text
stringlengths
28
935k
meta
stringlengths
137
139
red_pajama_subset
stringclasses
1 value
\subsection{State of the Art: overview of open problems} \par In an effort to evaluate the performance of UAVs in cellular networks many different types of studies have been performed, from analysis to simulator based, to actual experimental work. Several relevant overviews can be found in \cite{Tut18, azari2021evolution}. In this article, let us provide just a few of the most relevant works. An in-depth analysis of the performance of UAVs in a cellular network based on stochastic geometry provided in \cite{azari2019cellular}. Authors of \cite{rodriguez2021air} and \cite{bertold} characterized the UAV channels through dedicated measurement campaigns. All works listed above conclude that the antenna configuration at BSs should be considered when introducing aerial users to a cellular network as the antennas are pointed towards the ground generally. Other simulation-based research has proven that current LTE networks do not provide sufficient coverage at altitudes above building height, mainly due to interference problems \cite{colpaert2018aerial} and high handover rates \cite{colpaert2020beamforming}. Several measurement campaigns \cite{gharib2021exhaustive, Fakhreddine2019HandoverCF} showed satisfying results both in terms of coverage and handover rates. However, they were performed in rural areas where the BS density is much lower compared to an urban scenario. \textbf{Takeaways:} A high density of base stations results in high signal strengths but simultaneously high interference levels due to line-of-sight conditions. Moreover, the BS antennas are downtilted to optimize the ground coverage. Consequently, the problem of achieving a highly reliable connection with UAVs in an urban environment remains open due to i) limited coverage caused by high interference (growing with increasing flight altitude); ii) frequent handovers. \subsection{Multi-Operator Diversity as a Potential Solution} This article suggests a solution to increase the reliability of UAV communication links while requiring no modifications of the terrestrial cellular networks. Several studies have shown through network level measurements that equipping a UAV with multiple LTE modems to connect to different providers' networks will improve reliability and Quality of Service \cite{amorim2019improve,sae2020reliability,bacco2022airtoground}. Thus, we can assume that introducing network diversity improves the coverage and handover rates experienced by UAVs. Indeed, network infrastructure from different providers is deployed at different base station sites in the city\footnote{Even when the sites are shared (for instance the same mast can be used), the sector antennas are usually pointed differently. This is due to the need to optimize the performance under different underlying network topology.}. This feature reduces the probability of having a bad connection to all BSs at a given location of UAV. The price to pay is a slightly higher payload weight since the modern modems are quite compact. The size and weight can be reduced even further if a dedicated multi-connection module is designed. Another factor is an increased power consumption. However, a more stable connection results in less frequent modifications of the flight path \cite{7888557, Sibren19}. Note that power consumption of the communication modems is negligible in comparison with the propulsion energy \cite{7888557}. \subsection{Contributions} The main contributions of this work are: \begin{enumerate} \item We designed a realistic simulator taking into account \begin{itemize} \item real 3D environment including information about i) ground surface, ii) buildings and infrastructure; \item real cellular network parameters (e.g., BS locations, sector orientations, used power, etc.) reported by the Belgian operators to the government; \item 3D antenna patterns (with adaptable sidelobes); \item specific UAV channel models; \item users' mobility (UAVs). \end{itemize} \item We assessed potential effects of multi-operator diversity on i) coverage and ii) handovers. \end{enumerate} Note that in this work, we focus on a promising use case of drone delivery. UAV delivery will probably be performed at higher altitudes than other popular operations (e.g., patrolling) due to safety reasons. Though the higher altitude can result in more severe damage in case of malfunction, it gives a better time margin for the safety systems to act. For this reason we use altitudes higher than foreseen in \cite{ICAO}. Of course, the presented results are useful for other UAV applications when only the appropriate altitudes are analyzed. \section{Introduction} \input{intro} \section{Model} \label{sec:model} \par To model the scenario of drone deliveries, we consider drones flying in an urban environment at a fixed speed. They travel at constant altitudes ranging from just above rooftop level up to a maximum of 300~m above ground level. They fly in a straight line starting at a random point $A$ in the city to another random point $B$ representing the delivery address. The requirements for a network supporting these drones are twofold. On one side, only a low throughput link is necessary to monitor and control the UAV from a remote location. The requirement for this is a minimum Signal-to-Noise-Ratio (SINR). On the other hand, the link needs to be very reliable. Due to safety concerns, one cannot afford to lose connection to the UAV. The amount of handovers (HO) between sectors and radio link failures (RLF) will affect the time that the UAV is not connected to the network. \par For the location of our study, we choose the city of Leuven as the environment as this is the location of our university, and this allows us to verify our results even further in the future. \par We will evaluate the performance of the network using several metrics based on the SINR which is calculated at any 3D point $\vec{p}$ in the simulator as follows: \begin{equation} \label{eq:sinr_interference_noise} SINR (\vec{p}) = \frac{P_r(\vec{p},a)}{\sum^{A}_{i \neq a} P_{r, i}(\vec{p}) + N}, \end{equation} where $A$ represents the set of all sectors in the environment and $a$ represents the currently assigned sector, $N$ represents the noise power and is calculated as follows $N = BN_0F$, where $B$ is the bandwidth, $N_0$ is the noise density and $F$ is the noise figure. \par The metrics considered are the following: the first being coverage probability $P_{cov}$ calculated as the ratio of the area where the Signal-to-Interference-and-Noise-Ratio (SINR) is larger than a threshold (T) based on throughput requirements, $SINR > T$, divided by the total area. The second metric is the size of the largest continuous zone where no coverage exists in square kilometers, called the maximum outage zone $OUT_{max}$. This metric represents the importance of continuous coverage, large regions of outage results in the UAV being disconnected for long periods of time which is detrimental in a reliable network. \section{Simulations} \par To simulate the received powers at any 3D point, an improved version of the physical layer simulator developed in \cite{colpaert2018aerial, colpaert2020beamforming} is used. It uses a real 3D environment based on surface scans to create a virtual environment where assets like base stations and users can be deployed in a 3D space. The modified version includes realistic cellular network configurations as we detail in the following subsection. \subsection{Environment} The simulator requires several parameters based on the real world environment as input. First of all, terrain and surface information is required, as this affects the heights of the antennas and, more importantly, allows us to determine if a sector is in line of sight with a point. For this, the DHMV-dataset, see \cite{colpaert2018aerial}, is used and the considered environment is displayed in Fig.~\ref{fig:leuven_dsm_sectors}. \begin{figure} \centering \includegraphics[scale=0.6]{img/leuven/env.pdf} \caption{Digital Surface Model with sectors and simulation area indicated in red. The lines represent the sectors and their azimuth rotation and each color represents a different network.} \label{fig:leuven_dsm_sectors} \end{figure} \par Secondly, information about the location of the different base stations, their sectors, tilts, transmit powers and antennas needs to be known. For this, information from the Belgian Antenna Registry of the BIPT \cite{bipt-ant}, the organisation managing the spectrum in this environment, is combined with the database of \emph{declarations of conformity} issued by operators for each antenna site. These declaration documents contain all information about the hardware deployed at each antenna site and are used as input for the simulator. \par Thirdly, we used a 3D antenna pattern corresponding to the antennas used on the sites in the evaluated area \cite{huaweiantenna}. It is important to note that just like the real antenna, this antenna pattern has sidelobe suppression implemented meaning that the actual gain of the sidelobes is further reduces to improve power efficiency by reducing energy emitted towards the sky. \par Lastly, the used channel model is defined in \cite{3gpp2018enhanced} specifically for aerial vehicles. \subsection{Scenarios} \par Two different scenarios are simulated. One static scenario where all points on the map are evaluated at different altitudes, generating statistics of the area at different heights. Secondly, a mobile scenario is evaluated where a UAV travels a random path over the city populated by static ground users. In this scenario, we can evaluate handover behaviour and Radio-Link-Failure (RLF) occurrences of the network. \subsubsection{Static scenario} \par The first scenario's goal is to evaluate the statistics of the chosen city of Leuven and characterize the cellular network at different altitudes above ground level to give us some insight on how well a UAV can utilize the cellular network. Using the info of the environment and the general parameters used in a typical LTE deployment, see Table \ref{tab:general_simparams}, the simulator evaluates the channel model for every 3D point in the simulation area, and as such can calculate the received power from each sector at each 3D point. This happens for three different network operators (Op1, Op2 \& Op3). The base station sites of these operators can coincide. The received power from all sectors can be used to determine cell allocation and SINR levels. SINR levels can then be further used to calculate coverage. \par This characterization of the environment is performed for different operators. After combining all data, we can calculate the SINR at any point in a multi-operator network, as in \cite{nguyen2017using}: \begin{equation} \label{eq:sinr_max} SINR (\vec{p}) = \max\limits_{k}\Bigg(\frac{P_r(\vec{p},a)}{\sum^{A}_{i_k \neq a} P_{r, i_k}(\vec{p}) + N}\Bigg), \end{equation} where $k$ is the operator index. These SINR values can then be used to calculate the coverage as described in Section \ref{sec:model}. Using all the datapoints at a specific altitude we can also evaluate the area size of continuous outage zones and we can calculate the largest outage zone, $OUT_{max}$. \begin{table}[h!] \begin{center} \caption{Simulation Parameters} \label{tab:general_simparams} \begin{tabular}{|l|c|} \hline \textbf{Parameter} & \textbf{Value}\\ \hline Simulation area, & $9~km^2$\\ Resolution, & $5~m$\\ Carrier frequency, $f_c$& $1800~MHz$\\ Bandwidth, $B$ & $20~MHz$\\ Outage-threshold, $T$ & $-6~dB$\\ Noise density, $N_0$ \cite{3gppRadioFrequencyRF2018} & $-174~dBm/Hz$\\ Noise number, $F$ \cite{3gppRadioFrequencyRF2018} & $9~dB$\\ \hline \end{tabular} \end{center} \end{table} \subsubsection{Mobile scenario} \par Finally a second scenario is simulated to get more insight into the mobility characteristics of a multi-network approach. In \cite{colpaert2020beamforming}, the simulator was extended with the possibility to consider a moving drone that travels over a certain trajectory in three dimensional space and can hence experience changing network circumstances. They also implemented a simplified handover mechanism based on the \verb+A3+-event from the 4G- and 5G standards \cite{3gpp2021NR}. \par Alongside the handover event, there exists another event that could cause temporary disconnection and latency issues, the RLF event. When the UE detects problems in the connection it will wait for a specific timer (\verb+T310+ \cite{3gpp2021NR}) to run out and when the problem is not resolved at that time the UE will consider itself in RLF and begin the cell selection procedure again. The handover threshold and the RLF timer are network parameters that the operator can tweak on a per-UE basis. Because we want very low latency for drone applications, the following simulation uses a \verb+T310+ of $200~ms$. For the A3-threshold we take $-2~dB$ as in \cite{3gpp2018enhanced}. \par In a multi-network context the definitions are slightly different. First, a RLF is defined as an event when the user is not connected to any network. Secondly, a handover is defined as: \begin{itemize} \item One of the used networks has a HO and the other used networks are in RLF at that time; \item All used networks experience a handover within 1 second. \end{itemize} This period of $1~s$ is self-defined and is a measure for how robust one wants to protect the combined link against near simultaneous handovers. A longer period gives more margin, a shorter period assumes that the handover is correctly resolved when the other network starts a handover. The remainder of the simulation parameters can be found in Table \ref{tab:leuven_ho_stats}, refer to \cite{colpaert2020beamforming} for the full explanation of all the parameters. \begin{table}[h!] \begin{center} \caption{Handover Simulation Parameters} \label{tab:leuven_ho_stats} \begin{tabular}{|l|c|} \hline \textbf{Parameter} & \textbf{Value}\\ \hline Heights (AGL) $h$ & $20$~m, $40$~m, $80$~m, $160$~m\\ Drone velocity $v$ & $15~m/s$\\ Outage-threshold $T$ & $-6~dB$\\ A3 - Offset $T_{A3}$ & $2~dB$\\ RLF-timer \verb+T310+ & $200~ms$\\ Simulation timestep $\delta_t$ & $100~ms$\\ Number simulations & $5000$ \\ \hline \end{tabular} \end{center} \end{table} \section{Results} \par In this section, we look at the results generated by the simulations described above. We evaluate the metrics at different altitudes to get a better insight into the effect of drone height. We also draw the evaluations under different network loads, but we focus on the $100~\%$ network load as this is the worst-case scenario but the most important scenario when looking at the reliability of the communication link. \par First, we evaluate the coverage situation, followed by a study of the effects of using multiple operators. Next, we evaluate the handover results and verify whether using multiple networks results in an improvement in terms of handovers. \subsection{Coverage} \begin{figure}[] \centering \resizebox{0.9\linewidth}{!}{ \input{img/SINR/SINR_CDF-pxs} } \caption{CDF of the SINR of Operator 1 at different heights for a half or full network load. The vertical red line represent the coverage threshold. SINR levels below this threshold are considered as network outage. A network at half load has almost 100\% coverage up to an altitude of $160~m$.} \label{fig:leuven_sinr} \end{figure} \par The resulting statistics of the SINR for Operator 1 can be seen in Fig. \ref{fig:leuven_sinr} where the CDF of the SINR for different altitudes and loads is shown. To meet the requirements for downlink communications, UAVs must have a minimum SINR of $-6~dB$ \cite{colpaert2018aerial} for a command-and-control link. This is the coverage threshold $T$, below which the drone experiences a SINR that is too low to achieve successful communication. This is indicated by a vertical red line. \par The figure shows that as the drone flies higher, we can see that the density function shifts to the left, indicating that SINR values drop. One can also see that the curve becomes steeper indicating that the variance keeps decreasing with height: a very wide distribution at $20~m$ becomes much more concentrated at $160~m$. \par The effect of choosing a different outage threshold can be seen in Fig.~\ref{fig:leuven_cov_vs_threshold}, using the suggested threshold of $-6~dB$ results in a coverage probability of $0.74$ at an altitude of $160~m$. If a larger threshold is chosen the coverage probability drops drastically with $P_{cov}$ reaching zero at a threshold of $2~dB$ for an altitude of $160~m$. These results indicate the bad aerial coverage situation. \begin{figure} \centering \resizebox{0.9\linewidth}{!}{ \input{img/thresholds/thresholds-pxs} } \caption{Impact of the outage threshold, $T$, on the coverage probability, $P_{cov}$ at different altitudes under a $50\%$ or a $100\%$ network load.} \label{fig:leuven_cov_vs_threshold} \end{figure} \par In an effort to solve this coverage problem, we consider a connection with multiple networks at the same time. The SINR values in this network are calculated using \eqref{eq:sinr_max}. The coverage probability as a function of the drone altitude can be seen in Fig. \ref{fig:leuven_multi_cov}. When using one network operator, the probability stays one up until around $20~m$ height as the network is designed this way. However, we can see the coverage drops as soon as the UAV flies above rooftop height. In a multi-operator network we can see that the 100\% coverage reaches a much higher altitude. At an altitude of $100~m$ the coverage probability in a multi-operator network is still 0.99. This altitude is much more likely to be used by a drone network. Above this altitude the coverage drops again, albeit less than with one operator. The increase in coverage probability from using two compared to using three operators is less but can be considered for ultra-reliable systems. \begin{figure}[] \centering \resizebox{0.9\linewidth}{!}{ \begin{subfigure}{\linewidth} \input{img/multiop/multiop_cov-pxs} \caption{Coverage probability $P_{cov}$} \label{fig:leuven_multi_cov} \end{subfigure}} \resizebox{0.9\linewidth}{!}{ \begin{subfigure} {\linewidth} \input{img/multiop/multiop_outage-pxs} \caption{Maximum outage zone $OUT_{max}$} \label{fig:leuven_multi_outmax} \end{subfigure} } \caption{Impact of multi-operator diversity on the network performance. Using multiple cellular networks enables UAV connectivity at higher altitudes.} \end{figure} \par Fig. \ref{fig:leuven_multi_outmax} shows the $OUT_{max}$ as function of the altitude. Using a single operator results in relatively large outage zones, especially at altitudes above $100~m$. In a multi-operator scenario the size of the outage zones stays relatively small even at very large altitudes. A single operator network experiences much larger continuous outage zones than a two or three operator network. This can be explained by the fact that many of the antenna sites are different for the selection operators and even if they utilize the same antenna site they often deploy their sectors with different infrastructure, resulting in different azimuths, tilts, etc. \subsection{Handovers} \par The assignment map indicates which sector has the highest received power at each point. In Fig. \ref{fig:leuven_assmap} the assignment map of two operators at different altitudes is shown. Each color represents a sector, meaning that the color of a pixel determines which sector a user is assigned to at this location. One can observe that at $120~m$ height the assignment pattern is much more fragmented than the one at $20~m$ height. Due to the antenna sidelobes and nulls, UAVs at high altitudes will connect to sectors that are not necessarily the closest or they will alternate rapidly between multiple sectors. This will lead to higher handover frequency. These handovers result in throughput drops, where at these altitudes throughput is already a scarce resource. To build a reliable UAV communications network, reducing the number of handovers and Radio-Link-Failures is in the best of interest. \begin{figure} \centering \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\textwidth]{img/leuven/ass-pxs-20m.pdf} \caption{Operator 1, $20~m$} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\textwidth]{img/leuven/ass-pxs-120m.pdf} \caption{Operator 1, $120~m$} \end{subfigure} \vfill \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\textwidth]{img/leuven/ass-tnt-20m.pdf} \caption{Operator 2, $20~m$} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\textwidth]{img/leuven/ass-tnt-120m.pdf} \caption{Operator 2, $120~m$} \end{subfigure} \caption{Sector assignment map for two network operators at $20~m$ and $120~m$ height. Each color represents a different sector. The color of a pixel indicates which sector a user at this location is assigned to.} \label{fig:leuven_assmap} \end{figure} Fig. \ref{fig:leuven_assmap} also shows the difference in assignment patterns between two different operators. We can utilize this diversity to create a multi-operator network where when a handover needs to happen or when a RLF occurs, the user can always fall back on the other operator's network. \par The results can be neatly observed in the Fig. \ref{fig:handovers_results}. Fig. \ref{fig:handovers_time} shows the handover frequency experienced by a drone flying at certain altitudes. When looking at a single operator system, we can see that a drone flying at an altitude of $160~m$ experiences a median of five handovers, this is a handover every 12 seconds. It is clear that this will cause significant problems for the command and control link. In contrast, the multi operator systems experience approximately zero handovers at the same altitude, due to the network diversity. \par The same positive effect can be seen when monitoring the RLF duration. Fig. \ref{fig:rlf_dur} shows the duration a drone will not be connected to the network when it encounters a RLF. At an altitude of $160~m$ a drone using a single network will have a median disconnection time of $4~s$ when encountering a no-coverage zone. This is clearly not a desired situation. However, a drone connecting to multiple networks simultaneously can bring down this duration to a median of $1~s$. This shows the clear benefits for drones of connecting to multiple cellular networks at the same time. \label{sec:handovers} \begin{figure}[] \centering \resizebox{0.825\linewidth}{!}{ \begin{subfigure}{0.9\linewidth} \input{img/handovers/box_ho_min} \caption{Number of handovers per minute} \label{fig:handovers_time} \end{subfigure} } \resizebox{0.825\linewidth}{!}{ \begin{subfigure}{0.9\linewidth} \input{img/handovers/box_rlf_dur} \caption{Radio Link Failure duration} \label{fig:rlf_dur} \end{subfigure} } \caption{Impact of multi-operator diversity on the number of handovers and on the time spent disconnected due to RLF.} \label{fig:handovers_results} \end{figure} \section{Conclusion} \par In this article an application of multi-operator network diversity has been explored to improve the network conditions for UAVs in deployed mobile networks. The results indicate that the increase in performance is indeed significant: the coverage can be improved by 20\% even in the worst case scenario of full network load, while the size of the outage zones is up to ten times smaller, particularly for high altitudes, than for the separate networks, meaning that the drone will have less chance to be unreachable for a long time due to bad network conditions. The mobility characteristics can also be improved, the possible disconnection events can be reduced significantly, resulting in a better overall latency for the combined connection. \bibliographystyle{IEEEtran}
{'timestamp': '2022-02-21T02:18:42', 'yymm': '2111', 'arxiv_id': '2111.07637', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07637'}
arxiv
\section{Introduction} Reinforcement Learning (RL) considers an agent interacting with an unknown environment in a sequence of steps. At each of these steps, the agent must select an action. Consequently, the environment generates a reward and presents the agent with a new situation, also called a state. The goal of an agent is to maximise the cumulative sum of these rewards by learning the best action to take in each state. In this paper, we consider the episodic reinforcement learning problem. Here, the agent interacts with the environment in a sequence of episodes. Each episode consists of a fixed number of steps where the agent sees a state, selects an action, observes some reward and transitions to the next state. This feedback helps the agent to learn to take better decisions in the future. There exist many theoretically successful algorithms for episodic reinforcement learning \citep{REGAL, UCRL2, KLUCRL, UCRL2B, UCBVI, UBEV}. The majority of these are built under the assumption that the feedback is immediate or, at the very least, received at the end of each episode. This allows the agent to quickly learn about the quality of their decisions and adapt to take better actions. However, in many practical settings, feedback is not immediate. Instead, it is received only after some delay. This can occur due to the nature of the environment or for computational reasons. Examples of the former arise in healthcare, finance and online recommender systems. Here, the outcome of a treatment protocol, particular investment strategy or sequence of recommendations often returns at some unknown time in the future. Autonomous vehicles or wearable technology is an example of the latter, where heavy computation may occur on a separate machine meaning that the agent only receives the feedback at some later point in time. Currently, there is little theoretical understanding of the impact of delays on the regret of reinforcement learning algorithms. \subsection{Contributions} In this paper, we study the impact of stochastic delays on the regret of optimistic reinforcement learning algorithms in episodic Markov Decision Processes (MDPs). We propose two procedures for dealing with delayed feedback, which we call active and lazy updating. In the active updating procedure, a base algorithm updates the policy as soon as feedback is received. We show that this updating scheme leads to an additive increase in regret for a broad class of algorithms (the so-called 'optimistic' model-based algorithms). This additive penalty depends on the expected delay and the base algorithm of choice. The lazy updating protocol uses the \textit{doubling trick} and waits for the observed visits to a state-action-step to double before computing a new policy. We show that this leads to an additive increase in regret that depends on the expected delay and is independent of the chosen optimistic model-based algorithm, in some cases leading to improved results. \subsection{Related Work} \paragraph{Delays in Bandits} Stochastically delayed feedback has received much attention in the simpler multi-armed bandit and contextual bandit problems \citep{AA2011, PJ2013, CV2017, AM2020, MD2011, CV2020}. The results in the multi-armed bandit setting show delayed feedback causes an additive penalty in the regret that scales with the number of actions and the expected delay. Thus, we can expect a similar result in the harder episodic RL problem. However, dealing with delays in RL is more challenging than in the (contextual) bandit setting. Indeed in RL, since the environment is stochastic and changes depending on the actions taken, we cannot guarantee to observe a particular state nor the effects of taking a particular action. Consequently, this means that approaches such as the queuing technique of \cite{PJ2013} cannot easily be applied. \paragraph{Delays in RL} Despite being of practical importance, there is limited literature on stochastically delayed feedback in RL. Previous work has considered constant delays in observing the current state in an MDP \citep{KVK2003}. However, the challenges in this setting are somewhat different to that of delayed feedback. More recently, \cite{DAMDP} considered delayed feedback in adversarial MDPs. They consider adversarial delays and develop algorithms based on policy optimisation whose regret depends on the sum of the delays, the number of states and the number of steps per episode. For stochastic MDPs and adversarial delays, they also state that the regret will be increased by an additive term in the regret bound of order: $H^4 SA \tau_{\max}$ when all delays are less than $\tau_{\max}$ almost surely. In our paper, we consider stochastic delays and show that it is only the expected delay, which is often considerably smaller than the maximal delay, that impacts the regret. \section{Preliminaries} In this paper, we consider the task of learning to act optimally in an unknown episodic finite-horizon Markov Decision Process, EFH-MDP. We focus on the case where there is a delay between playing an episode and observing the sequence of states, actions and rewards sampled by the \textit{agent}; we refer to this sequence as feedback throughout this paper. \subsection{Episodic Finite-Horizon MDPs} \label{sec: EFH-MDP} An EFH-MDP is formalisable as a quintuple: $M = \left(\mathcal{S}, \mathcal{A}, H, P, R\right)$. Here, $\mathcal{S}$ is the set of states, $\mathcal{A}$ is the set of actions, $H$ is the horizon and gives the number of steps per episode, $P = \{P_{h}(\cdot \vert s, a)\}_{h, s, a}$ is the set of probability distributions over the next state and $R = \{R_{h}(s, a)\}_{h, s, a}$ is the set of reward functions. For conciseness, we assume that the reward function is known, deterministic and bounded between zero and one for all state-action-step triples.\footnote{The main challenge in model-based reinforcement learning lies in estimating the transition function. Thus, an extension to unknown bounded stochastic rewards is relatively straightforward.} In the episodic reinforcement learning problem, an algorithm interacts with an MDP in a sequence of episodes: $k = 1, 2, \dots, K$. We denote the set of episodes by: $[K] = \{1, 2, \dots K\}$; a convention that we adopt for sets of integers. In each of the episodes, the learner takes a fixed number of steps, $H$. At the start of the $k^\text{th}$ episode, the environment samples an initial state: $s_{1}^{k}$. The learner can use all available information to select a sequence of $H$ actions from this initial state. We consider algorithms that compute a deterministic policy $\pi_k: \mathcal{S}\times [H]\rightarrow \mathcal{A}$ at the start of each episode $k\in[K]$. One can show that if an optimal policy exists, there is a deterministic optimal policy \citep{MP1994}. The agent samples feedback from the environment by: selecting an action, $a_{h}^{k} = \pi_{k}(s_{h}^{k}, h)$; receiving a reward, $r_{h}^{k} = R_{h}(s_{h}^{k}, a_{h}^{k})$; and transitioning to the next state, $s_{h + 1}^{k} \sim P_{h}(\cdot \vert s_{h}^{k}, a_{h}^{k})$; for each $h = 1, \cdots ,H$. The feedback of the $k^\text{th}$ episode is given by $\{(s_{h}^{k}, a_{h}^{k}, r_{h}^{k}, s_{h + 1}^{k})\}_{h=1}^H$. In the standard episodic reinforcement learning setting, this feedback is received immediately. In this paper, we will consider the setting where this feedback is received after some stochastic delay which will be formally introduced in Section \ref{sec: delayed feedback}. We measure the quality of a policy, $\pi$, using the value function, which is the expected return at the end of the episode from the current step, given the current state: \begin{equation}\label{eqn: value function} V^{\pi}_{h}\left(s\right) = \mathbb{E}_{\pi}\left[\,\sum_{h' = h}^{H} r_{h'}^{k} \Big\vert s_{h'}^{k} = s\right]\;. \end{equation} Further, we denote the optimal value function by: $V^{*}_{h}(s) = \max_{\pi} \{V^{\pi}_{h}(s)\}$, which gives the maximum expected return $\forall (s, h)\in\mathcal{S}\times [H]$. When evaluating a learning algorithm, it is common to use regret. The regret measures the expected loss in rewards over a fixed number of $K$ episodes as a result of following (possibly) sub-optimal policies $\pi_1,\dots, \pi_K$: \begin{equation}\label{eqn: regret} \mathfrak{R}_{T} = \sum_{k = 1}^{K}V^{*}_{1}\left(s_{1}^{k}\right) - V^{\pi_{k}}_{1}\left(s_{1}^{k}\right) = \sum_{k = 1}^{K}\Delta_{1}^{k}\;. \end{equation} where $T = KH$ denote the total number of steps taken in the EFH-MDP. \cite{TDMDPLB} show that the lower bound for the regret in the standard episodic reinforcement learning setting with stage-dependent transitions is: $\Omega(H\sqrt{SAT})$. \subsection{Regret Minimisation in RL} Many provably efficient algorithms exist for learning EFH-MDPs when feedback is immediate. In this paper, we focus on optimistic model-based reinforcement learning algorithms. These algorithms maintain estimators of the transition probabilities for each $(s, a, s')\in\mathcal{S}\times\mathcal{A}\times\mathcal{S}$:\footnote{Throughout: $x\lor y = \max\{x, y\}$ and $x\land y \min\{x, y\}$.} \begin{align*} \hat{P}_{kh}\left(s'\vert s, a\right) = \frac{\sum_{i: i < k}\mathds{1}\left\{\left(s_{h}^{i}, a_{h}^{i}, s_{h + 1}^{i}\right) = \left(s, a, s'\right)\right\}}{1\lor N_{kh}\left(s, a\right)} \end{align*} where \begin{align} N_{kh}\left(s, a\right) &= \sum_{i: i < k}\mathds{1}\left\{\left(s_{h}^{i}, a_{h}^{i}\right) = \left(s, a\right)\right\}\label{eqn: total visitation counter} \end{align} is the total number of visits to the given state-action-step triple before the $k^\text{th}$ episode. In this paper, we consider the model-based algorithms that compute an optimistic value function of the form: \begin{align} \tilde{V}_{h}^{\pi_{k}} = \min\{H - h + 1, R_{h} + \big\langle \hat{P}_{kh}, \tilde{V}_{h + 1}^{\pi}\big\rangle + \beta_{kh}\}\label{eqn: optimistic value function} \end{align} with high probability, where $\beta_{kh}(s, a)$ is an exploration bonus whose general form is given by: \begin{align} \beta_{kh}\left(s, a\right)&=\min \Bigg\{\beta_{kh}^{*}(s, a), H - h\Bigg\}\label{eqn: exploration bonus}\\ \beta_{kh}^{*}\left(s, a\right) &= \frac{C_{kh}}{\sqrt{1\lor N_{kh}\left(s, a\right)}} + \frac{B_{kh}}{1\lor N_{kh}\left(s, a\right)} \nonumber \end{align} Here, $C_{kh}$ and $B_{kh}$ are algorithm-dependent quantities. Naturally, the value-optimistic algorithms compute value functions of this form. Examples of value-optimistic algorithms include: UBEV, UCBVI-CH, UCBVI-BF \citep{UBEV, UCBVI}. However, recent work proved that model-optimistic algorithms share this form too \citep{PB2020}. Some model-optimistic algorithms include: UCRL2, KL-UCRL and UCRL2B \citep{UCRL2, KLUCRL, UCRL2B}. For UCRL2, $C_{kh} = H\sqrt{S\log(SAT/\delta)}$ and $B_{kh} = 0$ \citep{PB2020}. Throughout this paper, we make use of the following assumption: \begin{assumption}\label{assumption: estimation error bonus} The exploration bonus upper bounds the estimation error: $\beta_{kh}(s, a) \geq \langle (\hat{P}_{kh} - P_{h})(\cdot\vert s, a), \tilde{V}^{\pi_{k}}_{h + 1}(\cdot)\rangle$ for all $(k, h)\in \times[K]\times[H]$. \end{assumption} Using Assumption \ref{assumption: estimation error bonus}, we can upper bound the regret by \citep{PB2020}: \begin{align} \mathfrak{R}_{T} &\leq 2H\sqrt{T\log\left(\frac{K\pi}{6\delta'}\right)} + 2\sum_{k = 1}^{K}\sum_{h = 1}^{H} \beta_{kh}\left(s_h^k, a_h^k\right)\label{eqn: regret upper bound} \end{align} with probability $1 - \delta'$. See Proposition \ref{lemma: regret decomposition} of Appendix \ref{sec: recursive regret} for proof of this claim. \subsection{The Importance of Counts}\label{sec: importance of counts} From Equation \eqref{eqn: regret upper bound}, it is clear that upper bounding the sum of the bonuses leads to an upper bound on the regret. Bounding the sum of bonuses involves upper bounding the sum of: $1/\sqrt{N_{kh}(s, a)}$ and $1/N_{kh}(s, a)$ over all steps and episodes. After rearranging these summations to get indicator functions in the numerators, standard techniques show that: \begin{align} \sum_{s, a, h}\sum_{k = 1}^{K} \frac{\mathds{1}\left\{s_{h}^{k} = s, a_{h}^{k} = a\right\}}{\sqrt{1\lor N_{kh}\left(s, a\right)}} &\leq 2\sqrt{HSAT}\label{eqn: p = 1/2 summation}\\ \sum_{s, a, h}\sum_{k = 1}^{K} \frac{\mathds{1}\left\{s_{h}^{k} = s, a_{h}^{k} = a\right\}}{1\lor N_{kh}\left(s, a\right)} &\leq HSA\log\left(8T\right)\label{eqn: p = 1 summation} \end{align} The result follows from realising that the term in the denominator increases by one whenever the indicator in the numerator is equal to one. Appendix \ref{sec: appendix importance of counts} gives full details of the bounds in \eqref{eqn: p = 1/2 summation} and \eqref{eqn: p = 1 summation}. Consequently, any algorithm that satisfies Assumption \ref{assumption: estimation error bonus} has a regret bound of the form: $C\sqrt{HSAT} + BHSA\log(T)$. \section{Delayed Feedback}\label{sec: delayed feedback} To model problems where feedback returns at some unknown time in the future, we introduce a random variable for the delay between playing the $k^\text{th}$ episode and observing the corresponding feedback, which we denote by $\tau_k$. Throughout this paper, we make the following assumption on the delays: \begin{assumption}\label{assumption: delays} The delays are positive, independent and identically distributed random variables with finite expectation. Denoting the delay of the $k^\text{th}$ episode by $\tau_{k}$, we require: $\tau_{k} \stackrel{iid}{\sim} f_{\tau}(\cdot)$, $\mathbb{P}(\tau < 0) = 0$ and $\mathbb{E}[\tau] < \infty$. \end{assumption} As a consequence of the delays, the feedback associated with an episode does not return immediately. Instead, it returns at some unknown time in the future: $k + \tau_{k}$. Therefore, the base algorithm only makes use of the feedback associated with the $k^\text{th}$ episode at the start of the episode: $\ceil{k + \tau_{k}} + 1$. When working with delayed feedback in RL, it is helpful to introduce the observed and missing visitation counters, and their relationship with the total visitation counter: \begin{align} N_{kh}'\left(s, a\right) &= \sum_{i: i + \tau_{i} < k}\mathds{1}\left\{\left(s_{h}^{i}, a_{h}^{i}\right) = \left(s, a\right)\right\}\label{eqn: observed visitation counter}\\ N_{kh}''\left(s, a\right) &= \sum_{i: i + \tau_{i} \geq k}\mathds{1}\left\{\left(s_{h}^{i}, a_{h}^{i}\right) = \left(s, a\right)\right\}\label{eqn: missing visitation counter}\\ \underbrace{N_{kh}\left(s, a\right)}_{\text{total visits}} &= \underbrace{N_{kh}'\left(s, a\right)}_{\text{observed visits}} + \underbrace{N_{kh}''\left(s, a\right)}_{\text{missing visits}} \label{eqn: visitation counter relationships} \end{align} Analogously to \eqref{eqn: observed visitation counter} we define \begin{align} N_{kh}'\left(s, a, s'\right) &= \sum_{i: i + \tau_{i} < k}\mathds{1}\left\{\left(s_{h}^{i}, a_{h}^{i}, s_{h + 1}^{i}\right) = \left(s, a, s'\right)\right\}\label{eqn: observed transition counter} \end{align} allowing for the estimation of transition probabilities. Instead of the total-visitation count, model-based optimistic algorithms can only compute their bonuses using the observed visitation counter. The corresponding value functions are still optimistic, but they will contract to the optimal value function more slowly. From Equation \eqref{eqn: regret upper bound}, it is clear that we can control the regret by controlling the bonuses. With delayed feedback, bounding the bonus terms is more difficult since the observed visitation count can remain constant across numerous episodes. Therefore, \eqref{eqn: p = 1/2 summation} and \eqref{eqn: p = 1 summation} do not upper bound the equivalent summations involving the observed visitation counters. One approach to delaying with delayed feedback would be to maintain numerous versions of the base algorithm and bound their regret separately using the standard techniques \citep{DAMDP}. To do so would require one to maintain $\tau_\text{max} + 1$ versions of the algorithm, where $\tau \leq \tau_{\max}$ almost surely. Consequently, the regret of this approach would would scale the regret of the base algorithm by the maximal delay. In addition to being highly inefficient from a space-complexity perspective, in cases where the delay distribution has infinite support or the bound on its distribution is large, this approach can have regret that is linear in the total number of steps, $T$. Further, $\tau_{\max}$ can be large in comparison to the expected delay. In Sections \ref{sec: active updating} and \ref{sec: lazy updating}, we show that it is possible to obtain regret bounds scaling with the expected delay rather than the maximal delay. \subsection{Bounding the Missing Episodes} In Sections \ref{sec: active updating} and \ref{sec: lazy updating}, we propose two procedures for dealing with delayed feedback in episodic RL: one based on updating as soon as new data becomes available and the other based on updating less frequently. In either case, we can bound the number of missing visits to each state-action-step triple by the number of missing episodes. The reasoning behind this due to the agent playing only one state-action pair per step in each episode. \begingroup \allowdisplaybreaks \begin{restatable}{lemma}{delaylemma} \label{lemma: delay failure event} Let $S_{k} = \sum_{i = 1}^{k - 1}\mathds{1}\{i + \tau_{i}\geq k\}$, where $\tau_{1}, \tau_{2}, \cdots \tau_{k - 1} \sim f_{\tau}(\cdot)$ are independent and identically distributed random variables with finite expected value. Further, let: \begin{align*} F_{k}^{\tau} = \left\{S_{k} \geq \mathbb{E}\left[\tau\right] + \log\left(\frac{K\pi}{6\delta'}\right) + \sqrt{2\mathbb{E}\left[\tau\right]\log\left(\frac{K\pi}{6\delta'}\right)}\right\} \end{align*} be the failure event for a single $k$. Then, $\mathbb{P}(F_{\tau}) = \mathbb{P}(\cup_{k = 1}^{\infty} F_{k}^{\tau}) \leq \delta'$. \end{restatable} \begin{proof} The proof follows from applying Bernstein's inequality to the sum of indicator random variables. See Lemma \ref{lemma: delay failure event} of Appendix \ref{sec: useful lemmas} for a full proof. \end{proof} A direct consequence of this lemma is an upper bound on the number of missing episodes: \begin{align*} S_{k} \leq \psi_{K}^{\tau}\coloneqq \mathbb{E}\left[\tau\right] + \log\left(\frac{K\pi}{6\delta'}\right) + \sqrt{2\mathbb{E}\left[\tau\right]\log\left(\frac{K\pi}{6\delta'}\right)} \end{align*} which holds across all $k \in \mathbb{Z}^{+}$ with probability $1 - \delta'$. \section{Active Updating}\label{sec: active updating} We first consider the effect of delays on the regret when we update the policy as soon as new data becomes available. This procedure is outlined in Algorithm \ref{alg: Active Algorithm}. We assume we have some base algorithm which takes all available data and outputs an optimistic policy. \begin{algorithm}[!htp]\label{alg: Active Algorithm} \DontPrintSemicolon Initialise visitation counter: $N_{1h}'\left(s, a\right) = 0$\\ Initialise transition counter: $N_{1h}'\left(s, a, s'\right) = 0$\\ Initialise the policy: $\pi_1 = Base\left(\{N'_{1h}\}_{h}\right)$\\ \For{$k = 1, 2, \cdots, K$}{ \uIf{$\exists\: i:i + \tau_{i} = k - 1$}{ Update visitation counters: \eqref{eqn: observed visitation counter} and \eqref{eqn: observed transition counter}.\\ Compute policy: $\pi_k = Base\left(\{N'_{kh}\}_{h}\right)$} \uElse{ Reuse old policy: $\pi_k = \pi_{k - 1}$} Sample an episode using policy: $\pi_{k}$.} \caption{Active Updating} \end{algorithm} \begin{theorem}[Active Updating]\label{theorem: active updating} Under Assumption \ref{assumption: estimation error bonus}, with probability $1 - \delta$, the regret of any model-based algorithm under delayed feedback is upper bounded by: \begin{align*} \tilde{\mathcal{O}}\left(C\sqrt{HSAT} + BHSA + \max\left\{C, B\right\}HSA\mathbb{E}\left[\,\tau\right]\right)\,, \end{align*} where $C$ and $B$ are universal upper bounds on the algorithm-dependent quantities in the exploration bonus of \eqref{eqn: exploration bonus}. \end{theorem} The second column of Table \ref{tab: algorithms} presents regret bounds for various optimistic algorithms using active updating under delayed feedback that fit into our framework. \subsection{Bounding the Observed Visitation Counter} From Equation \eqref{eqn: regret upper bound}, it is clear that we must bound the summation of the bonuses. In the standard setting, one can use the fact that the total visitation counter increases by one between successive plays of a state-action-step triple. However, this is not the case in the delayed feedback setting. The following lemma provides an upper bound on summations in the form of the bonuses calculated using the observed visitation counter, albeit without the terms in the numerator. \begin{restatable}{lemma}{summationbound} \label{lemma: summation bound} Let $Z_{T}^{p} = \sum_{k = 1}^{K}\sum_{h = 1}^{H} 1/(N_{kh}'(s_h^k, a_h^k))^p$. Then, with probability $1 - \delta'$: \begin{align*} Z_T^p &\leq \begin{cases} 4\sqrt{HSAT} + 3HSA\psi_{K}^{\tau} & \text{if } p = \frac{1}{2}\\ 2HSA \log\left(8T\right) + HSA\psi_{K}^{\tau}\log(16\psi_{K}^{\tau}) & \text{if } p = 1\\ \end{cases} \end{align*} \end{restatable} \begin{proof} Unless otherwise stated, we let: $N_{kh}(s, a) = 1\lor N_{kh}(s, a)$ and $N_{kh}'(s, a) = 1\lor N_{kh}'(s, a)$ for notational convenience. First, we use the relationships between the observed, missing and total visitation counters to split the summation into two parts in a similar manner to \cite{DAMDP}: \begin{align*} Z_{T}^{p}&=\sum_{k = 1}^{K}\sum_{h = 1}^{H} \left(\frac{1}{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p} = \sum_{k, h}\left(\frac{1}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p} \left(\frac{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)}{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p} \end{align*} From Equation \eqref{eqn: visitation counter relationships}, $N_{kh}(s, a) = N_{kh}'(s, a) + N_{kh}''(s, a)$, for any $(s, a, h)\in \mathcal{S}\times \mathcal{A}\times [H]$.Consequently, \begin{align*} Z_{T}^{p} &\leq \underbrace{\sum_{k, h}\left(\frac{1}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p}}_{A} + \underbrace{\sum_{k, h}\left(\frac{1}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)} \frac{N_{kh}''\left(s_{h}^{k}, a_{h}^{k}\right)}{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p}}_{B}, \end{align*} since $(1+x)^p \leq 1 + x^p$ for $p = 1/2$ and $p = 1$ and any $x>0$. Term $A$ is the summation of the total visitation counter seen in the non-delayed setting and so can be bounded using e.g. Equations \eqref{eqn: p = 1/2 summation} and \eqref{eqn: p = 1 summation}. Bounding $B$ requires more care, as it involves the observed and missing visitation counters. Recall that the algorithm plays one state-action pair at each step in every episode. Thus, the missing visitation counter is upper bounded by the number of missing episodes: $N_{kh}''(s, a) \leq S_k$. Lemma \ref{lemma: delay failure event} bounds the number of missing episodes: with probability $1 - \delta'$, $S_{k} \leq \psi_{K}^{\tau}$ across all $k \in \mathbb{Z}^{+}$. Splitting $B$ using the observed visitation counts and the upper bound on $S_k$ gives: \begingroup \allowdisplaybreaks \begin{align*} B &\leq \sum_{k, h}\left(\frac{\mathds{1}\left\{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right) \geq \psi_{K}^{\tau}\right\}\psi_{K}^{\tau}}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)} \right)^{p}\nonumber + \sum_{k, h}\left(\frac{\mathds{1}\left\{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right) \leq \psi_{K}^{\tau}\right\}\psi_{K}^{\tau}}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right) N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)} \right)^{p}\nonumber\\ &\leq \underbrace{\sum_{k, h}\left(\frac{\mathds{1}\left\{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right) \geq \psi_{K}^{\tau}\right\}}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)} \right)^{p}}_{B.1} + \underbrace{\sum_{k, h}\left(\frac{\mathds{1}\left\{N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right) \leq \psi_{K}^{\tau}\right\}\psi_{K}^{\tau}}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)N_{kh}'\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p}}_{B.2} \end{align*} \endgroup The last inequality follows since for the first sum, $N_{kh}'(s, a) \geq \psi_{K}^{\tau}$. Clearly, $B.1 \leq A$, as it is a summation over a subset of all the episodes. Using \eqref{eqn: visitation counter relationships}, it is possible to rewrite the indicator in the remaining term as: $\mathds{1}\{N_{kh}(s, a) - N_{kh}''(s, a) \leq \psi_{K}^{\tau}\}$, for any $(s, a, h)\in \mathcal{S}\times \mathcal{A}\times [H]$. Further, $N_{kh}''(s, a) \leq \psi_{K}^{\tau}$ and $N_{kh}'(s, a) \geq 1$. Therefore, \begin{align*} B.2 &\leq (\psi_{K}^{\tau})^{p} \sum_{k, h} \left(\frac{\mathds{1}\left\{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right) \leq 2\psi_{K}^{\tau}\right\}}{N_{kh}\left(s_{h}^{k}, a_{h}^{k}\right)}\right)^{p} \leq (\psi_{K}^{\tau})^{p}\sum_{s, a, h}\sum_{n = 0}^{2\psi_{K}^{\tau}}\frac{1}{(1\lor n)^p} \end{align*} Lemma \ref{lemma: p-series} of Appendix \ref{sec: appendix importance of counts} gives an upper bound of: $\sum_{n = 0}^{N}1/(1\lor n)^p$. Summing this upper bound over all state-action-step triples gives: \begin{align*} B.2 \leq \begin{cases} 3HSA\psi_{K}^{\tau} & \text{if } p = \frac{1}{2}\\ HSA\psi_{K}^{\tau}\log\left(16\psi_{K}^{\tau}\right) & \text{if } p = 1 \end{cases} \end{align*} Therefore: \begin{align*} Z_{T}^{p} &\leq 2A + B.2 \leq \begin{cases} 4\sqrt{HSAT} + 3HSA\psi_{K}^{\tau} & \text{if } p = \frac{1}{2}\\ HSA\left(2\log\left(8T\right) + \psi_{K}^{\tau}\log\left(16\psi_{K}^{\tau}\right)\right) & \text{if } p = 1 \end{cases} \end{align*} as required. \end{proof} \subsection{Proof of Theorem \ref{theorem: active updating}}\label{sec: proof thm 1} Using Lemma \ref{lemma: delay failure event} and \ref{lemma: summation bound}, we can bound the regret of optimistic model-based algorithms using active updating to handle the delayed feedbacks. \begin{proof} We split the regret into two sets of episodes based on whether their feedback is returned before the beginning of the final episode: \begin{align*} \mathfrak{R}_{T} =\sum_{k=1}^K \Delta_{1}^{k} \mathds{1}\left\{k + \tau_{k}\geq K\right\}+\Delta_{1}^{k} \mathds{1}\left\{k + \tau_{k}< K\right\}\;. \end{align*} Trivially, the regret of each of the first set of episodes can be bounded by the horizon, $H$. Lemma \ref{lemma: delay failure event} gives an upper bound on the number of missing episodes. Therefore, with probability $1 - \delta'$: \begin{align*} \sum_{k = 1}^{K}\Delta_{1}^{k} \mathds{1}\left\{k + \tau_{k} \geq K\right\} \leq H\psi_{K}^{\tau}\;. \end{align*} For the second set of episodes, we bound the regret by summing the bonuses. Using Equation \eqref{eqn: regret upper bound}: \begin{align*} \sum_{k = 1}^{K}\Delta_{1}^{k} \mathds{1}\left\{k + \tau_{k} < K\right\} \leq 2H\sqrt{T\log\left(\frac{K\pi}{6\delta'}\right)} + 2\sum_{k = 1}^{K}\sum_{h = 1}^{H}\beta_{kh}\left(s_h^k, a_h^k\right) \end{align*} Therefore, all that remains is to bound the sum of the exploration bonuses. To do so, we let $C \geq C_{kh}$ and $B \geq B_{kh}$ be universal upper bounds on the numerators in the exploration bonus. Then, the sum of the exploration bonuses has the following upper bound: \begin{align*} \sum_{k = 1}^{K}\sum_{h = 1}^{H}\left(\frac{C}{\sqrt{1\lor N_{kh}'\left(s_h^k, a_h^k\right)}} + \frac{B}{1\lor N_{kh}'\left(s_h^k, a_h^k\right)}\right) \end{align*} An application of Lemma \ref{lemma: summation bound} shows that the regret from summing the bonuses is upper bounded by: \begin{align*} &\sum_{k = 1}^{K}\sum_{h = 1}^{H}\beta_{kh}\left(s_{h}^{k}, a_{h}^{k}\right) \leq 4C\sqrt{HSAT} + 6CHSA\psi_{K}^{\tau} + 2BHSA\log\left(8T\right) + BHSA\psi_{K}^{\tau}\log\left(16\psi_{K}^{\tau}\right) \end{align*} Bringing everything together gives an upper bound on the regret: \begin{align*} \mathfrak{R}_{T} &\leq 2H\sqrt{T\log\left(\frac{K\pi}{6\delta'}\right)} + 8C\sqrt{HSAT} + 4BHSA\log\left(8T\right)+ 12CHSA\psi_{K}^{\tau} + 2BHSA\psi_{K}^{\tau}\log\left(16\psi_{K}^{\tau}\right) \end{align*} Rescaling $\delta' = \delta/(9 + 1)$ to accommodate for the additional failure event from Lemma \ref{lemma: delay failure event} gives the final result. \end{proof} \begin{table*}[ht] \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{l l l l l} \toprule \textbf{Algorithm} & $\mathfrak{R}_{T}$ (Active Updating) & $\mathfrak{R}_{T}$ (Lazy Updating)\\ \midrule UBEV & $\sqrt{H^3 SAT L} + H^2 SA L^{1/2} \mathbb{E}\left[\tau\right]$ & $\sqrt{H^3 SAT L} + H^2 SA \mathbb{E}\left[\tau\right]L_K$\\ % UCRL2 & $\sqrt{H^3 S^2 AT L} + H^2 S^{3/2} A L^{1/2} \mathbb{E}\left[\tau\right]$ & $\sqrt{H^3 S^2 AT L} + H^2 SA \mathbb{E}\left[\tau\right]L_K$\\ % KL-UCRL & $\sqrt{H^3 S^2 AT L} + H^2 S^{3/2} A L^{1/2 }\mathbb{E}\left[\tau\right]$ & $\sqrt{H^3 S^2 AT L} + H^2 SA \mathbb{E}\left[\tau\right]L_K$\\ % $\chi^{2}$-UCRL & $\sqrt{H^3 S^2 AT L^2} + H^2 S^2 A L_T + H^2 S^2 A \mathbb{E}\left[\tau\right]$ & $\sqrt{H^3 S^2 AT L^2} + H^3 S^3 A^2 L_K + H^2 S A \mathbb{E}\left[\tau\right]L_K$\\ % UCRL2B & $\sqrt{H^3 \Gamma S AT L^2} + H^2 S^2 A L L_T + H^2 S^2 A L \mathbb{E}\left[\tau\right]$ & $\sqrt{H^3 \Gamma S AT L^2} + H^3 S^3 A^2 L L_K + H^2 S A \mathbb{E}\left[\tau\right]L_K$\\ \bottomrule \end{tabular} } \caption{A selection of algorithms that fit into our framework and their regret bounds under delayed feedback. Here, $\Gamma \leq S$ is a uniform upper bound on the number of reachable states at a subsequent step. Further, $L_T = \log(8T)$, $L_K = \log (K/SA)$, and $L = \log(S, A, H, K, \delta')$ arises from the failure events of the chosen base algorithm.} \label{tab: algorithms} \end{table*} \section{Lazy Updating}\label{sec: lazy updating} In Section \ref{sec: active updating}, we derived regret bounds for a wide range of model-based algorithms using optimism. Although the active updating scheme does maintain good theoretical guarantees, a slower approach to updating can lead to improved regret bounds in some cases. Briefly, we consider waiting until the observed visits to a state-action-step double before updating the policy. Algorithm \ref{alg: Lazy Algorithm} presents the pseudo-code for this slower approach to updating.\\ \begin{theorem}[Lazy Updating]\label{theorem: lazy updating} Under Assumption \ref{assumption: estimation error bonus}, for $T\geq HSA$, with probability $1 - \delta$, the regret of any model-based algorithm under delayed feedback has the following upper bound: \begin{align*} \mathcal{O}\left(C\sqrt{HSAT} + B\left(HSA\right)^2 L_K + H^2 SAL_K\mathbb{E}\left[\tau\right]\right) \end{align*} where $L_{K} = \log(K/SA)$, $C$ and $B$ are universal upper bounds on the algorithm-dependent quantities in the exploration bonus of \eqref{eqn: exploration bonus}. \end{theorem} Theorem \ref{theorem: lazy updating} shows that the delay dependency is independent of the base algorithm. The third column of Table \ref{tab: algorithms} gives regret bounds for various algorithms using lazy updating to handle delayed feedback. \begin{algorithm}\label{alg: Lazy Algorithm} \DontPrintSemicolon Set $k = 1$\\ Set $j = 1$ \tcp{initialise first epoch} Set $k_{j} = k$ \tcp{starting time of first epoch} Initialise visitation counter: $N_{k_{j}h}'\left(s, a\right) = 0$\\ Initialise transition counter: $N_{k_{j}h}'\left(s, a, s'\right) = 0$\\ Initialise the policy: $\pi_k = Base\left(\{N_{k_j h}'\}_h\right)$\\ \For{$k = 1, 2, \cdots, K$}{ Update the within epoch counter: \eqref{eqn: within epoch counter}\\ \uIf{$\exists \,s, a, h: N_{k_{j} h}'(s, a) = n_{jh}^k(s, a)$}{ Start new epoch: $j = j + 1$; $k_{j} = k$\\ Update visitation counters: \eqref{eqn: observed visitation counter} and \eqref{eqn: observed transition counter}\\ Compute policy: $\pi_j = Base\left(\{N_{kh}'\}_h\right)$} Sample an episode using policy: $\pi_{k} = \pi_j$.} \caption{Lazy Updating} \end{algorithm} \subsection{The Doubling Trick} Instead of updating as soon as the algorithm sees feedback, we consider waiting until the observed visits to a state-action-step triple have doubled. Each update marks the start of an epoch, which we denote by: $j = 1, 2, \cdots, J$. At the start of each epoch, the base algorithm computes a policy and uses it to sample feedback from the MDP. Therefore, each epoch is just a set of episodes where the algorithm interacts with the environment using the same policy. Let $k_{j}$ denote the episode where the $j^\text{th}$ epoch starts. Then, the number of visits to each state-action-step triple that are observed while playing the $j^\text{th}$ epoch is simply: \begin{align} n_{jh}^{k}\left(s, a\right) \coloneqq \sum_{i = 1}^{k - 1}\mathds{1}\left\{s, a, h, k_{j} \leq i + \tau_{i} < k\right\}\label{eqn: within epoch counter} \end{align} where $\mathds{1}\{s, a, h\} = \mathds{1}\{s_{h}^{k} = s, a_{h}^{k} = a\}$. Epoch $j + 1$ starts whenever the observed visits to a state-action-step triple have doubled since the start of the $j^\text{th}$ epoch: \begin{align*} k_{j + 1} = \argmin_{k > k_{j}} \left\{\exists\, s, a, h: n_{jh}^{k}\left(s, a\right) = 1\lor N_{k_{j} h}'\left(s, a\right)\right\}\;. \end{align*} \begin{restatable}{lemma}{doublingtrick} \label{lemma: doubling trick} For $K \geq SA$, Algorithm \ref{alg: Lazy Algorithm} ensures that the number of epochs has the following upper bound: \begin{align*} J \leq 3HSA\log\left(\frac{4K}{SA}\right)\;. \end{align*} \end{restatable} \begin{proof} See Lemma \ref{lemma: doubling trick} of Appendix \ref{sec: useful lemmas}. \end{proof} \subsection{Proof of Theorem \ref{theorem: lazy updating}} Using Lemma \ref{lemma: doubling trick} and the arguments in its proof ensures that the number of epochs is logarithmic in the number of episodes and that we can make use of Lemma 19 of \cite{UCRL2} to bound the sum of the bonuses. Therefore, we can bound the regret of model-based algorithms using lazy updating to handle the delayed feedback. \begin{proof} Similarly to the first step in Section \ref{sec: proof thm 1}, we can bound the regret of the episodes that are not returned by the beginning of the final episode can be bounded by: $H\psi_{K}^{\tau}$. Now, we focus on the episodes that are returned before beginning the final episode. Lemma \ref{lemma: regret decomposition} gives the following recursive regret decomposition for any model-based algorithm: \begin{align*} \mathfrak{R}_{T} &\leq 2H\sqrt{T\log\left(\frac{K\pi}{6\delta'}\right)} + 2\sum_{k = 1}^{K}\sum_{h = 1}^{H}\beta_{kh}\left(s_{h}^{k}, a_{h}^{k}\right) \end{align*} where we omit the use of the indicator function: $\mathds{1}\{k + \tau_{k} < K\}$, for notational convenience. Therefore, all that remains is to bound the sum of the exploration bonuses. To do so, we utilise the fact that epochs are disjoint sets of episodes and that the algorithm uses the same bonus within each epoch, as the counts do not change: \begin{align*} \sum_{k = 1}^{K}\sum_{h = 1}^{H}&\beta_{kh}\left(s_{h}^{k}, a_{h}^{k}\right) = \sum_{j = 1}^{J}\sum_{k = k_j}^{k_{j + 1} - 1}\sum_{h = 1}^{H}\beta_{k_{j}h}\left(s_{h}^{k}, a_{h}^{k}\right) = \sum_{s, a, h}\sum_{j = 1}^{J}\beta_{k_{j}h}\left(s, a\right)\sum_{k = k_j}^{k_{j + 1} - 1}\mathds{1}\left\{s, a, h\right\}\;. \end{align*} The regret associated with the bonuses can then be split in two terms based on whether the state-action-step triples played in the $j^\text{th}$ epoch are observed before starting the next epoch: \begin{align*} &\underbrace{\sum_{j = 1}^{J}\sum_{s, a, h}\beta_{k_{j}h}\left(s, a\right)\sum_{k = k_j}^{k_{j + 1} - 1}\mathds{1}\left\{s, a, h, k + \tau_k < k_{j + 1}\right\}}_{A} + \underbrace{\sum_{j = 1}^{J}\sum_{s, a, h}\beta_{k_{j}h}\left(s, a\right)\sum_{k = k_j}^{k_{j + 1} - 1}\mathds{1}\left\{s, a, h, k + \tau_k \geq k_{j + 1}\right\}}_{B}\;. \end{align*} Focusing on the former and extending the inner-most summation to all episodes before the start of the next epoch gives: \begin{align*} A & \leq \sum_{j = 1}^{J}\sum_{s, a, h} n_{jh}^{k_{j + 1}}\left(s, a\right) \beta_{k_{j}h}\left(s, a\right) \end{align*} Recalling the form of the bonuses gives: \begin{align*} A &\leq \sum_{s, a, h}\sum_{j = 1}^{J}\left(\frac{C \,n_{jh}^{k_{j + 1}}\left(s, a\right)}{\sqrt{N_{k_{j}h}'\left(s, a\right)}}+ \frac{B \,n_{jh}^{k_{j + 1}}\left(s, a\right)}{N_{k_{j}h}'\left(s, a\right)}\right)\\ &\leq C\sum_{s, a, h}\sum_{j = 1}^{J}\frac{n_{jh}^{k_{j + 1}}\left(s, a\right)}{\sqrt{N_{k_{j}h}'\left(s, a\right)}} + HSAJB\\ &\leq C\sum_{s, a, h}\sqrt{N_{h}'\left(s, a\right)} + HSAJB\\ &\leq C\sqrt{HSAT} + HSAJB \end{align*} since $n_{jh}^{k_{j + 1}}(s, a) \leq N_{k_j h}'(s, a)$, due to the doubling scheme. The penultimate inequality follows from Lemma 19 of \cite{UCRL2}, which is restated in Appendix \ref{sec: lazy updating proofs} (Lemma \ref{lemma: ucrl2 summation}). From Equation \eqref{eqn: optimistic value function}, $\beta_{k_{j} h}(s, a) \leq H$. Utilising this and the fact that the policy plays only one state-action pair at each step of an episode allows the following bound on the remaining term: \begin{align*} B &\leq H\sum_{j = 1}^{J}\sum_{k = k_j}^{k_{j + 1} - 1}\sum_{s, a, h}\mathds{1}\left\{s, a, h, k + \tau_{k} \geq k_{j + 1}\right\} \\ &\leq H\sum_{j = 1}^{J}\sum_{k = k_j}^{k_{j + 1} - 1}\mathds{1}\left\{k + \tau_{k} \geq k_{j + 1}\right\} \\ &\leq H\sum_{j = 1}^{J} S_{k_{j + 1}} \leq HJ\psi_{K}^{\tau} \end{align*} where the last inequality used Lemma \ref{lemma: doubling trick}. Therefore, \begin{align*} \mathfrak{R}_{T} &\leq 2H\sqrt{T\log\left(\frac{K\pi}{6\delta'}\right)} + C\sqrt{HSAT} +B\left(HSA\right)^2 L_{K} + 3H^2 SAL_{K}\mathbb{E}\left[\tau\right] \end{align*} where $L_{k} = \log(K/SA)$. Rescaling $\delta' = \delta/(9 + 1)$ to accommodate for the additional failure event from Lemma \ref{lemma: delay failure event} gives the final result. \end{proof} \section{Discussion} Table \ref{tab: algorithms} presents a selection of algorithms that fit into our framework and their regret bounds under delayed feedback using both active and lazy updating. Here, we see that acting in delayed environments causes an additive increase in regret for all optimistic algorithms considered. For active updating, this additive increase scales with: $\max\{C, B\}HSA \mathbb{E}[\tau]$, where $C$ and $B$ are quantities depending on the base algorithm of choice. Typically, $C$ and $B$ involve the horizon, $H$, and the number of states, $S$. For lazy updating, this additive increase scales with: $H^2 SA \log(K/SA)\mathbb{E}[\tau]$, regardless of the chosen base algorithm. In either case, the results mirror what is seen in the bandit setting, most algorithms incur an additive regret penalty of $A\mathbb{E}[\tau]$ \citep{PJ2013}. For many algorithms such as UBEV, UCRL2, KL-UCRL, $B = 0$. In such a case, lazy updating is preferable if: $H\log(K/SA) \leq C$, where $C$ usually contains a logarithmic term at least as large as $\sqrt{\log(SAT/\delta)}$. Otherwise, active updating is preferable. When considering active updating, algorithms with tighter regret bounds in the non-delayed setting exhibit better dependency on the expected delay. Further, UBEV, UCRL2 and KL-UCRL recover their standard regret bounds in the non-delayed setting (when $\tau_k=0$ for all $k \in [K]$) using either active or lazy updating. Typically, $B > 0 $ for algorithms using variance reduction techniques, for example $\chi^2$-UCRL and UCRL2B. For these algorithms, from Table \ref{tab: algorithms}, it is clear that it is always better to use active updating. Thus, we focus our discussion on this updating scheme. Neither $\chi^2$-UCRL nor UCRL2B recover their regret bounds in the non-delayed feedback setting, due to bounding the empirical variance of the optimistic value function in each episode by $H$. This was necessary to avoid a multiplicative increase in regret due to the delays. Further, introducing the empirical variance comes at the expense of some lower-order terms: $HS\log(H, S, A, T, \delta')/N_{kh}'(s, a)$. Lemma \ref{lemma: summation bound} shows that these lower-order terms can be problematic, as they now depend on the expected delay. In particular, they lead to a term of order $H^2 S^2 A\mathbb{E}[\tau]$ in the regret bound. We note that the impact of these lower order terms when using non-standard counters has also been observed in settings such as differentially private reinforcement learning \citep{LDP}. Unfortunately, UCBVI \citep{UCBVI} does not fit into our framework. However, even if it did, we argue that it would not lead to improved results. Indeed, the algorithm makes use of Bernstein's inequality to handle the estimation error, resulting in the need to bound an additional term of the form: $H^2 S/N_{kh}'(s, a)$. Lemma \ref{lemma: summation bound} shows that this term alone introduces the following dependency on the delay: $H^3 S^2 A\mathbb{E}[\tau]$, which is worse than any of the other algorithms we consider in this paper. UBEV \citep{UBEV}, for example, has a delay dependency of: $H^2 S A\mathbb{E}[\tau]$; an improvement of $HS$. Moreover, due to bounding the empirical variance, UCBVI and UBEV will have the same leading order term in their regret bound. Therefore, we do not believe that using UCBVI in the delayed setting will lead to an improvement over UBEV, an algorithm which does fit into our framework. Lastly, we point out that although we consider model-based algorithms in this paper, we believe that lazy-updating could be used for a wider class of algorithms. Analyzing the effect that this would have on the regret of such algorithms remains an open question. \bibliographystyle{plainnat}
{'timestamp': '2021-11-16T02:28:53', 'yymm': '2111', 'arxiv_id': '2111.07615', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07615'}
arxiv
\section{Introduction}\label{sec:introduction}} \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE Computer Society journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \appendices \section{Proof of the First Zonklar Equation} Appendix one text goes here. \section{} Appendix two text goes here. \ifCLASSOPTIONcompsoc \section*{Acknowledgments} \else \section*{Acknowledgment} \fi The authors would like to thank... \ifCLASSOPTIONcaptionsoff \newpage \fi \section*{Acknowledgments} \else \section*{Acknowledgment} \fi This work was partially supported by the European Commission under European Horizon 2020 Programme, grant number 951911 - AI4Media. The authors also acknowledge the CINECA award under the ISCRA initiative (ISCRA-C - ``ILCoRe'', ID:~HP10CRMI87), for the availability of high performance computing resources. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{unsrt} \section{Introduction} \label{sec:intro} \IEEEPARstart{N}{atural} intelligent systems learn in an open universe and can search and recognize concepts while improving their knowledge. Modern \textit{artificial} intelligent systems typically perform visual search tasks exploiting internal feature representations learned by Deep Convolutional Neural Network (DCNN) models \cite{chopra2005learning,bengio2013representation,sharif2014cnn,YosinskiNIPS2014}. The output of these models in response to an input image is commonly referred to as feature vector. Visual search is achieved by indexing large corpus of images (i.e., the \textit{gallery-set}) according to their feature vectors and identifying the closest to a set of input images, called the \emph{query-set}. The representation model is typically learned by exploiting another set of images, called the \emph{training-set}. Successful examples of learning feature representation are: face-recognition \cite{schroff2015facenet,liu2016large,taigman2014deepface,deepID_NIPS2014,DBLP:conf/cvpr/DengGXZ19}, person re-identification \cite{yi2014deep,li2014deepreid,zheng2017person,chen2019abd} and image retrieval \cite{babenko2014neural,gordo2016deep,tolias:hal-01842218,tolias2021}. In the case in which these visual search systems receive novel data and/or want to adopt recent and more powerful network architectures, representation models may require to be \textit{upgraded} to improve their recognition capabilities. However, DCNNs, when upgraded with novel data or with different architectures, must re-process all the images in the gallery-set to generate new features and replace the old ones to benefit from the upgrade. This process is known as \emph{re-indexing}. \begin{figure}[t] \centering \includegraphics[width=0.99\linewidth]{imgs/ICML2021_intro.pdf} \caption{ Without compatible representation, updating the DCNN representation model with novel data requires all the gallery-set features to be re-indexed (the newly learned representation cannot be directly compared with the old one). Learning compatible representations allow direct feature comparison, thus eliminating the computationally intensive re-indexing of the gallery-set.} \label{fig:model_updates_comparison} \end{figure} Many practical vision applications involve very large-gallery sets such as facial recognition systems and social networks. In a similar vein, artificial life-long learning systems and autonomous robotics systems may gather experiences throughout their lifetime using an external memory and sequentially update\footnote{For new data assimilation, we use the term \textit{upgrade} to denote learning a model from scratch and the term \textit{update} to denote learning a model by fine-tuning a previous one.} their internal representation \cite{kumaran2016learning,nematzadeh2020memory,rolls2000memory}. The indexing process can therefore be computationally expensive or even infeasible (Fig.~\ref{fig:model_updates_comparison}). Further problems may arise due to privacy or ethical concerns as the original gallery images could not be stored, thus making reprocessing impossible \cite{van2020ethical}. In this case, the previously computed feature vectors are the only viable solution to continue using the data. In this paper, we propose a novel approach that avoids re-indexing the gallery-set during sequential upgrades of the representation model. The representation obtained in this manner is said to be \emph{compatible} as the features before and after the learning upgrades can be directly compared. Learning compatible representation has recently received increasing attention and novel methods have been proposed \cite{DBLP:conf/cvpr/ShenXXS20}, \cite{duggal2021compatibility}, \cite{Chen_2019_CVPR}, \cite{hu2019towards}, \cite{DBLP:conf/bmvc/WangCYCL20}, \cite{Meng_2021_ICCV}. Differently from these approaches, we address compatibility by encouraging \textit{stationarity} on the learned internal representation. The simple intuition is that stationarity allows features’ distribution not to change under time shift so that the current learned features are not conflicting with the old ones. In particular, our training methodology is based on two main concepts: (1) we use feature stationarity properties of classifiers whose parameters are not subject to learning; (2) we use the output of future/unseen classes to leave them a \textit{reserved} representation space. The insight of reserving a representation space is that it prevents future classes from coming into conflict with already learned ones thereby further promoting stationarity. Both feature stationarity and space reservation are obtained by learning a surrogate classification task with a special classifier in which the weights are \textit{fixed}. A very preliminary exploration of this complex subject was presented in \cite{pernici2020icpr}, where we have shown that the performance of the Class-incremental Learning task (CiL) \cite{Hsu18_EvalCL,van2019three} using fixed classifiers does not degrade with respect to the standard learned linear classifier. Here, we address the different and distinguished problem of sequential learning of compatible features in an open-set verification/identification scenario. We argue that the stationary properties of the feature representation \textit{emerged} in \cite{pernici2020icpr} are crucial for sequential learning of feature compatibility. We called our method Compatible Representations via Stationarity (CoReS). In Sec.~\ref{sec:rel_works}, we discuss the compatible learning problem in relation to the relevant areas of Class-incremental Learning and in Sec.~\ref{sec:Main Contributions}, we highlight our contributions. Sec.~\ref{sec:Problem Statement and Evaluation}, Sec.~\ref{sec:proposed-stationarity}, and Sec.~\ref{sec:learning_with_cores} present the details of the problem, the background, the motivation, and the proposed training procedure, respectively. In Sec.~\ref{sec:experiments}, we compare CoReS with state-of-the-art methods in a multi-model compatibility setting. Sec.~\ref{sec:ablation_studies} reports the ablation study and further improvements for the proposed method. \section{Related Works} \label{sec:rel_works} \noindent \textbf{Compatible Representation Learning}. The term backward compatibility has been firstly introduced in \cite{bansal2019updates} for \textit{classification} tasks. They noted that even though machine learning models can increase on average their performance through the availability of more data, new classification outputs can be different from previously correct ones. As a consequence, the trust in machine learning systems is severely harmed by such errors. An illustrative example from \cite{bansal2019updates} is over-the-air model updates in autonomous driving systems that change the user expected behavior of the car. Compatibility in classification has been further developed in \cite{srivastava2020an}, \cite{yan2021positive}, \cite{trauble2021backward} \cite{gygli2021towards}. Although the general principle is the same, learning compatible \textit{representation} models is substantially different from learning compatible classifier models since in learning compatible classifiers, \textit{no} constraints are directly imposed in the semantic distance of the feature representation. Recent works on compatible representation learning \cite{DBLP:conf/cvpr/ShenXXS20}, \cite{duggal2021compatibility}, \cite{Chen_2019_CVPR}, \cite{hu2019towards}, \cite{DBLP:conf/bmvc/WangCYCL20}, \cite{Meng_2021_ICCV} underline how modern visual search systems often need to be upgraded with novel data. In particular, \cite{Chen_2019_CVPR}, \cite{hu2019towards}, \cite{DBLP:conf/bmvc/WangCYCL20}, \cite{Meng_2021_ICCV} address the problem of compatible learning between two representation models. These works achieve compatibility by learning a \textit{map} between the two representation models so that new and old feature vectors can be directly compared. The map in \cite{Chen_2019_CVPR} is learned by a procedure consisting of three stages: adversarial learning for reconstruction, feature extraction and regression to jointly optimize the whole model. In \cite{hu2019towards} the map is learned through an autoencoder by minimizing the errors between the two representation spaces and the reconstruction errors. In \cite{DBLP:conf/bmvc/WangCYCL20} the learned map is a residual bottleneck transformation module trained by three different loss: classification loss, similarity loss between feature spaces, and, KL-divergence loss between the prototypes of the classifiers. In \cite{Meng_2021_ICCV} the estimated map aligns the class prototypes between the models. To further encourage compatibility, the method also reduces intra-class variations for the new model. These methods do not completely prevents the cost of re-indexing since the learned maps require to be evaluated every time the dataset is upgraded and are therefore not suited to sequential learning and/or large gallery-set. For example, the ResNet-101 architecture is one order slower that the mapping proposed in \cite{Chen_2019_CVPR}, therefore when the size of the gallery increases by an order of magnitude it is equivalent to re-index the images. \\ \indent Differently from these works, we leverage stationary features, thus avoiding learning specific space to space mappings for each previous upgraded representation model. The training strategy we propose learns a compatible representation to \textit{all} the previous upgraded representations. The advantage is to completely avoid the cost of re-indexing and make the proposed method particularly suitable for sequential learning. Our work therefore shares the same goal of Backward Compatible Training (BCT) \cite{DBLP:conf/cvpr/ShenXXS20,duggal2021compatibility}. The term ``backward'' refers to the explicit capability of achieving compatibility with all of the previously learned models. BCT takes advantage of an influence loss to achieve compatibility, where the old classifier is \textit{fixed} during the learning with the novel data of the model and it cooperates with the new representation model. Cooperation is achieved by aligning the prototypes of the new classifier with the prototypes of the old fixed one. Although the idea is very promising, if the previously learned classifier does \textit{not} sufficiently separate the learned features, the current classifier cannot improve this separation because it follows the previous one which can no longer be learned. Moreover, it can be noted that pairwise cooperation achieves sequential compatibility only indirectly through transitive compatibility (i.e., $\phi_{\rm 3}$ is indirectly compatible with $\phi_{\rm 1}$ since $\phi_{\rm 3}$ is compatible with $\phi_{\rm 2}$ that is compatible with $\phi_{\rm 1}$). Since our method is not based on pairwise learning, it does not inherit previously wrong learned classifiers and it achieves direct compatibility, making it specifically suitable for sequential learning. BCT has been extended in \cite{duggal2021compatibility} by taking into account small and large representation models for the query and the gallery, respectively. % Compatibility from a broader perspective has been implicitly studied in \cite{li2015convergent,NEURIPS2018_5fc34ed3} in which representation similarity between two networks with identical architecture but trained from different initialization has been quantitatively evaluated. \noindent \textbf{Class-incremental Learning (CiL)}. CiL sequentially increases the number of classes to be learned by the model over time \cite{Hsu18_EvalCL,van2019three,masana2020class}. Although it might look similar to sequential learning of compatible features, the main focus of CiL is reducing catastrophic forgetting \cite{mccloskey1989catastrophic} (i.e., the tendency of a model to forget previously learned information upon learning new information). Compatible learning differ from CiL in two important aspects: (1) the new model is \textit{not} required to be initialized as the old model and (2) the model has access to the \textit{whole data} during the model upgrade. Thus, compatible feature representations are learned performing incremental multitask learning so that catastrophic forgetting has no effect on the final learned representation. \section{Main Contributions} \label{sec:Main Contributions} We summarize our main contributions as follows: \begin{enumerate} \item We propose a novel training procedure for learning compatible feature representation via stationarity. \item We empirically verify in the open-set verification/identification problems (i.e. face recognition, persone re-identificaiton and image retrieval) that CoReS stationarity allows the sequential learning of compatibile features without having to access to previously learned models and without learning space to space mappings. \item We introduce novel criteria for comparing and evaluating compatible representation in sequential learning methods. \item Our approach improves the current state-of-the-art in learning compatible features. The experimental evaluation that we performed includes single and sequential multi-model upgrading in growing large-scale training datasets. \end{enumerate} \section{Problem Statement and Evaluation \mbox{Metrics}} \label{sec:Problem Statement and Evaluation} With reference to Fig.~\ref{fig:model_updates_comparison}, we indicate with $\mathcal{G}=\{\mathbf{f}_i\}_{i=1}^N$ the gallery-set, where $\mathbf{f}_i$ are the features extracted from the gallery-data, indicated as ${I}_\mathcal{G}=\{\mathbf{x}_i\}_{i=1}^N$, and $N$ is the number of elements of the two sets. The gallery-set $\mathcal{G}$ can include classes or identities $\mathcal{Y}=\{ y_1,y_2, ... , y_N \}$ associated with the features. We have a representation model $\phi_{\rm old}$ that transforms images $\mathbf{x}$ into features, $\mathbf{f} = \phi_{\rm old}(\mathbf{x})$, with $\mathbf{f} \in {\mathbb R}^d$ and where $d$ is the dimension of the feature representation. The model $\phi_{\rm old}$ is trained on the training-set $\mathcal{T}_{\rm old}$. The feature vectors obtained by transforming the gallery-data ${I}_\mathcal{G}$ are typically used to perform search tasks through some distance ${\rm dist}:{\mathbb R}^d \times {\mathbb R}^d \rightarrow \mathbb{R}_+$ to identify the closest features to a set of query images, indicated as ${I}_\mathcal{Q}$. As new data $\mathcal{X}$ become available, a new training-set $\mathcal{T}_{\rm new}=\mathcal{T}_{\rm old} \cup \mathcal{X}$ is created to improve the model $\phi_{\rm old}$. The new representation obtained from $\phi_{\rm new}$ is different from $\phi_{\rm old}$. To obtain the benefits of the new representation model $\phi_{\rm new}$, features that are in the gallery-set ${\cal G}$ should be used directly, that is \textit{without re-indexing} the original images ${I}_\mathcal{G}$ by $\phi_{\rm new}$. Equivalently, the already computed feature vectors from $\phi_{\rm old}$ for these images should be used. % Our goal is to design a training procedure to learn a new representation model $\phi_{\rm new}$ so that any query image can be used to perform search tasks with features ${\cal G}$, without the need to compute $\phi_{\rm new}({ I}_\mathcal{G})$. The resulting representation $\phi_{\rm new}$ is then \textit{compatible} with $\phi_{\rm old}$. The problem extends to an arbitrary number of time steps $T$ in which models are sequentially learned. As more data $\mathcal{X}_t$ at time $t$ is available, a new training-set $\mathcal{T}_{t}$ is created to train the model $\phi_t$, which is defined as follows: \begin{equation}\label{eq:growing_training_set} \mathcal{T}_{t} = \mathcal{T}_{t-1} \cup \mathcal{X}_t \end{equation} where $\mathcal{T}_{t-1}$ is the training-set at step $t-1$, with $t \in \{1,2, \dots, T\}$. \subsection{Compatibility Evaluation} \label{sec:eval-compatibility} For the evaluation of feature compatibility, we refer to the criteria recently introduced in \cite{DBLP:conf/cvpr/ShenXXS20}, that we briefly describe in the following. \noindent {\bf Empirical Compatibility Criterion (ECC)}. A compatible representation model must be at least as good as the old one in clustering images from the same class and separating those from different classes. % A new representation model $\phi_{\rm new}$ is therefore compatible with an old representation model $\phi_{\rm old}$ if: \begin{equation}\label{eq:compatible_pairwise} \resizebox{0.9\hsize}{!}{$% \begin{aligned} {\rm dist} \big(\phi_{\rm new}(\mathbf{x}_i), \phi_{\rm old}(\mathbf{x}_j) \big) &\leq {\rm dist} \big(\phi_{\rm old}(\mathbf{x}_i), \phi_{\rm old}(\mathbf{x}_j) \big) \\ & \forall \, (i, j) \in \big\{(i, j) \, | \, y_i = y_j \big\} \\ \mathrm{and} &\\ {\rm dist} \big(\phi_{\rm new}(\mathbf{x}_i), \phi_{\rm old}(\mathbf{x}_j) \big) &\geq {\rm dist} \big(\phi_{\rm old}(\mathbf{x}_i), \phi_{\rm old}(\mathbf{x}_j) \big) \\ & \forall \, (i, j) \in \big\{(i, j) \, | \, y_i \neq y_j \big\}, \\ \end{aligned} $} \end{equation} where ${\rm dist}(\cdot,\cdot)$ is a distance in feature space. Since it constrains all pairs of samples, Eq.~\ref{eq:compatible_pairwise} is therefore considered inadequate for true characterization and it is relaxed to the following \textit{Empirical Compatibility Criterion}: \begin{equation} \label{eq:compatible_set} {M} \big(\phi_{\rm new}^{\cal Q}, \phi_{\rm old}^{\cal G} \big) > {M} \big(\phi_{\rm old}^{\cal Q}, \phi_{\rm old}^{\cal G} \big), \end{equation} where ${M}$ is an evaluation metric based on ${\rm dist}(\cdot,\cdot)$. The notation ${M} \big(\phi_{\rm new}^{\cal Q}, \phi_{\rm old}^{\cal G} \big)$ underlines that the updated model $\phi_{\rm new}$ is used to extract the feature vectors ${\cal Q}$ from the query-set images ${I}_\mathcal{Q}$, while the old model $\phi_{\rm old}$ is used to extract the features ${\cal G}$ from the gallery-data ${I}_\mathcal{G}$, and that the metric $M$ is used to evaluate the performance from the two feature sets. This performance value is referred to as \emph{cross-test}, as it evaluates the case in which the query is extracted with the new model while the gallery with the old one. The term ${M} \big(\phi_{\rm old}^{\cal Q}, \phi_{\rm old}^{\cal G} \big)$ is referred to as \emph{self-test} as it evaluates the case in which both query and gallery features are extracted with $\phi_{\rm old}$. The underlying intuition is that if the performance of using the feature vectors obtained with the previous models with the upgraded query features (i.e., cross-test) is better than the performance with the features extracted from the old model (i.e., self-test), then the system is learning compatible representations. That is, the new training data improves the representation without breaking the compatibility with the previous one. \noindent {\bf Update Gain}. To evaluate the relative improvement gained by a new learned compatible representation with respect to an old one, \cite{DBLP:conf/cvpr/ShenXXS20} further defines the following \emph{Update Gain}: \begin{equation} \label{eq:update_gain} {\Gamma} \big(\phi_{\rm new}^{\cal Q}, \phi_{\rm old}^{\cal G} \big) = \frac{{M} \big(\phi_{\rm new}^{\cal Q}, \phi_{\rm old}^{\cal G} \big) - {M} \big(\phi_{\rm old}^{\cal Q}, \phi_{\rm old}^{\cal G} \big) } { {M} \big(\widetilde{\phi}_{\rm new}^{\cal Q}, \widetilde{\phi}_{\rm new}^{\cal G}\big) - {M} \big(\phi_{\rm old}^{\cal Q}, \phi_{\rm old}^{\cal G} \big)}, \end{equation} where $ \widetilde{\phi}_{\rm new}^{\mbox{ \!\!\!\! { \tiny ($\cdot$) } }} $ is the model learned according to the \textit{joint training and re-indexing} strategy which can be considered as the upper bound of the best achievable performance. Eq.~\ref{eq:update_gain} quantifies the gain produced by the learned compatible representation with respect to the non-compatible one learned by the upper bound. \section{Motivations and Background} \label{sec:proposed-stationarity} We now focus on the motivations underlying our training procedure and briefly recall the required technical background to formulate our method. \noindent {\bf Training from Scratch.} When Neural Network models are trained from a model in which weights are randomly initialized, their internal feature representation is subject to a substantial variation during learning. It is well known that: (1) features can be learned reliably in \textit{different} architectures when trained on a common dataset and % (2) the subspaces so trained are common to multiple different networks, however, as shown in\cite{li2015convergent, NEURIPS2018_5fc34ed3}, the specific learned \textit{subspace basis vectors} are substantially different. Therefore, training CNNs from scratch with randomly initialized weights does \textit{not} provide similar representations in terms of subspace geometry. This result \textit{excludes} compatibility between two independently trained representation models. \noindent {\bf Training from a Previously Learned Model.} The alternative training procedure that would seem more favorable to compatibility is learning with \textit{Incremental Fine-Tuning} (IFT) from a model in which weights are initialized from the previously learned model. However, and perhaps counter-intuitively, this does not help to obtain similar subspace representation geometry suited for compatibility. With reference to Fig.~\ref{fig:feat_space_change}, we provide direct evidence of this intrinsic aspect of feature learning (more in Sec.~\ref{sec:Qualitative Results}). In this toy problem, we trained on a subset of the MNIST dataset the LeNet++ architecture in \textit{two-dimensional} representation space \cite{wen2016discriminative}. This is achieved by setting the output size of the last hidden layer to two (no dimensionality reduction techniques are applied). The LeNet++ network is a modification of the LeNet \cite{lecun1998gradient} to a deeper and wider network. We follow standard practice in feature learning, classifier weights and biases are unit normalized and set to zero, respectively, to encourage learning cosine distance between features \cite{DBLP:conf/icml/LiuWYY16,Liu2017CVPR} and cross-entropy loss with softmax output is minimized. For the sake of clarity, we grow the training set $\mathcal{T}_{\rm new}$ by one single class: from five classes to six as shown in Fig.~\ref{fig:feat_space_change_pre} and Fig.~\ref{fig:feat_space_change_post}, respectively. The same characterization holds for any number of classes and feature space dimension. \begin{figure} \hspace{-13pt} \subfigure[]{ \label{fig:feat_space_change_pre} \adjincludegraphics[width=0.48\linewidth,trim={0 0 {.5\width} 0},clip]{imgs/figure2_adding_a_class.pdf} } \subfigure[]{ \label{fig:feat_space_change_post} \adjincludegraphics[width=0.48\linewidth,trim={{.5\width} 0 0 0},clip]{imgs/figure2_adding_a_class.pdf} } \caption{Training the LeNet++ network initialized from a previously learned model (i.e., fine-tuning) using the MNIST dataset. To visualize features, the output size of the last hidden layer is reduced to two. Colored cloud points are features from the test-set and colored lines represent classifier prototypes. \emph{(a)}: Learning is performed with a training-set $\mathcal{T}_{\rm old}$ consisting of the first five classes of the MNIST dataset. \emph{(b)}: Learning by fine-tuning $\mathcal{T}_{\rm new}=\mathcal{T}_{\rm old} \cup \text{ \{brown-class-data\}}$. The new class determines the effect of varying the spatial configuration of the representation (i.e., angles between class features change). As an example in the figure $\varphi \neq \varphi^\prime$.} \label{fig:feat_space_change} \end{figure} As can be noticed from the figures, changes in the extracted features (colored point clouds) are due to the inclusion of the novel class. Specifically, as the new class (brown) is included in the training-set and the representation fine-tuned, the features of the old classes (red, orange, blue, purple, and green) change their spatial configuration to accommodate the novel class. This is due to the fact that linear classifiers maximize inter-class distance to better discriminate between classes \cite{wen2016discriminative}. The consequence is that direct comparison between old and new features, based for example on the cosine distance, is not guaranteed to be determined by the same angle (i.e., $\varphi \neq \varphi^\prime$). To limit the spatial variation effect of the features, and therefore achieve compatibility, our approach learns stationary features according to the fixed classifiers in introduced in \cite{perniciTNNLS2021} that we briefly recall in the next subsection. \begin{figure*}[t] \centering \includegraphics[width=0.9\textwidth]{imgs/ICML2021_pre-fixed.pdf} \subfigure[]{\hspace{0.25\textwidth}\label{fig:reponet_classifier}} \subfigure[]{\hspace{0.25\textwidth}\label{fig:fixed_weight}} \subfigure[]{\hspace{0.25\textwidth}\label{fig:reponet_space}} \caption{ { Overview of CoReS. \textit{(a)}: The regular-polytope classifier in a neural network architecture with highlighted the datasets $\mathcal{T}_{\rm old}$, $\mathcal{T}_{\rm new}$, the new available data $\mathcal{X}$, the classifier prototypes $\{\mathbf{w}_i\}$, the future classifier outputs, the softmax outputs, and the feature $\mathbf{f}$. \textit{(b)}: A single fixed classifier prototype highlighted from Fig.(a). The prototype coordinates $x_1,x_2, \dots x_n$ are set to coordinate vertices of a regular polytope. \textit{(c)}: The two-dimensional illustrative representation space generated by the regular polytope classifier. The gray region is the margin region imposed by the outputs of the future/unseen classes for which no samples are available. The region is defined around the prototypes of the future classes (gray arrows). The colored point clouds show the learned features along their respective stationary classifier prototypes. Learned features are pushed out from the margin. } } \label{fig:reponet} \end{figure*} \subsection{Learning Stationary Features} As shown in the two-dimensional case of Fig.~\ref{fig:feat_space_change}, a standard learned linear classifier based on softmax and optimized with cross-entropy tends to split the available space into equiangular regions (similar to $N$-sided regular polygons) in which features are well separated. Recently in \cite{perniciTNNLS2021} it has been shown that this behavior can be reproduced with non-trainable (i.e., \textit{fixed}) linear classifiers to further add stationarity to learned features. This is achieved by setting classifier prototype vectors $\mathbf{w}_i$ to values taken from the coordinate vertices of a specific \textit{regular polytope} and leaving them not subject to learning. Regular polytopes are the generalized analog in any number of dimensions of $N$-sided regular polygons. As the parameters $\mathbf{w}_i$ are set as non-trainable (i.e., \textit{fixed}), \textit{only} the feature vector directions align toward the classifier weight vector directions achieving \textit{stationarity} \cite{perniciTNNLS2021}. By fixing the weights, the trainable classifier is basically superseded by previous layers. Therefore, differently from the works \cite{Chen_2019_CVPR,hu2019towards,DBLP:conf/bmvc/WangCYCL20,Meng_2021_ICCV}, that learn external learnable maps between representation spaces, in our method the functional complexity of learning a compatible representation is demanded to internal layers of the neural network. \noindent \section{Compatibility via Stationarity}\label{sec:learning_with_cores} Fig.~\ref{fig:reponet} shows our training procedure in two-dimensional representation space leveraging the structure of the fixed classifier in which future class outputs are added without samples. Compatible representation learning is achieved by sequentially training on $\mathcal{T}_{\rm old}$ and $\mathcal{T}_{\rm new}$ as formulated in Sec.~\ref{sec:Problem Statement and Evaluation}. For the sake of clarity, we illustrated both $\mathcal{T}_{\rm old}$ and the new data $\mathcal{X}$ having two classes each. The resulting training dataset $\mathcal{T}_{\rm new}$ to upgrade the compatible representation has four classes and in Fig.~\ref{fig:reponet}(c) it is shown applied to a 2D regular polytope (i.e., a $10$-sided polygon). We use the so called \mbox{$d$-Simplex} regular polytope fixed classifier in which class prototypes are near to all others (i.e., the simplex is the generalization of the triangle to higher dimensions) \cite{coxeter1973regular}. The topology of the simplex allows to make no assumptions about the semantic similarity between previously learned classes and future/unseen ones. In particular the prototypes for the fixed classifier can be computed as: $ \{\mathbf{w}_i\}= \{e_1,e_2,\dots,e_{d-1}, \alpha \sum_{i=1}^{d-1} e_i \}, \label{eq:d-simplex} $ where $\alpha=\frac{1-\sqrt{d+1}}{d}$ and $e_i$ with $i \in \{1,2, \dots, d-1\}$ denotes the standard basis in $\mathbb{R}^{d-1}$. Learning with CoReS proceeds by instantiating the fixed classifier and optimizing the following loss: \makeatletter \newcommand{\bBigg@{3.5}}{\bBigg@{3.5}} \newcommand{\bBigg@{5}}{\bBigg@{5}} \makeatother \begin{eqnarray} \mathcal{L}_t= -\dfrac{1}{N_b} \sum\limits_{\mathbf{x} \in \mathcal{T}_{t}} \log \! \bBigg@{3.5}( \dfrac {e^{ {\mathbf{w}}_{y_i}^{\top}{\mathbf{\phi(\mathbf{x})}} }} {\sum\limits_{\scriptscriptstyle j=1}^{\scriptscriptstyle \lvert\mathcal{T}_{t}\rvert} e^{ {\mathbf{w}}_{j}^{\top}{\mathbf{\phi(\mathbf{x})}} } + \sum\limits_{\scriptscriptstyle j=\lvert\mathcal{T}_{t}\rvert+1}^{\scriptscriptstyle K_p }e^{ {\mathbf{w}}_{j}^{\top}{\mathbf{\phi(\mathbf{x})}} }} \bBigg@{3.5}) \label{softmax_loss_virtual}, \end{eqnarray} where $\mathcal{T}_{t}$ is the training set at time $t$ as defined in Eq.~\ref{eq:growing_training_set}, $\phi$ is the representation model, $N_b$ is the number of elements in a mini-batch, $y_i$ is the label of the class that supervises the classifier output and $K_p$ is the number of classifier outputs. For $K_p - \lvert\mathcal{T}_{t}\rvert$ outputs, no training input samples and output labels are available at time $t$. The false positive responses generated by the second term of the denominator in Eq.~\ref{softmax_loss_virtual} allow reserving feature space for future usage so that every assimilated class a time $t$ does not cause feature conflict effects with respect to the already learned classes. Because the number of classes $K_p$ equal to the number of vertices of the $d$-Simplex fixed classifier: $K_p=d+1$, the representation dimensionality grows linearly with respect to the number of classes. However, this does not affect the training speed or excessive memory consumption since the fixed parameters of the classifier do not need to be updated by back-propagation \cite{DBLP:conf/iclr/HofferHS18,perniciTNNLS2021}. \subsection{Sequential Compatibility Criterion} \label{section_Multi-Step Compatibility Criterion} \begin{figure}[t] \centering \includegraphics[width=0.8\linewidth]{imgs/multi-ecc.pdf} \caption{Multi-model Empirical Compatibility Criterion (Eq.~\ref{eq:multistepecc}). The representation models $\phi_i$ with $i=1,2, \dots,T$ are sequentially learned (black arrows). The cross-tests involve pairs of different models, while the self-tests involve the same models (gray arrows). } \label{fig:multi_model_comp} \end{figure} When representation models are sequentially learned in $T$ steps, we generalized Eq.~\ref{eq:compatible_set} to the following Multi-model Empirical Compatibility Criterion: \begin{eqnarray} \label{eq:multistepecc} M \big( \phi_i^\mathcal{Q}, \phi_j^\mathcal{G} \big) > M \big( \phi_j^\mathcal{Q}, \phi_j^\mathcal{G} \big), {\rm \quad with \:} i > j, \end{eqnarray} where the time steps $i, j \in \{1,2,\ldots,T\}$ refer to two different models such that $\phi_j$ is learned before $\phi_i$. The model $\phi_i$ is compatible with the model $\phi_j$, when the cross-test between $\phi_i$ and $\phi_j$ is greater than the self-test of the model $\phi_j$. Fig.~\ref{fig:multi_model_comp} illustrates the Multi-model Empirical Compatibility Criterion, where $\{\phi_1, \phi_2, \ldots, \phi_T\}$ are the representation models, the black arrows indicate the sequence of models and the gray arrows represent the compatibility tests. The cross-tests involve a pair of models, while the self-tests a single one. Eq.~\ref{eq:multistepecc} allows defining the \textit{compatibility matrix}, in which rows represent new models and columns represent old models. The compatibility matrix $C$ is a square triangular matrix defined as: \begin{equation} C_{i,j} = \begin{cases} M \big( \phi_i^\mathcal{Q}, \phi_j^\mathcal{G} \big) & {\rm if} \; i > j \\ M \big( \phi_j^\mathcal{Q}, \phi_j^\mathcal{G} \big) & {\rm if} \; i = j \end{cases} \label{eq:compatibility_matrix} \end{equation} The value $C_{i, j}$ represents the evaluation metric $M$ of model $i$ to model $j$. Elements on the main diagonal, $i=j$, represent the \textit{self-test}, while the elements off-diagonal, $i > j$, represent the \textit{cross-test}. The compatibility matrix of Eq.~\ref{eq:compatibility_matrix} has a similar mathematical formulation, but with the purpose of compatibility, to the accuracy matrix $R_{i,j}$\footnote{The matrix $R_{i,j}$ in \cite{lopez2017gradient} reports the test classification accuracy of the model on task $j$ after learning the task $i$.} defined in \cite{lopez2017gradient} to quantify forward and backward transfer in CL. \\ \indent Besides monitoring compatibility performance across tasks, Eq.~\ref{eq:compatibility_matrix} is used to provide a single overall scalar metric to quantify the sequential compatibility. We define the Average Compatibility (\normnummecc) as the number of times that Eq.~\ref{eq:compatibility_matrix} is verified divided by the total number of times it could occur, as follows: \begin{equation} \small \normnummeccformula = \frac{2}{T(T-1)} \sum\limits_{1 \leq j < i \leq T}\mathds{1}{ \Big ( M \big( \phi_i^\mathcal{Q}, \phi_j^\mathcal{G} \big) > M \big( \phi_j^\mathcal{Q}, \phi_j^\mathcal{G} \big)} \Big ), \label{eq:AC} \end{equation} where $\mathds{1}(\cdot)$ denotes the indicator function. This metric is also independent of the number of the learning steps $T$. \\ \indent We further define the average of the entries of the compatibility matrix as: \begin{equation}\label{eq:avg_M} \avgmetrformula = \frac{2}{T(T+1)}\sum_{1 \leq j \leq i \leq T} C_{i, j}. \end{equation} This metric captures the overall accuracy $M$ achieved under compatible training. \section{Experimental Results}\label{sec:experiments} We evaluate our approach on different datasets and network architectures, comparing it with several baselines and the current state-of-the-art method. In the first part of this section, we evaluate the proposed approach in a single model upgrade on the \cifar datasets and, in the second part, the evaluation is performed in sequential model updating. Furthermore, we evaluate CoReS in the more challenging task of face verification and (body) re-identification with more sophisticated network architectures and datasets. We also report a qualitative analysis of the feature space learned by CoReS and other methods discussing the importance of stationary features to achieve compatibility. The ablation study is presented in Sec.~\ref{sec:ablation_studies}. \subsection{Baseline Methods} We compare CoReS with the following baselines: \textit{Naive}, \emph{Incremental Fine-Tuning} (IFT), \textit{Learning without Forgetting} (LwF) \cite{DBLP:conf/eccv/LiH16} and \textit{Backward Compatible Training} (BCT) \cite{DBLP:conf/cvpr/ShenXXS20}. The Naive approach trains the model $\phi_{\rm new}$ to be compatible with $\phi_{\rm old}$, minimizing some distance between the features computed on the same images. This is imposed using each image ${\cal T}_{\rm old}$ used to train $\phi_{\rm old}$ with an auxiliary loss $\mathcal{L}_{\rm dist}(\phi_{\rm new})$ training the new representation model, as $ \phi_{\rm new} = \arg\min_{\phi} \mathcal{L}(\phi, {\cal T}_{\rm new}) + \lambda \mathcal{L}_{\rm dist}(\phi), $ where $\label{eq:bct_l2} \mathcal{L}_{\rm dist}(\phi) = \frac{1}{\lvert\mathcal{T}_{\rm old}\rvert}\sum_{\stackrel{\mathbf{x} \in \cal{T}_{\rm old}}{}} {\rm dist}(\phi(\mathbf{x}),\phi_{\rm old}(\mathbf{x})), $ $\mathcal{L}$ is the standard cross-entropy loss and the scalar $\lambda$ balances the two losses. The Naive baseline, is instantiated with the Euclidean distance $\ell^2$ and is referred as $\phi_{\rm new-\ell^2}$. Note that $ \phi_{\rm old} $ it is not subject to learning. Except for IFT the baselines are based on the publicly available implementations\footnote{{https://github.com/YantaoShen/openBCT}} of \cite{DBLP:conf/cvpr/ShenXXS20}. As a reference, we also report the performance of the the upper bound obtained by joint training and re-indexing. The upper bound is also used to evaluate the Update Gain of Eq.~\ref{eq:update_gain}. \subsection{Benchmarks} To assess the effectiveness of CoReS, we evaluate our approach on different benchmarks and under the 1:1 and the 1:N search problems in an open-set context~\cite{OpenSetRec}. In the open-set evaluation protocol the classes in the training-set are different from the classes in the test-set. The open-set evaluation is also particularly valuable as it allows using a gallery with a constant number of elements. The alternative closed-set evaluation would require evaluating Eq.~\ref{eq:compatible_set} and Eq.~\ref{eq:multistepecc} with an increasing number of images at each upgrade. Consequently, the evaluation would depend on an increasing number of elements that would make it more difficult to define. We briefly report the details of each benchmark and describe the involved evaluation metrics. \noindent \textbf{\cifar-100 and \cifar-10.} The \cifar-100 and \cifar-10 datasets consist of 60000 $32 \times 32$ RGB images in 100 and 10 classes, respectively \cite{Krizhevsky2009LearningML}. There are 50000 training images and 10000 test images. As \cifar-100 and \cifar-10 contain a set of disjoint classes, we use the \cifar-100 to build training-sets to upgrade the representation models and \cifar-10 as the test set to evaluate compatibility. In particular, we focus on the verification protocol in which given a pair of images of unseen classes taken from the \cifar-10 dataset, the task is to decide whether the images contain the same class or not. At test time, we randomly generate from 6000 verification pairs from the test-set, composed by 3000 positive pairs and 3000 negative ones. The verification protocol is based on the cosine distance between the two feature vectors. \noindent \textbf{\textsc{CASIA}-WebFace\xspace and Labeled Face in the Wild (LFW).} The \textsc{CASIA}-WebFace\xspace dataset~\cite{DBLP:journals/corr/YiLLL14a} is composed by 10575 subjects and 494414 RGB face images. The LFW benchmark~\cite{LFWTech} contains 13233 target face images of 5749 different subjects. Of these, 1680 people have two or more images in the database, while the remaining 4069 people have just a single image in the database. The two datasets do not have common classes and therefore we use \textsc{CASIA}-WebFace\xspace to build training datasets to upgrade the representation models and LFW to perform open-set face verification to evaluate compatibility. \noindent \textbf{Market1501.} Market1501~\cite{zheng2015scalable} dataset contains 1501 identities divided in 751 training identities and 750 test identities. The two sets do not contain common classes and therefore he dataset is suited to perform open-set 1:N identification to evaluate compatibility. Images of each identity are captured by at most six cameras and each identity is captured by at least two cameras so that cross-camera search can be performed. For 1:N identification, a set of templates is first indexed as the gallery-set. Then each template in the query-set is used to search against the indexed templates. The quality metrics for this protocol is mean Average Precision (mAP). \subsection{Compatibility Evaluation on CIFAR-100/10} \label{sec:cifar_evaluation} To maximize usage of available data and to ensure reproducibility, we use \cifar-100 to sample a growing training dataset to sequentially upgrade the representation model and leverage \cifar-10 as test-set. % To evaluate the performance in sequential model upgrading, we split the \cifar-100 dataset accordingly. The growing training-set is increased by $\lfloor {K}_\texttt{dataset} / T \rfloor$ classes at each step, where $K_\texttt{dataset}$ is the total number of classes in the $\texttt{dataset}$ (e.g., 100 in \cifar-100). For a fair comparison, CoReS and the other baseline methods are evaluated on the same architecture. We used the recent \mbox{SENet-18} architecture~\cite{senet} adapted\footnote{Code source for SENet-18 https://github.com/kuangliu/pytorch-cifar} to the \cifar $32\times32$ input size. When not otherwise specified, we initialize the model with the same set of random weights, i.e., using the same random seed, every time the model is upgraded. The ablation study of this parameter is performed and discussed in Sec.~\ref{sec:Different Model Initialization}. We set the number of output nodes of the fixed classifier to ${K}_p=100$ and therefore the feature space is $99$-dimensional. The worst case analysis scenario of Class-incremental Learning with a larger number of output nodes has been already evaluated in \cite{pernici2020icpr} and therefore not further discussed. Optimization is obtained using SGD with learning rate of $0.1$, momentum of $0.9$, and weight decay of $5 \cdot 10^{-4}$. The batch size is set to $128$. The training is terminated after 100 epochs and the learning rate is scheduled to decrease to $0.01$ after $70$ epochs. \input{tables/cifar_2_step} \input{tables/cifar_3_step} \input{figures/multi_step_with_baseline} In this scenario, in which the representation model is upgraded once, we first train a representation model $\phi_{\rm old}$ on 50\% of the classes of \cifar-100 and subsequently the representation is upgraded using the 100\%. The compatibility of the pair of models $(\phi_{\rm new}, \phi_{\rm old})$ obtained with each baseline is evaluated according to the Empirical Compatibility Criterion (Eq.~\ref{eq:compatible_set}) and the Update Gain (Eq.~\ref{eq:update_gain}) as described in Sec.~\ref{sec:eval-compatibility}. Tab.~\ref{tab:baselinecomp} shows that only BCT and CoReS satisfy Eq.~\ref{eq:compatible_set}. Both $\phi_{{\rm new-BCT}}$ and $\phi_{{\rm new-CoReS}}$ learn a representation $\phi_{\rm new}$ compatible with the representation $\phi_{\rm old}$, and CoReS achieves higher Update Gain with respect to BCT. Naive, IFT, and LwF perform worse with respect to using $\phi_{\rm old}$. Reasons are to be found in the fact that the constraints imposed by these methods do not substantially influence the stationarity of the learned representation. We evaluate the compatibility between three models trained sequentially. We train $\phi_1$ on the 33\% of training-set, $\phi_2$ on the 66\% and $\phi_3$ on the 100\% of \cifar-100. To facilitate the comparison, the results shown in \Crefrange{fig:3step_lf}{fig:3step_cores} are presented according to the compatibility matrix defined in Eq.~\ref{eq:compatibility_matrix} in which not compatible models are highlighted in red. Consistent with the previous experiment, BCT and CoReS achieve higher compatibility with respect to the other baselines. CoReS achieves nearly full compatibility as the model $\phi_3$ is compatible with $\phi_1$, and the model $\phi_2$ is nearly compatible with $\phi_3$ (i.e., self and cross tests differ by $0.015$). In Tab.~\ref{tab:3step} the comparison of the Update Gain of the learned representations shows that CoReS achieves a substantial higher Update Gain of 54.7 with respect to BCT that achieves 52. Possible reasons of the better performance of CoReS may be connected to the fact that in BCT the compatibility of the last model $\phi_3$ with $\phi_1$ is learned indirectly without any relationships with $\phi_1$. While the compatibility of the representation learned by CoReS is jointly encouraged to all the models through the common fixed reference specified by the classifier prototypes. \Crefrange{fig:5_step_BCT}{fig:5_step_CORES} and ~\Crefrange{fig:10_step_BCT}{fig:10_step_CORES} show the comparison between BCT and CoReS in the case of five and ten-model compatibility, respectively. As the number of model upgrade increases, CoReS achieves higher compatibility and largely outperforms BCT. In the case of five-model compatibility, for example, CoReS only fails for the pair $(\phi_{3}, \phi_{1})$. In the more challenging case of ten-model compatibility, CoReS succeeds in achieving compatibility between pairs of representation models 23 times, while BCT 5 times, scoring an AC (Eq.~\ref{eq:AC}) values of 0.51 and 0.11 respectively. \input{tables/facerec_2_step} \input{figures/plot_AM-AC_face} \subsection{Compatibility evaluation on CASIA-WebFace/LFW} We evaluate the compatible representation learned by our approach on the challenging task of face verification by building multiple datasets from the \textsc{CASIA}-WebFace\xspace\ to sequentially upgrade the models. The compatibility of the upgraded models are evaluated on the LFW benchmark according to a verification task. We use the ResNet50~\cite{DBLP:conf/cvpr/HeZRS16} as model architecture with input size of $112 \times 112$. For every upgrade, training is terminated after 120 epochs, the learning rate is initialized to 0.1 and decreased to 0.01, 0.001, and 0.0001 at epoch 30, 60, 90 respectively and the batch size is set to 1024. To train the representation models we used 4 NVIDIA Tesla A-100 GPUs. Tab.~\ref{tab:face_rec} reports the results for both CoReS and BCT when the model is trained with 50\% and 100\% of the dataset. As can be noticed, both BCT and CoReS achieve comparable compatibility performances with CoReS reporting slightly higher Update Gain $\Gamma$. The different results with respect to the \textsc{Cifar}-10/100 evaluation of the previous section are mostly due to the fact that the 50\% percent of a large dataset like the CASIA-WebFace allows directly learn reasonably good features to represent the remaining 50\% of the data. Another reason may be due to the fact that in two-model compatibility BCT does not suffer from the transitive learning limit, thus learning directly the compatibility using the available previous model. We further evaluate our approach in multi-model scenarios with three, four, five and ten-model sequential step upgrade. Results are summarized in Fig.~\ref{fig:step_facerec} according to the \normnummecc and the $AM$\xspace metrics of Eq.~\ref{eq:AC} and Eq.~\ref{eq:avg_M}, respectively. Fig.~\ref{fig:MECC_face} points out the difference in the achieved compatibility representations between CoReS and BCT. In particular, our method achieves full compatibility, that is, \normnummecc $=1$, when the model is trained for two, three, four, and five step, and 0.57 for the challenging 10-model compatibility setting. Fig.~\ref{fig:M_avg_face} shows the verification accuracy $AM$\xspace decreasing favorably for CoReS. {Fig.~\ref{fig:BCT_face_5_step} and Fig.~\ref{fig:cores_face_5_step} show the compatibility matrices for the 5-model compatibility learning setting of BCT and CoReS, respectively. } In general, Fig.~\ref{fig:step_facerec} shows not only that the results are consistent with the \cifar\ ones, but that CoReS significantly improves compatible learning performance by a large margin also in face verification. We obtain a 49\% increase (i.e., from the 0.09 of BCT to the 0.58 of CoReS) in measuring the \normnummecc, which is a 544\% relative improvement over previous state-of-the-art. \input{tables/market1501} \subsection{Compatibility evaluation on Market1501} In order to diversify the training data, we finally validate CoReS on the person re-identification task (ReID) using the Market1501 dataset. Differently from face data, ReID data typically include severe occlusion and pose variation. Following~\cite{torchreid}, we adopt a pre-trained ResNet101~\cite{DBLP:conf/cvpr/HeZRS16} as feature extractor and Adam~\cite{kingma2014adam} as optimizer. We train the models for 25 epochs at each upgrade, with a initial learning rate of $3\cdot10^{-4}$, that is decreased to $3\cdot10^{-5}$ after 20 epochs. The mean Average Precision (mAP) is used as the accuracy metric $M$ in Eqs.~\ref{eq:compatible_set}, \ref{eq:multistepecc}, \ref{eq:compatibility_matrix}, \ref{eq:AC}, and \ref{eq:avg_M}. Tab.~\ref{tab:market} summarizes the two and three-model compatibility evaluation we performed. As evidenced by the table, CoReS obtain full compatibility, i.e., \normnummecc $= 1$, in both two and three-model compatibility and an higher $AM$\xspace. Contrarily, in BCT the AC decreases $= 0.3$, when the models are sequentially upgraded three times. Although the data are significantly different, the results are nevertheless consistent with the experiments of the previous sections. Our method seems to have the explicit advantage of not relying on the previously learned model and to encourage compatibility in a global way. The positive and consistent results obtained in different data sets confirm the wide and practical applicability of CoReS in several visual research tasks. \input{figures/qualitative_res} \subsection{Qualitative Results} \label{sec:Qualitative Results} To clarify the differences between the evaluated methods, we report qualitative results to obtain some intuitions about their behaviors. % Fig.~\ref{fig:evolution_featu_space} shows the evolution of the learned representations with models trained sequentially with the training set $\mathcal{T}_{\rm new}$ grown by a single class per upgrade step, from seven classes to eight and successively to nine. We used the same training settings used to obtain the results of Fig.~\ref{fig:feat_space_change} for the MNIST dataset example. In particular, Fig.~\ref{fig:ft_spc_ift}, Fig.~\ref{fig:ft_spc_bct}, and Fig.~\ref{fig:ft_spc_cores} shows the evolution of IFT, BCT \cite{DBLP:conf/cvpr/ShenXXS20}, and CoReS approaches, respectively. As it can be noticed, % each novel class learned by IFT significantly and unpredictably changes the spatial configuration of the representation with respect to the previously learned models. No one of the class features and the relative classifier prototypes (shown as colored lines) remain close to the previous model. This is due to the fact that IFT has no mechanism to prevent the re-arrangement of the features when novel information is assimilated. BCT keeps the representation reasonably stationary since it constraints the solution towards the previous learned classifier, however, variations to accommodate novel classes are evident. The olive class features, shown when learning from the eight to the nine class, are not as discriminative as the other classes, since they remained close to the origin. Differently from the others, features learned by CoReS remain accurately aligned to the $10$-sided polygon classifier prototypes, thus avoiding the effect of varying the spatial configuration of the representation and thus compatibility. \section{Ablation Studies} \label{sec:ablation_studies} As CoReS is a single building block method, ablation study consists mostly in hyperparameters tuning. In the following subsections, we conduct extensive experiments to determine which factors contribute the most to the performance of our training procedure. In Sec.~\ref{sec:num_epochs}, we study how the number of epochs affects learning compatible representations. In Sec.~\ref{sec:extensions_cores} we discuss an extension of our training procedure to select the epoch at which the best model was learned based on our Multi-model ECC of Eq.~\ref{eq:multistepecc}. We also evaluate the effects of: (1) the model initialization of Sec.~\ref{sec:Different Model Initialization}, with both random weights and by fine-tuning starting from the previously learned model, (2) different class sequence order in Sec.~\ref{sec:different_order_classes}, (3) different architectures in Sec.~\ref{sec:Different Model Architecture} and (4) changing architecture between model upgrades Sec.~\ref{sec:Different Model Architecture Between Upgrades}. Ablation study of CoReS is performed on the verification task on the dataset \cifar-100/10 as it is one of the more challenging for this problem and the faster to train. \subsection{Number of Epochs} \label{sec:num_epochs} To verify how the number of epochs affects each learned model in the final performance, we report the \normnummecc and the $AM$\xspace values of the 10-model sequence evaluated in the \cifar-100/10 experiment in which models are learned sequentially with 30, 70, 100, 200 and 350 epochs at each upgrading step. The case of 100 epochs is already shown in Fig.~\ref{fig:10_step_CORES} and it is included here for completeness. In this evaluation, we slightly modified the implementation details described in Sec.~\ref{sec:cifar_evaluation} to adapt the scheduling policy of the learning rate to the different numbers of epochs. We change the scheduling of the learning rate as follows: no scheduling for the 30 epochs case; decreased to 0.1 at 50-th epoch for 70 epochs scenario; decreased to 0.1, 0.01 at epochs 70, 140 respectively when the epochs are set to 200; decreased to 0.1, 0.01 at epochs 150, 250 respectively when the model is trained for 350 epochs per time step. Fig.~\ref{fig:abl_epoch} shows the results of the training for the selected number of epochs. Specifically, Fig.~\ref{fig:MECC_at_epoch} reports the \normnummecc of Eq.~\ref{eq:AC} and Fig.~\ref{fig:M_avg_at_epoch} the $AM$\xspace of Eq.~\ref{eq:avg_M}, respectively. The two indicators provide a concise summary of how the number of epochs contribute to the compatibility performance. As evidenced by the solid lines, $AM$\xspace increases with increasing epochs while \normnummecc decreases, showing, as expect, a clear trade-off between compatibility and verification accuracy. A reasonable balance, which is the one we used in this paper for the experiments, is around 100 epochs. \input{figures/ablation_epoch} \subsection{Compatibility based Model Selection} % \label{sec:extensions_cores} {At each upgrade, the sequential growing of the training-set with respect to a given and fixed gallery causes a change in the distribution between the training and the testing data which can be regarded as a form of dataset shift \cite{quinonero2009dataset}. } Under this learning condition, the distribution of the training-set and the gallery-set continuously change over time and \textit{adaptive learning} strategies can alleviate the challenges of sequential learning by reacting to the shift. In the following, instead of learning for a fixed number of epochs, we provide experiments on whether CoReS can exploit previous learned models to better capture the trade-off existing between verification accuracy and compatibility. We exploit this learning context and provide a simple adaptive strategy based on the following assumptions: (1) drift is occurring \textit{gradually} such that the density ratio of the marginal distribution before and after the upgrade is close to uniform \cite{sugiyama2007covariate} and (2) there is a set of data $\mathcal{\hat{G}}$ available that is an i.i.d. sample of the gallery-set data $\mathcal{G}$ (i.e., a split following the same distribution). Under these assumptions, it is possible to adapt the training procedure to the dataset shift according to standard model selection techniques, such as cross-validation \cite{stone1974cross}. We propose a model selection strategy based on Eq.~\ref{eq:multistepecc} to directly capture the underlying compatibility relation between previously learned models. During the training phase of a model $\phi_i$ with the sequential training-set $\mathcal{T}_i$ with $i \in \{1,2, \dots, T\}$, a model is learned at each epoch for a total of $N_e$ epochs. We search a model achieving the highest verification accuracy (i.e., the self-test) among the models satisfying the compatibility criterion of Eq.~\ref{eq:multistepecc} with respect to the previous model. More formally this search problem is formulated as follows: \begin{align} \label{eq:argmax} \phi^* = & \argmax{n = 1,2, \dots, N_e} & M_n\left( \phi^\mathcal{Q}_{i}, \phi^\mathcal{\hat{G}}_{i} \right) \qquad \qquad \qquad \qquad \: \: \\* \label{eq:st_mecc} & \; \qquad \textrm{s. t.} & M_n\left( \phi^\mathcal{Q}_{i}, \phi^\mathcal{\hat{G}}_{j} \right) > M_n\left( \phi^\mathcal{Q}_{j}, \phi^\mathcal{\hat{G}}_{j} \right) \quad \\* & \qquad \text{with} & \: \, j = i - 1, \qquad \qquad \qquad \qquad \qquad \: \: \label{eq:model_sel_index} \end{align} where $M_n(\cdot)$ in Eq.~\ref{eq:argmax} and in the right-hand side of Eq.~\ref{eq:st_mecc} indicate the self-test accuracy. $M_n(\cdot)$ in the left-hand side of Eq.~\ref{eq:st_mecc} indicates the cross-test verification accuracy of the $n$-th learned model with respect to the previous model (i.e., $j = i - 1$, as shown in Eq.\ref{eq:model_sel_index}). The search is solved online without saving the models learned at previous epochs. In Tab.~\ref{tab:hyper_tuning}, we compare the basic implementation described in Sec.~\ref{sec:cifar_evaluation}, indicated with \textsc{Vanilla}, with the Model Selection strategy indicated with MS. As evidenced by the table, MS increases \normnummecc\ to 0.53 keeping the same $AM$\xspace. \input{tables/ablation_MS-IT} \input{tables/ablation_other_settings} \subsection{Model Initialization} \label{sec:Different Model Initialization} At each upgrade we train from scratch by initializing the model with the same random parameters. This implies that all the upgraded models have started their optimization from a common configuration of the weights. In this section, we assess the compatibility when the parameters of the models are randomly initialized at every model upgrade. This implies that all the models are trained starting with a different configuration of the weights. Tab.~\ref{tab:ablation_other_settings}, shows mean and standard deviation of 20 runs of the \normnummecc (Eq.~\ref{eq:AC}) and the $AM$\xspace (Eq.~\ref{eq:avg_M}). As can be noticed, starting from random initialization negatively affects the final performance. In particular, in \textsc{Random init.}, the \normnummecc shows a reduction of 6\% and nearly similar $AM$\xspace with respect to the \textsc{Vanilla} training. This positive behavior may be motivated by the observations reported in \cite{NEURIPS2019_05e97c20,neyshabur2020being}. They show that initialization, whether pre-trained or random, may have a significant impact on the final classification accuracy and therefore on the learned features. This is most likely related to the concept of ``flat minima'' and to the fact that with a fixed initialization, the SGD optimization explores the same basin in the loss minimum \cite{hochreiter1995simplifying,hochreiter1997flat}. \input{figures/ablation_incremental_finetuning} \input{tables/ablation_order} \subsubsection{Fine-Tuning the Previously Learned Model} \label{sec:cores_IFT} We also evaluated CoReS in an \textit{Incremental Fine Tuning} setup in which instead of learning the model from scratch at each upgrade, the weights of the current model are initialized with the ones learned in the previous upgrade. % As shown in Fig.~\ref{fig:cores_incr}, there is a substantial reduction in the overall performance with respect to our training procedure shown in Fig.~\ref{fig:5_step_CORES}. This is supposed to be related to the fact that to assimilate novel class knowledge under the compatibility constraint, optimization requires going back to earlier weight configurations to find more complex error landscapes. This condition can simply be avoided learning the model from scratch. \subsection{Different class orderings} \label{sec:different_order_classes} Since compatibility is a sequential learning problem, we evaluate if the order of learning the new upgrades has influence on the learned compatible representation. The ablation is performed in the 10-model compatibility scenario (similar to \ref{sec:cifar_evaluation} ) using the \cifar-100 dataset for learning the compatible representation and \cifar-10 for evaluating the verification test. We report mean and standard deviation of 20 runs in which at each run a different permutation of the classes is used. We compare it with the \textsc{Vanilla} implementation, where the default alphabetically order of the classes is always used. As shown in Tab.~\ref{tab:ablation_other_order} permuting the class order, indicated as \textsc{Random Class Order}, does not affect the $AM$\xspace and the \normnummecc values with respect to the \textsc{Vanilla} implementation of CoReS. The average reduction at the end of the training process is substantially negligible and therefore with no impact on performance. It is however worth noticing that the standard deviation of the $AC$ is one order of magnitude higher of the standard deviation of the $AM$ showing that class orderings more effect on compatibility. This may be caused the high complexity introduced by learning compatible representations. \subsection{Different Model Architectures} \label{sec:Different Model Architecture} In this section, we evaluate the effect of different model architectures on learning compatible representations with CoReS. We study if the stationary constraint imposed by the fixed classifier benefits or limits the use of different architectures. It has been shown that the architecture expressive power improves the classification accuracy of fixed classifiers \cite{DBLP:conf/iclr/HofferHS18,perniciTNNLS2021}. According to this, in addition to the SENet-18 architecture evaluated in Sec.~\ref{sec:cifar_evaluation}, we ablate the individual contribution of three further architectures: the ResNet with two different depths (20 and 32) and the more recent RegNet~\cite{radosavovic2020designing}\footnote{Code source for ResNet20 and RegNetX\_200MF can be found at https://github.com/kuangliu/pytorch-cifar and for ResNet32 at https://github.com/arthurdouillard/incremental\_learning.pytorch}. Architectures are selected so as to have increasing expressive power, e.g., recent network design and an increasing number of parameters. Parameters increase as follows: 0.27M, 0.46M, 1.23M and 2.36M for ResNet20, ResNet32, SENet-18 and RegNetX\_200MF. In every architecture learning scenario (except the SENet-18), we set the SGD initial learning rate to 0.1 and the weight decay factor is $2 \cdot 10^{-4}$. For the ResNet20 model architecture, we train the model for 40 epochs and we do not decrease the learning rate. For the ResNet32, we train the model for 70 epochs and we decrease the learning rate to 0.01 and to 0.001 at the 50-th and 65-th epoch, respectively. For the RegNetX\_200MF, we train the model for 150 epochs and we reduce the learning rate at the 70-th and 120-th epoch to 0.01 and 0.001, respectively. Fig.~\ref{fig:resnet20}, Fig.~\ref{fig:resnet32} and Fig.~\ref{fig:regnet} represent the compatibility matrices of CoReS with the ResNet20, the ResNet32 and the RegNetX\_200MF, respectively. For completeness, the SENet-18 is shown in Fig.~\ref{fig:3step_cores}. As it can be noticed, both the compatibility and verification accuracy follows the expressive power of the evaluated model architectures. The ResNet32 in Fig.~\ref{fig:resnet32} has compatibility similar to Fig.~\ref{fig:resnet20} but the verification is higher. As shown in Fig.~\ref{fig:regnet} the RegNetX\_200MF architecture both improves the compatibility and the verification metric. This shows that our compatible learning approach is general enough to be applied in a wide range of scale variations and complexity. \input{figures/ablation_different_net_per_step} \subsubsection{Upgrading with Different Model Architectures } \label{sec:Different Model Architecture Between Upgrades} We further study the effects of model architecture changes during the model upgrade. This is the practical case in which a deployed system is upgraded not only with fresh data but also with recent and more powerful network architectures. As CoReS learn compatible features by sharing the same representation space of previous and future models irrespective of the layers within the architectures, we ask ourselves whether this might affect the results. According to this, we evaluate the sequential 3-model compatibility upgrading the ResNet20 to the SENet-18, and subsequently to the RegNetX\_200MF. Training is performed as in Sec.~\ref{sec:Different Model Architecture}. Fig.~\ref{fig:cores_diff_net_per_step} reports the compatibility matrix results of the evaluation. As it can be noticed, the resulting representations are always compatible between ResNet20, SENet-18 and RegNetX\_200MF. Also in this case, the increasing expressive power of the architectures is positively reflected on the sequential compatibility performance. Our approach therefore provides a general framework for learning compatible representations that sequentially leverages architectures of increasing expressiveness. \section{Conclusions} We have presented CoReS, a novel approach to learn compatible representations. Compatible representation allows ``new'' learned features to be compared directly to ``old'' features, so they can be used interchangeably in time. This enables Visual Search systems to avoid re-indexing the gallery-set when updating the representation model. CoReS achieved significantly better performance with respect to the current state-of-the-art method in the case of sequential multi-model compatibility. CoReS leverages fixed classifiers based on Regular Polytopes that allows learning stationary representation models without the need for an auxiliary loss imposing pairwise model training. In a more complex learning setting, the gallery-set can grow to include a new set of images. New training data can also be included in the gallery, depending on whether it has been already seen or not. Eventually, already seen data could be kept or removed from the gallery based on some redundancy criterion \cite{pernici2018memory}.
{'timestamp': '2021-11-16T02:29:21', 'yymm': '2111', 'arxiv_id': '2111.07632', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07632'}
arxiv
\section{Introduction} Facial features play a vital role for understanding and recognizing emotions.An important aspect in human interaction is the generality of facial features and gestures. In1971, Friesen and Ekman showed that facial features are universally related with specific emotions. Even animals also depict the same kinds of muscular movements as humans do that belong to a specific state of mind, in spite of their place of race, education, birth, etc. Hence, when modelled properly , this generality can work as a very useful characteristic in human-machine interaction. In this work , we try to analyze various facial tasks including Emotion and Gender Classification. Facial images or webcam feed acts as an input to these task so that these tasks predicts their respective classes on the given input. In Emotion classification task , emotion on the person's face classified into seven classes , which are: "angry, disgust, fear, happy, sad, surprise and neutral". Finally we try to predict who are Male or Female among them in Gender classification task.All these tasks can be performed on single faces as well as multiple faces in a single frame.Our complete real time pipeline of face detection , emotion classification and gender classification takes less than 0.5 sec. FER2013 and IMDB are the two datasets that we used for Emotion and Gender classification task respectively . FER-2013 dataset consists information about 35,887 grayscale, 48x48 sized face images with 7 emotions ,which are labeled as : `` Angry , Disgust , Fear , Happy , Sad , Surprise , Neutral " in which there are 28709 training images and 7178 validation images i.e 80/20 split. IMDB dataset is a very big dataset of faces that contains data of different artists. This dataset consists of approximately 470,000 images.This dataset gives a .mat file as metadata that contains few attributes like face\_score, a second\_face\_score, gender and age for every image . Images that have only single frontal face have more face scores, while image containing more than one faces have less face scores. The second\_face\_scores shows how certainly image contains the second face. Further we take only those images that contains single face and faces that are mostly frontal. To get this, we select only those images that have face score $\geq 3$. Finally IMDB is splitted into 80/20 ratio for Training and Validation set. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/FER2013.png} \caption{FER-2013 Samples for emotion classification \cite{DBLP:journals/corr/abs-1710-07557} } \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/IMDB.png} \caption{IMDB Samples for gender classification \cite{DBLP:journals/corr/abs-1710-07557} } \end{figure} Interpreting Emotion on the person’s face with the help of Machine Learning(ML) techniques is very complicated due to the large variance in samples from each task. As a result, millions of parameters within the model were trained using thousands of samples. Also, the accuracy of humans in identification of facial expression is $65\% \pm 5\% $.This can be seen by manually classifying the images of FER-2013 dataset which contains the classes: {“angry”, “disgust”, “fear”,“happy”, “sad”, “surprise”,“neutral”}. In this paper , we proposed an Ensemble CNN architecture that performs emotion and gender classifcation task and build a real-time system that can take live input from webcam and predicts emotion and gender of person in a single step. \section{Related Work } Large amount of research has been conducted to determine gender and emotion using facial features on different public standard datasets which permit public performance comparison of the proposed methods .As a result, there has been a lot of active research, with several recent papers using the concept of Convolutional Neural Networks (CNNs) for feature extraction and inference. Facial expressions can be recognised using nonverbal communication between humans, and also facial expression interpretation has been extensively researched. Facial expression is important in human interaction, and the Facial Expression Recognition(FER) algorithm uses computer vision techniques to aid in applications like human-computer interaction and data analytics. The goal of Xception\cite{DBLP:journals/corr/Chollet16a} Architecture is to provide a powerful method for developing exceptional Deep Learning models. Bigger models are made,either using more depth, that is, adding more sequential layers, or using more number of neurons in different layers of the model. The depth separable convolution can be performed to a great extent since it is connected with the group convolution and the inception modules .The convolutional network \cite{7780677} is located at the center of the highest and the latest and greatest computer vision algorithm and resolution for a wide variety of work. Although the expanded size of model , measurement and data processing costs often provide quality improvements for many tasks, the effectiveness and readiness of the calculation and low parameter requirements still support multi-case components usage. VGG16 is another proposed classifications architecture which can be used used to recognize emotion, but failed miserably due to its big size and more number of parameters. Octavio et.al \cite{DBLP:journals/corr/abs-1710-07557} worked on facial images and proposed a CNN architecture that helps to classify the emotions of facial expression and also classify the gender of a person in a single step. CNN model is implemented with accuracy reaching 96\% for classifying gender in IMDB Dataset and 66\% in classifying emotion in FER-2013 dataset. U.Gogate\cite{9299633} proposed a CNN architecture that helps to classify Emotion of Facial expression with an accuracy of 67\% and also classify the gender of person with accuracy of 95\% in IMDB.Akash Saravanan et.al \cite{DBLP:journals/corr/abs-1910-05602} uses face images of FER2013 dataset to classify the emotions on a person's face into one of the seven categories.In this paper ,a real time emotion detection system is built for emotion classification with an accuracy reached to 60.58\%. \section{Methodology} We are proposing a model architecture that is an ensemble of two CNN models , one is Mini-Xception and another is a simple 4-layer CNN model. We are ensembling these two models using "Average" .Mini-Xception architecture was developed by FrancoisChollet, who is the creator of Keras library . This is a deep CNN architecture that contains depthwise separable convolutions [3].Global average pooling algorithm is used in this model so that it is less dependent on the fully connected layer for trainable parameters. \begin{figure}[ht] \centering \includegraphics[width=\linewidth ]{images/new_depthwise.png} \caption{(a) Simple Convolutions (b) Depthwise Separable Convolutions} \end{figure} Depthwise Separable Convolutions consist of two types : (1) Depthwise Convolutions (2) Pointwise Convolutions. The main aim for using these layers is to segregate channel cross-correlations and spatial cross-correlations. This layer firstly applies a $D \times D$ on each M input channels and after that N $1\times 1\times M$ convolutions filter to integrate M numbers of input channels and N numbers of output channels.This layer minimizes the total computation as compared to normal convolutions by $ 1/N + 1/D^{2} $ \cite{DBLP:journals/corr/HowardZCKWWAA17} \textit{Why Ensembling ?} An ensemble is the machine learning model that integrates the predictions of two or more models.Predictions made by different models can be integrated using statistics, such as the mode or mean, or other complex methods. There are mainly two reasons to use an ensemble model over a single model as follows: \begin{itemize} \item \textbf{Performance:}An ensemble model can make better predictions and results in better performance than any single contributing model. \item \textbf{Robustness:}An ensemble minimizes the spread of the predictions and model performance. \end{itemize} \textit{Why Averaging ?} Average layer reduces the variance factor in the final neural network model which makes reductions in the spread of the model's performance for getting more confidence in model's result prediction. \begin{figure}[ht] \centering \includegraphics[width=\linewidth , height =18cm]{images/architecture.png} \caption{Model Architecture } \label{fig:fig4} \end{figure} \textbf{Figure \ref{fig:fig4}} shows our proposed model architecture that is our proposed ensembled model. For emotion classification task we trained our Ensemble model for 100 epochs and for gender classification task we trained only mini-Xception model(part of our ensemble model )for 100 epochs. We used Adam optimizer as an optimization algorithm and categorical cross entropy Loss as the loss function.We have tested models with proper validation cases for our emotion and gender classification task on FER-2013 and IMDB dataset respectively. For training purpose we have used Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz and 12GB NVIDIA Quadro k6000 GPU. \section{Experimental Results} Results for our real-time emotion and gender classification tasks in hidden faces are noticed.The whole real-time pipeline involves: detection of face , classification of emotion and Classification of gender in one single step .This implementation can work on both group as well as single images and also live input given through webcam. we address our results in \textbf{Table~\ref{tab:table1}} and compare it with other previous approaches .We can see ensemble model gives better performance .This is because we have used Average layer for ensembling the models to minimize the variance in the final neural network model which in turn reduces the spread in the model's performance for getting confidence in model's prediction.\textbf{Figure~\ref{fig:fig5}} represents normalized confusion matrix of our Ensembled model for Emotion classification task .\textbf{Figure~\ref{fig:fig6}} shows Precision , Recall , F1- score and support matrices for every class of emotion in Fer-2013 dataset. For calculating accuracy of the model on FER-2013 and IMDB dataset ,Accuracy metrics is used.The Emotion Recognition task is trained using Ensembled model and achieved accuracy of \textbf{68\%} for test images on FER-2013 dataset.The Gender Classification task uses Mini-Xception model and achieved accuracy of \textbf{95\%} for test images on IMDB dataset. \begin{table}{} \centering \caption{Comparsion of Different Approaaches} \label{tab:table1} \begin{tabular}{ccc} \hline\noalign{\smallskip} Approaches & FER-2013 & IMDB \\ \textbf{Our Approach} & \textbf{68}\% & \textbf{95}\% \\ \textbf{Octavio\cite{DBLP:journals/corr/abs-1710-07557}} & 66\% & 96\% \\ \textbf{Uttara \cite{9299633}} & 67\% & 95\% \\ \textbf{Akash \cite{DBLP:journals/corr/abs-1910-05602}} & 60.58\% & ---\\ \textbf{Mohammed \cite{9378708}} & --- & 94.49\% \\ \hline\noalign{\smallskip} \end{tabular} \end{table} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/confusion_matrix.png} \caption{Normalized Confusion Matrix of our Ensembled model for Emotion classification task on FER-2013 dataset} \label{fig:fig5} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/accuracy.png}` \caption{Results Matrix of our Ensembled model for Emotion classification task on FER-2013 Dataset} \label{fig:fig6} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/mypic.png} \caption{single face emotion and gender classification when image is passed as an input} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/grp2.png} \caption{multiple faces emotion and gender classification when image is passed as an input \cite{iiita_2019} . As it can be seen that our implementation can work on group images as well with accurate results.} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{images/single_emotion.png} \caption{Webcam based Emotion and Gender Classification . Time for Predicting Emotion and Gender of a person through webcam is 0.2 sec} \end{figure} \section{Conclusion} Proposed model can be used for general classification purpose while retaining real-time inferences. Finally a real-time system is built that executes :face detection, emotion classification and gender classification into a single module. This model can recognize the emotions by analysing the facial expression of the person shown to the webcam as an input to the model along with his/her gender. Emotion on the person’s face is classified into one of the seven categories-Angry , Disgust , Fear , Happy , Sad , Surprise , Neutral and then gender of the person is predicted as Male or Female. \section{Future Work} In emotion classification FER-2013, We can see that several common misclassifications like predicting “sad” instead of “fear” and predicting “angry” rather than “disgust” . This is due to the label “angry” is more triggered when a person is glowering and these state features have mixed up among shadowy frames. While in gender classification trained CNNs are partial towards features and accessories of western artists. This misclassification is caused because the IMDB dataset consists of mostly western artists. We understand that it is extremely important to uncover these behaviors when using for real-time inferences.These can be overcomed by using different vast datasets for this purpose or by uniformly distributing images for each class. \bibliographystyle{IEEEtran}
{'timestamp': '2021-11-16T02:33:59', 'yymm': '2111', 'arxiv_id': '2111.07746', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07746'}
arxiv
\section{Introduction} \label{introduction} Medical image segmentation is one of the essential tasks for computer-aided medical diagnosis. However, due to the pathological variability, dark lesion areas, as well as the uneven quality of the training data (lacking the consistency between imaging scanners, operators, and annotators), the accuracy of traditional convolutional neural networks (CNNs) type segmentation algorithms usually fail to meet clinical demands~\cite{wang2018interactive,wang2018deepigeos,liao2020iteratively}. To further refine the relatively inaccurate segmentation results, interactive image segmentation algorithms that take advantage of interactive correction information ({\em{e.g.}}, clicks, scribbles, or bounding boxes) are introduced~\cite{crajchl2016deepcut,xu2016deep,lin2016scribblesup,wang2018deepigeos,wang2018interactive,bredell2018iterative,liao2020iteratively,ma2020boundary-aware}. The general interactive segmentation process is depicted in Figure~\ref{interaction}, which contains two modules, {\em{i.e.}}, interactive module and utilization module. In the interactive module, the users (or experts) provide some interaction correction information ({\em{e.g.}}, hint information like clicks and scribbles). In the utilization module, the segmentation algorithm takes advantage of the interaction correction information to refine the previous model efficiently. The interactive segmentation algorithms can achieve better performance than traditional segmentation algorithms by utilizing the additional interactive correction information. The interaction process can be considered as the continuous cooperation between the model and the human expert. As a result, an excellent interactive segmentation model should understand experts' interactive information and update itself to collaborate better. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig-revised_interaction.pdf} \caption{The framework of the interactive segmentation process. Interactive module: the expert observes current (or initial) segmentation and provides further correction information (red hints); Utilization module: new segmentation is refined based on the correction information.} \label{interaction} \end{figure} \begin{figure}[htbp] \centering \subfigure[Correction information is ignored] { \label{badcase_b} \includegraphics[width=0.45\textwidth]{fig_badcase_b.png} } \subfigure[Refined result becomes worse] { \label{badcase_a} \includegraphics[width=0.45\textwidth ]{fig_badcase_a.png} } \caption{Segmentation refining failure after long-term interactions on BraTS2015 images: a) The segmentation model can not fully understand the hint information or just ignores it. b) The interactive segmentation model could misunderstand the expert's interaction correction, which results in the worse result;} \label{badcase} \end{figure} Methods such as BIFSeg~\cite{wang2018interactive} and DeepIGeos~\cite{wang2018deepigeos} model user interactions as hard constraints through conditional random fields (CRFs) end-to-end training. However, these model more focus on the \textit{one-step} interaction and the refined segmentation after the first step cannot be efficiently used in these model~\cite{liao2020iteratively,ma2020boundary-aware}. Thus, these model can not utilize the long-term interactive information but the short-term interactive information efficiently. The follow-up InterCNN~\cite{bredell2018iterative} and other methods~\cite{liao2020iteratively,ma2020boundary-aware} are improved on DeepIGeos and BIFSeg, modeling the problem as an \textit{iterative} interaction problem, which are more focus on the \textit{multi-step} interaction. Therefore, these method can cover the data distribution corresponding to different interaction levels in the training phase to effectively use long-term interactions, while ignoring the stochasticity or uncertainty of the model makes it difficult for them to effectively use short-term interactive information. Existing interactive methods cannot effectively utilize both short-term and long-term interactive information at the same time, which leads to the \textit{interactive misunderstanding} phenomenon\footnote{This phenomenon will be discussed in detail in the Section~\ref{action confidence}.}. Figure \ref{badcase} presents this phenomenon when implementing the popular interactive segmentation algorithm InterCNN~\cite{bredell2018iterative} on the BraTS2015 dataset. The algorithm ignores the expert's correction information as in Figure \ref{badcase_b}, and even be adversely affected by correction information as in Figure \ref{badcase_a}. These inconsistencies between hint information and the refined results indicate that existing algorithms still face the critical challenge of inefficiency utilization of interactive correction information. The reason for segmentation refining failure is that, at the end of the interactive procedure, the total loss of the model will guarantee the main area's priority and ignore some small but challenging areas, such as edges. The regions that are insensitive to interactive correction information could be considered hard-to-segment regions~\cite{nie2019difficulty,7780458}, which leads to mediocre segmentation refinement. If these regions are not paid more attention during the training stage, the segmentation model will inevitably dominate those easy-to-segment regions. This problem is more serious for medical images, where the hard-to-segment regions usually are tumor boundaries and are very important for clinical diagnosis and surgery. Therefore, it becomes urgent to improve the utilization of correction information, especially for the hard-to-segment regions. Besides, the requirement of large amounts of expert-annotated images is another crucial issue. On the one hand, accurate annotations of medical images require plenty of time of experts, so it is expensive to acquire sufficient data with high-quality annotations. On the other hand, more unlabeled images can be obtained with much less cost but existing popular interactive segmentation methods usually ignore utilizing these low-cost images. Thus it becomes more and more critical to reduce the need for expert-annotated images while simultaneously taking advantage of those unlabeled images. \begin{figure*}[ht!] \centering \subfigure[The architecture of MECCA.]{ \label{fig:framework} \includegraphics[width=0.95\textwidth]{fig-revised_framework.pdf}} \hspace{1cm} \subfigure[The testing stage of MECCA.]{ \label{testing} \includegraphics[width=0.85\textwidth]{fig-revised_testing.pdf}} \caption{\textbf{(a)} The architecture of MECCA. The segmentation module outputs actions to change the segmentation probability of each voxel(agent) at each interaction step. Meanwhile, the confidence network will estimate the confidence of actions, which will generate the self-adaptive reward and simulated label. The confidence map can provide the advice regions of the next interaction step to experts. \textbf{(b)} The testing stage of MECCA. In the first instance, all voxels in the segmentation probability map are initialized to a fixed value (set to $0.5$ in the experiment). Users or experts randomly mark hint points according to the initialized segmentation probability map.} \end{figure*} In this paper, we propose a novel interactive segmentation algorithm for 3D medical images called interactive {\bf{ME}}dical segmentation with self-adaptive {\bf{C}}onfidence {\bf{CA}}libration (MECCA). MECCA combines an action-based confidence learning network with the multi-agent reinforcement learning framework. The action-based confidence network could evaluate the corrective actions' quality by directly calculating the refinement actions' confidence. Unlike learning the confidence of the overall segmentation result, the confidence of actions could better evaluate whether the segmentation model has correctly utilized the experts' interactive correction information. We formulate the iterative interactions process as a Markov decision process(MDP) to model the dynamic process and further introduce the reinforcement learning technique~\cite{song2018seednet}. Further, instead of setting each image or each patient (a series of images) as the agent, we consider each voxel\footnote{The smallest unit in three-dimensional space.} as an agent while each agent aims to learn the segmentation policy and makes its decision~\cite{furuta2019pixelrl}. Specifically, after receiving the interactive correction information, each agent will modify its label by changing (increasing or decreasing) the category probability. The novel action-based confidence network will directly evaluate each agent's corrective action obtained from the corrective policy of MARL. By utilizing this action-based confidence network, two additional techniques are further proposed to improve the utilization efficiency of the interactive correction information: 1) compared with former manual-designed rewards, a self-adaptive reward function of each action is constructed, which could provide more meticulous feedback under a flexible framework; 2) a simulated label generation mechanism is established by utilizing the interactive correction information as the weakly supervisory signal. By combining the confidence network, the simulated label generation mechanism can approximately generate the labels for unsupervised images and reduce over-reliance on labeled data. The overall algorithm framework of our proposed algorithm is shown in Figure~\ref{fig:framework}. The main contributions of this work are summarized as follows: 1) A novel framework is proposed for interactive medical image segmentation by combining action-based confidence learning network with multi-agent reinforcement learning; 2) A self-adaptive feedback mechanism (self-adaptive reward) is constructed with the action-based confidence network to alleviate the effect of interactive misunderstanding phenomenon during the interaction process; 3) Simulated supervisory signals can be generated based on the confidence learning network and actions; hence much less labeled data (ground truth data) are needed to achieve the same performance. The following is the roadmap of this paper. Section \ref{related work} provides a brief but complete introduction to related works in image segmentation and interactive image segmentation, while the background material on confidence learning is also provided. Section \ref{method} describes the proposed interactive image segmentation algorithm, including the segmentation policy, the evaluation of corrective actions, the self-adaptive rewards, and the label generation scheme. Extensive experiments are presented in Section \ref{exp}. Conclusions and future work discussions are proposed in Section \ref{conclusion}. \section{Related Works}\label{related work} Image segmentation is the fundamental problem of computer vision or image processing that has been widely and long-termly studied. Deep learning (DL) has further promoted the development of automatic segmentation algorithms, the same as other applications. CNN-type methods are typical DL algorithms for image segmentation, e.g., fully convolutional networks (FCN) ~\cite{long2015fully} and DeepLab ~\cite{chen2017deeplab}. The U-Net~\cite{ronneberger2015u}, which is considered an evilutionary variant of FCN, becomes one of the SOTA methods and performs better for medical image segmentation. Medical image segmentation is the key to modern auxiliary diagnosis and treatment response evaluation. A series of related works were proposed with the progressive performance for medical image segmentation ~\cite{milletari2016v,kamnitsas2017efficient,li2017compactness}. In the following, we will review the development of interactive image segmentation methods and discuss confidence learning for image segmentation relevant to our proposed algorithm. \paragraph{Traditional interactive image segmentation methods.} The classical random Walk~\cite{grady2006random} can create a weight map with pixels as vertices and segment the image based on user interactions. GrabCut~\cite{rother2004grabcut} and GraphCut~\cite{boykov2001interactive} could associate image segmentation with the maximum flow and minimum cut algorithms on graphs, respectively, while Geos ~\cite{criminisi2008geos} was proposed to measure the similarity between pixels geodesic distance. These traditional interactive image segmentation methods aim to utilize additional expert interaction information to modify the segmentation performance further. \paragraph{DL-based interactive image segmentation methods.} \cite{xu2016deep} segments images based on CNN interactively. DeepCut~\cite{crajchl2016deepcut} and ScribbleSup~\cite{lin2016scribblesup} both employed weakly supervised expert hints to establish interactive image segmentation methods. DeepIGeoS~\cite{wang2018deepigeos} employed geodesic distance metric to construct a hint map. The interactive segmentation process can be considered as a sequential iterative process. It becomes natural to introduce the RL framework to model the interactive segmentation process. Polygon-RNN~\cite{castrejon2017annotating} fundamentally segmented each target as a polygon and iteratively chose the polygon vertexes through a recurrent neural network(RNN). Polygon-RNN+~\cite{acuna2018efficient} employed almost the same idea of Polygon-RNN but learned to choose vertexes by RL. SeedNet~\cite{song2018seednet} trained an expert interaction generation RL model, which obtains new simulated interaction information at each interaction step. IteR-MRL~\cite{liao2020iteratively} and BS-IRIS~\cite{ma2020boundary-aware} both modeled the dynamic interaction process as an MDP and employed multi-agent RL(MARL) models to segment images. Some researches also aim to reduce the annotation cost of interactive image segmentation. IFSL \cite{9358206} introduces interactive learning into the few-shot learning strategy and addresses the annotation burden of medical image segmentation models. IOG~\cite{9157733} proposes a practical Inside-Outside Guidance approach for minimizing the labeling cost. These interactive methods are difficult to effectively utilize experts' short-term and long-term interaction information simultaneously, thus making error correction operations. \paragraph{Uncertainty estimation for image segmentation} Uncertainty estimates are helpful in the context of deployed machine learning systems as they are capable of detecting when a neural network is likely to make an incorrect prediction or when the input may be out-of-distribution. Traditionally, much of the work are inspired by Bayesian statistics, or Bayesian Neural Network (BNN)~\cite{mackay1992practical,neal2012bayesian}. Unfortunately, Bayesian inference is computationally intractable in practice, so much effort has been put into developing approximations of Bayesian neural networks that are easier to train. Recent efforts to approximate the BNNs in this area include Monte-Carlo Dropout~\cite{gal2015dropout}, Multiplicative Normalizing Flows~\cite{louizos2017multiplicative}, and Stochastic Batch Normalization~\cite{atanov2019uncertainty}. These methods are capable of producing uncertainty estimates, although with varying degrees of success. The main disadvantage with these BNN approximations is that they require sampling to generate the output distributions. As such, uncertainty estimates are often time-consuming or resource-intensive to produce, requiring $10$ to $100$ forward passes through a neural network to produce useful uncertainty estimates at inference time. An alternative to BNNs is ensembling methods~\cite{dietterich2000ensemble,kamnitsas2017ensembles,mehrtash2018automatic,lakshminarayanan2016simple,mehrtash2020confidence}, which propose a frequentist approach to the problem of uncertainty estimation by training many models and observing the variance in their predictions. However, this technique is still quite resourcing intensive, as it requires inference from multiple models to produce the uncertainty estimate. A promising alternative to sampling-based methods is to instead have the neural network learn what its uncertainty should be for any give input, i.e., \textit{learning-based uncertainty estimation} or \textit{confidence learning}, as demonstrated in~\cite{kendall2017uncertainties,devries2018learning,robinson2018real,devries2018leveraging,jungo2019assessing,moeskops2017adversarial,hung2018adversarial,nie2019difficulty}. These methods commonly consist of a segmentation and confidence network and are more computationally efficient than other techniques. Thus they are better suited when computational resources are limited or when real-time inference is required, such as the interactive segmentation scenario considered in this paper. Specifically, \cite{kendall2017uncertainties} introduces a confidence network to predict the \textit{aleatoric} and \textit{epistemic} uncertainties by imitating classic Bayesian tools. The segmentation network of \cite{devries2018learning,devries2018leveraging} produces two separate outputs: prediction probabilities and a confidence estimate. Confidence estimates are motivated by interpolating between the predicted probability distribution and the target distribution during training, where the degree of interpolation is proportional to the confidence estimate. A series of work~\cite{nie2019difficulty,hung2018adversarial,moeskops2017adversarial} focus on incorporating the uncertainty estimation into the adversarial learning process, where the segmentation network corresponds to the generator, and the confidence network is the discriminator accordingly. \cite{moeskops2017adversarial} firstly employed GANs to improve the CNN-based brain MRI segmentation method. The semi-supervised learning technique is used in~\cite{hung2018adversarial} to predict trustworthy regions in unlabeled images. \cite{nie2019difficulty} proposed a difficulty-aware attention mechanism to handle those hard samples or challenging regions. Different from the previous work to learning uncertainty through imitation, joint training, or adversarial learning, a simple but powerful alternative is to introduce an auxiliary task, such as to predict the overlap between a proposed segmentation and its ground truth~\cite{robinson2018real}, or to predict the voxel-wise false positive and false negative~\cite{jungo2019assessing}.\\ \noindent{\bf{Remark.}} In our proposed algorithm, the confidence network should evaluate the confidence of calibrating actions instead of the segmentation result, which is the most significant difference between our interactive method and previous learning-based uncertainty estimation methods. Therefore, we design a novel action-oriented auxiliary task to predict whether the \textit{direction} of voxel-wise action is consistent with the ground truth. \section{The Proposed Algorithm}\label{method} This section will introduce our proposed interactive segmentation algorithm MECCA, which can iteratively evaluate the refinement actions and feedback to the segmentation model. The algorithm framework follows the multi-agent reinforcement learning structure (Section~\ref{MARL} and Section~\ref{seg train}) and an action-based confidence learning module (Section~\ref{action confidence}) is introduced to evaluate the confidence of corrective actions. This action-based confidence learning module can be used to establish the self-adaptive reward scheme and simulated label generation mechanism to utilize the interactive correction information efficiently. The architecture overview of MECCA has been depicted in Figure \ref{fig:framework}. The model's state information includes the original 3D image, the previous segmentation probability, and the hint map generated from interaction and confidence maps. Based on the current state information, the segmentation module gives suggested actions to refine previous segmentation results by adjusting the segmentation probability of each voxel (agent). Further, the state information will be utilized to evaluate the confidence of obtained actions through the confidence network, with a confidence map as the output. The self-adaptive reward is designed through a self-adaptive weighting scheme based on the action confidence evaluation (Section~\ref{self adaptive reward}). The self-adaptive reward map can be considered a value map with the same size as the original input image (each agent has its self-adaptive reward), which can reflect the performance of the corresponding agent's action. Besides, MECCA will suggest some low confidence regions for the user to interact next (Section~\ref{inter guid}). Besides, the confidence map can also be used to generate the simulated label by comparing it with actions, which will be described in Section~\ref{unlabeled}. The newly obtained hint map, the adjusted segmentation probability result, and the original 3D image form a new state. The process described above is repeated until the segmentation result meets requirements. To emphasize, during the testing stage in Figure~\ref{testing}, there is no need to calculate the self-adaptive rewards, and at the same time, we only need the obtained actions and suggested interaction areas. \subsection{MARL-driven Interactive Segmentation Framework} \label{MARL} This study employs the multi-agent reinforcement learning structure to formulate the interactive segmentation process and continuously give error-corrective actions at each interaction step. Let ${\mathbf{x}} = \left( x_1, \cdots, x_N \right)$ denotes the input image and $x_i$ denotes the $i$-th voxel of the image. In the setting of MARL, every voxel $x_i$ is treated as an agent with its own refinement policy $\pi_i({a_i}^{(t)},{s_i}^{(t)})$. At time step $t$, agent $x_i$ gets action ${a_i}^{(t)}$ from the segmentation network according to its current state ${s_i}^{(t)}$. After taking the action, agent will receive a reward ${r_i}^{(t)}$ according to the segmentation result. The state ${s_i}^{(t)}$ for agent $x_i$ is concentrated by its voxel value $b_i$, its current segmentation probability ${p_i}^{(t)}$ and the value ${h_i}^{(t)}$ on the hint map. In particular, the segmentation probabilities of all agents are initialized to 0.5 and range from 0 to 1. The hint map ${h}^{(t)}$ is transformed from the user’s hints which are in the form of edge points. At each step, users click on some edges, which are not correctly predicted, as hints. In order to let the model receive hint information, we generates a 3D Gaussian (with $8$-voxels kernel size) centered on each of the edge points as the hint map input to the segmentation network. The action ${a_i}^{(t)}$ for agent $x_i$ is sampled from its policy and used to adjust its previous segmentation probability: \begin{equation} a_i^{(t)}\sim\pi_{\theta}(a_i^{(t)}|s_i^{(t)}), \end{equation} \begin{equation}\label{eq:clip} p_i^{(t+1)}= \ clip(p_i^{(t)}+a_i^{(t)},0,1), \end{equation} where ${a_i}^{(t)} \in \mathcal{A}$ and the $clip$ operation modifies the probability to the interval [0,1]. The action set $\mathcal{A}$ contains actions of different scales, allowing the agent to select the proper action. In our setting, the $\mathcal{A}= \{\pm0.1, \pm0.2, \pm0.4\}$. $0$ is not used as one of the actions is mainly due to the following three reasons: 1) in the early stages of the experiment, we found that using $0$ as action will make the algorithm converge slow, and it requires more than $2$ times the number of interactions to achieve the performance of baselines. Therefore, we remove $0$ from the action space and encourage the agent to explore in the early stage of training. Not only does the algorithm converge faster, but it also requires fewer interactions; 2) in order to prevent the algorithm's output from exceeding the valid range, we have clipped the output action (this is also a common technique in reinforcement learning in order to ensure that the output of the policy is in the valid range), as shown in the (\ref{eq:clip}). 3) due to the existence of the self-adaptive confidence calibration mechanism, the action output by the algorithm will generally change in the direction of the correct label. Combined with the clipping technique used in the second point, the algorithm can guarantee effectual output even if there is no $0$-action. The reward ${r_i}^{(t)}$ is the feedback (positive or negative) of the action and used to update the refinement policy. The design of reward is a significant part of our algorithm, and we will introduce it in details in Section~\ref{self adaptive reward}. \subsection{Segmentation Network} \label{seg train} \begin{figure*}[ht!] \centering \includegraphics[width=\textwidth]{fig-revised_network.pdf} \caption{{The detailed architecture of the segmentation network. The confidence network architecture is the same as the value branch of the segmentation network, but the parameters are not shared. $|A|$ represents the size of the action space.}} \label{network} \end{figure*} The segmentation network adopts the P-Net, proposed in ~\cite{wang2018deepigeos}, as the backbone. The segmentation network $\bm{S}$ has two heads: policy head and value head. Two heads share the first three 3D convolutional blocks to extract low-level features. Each of the blocks has two convolution layers and the size of the convolution kernel is fixed as 3×3 in all these convolution layers. All the convolution kernels are dilated convolution, which can reduce the loss of the resolution. Both of the heads have another two 3D convolutional blocks to extract specific high-level features. The detailed architecture is shown in Figure~\ref{network}. Specifically, the policy head is to output the policy $\pi_i({a_i}^{(t)},{s_i}^{(t)})$, which is the distribution of action probabilities under current state. By taking actions on different scales, the probabilities will be dynamically adjusted. The value head is to estimate the value of the current state, which evaluates how good the current state is and estimates the expected return: \begin{equation} V_i^{(t)} = \mathbb{E} \left[ R_i^{(t)} \big| s_i=s_i^{(t)} \right] = \mathbb{E} \left[ {\textstyle{\sum_{k=t}^{\rm T}}} \gamma^{t-1} r_{i}^{(t)} \right], \end{equation} where $T$ is the terminal time step in the interaction process, and $\gamma$ is the discount factor. $\theta_v$ denotes the parameters of the value head, and the gradient with respect to $\theta_v$ is: \begin{equation} {\hbox{d}}_{\theta_{v}}=\nabla_{\theta_{v}} A^{2} \big( s^{(t)}, a^{(t)} \big), \label{critic} \end{equation} \begin{equation} A\big(s^{(t)}, a^{(t)}\big)= {\textstyle{\sum_{k=t}^{T}}} \gamma^{k-t} \bar{r}^{(k)}-V \big(s^{(t)}\big), \end{equation} where $\overline{r}^{(k)}$ is the mean reward of all voxels at timestep $k$. $A(\bm{s}^{(t)}, \bm{a}^{(t)})$ represents the advantage function~\cite{Mnih2016AsynchronousMF}. The goal of the policy head is to maximize the expected return by selecting proper actions in state $\bm{s}^{(t)}$. This study uses $\theta_p$ to denote the parameters of the policy head, and the gradient for $\theta_p$ is denoted as \begin{equation} {\hbox{d}}_{\theta_{p}} = -\nabla_{\theta_{p}} \pi\big(a^{(t)} | s^{(t)}\big) A\big(a^{(t)}, s^{(t)}\big). \label{actor} \end{equation} Usually, the policy head is updated after the value head. \subsection{Action Confidence Learning} \label{action confidence} As we mentioned in section \ref{introduction}, there will be some situations where the segmentation model misunderstands or ignores the hint information. To some extent, these samples (or regions) with the phenomenon of interactive misunderstanding are hard samples (or regions). Although these samples may account for a small percentage of the dataset, they are critical for improving generalization and robustness. The most important thing is finding a \textit{professional easy-or-hard representer}~\cite{nie2019difficulty} to identify them when interacting. Focal loss~\cite{lin2017focal} evaluates the hard-or-easy samples through predicted probability. ~\cite{nie2019difficulty} applies adversarial learning to train the easy-or-hard representer. Both of them have their advantages, but all evaluate hard-or-easy samples based on the final segmentation result. As such, these methods cannot be directly applied to interactive segmentation. For example, if the model predicts the category probability of a voxel to be $0.8$ ($p_i^{(t)}$ = $0.8$), and then takes an action $a_i^{(t)}$ = $-0.1$. The next prediction will be $0.7$ after interaction ($p_i^{(t+1)}$ = $0.7$). If $y_i=1$, before and after results are all correctly predicted because $p_i^{(t)}$ and $p_i^{(t+1)}$ are all greater than 0.5. While for interactive segmentation, the probability is changing in the wrong direction. This change is what we called the \textit{interactive misunderstanding} phenomenon and the formally definition is shown in following. \begin{definition}[\textit{Interactive Misunderstanding}] For a binary classification problem, the sign of the foreground label $y=1$ is denoted as \textit{positive}, and the sign of the background label $y=0$ is denoted as \textit{negative} accordingly. In an interactive medical image segmentation task (i.e. a voxel-wise binary classification problem), for any voxel $i$, if the sign of the change of segmentation probability output by algorithm for two consecutive interaction steps \textit{sign($\triangle(p^{(i)})$)} is not equal to \textit{sign($y_i$)}, then this phenomenon is defined as \textit{interactive misunderstanding}. \end{definition} Our proposed confidence network learns the confidence of given actions to avoid misunderstanding hint information and take accurate actions. We argue that confidential information can be used to regularized action choices and suggest more efficient interaction. The confidence network structure also uses P-Net ~\cite{wang2018deepigeos} as the backbone The confidence network contains six 3D convolutional blocks. Each of the blocks has two convolution layers, and the size of the convolution kernel is fixed as 3×3 in all these convolution layers. The detailed architecture is shown in Figure~\ref{network}. The confidence network is trained using the previous state and action as input and a confidence map as output. The confidence network is optimized by minimizing the summation of binary cross-entropy loss over actions (shown in (\ref{CLoss})) at each time step $t$. Here we use $\bm{C}$ to denote the confidence network, $w_{\bm{C}}$ denotes the parameters of the confidence network, while $L_{BCE}$ denotes the binary cross-entropy loss: \begin{equation} \begin{aligned} &L_{\bm{C}}(s^{(t)}, a^{(t)} ; w_{\bm{C}})\\ =& L_{B C E}(\bm{C}(s^{(t)}, a^{(t)}), \operatorname{g}^{(t)}) + L_{B C E}(\bm{C}(s^{(t)},-a^{(t)}), 1-\operatorname{g}^{(t)}), \end{aligned} \label{CLoss} \end{equation} where \begin{equation} \operatorname{g}^{(t)}=\left\{\begin{array}{ll} 0 & \text { if } a^{(t)} \oplus y^{(t)}==1, \\ 1 & \text { otherwise }, \end{array}\right. \end{equation} where $\operatorname{g}^{(t)}$ means whether the direction of action is consistent with the label. $a\oplus b$ is defined as that the statement is only true if either $a>0$ or $b>0$, but not both. One potential issue when training the confidence network is the imbalance of samples. Early in RL training, the error rate of actions output by the segmentation network is very high, while most actions are correct when the network gradually converges. Inspired by the training of the discriminator in generative adversarial networks, this study introduces symmetric samples into the (\ref{CLoss}) to speed up training. An obvious advantage is that it improves sample utilization efficiency because the confidence network can know what a ``bad sample" is and get a corresponding ``good sample." \subsection{Self-Adaptive Reward} \label{self adaptive reward} Essentially, no matter applying focal loss or adversarial learning to the training of the segmentation model, they all try to weigh these hard samples to prevent the model dominated by easy samples. However, the interactive segmentation task differs from those fully automatic segmentation tasks because the interactive segmentation model needs to cooperate with the user and understand the user's hint information. The action to refine the segmentation result shows how the segmentation model understands hint information. Therefore, it is necessary to ensure that the hint information is correctly understood and the correct action is taken. Specifically, the previously described action-confidence learning can provide the segmentation model with a confidence map to alleviate the interactive misunderstanding phenomenon. By this confidence map, hard-or-easy samples can be better recognized as the confidence values for these 'hard regions' are relatively lower than in other regions. This paper formulates this voxel-level action-aware as the self-adaptive reward function, $r^{(t)}$, which is shown in (\ref{action-aware}), to adapt this mechanism to the training of MARL: \begin{equation} \begin{aligned} r^{(t)} = {\textstyle{\sum_{i=1}^{N}}} \alpha\left(2-c_{i}\right)^{\beta}{gain}_i^{(t)}, \end{aligned} \label{action-aware} \end{equation} where $c_{i}$ is the value on the confidence map. The setting of hyperparameters $\alpha$ and $\beta$ are described in Section \ref{details}. In addition, ${gain}_i^{(t)}$ denotes the relative gain of cross-entropy: \begin{align} \label{reward} {gain}_i^{(t)} \ = \mathcal{X}_{i}^{(t-1)} - \mathcal{X}_{i}^{(t)}, \end{align} \begin{align} \label{cross entropy} \mathcal{X}_{i}^{(t)} \ =\ -y_{i}\log(p_{i}^{(t)})-(1-y_{i})\log(1-p_{i}^{(t)}), \end{align} where $\mathcal{X}_{i}^{(t)}$ denotes the cross-entropy between current segmentation probability and ground truth. If an agent gets a positive reward, its current action is good, and the refined segmentation result is closer to the ground truth. With the self-adaptive reward function in (\ref{action-aware}), the confidence value $c_i$ of these wrong actions is lower, and they will be punished more when training our segmentation model. \subsection{Interaction Guide} \label{inter guid} Another challenge for interactive image segmentation is that users usually need to decide where to interact in many slices, which is very time-consuming, especially for 3D images. Our framework also provides users with an interaction guide mechanism to save the user's interaction time. After refinement, our framework will suggest some possible areas for users to interact with next. Specifically, our framework will filter out those areas with low action confidence and provides them for users (see Figure~\ref{InterGuid}). Firstly, the original 3D image will be segmented with super voxels; each super voxel can be regarded as a group of voxels that share common characteristics. We use simple linear iterative clustering (SLIC)~\cite{Achanta2012SLICSC} technique with \textit{spacing} $=[2,2,2]$, \textit{compactness} $=0.1$ to generate supervoxels, and the number of initial supervoxels equals to $100$ and gradually declines during the refinement iterations for training and testing. Secondly, the proposed algorithm will compute the mean action confidence in each super voxel and rank them in descending order. Finally, the top $5$ super voxels will be marked and recommended to users. What users need to do is to select the best interaction positions from these super voxels. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_GuidInteraction.png} \caption{The illustration of interaction guide mechanism. The areas surrounded by the green lines are advice regions provided to users, and the red point is the real hint information selected from advice regions. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \label{InterGuid} \end{figure} \subsection{Simulated Label Generation} \label{unlabeled} \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig-revised_labelgen.pdf} \caption{The illustration of simulated label generation. The simulated label generation mechanism utilizes the confidence map and the action map to generate the simulated label. The confidence map is used to calibrate the action, and the direction of the calibrated action is the simulated label of each voxel.} \label{labelgen} \end{figure} In medical imaging, the unlabeled data is much more than labeled data due to difficulties in labeling medical images. To address this lack of annotations, the proposed algorithm leverages the action confidence not only to improve the utilization efficiency of hint information but also to generate a simulated label, shown in Figure \ref{labelgen}, for unlabeled data. We define the simulated label as follow: \begin{equation} \label{simulated label} \hat{y}^{(t)}=\left\{\begin{array}{ll} 1 & \text { if } a^{(t)} \oplus c^{(t)}==1, \\ 0 & \text { otherwise }. \end{array}\right. \end{equation} The $\hat{y}^{(t)}$ is the simulated voxel-level label generated from the confidence map and detailed illustration is shown in Figure~\ref{labelgen}. Based on this mechanism, this study considers using these unlabeled data to assist in training the segmentation network. Specifically, this study divides the dataset into two parts during the training stage: the first part contains voxel-level annotation information, and the second part contains only hint information during training. The labeled data is trained as above, while the unlabeled data is trained with the simulated label. During the training stage, the backward of gradients will be masked: \begin{equation} \begin{aligned} d \theta_{v}=M\nabla_{\theta_{v}} A\big(s^{(t)}, a^{(t)}\big)^{2}, \end{aligned} \label{fake_v} \end{equation} \begin{equation} \begin{aligned} d \theta_{p}=M\nabla_\pi \big(a^{(t)} | s^{(t)} \big) A \big(a^{(t)}, s^{(t)} \big), \end{aligned} \label{fake_p} \end{equation} where \begin{equation} \begin{aligned} M = I(max(c^{(t)},1-c^{(t)})>\delta). \end{aligned} \label{mask} \end{equation} $A\left(\boldsymbol{s}^{(t)}, \boldsymbol{a}^{(t)}\right)$ is the advantage (which is defined in~\cite{Mnih2016AsynchronousMF}) at time step $t$ of taking $a^{(t)}$ in condition of state $s^{(t)}$, which indicates the actual accumulated reward without being affected by the state and reduces the variance of gradient. A mask, $M$, is used to constraint the training of unlabeled data. The gradients of unlabeled data backward only when the action confidence exceeds the threshold $\delta$ (which is gradually increased during the training process). Unlike traditional pseudo-label training, the supervised signal does not come from the segmentation but the confidence network. These filtered data with hint information are more valuable and provide more accurate supervised signals. Generally, the training process with labeled and simulated labeled data is carried out simultaneously. When using the simulated label generation mechanism, the pseudocode is shown in {\bf{Algorithm~\ref{alg:1}}}. \begin{algorithm} \caption{MECCA: Interactive Medical Image Segmentation with Self-Adaptive Confidence Calibration} \label{alg:1} \begin{algorithmic}[1] \STATE Initialize the segmentation network $\bm{S}$ with $\theta$; \STATE Initialize the confidence network $\bm{C}$ with $w$; \FOR{every sample in labeled datasets} \STATE Set the segmentation probability of each voxel to $0.5$; \STATE $s^{(0)} \leftarrow (x,p^{(0)},h^{(0)})$; \FOR{every interaction time step $t$} \STATE Take action $a^{(t)} \leftarrow S(s^{(t)})$; \STATE Get reward $r^{(t)}$ and observe the next state $s^{(t+1)}$; \STATE Compute the gradient of $\bm{S}$ via (\ref{critic}) and (\ref{actor}); \STATE Compute the gradient of $\bm{C}$ via (\ref{CLoss}); \ENDFOR \STATE Get a sample ($x', y'$) from unlabeled dataset; \STATE Initialize the state: $s'^{(0)} \leftarrow (x',p'^{(0)},h'^{(0)})$; \FOR{every interaction time step $t$} \STATE Take action $a'^{(t)} \leftarrow S(s'^{(t)})$; \STATE Generate the simulated label $\hat{y}^{(t)}$ by (\ref{simulated label}); \STATE Observe the reward and next state $s'^{(t+1)}$; \STATE Compute the gradient of $\bm{S}$ via (\ref{fake_v}) and (\ref{fake_p}). \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \section{Experiments and results} \label{exp} \subsection{Dataset and Implementaion details}\label{details} To comprehensively evaluate our proposed method, we apply our algorithm to four 3D medical image datasets. All datasets are divided into two parts: $D_{train}$/$D_{test}$. The details of these datasets are as follows: 1) \textbf{BraTS2015}: Brain Tumor Segmentation Challenge $2015$ ~\cite{menze:hal-00935640} contains $274(234/40)$ multiparametric MRI(Flair, T1, T1C, T2) from brain tumor patients. In our task, we only use the Flair image and segment the whole brain tumor. 2) \textbf{BraTS2020}: Brain Tumor Segmentation Challenge $2020$ ~\cite{menze:hal-00935640} contains $285(235/50)$ multiparametric MRI(Flair, T1, T1C, T2) from brain tumor patients. In our task, we only use the Flair image and segment the whole brain tumor. 3) \textbf{MM-WHS}: Multi-Modality Whole Heart Segmentation~\cite{zhuang2016multi} contains $24(20/4)$ multi-modality whole heart images covering the whole heart substructures. In our task, this study chooses to segment the left atrium blood cavity. 4) \textbf{Medical Segmentation Decathlon}: This is a generalisable 3D semantic segmentation datasets containing different organ segmentation tasks~\cite{simpson2019large}. This study chooses to use the spleen and liver dataset, which provides $61(41/20)$ and $106(96/10)$ CT images respectively. We implement our method with PyTorch~\cite{NEURIPS2019_9015}\footnote{The demo video of MECCA algorithm is available at \url{https://bit.ly/mecca-demo-video}.}. The segmentation and confidence network are both initialized by Xavier~\cite{glorot2010understanding} method, and learning rates are initialized to $1e-4$. Other parameters are set as follow: $T=5$, $\gamma=0.95$, $\alpha=0.8$, $\beta=1$. The mask $M$ ranges from $0.85$ to $0.99$ and ascents $0.00025$ at every epoch. Adam~\cite{kingma2014adam} is adopted as the optimizer. The original image is cropped by the bounding box based on the ground truth with a random extension in the range of $1$ to $11$ voxels. Each image is then resized and normalized to $55 * 55 * 30$. The data is augmented by random flip and rotation. The proposed algorithm training time with one Nvidia 2080ti GPU varies from $5$ to $13$ hours for different datasets. \subsection{Interaction Settings and Evaluation Metrics} \begin{figure}[ht!] \centering \includegraphics[width=0.6\textwidth]{fig_res1.png} \caption{Visualization of segmentation results by different methods. The green lines represent the boundaries of ground truth, and the yellow lines represent the predictive boundaries.} \label{view1} \end{figure} During the process of interaction, this study adopts the edge points as the hint information for two reasons. On the one hand, click operation saves more time than scribbles or other interactive ways. On the other hand, edge points can provide more information about object edges as the bottleneck of medical image segmentation is usually the inaccurate segmentation of object edges. Specifically, this study provides each method with $45$ points\footnote{Please refer to Section IV-C for details.} during the whole interaction process. At every step, users will click some edges which are not correctly predicted. This study generates a 3D Gaussian (with $8$-voxels kernel size) centered on each of the edge points as the hint map to let networks receive hint information. Then the hint map will be input to the segmentation network as part of the state. This study will use the Dice score and the average symmetric surface distance (ASSD) to evaluate the performance of the segmentation result. According to these evaluation metrics, doctors can judge the patient's condition: $$ {\text{Dice}}(S_p, S_g) = (2|S_p \cap S_g|) / (|S_p| + |S_g|), $$ where $S_p,S_g$ denote the prediction of an algorithm and the ground truth respectively. $$ {\text{ASSD}} = \big({\textstyle{\sum_{i \in \mathcal{S}_{a}}}} d\left(i, \mathcal{S}_{b}\right) + {\textstyle{\sum_{i \in \mathcal{S}_{b}}}} d\left(i, \mathcal{S}_{a}\right)\big) / (\left|\mathcal{S}_{a}\right|+\left|\mathcal{S}_{b}\right|), $$where $\mathcal{S}_{a}$ and $\mathcal{S}_{b}$ represent the set of surface points of the segmentation result predicted by the algorithm and the ground truth, respectively. $d\left(i, \mathcal{S}_{b}\right)$ is the shortest Euclidean distance between $i$ and $\mathcal{S}_{b}$. The Dice score and ASSD in all tables are the average value of five test results of algorithms. \subsection{Comparisons with State-of-the-art Methods} \begin{table} \caption{Dice scores at each interaction step by different methods. The value in parentheses represents the improvement relative to the previous step.} \label{improvementTab} \centering \scalebox{0.9}{ \begin{tabular}{c c c c c c c} \toprule[1pt] Step & 1 & 2 & 3 & 4 & 5 \\ \hline \multirow{2}{*}{DeepIGeos} & 87.36&87.53&87.67&87.99&88.32 \\ & & (+0.17) & (+0.14) & (\textbf{+0.32}) & (+0.33) \\ \hline \multirow{2}{*}{InterCNN} & 87.21 & \textbf{88.59} & 88.54 & 88.39 & 88.26 \\ & & (+1.38) & (-0.04) & (-0.16) & (-0.12) \\ \hline \multirow{2}{*}{IteR-MRL} & 84.56 & 85.35 & 88.15 & 88.11 & 88.94 \\ & & (+0.80) & (\textbf{+2.80}) & (-0.08) & (+0.83) \\ \hline \multirow{2}{*}{MECCA} & 86.49 & 88.53 & \textbf{89.56} & \textbf{89.12} & \textbf{90.29} \\ & & (\textbf{+2.03}) & (+1.03) & (-0.44) & (\textbf{+1.17}) \\[0.5ex] \bottomrule[1pt] \end{tabular}} \end{table} \begin{figure}[ht!] \centering \includegraphics[width=0.6\textwidth]{fig_improvement.png} \caption{ Visualization of the performance improvement of different interactive medical segmentation methods at the different interaction steps. All these testing results are performed on the BraTS2015 dataset.} \label{improvementFig} \end{figure} We compare MECCA with five state-of-the-art interactive segmentation methods: DeepIGeos~\cite{wang2018deepigeos}\footnote{\url{https://github.com/taigw/GeodisTK.}}, InterCNN~\cite{bredell2018iterative}\footnote{\url{https://github.com/gbredell/interCNN.}}, IteR-MRL~\cite{liao2020iteratively} and BS-IRIS~\cite{ma2020boundary-aware}. InterCNN is the multi-step version of DeepIGeos. We also introduce the SOTA method, U-Net~\cite{ronneberger2015u}\footnote{\url{https://github.com/liyun-lu/unet\_and\_vnet.}}, of medical image segmentation as a comparable baseline. Table~\ref{res1} show the quantitative comparison of the six interactive segmentation methods on different datasets. For a fair comparison, all CNN-based methods adopt the same network structure (P-Net), which is proposed in~\cite{wang2018deepigeos}. We can see that our proposed MECCA performs better than other state-of-the-art methods on all three datasets. This study also visualizes the results in Figure~\ref{view1}, which shows that our method is more accurate in edge segmentation. \begin{table*}[htbp] \label{tab:test} \caption{Quantitative comparison of 3D medical image datasets segmentation by different methods. In particular, the P-Net is the method without hint information. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{res1} \centering \resizebox{\textwidth}{!}{% \begin{tabular}{c|cccccccccc} \toprule[1pt] Methods &\multicolumn{2}{c}{BraTS2020} &\multicolumn{2}{c}{BraTS2015} & \multicolumn{2}{c}{MM-WHS} & \multicolumn{2}{c}{Spleen} & \multicolumn{2}{c}{Liver}\\ & Dice(\%) & ASSD(pixels) & Dice(\%) & ASSD(pixels) & Dice(\%) & ASSD(pixels) &Dice(\%) & ASSD(pixels) &Dice(\%) & ASSD(pixels)\\ \midrule P-Net &83.67$\pm$8.35 &5.78$\pm$4.01 &84.00$\pm$12.01 &5.10$\pm3.72$ &81.40$\pm$1.48 &3.28$\pm$0.45 &88.08$\pm$2.25 &4.25$\pm$2.07 &35.89$\pm$2.61 &34.46$\pm$23.82 \\ U-Net &84.72$\pm$10.42 &4.09$\pm$3.89 &84.66$\pm$11.25 &6.17$\pm$4.69 &80.96$\pm$1.65 &3.72$\pm$0.39 &87.95$\pm$2.87 &5.12$\pm$1.09 &56.00$\pm$1.93 &22.38$\pm$22.42\\ DeepIGeos &88.54$\pm$.97 &2.11$\pm$1.30 &88.32$\pm$5.34 &2.28$\pm$1.24 &88.48$\pm$0.71 &1.53$\pm$0.18 &91.97$\pm$1.51 &0.93$\pm$0.46 &48.57$\pm$2.52 & 10.28$\pm$3.45\\ InterCNN &88.39$\pm$6.01 &2.01$\pm$1.09 &88.26$\pm$7.07 &1.81$\pm$2.09 &87.85$\pm$1.15 &0.80$\pm$0.15 &93.52$\pm$0.94 &0.54$\pm$0.83 &59.92$\pm$2.20 &5.95$\pm$2.76\\ IteR-MRL &89.22$\pm$4.65 &2.07$\pm$0.91 &88.94$\pm$4.81 &\textbf{1.41$\pm$0.22} &89.55$\pm$0.87 &0.90$\pm$0.11 &91.50$\pm$1.34 &0.67$\pm$0.21 &62.29$\pm$1.93 &\textbf{0.87$\pm$0.59}\\ BS-IRIS &90.47$\pm$5.23 &1.82$\pm$0.33 &89.74$\pm$3.86 &1.61$\pm$0.42 &89.12$\pm$0.98 &1.19$\pm$0.16 &92.35$\pm$1.13 &0.54$\pm$0.19 & 67.25$\pm$2.01& 4.34$\pm$1.18\\ MECCA &\textbf{91.02$\pm$5.86} &\textbf{1.15$\pm$0.20} &\textbf{90.29$\pm$5.07} &1.50$\pm$0.33 &\textbf{90.39$\pm$5.89} &\textbf{0.80$\pm$0.01} &\textbf{94.96$\pm$1.44} &\textbf{0.30$\pm$0.16} &\textbf{71.46$\pm$1.41} &2.36$\pm$0.99\\ \bottomrule \end{tabular}% } \end{table*} To demonstrate that our method can take advantage of hint information more efficiently, this study also compares the relative improvement of different methods at each interaction step. Due to the different interaction ways of different methods, this study sets up a unified interaction process: all these methods have $5$ interaction steps and receive $25$ identical points at the first step to generate the initial segmentation result. After that, users will click $5$ points at each step in the following $4$ interaction steps (total of $25 + 5\times 4 = 45$ points), and these methods will iteratively refine previous segmentation results. The DeepIGeos method does not model the interaction sequence, and it just combines current and previous hint information to refine the previous segmentation. The experimental results are shown in Table~\ref{improvementTab} and Figure~\ref{improvementFig}. The results show that MECCA can perform better under the same amount of hint information and improve more dice scores at most steps. Compared with CNN-based methods, the main advantage of RL-based methods is that they can always keep notable improvement. There are two reasons for this result. The first one is that RL-based methods model the whole interaction process to avoid interaction conflict. The second reason is the relative entropy-based reward which encourages the model to keep refining results. However, we should realize, the RL-based methods still can not guarantee the high confidence of the corrective actions. As we can see in Figure~\ref{improvementFig}, the performance of IteR-MRL is not as good as other methods at the beginning, which is caused by numerous incorrect actions. However, after learning the confidence of actions and applying the self-adaptive reward to update the segmentation model, our proposed MECCA can perform well at each step and keep significantly refining the result. Figure~\ref{segproc} presents the visualization of the segmentation process of our proposed method. Since our proposed method models the whole interaction process, Figure~\ref{segproc} shows the current interaction step and its previous and next interaction steps. At each step, the second column is the confidence map. This study finds that the confidence value of object edges is always lower than in other regions, and these regions will receive more `punishment' when rewards are generated. This study observes that MECCA can gradually correct the edges around the user clicks (the red regions). \begin{table}[ht!] \centering \caption{The DICE of our method varies with the number of interactions under different difficult cases.} \label{tab:difficults-vs-interacts} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{|c|l|l|l|l|l|} \hline \rowcolor[HTML]{9B9B9B} \multicolumn{1}{|l|}{\cellcolor[HTML]{9B9B9B}} & \multicolumn{5}{c|}{\cellcolor[HTML]{9B9B9B}Interaction times} \\ \hline \rowcolor[HTML]{FFFFFF} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}1} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}2} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}3} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}4} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}5} \\ \hline \rowcolor[HTML]{FFFFFF} The easy case & 94.05 & 95.15 & 95.38 & 95.91 & 96.25 \\ \hline \rowcolor[HTML]{FFFFFF} The hard case & 41.45 & 47.38 & 65.78 & 77.79 & 79.37 \\ \hline \end{tabular}% } \end{table} \begin{table}[htb!] \centering \caption{MECCA's tolerance for inaccurate interaction points. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{tab:disturbed} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{|c|l|l|} \hline & DICE (\%) & ASSD (pixels) \\ \hline Disturbed Interactions & 88.75±9.72 & \textbf{1.11±0.23} \\ \hline Non-Disturbed Interactions & \textbf{90.29±5.07} & 1.50±0.33 \\ \hline \end{tabular}% } \end{table} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 4/10 testing instance, 7/30 channel, Liver 2 of MSD dataset.} \label{fig:sint1} \end{figure} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 6/10 testing instance, 18/30 channel, Liver 2 of MSD dataset.} \label{fig:sint2} \end{figure} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 7/10 testing instance, 10/30 channel, Liver 2 of MSD dataset.} \label{fig:sint3} \end{figure} Besides, we select the best and worst-performing samples from the test set for more analysis. The results are shown in the Table~\ref{tab:difficults-vs-interacts}. The improvement of easy samples through interaction is not considerable, but the improvement of hard samples through interaction can reach twice as much. However, significantly more interactions are required for hard samples to achieve the same segmentation accuracy of easy samples. Moreover, it is very difficult and time-consuming to accurately mark edge points in a real scene, and is less practical to ask user to click the accurate edge points. To verify MECCA's tolerance for inaccurate edge points, we conducted a robustness study under the same settings as Table~\ref{res1}. Specifically, during each interaction in the training phase, random noises are added to simulated edge points. The noise range is plus or minus $2$ voxels in the three directions of $x$, $y$, and $z$. In this way, the edge points used by the algorithm will be randomly selected from $64\;(4\times 4\times 4)$ voxels within the real edge point neighborhood. This disturbance radius can cover the edge ambiguity area in most cases. In the testing phase, we also adopted the same disturbance operation, and the final results are shown in Table~\ref{tab:disturbed}. From the table, it can be seen that the perturbed edge points will make the DICE value of the algorithm drop and have a more considerable variance. However, the maximum value of DICE exceeds the accurate edge points. The perturbed edge points can even exceed the performance of accurate edge points in the ASSD value. We believe that there may be two reasons for the above phenomenon. First, MECCA uses adaptive confidence calibration to improve the information-misunderstanding of the iterative algorithm, but it also makes the algorithm more ``conservative''. The perturbed edge point information may exceed the actual object boundary, which can make the segmentation effect of our method better or more ``radical''; Second, perturbing the interactive information during the training phase can enable the reinforcement learning algorithm to explore the environment (medical images). Existing SOTA reinforcement learning algorithms generally impose entropy constraints on the policy, enhance the randomness of the policy, and encourage exploration. Moreover, our perturbation of interactive information will indirectly affect the policy of the algorithm. In a word, MECCA has good robustness to inaccurate edge points. Finally, we show how different methods respond to the same user interactions according to the same initial segmentation, especially for hard cases. We selected some images with poor performance in baselines or MECCA as the research objects. Specifically, the generation mechanism of the same user interactions is described as following. Total $45$ hint points are randomly selected from the intersection area of the boundary of the foreground object and the error region of the initialization segmentation. Then, these $45$ points are allocated to the $5$ interactive steps of all methods according to the combination of $25$, $5$, $5$, $5$, and $5$. The number of hint points used in each interactive step is the same as that of all methods during training and testing. The results are shown in Figure~\ref{fig:sint1}-\ref{fig:sint3}. It can be seen from the results that MECCA can use the hint points information stably in all cases. The \textit{interactive misunderstanding} phenomenon arises in other methods. These method either ignore the expert's correction information, or even be adversely affected by correction information as in figures. \subsection{Comparison of Different Weighted Rewards} \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_mask.png} \caption{Visualization of the self-adaptive mask, the Error region mask and the Focal mask. All masks are obtained at the first interaction step. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \label{maskview} \end{figure} \begin{figure*}[ht!] \centering \subfigure[]{ \label{segproc} \includegraphics[width=0.8\textwidth]{fig_segproc.png}} \subfigure[]{ \label{weightview} \includegraphics[width=0.5\textwidth]{fig_rewardWeight.png}} \caption{\textbf{(a)} The segmentation process of MECCA. At each step, the first column is the action map, the second column is the confidence map, and the third column is the segmentation result with the user's hint information.\textbf{(b)} Average Dice scores of methods with different weighting rewards. The reward function of IteR-MRL is not weighted; the reward function of Focal-IteR-MRL is weighted via (\ref{focalreward}), the reward function of Err-IteR-MRL is weighted in segmentation error regions, and the the reward function of MECCA is weighted through action confidence. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \end{figure*} One main contribution of our work is that the self-adaptive reward mechanism is further proposed based on the confidence map. This mechanism makes different actions have different feedback levels so that the segmentation network can identify wrong actions as much as possible. To measure the impact of different reward weighting ways on the segmentation result, this study compares MECCA with the original IteR-MRL without weighting reward, the Focal-Reward IteR-MRL (Focal-IteR-MRL), and the one with weighted reward in segmentation error regions (Err-IteR-MRL). The Focal-Reward IteR-MRL adapt the idea of Focal loss~\cite{lin2017focal}: \begin{align} \label{focalreward} FocalReward_{i}^{(t)} \ &=\ \mathcal{X}_{i}^{(t-1)} - \mathcal{X}_{i}^{(t)}, \end{align} where \begin{equation} \mathcal{X}_{i}^{(t)}=\left\{\begin{array}{ll} -(1-p_{i})y_{i}\log(p_{i}^{(t)}) & \text { if } y_{i}=1, \\ -p_{i}(1-y_{i})\log(1-p_{i}^{(t)}) & \text { if } y_{i}=0. \end{array}\right. \end{equation} The reward function of Err-IteR-MARL is a linear scaling of reward of IteR-MARL: \begin{equation} \text{ErrReward}_{i}^{(t)}= \begin{cases} (1 + \lambda_i) \text{gain}_{i}^{(t)}, & \text { if voxel i is misclassified,} \\ \text{gain}_{i}^{(t)}, & \text { otherwise, } \end{cases} \end{equation} where $\lambda_i$ is a positive real number hyperparameter. The performance of different weighting rewards is shown in Figure~\ref{weightview}. Action-based reward weighting methods are more suitable for interactive segmentation since the improvement of our proposed method is more notable than other methods. Also, this study visualizes different masks that weigh the primary reward in Figure~\ref{maskview}. As we can see, the focal mask pays more attention to regions with low prediction probabilities, and the errors region mask contains all regions segmented incorrectly in the previous result. It is not enough for the focal mask to obtain more structured information by only considering the probability of prediction. As such, the performance of Focal-IteR-MRL is erratic, even the poorest on the left atrium dataset. The performance of Err-IteR-MRL is more stable than other methods, but the improvement is not notable. It is because that the weighting way of Err-IteR-MRL is based on the segmentation result while the refinement process of the interactive image segmentation is based on actions. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_weaklysup.png} \caption{Qualitative segmentation results of MECCA for BraTS2015 validation set. The first column shows the cropped original images. The second to fifth columns respectively show: the result of supervised learning only using $12.5$\% of labeled data, the results of weakly-supervised learning using $12.5$\% labeled and other unlabelled images, the result of supervised learning only using $25$\% of labeled data, the results of weakly-supervised learning using $25$\% labeled and other unlabelled images. Both supervised learning and weakly supervised learning is based on our proposed method.} \label{weakview} \end{figure} \subsection{Weakly-supervised Interactive Segmentation} \begin{table}[htbp] \caption{Quantitative comparison between MECCA and other methods on BraTS2015 Dataset of different sizes. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{weaktable} \centering \begin{tabular}{p{30mm}|ccccccr} \toprule[1pt] Data amount & 1/8 & 1/4 & 1/3 & 1/2 & 1/1 & $\triangle(1/8, 1/1)$ \\ \midrule P-Net &75.86 &80.83 &80.88 &83.02 &84.00 & $10.73\%$\\ DeepIGeos &85.50 &85.90 &87.70 &87.60 &88.32 & $3.30\%$\\ IteR-MRL &84.36 &86.54 &87.38 &88.66 &88.94 & $5.07\%$\\ UA-MT & 83.08 & 84.47 & 84.62 & 84.39 & 84.66 & \textbf{1.90\%}\\ MECCA &\textbf{87.14} &\textbf{88.23} &\textbf{88.31} &\textbf{89.17} &\textbf{90.29} & $3.60\%$ \\ \bottomrule \end{tabular} \end{table} As mentioned in Section~\ref{unlabeled}, MECCA can reduce the dependence on voxel-level annotations of images by using the simulated label generated from the action confidence map. This study validates Algorithm~\ref{alg:1} on the BraTS2015 dataset by randomly selecting different proportions of samples as fully labeled data and using the rest of the training images as unlabeled data, which only provided hint information when interaction. This study compares MECCA against the P-Net (without hint), DeepIGeos, and IteR-MRL~\cite{liao2020iteratively}. However, only MECCA uses unlabeled data, and the remaining three baselines only use a fixed proportion of labeled data. This does not fully demonstrate the performance of MECCA on semi-supervised problems. For this reason, we additionally introduce a state-of-the-art semi-supervised method UA-MT~\cite{yu2018pu}. \textcolor{black}{Table~\ref{weaktable} shows the results of different methods. MECCA achieves a Dice score of $87.14$\% with only $12.5$\% labeled data, and it performs better than the other methods with $25$\% labeled data.} Since UA-MT is not an interactive segmentation algorithm, its absolute performance is worse than interactive segmentation baselines but better than the non-interactive method P-Net. In addition, it can be seen from the last column of results that UA-MT has the most negligible performance loss on different proportions of labeled data. After MECCA introduces the simulated label generation mechanism, the performance loss can also be controlled at a similar magnitude to UA-MT. Interestingly, DeepIGeos can maintain a good performance loss without using a semi-supervised learning mechanism. Combined with the performance loss of IteR-MRL, we can conclude that in the semi-supervised interactive segmentation task, the interactive misunderstanding phenomenon will exacerbate the performance loss caused by the missing data. DeepIGeos and MECCA alleviate the interactive misunderstanding phenomenon through hard constraints and self-adaptive confidence calibration, respectively, so both of them can achieve better results under semi-supervised settings. However, it is worth mentioning that DeepIGeos does not consider multi-step interactions and the relationship between consecutive interactions. It cannot fully utilize long-term interactive information, so it has a large gap with MECCA in absolute performance. \textcolor{black}{Figure~\ref{weakview} shows the qualitative segmentation results of our method trained with different data sizes. It shows that the model trained with $12.5$\% labeled data can only capture the main region of the tumor. However, the model is unable to distinguish the infiltration areas of the tumor. For instance, the boundaries of tumors in the figure are hard to distinguish as it is more similar to these healthy regions. In this case, the models trained with little data tend to ignore these boundary regions of the tumor, while the model trained with both labeled data and unlabeled data can get more smooth and accurate boundaries. This phenomenon is mainly due to the distribution of the training set is not consistent with the validation set. The main advantage of the model trained with both labeled and unlabeled data is that it can minimize the gap between training and validation data.} \begin{table}[ht!] \centering \caption{DICE of the algorithm under different number of interactions and percentage of labeled data.} \label{tab:labeled-vs-interacts} \resizebox{0.6\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|} \hline \rowcolor[HTML]{9B9B9B} \% Labeled Data & \multicolumn{5}{c|}{\cellcolor[HTML]{9B9B9B}Interaction Steps} \\ \hline \rowcolor[HTML]{FFFFFF} & 3 & 4 & 5 & 6 & 7 \\ \hline \rowcolor[HTML]{FFFFFF} 25$\%$ & 84.03 & 86.18 & 88.23 & 87.32 & 88.24 \\ \hline \rowcolor[HTML]{FFFFFF} 33$\%$ & 85.32 & 87.60 & 88.31 & 87.99 & 88.53 \\ \hline \rowcolor[HTML]{FFFFFF} 50$\%$ & 85.39 & 87.07 & 89.17 & 88.93 & 89.13 \\ \hline \rowcolor[HTML]{FFFFFF} 100$\%$ & 89.93 & 90.40 & 90.29 & 89.85 & 90.79 \\ \hline \end{tabular}% } \end{table} We additionally test MECCA's performance under different interaction times and the percentage of labeled data, and the results are shown in Table~\ref{tab:labeled-vs-interacts}. Based on the experimental results, we can obtain the following conclusions: 1) if there is enough labeled data, MECCA can achieve good results after a few interactions; 2) the number of interactions required by MECCA to achieve the same performance is roughly inversely proportional to the number of labeled data; 3) although MECCA requires more interactions (about $2$-$3$ times the number of interactions) when only part of the labeled data is available, it can approach the algorithm's performance trained with all labeled data in the end. \subsection{Ablation Study} {\begin{table}[htbp] \caption{Ablation study of our proposed algorithm on the BraTS2015 dataset with $25\%$ labeled data and $75\%$ unlabeled data . Significant improvement (p-value < $0.05$) is marked in bold.} \label{ablation} \centering \begin{tabular}{p{18mm}p{20mm}p{20mm}|c} \toprule[1pt] Self-adaptive reward & Interaction guide & Simulated labels generation & Dice(\%) \\ \midrule & & &86.54 \\ \checkmark & & &87.21 \\ &\checkmark & &86.56 \\ & &\checkmark &88.01 \\ \checkmark &\checkmark & &87.24 \\ \checkmark &\checkmark &\checkmark &\textbf{88.23} \\ \bottomrule \end{tabular} \end{table}} {\begin{table}[htbp] \caption{Ablation study of our proposed algorithm on the Liver 2 dataset of MSD with $25\%$ labeled data and $75\%$ unlabeled data. Significant improvement (p-value $<0.05$) is marked in bold.} \label{ablation-add} \centering \begin{tabular}{p{18mm}p{20mm}p{20mm}|c} \toprule[1pt] Self-adaptive reward & Interaction guide & Simulated labels generation & Dice(\%) \\ \midrule & & & 66.43 \\ \checkmark & & & 67.45 \\ &\checkmark & & 66.56 \\ & &\checkmark & 67.93 \\ \checkmark &\checkmark & & 67.59 \\ \checkmark &\checkmark &\checkmark &\textbf{69.99} \\ \bottomrule \end{tabular} \end{table}} Table \ref{ablation} and \ref{ablation-add} shows the impact of different mechanisms to the MECCA. It is clear that the stimulative labels generation mechanism and self-adaptive reward mechanism significantly improve the algorithm's performance. The stimulative labels generation mechanism can achieve a $1.47\%$ and $3.56\%$ gain over the initial algorithm without any mechanisms for the Brats2015 and Liver 2 dataset, respectively. The main reason for this significant improvement is the utilization of these unlabeled data. \begin{table}[htbp] \caption{Quantitative comparison of interactive segmentation methods in computational and interaction time.} \label{Comtime} \centering \begin{tabular}{p{25mm}|p{55mm}p{50mm}c} \toprule[1pt] Methods & Total inference time per iteration & Interaction time per iteration \\ \midrule DeepIGeos &\textbf{510ms} &226ms \\ InterCNN &532ms &237ms \\ IteR-MRL &869ms &235ms \\ BS-IRIS &990ms &250ms \\ MECCA &631ms &\textbf{123ms} \\ \bottomrule \end{tabular} \end{table} \begin{table}[htb!] \centering \caption{Quantitative comparison of interactive segmentation methods in interaction time on realistic segmentation platform operated by experts. Demo video of MECCA is available at \url{https://bit.ly/mecca-demo-video}.} \label{tab:real-time} \resizebox{0.8\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|} \hline & \multicolumn{5}{c|}{Interaction Time (\textit{Second}, Real World)} \\ \hline Interaction Step(s) & 1 (25 points) & 2 (5 points) & 3 (5 points) & 4 (5 points) & 5 (5 points) \\ \hline DeepIGeos & 70 & 15 & 15 & 8 & 8 \\ \hline InterCNN & 76 & 19 & 18 & 8 & 7 \\ \hline IteR-MRL & 75 & 17 & 17 & 8 & 8 \\ \hline BS-IRIS & 80 & 20 & 20 & 11 & 10 \\ \hline MECCA & \textbf{41} & \textbf{12} & \textbf{11} & \textbf{5} & \textbf{5} \\ \hline \end{tabular}% } \end{table} Table~\ref{Comtime} shows the comparison of interactive segmentation methods in computational and interaction time. The result shows that the MECCA only takes half the time of other methods when performing an interaction. The main contribution to the reduction of interaction time is the interaction guide mechanism mentioned in Section~\ref{inter guid}. Furthermore, to explore the efficiency of MECCA in authentic tasks, we designed an interactive software platform. We asked oncologists to use it for natural interactive segmentation, and the results are in Table~\ref{tab:real-time}. It can be seen from the results that the MECCA algorithm also takes only about half of the time of the baselines due to the interaction guidance. In addition, as the segmentation results become more and more accurate, the interaction time required gradually decreases. \section{Conclusion} \label{conclusion} This paper presents a novel action-based confidence learning method for interactive 3D image segmentation. Specifically, this paper proposes to learn the confidence of actions that continuously refine the segmentation result during the interaction process so that hint information can be used more effectively. Based on this, the self-adaptive reward is proposed for the segmentation module, which can prevent the interactive misunderstanding phenomenon during the interaction and help reduce the time cost of interaction by providing users with the advice regions to interact next. Besides, the confidence map can also replace the ground truth to generate feedback for the unlabeled samples for the segmentation module. These samples without voxel-level annotations can also be used to train our model. By integrating these components, MECCA is demonstrated to medical segmentation efficiently via less voxel-level annotated samples. \section{Introduction} \label{introduction} Medical image segmentation is one of the essential tasks for computer-aided medical diagnosis. However, due to the pathological variability, dark lesion areas, as well as the uneven quality of the training data (lacking the consistency between imaging scanners, operators, and annotators), the accuracy of traditional convolutional neural networks (CNNs) type segmentation algorithms usually fail to meet clinical demands~\cite{wang2018interactive,wang2018deepigeos,liao2020iteratively}. To further refine the relatively inaccurate segmentation results, interactive image segmentation algorithms that take advantage of interactive correction information ({\em{e.g.}}, clicks, scribbles, or bounding boxes) are introduced~\cite{crajchl2016deepcut,xu2016deep,lin2016scribblesup,wang2018deepigeos,wang2018interactive,bredell2018iterative,liao2020iteratively,ma2020boundary-aware}. The general interactive segmentation process is depicted in Figure~\ref{interaction}, which contains two modules, {\em{i.e.}}, interactive module and utilization module. In the interactive module, the users (or experts) provide some interaction correction information ({\em{e.g.}}, hint information like clicks and scribbles). In the utilization module, the segmentation algorithm takes advantage of the interaction correction information to refine the previous model efficiently. The interactive segmentation algorithms can achieve better performance than traditional segmentation algorithms by utilizing the additional interactive correction information. The interaction process can be considered as the continuous cooperation between the model and the human expert. As a result, an excellent interactive segmentation model should understand experts' interactive information and update itself to collaborate better. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig-revised_interaction.pdf} \caption{The framework of the interactive segmentation process. Interactive module: the expert observes current (or initial) segmentation and provides further correction information (red hints); Utilization module: new segmentation is refined based on the correction information.} \label{interaction} \end{figure} \begin{figure}[htbp] \centering \subfigure[Correction information is ignored] { \label{badcase_b} \includegraphics[width=0.45\textwidth]{fig_badcase_b.png} } \subfigure[Refined result becomes worse] { \label{badcase_a} \includegraphics[width=0.45\textwidth ]{fig_badcase_a.png} } \caption{Segmentation refining failure after long-term interactions on BraTS2015 images: a) The segmentation model can not fully understand the hint information or just ignores it. b) The interactive segmentation model could misunderstand the expert's interaction correction, which results in the worse result;} \label{badcase} \end{figure} Methods such as BIFSeg~\cite{wang2018interactive} and DeepIGeos~\cite{wang2018deepigeos} model user interactions as hard constraints through conditional random fields (CRFs) end-to-end training. However, these model more focus on the \textit{one-step} interaction and the refined segmentation after the first step cannot be efficiently used in these model~\cite{liao2020iteratively,ma2020boundary-aware}. Thus, these model can not utilize the long-term interactive information but the short-term interactive information efficiently. The follow-up InterCNN~\cite{bredell2018iterative} and other methods~\cite{liao2020iteratively,ma2020boundary-aware} are improved on DeepIGeos and BIFSeg, modeling the problem as an \textit{iterative} interaction problem, which are more focus on the \textit{multi-step} interaction. Therefore, these method can cover the data distribution corresponding to different interaction levels in the training phase to effectively use long-term interactions, while ignoring the stochasticity or uncertainty of the model makes it difficult for them to effectively use short-term interactive information. Existing interactive methods cannot effectively utilize both short-term and long-term interactive information at the same time, which leads to the \textit{interactive misunderstanding} phenomenon\footnote{This phenomenon will be discussed in detail in the Section~\ref{action confidence}.}. Figure \ref{badcase} presents this phenomenon when implementing the popular interactive segmentation algorithm InterCNN~\cite{bredell2018iterative} on the BraTS2015 dataset. The algorithm ignores the expert's correction information as in Figure \ref{badcase_b}, and even be adversely affected by correction information as in Figure \ref{badcase_a}. These inconsistencies between hint information and the refined results indicate that existing algorithms still face the critical challenge of inefficiency utilization of interactive correction information. The reason for segmentation refining failure is that, at the end of the interactive procedure, the total loss of the model will guarantee the main area's priority and ignore some small but challenging areas, such as edges. The regions that are insensitive to interactive correction information could be considered hard-to-segment regions~\cite{nie2019difficulty,7780458}, which leads to mediocre segmentation refinement. If these regions are not paid more attention during the training stage, the segmentation model will inevitably dominate those easy-to-segment regions. This problem is more serious for medical images, where the hard-to-segment regions usually are tumor boundaries and are very important for clinical diagnosis and surgery. Therefore, it becomes urgent to improve the utilization of correction information, especially for the hard-to-segment regions. Besides, the requirement of large amounts of expert-annotated images is another crucial issue. On the one hand, accurate annotations of medical images require plenty of time of experts, so it is expensive to acquire sufficient data with high-quality annotations. On the other hand, more unlabeled images can be obtained with much less cost but existing popular interactive segmentation methods usually ignore utilizing these low-cost images. Thus it becomes more and more critical to reduce the need for expert-annotated images while simultaneously taking advantage of those unlabeled images. \begin{figure*}[ht!] \centering \subfigure[The architecture of MECCA.]{ \label{fig:framework} \includegraphics[width=0.95\textwidth]{fig-revised_framework.pdf}} \hspace{1cm} \subfigure[The testing stage of MECCA.]{ \label{testing} \includegraphics[width=0.85\textwidth]{fig-revised_testing.pdf}} \caption{\textbf{(a)} The architecture of MECCA. The segmentation module outputs actions to change the segmentation probability of each voxel(agent) at each interaction step. Meanwhile, the confidence network will estimate the confidence of actions, which will generate the self-adaptive reward and simulated label. The confidence map can provide the advice regions of the next interaction step to experts. \textbf{(b)} The testing stage of MECCA. In the first instance, all voxels in the segmentation probability map are initialized to a fixed value (set to $0.5$ in the experiment). Users or experts randomly mark hint points according to the initialized segmentation probability map.} \end{figure*} In this paper, we propose a novel interactive segmentation algorithm for 3D medical images called interactive {\bf{ME}}dical segmentation with self-adaptive {\bf{C}}onfidence {\bf{CA}}libration (MECCA). MECCA combines an action-based confidence learning network with the multi-agent reinforcement learning framework. The action-based confidence network could evaluate the corrective actions' quality by directly calculating the refinement actions' confidence. Unlike learning the confidence of the overall segmentation result, the confidence of actions could better evaluate whether the segmentation model has correctly utilized the experts' interactive correction information. We formulate the iterative interactions process as a Markov decision process(MDP) to model the dynamic process and further introduce the reinforcement learning technique~\cite{song2018seednet}. Further, instead of setting each image or each patient (a series of images) as the agent, we consider each voxel\footnote{The smallest unit in three-dimensional space.} as an agent while each agent aims to learn the segmentation policy and makes its decision~\cite{furuta2019pixelrl}. Specifically, after receiving the interactive correction information, each agent will modify its label by changing (increasing or decreasing) the category probability. The novel action-based confidence network will directly evaluate each agent's corrective action obtained from the corrective policy of MARL. By utilizing this action-based confidence network, two additional techniques are further proposed to improve the utilization efficiency of the interactive correction information: 1) compared with former manual-designed rewards, a self-adaptive reward function of each action is constructed, which could provide more meticulous feedback under a flexible framework; 2) a simulated label generation mechanism is established by utilizing the interactive correction information as the weakly supervisory signal. By combining the confidence network, the simulated label generation mechanism can approximately generate the labels for unsupervised images and reduce over-reliance on labeled data. The overall algorithm framework of our proposed algorithm is shown in Figure~\ref{fig:framework}. The main contributions of this work are summarized as follows: 1) A novel framework is proposed for interactive medical image segmentation by combining action-based confidence learning network with multi-agent reinforcement learning; 2) A self-adaptive feedback mechanism (self-adaptive reward) is constructed with the action-based confidence network to alleviate the effect of interactive misunderstanding phenomenon during the interaction process; 3) Simulated supervisory signals can be generated based on the confidence learning network and actions; hence much less labeled data (ground truth data) are needed to achieve the same performance. The following is the roadmap of this paper. Section \ref{related work} provides a brief but complete introduction to related works in image segmentation and interactive image segmentation, while the background material on confidence learning is also provided. Section \ref{method} describes the proposed interactive image segmentation algorithm, including the segmentation policy, the evaluation of corrective actions, the self-adaptive rewards, and the label generation scheme. Extensive experiments are presented in Section \ref{exp}. Conclusions and future work discussions are proposed in Section \ref{conclusion}. \section{Related Works}\label{related work} Image segmentation is the fundamental problem of computer vision or image processing that has been widely and long-termly studied. Deep learning (DL) has further promoted the development of automatic segmentation algorithms, the same as other applications. CNN-type methods are typical DL algorithms for image segmentation, e.g., fully convolutional networks (FCN) ~\cite{long2015fully} and DeepLab ~\cite{chen2017deeplab}. The U-Net~\cite{ronneberger2015u}, which is considered an evilutionary variant of FCN, becomes one of the SOTA methods and performs better for medical image segmentation. Medical image segmentation is the key to modern auxiliary diagnosis and treatment response evaluation. A series of related works were proposed with the progressive performance for medical image segmentation ~\cite{milletari2016v,kamnitsas2017efficient,li2017compactness}. In the following, we will review the development of interactive image segmentation methods and discuss confidence learning for image segmentation relevant to our proposed algorithm. \paragraph{Traditional interactive image segmentation methods.} The classical random Walk~\cite{grady2006random} can create a weight map with pixels as vertices and segment the image based on user interactions. GrabCut~\cite{rother2004grabcut} and GraphCut~\cite{boykov2001interactive} could associate image segmentation with the maximum flow and minimum cut algorithms on graphs, respectively, while Geos ~\cite{criminisi2008geos} was proposed to measure the similarity between pixels geodesic distance. These traditional interactive image segmentation methods aim to utilize additional expert interaction information to modify the segmentation performance further. \paragraph{DL-based interactive image segmentation methods.} \cite{xu2016deep} segments images based on CNN interactively. DeepCut~\cite{crajchl2016deepcut} and ScribbleSup~\cite{lin2016scribblesup} both employed weakly supervised expert hints to establish interactive image segmentation methods. DeepIGeoS~\cite{wang2018deepigeos} employed geodesic distance metric to construct a hint map. The interactive segmentation process can be considered as a sequential iterative process. It becomes natural to introduce the RL framework to model the interactive segmentation process. Polygon-RNN~\cite{castrejon2017annotating} fundamentally segmented each target as a polygon and iteratively chose the polygon vertexes through a recurrent neural network(RNN). Polygon-RNN+~\cite{acuna2018efficient} employed almost the same idea of Polygon-RNN but learned to choose vertexes by RL. SeedNet~\cite{song2018seednet} trained an expert interaction generation RL model, which obtains new simulated interaction information at each interaction step. IteR-MRL~\cite{liao2020iteratively} and BS-IRIS~\cite{ma2020boundary-aware} both modeled the dynamic interaction process as an MDP and employed multi-agent RL(MARL) models to segment images. Some researches also aim to reduce the annotation cost of interactive image segmentation. IFSL \cite{9358206} introduces interactive learning into the few-shot learning strategy and addresses the annotation burden of medical image segmentation models. IOG~\cite{9157733} proposes a practical Inside-Outside Guidance approach for minimizing the labeling cost. These interactive methods are difficult to effectively utilize experts' short-term and long-term interaction information simultaneously, thus making error correction operations. \paragraph{Uncertainty estimation for image segmentation} Uncertainty estimates are helpful in the context of deployed machine learning systems as they are capable of detecting when a neural network is likely to make an incorrect prediction or when the input may be out-of-distribution. Traditionally, much of the work are inspired by Bayesian statistics, or Bayesian Neural Network (BNN)~\cite{mackay1992practical,neal2012bayesian}. Unfortunately, Bayesian inference is computationally intractable in practice, so much effort has been put into developing approximations of Bayesian neural networks that are easier to train. Recent efforts to approximate the BNNs in this area include Monte-Carlo Dropout~\cite{gal2015dropout}, Multiplicative Normalizing Flows~\cite{louizos2017multiplicative}, and Stochastic Batch Normalization~\cite{atanov2019uncertainty}. These methods are capable of producing uncertainty estimates, although with varying degrees of success. The main disadvantage with these BNN approximations is that they require sampling to generate the output distributions. As such, uncertainty estimates are often time-consuming or resource-intensive to produce, requiring $10$ to $100$ forward passes through a neural network to produce useful uncertainty estimates at inference time. An alternative to BNNs is ensembling methods~\cite{dietterich2000ensemble,kamnitsas2017ensembles,mehrtash2018automatic,lakshminarayanan2016simple,mehrtash2020confidence}, which propose a frequentist approach to the problem of uncertainty estimation by training many models and observing the variance in their predictions. However, this technique is still quite resourcing intensive, as it requires inference from multiple models to produce the uncertainty estimate. A promising alternative to sampling-based methods is to instead have the neural network learn what its uncertainty should be for any give input, i.e., \textit{learning-based uncertainty estimation} or \textit{confidence learning}, as demonstrated in~\cite{kendall2017uncertainties,devries2018learning,robinson2018real,devries2018leveraging,jungo2019assessing,moeskops2017adversarial,hung2018adversarial,nie2019difficulty}. These methods commonly consist of a segmentation and confidence network and are more computationally efficient than other techniques. Thus they are better suited when computational resources are limited or when real-time inference is required, such as the interactive segmentation scenario considered in this paper. Specifically, \cite{kendall2017uncertainties} introduces a confidence network to predict the \textit{aleatoric} and \textit{epistemic} uncertainties by imitating classic Bayesian tools. The segmentation network of \cite{devries2018learning,devries2018leveraging} produces two separate outputs: prediction probabilities and a confidence estimate. Confidence estimates are motivated by interpolating between the predicted probability distribution and the target distribution during training, where the degree of interpolation is proportional to the confidence estimate. A series of work~\cite{nie2019difficulty,hung2018adversarial,moeskops2017adversarial} focus on incorporating the uncertainty estimation into the adversarial learning process, where the segmentation network corresponds to the generator, and the confidence network is the discriminator accordingly. \cite{moeskops2017adversarial} firstly employed GANs to improve the CNN-based brain MRI segmentation method. The semi-supervised learning technique is used in~\cite{hung2018adversarial} to predict trustworthy regions in unlabeled images. \cite{nie2019difficulty} proposed a difficulty-aware attention mechanism to handle those hard samples or challenging regions. Different from the previous work to learning uncertainty through imitation, joint training, or adversarial learning, a simple but powerful alternative is to introduce an auxiliary task, such as to predict the overlap between a proposed segmentation and its ground truth~\cite{robinson2018real}, or to predict the voxel-wise false positive and false negative~\cite{jungo2019assessing}.\\ \noindent{\bf{Remark.}} In our proposed algorithm, the confidence network should evaluate the confidence of calibrating actions instead of the segmentation result, which is the most significant difference between our interactive method and previous learning-based uncertainty estimation methods. Therefore, we design a novel action-oriented auxiliary task to predict whether the \textit{direction} of voxel-wise action is consistent with the ground truth. \section{The Proposed Algorithm}\label{method} This section will introduce our proposed interactive segmentation algorithm MECCA, which can iteratively evaluate the refinement actions and feedback to the segmentation model. The algorithm framework follows the multi-agent reinforcement learning structure (Section~\ref{MARL} and Section~\ref{seg train}) and an action-based confidence learning module (Section~\ref{action confidence}) is introduced to evaluate the confidence of corrective actions. This action-based confidence learning module can be used to establish the self-adaptive reward scheme and simulated label generation mechanism to utilize the interactive correction information efficiently. The architecture overview of MECCA has been depicted in Figure \ref{fig:framework}. The model's state information includes the original 3D image, the previous segmentation probability, and the hint map generated from interaction and confidence maps. Based on the current state information, the segmentation module gives suggested actions to refine previous segmentation results by adjusting the segmentation probability of each voxel (agent). Further, the state information will be utilized to evaluate the confidence of obtained actions through the confidence network, with a confidence map as the output. The self-adaptive reward is designed through a self-adaptive weighting scheme based on the action confidence evaluation (Section~\ref{self adaptive reward}). The self-adaptive reward map can be considered a value map with the same size as the original input image (each agent has its self-adaptive reward), which can reflect the performance of the corresponding agent's action. Besides, MECCA will suggest some low confidence regions for the user to interact next (Section~\ref{inter guid}). Besides, the confidence map can also be used to generate the simulated label by comparing it with actions, which will be described in Section~\ref{unlabeled}. The newly obtained hint map, the adjusted segmentation probability result, and the original 3D image form a new state. The process described above is repeated until the segmentation result meets requirements. To emphasize, during the testing stage in Figure~\ref{testing}, there is no need to calculate the self-adaptive rewards, and at the same time, we only need the obtained actions and suggested interaction areas. \subsection{MARL-driven Interactive Segmentation Framework} \label{MARL} This study employs the multi-agent reinforcement learning structure to formulate the interactive segmentation process and continuously give error-corrective actions at each interaction step. Let ${\mathbf{x}} = \left( x_1, \cdots, x_N \right)$ denotes the input image and $x_i$ denotes the $i$-th voxel of the image. In the setting of MARL, every voxel $x_i$ is treated as an agent with its own refinement policy $\pi_i({a_i}^{(t)},{s_i}^{(t)})$. At time step $t$, agent $x_i$ gets action ${a_i}^{(t)}$ from the segmentation network according to its current state ${s_i}^{(t)}$. After taking the action, agent will receive a reward ${r_i}^{(t)}$ according to the segmentation result. The state ${s_i}^{(t)}$ for agent $x_i$ is concentrated by its voxel value $b_i$, its current segmentation probability ${p_i}^{(t)}$ and the value ${h_i}^{(t)}$ on the hint map. In particular, the segmentation probabilities of all agents are initialized to 0.5 and range from 0 to 1. The hint map ${h}^{(t)}$ is transformed from the user’s hints which are in the form of edge points. At each step, users click on some edges, which are not correctly predicted, as hints. In order to let the model receive hint information, we generates a 3D Gaussian (with $8$-voxels kernel size) centered on each of the edge points as the hint map input to the segmentation network. The action ${a_i}^{(t)}$ for agent $x_i$ is sampled from its policy and used to adjust its previous segmentation probability: \begin{equation} a_i^{(t)}\sim\pi_{\theta}(a_i^{(t)}|s_i^{(t)}), \end{equation} \begin{equation}\label{eq:clip} p_i^{(t+1)}= \ clip(p_i^{(t)}+a_i^{(t)},0,1), \end{equation} where ${a_i}^{(t)} \in \mathcal{A}$ and the $clip$ operation modifies the probability to the interval [0,1]. The action set $\mathcal{A}$ contains actions of different scales, allowing the agent to select the proper action. In our setting, the $\mathcal{A}= \{\pm0.1, \pm0.2, \pm0.4\}$. $0$ is not used as one of the actions is mainly due to the following three reasons: 1) in the early stages of the experiment, we found that using $0$ as action will make the algorithm converge slow, and it requires more than $2$ times the number of interactions to achieve the performance of baselines. Therefore, we remove $0$ from the action space and encourage the agent to explore in the early stage of training. Not only does the algorithm converge faster, but it also requires fewer interactions; 2) in order to prevent the algorithm's output from exceeding the valid range, we have clipped the output action (this is also a common technique in reinforcement learning in order to ensure that the output of the policy is in the valid range), as shown in the (\ref{eq:clip}). 3) due to the existence of the self-adaptive confidence calibration mechanism, the action output by the algorithm will generally change in the direction of the correct label. Combined with the clipping technique used in the second point, the algorithm can guarantee effectual output even if there is no $0$-action. The reward ${r_i}^{(t)}$ is the feedback (positive or negative) of the action and used to update the refinement policy. The design of reward is a significant part of our algorithm, and we will introduce it in details in Section~\ref{self adaptive reward}. \subsection{Segmentation Network} \label{seg train} \begin{figure*}[ht!] \centering \includegraphics[width=\textwidth]{fig-revised_network.pdf} \caption{{The detailed architecture of the segmentation network. The confidence network architecture is the same as the value branch of the segmentation network, but the parameters are not shared. $|A|$ represents the size of the action space.}} \label{network} \end{figure*} The segmentation network adopts the P-Net, proposed in ~\cite{wang2018deepigeos}, as the backbone. The segmentation network $\bm{S}$ has two heads: policy head and value head. Two heads share the first three 3D convolutional blocks to extract low-level features. Each of the blocks has two convolution layers and the size of the convolution kernel is fixed as 3×3 in all these convolution layers. All the convolution kernels are dilated convolution, which can reduce the loss of the resolution. Both of the heads have another two 3D convolutional blocks to extract specific high-level features. The detailed architecture is shown in Figure~\ref{network}. Specifically, the policy head is to output the policy $\pi_i({a_i}^{(t)},{s_i}^{(t)})$, which is the distribution of action probabilities under current state. By taking actions on different scales, the probabilities will be dynamically adjusted. The value head is to estimate the value of the current state, which evaluates how good the current state is and estimates the expected return: \begin{equation} V_i^{(t)} = \mathbb{E} \left[ R_i^{(t)} \big| s_i=s_i^{(t)} \right] = \mathbb{E} \left[ {\textstyle{\sum_{k=t}^{\rm T}}} \gamma^{t-1} r_{i}^{(t)} \right], \end{equation} where $T$ is the terminal time step in the interaction process, and $\gamma$ is the discount factor. $\theta_v$ denotes the parameters of the value head, and the gradient with respect to $\theta_v$ is: \begin{equation} {\hbox{d}}_{\theta_{v}}=\nabla_{\theta_{v}} A^{2} \big( s^{(t)}, a^{(t)} \big), \label{critic} \end{equation} \begin{equation} A\big(s^{(t)}, a^{(t)}\big)= {\textstyle{\sum_{k=t}^{T}}} \gamma^{k-t} \bar{r}^{(k)}-V \big(s^{(t)}\big), \end{equation} where $\overline{r}^{(k)}$ is the mean reward of all voxels at timestep $k$. $A(\bm{s}^{(t)}, \bm{a}^{(t)})$ represents the advantage function~\cite{Mnih2016AsynchronousMF}. The goal of the policy head is to maximize the expected return by selecting proper actions in state $\bm{s}^{(t)}$. This study uses $\theta_p$ to denote the parameters of the policy head, and the gradient for $\theta_p$ is denoted as \begin{equation} {\hbox{d}}_{\theta_{p}} = -\nabla_{\theta_{p}} \pi\big(a^{(t)} | s^{(t)}\big) A\big(a^{(t)}, s^{(t)}\big). \label{actor} \end{equation} Usually, the policy head is updated after the value head. \subsection{Action Confidence Learning} \label{action confidence} As we mentioned in section \ref{introduction}, there will be some situations where the segmentation model misunderstands or ignores the hint information. To some extent, these samples (or regions) with the phenomenon of interactive misunderstanding are hard samples (or regions). Although these samples may account for a small percentage of the dataset, they are critical for improving generalization and robustness. The most important thing is finding a \textit{professional easy-or-hard representer}~\cite{nie2019difficulty} to identify them when interacting. Focal loss~\cite{lin2017focal} evaluates the hard-or-easy samples through predicted probability. ~\cite{nie2019difficulty} applies adversarial learning to train the easy-or-hard representer. Both of them have their advantages, but all evaluate hard-or-easy samples based on the final segmentation result. As such, these methods cannot be directly applied to interactive segmentation. For example, if the model predicts the category probability of a voxel to be $0.8$ ($p_i^{(t)}$ = $0.8$), and then takes an action $a_i^{(t)}$ = $-0.1$. The next prediction will be $0.7$ after interaction ($p_i^{(t+1)}$ = $0.7$). If $y_i=1$, before and after results are all correctly predicted because $p_i^{(t)}$ and $p_i^{(t+1)}$ are all greater than 0.5. While for interactive segmentation, the probability is changing in the wrong direction. This change is what we called the \textit{interactive misunderstanding} phenomenon and the formally definition is shown in following. \begin{definition}[\textit{Interactive Misunderstanding}] For a binary classification problem, the sign of the foreground label $y=1$ is denoted as \textit{positive}, and the sign of the background label $y=0$ is denoted as \textit{negative} accordingly. In an interactive medical image segmentation task (i.e. a voxel-wise binary classification problem), for any voxel $i$, if the sign of the change of segmentation probability output by algorithm for two consecutive interaction steps \textit{sign($\triangle(p^{(i)})$)} is not equal to \textit{sign($y_i$)}, then this phenomenon is defined as \textit{interactive misunderstanding}. \end{definition} Our proposed confidence network learns the confidence of given actions to avoid misunderstanding hint information and take accurate actions. We argue that confidential information can be used to regularized action choices and suggest more efficient interaction. The confidence network structure also uses P-Net ~\cite{wang2018deepigeos} as the backbone The confidence network contains six 3D convolutional blocks. Each of the blocks has two convolution layers, and the size of the convolution kernel is fixed as 3×3 in all these convolution layers. The detailed architecture is shown in Figure~\ref{network}. The confidence network is trained using the previous state and action as input and a confidence map as output. The confidence network is optimized by minimizing the summation of binary cross-entropy loss over actions (shown in (\ref{CLoss})) at each time step $t$. Here we use $\bm{C}$ to denote the confidence network, $w_{\bm{C}}$ denotes the parameters of the confidence network, while $L_{BCE}$ denotes the binary cross-entropy loss: \begin{equation} \begin{aligned} &L_{\bm{C}}(s^{(t)}, a^{(t)} ; w_{\bm{C}})\\ =& L_{B C E}(\bm{C}(s^{(t)}, a^{(t)}), \operatorname{g}^{(t)}) + L_{B C E}(\bm{C}(s^{(t)},-a^{(t)}), 1-\operatorname{g}^{(t)}), \end{aligned} \label{CLoss} \end{equation} where \begin{equation} \operatorname{g}^{(t)}=\left\{\begin{array}{ll} 0 & \text { if } a^{(t)} \oplus y^{(t)}==1, \\ 1 & \text { otherwise }, \end{array}\right. \end{equation} where $\operatorname{g}^{(t)}$ means whether the direction of action is consistent with the label. $a\oplus b$ is defined as that the statement is only true if either $a>0$ or $b>0$, but not both. One potential issue when training the confidence network is the imbalance of samples. Early in RL training, the error rate of actions output by the segmentation network is very high, while most actions are correct when the network gradually converges. Inspired by the training of the discriminator in generative adversarial networks, this study introduces symmetric samples into the (\ref{CLoss}) to speed up training. An obvious advantage is that it improves sample utilization efficiency because the confidence network can know what a ``bad sample" is and get a corresponding ``good sample." \subsection{Self-Adaptive Reward} \label{self adaptive reward} Essentially, no matter applying focal loss or adversarial learning to the training of the segmentation model, they all try to weigh these hard samples to prevent the model dominated by easy samples. However, the interactive segmentation task differs from those fully automatic segmentation tasks because the interactive segmentation model needs to cooperate with the user and understand the user's hint information. The action to refine the segmentation result shows how the segmentation model understands hint information. Therefore, it is necessary to ensure that the hint information is correctly understood and the correct action is taken. Specifically, the previously described action-confidence learning can provide the segmentation model with a confidence map to alleviate the interactive misunderstanding phenomenon. By this confidence map, hard-or-easy samples can be better recognized as the confidence values for these 'hard regions' are relatively lower than in other regions. This paper formulates this voxel-level action-aware as the self-adaptive reward function, $r^{(t)}$, which is shown in (\ref{action-aware}), to adapt this mechanism to the training of MARL: \begin{equation} \begin{aligned} r^{(t)} = {\textstyle{\sum_{i=1}^{N}}} \alpha\left(2-c_{i}\right)^{\beta}{gain}_i^{(t)}, \end{aligned} \label{action-aware} \end{equation} where $c_{i}$ is the value on the confidence map. The setting of hyperparameters $\alpha$ and $\beta$ are described in Section \ref{details}. In addition, ${gain}_i^{(t)}$ denotes the relative gain of cross-entropy: \begin{align} \label{reward} {gain}_i^{(t)} \ = \mathcal{X}_{i}^{(t-1)} - \mathcal{X}_{i}^{(t)}, \end{align} \begin{align} \label{cross entropy} \mathcal{X}_{i}^{(t)} \ =\ -y_{i}\log(p_{i}^{(t)})-(1-y_{i})\log(1-p_{i}^{(t)}), \end{align} where $\mathcal{X}_{i}^{(t)}$ denotes the cross-entropy between current segmentation probability and ground truth. If an agent gets a positive reward, its current action is good, and the refined segmentation result is closer to the ground truth. With the self-adaptive reward function in (\ref{action-aware}), the confidence value $c_i$ of these wrong actions is lower, and they will be punished more when training our segmentation model. \subsection{Interaction Guide} \label{inter guid} Another challenge for interactive image segmentation is that users usually need to decide where to interact in many slices, which is very time-consuming, especially for 3D images. Our framework also provides users with an interaction guide mechanism to save the user's interaction time. After refinement, our framework will suggest some possible areas for users to interact with next. Specifically, our framework will filter out those areas with low action confidence and provides them for users (see Figure~\ref{InterGuid}). Firstly, the original 3D image will be segmented with super voxels; each super voxel can be regarded as a group of voxels that share common characteristics. We use simple linear iterative clustering (SLIC)~\cite{Achanta2012SLICSC} technique with \textit{spacing} $=[2,2,2]$, \textit{compactness} $=0.1$ to generate supervoxels, and the number of initial supervoxels equals to $100$ and gradually declines during the refinement iterations for training and testing. Secondly, the proposed algorithm will compute the mean action confidence in each super voxel and rank them in descending order. Finally, the top $5$ super voxels will be marked and recommended to users. What users need to do is to select the best interaction positions from these super voxels. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_GuidInteraction.png} \caption{The illustration of interaction guide mechanism. The areas surrounded by the green lines are advice regions provided to users, and the red point is the real hint information selected from advice regions. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \label{InterGuid} \end{figure} \subsection{Simulated Label Generation} \label{unlabeled} \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig-revised_labelgen.pdf} \caption{The illustration of simulated label generation. The simulated label generation mechanism utilizes the confidence map and the action map to generate the simulated label. The confidence map is used to calibrate the action, and the direction of the calibrated action is the simulated label of each voxel.} \label{labelgen} \end{figure} In medical imaging, the unlabeled data is much more than labeled data due to difficulties in labeling medical images. To address this lack of annotations, the proposed algorithm leverages the action confidence not only to improve the utilization efficiency of hint information but also to generate a simulated label, shown in Figure \ref{labelgen}, for unlabeled data. We define the simulated label as follow: \begin{equation} \label{simulated label} \hat{y}^{(t)}=\left\{\begin{array}{ll} 1 & \text { if } a^{(t)} \oplus c^{(t)}==1, \\ 0 & \text { otherwise }. \end{array}\right. \end{equation} The $\hat{y}^{(t)}$ is the simulated voxel-level label generated from the confidence map and detailed illustration is shown in Figure~\ref{labelgen}. Based on this mechanism, this study considers using these unlabeled data to assist in training the segmentation network. Specifically, this study divides the dataset into two parts during the training stage: the first part contains voxel-level annotation information, and the second part contains only hint information during training. The labeled data is trained as above, while the unlabeled data is trained with the simulated label. During the training stage, the backward of gradients will be masked: \begin{equation} \begin{aligned} d \theta_{v}=M\nabla_{\theta_{v}} A\big(s^{(t)}, a^{(t)}\big)^{2}, \end{aligned} \label{fake_v} \end{equation} \begin{equation} \begin{aligned} d \theta_{p}=M\nabla_\pi \big(a^{(t)} | s^{(t)} \big) A \big(a^{(t)}, s^{(t)} \big), \end{aligned} \label{fake_p} \end{equation} where \begin{equation} \begin{aligned} M = I(max(c^{(t)},1-c^{(t)})>\delta). \end{aligned} \label{mask} \end{equation} $A\left(\boldsymbol{s}^{(t)}, \boldsymbol{a}^{(t)}\right)$ is the advantage (which is defined in~\cite{Mnih2016AsynchronousMF}) at time step $t$ of taking $a^{(t)}$ in condition of state $s^{(t)}$, which indicates the actual accumulated reward without being affected by the state and reduces the variance of gradient. A mask, $M$, is used to constraint the training of unlabeled data. The gradients of unlabeled data backward only when the action confidence exceeds the threshold $\delta$ (which is gradually increased during the training process). Unlike traditional pseudo-label training, the supervised signal does not come from the segmentation but the confidence network. These filtered data with hint information are more valuable and provide more accurate supervised signals. Generally, the training process with labeled and simulated labeled data is carried out simultaneously. When using the simulated label generation mechanism, the pseudocode is shown in {\bf{Algorithm~\ref{alg:1}}}. \begin{algorithm} \caption{MECCA: Interactive Medical Image Segmentation with Self-Adaptive Confidence Calibration} \label{alg:1} \begin{algorithmic}[1] \STATE Initialize the segmentation network $\bm{S}$ with $\theta$; \STATE Initialize the confidence network $\bm{C}$ with $w$; \FOR{every sample in labeled datasets} \STATE Set the segmentation probability of each voxel to $0.5$; \STATE $s^{(0)} \leftarrow (x,p^{(0)},h^{(0)})$; \FOR{every interaction time step $t$} \STATE Take action $a^{(t)} \leftarrow S(s^{(t)})$; \STATE Get reward $r^{(t)}$ and observe the next state $s^{(t+1)}$; \STATE Compute the gradient of $\bm{S}$ via (\ref{critic}) and (\ref{actor}); \STATE Compute the gradient of $\bm{C}$ via (\ref{CLoss}); \ENDFOR \STATE Get a sample ($x', y'$) from unlabeled dataset; \STATE Initialize the state: $s'^{(0)} \leftarrow (x',p'^{(0)},h'^{(0)})$; \FOR{every interaction time step $t$} \STATE Take action $a'^{(t)} \leftarrow S(s'^{(t)})$; \STATE Generate the simulated label $\hat{y}^{(t)}$ by (\ref{simulated label}); \STATE Observe the reward and next state $s'^{(t+1)}$; \STATE Compute the gradient of $\bm{S}$ via (\ref{fake_v}) and (\ref{fake_p}). \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \section{Experiments and results} \label{exp} \subsection{Dataset and Implementaion details}\label{details} To comprehensively evaluate our proposed method, we apply our algorithm to four 3D medical image datasets. All datasets are divided into two parts: $D_{train}$/$D_{test}$. The details of these datasets are as follows: 1) \textbf{BraTS2015}: Brain Tumor Segmentation Challenge $2015$ ~\cite{menze:hal-00935640} contains $274(234/40)$ multiparametric MRI(Flair, T1, T1C, T2) from brain tumor patients. In our task, we only use the Flair image and segment the whole brain tumor. 2) \textbf{BraTS2020}: Brain Tumor Segmentation Challenge $2020$ ~\cite{menze:hal-00935640} contains $285(235/50)$ multiparametric MRI(Flair, T1, T1C, T2) from brain tumor patients. In our task, we only use the Flair image and segment the whole brain tumor. 3) \textbf{MM-WHS}: Multi-Modality Whole Heart Segmentation~\cite{zhuang2016multi} contains $24(20/4)$ multi-modality whole heart images covering the whole heart substructures. In our task, this study chooses to segment the left atrium blood cavity. 4) \textbf{Medical Segmentation Decathlon}: This is a generalisable 3D semantic segmentation datasets containing different organ segmentation tasks~\cite{simpson2019large}. This study chooses to use the spleen and liver dataset, which provides $61(41/20)$ and $106(96/10)$ CT images respectively. We implement our method with PyTorch~\cite{NEURIPS2019_9015}\footnote{The demo video of MECCA algorithm is available at \url{https://bit.ly/mecca-demo-video}.}. The segmentation and confidence network are both initialized by Xavier~\cite{glorot2010understanding} method, and learning rates are initialized to $1e-4$. Other parameters are set as follow: $T=5$, $\gamma=0.95$, $\alpha=0.8$, $\beta=1$. The mask $M$ ranges from $0.85$ to $0.99$ and ascents $0.00025$ at every epoch. Adam~\cite{kingma2014adam} is adopted as the optimizer. The original image is cropped by the bounding box based on the ground truth with a random extension in the range of $1$ to $11$ voxels. Each image is then resized and normalized to $55 * 55 * 30$. The data is augmented by random flip and rotation. The proposed algorithm training time with one Nvidia 2080ti GPU varies from $5$ to $13$ hours for different datasets. \subsection{Interaction Settings and Evaluation Metrics} \begin{figure}[ht!] \centering \includegraphics[width=0.6\textwidth]{fig_res1.png} \caption{Visualization of segmentation results by different methods. The green lines represent the boundaries of ground truth, and the yellow lines represent the predictive boundaries.} \label{view1} \end{figure} During the process of interaction, this study adopts the edge points as the hint information for two reasons. On the one hand, click operation saves more time than scribbles or other interactive ways. On the other hand, edge points can provide more information about object edges as the bottleneck of medical image segmentation is usually the inaccurate segmentation of object edges. Specifically, this study provides each method with $45$ points\footnote{Please refer to Section IV-C for details.} during the whole interaction process. At every step, users will click some edges which are not correctly predicted. This study generates a 3D Gaussian (with $8$-voxels kernel size) centered on each of the edge points as the hint map to let networks receive hint information. Then the hint map will be input to the segmentation network as part of the state. This study will use the Dice score and the average symmetric surface distance (ASSD) to evaluate the performance of the segmentation result. According to these evaluation metrics, doctors can judge the patient's condition: $$ {\text{Dice}}(S_p, S_g) = (2|S_p \cap S_g|) / (|S_p| + |S_g|), $$ where $S_p,S_g$ denote the prediction of an algorithm and the ground truth respectively. $$ {\text{ASSD}} = \big({\textstyle{\sum_{i \in \mathcal{S}_{a}}}} d\left(i, \mathcal{S}_{b}\right) + {\textstyle{\sum_{i \in \mathcal{S}_{b}}}} d\left(i, \mathcal{S}_{a}\right)\big) / (\left|\mathcal{S}_{a}\right|+\left|\mathcal{S}_{b}\right|), $$where $\mathcal{S}_{a}$ and $\mathcal{S}_{b}$ represent the set of surface points of the segmentation result predicted by the algorithm and the ground truth, respectively. $d\left(i, \mathcal{S}_{b}\right)$ is the shortest Euclidean distance between $i$ and $\mathcal{S}_{b}$. The Dice score and ASSD in all tables are the average value of five test results of algorithms. \subsection{Comparisons with State-of-the-art Methods} \begin{table} \caption{Dice scores at each interaction step by different methods. The value in parentheses represents the improvement relative to the previous step.} \label{improvementTab} \centering \scalebox{0.9}{ \begin{tabular}{c c c c c c c} \toprule[1pt] Step & 1 & 2 & 3 & 4 & 5 \\ \hline \multirow{2}{*}{DeepIGeos} & 87.36&87.53&87.67&87.99&88.32 \\ & & (+0.17) & (+0.14) & (\textbf{+0.32}) & (+0.33) \\ \hline \multirow{2}{*}{InterCNN} & 87.21 & \textbf{88.59} & 88.54 & 88.39 & 88.26 \\ & & (+1.38) & (-0.04) & (-0.16) & (-0.12) \\ \hline \multirow{2}{*}{IteR-MRL} & 84.56 & 85.35 & 88.15 & 88.11 & 88.94 \\ & & (+0.80) & (\textbf{+2.80}) & (-0.08) & (+0.83) \\ \hline \multirow{2}{*}{MECCA} & 86.49 & 88.53 & \textbf{89.56} & \textbf{89.12} & \textbf{90.29} \\ & & (\textbf{+2.03}) & (+1.03) & (-0.44) & (\textbf{+1.17}) \\[0.5ex] \bottomrule[1pt] \end{tabular}} \end{table} \begin{figure}[ht!] \centering \includegraphics[width=0.6\textwidth]{fig_improvement.png} \caption{ Visualization of the performance improvement of different interactive medical segmentation methods at the different interaction steps. All these testing results are performed on the BraTS2015 dataset.} \label{improvementFig} \end{figure} We compare MECCA with five state-of-the-art interactive segmentation methods: DeepIGeos~\cite{wang2018deepigeos}\footnote{\url{https://github.com/taigw/GeodisTK.}}, InterCNN~\cite{bredell2018iterative}\footnote{\url{https://github.com/gbredell/interCNN.}}, IteR-MRL~\cite{liao2020iteratively} and BS-IRIS~\cite{ma2020boundary-aware}. InterCNN is the multi-step version of DeepIGeos. We also introduce the SOTA method, U-Net~\cite{ronneberger2015u}\footnote{\url{https://github.com/liyun-lu/unet\_and\_vnet.}}, of medical image segmentation as a comparable baseline. Table~\ref{res1} show the quantitative comparison of the six interactive segmentation methods on different datasets. For a fair comparison, all CNN-based methods adopt the same network structure (P-Net), which is proposed in~\cite{wang2018deepigeos}. We can see that our proposed MECCA performs better than other state-of-the-art methods on all three datasets. This study also visualizes the results in Figure~\ref{view1}, which shows that our method is more accurate in edge segmentation. \begin{table*}[htbp] \label{tab:test} \caption{Quantitative comparison of 3D medical image datasets segmentation by different methods. In particular, the P-Net is the method without hint information. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{res1} \centering \resizebox{\textwidth}{!}{% \begin{tabular}{c|cccccccccc} \toprule[1pt] Methods &\multicolumn{2}{c}{BraTS2020} &\multicolumn{2}{c}{BraTS2015} & \multicolumn{2}{c}{MM-WHS} & \multicolumn{2}{c}{Spleen} & \multicolumn{2}{c}{Liver}\\ & Dice(\%) & ASSD(pixels) & Dice(\%) & ASSD(pixels) & Dice(\%) & ASSD(pixels) &Dice(\%) & ASSD(pixels) &Dice(\%) & ASSD(pixels)\\ \midrule P-Net &83.67$\pm$8.35 &5.78$\pm$4.01 &84.00$\pm$12.01 &5.10$\pm3.72$ &81.40$\pm$1.48 &3.28$\pm$0.45 &88.08$\pm$2.25 &4.25$\pm$2.07 &35.89$\pm$2.61 &34.46$\pm$23.82 \\ U-Net &84.72$\pm$10.42 &4.09$\pm$3.89 &84.66$\pm$11.25 &6.17$\pm$4.69 &80.96$\pm$1.65 &3.72$\pm$0.39 &87.95$\pm$2.87 &5.12$\pm$1.09 &56.00$\pm$1.93 &22.38$\pm$22.42\\ DeepIGeos &88.54$\pm$.97 &2.11$\pm$1.30 &88.32$\pm$5.34 &2.28$\pm$1.24 &88.48$\pm$0.71 &1.53$\pm$0.18 &91.97$\pm$1.51 &0.93$\pm$0.46 &48.57$\pm$2.52 & 10.28$\pm$3.45\\ InterCNN &88.39$\pm$6.01 &2.01$\pm$1.09 &88.26$\pm$7.07 &1.81$\pm$2.09 &87.85$\pm$1.15 &0.80$\pm$0.15 &93.52$\pm$0.94 &0.54$\pm$0.83 &59.92$\pm$2.20 &5.95$\pm$2.76\\ IteR-MRL &89.22$\pm$4.65 &2.07$\pm$0.91 &88.94$\pm$4.81 &\textbf{1.41$\pm$0.22} &89.55$\pm$0.87 &0.90$\pm$0.11 &91.50$\pm$1.34 &0.67$\pm$0.21 &62.29$\pm$1.93 &\textbf{0.87$\pm$0.59}\\ BS-IRIS &90.47$\pm$5.23 &1.82$\pm$0.33 &89.74$\pm$3.86 &1.61$\pm$0.42 &89.12$\pm$0.98 &1.19$\pm$0.16 &92.35$\pm$1.13 &0.54$\pm$0.19 & 67.25$\pm$2.01& 4.34$\pm$1.18\\ MECCA &\textbf{91.02$\pm$5.86} &\textbf{1.15$\pm$0.20} &\textbf{90.29$\pm$5.07} &1.50$\pm$0.33 &\textbf{90.39$\pm$5.89} &\textbf{0.80$\pm$0.01} &\textbf{94.96$\pm$1.44} &\textbf{0.30$\pm$0.16} &\textbf{71.46$\pm$1.41} &2.36$\pm$0.99\\ \bottomrule \end{tabular}% } \end{table*} To demonstrate that our method can take advantage of hint information more efficiently, this study also compares the relative improvement of different methods at each interaction step. Due to the different interaction ways of different methods, this study sets up a unified interaction process: all these methods have $5$ interaction steps and receive $25$ identical points at the first step to generate the initial segmentation result. After that, users will click $5$ points at each step in the following $4$ interaction steps (total of $25 + 5\times 4 = 45$ points), and these methods will iteratively refine previous segmentation results. The DeepIGeos method does not model the interaction sequence, and it just combines current and previous hint information to refine the previous segmentation. The experimental results are shown in Table~\ref{improvementTab} and Figure~\ref{improvementFig}. The results show that MECCA can perform better under the same amount of hint information and improve more dice scores at most steps. Compared with CNN-based methods, the main advantage of RL-based methods is that they can always keep notable improvement. There are two reasons for this result. The first one is that RL-based methods model the whole interaction process to avoid interaction conflict. The second reason is the relative entropy-based reward which encourages the model to keep refining results. However, we should realize, the RL-based methods still can not guarantee the high confidence of the corrective actions. As we can see in Figure~\ref{improvementFig}, the performance of IteR-MRL is not as good as other methods at the beginning, which is caused by numerous incorrect actions. However, after learning the confidence of actions and applying the self-adaptive reward to update the segmentation model, our proposed MECCA can perform well at each step and keep significantly refining the result. Figure~\ref{segproc} presents the visualization of the segmentation process of our proposed method. Since our proposed method models the whole interaction process, Figure~\ref{segproc} shows the current interaction step and its previous and next interaction steps. At each step, the second column is the confidence map. This study finds that the confidence value of object edges is always lower than in other regions, and these regions will receive more `punishment' when rewards are generated. This study observes that MECCA can gradually correct the edges around the user clicks (the red regions). \begin{table}[ht!] \centering \caption{The DICE of our method varies with the number of interactions under different difficult cases.} \label{tab:difficults-vs-interacts} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{|c|l|l|l|l|l|} \hline \rowcolor[HTML]{9B9B9B} \multicolumn{1}{|l|}{\cellcolor[HTML]{9B9B9B}} & \multicolumn{5}{c|}{\cellcolor[HTML]{9B9B9B}Interaction times} \\ \hline \rowcolor[HTML]{FFFFFF} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}1} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}2} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}3} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}4} & \multicolumn{1}{c|}{\cellcolor[HTML]{FFFFFF}5} \\ \hline \rowcolor[HTML]{FFFFFF} The easy case & 94.05 & 95.15 & 95.38 & 95.91 & 96.25 \\ \hline \rowcolor[HTML]{FFFFFF} The hard case & 41.45 & 47.38 & 65.78 & 77.79 & 79.37 \\ \hline \end{tabular}% } \end{table} \begin{table}[htb!] \centering \caption{MECCA's tolerance for inaccurate interaction points. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{tab:disturbed} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{|c|l|l|} \hline & DICE (\%) & ASSD (pixels) \\ \hline Disturbed Interactions & 88.75±9.72 & \textbf{1.11±0.23} \\ \hline Non-Disturbed Interactions & \textbf{90.29±5.07} & 1.50±0.33 \\ \hline \end{tabular}% } \end{table} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_4_channel_1_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 4/10 testing instance, 7/30 channel, Liver 2 of MSD dataset.} \label{fig:sint1} \end{figure} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_6_channel_12_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 6/10 testing instance, 18/30 channel, Liver 2 of MSD dataset.} \label{fig:sint2} \end{figure} \begin{figure}[ht!] \centering \subfigure[DeepIGeos]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_DeepIGeos.pdf} } \subfigure[InterCNN]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_InterCNN.pdf}} \subfigure[IteR-MRL]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_IteR-MRL.pdf}} \subfigure[MECCA]{ \includegraphics[width=0.8\textwidth]{fig-revised_sint_pic_7_channel_4_liver_cancer_MECCA_origin.pdf}} \caption{The results of different methods response to the same user interactions according to the same initial segmentation on 7/10 testing instance, 10/30 channel, Liver 2 of MSD dataset.} \label{fig:sint3} \end{figure} Besides, we select the best and worst-performing samples from the test set for more analysis. The results are shown in the Table~\ref{tab:difficults-vs-interacts}. The improvement of easy samples through interaction is not considerable, but the improvement of hard samples through interaction can reach twice as much. However, significantly more interactions are required for hard samples to achieve the same segmentation accuracy of easy samples. Moreover, it is very difficult and time-consuming to accurately mark edge points in a real scene, and is less practical to ask user to click the accurate edge points. To verify MECCA's tolerance for inaccurate edge points, we conducted a robustness study under the same settings as Table~\ref{res1}. Specifically, during each interaction in the training phase, random noises are added to simulated edge points. The noise range is plus or minus $2$ voxels in the three directions of $x$, $y$, and $z$. In this way, the edge points used by the algorithm will be randomly selected from $64\;(4\times 4\times 4)$ voxels within the real edge point neighborhood. This disturbance radius can cover the edge ambiguity area in most cases. In the testing phase, we also adopted the same disturbance operation, and the final results are shown in Table~\ref{tab:disturbed}. From the table, it can be seen that the perturbed edge points will make the DICE value of the algorithm drop and have a more considerable variance. However, the maximum value of DICE exceeds the accurate edge points. The perturbed edge points can even exceed the performance of accurate edge points in the ASSD value. We believe that there may be two reasons for the above phenomenon. First, MECCA uses adaptive confidence calibration to improve the information-misunderstanding of the iterative algorithm, but it also makes the algorithm more ``conservative''. The perturbed edge point information may exceed the actual object boundary, which can make the segmentation effect of our method better or more ``radical''; Second, perturbing the interactive information during the training phase can enable the reinforcement learning algorithm to explore the environment (medical images). Existing SOTA reinforcement learning algorithms generally impose entropy constraints on the policy, enhance the randomness of the policy, and encourage exploration. Moreover, our perturbation of interactive information will indirectly affect the policy of the algorithm. In a word, MECCA has good robustness to inaccurate edge points. Finally, we show how different methods respond to the same user interactions according to the same initial segmentation, especially for hard cases. We selected some images with poor performance in baselines or MECCA as the research objects. Specifically, the generation mechanism of the same user interactions is described as following. Total $45$ hint points are randomly selected from the intersection area of the boundary of the foreground object and the error region of the initialization segmentation. Then, these $45$ points are allocated to the $5$ interactive steps of all methods according to the combination of $25$, $5$, $5$, $5$, and $5$. The number of hint points used in each interactive step is the same as that of all methods during training and testing. The results are shown in Figure~\ref{fig:sint1}-\ref{fig:sint3}. It can be seen from the results that MECCA can use the hint points information stably in all cases. The \textit{interactive misunderstanding} phenomenon arises in other methods. These method either ignore the expert's correction information, or even be adversely affected by correction information as in figures. \subsection{Comparison of Different Weighted Rewards} \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_mask.png} \caption{Visualization of the self-adaptive mask, the Error region mask and the Focal mask. All masks are obtained at the first interaction step. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \label{maskview} \end{figure} \begin{figure*}[ht!] \centering \subfigure[]{ \label{segproc} \includegraphics[width=0.8\textwidth]{fig_segproc.png}} \subfigure[]{ \label{weightview} \includegraphics[width=0.5\textwidth]{fig_rewardWeight.png}} \caption{\textbf{(a)} The segmentation process of MECCA. At each step, the first column is the action map, the second column is the confidence map, and the third column is the segmentation result with the user's hint information.\textbf{(b)} Average Dice scores of methods with different weighting rewards. The reward function of IteR-MRL is not weighted; the reward function of Focal-IteR-MRL is weighted via (\ref{focalreward}), the reward function of Err-IteR-MRL is weighted in segmentation error regions, and the the reward function of MECCA is weighted through action confidence. The brighter the color (closer to yellow), the larger the positive value; on the contrary, the darker the color (closer to black), the smaller the negative value.} \end{figure*} One main contribution of our work is that the self-adaptive reward mechanism is further proposed based on the confidence map. This mechanism makes different actions have different feedback levels so that the segmentation network can identify wrong actions as much as possible. To measure the impact of different reward weighting ways on the segmentation result, this study compares MECCA with the original IteR-MRL without weighting reward, the Focal-Reward IteR-MRL (Focal-IteR-MRL), and the one with weighted reward in segmentation error regions (Err-IteR-MRL). The Focal-Reward IteR-MRL adapt the idea of Focal loss~\cite{lin2017focal}: \begin{align} \label{focalreward} FocalReward_{i}^{(t)} \ &=\ \mathcal{X}_{i}^{(t-1)} - \mathcal{X}_{i}^{(t)}, \end{align} where \begin{equation} \mathcal{X}_{i}^{(t)}=\left\{\begin{array}{ll} -(1-p_{i})y_{i}\log(p_{i}^{(t)}) & \text { if } y_{i}=1, \\ -p_{i}(1-y_{i})\log(1-p_{i}^{(t)}) & \text { if } y_{i}=0. \end{array}\right. \end{equation} The reward function of Err-IteR-MARL is a linear scaling of reward of IteR-MARL: \begin{equation} \text{ErrReward}_{i}^{(t)}= \begin{cases} (1 + \lambda_i) \text{gain}_{i}^{(t)}, & \text { if voxel i is misclassified,} \\ \text{gain}_{i}^{(t)}, & \text { otherwise, } \end{cases} \end{equation} where $\lambda_i$ is a positive real number hyperparameter. The performance of different weighting rewards is shown in Figure~\ref{weightview}. Action-based reward weighting methods are more suitable for interactive segmentation since the improvement of our proposed method is more notable than other methods. Also, this study visualizes different masks that weigh the primary reward in Figure~\ref{maskview}. As we can see, the focal mask pays more attention to regions with low prediction probabilities, and the errors region mask contains all regions segmented incorrectly in the previous result. It is not enough for the focal mask to obtain more structured information by only considering the probability of prediction. As such, the performance of Focal-IteR-MRL is erratic, even the poorest on the left atrium dataset. The performance of Err-IteR-MRL is more stable than other methods, but the improvement is not notable. It is because that the weighting way of Err-IteR-MRL is based on the segmentation result while the refinement process of the interactive image segmentation is based on actions. \begin{figure}[ht!] \centering \includegraphics[width=0.8\textwidth]{fig_weaklysup.png} \caption{Qualitative segmentation results of MECCA for BraTS2015 validation set. The first column shows the cropped original images. The second to fifth columns respectively show: the result of supervised learning only using $12.5$\% of labeled data, the results of weakly-supervised learning using $12.5$\% labeled and other unlabelled images, the result of supervised learning only using $25$\% of labeled data, the results of weakly-supervised learning using $25$\% labeled and other unlabelled images. Both supervised learning and weakly supervised learning is based on our proposed method.} \label{weakview} \end{figure} \subsection{Weakly-supervised Interactive Segmentation} \begin{table}[htbp] \caption{Quantitative comparison between MECCA and other methods on BraTS2015 Dataset of different sizes. Significant improvement (p-value $< 0.05$) is marked in bold.} \label{weaktable} \centering \begin{tabular}{p{30mm}|ccccccr} \toprule[1pt] Data amount & 1/8 & 1/4 & 1/3 & 1/2 & 1/1 & $\triangle(1/8, 1/1)$ \\ \midrule P-Net &75.86 &80.83 &80.88 &83.02 &84.00 & $10.73\%$\\ DeepIGeos &85.50 &85.90 &87.70 &87.60 &88.32 & $3.30\%$\\ IteR-MRL &84.36 &86.54 &87.38 &88.66 &88.94 & $5.07\%$\\ UA-MT & 83.08 & 84.47 & 84.62 & 84.39 & 84.66 & \textbf{1.90\%}\\ MECCA &\textbf{87.14} &\textbf{88.23} &\textbf{88.31} &\textbf{89.17} &\textbf{90.29} & $3.60\%$ \\ \bottomrule \end{tabular} \end{table} As mentioned in Section~\ref{unlabeled}, MECCA can reduce the dependence on voxel-level annotations of images by using the simulated label generated from the action confidence map. This study validates Algorithm~\ref{alg:1} on the BraTS2015 dataset by randomly selecting different proportions of samples as fully labeled data and using the rest of the training images as unlabeled data, which only provided hint information when interaction. This study compares MECCA against the P-Net (without hint), DeepIGeos, and IteR-MRL~\cite{liao2020iteratively}. However, only MECCA uses unlabeled data, and the remaining three baselines only use a fixed proportion of labeled data. This does not fully demonstrate the performance of MECCA on semi-supervised problems. For this reason, we additionally introduce a state-of-the-art semi-supervised method UA-MT~\cite{yu2018pu}. \textcolor{black}{Table~\ref{weaktable} shows the results of different methods. MECCA achieves a Dice score of $87.14$\% with only $12.5$\% labeled data, and it performs better than the other methods with $25$\% labeled data.} Since UA-MT is not an interactive segmentation algorithm, its absolute performance is worse than interactive segmentation baselines but better than the non-interactive method P-Net. In addition, it can be seen from the last column of results that UA-MT has the most negligible performance loss on different proportions of labeled data. After MECCA introduces the simulated label generation mechanism, the performance loss can also be controlled at a similar magnitude to UA-MT. Interestingly, DeepIGeos can maintain a good performance loss without using a semi-supervised learning mechanism. Combined with the performance loss of IteR-MRL, we can conclude that in the semi-supervised interactive segmentation task, the interactive misunderstanding phenomenon will exacerbate the performance loss caused by the missing data. DeepIGeos and MECCA alleviate the interactive misunderstanding phenomenon through hard constraints and self-adaptive confidence calibration, respectively, so both of them can achieve better results under semi-supervised settings. However, it is worth mentioning that DeepIGeos does not consider multi-step interactions and the relationship between consecutive interactions. It cannot fully utilize long-term interactive information, so it has a large gap with MECCA in absolute performance. \textcolor{black}{Figure~\ref{weakview} shows the qualitative segmentation results of our method trained with different data sizes. It shows that the model trained with $12.5$\% labeled data can only capture the main region of the tumor. However, the model is unable to distinguish the infiltration areas of the tumor. For instance, the boundaries of tumors in the figure are hard to distinguish as it is more similar to these healthy regions. In this case, the models trained with little data tend to ignore these boundary regions of the tumor, while the model trained with both labeled data and unlabeled data can get more smooth and accurate boundaries. This phenomenon is mainly due to the distribution of the training set is not consistent with the validation set. The main advantage of the model trained with both labeled and unlabeled data is that it can minimize the gap between training and validation data.} \begin{table}[ht!] \centering \caption{DICE of the algorithm under different number of interactions and percentage of labeled data.} \label{tab:labeled-vs-interacts} \resizebox{0.6\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|} \hline \rowcolor[HTML]{9B9B9B} \% Labeled Data & \multicolumn{5}{c|}{\cellcolor[HTML]{9B9B9B}Interaction Steps} \\ \hline \rowcolor[HTML]{FFFFFF} & 3 & 4 & 5 & 6 & 7 \\ \hline \rowcolor[HTML]{FFFFFF} 25$\%$ & 84.03 & 86.18 & 88.23 & 87.32 & 88.24 \\ \hline \rowcolor[HTML]{FFFFFF} 33$\%$ & 85.32 & 87.60 & 88.31 & 87.99 & 88.53 \\ \hline \rowcolor[HTML]{FFFFFF} 50$\%$ & 85.39 & 87.07 & 89.17 & 88.93 & 89.13 \\ \hline \rowcolor[HTML]{FFFFFF} 100$\%$ & 89.93 & 90.40 & 90.29 & 89.85 & 90.79 \\ \hline \end{tabular}% } \end{table} We additionally test MECCA's performance under different interaction times and the percentage of labeled data, and the results are shown in Table~\ref{tab:labeled-vs-interacts}. Based on the experimental results, we can obtain the following conclusions: 1) if there is enough labeled data, MECCA can achieve good results after a few interactions; 2) the number of interactions required by MECCA to achieve the same performance is roughly inversely proportional to the number of labeled data; 3) although MECCA requires more interactions (about $2$-$3$ times the number of interactions) when only part of the labeled data is available, it can approach the algorithm's performance trained with all labeled data in the end. \subsection{Ablation Study} {\begin{table}[htbp] \caption{Ablation study of our proposed algorithm on the BraTS2015 dataset with $25\%$ labeled data and $75\%$ unlabeled data . Significant improvement (p-value < $0.05$) is marked in bold.} \label{ablation} \centering \begin{tabular}{p{18mm}p{20mm}p{20mm}|c} \toprule[1pt] Self-adaptive reward & Interaction guide & Simulated labels generation & Dice(\%) \\ \midrule & & &86.54 \\ \checkmark & & &87.21 \\ &\checkmark & &86.56 \\ & &\checkmark &88.01 \\ \checkmark &\checkmark & &87.24 \\ \checkmark &\checkmark &\checkmark &\textbf{88.23} \\ \bottomrule \end{tabular} \end{table}} {\begin{table}[htbp] \caption{Ablation study of our proposed algorithm on the Liver 2 dataset of MSD with $25\%$ labeled data and $75\%$ unlabeled data. Significant improvement (p-value $<0.05$) is marked in bold.} \label{ablation-add} \centering \begin{tabular}{p{18mm}p{20mm}p{20mm}|c} \toprule[1pt] Self-adaptive reward & Interaction guide & Simulated labels generation & Dice(\%) \\ \midrule & & & 66.43 \\ \checkmark & & & 67.45 \\ &\checkmark & & 66.56 \\ & &\checkmark & 67.93 \\ \checkmark &\checkmark & & 67.59 \\ \checkmark &\checkmark &\checkmark &\textbf{69.99} \\ \bottomrule \end{tabular} \end{table}} Table \ref{ablation} and \ref{ablation-add} shows the impact of different mechanisms to the MECCA. It is clear that the stimulative labels generation mechanism and self-adaptive reward mechanism significantly improve the algorithm's performance. The stimulative labels generation mechanism can achieve a $1.47\%$ and $3.56\%$ gain over the initial algorithm without any mechanisms for the Brats2015 and Liver 2 dataset, respectively. The main reason for this significant improvement is the utilization of these unlabeled data. \begin{table}[htbp] \caption{Quantitative comparison of interactive segmentation methods in computational and interaction time.} \label{Comtime} \centering \begin{tabular}{p{25mm}|p{55mm}p{50mm}c} \toprule[1pt] Methods & Total inference time per iteration & Interaction time per iteration \\ \midrule DeepIGeos &\textbf{510ms} &226ms \\ InterCNN &532ms &237ms \\ IteR-MRL &869ms &235ms \\ BS-IRIS &990ms &250ms \\ MECCA &631ms &\textbf{123ms} \\ \bottomrule \end{tabular} \end{table} \begin{table}[htb!] \centering \caption{Quantitative comparison of interactive segmentation methods in interaction time on realistic segmentation platform operated by experts. Demo video of MECCA is available at \url{https://bit.ly/mecca-demo-video}.} \label{tab:real-time} \resizebox{0.8\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|} \hline & \multicolumn{5}{c|}{Interaction Time (\textit{Second}, Real World)} \\ \hline Interaction Step(s) & 1 (25 points) & 2 (5 points) & 3 (5 points) & 4 (5 points) & 5 (5 points) \\ \hline DeepIGeos & 70 & 15 & 15 & 8 & 8 \\ \hline InterCNN & 76 & 19 & 18 & 8 & 7 \\ \hline IteR-MRL & 75 & 17 & 17 & 8 & 8 \\ \hline BS-IRIS & 80 & 20 & 20 & 11 & 10 \\ \hline MECCA & \textbf{41} & \textbf{12} & \textbf{11} & \textbf{5} & \textbf{5} \\ \hline \end{tabular}% } \end{table} Table~\ref{Comtime} shows the comparison of interactive segmentation methods in computational and interaction time. The result shows that the MECCA only takes half the time of other methods when performing an interaction. The main contribution to the reduction of interaction time is the interaction guide mechanism mentioned in Section~\ref{inter guid}. Furthermore, to explore the efficiency of MECCA in authentic tasks, we designed an interactive software platform. We asked oncologists to use it for natural interactive segmentation, and the results are in Table~\ref{tab:real-time}. It can be seen from the results that the MECCA algorithm also takes only about half of the time of the baselines due to the interaction guidance. In addition, as the segmentation results become more and more accurate, the interaction time required gradually decreases. \section{Conclusion} \label{conclusion} This paper presents a novel action-based confidence learning method for interactive 3D image segmentation. Specifically, this paper proposes to learn the confidence of actions that continuously refine the segmentation result during the interaction process so that hint information can be used more effectively. Based on this, the self-adaptive reward is proposed for the segmentation module, which can prevent the interactive misunderstanding phenomenon during the interaction and help reduce the time cost of interaction by providing users with the advice regions to interact next. Besides, the confidence map can also replace the ground truth to generate feedback for the unlabeled samples for the segmentation module. These samples without voxel-level annotations can also be used to train our model. By integrating these components, MECCA is demonstrated to medical segmentation efficiently via less voxel-level annotated samples.
{'timestamp': '2021-11-16T02:32:49', 'yymm': '2111', 'arxiv_id': '2111.07716', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07716'}
arxiv
\section{Introduction}\label{section:Introduction}} \IEEEPARstart{S}{imultaneous} localization and mapping (SLAM) methods have been applied to solve localization and map-building problems in robotics. LiDAR odometry and local mapping algorithms are widely used in SLAM systems. However, integration processes unavoidably cause an accumulation of pose errors. This drift causes map distortion and estimation failure. Although SLAM is a loop-closing algorithm, it only disperses errors in the history trace, rather than truly eliminating every pose error \cite{2017StateEstimation}. The key to improving the long-term performance relies on the enhancement of front-end accuracy \cite{2016PastPA}. Inspired by our experience with visual odometry (VO) in a dynamic environment \cite{2020PointCorrelations}, diverse feature points are considered owing to their different influences on pose estimation. We presume that diverse LiDAR point residuals have different sensitivities and uncertainties for pose estimation accuracy. Therefore, a novel sensitivity and uncertainty theory that distinguishes residuals from diverse pattern representations was proposed. The theory quantifies the influence of every residual term’s pose estimation accuracy into six dimensions: three for rotation and three for translation. The theory classifies and selects a subset of high sensitivity and low uncertainty, which enters the optimization to achieve a higher accuracy than the utilization of all points. As shown in Fig. \ref{figure:AfterSelected}, the left is the original LO using all valid planar feature points, and the right is adding our selection scheme to this LO. They run on the KITTI benchmark \cite{2012KITTI} sequence 03. The selected planar points were almost half of the original; however, they obtained fewer translation errors simultaneously. \begin{figure*}[htbp] \centering \includegraphics[width=0.95\textwidth]{./image/AfterSelected.jpg} \caption{Original (blue) and our applied selection scheme (green) LO results are shown here. The selected planar points are almost half less than the original, but obtain fewer translation errors simultaneously.} \label{figure:AfterSelected} \end{figure*} Sensitivity describes the extent to which a registration residual changes when a standard pose disturbance is applied to the sensor. It is defined as a six-dimensional vector: three for rotation angles and others for translation. In Fig. \ref{figure:Sensitivity}, calculating a LiDAR rotation angle, using high sensitivity points is better, which equals the lever principle. In Fig. \ref{figure:PlaneSensitivity}, every planar point’s sensitivities to yaw angle are drowned in color. Black and red were low, while green and blue were high. The near-ground points were not sensitive to the yaw angle, and the middle-building walls were more sensitive than the left and right walls. Uncertainty describes the reliability of a registration residual term that combines a LiDAR point measurement and its corresponding geometric model credibility. It is defined as a three-dimensional Gaussian distribution, such as a line or a plane pattern. In Fig. \ref{figure:PlaneUncertainty}, high uncertainty planar points in blue are trees, which are unsuitable for pose estimation. The red regions represent smooth walls and near-ground points, which are reliable for pose estimation. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Sensitivity.jpg} \caption{Sensitivity describes how much a registration residual changes. When there exists a small pose error, higher sensitivity points have more distance errors.} \label{figure:Sensitivity} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/PlaneSensitivity.jpg} \caption{Every planar point’s sensitivities to the yaw angle are drowned in color. Black and red are low, and green and blue are high. The near-ground points are not sensitive to the yaw angle, and the middle-building walls are more sensitive than the left and right walls.} \label{figure:PlaneSensitivity} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/PlaneUncertainty.jpg} \caption{High uncertainty planar points in blue are trees. The red regions are smooth walls and near-ground points, which are reliable for pose estimation.} \label{figure:PlaneUncertainty} \end{figure} This research aims to find calculus approaches for LiDAR point residual sensitivity and uncertainty. We comprehensively considered these two properties in a score vector and decouple them into six dimensions. Thereafter, all LiDAR point residuals were sorted to select a subset that included high sensitivity and low uncertainty points. Finally, these residuals were sent for optimization. In code realization, a threshold rule is defined to stop the selection. Theoretically, we demonstrated that sorting residuals using the proposed method achieves a global statistical optimum. This algorithm is independent of the specific LiDAR SLAM algorithms and LiDAR hardware configurations. It is a general module to enhance accuracy and can be added to any existing optimization-based code realizations. Our experiments on LO and LIO indicate that utilizing selected residuals simultaneously enhances optimization accuracy, decreases residual terms, and guarantees real-time performance. The main contributions of this study are as follows: (1) To the best of our knowledge, this is the first study to theoretically prove the global statistical optimal point selection scheme for enhancing pose estimation accuracy in LiDAR odometry and mapping. (2) This paper proposed a sensitivity model for point-to-plane and point-to-line distance, as well as uncertainty model for LiDAR point measurement and its corresponding geometry pattern. Sensitivity and uncertainty decoupling into six-dimensional methods were also proposed. (3) Experiments were conducted using the KITTI benchmark. The ALOAM translation error decreased from $1.7318\%$ to $1.5781\%$ in virtually half of the number of planes and lines used. Different types of LiDAR scan modes were evaluated in indoor and outdoor environments using LO and LIO, increasing the average accuracy by approximately $20\%$. Experiments reveal that the time consumption depends on the residual amount rather than the feature detection and residual selection parts. The proposed selection scheme guarantees real-time performance. \section{Related Work} \label{section:Related Work} Related studies can be classified into three categories: sensitivity, uncertainty, and entropy-based LO methods. \subsection{Sensitivity Model} This report \cite{2003GeometricallySS} provides considerable motivation for employing the sensitivity model. It proposes a technique for determining whether a pair of meshes is unstable in the iterative closest point (ICP) algorithm. It estimates a covariance matrix from the sparse uniform sampling of the input. Subsequently, it develops a strategy that attempts to minimize this instability and draws a new set of sample points primarily from the stable areas of the input meshes. However, this study concentrates on the registration problem; it does not consider measurement uncertainties and analyzes only the mesh plane errors. However, this technique was fundamental to our theory. LO-Degeneracy \cite{2016OdometryDegeneracy} aims to avoid a degenerate environment, which is regarded as a condition in which one-dimensional sensitivity is zero. It determines and separates the degenerate dimensions in the state space and partially solves the problem in well-conditioned directions. It linearizes the cost function and uses the dot product of the coefficient matrix with its transpose. A matrix containing the geometric structures of the problem constraints is formed. The IMLS \cite{2018IMLSSLAM} technique is a complete LO that uses \cite{2003GeometricallySS} method to select points. Therefore, numerous points can alter the constraints to shrink the final pose. However, it does not solve the problem theoretically and only considers a point-to-plane sensitivity model. The LeGOLOAM algorithm \cite{2018LeGOLOAM} uses normal vector clustering to detect true line points and obtain better matching. Optimization was achieved in two stages using the ground vehicle hypothesis. LeGOLOAM is regarded as improving accuracy from the pattern recognition perspective. However, this is strongly limited by the ground-vehicle hypothesis. Two-stage optimization enables all observations to calculate the rotation and translation separately. LION \cite{2021LION} can self-assess its performance using an observability metric that evaluates whether the pose estimation is geometrically ill-constrained. This is similar to LO-Degeneracy \cite{2016OdometryDegeneracy} and is applied to a real tunnel scene. SGLO \cite{2021SGLO} considers the derivative of the residuals; however, it has not been discussed in depth. It does not consider constraint information in every dimension, which is the core content. MULLS \cite{2021MULLS} clarified the residual linearization process. It uses all observations in the estimations with diverse weights, implying that estimations in different directions can be balanced. In \cite{2020SetCardinalityMax}, inline set cardinality maximization was used to select suitable feature for a 3D-2D pose estimation. Bearing vectors play an important role in the selection and avoidance of degeneration. From these studies, the proposed theory theoretically clarifies sensitivity. It is inspired by IMLS and extends to a point-to-line residual type. Compared to the MULLS, the point-to-line catches a Hessian matrix in the MULLS, which cannot be sorted directly. The proposed theory uses the main direction projection to regroup into a linear form, which is convenient for sorting. \subsection{Uncertainty Model} The uncertainty model consisted of two parts. The first part independently models the uncertainty of every laser point measurement in 3D and is referred to as the laser scan beam. The second part models the uncertainty of the geometric pattern in the map. The essential difference between these two models is that the first part describes the uncertainty of the current observations and the second part describes the uncertainty of history-measured information. \subsubsection{Laser Scan Beam} For laser points, \cite{2007LidarError} proposed rigorous first-order error analysis. It measures the horizontal and vertical errors of a laser pulse and determines the nonlinear error growth, as recently reported in \cite{2020LidarComparing}. Comparing various LiDAR sensors available in the market \cite{2020LidarComparing}, measurement errors were found to be relevant to the target range. In \cite{2007AirLaser}, a laser point was modeled as a projected footprint and used to represent an uncertainty matrix. A 3D Gaussian distribution was proposed \cite{2018VLP16Model} to model LiDAR uncertainty points and to clarify their propagation. \subsubsection{Geometry Pattern} For geometry patterns, point cloud data (PCD) are direct and easy to use for localization. Accordingly, this investigation focuses on the map geometry pattern implemented using PCD. The LOAM algorithm \cite{2014LOAM} generates five points to simulate a plane and line by decoupling the eigenvalues. It fundamentally calculates them as a 3D Gaussian distribution but discards irrelevant directions. The Gaussian mixture model \cite{2016GMM} (GMM) is a continuous distribution function method; however, it adopts multiple Gaussians and regroups them with different weights. A multilayer tree structure \cite{2018GMMtree} can fuse flat areas into one Gaussian or decompose a complicated area into several Gaussians. In addition to these explicit function representations, implicit methods are relevant to PCD applications. A moving least square (MLS) surface is defined in \cite{2004MLS}; it is a $C^\infty$ smooth surface generated from a raw PCD. An implicit version was defined in \cite{2005ProvablyMLS}, which represents the distance of a location on a surface composed of neighboring points. Based on the aforementioned studies, real LiDAR emitting and receiving structures were considered to build a laser point uncertainty model. Thereafter, the measured points were added to the map and fused together. Our study aimed to improve the real-time estimation accuracy of mobile robots. Compared with a 3D reconstruction, sacrificing some of the complicated area details and focusing on the main direction constraints are advantageous for SLAM. Because nearby LiDAR points are dense, the remote points are sparse. The leaves, trees, and other irregular objects are not suitable for pose estimation, indicating that their fused uncertainties are higher. Therefore, the Gaussian method is preferred, and the uncertainties of the map points are considered. Consequently, these points are completely used in a plane or line. \subsection{Entropy Based LO Method} Since 2020, some research has applied the entropy concept from information theory \cite{Shannon1948Entropy} to SLAM systems to improve robustness and accuracy. \cite{2020GoodFeatureMatching} proposed sub-matrix selection by choosing a scoring metric for VO. It models estimation as a linear matrix to obtain the best subset that yields the metric Max-$log$Det. With this metric, satisfactory feature selection becomes an NP-hard problem. They designed a lazy greedy algorithm to determine the maximum submatrix. In a continuation of \cite{2020GoodGraphOptimize}, it focused on selecting satisfactory poses for graph optimization. In \cite{2020InformationDrivenDirectRGBD}, the most numerous mutual information points were selected, and the metrics were similar. MLOAM \cite{2021ICRAmloam} imitates and applies entropy to a multi-LiDAR field. The two LiDAR sensors were set at diverse angles to cover a wide area. In addition, a greedy method was designed. The two LiDARs were run in real time with satisfactory accuracy. Compared to the aforementioned studies, the most novel contribution of our proposed theory is that we provide an analytical demonstration of why the selected points obtain higher accuracy. Another advantage is that the proposed theory is endogenously explainable, which is derived from a singular value decomposition (SVD)-based registration problem \cite{1992ICP}. Finally, the sensitivity and uncertainty processes are modeled in a linear form, avoiding the calculation of a sub-matrix metric using a greedy method. \section{Notations and Preliminaries} \label{section:Notations and Preliminaries} Before introducing our theory, the interpretation of the ICP registration problem aids in understanding the theory. The SVD method was used as a standard solution. Zero-mean normalization is applied to decouple it into calculating the rotation (first step) and translation (second step). That is, it solves $\mathbf{R}$ in $\rm{SO}(3)$ space and then returns to $\rm{SE}(3)$ space to calculate $\mathbf{t}$. This is known as the Wahba problem \cite{Wahba1965} since 1965, or rotation search \cite{2004RotationSearch} in the recent robotic community. Assume that a no-disturbance point set (source) is $P=\{\mathbf{p}^*_i\},i=1,\ldots,N$ and its corresponding no-disturbance point set (target) is $Q=\{\mathbf{q}^*_i\},i=1,\ldots,N$. The standard $L_2$ norm point-to-point registration problem is expressed as follows: \begin{equation} \label{equation:ICP} \begin{aligned} \mathbf{R}^* & =\mathop{\arg\min}\limits_{\mathbf{R}^*\in\rm{SO}(3)}\sum_{i=1}^N ||\mathbf{R}^*\mathbf{p}^*_i-\mathbf{q}^*_i||^2 \\ & =\mathop{\arg\max}\limits_{\mathbf{R}^*\in\rm{SO}(3)} tr(\mathbf{R}^*\sum_{i=1}^N \mathbf{p}^*_i {\mathbf{q}^*_i}^T) \end{aligned} \end{equation} \begin{equation} \label{equation:ICPSVD} \mathbf{H}=\sum_{i=1}^N \mathbf{p}^*_i {\mathbf{q}^*_i}^T=\mathbf{U\Sigma V}^T \end{equation} \begin{equation} \label{equation:ICPSVD2} \mathbf{R}^*=\mathbf{VU}^T \end{equation} where $\mathbf{R}$ is a $3\times3$ rotation matrix and the proof of Eq. (\ref{equation:ICP}) is provided in Appendix A. By linearizing the rotation parameters from the Lie group manifold to its corresponding location in the tangent vector space (i.e., $\phi_\mathbf{R}^\wedge\in\mathfrak{so}(3),\phi_\mathbf{R}\in\mathbb R^3$ Lie algebra), the problem becomes a linear least-squares problem. Accordingly, it is solved using the Gauss-Newton\cite{1974GN} or Levenberg-Marquardt\cite{1977LM} techniques. The optimal rotation is found as the singular vectors $\mathbf{V}$ and $\mathbf{U}$ regroups of $\mathbf{H}$. Any two rotation matrices, $\mathbf{L}$ and $\mathbf{K}$, and their corresponding axis angles (rotation vector), $\phi_\mathbf{L}=\theta_\mathbf{L}\omega_\mathbf{L}$ and $\phi_\mathbf{K}=\theta_\mathbf{K}\omega_\mathbf{K}$, as shown in Fig. \ref{figure:AngleAxis}, are connected by the exponential map from the Lie group to the Lie algebra. \begin{equation} \label{equation:Angle Axis} \begin{aligned} \mathbf{L} & =\exp(\phi_\mathbf{L}^\wedge)=\exp(\theta_\mathbf{L}\omega_\mathbf{L}^\wedge) \\ \mathbf{K} & =\exp(\phi_\mathbf{K}^\wedge)=\exp(\theta_\mathbf{K}\omega_\mathbf{K}^\wedge) \end{aligned} \end{equation} $\theta_\mathbf{L}$ and $\theta_\mathbf{K}$ are the angles (scalar), $\omega_\mathbf{L}$ and $\omega_\mathbf{K}$ are axes ($3\times1$ vector), $\phi^\wedge$ denotes the symmetric skew matrix of vector $\phi$. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/AngleAxis.jpg} \caption{Axis angle (rotation vector) representation is $\phi_\mathbf{L}=\theta_\mathbf{L}\omega_\mathbf{L}$ and $\mathbf{L}=\exp(\phi_\mathbf{L}^\wedge)=\exp(\theta_\mathbf{L}\omega_\mathbf{L}^\wedge)$. The black sphere is the $\rm{SO}(3)$ space Lie group, and the blue grid is the $\mathfrak{so}(3)$ space Lie algebra, which is tangent to the expansion location. $\exp$ and $\log$ mappings connect each other. This enable gradient descent-based optimization algorithms to work.} \label{figure:AngleAxis} \end{figure} skew-symmetric matrix and corresponding vector satisfying \begin{equation} \mathbf{a}^\wedge= \begin{bmatrix} a_1\\ a_2\\ a_3 \end{bmatrix}^\wedge= \begin{bmatrix} 0 & -a_3 & a_2 \\ a_3 & 0 & -a_1 \\ -a_2 & a_1 & 0 \end{bmatrix} \end{equation} To measure the difference between the two rotation matrices, $\mathbf{R}^*$ and $\mathbf{R}_i$ in Fig. \ref{figure:RiemannianDistance}, the Riemannian metric distance \cite{2004RotationSearch} under the Frobenius Norm is used. It is defined as \begin{equation} \label{equation:Riemanniandistance} \begin{aligned} Riem(\mathbf{R}^*,\mathbf{R}_i) & =||\log({\mathbf{R}^*}^T \mathbf{R}_i)||^2_F \\ & =||\log(\Delta\mathbf{R})||^2_F \\ & =Riem(\Delta\mathbf{R}) \\ & =||\log(\exp(\phi^\wedge_{\Delta\mathbf{R}}))||^2_F \\ & =tr({\phi^\wedge_{\Delta\mathbf{R}}}^T\phi^\wedge_{\Delta\mathbf{R}}) \end{aligned} \end{equation} that satisfies $\Delta\mathbf{R}={\mathbf{R}^*}^T \mathbf{R}_i$. This distance is the length of the shortest geodesic curve connecting the two rotation matrices. The defined symbols are summarized in TABLE \ref{table:Basic Notations}. \begin{figure}[htbp] \centering \includegraphics[width=0.15\textwidth]{./image/RiemannianDistance.jpg} \caption{When sensors provide redundant observations, there exist many estimated rotation matrices $\mathbf{R}_i$. The method of calculating the smallest fitting error rotation matrix $\mathbf{R}^*$ is a fundamental optimization problem. This phenomenon is common in a LO or LIO, which requires the sum of Riemannian distances to be the smallest. Specifically, if $\mathbf{R}^*$ is the optimal, it must be close to all valid $\mathbf{R}_i$.} \label{figure:RiemannianDistance} \end{figure} \begin{table}[htbp] \begin{center} \caption{Basic notations} \renewcommand\arraystretch{1.4} \resizebox{0.5\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline $\mathbf{R}$,$\mathbf{L}$,$\mathbf{K}$ & rotation matrix & $\phi$ & angle axis (rotation vector) \\ \hline $\theta$ & angle & $\omega$ & axis \\ \hline $\mathbf{p}^*_i$ & source point & $\mathbf{q}^*_i$ & target point \\ \hline \end{tabular} } \label{table:Basic Notations} \end{center} \end{table} \section{Sensitivity and Uncertainty} \label{section:Sensitivity and Uncertainty} This section proves that the proposed sensitivity and uncertainty theory-based selection scheme achieves the global statistical optimal pose estimation accuracy. The optimum is statistical because the analyses are based on probability distributions. In one-shot sampling, a point with a higher uncertainty may be more accurate than other points because the uncertainty is only a probability distribution description. Therefore, multisampling and calculated expectations are superior. For brevity, we simplified the enhancing accuracy issue as a point registration problem in $\rm{SO}(3)$. Assuming the ideal condition, there exists a ground truth rotation $\mathbf{R}^*$ that satisfies the no-disturbance condition for $N\geq 4$ points: \begin{equation} \label{equation:RotationStar} \mathbf{R}^*\mathbf{p}^*_i=\mathbf{q}^*_i, i=1,\cdots,N \end{equation} Consider small disturbances on source points $\mathbf{p}^*_i$ as real LiDAR noise, which may occur during capturing or algorithm drift. On $\rm{SO}(3)$, a dynamic rotation matrix $\mathbf{L}^\prime_i$ describes this error, $\mathbf{p}^\prime_i=\mathbf{L}^\prime_i \mathbf{p}^*_i$, which lies on the 3D manifold surface in Fig. \ref{figure:DemonstrationUncertaintyModel}. The same disturbance $\mathbf{K}^\prime_i$ was added to the target point $\mathbf{q}^*_i$. We defined this simple uncertainty model as the only one for the inference. The uncertainty model details are described in Lemmas \ref{lemma:Uncertainty} and Fig. \ref{figure:DemonstrationUncertaintyModel}, which do not hinder understanding at present. Assuming the selection $M$ point pairs in a certain rule, $M$ depends on the number of points participating in the rotation calculation, that is, at least $4$ points. Therefore, $M$ controls the algorithm to cover all the possible conditions, satisfying $4\leq M\leq N$. The optimal rotation, $\mathbf{R}^\prime$, was calculated using Eq. (\ref{equation:ICP}): \begin{equation} \label{equation:RotationPrime1} \mathbf{R}^\prime=\mathop{\arg\min}\limits_{\mathbf{R}^\prime\in\rm{SO}(3)}\sum_{j=1}^M||\mathbf{R}^\prime\mathbf{p}^\prime_j-\mathbf{q}^\prime_j||^2 \end{equation} If this selection scheme is optimal, the Riemannian distance between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ is very close. Specifically, by exchanging an arbitrary one-point pair inside $M$ with that outside of $N-M$, the optimal rotation is $\mathbf{R}^{\prime\prime}$. \begin{equation} \label{equation:RotationPrime2} \mathbf{R}^{\prime\prime}=\mathop{\arg\min}\limits_{\mathbf{R}^{\prime\prime}\in\rm{SO}(3)}\sum_{j=1}^M||\mathbf{R}^{\prime\prime}\mathbf{p}^{\prime\prime}_j-\mathbf{q}^{\prime\prime}_j||^2 \end{equation} where $\{\mathbf{p}^\prime\}$, $\{\mathbf{q}^\prime\}$ and $\{\mathbf{p}^{\prime\prime}\}$, $\{\mathbf{q}^{\prime\prime}\}$ are at least one point pair that are different. A conjecture must then be established to illustrate why the selection scheme is optimal. \begin{conjecture}[\bf{Closest Riemannian Distance}] \label{conjecture:Closest Riemannian Distance} \begin{equation} \label{equation:DistanceRotationPrime12} Riem(\mathbf{R}^*,\mathbf{R}^\prime)<Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime}) \end{equation} \end{conjecture} The remainder of this section demonstrates Conjecture \ref{conjecture:Closest Riemannian Distance}, and the entire demonstration process is shown in Fig. \ref{figure:Demonstration Pipeline}. The defined symbols are summarized in TABLE \ref{table:Sensitivity Uncertainty Notations} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/DemonstrationPipeline.jpg} \caption{Outline of the demonstration process.} \label{figure:Demonstration Pipeline} \end{figure} \begin{table}[htbp] \begin{center} \caption{Theory notations} \renewcommand\arraystretch{1.8} \resizebox{0.5\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline $\mathbf{R}^*$ & ideal rotation & $\mathbf{R}^\prime$ & optimal rotation \\ \hline $\mathbf{R}^{\prime\prime}$ & \multicolumn{3}{c|}{after point pair exchanged optimal rotation} \\ \hline $\mathbf{p}^*_i$ & ideal source point & $\mathbf{q}^*_i$ & ideal target point \\ \hline $\mathbf{p}^\prime_i$ & source point after disturbance & $\mathbf{q}^\prime_i$ & target point after disturbance \\ \hline $\mathbf{p}^{\prime\prime}_i$ & \multicolumn{3}{c|}{after point pair exchanging source point} \\ \hline $\mathbf{q}^{\prime\prime}_i$ & \multicolumn{3}{c|}{after point pair exchanging target point} \\ \hline $\mathbf{L}^\prime_i$ & rotation disturbance on source point & $\mathbf{K}^\prime_i$ & rotation disturbance on target point \\ \hline $\Phi_{\mathbf{p}^*_i}$ & uncertainty & $\mathbf{J}_{\mathbf{p}^*_i}$ & sensitivity \\ \hline $\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}$ & \multicolumn{3}{c|}{the first, second, third, fourth term of Riemannian distance expansion} \\ \hline \end{tabular} } \label{table:Sensitivity Uncertainty Notations} \end{center} \end{table} Initially, the relationship between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ should be established in Theorem \ref{theorem:Rotation Under Disturbance}, and then their distances are calculated. This is practicable for analyzing the point disturbance influence on the pose estimation result. \begin{theorem}[\bf{Rotation Under Disturbance}] \label{theorem:Rotation Under Disturbance} Assuming the addition of disturbances to the source and target points, we can establish \begin{equation} \label{equation:Rotation Under Disturbance} \mathbf{R}^\prime=\mathbf{K}^\prime \mathbf{R}^* \mathbf{L}^{\prime T} \end{equation} \end{theorem} \begin{proof}[\bf{Rotation Under Disturbance}] By substituting the disturbances into Eq. (\ref{equation:ICPSVD}) and (\ref{equation:ICPSVD2}), respectively, \begin{equation} \begin{aligned} \mathbf{H}^\prime & =\sum_{i=0}^N \mathbf{p}_i^\prime \mathbf{q}_i^{\prime T} \\ & =\sum_{i=0}^N \mathbf{L}^\prime \mathbf{p}^*_i \mathbf{q}_i^{* T} \mathbf{K}^{\prime T} \\ & =\mathbf{L}^\prime \mathbf{H}^* \mathbf{K}^{\prime T} \\ & =(\mathbf{L}^\prime \mathbf{U})\mathbf{\Sigma}(\mathbf{K}^\prime \mathbf{V})^T \end{aligned} \end{equation} Thus, the optimal rotation is \begin{equation} \begin{aligned} \mathbf{R}^\prime=\mathbf{K}^\prime \mathbf{V}(\mathbf{L}^\prime \mathbf{U})^T=\mathbf{K}^\prime \mathbf{VU}^T \mathbf{L}^{\prime T}=\mathbf{K}^\prime \mathbf{R}^* \mathbf{L}^{\prime T} \end{aligned} \end{equation} \begin{center} \bf{Q.E.D. \end{center} \end{proof} Next, the Riemannian distance between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ is expanded. Theorem \ref{theorem:Riemannian Distance} aims to identify the elements that affect the result exactly. Thus, the definition of sensitivity and uncertainty properties is motivated here. \begin{theorem}[\bf{Riemannian Distance}] \label{theorem:Riemannian Distance} \begin{equation} \label{equation:Riemannian Distance} \begin{aligned} Riem(\mathbf{R}^*,\mathbf{R}^\prime) & =||\log({\mathbf{R}^*}^T\mathbf{R}^\prime)||_F^2\\ &=\mathbf{A}+\mathbf{B}+\mathbf{C}+\mathbf{D} \end{aligned} \end{equation} the four terms that satisfy \begin{equation} \label{equation:Riemannian Distance ABCD} \begin{aligned} \mathbf{A} & =2{(\mathbf{R}^*\phi_{\mathbf{K}^\prime})}^T(\mathbf{R}^*\phi_{\mathbf{K}^\prime}) \\ \mathbf{B} & =2{\phi_{\mathbf{L}^\prime}}^T\phi_{\mathbf{L}^\prime} \\ \mathbf{C} & =\frac{1}{2}{[(\mathbf{R}^*\phi_{\mathbf{K}^\prime})^\wedge\phi_{\mathbf{L}^\prime}]}^T (\mathbf{R}^*\phi_{\mathbf{K}^\prime})^\wedge\phi_{\mathbf{L}^\prime} \\ \mathbf{D} & =4{(\mathbf{R}^*\phi_{\mathbf{K}^\prime})}^T\phi_{\mathbf{L}^\prime} \end{aligned} \end{equation} \end{theorem} \begin{proof}[\bf{Riemannian Distance}] The proof of Theorem \ref{theorem:Riemannian Distance} is provided in Appendix B. The core is the utilization of the Baker (Campbell) Hausdorff formula \cite{1974BCH} and exponential mapping expansion. Thereafter, we acquired six terms, and the last two terms are always zero. \end{proof} Note that, in Theorem \ref{theorem:Riemannian Distance}, $\mathbf{A}$ and $\mathbf{B}$ have additional concise representations. Therefore, we have written Remark \ref{remark:Disturbance Terms} to illustrate this for better comprehension. \begin{remark}[\bf{Disturbance Terms}] \label{remark:Disturbance Terms} Based on Theorem \ref{theorem:Riemannian Distance} and the angle-axis representation in Fig. \ref{figure:AngleAxis} \begin{equation} \label{equation:Disturbance Terms A B} \begin{aligned} \frac{\mathbf{A}}{2} & =(\mathbf{R}^* \phi_{\mathbf{K}^\prime})^T(\mathbf{R}^* \phi_{\mathbf{K}^\prime})=\theta_{\mathbf{K}^\prime}^2 \\ \frac{\mathbf{B}}{2} & =\phi_{\mathbf{L}^\prime}^T \phi_{\mathbf{L}^\prime}=\theta_{\mathbf{L}^\prime}^2 \end{aligned} \end{equation} \end{remark} $\mathbf{C}$ and $\mathbf{D}$ are dynamic, depending on the included angle of these two disturbance rotation vectors. Subsequently, the dynamic properties of the last two terms, $\mathbf{C}$ and $\mathbf{D}$ can be clarified from another perspective. In one-shot sampling, a point is captured at a specific position where it must be located. Although it belongs to a specific distribution, the one-shot sampling is random. This phenomenon results in Eq. (\ref{equation:DistanceRotationPrime12}) in Conjecture \ref{conjecture:Closest Riemannian Distance} is impossible. Therefore, we considered comparing the expectations of the Riemannian distance to solve this problem. In the next theorem, after double integration throughout the disturbance space, $\mathbf{C}$ is only related to $\theta_{\mathbf{K}^\prime}\theta_{\mathbf{L}^\prime}$ and $\mathbf{D}$ is zero. Eventually, the comparison continued. \begin{theorem}[\bf{Expectation of Riemannian Distance}] \label{theorem:Expectation of Riemannian Distance} The expectation of the Riemannian distance is \begin{equation} \label{equation:Expectation of Riemannian Distance} E(Riem(\mathbf{R}^*,\mathbf{R}^\prime))=2\theta_{\mathbf{K}^\prime}^2+2\theta_{\mathbf{L}^\prime}^2+\frac{\theta^2_{\mathbf{K}^\prime}\theta^2_{\mathbf{L}^\prime}}{4} \end{equation} \end{theorem} \begin{proof}[\bf{Expectation of Riemannian Distance}] The proof of Theorem \ref{theorem:Expectation of Riemannian Distance} is provided in Appendix C. \end{proof} Sensitivity and uncertainty have been clear perspicuities. They are defined from Theorem \ref{theorem:Expectation of Riemannian Distance} with $\theta_{\mathbf{K}^\prime}$ and $\theta_{\mathbf{L}^\prime}$. We write these two properties in Lemmas \ref{lemma:Sensitivity} and \ref{lemma:Uncertainty}. \begin{lemma}[\bf{Sensitivity}] \label{lemma:Sensitivity} Points that are distant from the center of a LiDAR sensor undergo more changes when the same rotation is applied. Thus, in point-to-point registration, the sensitivity is defined by a point's norm. The point (i.e., $\mathbf{p}^*_i$) sensitivity in Fig. \ref{figure:DemonstrationSensitivityModel} is defined by \begin{equation} \label{equation:Sensitivity} \mathbf{J}_{\mathbf{p}^*_i}=||\mathbf{p}^*_i||^2 \end{equation} \end{lemma} \begin{figure}[htbp] \centering \includegraphics[width=0.25\textwidth]{./image/DemonstrationSensitivityModel.jpg} \caption{Points that are distant from the center of a LiDAR sensor, undergo more changes when the same rotation is applied to them. Thus, in point-to-point registration, sensitivity is defined by a point's norm.} \label{figure:DemonstrationSensitivityModel} \end{figure} \begin{lemma}[\bf{Uncertainty}] \label{lemma:Uncertainty} A small disturbance on $\rm{SO}(3)$ can be described as a small rotation matrix $\mathbf{L}^\prime_i$, which is equal to a circular uniform distribution with radius $h\in(0,\epsilon)$. $h$ is a scalar variable and $\epsilon$ is the distance to the maximal far location. The point (i.e., $\mathbf{p}^*_i$) uncertainty in Fig. \ref{figure:DemonstrationUncertaintyModel} is defined by \begin{equation} \label{equation:Uncertainty} \Phi_{\mathbf{p}^*_i}=\frac{\epsilon}{2} \end{equation} because $h^2$ indicates the disturbance amplitude, and its expectation integration $E$ is \begin{equation} \Phi_{\mathbf{p}^*_i}=E(h^2)=\frac{1}{\epsilon}\int_{0}^{\epsilon}\frac{1}{2\pi h}\int_{0}^{2\pi}h^2 d\alpha dh=\frac{\epsilon}{2} \end{equation} where $\alpha$ denotes the round integration of $\mathbf{p}^\prime$. \end{lemma} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/DemonstrationUncertaintyModel.jpg} \caption {Small disturbance on $\rm{SO}(3)$ can be described as a small rotation matrix $\mathbf{L}^\prime_i$, which equals to a circle uniform distribution whose radius is $h\in(0,\epsilon)$. $h$ is a scalar variable, and $\epsilon$ is a given distance to the maximal far location.} \label{figure:DemonstrationUncertaintyModel} \end{figure} Finally, by combining Lemma \ref{lemma:Sensitivity}, Lemma \ref{lemma:Uncertainty} and Theorem \ref{theorem:Expectation of Riemannian Distance}, Conjecture \ref{conjecture:Closest Riemannian Distance} can be proven. \begin{proof}[\bf{Conjecture \ref{conjecture:Closest Riemannian Distance} Closest Riemannian Distance}] As shown in Fig. \ref{figure:TangentAngleAxis}, for a specific point pair (i.e., index $i$), according to the law of sines, the relationship between sensitivity and uncertainty is established. \begin{figure}[htbp] \centering \includegraphics[width=0.2\textwidth]{./image/TangentAngleAxis.jpg} \caption{According to the law of sines, the relationship between sensitivity and uncertainty is established.} \label{figure:TangentAngleAxis} \end{figure} There exists \begin{equation} \label{equation:Point Contribution Model 5} \begin{aligned} \theta_{\mathbf{L}^\prime_i}&=arcsin(\frac{\epsilon_{\mathbf{p}^\prime_i}}{\sqrt{||\mathbf{p}^\prime_i||^2}})\propto\frac{\Phi_{\mathbf{p}^\prime_i}^2}{\mathbf J_{\mathbf{p}^\prime_i}}\\ \theta_{\mathbf{K}^\prime_i}&=arcsin(\frac{\epsilon_{\mathbf{q}^\prime_i}}{\sqrt{||\mathbf{q}^\prime_i||^2}})\propto\frac{\Phi_{\mathbf{q}^\prime_i}^2}{\mathbf J_{\mathbf{q}^\prime_i}} \end{aligned} \end{equation} When $M$ point pairs have diverse disturbances, $\mathbf{R}^\prime$ and $\mathbf{R}^{\prime\prime}$ are dynamic owing to the specific disturbances. Fortunately, by solving Eq. (\ref{equation:RotationPrime1}) ($\mathbf{R}^\prime$) and (\ref{equation:RotationPrime2}) ($\mathbf{R}^{\prime\prime}$) are based on Lie algebra, a linear space. Similar to the rotation search in Fig. \ref{figure:RiemannianDistance}, this linear property means argument every $M$ point pairs data around their locations satisfying \begin{equation} \label{equation:RotationSearch} \mathbf{R}^\prime=\mathop{\arg\min}\limits_{\mathbf{R}^*\in\rm{SO}(3)}\sum_{i=1}^M Riem(\mathbf{R}^*,\mathbf{R}^\prime_i) \end{equation} where $\mathbf{R}^\prime_i$ is the optimal rotation estimation for every point pair (i.e., $\mathbf{p}^\prime_i$ and $\mathbf{q}^\prime_i$). Although $\mathbf{R}^\prime_i$ cannot be solved using only one point pair, the influence of this point pair on the final result can be quantified using Eq. (\ref{equation:RotationSearch}). Because the same point pair can be aligned, their sensitivities are equal. \begin{equation} \begin{aligned} ||\mathbf J_{\mathbf{p}^\prime_i}|| & =||\mathbf J_{\mathbf{q}^\prime_i}|| \\ ||\mathbf J_{\mathbf{p}^{\prime\prime}_i}|| & =||\mathbf J_{\mathbf{q}^{\prime\prime}_i}|| \end{aligned} \end{equation} Considering the exchange point pairs, $E(Riem(\mathbf{R}^*,\mathbf{R}^\prime))$ and $E(Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime}))$, the different parts are comparable. \begin{equation} \label{equation:observation contribution} \begin{aligned} \sum_{i=1}^M\frac{\Phi_{\mathbf{p}^\prime_i}^2}{\mathbf J_{\mathbf{p}^\prime_i}} & <\sum_{i=1}^M\frac{\Phi_{\mathbf{p}^{\prime\prime}_i}^2}{\mathbf J_{\mathbf{p}^{\prime\prime}_i}} \\ \sum_{i=1}^M\frac{\Phi_{\mathbf{q}^\prime_i}^2}{\mathbf J_{\mathbf{q}^\prime_i}} & <\sum_{i=1}^M\frac{\Phi_{\mathbf{q}^{\prime\prime}_i}^2}{\mathbf J_{\mathbf{q}^{\prime\prime}_i}} \end{aligned} \end{equation} Subsequently, the two equations in Eq. (\ref{equation:observation contribution}) by substituting Eq. (\ref{equation:Sensitivity}) and (\ref{equation:Uncertainty}). Considering Eq. (\ref{equation:Expectation of Riemannian Distance}), $\theta_{\mathbf{L}^\prime}$, $\theta_{\mathbf{K}^\prime}$, $\theta_{\mathbf{L}^{\prime\prime}}$, and $\theta_{\mathbf{K}^{\prime\prime}}$ are the small disturbances. The term $\theta^2_{\mathbf{K}^\prime}\theta^2_{\mathbf{L}^\prime}$ is of fourth order. The main related terms are of second order. \begin{equation} \begin{aligned} \sum_{i=1}^M\frac{\epsilon_{\mathbf{p}^\prime_i}^2+\epsilon_{\mathbf{q}^\prime_i}^2}{||\mathbf{p}^\prime_i||^2} & <\sum_{i=1}^M\frac{\epsilon_{\mathbf{p}^{\prime\prime}_i}^2+\epsilon_{\mathbf{q}^{\prime\prime}_i}^2}{||\mathbf{p}^{\prime\prime}||^2} \\ \Leftrightarrow \sum_{i=1}^M \theta_{\mathbf{L}^\prime}^2+\theta_{\mathbf{K}^\prime}^2 & <\sum_{i=1}^M \theta_{\mathbf{L}^{\prime\prime}}^2+\theta_{\mathbf{K}^{\prime\prime}}^2 \\ \Leftrightarrow E(Riem(\mathbf{R}^*,\mathbf{R}^\prime)) & <E(Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime})) \end{aligned} \end{equation} \begin{center} \bf{Q.E.D. \end{center} \end{proof} Therefore, the demonstration is terminated at the expectation comparison because the dynamic disturbance parts make direct comparison impossible. Therefore, our selection scheme was statistically optimal. In the next section, we define more complex, close-to-reality sensitivity, and uncertainty models to describe the real LiDAR measurement points. \section{Enhance LiDAR Odometry Accuracy} \label{section:Enhance Lidar Odometry Accuracy} This section describes the practical application of our theory. The complete procedure is shown in Fig. \ref{figure:Pipline Contribution}. An outline details the selection scheme. The inputs included map points, LiDAR measured points, and an initial pose available from a uniform motion model or IMU. Subsequently, we used an octree to find neighbors that established the closest matches. Because the measured points are classified as surf and corner (plane and line), the algorithm computes the sensitivities and uncertainties separately. Finally, we sorted all residual terms by sensitivity and uncertainty scores, stopped at a threshold, and sent them to the nonlinear solver to derive the optimal pose. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Pipeline.jpg} \caption{Outline details the selection scheme. The inputs include map points, LiDAR measured points, and an initial pose available from a uniform motion model or IMU. Subsequently, we employed an octree to find neighbors that establish the closest matches. Because measured points are classified into surf and corner (plane and line), the algorithm computes sensitivities and uncertainties separately. Finally, we sorted all residual terms by sensitivity and uncertainty scores, stopped at a threshold, and sent them into the nonlinear solver to derive the optimal pose.} \label{figure:Pipline Contribution} \end{figure} This section first presents the method for calculating the sensitivity model. It uses a Taylor expansion and eigenvalue projection tool to decouple residuals into six dimensions depending on the type of point-to-plane and point-to-line residuals. The second section presents the calculation of the uncertainty model. The laser scan beam and geometry patterns are analyzed to describe the uncertainties in this process. The third section explains the final selection standard, which comprehensively considers the influences of sensitivity and uncertainty. \subsection{Sensitivity model} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.09\textwidth]{./image/PlaneResidual.jpg} \label{figure:PlaneResidual}} \hspace{0.1\textwidth} \subfigure[]{ \includegraphics[width=0.1\textwidth]{./image/LineResidual.jpg} \label{figure:LineResidual}} \caption{Two types of common residuals used in LO: (a) point-to-plane distance and (b) point-to-line distance.} \end{figure} To satisfy the assumption of an infinitesimal rotation and translation, the linearization error approaches zero. \begin{equation} \mathbf{R}\approx \begin{bmatrix} 1 & -r_z & r_y \\ r_z & 1 & -r_x \\ -r_y & r_x & 1 \end{bmatrix} \approx\rm \mathbf{I}_3 + \begin{bmatrix} r_x \\ r_y \\ r_z \end{bmatrix}^\wedge \end{equation} \subsubsection{Point-to-plane distance} A LiDAR measured point $\mathbf{p}_i$ and the corresponding map point $\mathbf{q}_i$, which is defined as a point on the plane. The normal vector is $\mathbf{n}_i$, as shown in Fig. \ref{figure:PlaneResidual}. The error of the $i$-index residual-term point-to-plane distance is \begin{equation} e^{pl}_i=(\mathbf{Rp}_i+\mathbf{t}-\mathbf{q}_i)^{\rm T}\mathbf{n}_i \end{equation} and $e^{pl}_i$ is scalar. \begin{equation} \begin{aligned} e^{pl}_i & \approx\left[(\mathbf{I}+\mathbf{r}^\wedge)\mathbf{p}_i+\mathbf{t}-\mathbf{q}_i\right]^{\rm T}\mathbf{n}_i \\ & \approx\left[\mathbf{p}_i+\mathbf{r}\times \mathbf{p}_i+\mathbf{t}-\mathbf{q}_i\right]^{\rm T}\mathbf{n}_i \end{aligned} \end{equation} Residual sensitivity describes the $\mathbf{r}$ and $\mathbf{t}$ on $e^{pl}_i$. Thereafter, we used the Jacobian tool and linearized rotation to calculate this property. \begin{equation} \label{equation:sensitivity point to plane} \mathbf{J}_{e^{pl}_i}=\left[\frac{\partial {e^{pl}_i}^{\rm T}}{\partial (\mathbf{r},\mathbf{t})}\right]^{\rm T}= \begin{bmatrix} (\mathbf{p}_i\times \mathbf{n}_i)^{\rm T} & \mathbf{n}_i^{\rm T} \end{bmatrix} \end{equation} \subsubsection{Point-to-line distance} A LiDAR measured point, $\mathbf{p}_i$, and the corresponding map point, $\mathbf{q}_i$, which is defined as a point on the line. Its pointing direction is the unit vector $\mathbf{n}_i$, as shown in Fig. \ref{figure:LineResidual}. Before forming the distance, a new vector $\mathbf{d}_i$ should first be defined. \begin{equation} \mathbf{d}_i=(\mathbf{q}_i-\mathbf{Rp}_i-\mathbf{t})\times(\mathbf{q}_i+\mathbf{n}_i-\mathbf{Rp}_i-\mathbf{t}) \end{equation} where $\mathbf{d}_i$ denotes a $3\times1$ vector. Its norm is the parallelogram area of vectors $\mathbf{p}_i$ to $\mathbf{q}_i$ and $\mathbf{p}_i$ to $\mathbf{q}_i+\mathbf{n}_i$. Its direction was orthogonal to the plane of the two vectors. Because the norm vector $\mathbf{n}_i$ is a unit vector, the number of areas is exactly equal to the distance. The error in the $i$-index residual term point-to-line distance $e^{li}_i$ is defined as \begin{equation} e^{li}_i=\mathbf{d}_i^{\rm T}\mathbf{d}_i \end{equation} This differed from the point-to-plane distance. First, $\mathbf{d}_i$ is derived as \begin{equation} \begin{aligned} \mathbf{d}_i & \approx(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i)\times(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i+\mathbf{n}_i) \\ & \approx(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i)\times \mathbf{n}_i \end{aligned} \end{equation} The Jacobian of the distance $\mathbf{d}_i$ is \begin{equation} \label{equation:sensitivity point to line} \mathbf{J}_{\mathbf{d}_i}=\left[\frac{\partial \mathbf{d}_i^{\rm T}}{\partial (\mathbf{r},\mathbf{t})}\right]^{\rm T}= \begin{bmatrix} (\mathbf{n}_i^{\rm T}\mathbf{p}_i){\rm \mathbf{I}_3}-\mathbf{p}_i \mathbf{n}_i^{\rm T} & \mathbf{n}^\wedge \end{bmatrix} \end{equation} where $\mathbf{J}_{\mathbf{d}_i}$ is a $3\times6$-matrix. Moreover, \begin{equation} \Delta e^{li}_i=\Delta \begin{bmatrix} \mathbf{r} & \mathbf{t} \end{bmatrix} \mathbf{J}_{\mathbf{d}_i}^{\rm T}\mathbf{J}_{\mathbf{d}_i}\Delta \begin{bmatrix} \mathbf{r} \\ \mathbf{t} \\ \end{bmatrix} \end{equation} Thus, Hessian matrix $\mathbf{H}_{\mathbf{d}_i}=\mathbf{J}_{\mathbf{d}_i}^{\rm T}\mathbf{J}_{\mathbf{d}_i}$ is defined. Therefore, point-to-line $e^{li}_i$ is a quadratic form of the optimization parameters, different from the linear form in the point-to-plane distance. Direct decoupling into six dimensions is impossible because the partial derivatives of the quadratic function approximating $\Delta \mathbf{r}={\bf 0}$ and $\Delta \mathbf{t}={\bf 0}$ are consistently zero. Thus, we have focused on the growing gradient in a small region. The Hessian matrix was projected onto the six axes. Every eigenvalue with vectors was projected onto the $j$-index axis. They were regrouped in linear form. \subsection{Uncertainty model} Before introducing the uncertainty model, the accuracy and variance should be defined. For the standard variable $\theta$, the accuracy is $\Delta\theta$. As shown in Table \ref{table:Distribution Variance}, when the error associated with the variable $\theta$ is defined with distinct distributions, the variance is different. \begin{table}[htbp] \begin{center} \caption{Distribution and variance notations} \renewcommand\arraystretch{1.4} \resizebox{0.45\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline variable & accuracy & distribution type & variance \\ \hline \multirow{3}{*}{$\theta$} & \multirow{3}{*}{$\Delta\theta$} & Uniform & $\sigma_\theta=\frac{\Delta\theta}{\sqrt{3}}$ \\ \cline{3-4} & & Gaussian & $\sigma_\theta=\Delta\theta$ \\ \cline{3-4} & & Not measured & $\sigma_\theta=0$ \\ \hline \end{tabular} } \label{table:Distribution Variance} \end{center} \end{table} \subsubsection{Laser scan beam} Based on a multibeam laser scanner system \cite{2007LidarError,2007AirLaser,2018VLP16Model}, the rotation $\mathbf{R}^{sl}$ is from the laser coordinate $l$ to the scanner coordinate $s$. Typically, a mechanical spinning device, which creates a fixed laser to a circular scanner, as shown in Fig. \ref{figure:LidarScanModel4}. \begin{equation} \mathbf{R}^{sl}(\alpha,\omega)= \begin{bmatrix} cos\omega & 0 & sin\omega \\ 0 & 1 & 0 \\ -sin\omega & 0 & cos\omega \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & cos\alpha & -sin\alpha \\ 0 & sin\alpha & cos\alpha \end{bmatrix} \end{equation} where $\alpha$ is the azimuth angle and $\omega$ is the elevation angle of the laser beam channel. \begin{figure}[htbp] \centering \subfigure[coordinates]{ \includegraphics[width=0.25\textwidth ,height=0.15\textwidth]{./image/LidarScanModel4.jpg} \label{figure:LidarScanModel4}} \hspace{0.15\textwidth} \subfigure[diode stack]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel1.png} \label{figure:LidarScanModel1}} \subfigure[receiver]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel2.png} \label{figure:LidarScanModel2}} \subfigure[laser scan lines]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel3.png} \label{figure:LidarScanModel3}} \caption{LiDAR laser scan beam model. (a) is the coordinate from laser to scanner. (b) is a laser diode stack emits three light beams. (c) is an infrared observation window. (d) indicates three laser lines and their footprints.} \end{figure} As illustrated in Fig. \ref{figure:LidarScanModel1}, a laser diode stack emits three light beams. They fall on the environment surface and are reflected in the LiDAR observation window, as shown in Fig. \ref{figure:LidarScanModel2}. LiDAR records the emission time and the most intense time to calculate depth. Owing to the observation window, the laser depth can be simulated as a divergent beam. The true location can lie anywhere within the beam footprint. According to the manual, the Velodyne Puck (VLP-16) claims $\Delta z^l=3\ cm$. The horizontal and vertical divergence angles of the rectangular window were $\delta _h=3 \times 10^{-3}\ rad$ and $\delta _v=1.5 \times 10^{-3}\ rad$. Therefore, assuming that point is uniform in this region, \begin{equation} \sigma _{x^l}=\frac{\Delta x^l}{\sqrt{3}}=\frac{z^l tan(\frac{\delta _v}{2})}{\sqrt{3}}, \sigma _{y^l}=\frac{\Delta y^l}{\sqrt{3}}=\frac{z^l tan(\frac{\delta _h}{2})}{\sqrt{3}} \end{equation} Following the self-rotation, a laser scan line was formed, as shown in Fig. \ref{figure:LidarScanModel3}. Every elevation angle $\omega$ was carefully calibrated and rectified; thus, $\sigma _\omega=0$. For the azimuth $\alpha$, the manual states that the rotation angular resolution is $0.01\ \degree$. All studies in \cite{2007LidarError,2020LidarComparing,2007AirLaser,2018VLP16Model} assumed that \begin{equation} 0<\sigma _\alpha<\frac{\pi\Delta\alpha}{180\sqrt{3}} \end{equation} where $\Delta\alpha= 0.005\ \degree$ is the half resolution. The LiDAR parameters and coordinates are shown in Fig. \ref{figure:LidarScanModel4}. Because self-rotation is nonlinear, $\mathbf{R}^{sl}(\alpha,\omega)$ must be linearized, and uncertainty propagation works. Finally, uncertainty is a matrix. In laser coordinate $l$, it is a $5\times 5$ matrix $\Sigma^l$. The scanner coordinate $s$ is a $3\times 3$ matrix $\Sigma^s$. They are connected by uncertainty propagation as follows: \begin{equation} \Sigma^s=\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}^T\Sigma^l\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)} \end{equation} where $\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}$ denotes a $3\times 5$ matrix. This is derived from the first-order Taylor expansion formula of $\mathbf{R}^{sl}(\alpha,\omega)$. \begin{equation} \mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}={\left[\frac{\partial \mathbf{R}^{sl}(\alpha,\omega)}{\partial (x,y,z,\alpha,\omega)}\right]}^T \end{equation} $\Sigma^l$ is generated as a diagonal matrix from the individual sources: \begin{equation} \Sigma^l=\rm diag \begin{bmatrix} \sigma^2_{x^l} & \sigma^2_{y^l} & \sigma^2_{z^l} & \sigma^2_\alpha & \sigma^2_\omega \end{bmatrix} \end{equation} These variable variances have been discussed previously, and some can be found in the LiDAR sensor manual. \subsubsection{Geometry pattern} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.2\textwidth]{./image/PointPlane.jpg} \label{figure:PointPlane}} \hspace{0.05\textwidth} \subfigure[]{ \includegraphics[width=0.15\textwidth]{./image/PointLine.jpg} \label{figure:PointLine}} \caption{Two error types establish different residual terms. (a) Point-to-plane distance and (b) point-to-line distance. Registration attempts to adjust rotation and translation and then decrease these error distances.} \end{figure} Owing to inhomogeneous noise, sparse density, and missing data in LiDAR sampling \cite{2018SurfaceBasedGICP}, pose estimation typically employs plane and line patterns. Several studies \cite{2014LOAM,2018LeGOLOAM,2019LIOmapping,2020LIOSAM,2021MULLS} have minimized the alignment distance. The LO baseline LOAM \cite{2014LOAM} uses five neighboring points to model the plane or line shown in Fig. \ref{figure:PointPlane} and \ref{figure:PointLine}. Applying PCA technique, eigenvalues $\lambda^0<\lambda^1<\lambda^2$ and eigenvectors $\mathbf{\nu}^0$, $\mathbf{\nu}^1$ and $\mathbf{\nu}^2$ are calculated by applying the PCA technique. These correspond to $x$,$y$, and $z$ dimensions. This process essentially involves modeling the surface as a 3D Gaussian ellipsoid. We should comprehensively consider the influences of both current LiDAR measured information uncertainties (laser scan beam) and history-map model uncertainties (geometry pattern). As shown in Fig. \ref{figure:SmallUncertaintyFusion}, the prior only considers modeling these map points as a plane. After adding the information of every point uncertainty, although the posterior becomes slightly fat, this fusion result indicates that this model is sufficiently good for pose estimation. In Fig. \ref{figure:BigUncertaintyFusion}, considering every point uncertainties, the posterior becomes thick in the main direction, and this fusion result is bad. Because our purpose is to model uncertainties in registration, the main error direction uncertainties are modeled using the sigma-point transform technique \cite{1996SigmaPointTransform}. The points were resampled around the ellipsoid to infer the posterior Gaussian distribution. The distances of these points to the mean are one sigma. \begin{figure}[htbp] \centering \subfigure[low uncertainty fusion result]{ \includegraphics[width=0.15\textwidth]{./image/SmallUncertaintyFusion.jpg} \label{figure:SmallUncertaintyFusion}} \hspace{0.05\textwidth} \subfigure[high uncertainty fusion result]{ \includegraphics[width=0.17\textwidth]{./image/BigUncertaintyFusion.jpg} \label{figure:BigUncertaintyFusion}} \caption{Resampling points to measurement uncertainties. These points' distances to the mean are one sigma; low uncertainty fusion is satisfactory for estimation.} \end{figure} Similar to minimizing the Kullback-Leibler divergence \cite{2007KLDivergenceGMM} between two Gaussians, we provide a simple fusion method in which the eigenvalue along the registration direction is employed to reflect the disparity: \begin{equation} \label{equation:uncertainty} \Phi_{e_i}= \begin{cases} (\lambda_{i_{sou}}^0+\lambda_{i_{tar}}^0)/2 & (plane) \\ (\lambda_{i_{sou}}^0+\lambda_{i_{sou}}^1+\lambda_{i_{tar}}^0+\lambda_{i_{tar}}^1)/4 & (line) \end{cases} \end{equation} where $\Phi_{e_i}$ is a scalar that evaluates uncertainty. $\lambda_{i_{sou}}^0$ is the smallest eigenvector of the source point distribution, and $\lambda_{i_{tar}}^0$ is for the target. \subsection{Sort by score} Motivated by Eq. (\ref{equation:Point Contribution Model 5}), combining the sensitivity and uncertainty models from Lemmas \ref{lemma:Sensitivity} and \ref{lemma:Uncertainty} into a score, and judging the residual influence on the pose estimation accuracy. In practice, using Eqs. (\ref{equation:sensitivity point to plane}), (\ref{equation:sensitivity point to line}), and (\ref{equation:uncertainty}), the score for a residual can be derived as \begin{equation} \Psi_{e_i}=\frac{\mathbf{J}_{e_i}}{\Phi_{e_i}^2} \end{equation} where the score $\Psi_{e_i}$ is a $6\times1$ vector that corresponds to three rotations and three translations. Next, we performed score sorting and selected residuals from the top big score in every six dimensions, in parallel. The repeated terms were recorded only once. Because the dislocation match and geometry assumption (plane line) cause four point pairs to be unstable, we set a threshold parameter to judge the stop rule: (1) the selected residual amount reaches $200$ per dimension and (2) the residual score decreases to $10\%$ of the maximal. \section{Experiments} We used simulation, benchmark, and our captured real data to introduce the experiments, which were segmented into three parts. The first part is a two-frame point cloud registration simulation (Section \ref{subsection:Simulation}), which controls the noise amplitude in the measurements and models. This verifies the validity of the residual selection scheme in a controlled environment. The second part is the KITTI benchmark \cite{2012KITTI} comparison (section \ref{subsection:KITTI Benchmark}), which aims to prove the selection's general effectiveness in decreasing time cost and improving pose accuracy. The third part comprises our captured real indoor and outdoor data (Section \ref{subsection:Online Captured Scenario}). It contains two types of scan-mode LiDAR and inertial measurement unit (IMU) data. This part proves our method's validation in both the LO and LIO algorithms and is also applicable for different LiDARs. Finally, the IMU is used only in LIOmapping \cite{2019LIOmapping} for comparison purposes, which is unnecessary for our proposed algorithm. Therefore, the sensitivity- and uncertainty-theory-based residual term selection scheme achieved significant improvements in accuracy. It exhibits real-time performance with fewer residual terms and lower computational costs in nonlinear optimization. Our codes were implemented in C++. The program was executed on a desktop computer with hardware parameters of a six-core CPU AMD 2600x, 48-GB RAM, and an Nvidia RTX 2070 GPU. \subsection{Simulation} \label{subsection:Simulation} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.23\textwidth]{./image/DisturbanceOnMeasurement.jpg}} \subfigure[]{ \includegraphics[width=0.23\textwidth]{./image/DisturbanceOnModel.jpg}} \caption{LiDAR measurement points are randomly generated. The initial pose is set as an identity matrix, and 100 times experiments calculate mean translation errors for one specific parameter set. Disturbances are separately added. Under both conditions, the random method samples the same point amount as the selection method. When disturbance amplitudes are zero, both methods have no deviations. When amplitudes grow, translation errors of both methods increase; however, the growth of the proposed selection method is slower.} \label{figure:SimulationDisturbance} \end{figure} \begin{algorithm}[htbp] \label{algorithm:Simulation} \caption{Two-frame (source and target) registration simulation} \LinesNumbered \KwIn{input parameters: disturbance amplitude $Da$, residual number $Rn$} \KwOut{output results: translation error in selection $t^{sel}$ and random $t^{ran}$} Source LiDAR points were randomly generated from $1\ m$ to $100\ m$ in 64-circles with different depths. {/*generate points*/}\; The PCD density satisfies the Velodyne HDL64 angle resolution Every point is randomly allocated to a specific geometry pattern model, a plane (three points), or a line (two points). The measured points remain associated with their models, and these matches do not change during optimizations\; \For{$Da=0$;$Da<0.2$;$Da+=0.01${/*disturbances*/}}{ \For{$Rn=120$;$Rn<=240$;$Rn+=60${/*select*/}}{ \For{int $i=0$;$i<100$;$i++${/*multi-samples*/}}{ The ground truth transformation $T_{gt}$ is randomly generated{/*generate a gt pose*/}\; Apply $T_{gt}$ to the source LiDAR points to generate target points{/*apply pose*/}\; Apply disturbance $Da$ to the measurements or models{/*apply disturbances*/}\; The proposed theory-based method selects $Rn$ terms and calculates the transformation result $T^{sel}_i${/*selection method*/}\; The random method selects $Rn$ terms and calculates the transformation result $T^{ran}_i${/*random method*/}\; Calculate the translation errors of the selection $t^{sel}_i=||T_{gt}-T^{sel}_i||$ and random $t^{ran}_i=||T_{gt}-T^{ran}_i||${/*one-test comparison*/}. } Calculate the mean translation errors $t^{sel}$ and $t^{ran}$ $100$ times{/* multi-sample mean*/}\; } } \end{algorithm} To evaluate the proposed theory, in Algorithm \ref{algorithm:Simulation}, a two-frame (source and target) registration simulation is implemented. The ground truth (gt) transformation and LiDAR measured points (source) were randomly generated. Every point was randomly allocated to a specific pattern model, plane (three points), or line (two points). Next, the gt pose was applied to the source points to generate the target points. Subsequently, the disturbances increase. Finally, theory-based and random selection methods were applied to solve the registration. This was repeated 100 times, and then an average translation error was derived. A comparison between the two methods reveals that the proposed method is superior, as shown in Fig. \ref{figure:SimulationDisturbance}. The resulting curves are presented in Fig. \ref{figure:SimulationDisturbance}. The disturbance amplitude increased along the horizontal axis. When the disturbance is zero, the data associations are accurate and do not change during the optimization. The proposed and random methods converge to zero. The error in the proposed method gradually increased as the disturbance amplitude increased. The random method probably selected large-error residual terms. The proposed method sorted all the terms; thus, the selected terms were optimal. This simulation demonstrated the influence of the proposed theory on improving pose estimation accuracy. \subsection{KITTI benchmark} \label{subsection:KITTI Benchmark} The KITTI benchmark is a well-known autonomous driving benchmark \cite{2012KITTI}. It includes a Velodyne LiDAR ($64$ scans), two gray cameras, and two color cameras. The GPS and IMU were used for the gt. It provides $11$ sequences with ground truths in urban, city, natural, and highway environments, and has been widely used for VO and LO evaluation. A few comparison algorithms are introduced in this section. ALOAM is a well-known advanced c++ realization of the LO baseline LOAM \cite{2014LOAM}. LOAM is now a closed source. Several other LO/LIO algorithms have been modified, such as LeGOLOAM \cite{2018LeGOLOAM} and LIO-SAM \cite{2020LIOSAM}. We compared the original ALOAM with ALOAM-select, which was added to our proposed selection scheme in front of the mapping thread optimization. The pose accuracy and time costs are compared in the following sections. MLOAM \cite{2021ICRAmloam} is another relevant work in this field that has a residual selection process. Although it was designed for a multi-LiDAR system, we modified it for one LiDAR. In particular, MLOAM (we modified) and ALOAM-select were only compared in a standard benchmark. \subsubsection{Pose accuracy} The first test directly utilized selection in the ALOAM mapping thread, indicating that our selected residual terms are a subset of the original code used. The results are summarized in TABLE \ref{table:KITTI Subset}. On average, the proposed method employs fewer planes and lines for optimization than the original method. Although the residuals ALOAM-select used were a subset of the original ALOAM, improvements were achieved in seven sequences. For the other four sequences, the proposed method was not superior. Nevertheless, these four sequences fell by approximately $0.05\%$, including $5\ cm$ drift over $100\ m$. We believe that waiting to be selected as a feature set restricts the improvement in accuracy. In particular, the detected feature point set of ALOAM was insufficiently large for our selection. We modify the feature detection parameter of the original ALOAM in the next test to illustrate our hypothesis. \begin{table*}[htbp] \begin{center} \caption{KITTI subset points} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{ALOAM/m} & 0.7556\% & 1.9629\% & 4.5316\% & 0.9507\% & \bf{0.7201}\% & 0.5421\% & 0.6053\% & \bf{0.4203}\% & \bf{1.0482}\% & 0.7235\% & \bf{1.0075}\% & 1.7318\% \\ LineNum & 1051 & 1477 & 1070 & 1230 & 1304 & 1166 & 1414 & 1050 & 1190 & 1214 & 1067 & 1203 \\ PlaneNum & 1707 & 2865 & 1968 & 2885 & 2628 & 2015 & 3521 & 1746 & 2265 & 2298 & 1718 & 2328 \\ \hline \bf{ALOAM-select/m} & \bf{0.7244}\% & \bf{1.9339}\% & \bf{4.4820}\% & \bf{0.8636}\% & 0.7295\% & \bf{0.4828}\% & \bf{0.5798}\% & 0.4493\% & 1.0662\% & \bf{0.6609}\% & 1.0659\% & \bf{1.7041}\% \\ LineNum & \bf{676} & \bf{646} & \bf{662} & \bf{658} & \bf{719} & \bf{688} & \bf{700} & \bf{676} & \bf{674} & \bf{690} & \bf{670} & \bf{678} \\ PlaneNum & \bf{1294} & \bf{1451} & \bf{1325} & \bf{1438} & \bf{1449} & \bf{1352} & \bf{1523} & \bf{1287} & \bf{1341} & \bf{1394} & \bf{1207} & \bf{1369} \\ \hline \end{tabular} } \label{table:KITTI Subset} \end{center} \end{table*} \begin{table*}[htbp] \begin{center} \caption{KITTI twice potential points} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{ALOAM/m} & 0.7556\% & 1.9629\% & 4.5316\% & 0.9507\% & 0.7201\% & 0.5421\% & 0.6053\% & 0.4203\% & 1.0482\% & 0.7235\% & \bf{1.0075}\% & 1.7318\% \\ LineNum & 1051 & 1477 & 1070 & 1230 & 1304 & 1166 & 1414 & 1050 & 1190 & 1214 & 1067 & 1203 \\ PlaneNum & 1707 & 2865 & 1968 & 2885 & 2628 & 2015 & 3521 & 1746 & 2265 & 2298 & 1718 & 2328 \\ \hline \bf{ALOAM-select2/m} & \bf{0.7462}\% & \bf{1.8716}\% & \bf{4.0993}\% & \bf{0.7866}\% & \bf{0.6817}\% & \bf{0.3984}\% & \bf{0.5625}\% & \bf{0.3927}\% & \bf{0.9670}\% & \bf{0.5844}\% & 1.0778\% & \bf{1.5781}\% \\ LineNum & \bf{838} & \bf{777} & \bf{758} & \bf{748} & \bf{833} & \bf{784} & \bf{816} & \bf{761} & \bf{768} & \bf{792} & \bf{755} & \bf{784} \\ PlaneNum & \bf{1674} & \bf{1418} & \bf{1303} & \bf{1414} & \bf{1424} & \bf{1327} & \bf{1509} & \bf{1255} & \bf{1321} & \bf{1370} & \bf{1181} & \bf{1381} \\ \hline \end{tabular} } \label{table:KITTI Twice} \end{center} \end{table*} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Sequence10.jpg} \caption{KITTI sequence 10: LiDAR points restricted to the local region by bushes on both sides. Scores are similar in this environment. Error matches influence the proposed selection; hence, falling behind by $7\ cm$ is possible under this extreme environment.} \label{figure:Sequence10} \end{figure} For the second test, we used twice the number of potential feature points for selection (ALOAM-select2). As summarized in TABLE \ref{table:KITTI Twice}, the accuracy improves by approximately $20\ cm$ per $100\ m$, with advancements in ten sequences. Moreover, only approximately half of the planes and lines were used to obtain this result. These two tests demonstrated the validity of our theory for improving accuracy. To identify shortages, in the second test sequence 10, the checking of the LiDAR frame points is shown in Fig. \ref{figure:Sequence10}. The car in this sequence traverses a wild-field road with bushes on both sides. In this environment, LiDAR observations were restricted to a local region. Our calculations yielded similar results. The proposed algorithm trades off the robustness to achieve accuracy. Error matches have a stronger influence; thus, falling behind $7\ cm$ is possible in this extreme environment. MLOAM \cite{2021ICRAmloam} was designed for multi-LiDAR systems. The results are compared on KITTI, as summarized in TABLE \ref{table:KITTI MLOAM}. Regarding the proposed method, only Sequence 02 falls behind; the other sequences have better results. MLOAM's selection scheme defines manual prior information, solves a metric Max-$log$Det, and then derives residuals that persist. Our proposed theory considers the sensitivity and uncertainty of sensor data, which are closer to the natural process of an LO. This enables more accurate measurements and map models to improve accuracy and avoids the calculation of matrix determinants. For sequence 02, the LiDAR goes through a crossroad with fast turning, and the proposed method drifts significantly from this location. From that point onward, it was considerably misled, resulting in a large error in the total path. MLOAM was originally intended for multi-LiDAR sensors, and we modified its code for one LiDAR running. Considering fairness and limitations on the article length, the next section's comparison focuses on the single LiDAR algorithm. \begin{table*}[htbp] \begin{center} \caption{KITTI MLOAM} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{MLOAM/m} & 1.7015\% & 2.3043\% & \bf{2.3271}\% & 1.0544\% & 1.1347\% & 0.8285\% & 1.4445\% & 1.4053\% & 1.0679\% & 1.5106\% & 1.9189\% & 1.6152\% \\ \hline \bf{ALOAM-select2/m} & \bf{0.7462}\% & \bf{1.8716}\% & 4.0993\% & \bf{0.7866}\% & \bf{0.6817}\% & \bf{0.3984}\% & \bf{0.5625}\% & \bf{0.3927}\% & \bf{0.9670}\% & \bf{0.5844}\% & \bf{1.0778}\% & \bf{1.5781}\% \\ \hline \end{tabular} } \label{table:KITTI MLOAM} \end{center} \end{table*} \subsubsection{Time Cost} \begin{figure*}[htbp] \centering \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost50.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost100.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost200.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost300.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost400.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost500.jpg}} \caption{Black is selection time, which is within almost $15\ ms$. The green is detection time, which is constant in comparisons. The red is optimization time. Provided that increasing of the residual selection amount per dimension, is from $50$ to $500$; more residuals are selected and entered into optimization, which makes it more time-consuming.} \label{figure:TimeCost} \end{figure*} To verify the effect of the selection part on the overall LO time performance, the time costs of the main part are shown in Fig. \ref{figure:TimeCost}. Compared with feature point detection (green) and residual optimization (red), our selection process (black) costs less than $15\ ms$. The optimization part accounts for a large proportion of the time cost. Provided that the selected residual amount per dimension decreases from $500$ to $50$, the optimization becomes faster. Some coding tricks have been introduced here to illustrate why the selection parts require less time. If an LO/LIO algorithm adopts our selection, its accuracy can be improved, and more computation time can be achieved. First, not every residual must participate in the sorting. When calculating the score, the maximal scores in $6$ dimensions were recorded. Residuals scores are higher than the ratio threshold ($60\%$ we adopt) of maximal retention sorting. Second, point-to-plane and point-to-line are both independent in $6$ dimensions; thus, multithread parallel operations accelerate sorting. Therefore, the optimization part requires time, which is related to the residual amount. If we utilize our selected residuals, compared with using all obtainable residuals, the residual term amount decreases significantly, and the selection process is still lightweight. The pose estimation accuracy is simultaneously improved in the next section, and we use residual amounts to illustrate the computation cost. \subsection{Online captured scenario} \label{subsection:Online Captured Scenario} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Scenario.jpg} \caption{Our online captured scenarios are shown in Fig. \ref{figure:Scenario}. The indoor environment is a building with a long corridor. Its length is $74m$, and width is $35m$.The outdoor path is approximately $1.1 km$ long. Both capturing tours start and end at exactly the same location, and execute five times for fairness.} \label{figure:Scenario} \end{figure} We used our sensors to operate in real environments to illustrate the details. The captured online scenarios are shown in Fig. \ref{figure:Scenario}. The indoor environment includes walking inside a building with a long corridor. The outdoor path was approximately $1.1 km$ long. By pasting a landmark on the ground, both tours start and end at exactly the same location. The same path is captured five times to ensure fairness and credibility. Two collection devices were used during capture, as shown in Fig. \ref{figure:VLP16Xsense BS LiDAR}. The first was a Velodyne LiDAR (Puck VLP16) with an IMU (Xsens MTI-100). The second is Robosense LiDAR (Blind Spot 32). As shown in Fig. \ref{figure:VLP16Xsense BS LiDAR Points}, these two LiDARs have completely different scan modes. The horizon of VLP16 was $360 \degree$, and the BS LiDAR was a half-sphere window with 32 scans. \begin{figure}[htbp] \centering \subfigure[Collection device: Velodyne LiDAR (Puck VLP16) and IMU (Xsens MTI-100), Robosense LiDAR (Blind Spot 32)] { \label{figure:VLP16Xsense BS LiDAR} \includegraphics[width=0.45\textwidth]{./image/LiDARIMUBlindSpot.jpg} } \subfigure[These two type of LiDAR sensors have different scan modes.] { \label{figure:VLP16Xsense BS LiDAR Points} \includegraphics[width=0.45\textwidth]{./image/LiDARIMUBlindSpotPoints.jpg} } \caption{Two collection devices and their different scan modes.} \end{figure} We apply our method to ALOAM and LIOmapping as ALOAM-select and LIOmapping-select, respectively. We both set the same strategy and parameters: (1) stop when the residual amount reaches a maximum of 200 per dimension; (2) stop when the residual score decreases to $10\%$ of the maximum. For convenience, we focused on the pose accuracy using the loop-closure error. \subsubsection{VLP16 LO indoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{indoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{ALOAM} & 0.0334 & \bf{0.0163} & 0.1131 & 0.0338 & 6.7570 \\ \hline \bf{ALOAM-select} & \bf{0.0274} & 0.0184 & \bf{0.0654} & \bf{0.0162} & \bf{0.0400} \\ \hline & & & \\ \hline \bf{BALM} & 0.0278 & \bf{0.0091} & 0.0597 & 0.0303 & 0.1471 \\ \hline \bf{BALM-select} & \bf{0.0261} & 0.0146 & \bf{0.0534} & \bf{0.0244} & \bf{0.0846} \\ \hline \end{tabular} } \label{table:VLP16 LO Indoor} \end{center} \end{table} The indoor loop closure errors are summarized in TABLE \ref{table:VLP16 LO Indoor}. Because the LiDAR range was sufficiently long to measure the farthest wall, the drift was within the centimeter level. Compared with ALOAM, ALOAM-select achieved better results in the four sequences. In sequence 01, because ALOAM's translation is virtually $1\ cm$, we believe that the accuracy of the start and end locations of this sequence is insufficient for evaluation. Sequence 04 involved walking in the restroom. More surrounding points are used by ALOAM, but ALOAM-select uses more points outside the door and window, which are more sensitive. The ALOAM drift was distinct, whereas that of the ALOAM-select was low. This result verifies the validity of the electioproposed sn scheme. The paths, maps, and drifts are shown in Figs. \ref{figure:LOsq04}. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/LOsq04A.jpg} \caption{Sequence 04 involves walking into a restroom. More surrounding points are used by ALOAM, but the ALOAM-select uses more points outside the door and window, which are more sensitive.} \label{figure:LOsq04} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/LOsq04BA.jpg} \caption{Drift of BALM is shown in the start and end locations, which should be exactly the same. The drift of BALM-select is smaller, as seen from the building steps.} \label{figure:LOsq04BA} \end{figure} Furthermore, we compared it with the recent famous bundle-adjustment LiDAR mapping algorithm, BALM \cite{2021BALM} in TABLE \ref{table:VLP16 LO Indoor}. The BALM adopts the bundle adjustment concept for visual SLAM. It has a sliding window and adjusts inside frame poses, which aims to make voxels more compact, such as planes flatter and lines more slender. This is also the same idea in eigenfactor \cite{2019EigenFactors}, plane-adjustment \cite{2021PlaneAdjustmentLiDAR}, and $\pi$-LSAM \cite{2021pi-LSAM}. The BALM code was originally designed for the VLP16 LiDAR. We applied our selection scheme in front of the decision regarding, which voxels enter the optimization; thus, we called it BALM-select. Because the inside of the building has many smooth wall constraints, the loop-closure errors are significantly small. Because of the sliding windows in the bundle adjustment, the indoor environment is insufficiently large for LiDAR sensors. Current frame observations may be connected to early information, which strongly constrains the sensor pose. Therefore, after comparing the indoor data, the BALM accuracy disparity was not as obvious as that of ALOAM. \subsubsection{VLP16 LO outdoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{outdoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{ALOAM} & 7.8131 & 10.0851 & 8.0538 & 5.0375 & 6.9043 \\ \hline \bf{ALOAM-select} & \bf{5.0001} & \bf{5.8372} & \bf{4.4030} & \bf{3.3837} & \bf{5.4447} \\ \hline & \\ \hline \bf{BALM} & 6.3223 & 11.7821 & 6.2510 & 4.8214 & 5.9736 \\ \hline \bf{BALM-select} & \bf{4.6401} & \bf{6.3965} & \bf{4.1028} & \bf{2.0205} & \bf{4.2007} \\ \hline \end{tabular} } \label{table:VLP16 LO Outdoor} \end{center} \end{table} The outdoor loop closure errors are summarized in TABLE \ref{table:VLP16 LO Outdoor}. The long outdoor path demonstrates the superiority of the ALOAM-select and BALM-select. This path is approximately $1.1\ km$-long circle in Fig. \ref{figure:LIOLoopClosureError}. The proposed method achieved almost twice the accuracy of all five sequences. These results further support the analysis of the proposed method using the KITTI benchmark dataset. Under large-scale conditions, the proposed method achieves more significant results. The wall mapping quality is illustrated in Fig. \ref{figure:Wall} and \ref{figure:WallScene}. In Fig. \ref{figure:Wall}, points in the blue rectangle represent the ALOAM building wall; points in the green rectangle are generated by ALOAM-select, and points in the orange rectangle are LIOmapping result. Fig. \ref{figure:WallScene} shows the LiDAR's moving path, and the scanned wall. The ALOAM building wall is thick, indicating that the estimated LiDAR poses a drift. The wall generated by ALOAM-select is as thin as that of LIOmapping, indicating higher accuracy; here, only LiDAR is used to reach this LiDAR with an IMU level. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/LOandLIOWall.jpg} \caption{Building map quality. Points in the blue rectangle represent the ALOAM building wall; points in the green rectangle are generated by ALOAM-select, and points in the orange rectangle are the LIOmapping results. The ALOAM building wall is thick, indicating that the estimated LiDAR poses have drifted. Wall thickness generated by the proposed method is as thin as that of LIOmapping, indicating higher accuracy; only LiDAR is used to reach this LiDAR with the IMU level.} \label{figure:Wall} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Wall.jpg} \caption{Real wall scene: LiDAR moving path, the scanned wall, far and near the scanning surface.} \label{figure:WallScene} \end{figure} \subsubsection{VLP16 LIO Indoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LIO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{indoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{LIOmapping} & \bf{0.0332} & 0.0399 & 0.0297 & \bf{0.0363} & \bf{0.0163} \\ \hline \bf{LIOmapping-select} & 0.0335 & \bf{0.0158} & \bf{0.0198} & 0.0380 & 0.0359 \\ \hline \end{tabular} } \label{table:VLP16 LIO Indoor} \end{center} \end{table} The loop closure error is small for LIO because the indoor path is less than that of the outdoor path; the results are summarized in TABLE \ref{table:VLP16 LIO Indoor}. The path starts from a hall, and the front side of the corridor can be observed. The LiDAR data are repeated on the surrounding walls. The results of LIOmapping and LIOmapping-select were similar. We presumed that the small region restricted the improvement in accuracy. \subsubsection{VLP16 LIO outdoor} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/LIOLoopClosureError.jpg} \caption{After fusing IMU data, the LIO algorithm's loop closure error is significantly smaller than LO. However, from the start and end location data, before and after adding selection's drifts are still visible.} \label{figure:LIOLoopClosureError} \end{figure} \begin{table}[htbp] \begin{center} \caption{VLP16 LIO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{outdoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{LIOmapping} & 3.6719 & 4.5632 & 5.0961 & 4.2081 & 3.6909 \\ \hline \bf{LIOmapping-select} & \bf{3.2095} & \bf{3.6629} & \bf{4.2257} & \bf{4.0576} & \bf{3.1955} \\ \hline \end{tabular} } \label{table:VLP16 LIO Outdoor} \end{center} \end{table} The outdoor results are summarized in TABLE \ref{table:VLP16 LIO Outdoor}. The average improvement in accuracy of LIOmapping-select was approximately $0.5\ m$. Therefore, the application of our theory to LIO systems is also valuable. After fusing the IMU data, the loop closure error of the LIO algorithm was significantly smaller than that of the LO. However, from the start and end location data, before and after the addition of drifts in the selection are still visible. Because LIO mapping does not have a loop-closing function, this error cannot be eliminated. After the addition of selection, LIOmapping-select tends to use far-away observations, which strongly constrain the sensor pose. Thus, the estimation accuracy was higher on average. \subsubsection{Blind spot LO indoor} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/BSPoints.jpg} \caption{BS LiDAR point distribution considerably differs from that of Velodyne VLP16. Many points lie in a small region within $10\ m$ in front of LiDAR. However, distant points on the wall are more suitable for pose estimation in the forwarding moving direction.} \label{figure:BS Points Distribution} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/BSLOIndoorPath.jpg} \caption{BS LiDAR indoor built map. Ground floor and ceiling generated by BS-ALOAM are distorted, because poses drifts are at meter level. BS-ALOAM-select maintains with considerably lower drift.} \label{figure:Indoor Blind Spot} \end{figure} Another scan mode, the Robosense blind spot (BS) LiDAR, is shown in Fig. \ref{figure:VLP16Xsense BS LiDAR}. Its view was a half-sphere with 32 laser scans from $0 \degree$ (horizontal) to $89 \degree$ (vertical). Its direction is set toward the ceiling, which is less likely to be scanned by VPL16. To fit the ALOAM code, we modified the point allocation and feature detection functions and renamed them to BS-ALOAM. Upon entering the corridor, the BS LiDAR was placed toward the front to measure more points. In Fig. \ref{figure:BS Points Distribution}, the BS LiDAR point distribution shows extremely different from that of VLP16. Virtually, $92\%$ of the laser points lie in a small region within $10\ m$ of the surroundings. However, points that are distant from the wall are more useful. In BS-ALOAM selection, more suitable points are selected. The results are summarized in TABLE \ref{table:Blind Spot LO Indoor}; the results of the proposed method are distinct. The accuracy of the BS-ALOAM-select improved from the meter to decimeter level. A building map is shown in Fig. \ref{figure:Indoor Blind Spot}. When we return to the hall, the floor and ceiling map of the BS-ALOAM is distorted because the pose drifts are at the meter level. The BS-ALOAM-select maintained a considerably lower drift. \begin{table}[htbp] \begin{center} \caption{BS LO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment&\multicolumn{5}{|c}{indoor (loop closure error/m)}\\ \hline Sequence&00&01&02&03&04\\ \hline \bf{BS-ALOAM} & 2.9735 & 3.2668 & 3.2795 & 2.1737 & 5.0697 \\ \hline \bf{BS-ALOAM-select} & \bf{0.1301} & \bf{0.1012} & \bf{0.0886} & \bf{0.7348} & \bf{0.1299} \\ \hline \end{tabular} } \label{table:Blind Spot LO Indoor} \end{center} \end{table} \subsubsection{BlindSpot LO Outdoor} \begin{table}[htbp] \begin{center} \caption{BS LO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment&\multicolumn{5}{|c}{outdoor (loop closure error/m)}\\ \hline Sequence&00&01&02&03&04\\ \hline \bf{BS-ALOAM} & 4.4345 & 19.3979 & 17.8245 & 20.5416 & \bf{43.1282} \\ \hline \bf{BS-ALOAM-select} & \bf{3.1535} & \bf{13.5462} & \bf{15.1132} & \bf{12.7554} & 52.5632 \\ \hline \end{tabular} } \label{table:Blind Spot LO Outdoor} \end{center} \end{table} Because of the BS LiDAR scan characteristics, distant points are extremely sparse, and near points are considered dense. According to our theory, the estimation accuracy is significantly lower than that of VLP16. The results summarized in TABLE \ref{table:Blind Spot LO Outdoor} explain this phenomenon. The translation error exceeded that of VLP16. Although certain improvements were achieved, the resulting errors can be ignored. Thus, BS LiDAR is unsuitable for outdoor SLAM applications. SLAM requires a LiDAR sensor capable of capturing distant points, which is more favorable for estimation. \section{Conclusion} \label{section:Conclusion} In this paper, we proposed a theory of LiDAR point sensitivity and uncertainty to enhance LiDAR odometry accuracy. We demonstrated that our selection method is a global statistical optimal. To explain this realization, LiDAR measurement uncertainties and fusing mechanisms were calculated, and residual sensitivities were analyzed. The scores were decoupled into six dimensions. Thereafter, the algorithm sorted and selected the residuals for optimization. The experiment results revealed that superior pose estimation accuracy was achieved. This selection makes it possible to simultaneously achieve high optimization accuracy and guarantee real-time performance. Owing to laser time-of-flight sensing and careful rotary mechanism calibration, the LiDAR uncertainty region does not grow as large as that of the binocular cameras. Therefore, LiDAR had a more distinct effect on our theory. The problem of data association has not yet been addressed. This work adopted traditional data association methods in the LO, relying on a uniform motion model or IMU, which is the neighborhood principle in ICP. Because this study concentrates on improving the pose estimation accuracy, a uniform motion model for walking or low-speed driving is sufficient. The proposed theory attempts to select residual terms with small uncertainties and high sensitivities. This fundamentally decreases the robustness of the pose estimation and simultaneously increases its accuracy; this is the reason for the tradeoff between robustness and accuracy. To improve the accuracy of pose estimation from another perspective, our next objective is to investigate data association. \section{Introduction}\label{section:Introduction}} \IEEEPARstart{S}{imultaneous} localization and mapping (SLAM) methods have been applied to solve localization and map-building problems in robotics. LiDAR odometry and local mapping algorithms are widely used in SLAM systems. However, integration processes unavoidably cause an accumulation of pose errors. This drift causes map distortion and estimation failure. Although SLAM is a loop-closing algorithm, it only disperses errors in the history trace, rather than truly eliminating every pose error \cite{2017StateEstimation}. The key to improving the long-term performance relies on the enhancement of front-end accuracy \cite{2016PastPA}. Inspired by our experience with visual odometry (VO) in a dynamic environment \cite{2020PointCorrelations}, diverse feature points are considered owing to their different influences on pose estimation. We presume that diverse LiDAR point residuals have different sensitivities and uncertainties for pose estimation accuracy. Therefore, a novel sensitivity and uncertainty theory that distinguishes residuals from diverse pattern representations was proposed. The theory quantifies the influence of every residual term’s pose estimation accuracy into six dimensions: three for rotation and three for translation. The theory classifies and selects a subset of high sensitivity and low uncertainty, which enters the optimization to achieve a higher accuracy than the utilization of all points. As shown in Fig. \ref{figure:AfterSelected}, the left is the original LO using all valid planar feature points, and the right is adding our selection scheme to this LO. They run on the KITTI benchmark \cite{2012KITTI} sequence 03. The selected planar points were almost half of the original; however, they obtained fewer translation errors simultaneously. \begin{figure*}[htbp] \centering \includegraphics[width=0.95\textwidth]{./image/AfterSelected.jpg} \caption{Original (blue) and our applied selection scheme (green) LO results are shown here. The selected planar points are almost half less than the original, but obtain fewer translation errors simultaneously.} \label{figure:AfterSelected} \end{figure*} Sensitivity describes the extent to which a registration residual changes when a standard pose disturbance is applied to the sensor. It is defined as a six-dimensional vector: three for rotation angles and others for translation. In Fig. \ref{figure:Sensitivity}, calculating a LiDAR rotation angle, using high sensitivity points is better, which equals the lever principle. In Fig. \ref{figure:PlaneSensitivity}, every planar point’s sensitivities to yaw angle are drowned in color. Black and red were low, while green and blue were high. The near-ground points were not sensitive to the yaw angle, and the middle-building walls were more sensitive than the left and right walls. Uncertainty describes the reliability of a registration residual term that combines a LiDAR point measurement and its corresponding geometric model credibility. It is defined as a three-dimensional Gaussian distribution, such as a line or a plane pattern. In Fig. \ref{figure:PlaneUncertainty}, high uncertainty planar points in blue are trees, which are unsuitable for pose estimation. The red regions represent smooth walls and near-ground points, which are reliable for pose estimation. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Sensitivity.jpg} \caption{Sensitivity describes how much a registration residual changes. When there exists a small pose error, higher sensitivity points have more distance errors.} \label{figure:Sensitivity} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/PlaneSensitivity.jpg} \caption{Every planar point’s sensitivities to the yaw angle are drowned in color. Black and red are low, and green and blue are high. The near-ground points are not sensitive to the yaw angle, and the middle-building walls are more sensitive than the left and right walls.} \label{figure:PlaneSensitivity} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/PlaneUncertainty.jpg} \caption{High uncertainty planar points in blue are trees. The red regions are smooth walls and near-ground points, which are reliable for pose estimation.} \label{figure:PlaneUncertainty} \end{figure} This research aims to find calculus approaches for LiDAR point residual sensitivity and uncertainty. We comprehensively considered these two properties in a score vector and decouple them into six dimensions. Thereafter, all LiDAR point residuals were sorted to select a subset that included high sensitivity and low uncertainty points. Finally, these residuals were sent for optimization. In code realization, a threshold rule is defined to stop the selection. Theoretically, we demonstrated that sorting residuals using the proposed method achieves a global statistical optimum. This algorithm is independent of the specific LiDAR SLAM algorithms and LiDAR hardware configurations. It is a general module to enhance accuracy and can be added to any existing optimization-based code realizations. Our experiments on LO and LIO indicate that utilizing selected residuals simultaneously enhances optimization accuracy, decreases residual terms, and guarantees real-time performance. The main contributions of this study are as follows: (1) To the best of our knowledge, this is the first study to theoretically prove the global statistical optimal point selection scheme for enhancing pose estimation accuracy in LiDAR odometry and mapping. (2) This paper proposed a sensitivity model for point-to-plane and point-to-line distance, as well as uncertainty model for LiDAR point measurement and its corresponding geometry pattern. Sensitivity and uncertainty decoupling into six-dimensional methods were also proposed. (3) Experiments were conducted using the KITTI benchmark. The ALOAM translation error decreased from $1.7318\%$ to $1.5781\%$ in virtually half of the number of planes and lines used. Different types of LiDAR scan modes were evaluated in indoor and outdoor environments using LO and LIO, increasing the average accuracy by approximately $20\%$. Experiments reveal that the time consumption depends on the residual amount rather than the feature detection and residual selection parts. The proposed selection scheme guarantees real-time performance. \section{Related Work} \label{section:Related Work} Related studies can be classified into three categories: sensitivity, uncertainty, and entropy-based LO methods. \subsection{Sensitivity Model} This report \cite{2003GeometricallySS} provides considerable motivation for employing the sensitivity model. It proposes a technique for determining whether a pair of meshes is unstable in the iterative closest point (ICP) algorithm. It estimates a covariance matrix from the sparse uniform sampling of the input. Subsequently, it develops a strategy that attempts to minimize this instability and draws a new set of sample points primarily from the stable areas of the input meshes. However, this study concentrates on the registration problem; it does not consider measurement uncertainties and analyzes only the mesh plane errors. However, this technique was fundamental to our theory. LO-Degeneracy \cite{2016OdometryDegeneracy} aims to avoid a degenerate environment, which is regarded as a condition in which one-dimensional sensitivity is zero. It determines and separates the degenerate dimensions in the state space and partially solves the problem in well-conditioned directions. It linearizes the cost function and uses the dot product of the coefficient matrix with its transpose. A matrix containing the geometric structures of the problem constraints is formed. The IMLS \cite{2018IMLSSLAM} technique is a complete LO that uses \cite{2003GeometricallySS} method to select points. Therefore, numerous points can alter the constraints to shrink the final pose. However, it does not solve the problem theoretically and only considers a point-to-plane sensitivity model. The LeGOLOAM algorithm \cite{2018LeGOLOAM} uses normal vector clustering to detect true line points and obtain better matching. Optimization was achieved in two stages using the ground vehicle hypothesis. LeGOLOAM is regarded as improving accuracy from the pattern recognition perspective. However, this is strongly limited by the ground-vehicle hypothesis. Two-stage optimization enables all observations to calculate the rotation and translation separately. LION \cite{2021LION} can self-assess its performance using an observability metric that evaluates whether the pose estimation is geometrically ill-constrained. This is similar to LO-Degeneracy \cite{2016OdometryDegeneracy} and is applied to a real tunnel scene. SGLO \cite{2021SGLO} considers the derivative of the residuals; however, it has not been discussed in depth. It does not consider constraint information in every dimension, which is the core content. MULLS \cite{2021MULLS} clarified the residual linearization process. It uses all observations in the estimations with diverse weights, implying that estimations in different directions can be balanced. In \cite{2020SetCardinalityMax}, inline set cardinality maximization was used to select suitable feature for a 3D-2D pose estimation. Bearing vectors play an important role in the selection and avoidance of degeneration. From these studies, the proposed theory theoretically clarifies sensitivity. It is inspired by IMLS and extends to a point-to-line residual type. Compared to the MULLS, the point-to-line catches a Hessian matrix in the MULLS, which cannot be sorted directly. The proposed theory uses the main direction projection to regroup into a linear form, which is convenient for sorting. \subsection{Uncertainty Model} The uncertainty model consisted of two parts. The first part independently models the uncertainty of every laser point measurement in 3D and is referred to as the laser scan beam. The second part models the uncertainty of the geometric pattern in the map. The essential difference between these two models is that the first part describes the uncertainty of the current observations and the second part describes the uncertainty of history-measured information. \subsubsection{Laser Scan Beam} For laser points, \cite{2007LidarError} proposed rigorous first-order error analysis. It measures the horizontal and vertical errors of a laser pulse and determines the nonlinear error growth, as recently reported in \cite{2020LidarComparing}. Comparing various LiDAR sensors available in the market \cite{2020LidarComparing}, measurement errors were found to be relevant to the target range. In \cite{2007AirLaser}, a laser point was modeled as a projected footprint and used to represent an uncertainty matrix. A 3D Gaussian distribution was proposed \cite{2018VLP16Model} to model LiDAR uncertainty points and to clarify their propagation. \subsubsection{Geometry Pattern} For geometry patterns, point cloud data (PCD) are direct and easy to use for localization. Accordingly, this investigation focuses on the map geometry pattern implemented using PCD. The LOAM algorithm \cite{2014LOAM} generates five points to simulate a plane and line by decoupling the eigenvalues. It fundamentally calculates them as a 3D Gaussian distribution but discards irrelevant directions. The Gaussian mixture model \cite{2016GMM} (GMM) is a continuous distribution function method; however, it adopts multiple Gaussians and regroups them with different weights. A multilayer tree structure \cite{2018GMMtree} can fuse flat areas into one Gaussian or decompose a complicated area into several Gaussians. In addition to these explicit function representations, implicit methods are relevant to PCD applications. A moving least square (MLS) surface is defined in \cite{2004MLS}; it is a $C^\infty$ smooth surface generated from a raw PCD. An implicit version was defined in \cite{2005ProvablyMLS}, which represents the distance of a location on a surface composed of neighboring points. Based on the aforementioned studies, real LiDAR emitting and receiving structures were considered to build a laser point uncertainty model. Thereafter, the measured points were added to the map and fused together. Our study aimed to improve the real-time estimation accuracy of mobile robots. Compared with a 3D reconstruction, sacrificing some of the complicated area details and focusing on the main direction constraints are advantageous for SLAM. Because nearby LiDAR points are dense, the remote points are sparse. The leaves, trees, and other irregular objects are not suitable for pose estimation, indicating that their fused uncertainties are higher. Therefore, the Gaussian method is preferred, and the uncertainties of the map points are considered. Consequently, these points are completely used in a plane or line. \subsection{Entropy Based LO Method} Since 2020, some research has applied the entropy concept from information theory \cite{Shannon1948Entropy} to SLAM systems to improve robustness and accuracy. \cite{2020GoodFeatureMatching} proposed sub-matrix selection by choosing a scoring metric for VO. It models estimation as a linear matrix to obtain the best subset that yields the metric Max-$log$Det. With this metric, satisfactory feature selection becomes an NP-hard problem. They designed a lazy greedy algorithm to determine the maximum submatrix. In a continuation of \cite{2020GoodGraphOptimize}, it focused on selecting satisfactory poses for graph optimization. In \cite{2020InformationDrivenDirectRGBD}, the most numerous mutual information points were selected, and the metrics were similar. MLOAM \cite{2021ICRAmloam} imitates and applies entropy to a multi-LiDAR field. The two LiDAR sensors were set at diverse angles to cover a wide area. In addition, a greedy method was designed. The two LiDARs were run in real time with satisfactory accuracy. Compared to the aforementioned studies, the most novel contribution of our proposed theory is that we provide an analytical demonstration of why the selected points obtain higher accuracy. Another advantage is that the proposed theory is endogenously explainable, which is derived from a singular value decomposition (SVD)-based registration problem \cite{1992ICP}. Finally, the sensitivity and uncertainty processes are modeled in a linear form, avoiding the calculation of a sub-matrix metric using a greedy method. \section{Notations and Preliminaries} \label{section:Notations and Preliminaries} Before introducing our theory, the interpretation of the ICP registration problem aids in understanding the theory. The SVD method was used as a standard solution. Zero-mean normalization is applied to decouple it into calculating the rotation (first step) and translation (second step). That is, it solves $\mathbf{R}$ in $\rm{SO}(3)$ space and then returns to $\rm{SE}(3)$ space to calculate $\mathbf{t}$. This is known as the Wahba problem \cite{Wahba1965} since 1965, or rotation search \cite{2004RotationSearch} in the recent robotic community. Assume that a no-disturbance point set (source) is $P=\{\mathbf{p}^*_i\},i=1,\ldots,N$ and its corresponding no-disturbance point set (target) is $Q=\{\mathbf{q}^*_i\},i=1,\ldots,N$. The standard $L_2$ norm point-to-point registration problem is expressed as follows: \begin{equation} \label{equation:ICP} \begin{aligned} \mathbf{R}^* & =\mathop{\arg\min}\limits_{\mathbf{R}^*\in\rm{SO}(3)}\sum_{i=1}^N ||\mathbf{R}^*\mathbf{p}^*_i-\mathbf{q}^*_i||^2 \\ & =\mathop{\arg\max}\limits_{\mathbf{R}^*\in\rm{SO}(3)} tr(\mathbf{R}^*\sum_{i=1}^N \mathbf{p}^*_i {\mathbf{q}^*_i}^T) \end{aligned} \end{equation} \begin{equation} \label{equation:ICPSVD} \mathbf{H}=\sum_{i=1}^N \mathbf{p}^*_i {\mathbf{q}^*_i}^T=\mathbf{U\Sigma V}^T \end{equation} \begin{equation} \label{equation:ICPSVD2} \mathbf{R}^*=\mathbf{VU}^T \end{equation} where $\mathbf{R}$ is a $3\times3$ rotation matrix and the proof of Eq. (\ref{equation:ICP}) is provided in Appendix A. By linearizing the rotation parameters from the Lie group manifold to its corresponding location in the tangent vector space (i.e., $\phi_\mathbf{R}^\wedge\in\mathfrak{so}(3),\phi_\mathbf{R}\in\mathbb R^3$ Lie algebra), the problem becomes a linear least-squares problem. Accordingly, it is solved using the Gauss-Newton\cite{1974GN} or Levenberg-Marquardt\cite{1977LM} techniques. The optimal rotation is found as the singular vectors $\mathbf{V}$ and $\mathbf{U}$ regroups of $\mathbf{H}$. Any two rotation matrices, $\mathbf{L}$ and $\mathbf{K}$, and their corresponding axis angles (rotation vector), $\phi_\mathbf{L}=\theta_\mathbf{L}\omega_\mathbf{L}$ and $\phi_\mathbf{K}=\theta_\mathbf{K}\omega_\mathbf{K}$, as shown in Fig. \ref{figure:AngleAxis}, are connected by the exponential map from the Lie group to the Lie algebra. \begin{equation} \label{equation:Angle Axis} \begin{aligned} \mathbf{L} & =\exp(\phi_\mathbf{L}^\wedge)=\exp(\theta_\mathbf{L}\omega_\mathbf{L}^\wedge) \\ \mathbf{K} & =\exp(\phi_\mathbf{K}^\wedge)=\exp(\theta_\mathbf{K}\omega_\mathbf{K}^\wedge) \end{aligned} \end{equation} $\theta_\mathbf{L}$ and $\theta_\mathbf{K}$ are the angles (scalar), $\omega_\mathbf{L}$ and $\omega_\mathbf{K}$ are axes ($3\times1$ vector), $\phi^\wedge$ denotes the symmetric skew matrix of vector $\phi$. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/AngleAxis.jpg} \caption{Axis angle (rotation vector) representation is $\phi_\mathbf{L}=\theta_\mathbf{L}\omega_\mathbf{L}$ and $\mathbf{L}=\exp(\phi_\mathbf{L}^\wedge)=\exp(\theta_\mathbf{L}\omega_\mathbf{L}^\wedge)$. The black sphere is the $\rm{SO}(3)$ space Lie group, and the blue grid is the $\mathfrak{so}(3)$ space Lie algebra, which is tangent to the expansion location. $\exp$ and $\log$ mappings connect each other. This enable gradient descent-based optimization algorithms to work.} \label{figure:AngleAxis} \end{figure} skew-symmetric matrix and corresponding vector satisfying \begin{equation} \mathbf{a}^\wedge= \begin{bmatrix} a_1\\ a_2\\ a_3 \end{bmatrix}^\wedge= \begin{bmatrix} 0 & -a_3 & a_2 \\ a_3 & 0 & -a_1 \\ -a_2 & a_1 & 0 \end{bmatrix} \end{equation} To measure the difference between the two rotation matrices, $\mathbf{R}^*$ and $\mathbf{R}_i$ in Fig. \ref{figure:RiemannianDistance}, the Riemannian metric distance \cite{2004RotationSearch} under the Frobenius Norm is used. It is defined as \begin{equation} \label{equation:Riemanniandistance} \begin{aligned} Riem(\mathbf{R}^*,\mathbf{R}_i) & =||\log({\mathbf{R}^*}^T \mathbf{R}_i)||^2_F \\ & =||\log(\Delta\mathbf{R})||^2_F \\ & =Riem(\Delta\mathbf{R}) \\ & =||\log(\exp(\phi^\wedge_{\Delta\mathbf{R}}))||^2_F \\ & =tr({\phi^\wedge_{\Delta\mathbf{R}}}^T\phi^\wedge_{\Delta\mathbf{R}}) \end{aligned} \end{equation} that satisfies $\Delta\mathbf{R}={\mathbf{R}^*}^T \mathbf{R}_i$. This distance is the length of the shortest geodesic curve connecting the two rotation matrices. The defined symbols are summarized in TABLE \ref{table:Basic Notations}. \begin{figure}[htbp] \centering \includegraphics[width=0.15\textwidth]{./image/RiemannianDistance.jpg} \caption{When sensors provide redundant observations, there exist many estimated rotation matrices $\mathbf{R}_i$. The method of calculating the smallest fitting error rotation matrix $\mathbf{R}^*$ is a fundamental optimization problem. This phenomenon is common in a LO or LIO, which requires the sum of Riemannian distances to be the smallest. Specifically, if $\mathbf{R}^*$ is the optimal, it must be close to all valid $\mathbf{R}_i$.} \label{figure:RiemannianDistance} \end{figure} \begin{table}[htbp] \begin{center} \caption{Basic notations} \renewcommand\arraystretch{1.4} \resizebox{0.5\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline $\mathbf{R}$,$\mathbf{L}$,$\mathbf{K}$ & rotation matrix & $\phi$ & angle axis (rotation vector) \\ \hline $\theta$ & angle & $\omega$ & axis \\ \hline $\mathbf{p}^*_i$ & source point & $\mathbf{q}^*_i$ & target point \\ \hline \end{tabular} } \label{table:Basic Notations} \end{center} \end{table} \section{Sensitivity and Uncertainty} \label{section:Sensitivity and Uncertainty} This section proves that the proposed sensitivity and uncertainty theory-based selection scheme achieves the global statistical optimal pose estimation accuracy. The optimum is statistical because the analyses are based on probability distributions. In one-shot sampling, a point with a higher uncertainty may be more accurate than other points because the uncertainty is only a probability distribution description. Therefore, multisampling and calculated expectations are superior. For brevity, we simplified the enhancing accuracy issue as a point registration problem in $\rm{SO}(3)$. Assuming the ideal condition, there exists a ground truth rotation $\mathbf{R}^*$ that satisfies the no-disturbance condition for $N\geq 4$ points: \begin{equation} \label{equation:RotationStar} \mathbf{R}^*\mathbf{p}^*_i=\mathbf{q}^*_i, i=1,\cdots,N \end{equation} Consider small disturbances on source points $\mathbf{p}^*_i$ as real LiDAR noise, which may occur during capturing or algorithm drift. On $\rm{SO}(3)$, a dynamic rotation matrix $\mathbf{L}^\prime_i$ describes this error, $\mathbf{p}^\prime_i=\mathbf{L}^\prime_i \mathbf{p}^*_i$, which lies on the 3D manifold surface in Fig. \ref{figure:DemonstrationUncertaintyModel}. The same disturbance $\mathbf{K}^\prime_i$ was added to the target point $\mathbf{q}^*_i$. We defined this simple uncertainty model as the only one for the inference. The uncertainty model details are described in Lemmas \ref{lemma:Uncertainty} and Fig. \ref{figure:DemonstrationUncertaintyModel}, which do not hinder understanding at present. Assuming the selection $M$ point pairs in a certain rule, $M$ depends on the number of points participating in the rotation calculation, that is, at least $4$ points. Therefore, $M$ controls the algorithm to cover all the possible conditions, satisfying $4\leq M\leq N$. The optimal rotation, $\mathbf{R}^\prime$, was calculated using Eq. (\ref{equation:ICP}): \begin{equation} \label{equation:RotationPrime1} \mathbf{R}^\prime=\mathop{\arg\min}\limits_{\mathbf{R}^\prime\in\rm{SO}(3)}\sum_{j=1}^M||\mathbf{R}^\prime\mathbf{p}^\prime_j-\mathbf{q}^\prime_j||^2 \end{equation} If this selection scheme is optimal, the Riemannian distance between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ is very close. Specifically, by exchanging an arbitrary one-point pair inside $M$ with that outside of $N-M$, the optimal rotation is $\mathbf{R}^{\prime\prime}$. \begin{equation} \label{equation:RotationPrime2} \mathbf{R}^{\prime\prime}=\mathop{\arg\min}\limits_{\mathbf{R}^{\prime\prime}\in\rm{SO}(3)}\sum_{j=1}^M||\mathbf{R}^{\prime\prime}\mathbf{p}^{\prime\prime}_j-\mathbf{q}^{\prime\prime}_j||^2 \end{equation} where $\{\mathbf{p}^\prime\}$, $\{\mathbf{q}^\prime\}$ and $\{\mathbf{p}^{\prime\prime}\}$, $\{\mathbf{q}^{\prime\prime}\}$ are at least one point pair that are different. A conjecture must then be established to illustrate why the selection scheme is optimal. \begin{conjecture}[\bf{Closest Riemannian Distance}] \label{conjecture:Closest Riemannian Distance} \begin{equation} \label{equation:DistanceRotationPrime12} Riem(\mathbf{R}^*,\mathbf{R}^\prime)<Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime}) \end{equation} \end{conjecture} The remainder of this section demonstrates Conjecture \ref{conjecture:Closest Riemannian Distance}, and the entire demonstration process is shown in Fig. \ref{figure:Demonstration Pipeline}. The defined symbols are summarized in TABLE \ref{table:Sensitivity Uncertainty Notations} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/DemonstrationPipeline.jpg} \caption{Outline of the demonstration process.} \label{figure:Demonstration Pipeline} \end{figure} \begin{table}[htbp] \begin{center} \caption{Theory notations} \renewcommand\arraystretch{1.8} \resizebox{0.5\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline $\mathbf{R}^*$ & ideal rotation & $\mathbf{R}^\prime$ & optimal rotation \\ \hline $\mathbf{R}^{\prime\prime}$ & \multicolumn{3}{c|}{after point pair exchanged optimal rotation} \\ \hline $\mathbf{p}^*_i$ & ideal source point & $\mathbf{q}^*_i$ & ideal target point \\ \hline $\mathbf{p}^\prime_i$ & source point after disturbance & $\mathbf{q}^\prime_i$ & target point after disturbance \\ \hline $\mathbf{p}^{\prime\prime}_i$ & \multicolumn{3}{c|}{after point pair exchanging source point} \\ \hline $\mathbf{q}^{\prime\prime}_i$ & \multicolumn{3}{c|}{after point pair exchanging target point} \\ \hline $\mathbf{L}^\prime_i$ & rotation disturbance on source point & $\mathbf{K}^\prime_i$ & rotation disturbance on target point \\ \hline $\Phi_{\mathbf{p}^*_i}$ & uncertainty & $\mathbf{J}_{\mathbf{p}^*_i}$ & sensitivity \\ \hline $\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}$ & \multicolumn{3}{c|}{the first, second, third, fourth term of Riemannian distance expansion} \\ \hline \end{tabular} } \label{table:Sensitivity Uncertainty Notations} \end{center} \end{table} Initially, the relationship between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ should be established in Theorem \ref{theorem:Rotation Under Disturbance}, and then their distances are calculated. This is practicable for analyzing the point disturbance influence on the pose estimation result. \begin{theorem}[\bf{Rotation Under Disturbance}] \label{theorem:Rotation Under Disturbance} Assuming the addition of disturbances to the source and target points, we can establish \begin{equation} \label{equation:Rotation Under Disturbance} \mathbf{R}^\prime=\mathbf{K}^\prime \mathbf{R}^* \mathbf{L}^{\prime T} \end{equation} \end{theorem} \begin{proof}[\bf{Rotation Under Disturbance}] By substituting the disturbances into Eq. (\ref{equation:ICPSVD}) and (\ref{equation:ICPSVD2}), respectively, \begin{equation} \begin{aligned} \mathbf{H}^\prime & =\sum_{i=0}^N \mathbf{p}_i^\prime \mathbf{q}_i^{\prime T} \\ & =\sum_{i=0}^N \mathbf{L}^\prime \mathbf{p}^*_i \mathbf{q}_i^{* T} \mathbf{K}^{\prime T} \\ & =\mathbf{L}^\prime \mathbf{H}^* \mathbf{K}^{\prime T} \\ & =(\mathbf{L}^\prime \mathbf{U})\mathbf{\Sigma}(\mathbf{K}^\prime \mathbf{V})^T \end{aligned} \end{equation} Thus, the optimal rotation is \begin{equation} \begin{aligned} \mathbf{R}^\prime=\mathbf{K}^\prime \mathbf{V}(\mathbf{L}^\prime \mathbf{U})^T=\mathbf{K}^\prime \mathbf{VU}^T \mathbf{L}^{\prime T}=\mathbf{K}^\prime \mathbf{R}^* \mathbf{L}^{\prime T} \end{aligned} \end{equation} \begin{center} \bf{Q.E.D. \end{center} \end{proof} Next, the Riemannian distance between $\mathbf{R}^*$ and $\mathbf{R}^\prime$ is expanded. Theorem \ref{theorem:Riemannian Distance} aims to identify the elements that affect the result exactly. Thus, the definition of sensitivity and uncertainty properties is motivated here. \begin{theorem}[\bf{Riemannian Distance}] \label{theorem:Riemannian Distance} \begin{equation} \label{equation:Riemannian Distance} \begin{aligned} Riem(\mathbf{R}^*,\mathbf{R}^\prime) & =||\log({\mathbf{R}^*}^T\mathbf{R}^\prime)||_F^2\\ &=\mathbf{A}+\mathbf{B}+\mathbf{C}+\mathbf{D} \end{aligned} \end{equation} the four terms that satisfy \begin{equation} \label{equation:Riemannian Distance ABCD} \begin{aligned} \mathbf{A} & =2{(\mathbf{R}^*\phi_{\mathbf{K}^\prime})}^T(\mathbf{R}^*\phi_{\mathbf{K}^\prime}) \\ \mathbf{B} & =2{\phi_{\mathbf{L}^\prime}}^T\phi_{\mathbf{L}^\prime} \\ \mathbf{C} & =\frac{1}{2}{[(\mathbf{R}^*\phi_{\mathbf{K}^\prime})^\wedge\phi_{\mathbf{L}^\prime}]}^T (\mathbf{R}^*\phi_{\mathbf{K}^\prime})^\wedge\phi_{\mathbf{L}^\prime} \\ \mathbf{D} & =4{(\mathbf{R}^*\phi_{\mathbf{K}^\prime})}^T\phi_{\mathbf{L}^\prime} \end{aligned} \end{equation} \end{theorem} \begin{proof}[\bf{Riemannian Distance}] The proof of Theorem \ref{theorem:Riemannian Distance} is provided in Appendix B. The core is the utilization of the Baker (Campbell) Hausdorff formula \cite{1974BCH} and exponential mapping expansion. Thereafter, we acquired six terms, and the last two terms are always zero. \end{proof} Note that, in Theorem \ref{theorem:Riemannian Distance}, $\mathbf{A}$ and $\mathbf{B}$ have additional concise representations. Therefore, we have written Remark \ref{remark:Disturbance Terms} to illustrate this for better comprehension. \begin{remark}[\bf{Disturbance Terms}] \label{remark:Disturbance Terms} Based on Theorem \ref{theorem:Riemannian Distance} and the angle-axis representation in Fig. \ref{figure:AngleAxis} \begin{equation} \label{equation:Disturbance Terms A B} \begin{aligned} \frac{\mathbf{A}}{2} & =(\mathbf{R}^* \phi_{\mathbf{K}^\prime})^T(\mathbf{R}^* \phi_{\mathbf{K}^\prime})=\theta_{\mathbf{K}^\prime}^2 \\ \frac{\mathbf{B}}{2} & =\phi_{\mathbf{L}^\prime}^T \phi_{\mathbf{L}^\prime}=\theta_{\mathbf{L}^\prime}^2 \end{aligned} \end{equation} \end{remark} $\mathbf{C}$ and $\mathbf{D}$ are dynamic, depending on the included angle of these two disturbance rotation vectors. Subsequently, the dynamic properties of the last two terms, $\mathbf{C}$ and $\mathbf{D}$ can be clarified from another perspective. In one-shot sampling, a point is captured at a specific position where it must be located. Although it belongs to a specific distribution, the one-shot sampling is random. This phenomenon results in Eq. (\ref{equation:DistanceRotationPrime12}) in Conjecture \ref{conjecture:Closest Riemannian Distance} is impossible. Therefore, we considered comparing the expectations of the Riemannian distance to solve this problem. In the next theorem, after double integration throughout the disturbance space, $\mathbf{C}$ is only related to $\theta_{\mathbf{K}^\prime}\theta_{\mathbf{L}^\prime}$ and $\mathbf{D}$ is zero. Eventually, the comparison continued. \begin{theorem}[\bf{Expectation of Riemannian Distance}] \label{theorem:Expectation of Riemannian Distance} The expectation of the Riemannian distance is \begin{equation} \label{equation:Expectation of Riemannian Distance} E(Riem(\mathbf{R}^*,\mathbf{R}^\prime))=2\theta_{\mathbf{K}^\prime}^2+2\theta_{\mathbf{L}^\prime}^2+\frac{\theta^2_{\mathbf{K}^\prime}\theta^2_{\mathbf{L}^\prime}}{4} \end{equation} \end{theorem} \begin{proof}[\bf{Expectation of Riemannian Distance}] The proof of Theorem \ref{theorem:Expectation of Riemannian Distance} is provided in Appendix C. \end{proof} Sensitivity and uncertainty have been clear perspicuities. They are defined from Theorem \ref{theorem:Expectation of Riemannian Distance} with $\theta_{\mathbf{K}^\prime}$ and $\theta_{\mathbf{L}^\prime}$. We write these two properties in Lemmas \ref{lemma:Sensitivity} and \ref{lemma:Uncertainty}. \begin{lemma}[\bf{Sensitivity}] \label{lemma:Sensitivity} Points that are distant from the center of a LiDAR sensor undergo more changes when the same rotation is applied. Thus, in point-to-point registration, the sensitivity is defined by a point's norm. The point (i.e., $\mathbf{p}^*_i$) sensitivity in Fig. \ref{figure:DemonstrationSensitivityModel} is defined by \begin{equation} \label{equation:Sensitivity} \mathbf{J}_{\mathbf{p}^*_i}=||\mathbf{p}^*_i||^2 \end{equation} \end{lemma} \begin{figure}[htbp] \centering \includegraphics[width=0.25\textwidth]{./image/DemonstrationSensitivityModel.jpg} \caption{Points that are distant from the center of a LiDAR sensor, undergo more changes when the same rotation is applied to them. Thus, in point-to-point registration, sensitivity is defined by a point's norm.} \label{figure:DemonstrationSensitivityModel} \end{figure} \begin{lemma}[\bf{Uncertainty}] \label{lemma:Uncertainty} A small disturbance on $\rm{SO}(3)$ can be described as a small rotation matrix $\mathbf{L}^\prime_i$, which is equal to a circular uniform distribution with radius $h\in(0,\epsilon)$. $h$ is a scalar variable and $\epsilon$ is the distance to the maximal far location. The point (i.e., $\mathbf{p}^*_i$) uncertainty in Fig. \ref{figure:DemonstrationUncertaintyModel} is defined by \begin{equation} \label{equation:Uncertainty} \Phi_{\mathbf{p}^*_i}=\frac{\epsilon}{2} \end{equation} because $h^2$ indicates the disturbance amplitude, and its expectation integration $E$ is \begin{equation} \Phi_{\mathbf{p}^*_i}=E(h^2)=\frac{1}{\epsilon}\int_{0}^{\epsilon}\frac{1}{2\pi h}\int_{0}^{2\pi}h^2 d\alpha dh=\frac{\epsilon}{2} \end{equation} where $\alpha$ denotes the round integration of $\mathbf{p}^\prime$. \end{lemma} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/DemonstrationUncertaintyModel.jpg} \caption {Small disturbance on $\rm{SO}(3)$ can be described as a small rotation matrix $\mathbf{L}^\prime_i$, which equals to a circle uniform distribution whose radius is $h\in(0,\epsilon)$. $h$ is a scalar variable, and $\epsilon$ is a given distance to the maximal far location.} \label{figure:DemonstrationUncertaintyModel} \end{figure} Finally, by combining Lemma \ref{lemma:Sensitivity}, Lemma \ref{lemma:Uncertainty} and Theorem \ref{theorem:Expectation of Riemannian Distance}, Conjecture \ref{conjecture:Closest Riemannian Distance} can be proven. \begin{proof}[\bf{Conjecture \ref{conjecture:Closest Riemannian Distance} Closest Riemannian Distance}] As shown in Fig. \ref{figure:TangentAngleAxis}, for a specific point pair (i.e., index $i$), according to the law of sines, the relationship between sensitivity and uncertainty is established. \begin{figure}[htbp] \centering \includegraphics[width=0.2\textwidth]{./image/TangentAngleAxis.jpg} \caption{According to the law of sines, the relationship between sensitivity and uncertainty is established.} \label{figure:TangentAngleAxis} \end{figure} There exists \begin{equation} \label{equation:Point Contribution Model 5} \begin{aligned} \theta_{\mathbf{L}^\prime_i}&=arcsin(\frac{\epsilon_{\mathbf{p}^\prime_i}}{\sqrt{||\mathbf{p}^\prime_i||^2}})\propto\frac{\Phi_{\mathbf{p}^\prime_i}^2}{\mathbf J_{\mathbf{p}^\prime_i}}\\ \theta_{\mathbf{K}^\prime_i}&=arcsin(\frac{\epsilon_{\mathbf{q}^\prime_i}}{\sqrt{||\mathbf{q}^\prime_i||^2}})\propto\frac{\Phi_{\mathbf{q}^\prime_i}^2}{\mathbf J_{\mathbf{q}^\prime_i}} \end{aligned} \end{equation} When $M$ point pairs have diverse disturbances, $\mathbf{R}^\prime$ and $\mathbf{R}^{\prime\prime}$ are dynamic owing to the specific disturbances. Fortunately, by solving Eq. (\ref{equation:RotationPrime1}) ($\mathbf{R}^\prime$) and (\ref{equation:RotationPrime2}) ($\mathbf{R}^{\prime\prime}$) are based on Lie algebra, a linear space. Similar to the rotation search in Fig. \ref{figure:RiemannianDistance}, this linear property means argument every $M$ point pairs data around their locations satisfying \begin{equation} \label{equation:RotationSearch} \mathbf{R}^\prime=\mathop{\arg\min}\limits_{\mathbf{R}^*\in\rm{SO}(3)}\sum_{i=1}^M Riem(\mathbf{R}^*,\mathbf{R}^\prime_i) \end{equation} where $\mathbf{R}^\prime_i$ is the optimal rotation estimation for every point pair (i.e., $\mathbf{p}^\prime_i$ and $\mathbf{q}^\prime_i$). Although $\mathbf{R}^\prime_i$ cannot be solved using only one point pair, the influence of this point pair on the final result can be quantified using Eq. (\ref{equation:RotationSearch}). Because the same point pair can be aligned, their sensitivities are equal. \begin{equation} \begin{aligned} ||\mathbf J_{\mathbf{p}^\prime_i}|| & =||\mathbf J_{\mathbf{q}^\prime_i}|| \\ ||\mathbf J_{\mathbf{p}^{\prime\prime}_i}|| & =||\mathbf J_{\mathbf{q}^{\prime\prime}_i}|| \end{aligned} \end{equation} Considering the exchange point pairs, $E(Riem(\mathbf{R}^*,\mathbf{R}^\prime))$ and $E(Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime}))$, the different parts are comparable. \begin{equation} \label{equation:observation contribution} \begin{aligned} \sum_{i=1}^M\frac{\Phi_{\mathbf{p}^\prime_i}^2}{\mathbf J_{\mathbf{p}^\prime_i}} & <\sum_{i=1}^M\frac{\Phi_{\mathbf{p}^{\prime\prime}_i}^2}{\mathbf J_{\mathbf{p}^{\prime\prime}_i}} \\ \sum_{i=1}^M\frac{\Phi_{\mathbf{q}^\prime_i}^2}{\mathbf J_{\mathbf{q}^\prime_i}} & <\sum_{i=1}^M\frac{\Phi_{\mathbf{q}^{\prime\prime}_i}^2}{\mathbf J_{\mathbf{q}^{\prime\prime}_i}} \end{aligned} \end{equation} Subsequently, the two equations in Eq. (\ref{equation:observation contribution}) by substituting Eq. (\ref{equation:Sensitivity}) and (\ref{equation:Uncertainty}). Considering Eq. (\ref{equation:Expectation of Riemannian Distance}), $\theta_{\mathbf{L}^\prime}$, $\theta_{\mathbf{K}^\prime}$, $\theta_{\mathbf{L}^{\prime\prime}}$, and $\theta_{\mathbf{K}^{\prime\prime}}$ are the small disturbances. The term $\theta^2_{\mathbf{K}^\prime}\theta^2_{\mathbf{L}^\prime}$ is of fourth order. The main related terms are of second order. \begin{equation} \begin{aligned} \sum_{i=1}^M\frac{\epsilon_{\mathbf{p}^\prime_i}^2+\epsilon_{\mathbf{q}^\prime_i}^2}{||\mathbf{p}^\prime_i||^2} & <\sum_{i=1}^M\frac{\epsilon_{\mathbf{p}^{\prime\prime}_i}^2+\epsilon_{\mathbf{q}^{\prime\prime}_i}^2}{||\mathbf{p}^{\prime\prime}||^2} \\ \Leftrightarrow \sum_{i=1}^M \theta_{\mathbf{L}^\prime}^2+\theta_{\mathbf{K}^\prime}^2 & <\sum_{i=1}^M \theta_{\mathbf{L}^{\prime\prime}}^2+\theta_{\mathbf{K}^{\prime\prime}}^2 \\ \Leftrightarrow E(Riem(\mathbf{R}^*,\mathbf{R}^\prime)) & <E(Riem(\mathbf{R}^*,\mathbf{R}^{\prime\prime})) \end{aligned} \end{equation} \begin{center} \bf{Q.E.D. \end{center} \end{proof} Therefore, the demonstration is terminated at the expectation comparison because the dynamic disturbance parts make direct comparison impossible. Therefore, our selection scheme was statistically optimal. In the next section, we define more complex, close-to-reality sensitivity, and uncertainty models to describe the real LiDAR measurement points. \section{Enhance LiDAR Odometry Accuracy} \label{section:Enhance Lidar Odometry Accuracy} This section describes the practical application of our theory. The complete procedure is shown in Fig. \ref{figure:Pipline Contribution}. An outline details the selection scheme. The inputs included map points, LiDAR measured points, and an initial pose available from a uniform motion model or IMU. Subsequently, we used an octree to find neighbors that established the closest matches. Because the measured points are classified as surf and corner (plane and line), the algorithm computes the sensitivities and uncertainties separately. Finally, we sorted all residual terms by sensitivity and uncertainty scores, stopped at a threshold, and sent them to the nonlinear solver to derive the optimal pose. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Pipeline.jpg} \caption{Outline details the selection scheme. The inputs include map points, LiDAR measured points, and an initial pose available from a uniform motion model or IMU. Subsequently, we employed an octree to find neighbors that establish the closest matches. Because measured points are classified into surf and corner (plane and line), the algorithm computes sensitivities and uncertainties separately. Finally, we sorted all residual terms by sensitivity and uncertainty scores, stopped at a threshold, and sent them into the nonlinear solver to derive the optimal pose.} \label{figure:Pipline Contribution} \end{figure} This section first presents the method for calculating the sensitivity model. It uses a Taylor expansion and eigenvalue projection tool to decouple residuals into six dimensions depending on the type of point-to-plane and point-to-line residuals. The second section presents the calculation of the uncertainty model. The laser scan beam and geometry patterns are analyzed to describe the uncertainties in this process. The third section explains the final selection standard, which comprehensively considers the influences of sensitivity and uncertainty. \subsection{Sensitivity model} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.09\textwidth]{./image/PlaneResidual.jpg} \label{figure:PlaneResidual}} \hspace{0.1\textwidth} \subfigure[]{ \includegraphics[width=0.1\textwidth]{./image/LineResidual.jpg} \label{figure:LineResidual}} \caption{Two types of common residuals used in LO: (a) point-to-plane distance and (b) point-to-line distance.} \end{figure} To satisfy the assumption of an infinitesimal rotation and translation, the linearization error approaches zero. \begin{equation} \mathbf{R}\approx \begin{bmatrix} 1 & -r_z & r_y \\ r_z & 1 & -r_x \\ -r_y & r_x & 1 \end{bmatrix} \approx\rm \mathbf{I}_3 + \begin{bmatrix} r_x \\ r_y \\ r_z \end{bmatrix}^\wedge \end{equation} \subsubsection{Point-to-plane distance} A LiDAR measured point $\mathbf{p}_i$ and the corresponding map point $\mathbf{q}_i$, which is defined as a point on the plane. The normal vector is $\mathbf{n}_i$, as shown in Fig. \ref{figure:PlaneResidual}. The error of the $i$-index residual-term point-to-plane distance is \begin{equation} e^{pl}_i=(\mathbf{Rp}_i+\mathbf{t}-\mathbf{q}_i)^{\rm T}\mathbf{n}_i \end{equation} and $e^{pl}_i$ is scalar. \begin{equation} \begin{aligned} e^{pl}_i & \approx\left[(\mathbf{I}+\mathbf{r}^\wedge)\mathbf{p}_i+\mathbf{t}-\mathbf{q}_i\right]^{\rm T}\mathbf{n}_i \\ & \approx\left[\mathbf{p}_i+\mathbf{r}\times \mathbf{p}_i+\mathbf{t}-\mathbf{q}_i\right]^{\rm T}\mathbf{n}_i \end{aligned} \end{equation} Residual sensitivity describes the $\mathbf{r}$ and $\mathbf{t}$ on $e^{pl}_i$. Thereafter, we used the Jacobian tool and linearized rotation to calculate this property. \begin{equation} \label{equation:sensitivity point to plane} \mathbf{J}_{e^{pl}_i}=\left[\frac{\partial {e^{pl}_i}^{\rm T}}{\partial (\mathbf{r},\mathbf{t})}\right]^{\rm T}= \begin{bmatrix} (\mathbf{p}_i\times \mathbf{n}_i)^{\rm T} & \mathbf{n}_i^{\rm T} \end{bmatrix} \end{equation} \subsubsection{Point-to-line distance} A LiDAR measured point, $\mathbf{p}_i$, and the corresponding map point, $\mathbf{q}_i$, which is defined as a point on the line. Its pointing direction is the unit vector $\mathbf{n}_i$, as shown in Fig. \ref{figure:LineResidual}. Before forming the distance, a new vector $\mathbf{d}_i$ should first be defined. \begin{equation} \mathbf{d}_i=(\mathbf{q}_i-\mathbf{Rp}_i-\mathbf{t})\times(\mathbf{q}_i+\mathbf{n}_i-\mathbf{Rp}_i-\mathbf{t}) \end{equation} where $\mathbf{d}_i$ denotes a $3\times1$ vector. Its norm is the parallelogram area of vectors $\mathbf{p}_i$ to $\mathbf{q}_i$ and $\mathbf{p}_i$ to $\mathbf{q}_i+\mathbf{n}_i$. Its direction was orthogonal to the plane of the two vectors. Because the norm vector $\mathbf{n}_i$ is a unit vector, the number of areas is exactly equal to the distance. The error in the $i$-index residual term point-to-line distance $e^{li}_i$ is defined as \begin{equation} e^{li}_i=\mathbf{d}_i^{\rm T}\mathbf{d}_i \end{equation} This differed from the point-to-plane distance. First, $\mathbf{d}_i$ is derived as \begin{equation} \begin{aligned} \mathbf{d}_i & \approx(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i)\times(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i+\mathbf{n}_i) \\ & \approx(\mathbf{q}_i-\mathbf{p}_i-\mathbf{t}-\mathbf{r}\times \mathbf{p}_i)\times \mathbf{n}_i \end{aligned} \end{equation} The Jacobian of the distance $\mathbf{d}_i$ is \begin{equation} \label{equation:sensitivity point to line} \mathbf{J}_{\mathbf{d}_i}=\left[\frac{\partial \mathbf{d}_i^{\rm T}}{\partial (\mathbf{r},\mathbf{t})}\right]^{\rm T}= \begin{bmatrix} (\mathbf{n}_i^{\rm T}\mathbf{p}_i){\rm \mathbf{I}_3}-\mathbf{p}_i \mathbf{n}_i^{\rm T} & \mathbf{n}^\wedge \end{bmatrix} \end{equation} where $\mathbf{J}_{\mathbf{d}_i}$ is a $3\times6$-matrix. Moreover, \begin{equation} \Delta e^{li}_i=\Delta \begin{bmatrix} \mathbf{r} & \mathbf{t} \end{bmatrix} \mathbf{J}_{\mathbf{d}_i}^{\rm T}\mathbf{J}_{\mathbf{d}_i}\Delta \begin{bmatrix} \mathbf{r} \\ \mathbf{t} \\ \end{bmatrix} \end{equation} Thus, Hessian matrix $\mathbf{H}_{\mathbf{d}_i}=\mathbf{J}_{\mathbf{d}_i}^{\rm T}\mathbf{J}_{\mathbf{d}_i}$ is defined. Therefore, point-to-line $e^{li}_i$ is a quadratic form of the optimization parameters, different from the linear form in the point-to-plane distance. Direct decoupling into six dimensions is impossible because the partial derivatives of the quadratic function approximating $\Delta \mathbf{r}={\bf 0}$ and $\Delta \mathbf{t}={\bf 0}$ are consistently zero. Thus, we have focused on the growing gradient in a small region. The Hessian matrix was projected onto the six axes. Every eigenvalue with vectors was projected onto the $j$-index axis. They were regrouped in linear form. \subsection{Uncertainty model} Before introducing the uncertainty model, the accuracy and variance should be defined. For the standard variable $\theta$, the accuracy is $\Delta\theta$. As shown in Table \ref{table:Distribution Variance}, when the error associated with the variable $\theta$ is defined with distinct distributions, the variance is different. \begin{table}[htbp] \begin{center} \caption{Distribution and variance notations} \renewcommand\arraystretch{1.4} \resizebox{0.45\textwidth}{!} { \begin{tabular}{|c|c|c|c|} \hline variable & accuracy & distribution type & variance \\ \hline \multirow{3}{*}{$\theta$} & \multirow{3}{*}{$\Delta\theta$} & Uniform & $\sigma_\theta=\frac{\Delta\theta}{\sqrt{3}}$ \\ \cline{3-4} & & Gaussian & $\sigma_\theta=\Delta\theta$ \\ \cline{3-4} & & Not measured & $\sigma_\theta=0$ \\ \hline \end{tabular} } \label{table:Distribution Variance} \end{center} \end{table} \subsubsection{Laser scan beam} Based on a multibeam laser scanner system \cite{2007LidarError,2007AirLaser,2018VLP16Model}, the rotation $\mathbf{R}^{sl}$ is from the laser coordinate $l$ to the scanner coordinate $s$. Typically, a mechanical spinning device, which creates a fixed laser to a circular scanner, as shown in Fig. \ref{figure:LidarScanModel4}. \begin{equation} \mathbf{R}^{sl}(\alpha,\omega)= \begin{bmatrix} cos\omega & 0 & sin\omega \\ 0 & 1 & 0 \\ -sin\omega & 0 & cos\omega \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & cos\alpha & -sin\alpha \\ 0 & sin\alpha & cos\alpha \end{bmatrix} \end{equation} where $\alpha$ is the azimuth angle and $\omega$ is the elevation angle of the laser beam channel. \begin{figure}[htbp] \centering \subfigure[coordinates]{ \includegraphics[width=0.25\textwidth ,height=0.15\textwidth]{./image/LidarScanModel4.jpg} \label{figure:LidarScanModel4}} \hspace{0.15\textwidth} \subfigure[diode stack]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel1.jpg} \label{figure:LidarScanModel1}} \subfigure[receiver]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel2.jpg} \label{figure:LidarScanModel2}} \subfigure[laser scan lines]{ \includegraphics[width=0.13\textwidth ,height=0.1\textwidth]{./image/LidarScanModel3.jpg} \label{figure:LidarScanModel3}} \caption{LiDAR laser scan beam model. (a) is the coordinate from laser to scanner. (b) is a laser diode stack emits three light beams. (c) is an infrared observation window. (d) indicates three laser lines and their footprints.} \end{figure} As illustrated in Fig. \ref{figure:LidarScanModel1}, a laser diode stack emits three light beams. They fall on the environment surface and are reflected in the LiDAR observation window, as shown in Fig. \ref{figure:LidarScanModel2}. LiDAR records the emission time and the most intense time to calculate depth. Owing to the observation window, the laser depth can be simulated as a divergent beam. The true location can lie anywhere within the beam footprint. According to the manual, the Velodyne Puck (VLP-16) claims $\Delta z^l=3\ cm$. The horizontal and vertical divergence angles of the rectangular window were $\delta _h=3 \times 10^{-3}\ rad$ and $\delta _v=1.5 \times 10^{-3}\ rad$. Therefore, assuming that point is uniform in this region, \begin{equation} \sigma _{x^l}=\frac{\Delta x^l}{\sqrt{3}}=\frac{z^l tan(\frac{\delta _v}{2})}{\sqrt{3}}, \sigma _{y^l}=\frac{\Delta y^l}{\sqrt{3}}=\frac{z^l tan(\frac{\delta _h}{2})}{\sqrt{3}} \end{equation} Following the self-rotation, a laser scan line was formed, as shown in Fig. \ref{figure:LidarScanModel3}. Every elevation angle $\omega$ was carefully calibrated and rectified; thus, $\sigma _\omega=0$. For the azimuth $\alpha$, the manual states that the rotation angular resolution is $0.01\ \degree$. All studies in \cite{2007LidarError,2020LidarComparing,2007AirLaser,2018VLP16Model} assumed that \begin{equation} 0<\sigma _\alpha<\frac{\pi\Delta\alpha}{180\sqrt{3}} \end{equation} where $\Delta\alpha= 0.005\ \degree$ is the half resolution. The LiDAR parameters and coordinates are shown in Fig. \ref{figure:LidarScanModel4}. Because self-rotation is nonlinear, $\mathbf{R}^{sl}(\alpha,\omega)$ must be linearized, and uncertainty propagation works. Finally, uncertainty is a matrix. In laser coordinate $l$, it is a $5\times 5$ matrix $\Sigma^l$. The scanner coordinate $s$ is a $3\times 3$ matrix $\Sigma^s$. They are connected by uncertainty propagation as follows: \begin{equation} \Sigma^s=\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}^T\Sigma^l\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)} \end{equation} where $\mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}$ denotes a $3\times 5$ matrix. This is derived from the first-order Taylor expansion formula of $\mathbf{R}^{sl}(\alpha,\omega)$. \begin{equation} \mathbf{J}_{\mathbf{R}^{sl}(\alpha,\omega)}={\left[\frac{\partial \mathbf{R}^{sl}(\alpha,\omega)}{\partial (x,y,z,\alpha,\omega)}\right]}^T \end{equation} $\Sigma^l$ is generated as a diagonal matrix from the individual sources: \begin{equation} \Sigma^l=\rm diag \begin{bmatrix} \sigma^2_{x^l} & \sigma^2_{y^l} & \sigma^2_{z^l} & \sigma^2_\alpha & \sigma^2_\omega \end{bmatrix} \end{equation} These variable variances have been discussed previously, and some can be found in the LiDAR sensor manual. \subsubsection{Geometry pattern} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.2\textwidth]{./image/PointPlane.jpg} \label{figure:PointPlane}} \hspace{0.05\textwidth} \subfigure[]{ \includegraphics[width=0.15\textwidth]{./image/PointLine.jpg} \label{figure:PointLine}} \caption{Two error types establish different residual terms. (a) Point-to-plane distance and (b) point-to-line distance. Registration attempts to adjust rotation and translation and then decrease these error distances.} \end{figure} Owing to inhomogeneous noise, sparse density, and missing data in LiDAR sampling \cite{2018SurfaceBasedGICP}, pose estimation typically employs plane and line patterns. Several studies \cite{2014LOAM,2018LeGOLOAM,2019LIOmapping,2020LIOSAM,2021MULLS} have minimized the alignment distance. The LO baseline LOAM \cite{2014LOAM} uses five neighboring points to model the plane or line shown in Fig. \ref{figure:PointPlane} and \ref{figure:PointLine}. Applying PCA technique, eigenvalues $\lambda^0<\lambda^1<\lambda^2$ and eigenvectors $\mathbf{\nu}^0$, $\mathbf{\nu}^1$ and $\mathbf{\nu}^2$ are calculated by applying the PCA technique. These correspond to $x$,$y$, and $z$ dimensions. This process essentially involves modeling the surface as a 3D Gaussian ellipsoid. We should comprehensively consider the influences of both current LiDAR measured information uncertainties (laser scan beam) and history-map model uncertainties (geometry pattern). As shown in Fig. \ref{figure:SmallUncertaintyFusion}, the prior only considers modeling these map points as a plane. After adding the information of every point uncertainty, although the posterior becomes slightly fat, this fusion result indicates that this model is sufficiently good for pose estimation. In Fig. \ref{figure:BigUncertaintyFusion}, considering every point uncertainties, the posterior becomes thick in the main direction, and this fusion result is bad. Because our purpose is to model uncertainties in registration, the main error direction uncertainties are modeled using the sigma-point transform technique \cite{1996SigmaPointTransform}. The points were resampled around the ellipsoid to infer the posterior Gaussian distribution. The distances of these points to the mean are one sigma. \begin{figure}[htbp] \centering \subfigure[low uncertainty fusion result]{ \includegraphics[width=0.15\textwidth]{./image/SmallUncertaintyFusion.jpg} \label{figure:SmallUncertaintyFusion}} \hspace{0.05\textwidth} \subfigure[high uncertainty fusion result]{ \includegraphics[width=0.17\textwidth]{./image/BigUncertaintyFusion.jpg} \label{figure:BigUncertaintyFusion}} \caption{Resampling points to measurement uncertainties. These points' distances to the mean are one sigma; low uncertainty fusion is satisfactory for estimation.} \end{figure} Similar to minimizing the Kullback-Leibler divergence \cite{2007KLDivergenceGMM} between two Gaussians, we provide a simple fusion method in which the eigenvalue along the registration direction is employed to reflect the disparity: \begin{equation} \label{equation:uncertainty} \Phi_{e_i}= \begin{cases} (\lambda_{i_{sou}}^0+\lambda_{i_{tar}}^0)/2 & (plane) \\ (\lambda_{i_{sou}}^0+\lambda_{i_{sou}}^1+\lambda_{i_{tar}}^0+\lambda_{i_{tar}}^1)/4 & (line) \end{cases} \end{equation} where $\Phi_{e_i}$ is a scalar that evaluates uncertainty. $\lambda_{i_{sou}}^0$ is the smallest eigenvector of the source point distribution, and $\lambda_{i_{tar}}^0$ is for the target. \subsection{Sort by score} Motivated by Eq. (\ref{equation:Point Contribution Model 5}), combining the sensitivity and uncertainty models from Lemmas \ref{lemma:Sensitivity} and \ref{lemma:Uncertainty} into a score, and judging the residual influence on the pose estimation accuracy. In practice, using Eqs. (\ref{equation:sensitivity point to plane}), (\ref{equation:sensitivity point to line}), and (\ref{equation:uncertainty}), the score for a residual can be derived as \begin{equation} \Psi_{e_i}=\frac{\mathbf{J}_{e_i}}{\Phi_{e_i}^2} \end{equation} where the score $\Psi_{e_i}$ is a $6\times1$ vector that corresponds to three rotations and three translations. Next, we performed score sorting and selected residuals from the top big score in every six dimensions, in parallel. The repeated terms were recorded only once. Because the dislocation match and geometry assumption (plane line) cause four point pairs to be unstable, we set a threshold parameter to judge the stop rule: (1) the selected residual amount reaches $200$ per dimension and (2) the residual score decreases to $10\%$ of the maximal. \section{Experiments} We used simulation, benchmark, and our captured real data to introduce the experiments, which were segmented into three parts. The first part is a two-frame point cloud registration simulation (Section \ref{subsection:Simulation}), which controls the noise amplitude in the measurements and models. This verifies the validity of the residual selection scheme in a controlled environment. The second part is the KITTI benchmark \cite{2012KITTI} comparison (section \ref{subsection:KITTI Benchmark}), which aims to prove the selection's general effectiveness in decreasing time cost and improving pose accuracy. The third part comprises our captured real indoor and outdoor data (Section \ref{subsection:Online Captured Scenario}). It contains two types of scan-mode LiDAR and inertial measurement unit (IMU) data. This part proves our method's validation in both the LO and LIO algorithms and is also applicable for different LiDARs. Finally, the IMU is used only in LIOmapping \cite{2019LIOmapping} for comparison purposes, which is unnecessary for our proposed algorithm. Therefore, the sensitivity- and uncertainty-theory-based residual term selection scheme achieved significant improvements in accuracy. It exhibits real-time performance with fewer residual terms and lower computational costs in nonlinear optimization. Our codes were implemented in C++. The program was executed on a desktop computer with hardware parameters of a six-core CPU AMD 2600x, 48-GB RAM, and an Nvidia RTX 2070 GPU. \subsection{Simulation} \label{subsection:Simulation} \begin{figure}[htbp] \centering \subfigure[]{ \includegraphics[width=0.23\textwidth]{./image/DisturbanceOnMeasurement.jpg}} \subfigure[]{ \includegraphics[width=0.23\textwidth]{./image/DisturbanceOnModel.jpg}} \caption{LiDAR measurement points are randomly generated. The initial pose is set as an identity matrix, and 100 times experiments calculate mean translation errors for one specific parameter set. Disturbances are separately added. Under both conditions, the random method samples the same point amount as the selection method. When disturbance amplitudes are zero, both methods have no deviations. When amplitudes grow, translation errors of both methods increase; however, the growth of the proposed selection method is slower.} \label{figure:SimulationDisturbance} \end{figure} \begin{algorithm}[htbp] \label{algorithm:Simulation} \caption{Two-frame (source and target) registration simulation} \LinesNumbered \KwIn{input parameters: disturbance amplitude $Da$, residual number $Rn$} \KwOut{output results: translation error in selection $t^{sel}$ and random $t^{ran}$} Source LiDAR points were randomly generated from $1\ m$ to $100\ m$ in 64-circles with different depths. {/*generate points*/}\; The PCD density satisfies the Velodyne HDL64 angle resolution Every point is randomly allocated to a specific geometry pattern model, a plane (three points), or a line (two points). The measured points remain associated with their models, and these matches do not change during optimizations\; \For{$Da=0$;$Da<0.2$;$Da+=0.01${/*disturbances*/}}{ \For{$Rn=120$;$Rn<=240$;$Rn+=60${/*select*/}}{ \For{int $i=0$;$i<100$;$i++${/*multi-samples*/}}{ The ground truth transformation $T_{gt}$ is randomly generated{/*generate a gt pose*/}\; Apply $T_{gt}$ to the source LiDAR points to generate target points{/*apply pose*/}\; Apply disturbance $Da$ to the measurements or models{/*apply disturbances*/}\; The proposed theory-based method selects $Rn$ terms and calculates the transformation result $T^{sel}_i${/*selection method*/}\; The random method selects $Rn$ terms and calculates the transformation result $T^{ran}_i${/*random method*/}\; Calculate the translation errors of the selection $t^{sel}_i=||T_{gt}-T^{sel}_i||$ and random $t^{ran}_i=||T_{gt}-T^{ran}_i||${/*one-test comparison*/}. } Calculate the mean translation errors $t^{sel}$ and $t^{ran}$ $100$ times{/* multi-sample mean*/}\; } } \end{algorithm} To evaluate the proposed theory, in Algorithm \ref{algorithm:Simulation}, a two-frame (source and target) registration simulation is implemented. The ground truth (gt) transformation and LiDAR measured points (source) were randomly generated. Every point was randomly allocated to a specific pattern model, plane (three points), or line (two points). Next, the gt pose was applied to the source points to generate the target points. Subsequently, the disturbances increase. Finally, theory-based and random selection methods were applied to solve the registration. This was repeated 100 times, and then an average translation error was derived. A comparison between the two methods reveals that the proposed method is superior, as shown in Fig. \ref{figure:SimulationDisturbance}. The resulting curves are presented in Fig. \ref{figure:SimulationDisturbance}. The disturbance amplitude increased along the horizontal axis. When the disturbance is zero, the data associations are accurate and do not change during the optimization. The proposed and random methods converge to zero. The error in the proposed method gradually increased as the disturbance amplitude increased. The random method probably selected large-error residual terms. The proposed method sorted all the terms; thus, the selected terms were optimal. This simulation demonstrated the influence of the proposed theory on improving pose estimation accuracy. \subsection{KITTI benchmark} \label{subsection:KITTI Benchmark} The KITTI benchmark is a well-known autonomous driving benchmark \cite{2012KITTI}. It includes a Velodyne LiDAR ($64$ scans), two gray cameras, and two color cameras. The GPS and IMU were used for the gt. It provides $11$ sequences with ground truths in urban, city, natural, and highway environments, and has been widely used for VO and LO evaluation. A few comparison algorithms are introduced in this section. ALOAM is a well-known advanced c++ realization of the LO baseline LOAM \cite{2014LOAM}. LOAM is now a closed source. Several other LO/LIO algorithms have been modified, such as LeGOLOAM \cite{2018LeGOLOAM} and LIO-SAM \cite{2020LIOSAM}. We compared the original ALOAM with ALOAM-select, which was added to our proposed selection scheme in front of the mapping thread optimization. The pose accuracy and time costs are compared in the following sections. MLOAM \cite{2021ICRAmloam} is another relevant work in this field that has a residual selection process. Although it was designed for a multi-LiDAR system, we modified it for one LiDAR. In particular, MLOAM (we modified) and ALOAM-select were only compared in a standard benchmark. \subsubsection{Pose accuracy} The first test directly utilized selection in the ALOAM mapping thread, indicating that our selected residual terms are a subset of the original code used. The results are summarized in TABLE \ref{table:KITTI Subset}. On average, the proposed method employs fewer planes and lines for optimization than the original method. Although the residuals ALOAM-select used were a subset of the original ALOAM, improvements were achieved in seven sequences. For the other four sequences, the proposed method was not superior. Nevertheless, these four sequences fell by approximately $0.05\%$, including $5\ cm$ drift over $100\ m$. We believe that waiting to be selected as a feature set restricts the improvement in accuracy. In particular, the detected feature point set of ALOAM was insufficiently large for our selection. We modify the feature detection parameter of the original ALOAM in the next test to illustrate our hypothesis. \begin{table*}[htbp] \begin{center} \caption{KITTI subset points} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{ALOAM/m} & 0.7556\% & 1.9629\% & 4.5316\% & 0.9507\% & \bf{0.7201}\% & 0.5421\% & 0.6053\% & \bf{0.4203}\% & \bf{1.0482}\% & 0.7235\% & \bf{1.0075}\% & 1.7318\% \\ LineNum & 1051 & 1477 & 1070 & 1230 & 1304 & 1166 & 1414 & 1050 & 1190 & 1214 & 1067 & 1203 \\ PlaneNum & 1707 & 2865 & 1968 & 2885 & 2628 & 2015 & 3521 & 1746 & 2265 & 2298 & 1718 & 2328 \\ \hline \bf{ALOAM-select/m} & \bf{0.7244}\% & \bf{1.9339}\% & \bf{4.4820}\% & \bf{0.8636}\% & 0.7295\% & \bf{0.4828}\% & \bf{0.5798}\% & 0.4493\% & 1.0662\% & \bf{0.6609}\% & 1.0659\% & \bf{1.7041}\% \\ LineNum & \bf{676} & \bf{646} & \bf{662} & \bf{658} & \bf{719} & \bf{688} & \bf{700} & \bf{676} & \bf{674} & \bf{690} & \bf{670} & \bf{678} \\ PlaneNum & \bf{1294} & \bf{1451} & \bf{1325} & \bf{1438} & \bf{1449} & \bf{1352} & \bf{1523} & \bf{1287} & \bf{1341} & \bf{1394} & \bf{1207} & \bf{1369} \\ \hline \end{tabular} } \label{table:KITTI Subset} \end{center} \end{table*} \begin{table*}[htbp] \begin{center} \caption{KITTI twice potential points} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{ALOAM/m} & 0.7556\% & 1.9629\% & 4.5316\% & 0.9507\% & 0.7201\% & 0.5421\% & 0.6053\% & 0.4203\% & 1.0482\% & 0.7235\% & \bf{1.0075}\% & 1.7318\% \\ LineNum & 1051 & 1477 & 1070 & 1230 & 1304 & 1166 & 1414 & 1050 & 1190 & 1214 & 1067 & 1203 \\ PlaneNum & 1707 & 2865 & 1968 & 2885 & 2628 & 2015 & 3521 & 1746 & 2265 & 2298 & 1718 & 2328 \\ \hline \bf{ALOAM-select2/m} & \bf{0.7462}\% & \bf{1.8716}\% & \bf{4.0993}\% & \bf{0.7866}\% & \bf{0.6817}\% & \bf{0.3984}\% & \bf{0.5625}\% & \bf{0.3927}\% & \bf{0.9670}\% & \bf{0.5844}\% & 1.0778\% & \bf{1.5781}\% \\ LineNum & \bf{838} & \bf{777} & \bf{758} & \bf{748} & \bf{833} & \bf{784} & \bf{816} & \bf{761} & \bf{768} & \bf{792} & \bf{755} & \bf{784} \\ PlaneNum & \bf{1674} & \bf{1418} & \bf{1303} & \bf{1414} & \bf{1424} & \bf{1327} & \bf{1509} & \bf{1255} & \bf{1321} & \bf{1370} & \bf{1181} & \bf{1381} \\ \hline \end{tabular} } \label{table:KITTI Twice} \end{center} \end{table*} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Sequence10.jpg} \caption{KITTI sequence 10: LiDAR points restricted to the local region by bushes on both sides. Scores are similar in this environment. Error matches influence the proposed selection; hence, falling behind by $7\ cm$ is possible under this extreme environment.} \label{figure:Sequence10} \end{figure} For the second test, we used twice the number of potential feature points for selection (ALOAM-select2). As summarized in TABLE \ref{table:KITTI Twice}, the accuracy improves by approximately $20\ cm$ per $100\ m$, with advancements in ten sequences. Moreover, only approximately half of the planes and lines were used to obtain this result. These two tests demonstrated the validity of our theory for improving accuracy. To identify shortages, in the second test sequence 10, the checking of the LiDAR frame points is shown in Fig. \ref{figure:Sequence10}. The car in this sequence traverses a wild-field road with bushes on both sides. In this environment, LiDAR observations were restricted to a local region. Our calculations yielded similar results. The proposed algorithm trades off the robustness to achieve accuracy. Error matches have a stronger influence; thus, falling behind $7\ cm$ is possible in this extreme environment. MLOAM \cite{2021ICRAmloam} was designed for multi-LiDAR systems. The results are compared on KITTI, as summarized in TABLE \ref{table:KITTI MLOAM}. Regarding the proposed method, only Sequence 02 falls behind; the other sequences have better results. MLOAM's selection scheme defines manual prior information, solves a metric Max-$log$Det, and then derives residuals that persist. Our proposed theory considers the sensitivity and uncertainty of sensor data, which are closer to the natural process of an LO. This enables more accurate measurements and map models to improve accuracy and avoids the calculation of matrix determinants. For sequence 02, the LiDAR goes through a crossroad with fast turning, and the proposed method drifts significantly from this location. From that point onward, it was considerably misled, resulting in a large error in the total path. MLOAM was originally intended for multi-LiDAR sensors, and we modified its code for one LiDAR running. Considering fairness and limitations on the article length, the next section's comparison focuses on the single LiDAR algorithm. \begin{table*}[htbp] \begin{center} \caption{KITTI MLOAM} \resizebox{\textwidth}{!} { \begin{tabular}{l|ccccccccccc|c} \hline Sequence & 00 & 01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & Average \\ FrameNum & 4541 & 1101 & 4661 & 801 & 271 & 2761 & 1101 & 1101 & 4071 & 1591 & 1201 & - \\ \hline \bf{MLOAM/m} & 1.7015\% & 2.3043\% & \bf{2.3271}\% & 1.0544\% & 1.1347\% & 0.8285\% & 1.4445\% & 1.4053\% & 1.0679\% & 1.5106\% & 1.9189\% & 1.6152\% \\ \hline \bf{ALOAM-select2/m} & \bf{0.7462}\% & \bf{1.8716}\% & 4.0993\% & \bf{0.7866}\% & \bf{0.6817}\% & \bf{0.3984}\% & \bf{0.5625}\% & \bf{0.3927}\% & \bf{0.9670}\% & \bf{0.5844}\% & \bf{1.0778}\% & \bf{1.5781}\% \\ \hline \end{tabular} } \label{table:KITTI MLOAM} \end{center} \end{table*} \subsubsection{Time Cost} \begin{figure*}[htbp] \centering \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost50.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost100.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost200.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost300.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost400.jpg}} \subfigure[]{ \includegraphics[width=0.3\textwidth]{./image/TimeCost500.jpg}} \caption{Black is selection time, which is within almost $15\ ms$. The green is detection time, which is constant in comparisons. The red is optimization time. Provided that increasing of the residual selection amount per dimension, is from $50$ to $500$; more residuals are selected and entered into optimization, which makes it more time-consuming.} \label{figure:TimeCost} \end{figure*} To verify the effect of the selection part on the overall LO time performance, the time costs of the main part are shown in Fig. \ref{figure:TimeCost}. Compared with feature point detection (green) and residual optimization (red), our selection process (black) costs less than $15\ ms$. The optimization part accounts for a large proportion of the time cost. Provided that the selected residual amount per dimension decreases from $500$ to $50$, the optimization becomes faster. Some coding tricks have been introduced here to illustrate why the selection parts require less time. If an LO/LIO algorithm adopts our selection, its accuracy can be improved, and more computation time can be achieved. First, not every residual must participate in the sorting. When calculating the score, the maximal scores in $6$ dimensions were recorded. Residuals scores are higher than the ratio threshold ($60\%$ we adopt) of maximal retention sorting. Second, point-to-plane and point-to-line are both independent in $6$ dimensions; thus, multithread parallel operations accelerate sorting. Therefore, the optimization part requires time, which is related to the residual amount. If we utilize our selected residuals, compared with using all obtainable residuals, the residual term amount decreases significantly, and the selection process is still lightweight. The pose estimation accuracy is simultaneously improved in the next section, and we use residual amounts to illustrate the computation cost. \subsection{Online captured scenario} \label{subsection:Online Captured Scenario} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Scenario.jpg} \caption{Our online captured scenarios are shown in Fig. \ref{figure:Scenario}. The indoor environment is a building with a long corridor. Its length is $74m$, and width is $35m$.The outdoor path is approximately $1.1 km$ long. Both capturing tours start and end at exactly the same location, and execute five times for fairness.} \label{figure:Scenario} \end{figure} We used our sensors to operate in real environments to illustrate the details. The captured online scenarios are shown in Fig. \ref{figure:Scenario}. The indoor environment includes walking inside a building with a long corridor. The outdoor path was approximately $1.1 km$ long. By pasting a landmark on the ground, both tours start and end at exactly the same location. The same path is captured five times to ensure fairness and credibility. Two collection devices were used during capture, as shown in Fig. \ref{figure:VLP16Xsense BS LiDAR}. The first was a Velodyne LiDAR (Puck VLP16) with an IMU (Xsens MTI-100). The second is Robosense LiDAR (Blind Spot 32). As shown in Fig. \ref{figure:VLP16Xsense BS LiDAR Points}, these two LiDARs have completely different scan modes. The horizon of VLP16 was $360 \degree$, and the BS LiDAR was a half-sphere window with 32 scans. \begin{figure}[htbp] \centering \subfigure[Collection device: Velodyne LiDAR (Puck VLP16) and IMU (Xsens MTI-100), Robosense LiDAR (Blind Spot 32)] { \label{figure:VLP16Xsense BS LiDAR} \includegraphics[width=0.45\textwidth]{./image/LiDARIMUBlindSpot.jpg} } \subfigure[These two type of LiDAR sensors have different scan modes.] { \label{figure:VLP16Xsense BS LiDAR Points} \includegraphics[width=0.45\textwidth]{./image/LiDARIMUBlindSpotPoints.jpg} } \caption{Two collection devices and their different scan modes.} \end{figure} We apply our method to ALOAM and LIOmapping as ALOAM-select and LIOmapping-select, respectively. We both set the same strategy and parameters: (1) stop when the residual amount reaches a maximum of 200 per dimension; (2) stop when the residual score decreases to $10\%$ of the maximum. For convenience, we focused on the pose accuracy using the loop-closure error. \subsubsection{VLP16 LO indoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{indoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{ALOAM} & 0.0334 & \bf{0.0163} & 0.1131 & 0.0338 & 6.7570 \\ \hline \bf{ALOAM-select} & \bf{0.0274} & 0.0184 & \bf{0.0654} & \bf{0.0162} & \bf{0.0400} \\ \hline & & & \\ \hline \bf{BALM} & 0.0278 & \bf{0.0091} & 0.0597 & 0.0303 & 0.1471 \\ \hline \bf{BALM-select} & \bf{0.0261} & 0.0146 & \bf{0.0534} & \bf{0.0244} & \bf{0.0846} \\ \hline \end{tabular} } \label{table:VLP16 LO Indoor} \end{center} \end{table} The indoor loop closure errors are summarized in TABLE \ref{table:VLP16 LO Indoor}. Because the LiDAR range was sufficiently long to measure the farthest wall, the drift was within the centimeter level. Compared with ALOAM, ALOAM-select achieved better results in the four sequences. In sequence 01, because ALOAM's translation is virtually $1\ cm$, we believe that the accuracy of the start and end locations of this sequence is insufficient for evaluation. Sequence 04 involved walking in the restroom. More surrounding points are used by ALOAM, but ALOAM-select uses more points outside the door and window, which are more sensitive. The ALOAM drift was distinct, whereas that of the ALOAM-select was low. This result verifies the validity of the electioproposed sn scheme. The paths, maps, and drifts are shown in Figs. \ref{figure:LOsq04}. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/LOsq04A.jpg} \caption{Sequence 04 involves walking into a restroom. More surrounding points are used by ALOAM, but the ALOAM-select uses more points outside the door and window, which are more sensitive.} \label{figure:LOsq04} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/LOsq04BA.jpg} \caption{Drift of BALM is shown in the start and end locations, which should be exactly the same. The drift of BALM-select is smaller, as seen from the building steps.} \label{figure:LOsq04BA} \end{figure} Furthermore, we compared it with the recent famous bundle-adjustment LiDAR mapping algorithm, BALM \cite{2021BALM} in TABLE \ref{table:VLP16 LO Indoor}. The BALM adopts the bundle adjustment concept for visual SLAM. It has a sliding window and adjusts inside frame poses, which aims to make voxels more compact, such as planes flatter and lines more slender. This is also the same idea in eigenfactor \cite{2019EigenFactors}, plane-adjustment \cite{2021PlaneAdjustmentLiDAR}, and $\pi$-LSAM \cite{2021pi-LSAM}. The BALM code was originally designed for the VLP16 LiDAR. We applied our selection scheme in front of the decision regarding, which voxels enter the optimization; thus, we called it BALM-select. Because the inside of the building has many smooth wall constraints, the loop-closure errors are significantly small. Because of the sliding windows in the bundle adjustment, the indoor environment is insufficiently large for LiDAR sensors. Current frame observations may be connected to early information, which strongly constrains the sensor pose. Therefore, after comparing the indoor data, the BALM accuracy disparity was not as obvious as that of ALOAM. \subsubsection{VLP16 LO outdoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{outdoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{ALOAM} & 7.8131 & 10.0851 & 8.0538 & 5.0375 & 6.9043 \\ \hline \bf{ALOAM-select} & \bf{5.0001} & \bf{5.8372} & \bf{4.4030} & \bf{3.3837} & \bf{5.4447} \\ \hline & \\ \hline \bf{BALM} & 6.3223 & 11.7821 & 6.2510 & 4.8214 & 5.9736 \\ \hline \bf{BALM-select} & \bf{4.6401} & \bf{6.3965} & \bf{4.1028} & \bf{2.0205} & \bf{4.2007} \\ \hline \end{tabular} } \label{table:VLP16 LO Outdoor} \end{center} \end{table} The outdoor loop closure errors are summarized in TABLE \ref{table:VLP16 LO Outdoor}. The long outdoor path demonstrates the superiority of the ALOAM-select and BALM-select. This path is approximately $1.1\ km$-long circle in Fig. \ref{figure:LIOLoopClosureError}. The proposed method achieved almost twice the accuracy of all five sequences. These results further support the analysis of the proposed method using the KITTI benchmark dataset. Under large-scale conditions, the proposed method achieves more significant results. The wall mapping quality is illustrated in Fig. \ref{figure:Wall} and \ref{figure:WallScene}. In Fig. \ref{figure:Wall}, points in the blue rectangle represent the ALOAM building wall; points in the green rectangle are generated by ALOAM-select, and points in the orange rectangle are LIOmapping result. Fig. \ref{figure:WallScene} shows the LiDAR's moving path, and the scanned wall. The ALOAM building wall is thick, indicating that the estimated LiDAR poses a drift. The wall generated by ALOAM-select is as thin as that of LIOmapping, indicating higher accuracy; here, only LiDAR is used to reach this LiDAR with an IMU level. \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/LOandLIOWall.jpg} \caption{Building map quality. Points in the blue rectangle represent the ALOAM building wall; points in the green rectangle are generated by ALOAM-select, and points in the orange rectangle are the LIOmapping results. The ALOAM building wall is thick, indicating that the estimated LiDAR poses have drifted. Wall thickness generated by the proposed method is as thin as that of LIOmapping, indicating higher accuracy; only LiDAR is used to reach this LiDAR with the IMU level.} \label{figure:Wall} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/Wall.jpg} \caption{Real wall scene: LiDAR moving path, the scanned wall, far and near the scanning surface.} \label{figure:WallScene} \end{figure} \subsubsection{VLP16 LIO Indoor} \begin{table}[htbp] \begin{center} \caption{VLP16 LIO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{indoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{LIOmapping} & \bf{0.0332} & 0.0399 & 0.0297 & \bf{0.0363} & \bf{0.0163} \\ \hline \bf{LIOmapping-select} & 0.0335 & \bf{0.0158} & \bf{0.0198} & 0.0380 & 0.0359 \\ \hline \end{tabular} } \label{table:VLP16 LIO Indoor} \end{center} \end{table} The loop closure error is small for LIO because the indoor path is less than that of the outdoor path; the results are summarized in TABLE \ref{table:VLP16 LIO Indoor}. The path starts from a hall, and the front side of the corridor can be observed. The LiDAR data are repeated on the surrounding walls. The results of LIOmapping and LIOmapping-select were similar. We presumed that the small region restricted the improvement in accuracy. \subsubsection{VLP16 LIO outdoor} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{./image/LIOLoopClosureError.jpg} \caption{After fusing IMU data, the LIO algorithm's loop closure error is significantly smaller than LO. However, from the start and end location data, before and after adding selection's drifts are still visible.} \label{figure:LIOLoopClosureError} \end{figure} \begin{table}[htbp] \begin{center} \caption{VLP16 LIO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment & \multicolumn{5}{|c}{outdoor (loop closure error/m)} \\ \hline Sequence & 00 & 01 & 02 & 03 & 04 \\ \hline \bf{LIOmapping} & 3.6719 & 4.5632 & 5.0961 & 4.2081 & 3.6909 \\ \hline \bf{LIOmapping-select} & \bf{3.2095} & \bf{3.6629} & \bf{4.2257} & \bf{4.0576} & \bf{3.1955} \\ \hline \end{tabular} } \label{table:VLP16 LIO Outdoor} \end{center} \end{table} The outdoor results are summarized in TABLE \ref{table:VLP16 LIO Outdoor}. The average improvement in accuracy of LIOmapping-select was approximately $0.5\ m$. Therefore, the application of our theory to LIO systems is also valuable. After fusing the IMU data, the loop closure error of the LIO algorithm was significantly smaller than that of the LO. However, from the start and end location data, before and after the addition of drifts in the selection are still visible. Because LIO mapping does not have a loop-closing function, this error cannot be eliminated. After the addition of selection, LIOmapping-select tends to use far-away observations, which strongly constrain the sensor pose. Thus, the estimation accuracy was higher on average. \subsubsection{Blind spot LO indoor} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/BSPoints.jpg} \caption{BS LiDAR point distribution considerably differs from that of Velodyne VLP16. Many points lie in a small region within $10\ m$ in front of LiDAR. However, distant points on the wall are more suitable for pose estimation in the forwarding moving direction.} \label{figure:BS Points Distribution} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{./image/BSLOIndoorPath.jpg} \caption{BS LiDAR indoor built map. Ground floor and ceiling generated by BS-ALOAM are distorted, because poses drifts are at meter level. BS-ALOAM-select maintains with considerably lower drift.} \label{figure:Indoor Blind Spot} \end{figure} Another scan mode, the Robosense blind spot (BS) LiDAR, is shown in Fig. \ref{figure:VLP16Xsense BS LiDAR}. Its view was a half-sphere with 32 laser scans from $0 \degree$ (horizontal) to $89 \degree$ (vertical). Its direction is set toward the ceiling, which is less likely to be scanned by VPL16. To fit the ALOAM code, we modified the point allocation and feature detection functions and renamed them to BS-ALOAM. Upon entering the corridor, the BS LiDAR was placed toward the front to measure more points. In Fig. \ref{figure:BS Points Distribution}, the BS LiDAR point distribution shows extremely different from that of VLP16. Virtually, $92\%$ of the laser points lie in a small region within $10\ m$ of the surroundings. However, points that are distant from the wall are more useful. In BS-ALOAM selection, more suitable points are selected. The results are summarized in TABLE \ref{table:Blind Spot LO Indoor}; the results of the proposed method are distinct. The accuracy of the BS-ALOAM-select improved from the meter to decimeter level. A building map is shown in Fig. \ref{figure:Indoor Blind Spot}. When we return to the hall, the floor and ceiling map of the BS-ALOAM is distorted because the pose drifts are at the meter level. The BS-ALOAM-select maintained a considerably lower drift. \begin{table}[htbp] \begin{center} \caption{BS LO indoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment&\multicolumn{5}{|c}{indoor (loop closure error/m)}\\ \hline Sequence&00&01&02&03&04\\ \hline \bf{BS-ALOAM} & 2.9735 & 3.2668 & 3.2795 & 2.1737 & 5.0697 \\ \hline \bf{BS-ALOAM-select} & \bf{0.1301} & \bf{0.1012} & \bf{0.0886} & \bf{0.7348} & \bf{0.1299} \\ \hline \end{tabular} } \label{table:Blind Spot LO Indoor} \end{center} \end{table} \subsubsection{BlindSpot LO Outdoor} \begin{table}[htbp] \begin{center} \caption{BS LO outdoor} \resizebox{0.5\textwidth}{!} { \begin{tabular}{l|ccccc} \hline Environment&\multicolumn{5}{|c}{outdoor (loop closure error/m)}\\ \hline Sequence&00&01&02&03&04\\ \hline \bf{BS-ALOAM} & 4.4345 & 19.3979 & 17.8245 & 20.5416 & \bf{43.1282} \\ \hline \bf{BS-ALOAM-select} & \bf{3.1535} & \bf{13.5462} & \bf{15.1132} & \bf{12.7554} & 52.5632 \\ \hline \end{tabular} } \label{table:Blind Spot LO Outdoor} \end{center} \end{table} Because of the BS LiDAR scan characteristics, distant points are extremely sparse, and near points are considered dense. According to our theory, the estimation accuracy is significantly lower than that of VLP16. The results summarized in TABLE \ref{table:Blind Spot LO Outdoor} explain this phenomenon. The translation error exceeded that of VLP16. Although certain improvements were achieved, the resulting errors can be ignored. Thus, BS LiDAR is unsuitable for outdoor SLAM applications. SLAM requires a LiDAR sensor capable of capturing distant points, which is more favorable for estimation. \section{Conclusion} \label{section:Conclusion} In this paper, we proposed a theory of LiDAR point sensitivity and uncertainty to enhance LiDAR odometry accuracy. We demonstrated that our selection method is a global statistical optimal. To explain this realization, LiDAR measurement uncertainties and fusing mechanisms were calculated, and residual sensitivities were analyzed. The scores were decoupled into six dimensions. Thereafter, the algorithm sorted and selected the residuals for optimization. The experiment results revealed that superior pose estimation accuracy was achieved. This selection makes it possible to simultaneously achieve high optimization accuracy and guarantee real-time performance. Owing to laser time-of-flight sensing and careful rotary mechanism calibration, the LiDAR uncertainty region does not grow as large as that of the binocular cameras. Therefore, LiDAR had a more distinct effect on our theory. The problem of data association has not yet been addressed. This work adopted traditional data association methods in the LO, relying on a uniform motion model or IMU, which is the neighborhood principle in ICP. Because this study concentrates on improving the pose estimation accuracy, a uniform motion model for walking or low-speed driving is sufficient. The proposed theory attempts to select residual terms with small uncertainties and high sensitivities. This fundamentally decreases the robustness of the pose estimation and simultaneously increases its accuracy; this is the reason for the tradeoff between robustness and accuracy. To improve the accuracy of pose estimation from another perspective, our next objective is to investigate data association.
{'timestamp': '2022-08-17T02:08:20', 'yymm': '2111', 'arxiv_id': '2111.07723', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07723'}
arxiv
\section{Introduction} Deep learning methods have brought revolutionary advances in computer vision, time series prediction and machine learning in recent years. Handcrafted feature selection has been replaced by modern end-to-end systems, allowing efficient and accurate modelling of a variety of data. In particular, convolutional neural networks (CNNs) automatically learn features on gridded data, such as images or geospatial information, which are invariant to spatial translation~\cite{Goodfellow2016}. Recurrent neural networks (RNNs) such as long short-term memory networks (LSTMs) or gated recurrent units (GRUs) are specialised for modelling sequential data, such as time series or sentences (albeit now replaced by transformers)~\cite{Lipton2015}. Recently, modelling dynamical systems from data has gained attention as a novel and challenging task~\cite{Karlbauer2019,Praditia2021,So2021,Li2020a}. These systems describe a variety of physical processes such as weather phenomena~\cite{Rasp2020}, wave propagation~\cite{Karlbauer2019}, chemical reactions~\cite{Rudolph2005}, and computational fluid dynamics~\cite{BelbutePeres2020}. All dynamical systems are governed by either ordinary differential equations (ODEs) involving time derivatives or partial differential equations (PDEs) involving time and spacial derivatives. Due to their chaotic nature, learning such systems from data remains challenging for current models~\cite{Bronstein2017}. In recent years, several approaches to model dynamical data incorporating prior knowledge about the physical system have been proposed~\cite{Raissi2017,Praditia2021,Long2019,Berg2019}. However, most of the models make specific assumptions about the type or structure of the underlying differential equations: they have been designed for specific problem types such as advection-diffusion problems, require prior knowledge about the equation such as the general form or the exact equation, or are limited to linear equations. In current literature only a handful of flexible approaches exist~\cite{Karlbauer2019,Ayed2019,Iakovlev2021}. In this work we propose NeuralPDE, a novel approach for modelling spatio-temporal data. NeuralPDE learns the dynamics of partial differential equations using convolutional neural networks as summarized in~\Cref{fig:neuralPDE_overview}. The derivative of the system is used to solve the underlying equations using the Method of Lines~\cite{Schiesser2012} in combination with differentiable ODE solvers~\cite{Chen2018}. Our approach works on an end-to-end basis, without assuming any prior constraints on the underlying equations, while taking advantage of the dynamical nature of the data by explicitly solving the governing differential equations. The main contributions of our work are\footnote{Our code will be made publicly available upon publication.}: \begin{enumerate} \item We combine NeuralODEs and the Method of Lines through usage of CNNs to account for the spatial component in PDEs. \item We propose using general CNNs that do not require prior knowledge about the underlying equations. \item NeuralPDEs can inherently learn continuous dynamics which can be used with arbitrary time discretizations. \item We demonstrate that our model is applicable to a wide range of dynamical systems, including non-linear and higher-order equations. \ \end{enumerate} \begin{figure*}[t] \centering \includegraphics[width=1\textwidth]{figures/figure1.pdf} \caption{NeuralPDE: combining the Method of Lines and NeuralODE. Our model employs a CNN to parametrize the dynamics of the system $\frac{\partial\mathcal{U}}{\partial t}$. This allows the representation of the PDE by a system of ODEs (Method of Lines) which is solved using any differentiable ODE Solver predicting multiple future states (three in the figure above). The CNN is trained using adjoint backpropagation.} \label{fig:neuralPDE_overview} \end{figure*} \section{Related Work} \label{sec:related_work} NeuralODEs~\cite{Chen2018} introduces continuous depth neural networks for parametrizing an ODE. The networks are combined with a standard ODE solver for solving the ODE. NeuralODE forms the basis for our method in the same way that numerical ODE solvers are the basis for one family of numerical PDE solvers. Many approaches for learning dynamical systems from data operate under strong assumptions about the underlying data: Universal Differential Equations (UDE)~\cite{Rackauckas2020}, Physics Informed Neural Networks (PINN)~\cite{Raissi2017a}, and PDE Net 2.0~\cite{Long2019} require prior knowledge about the generating equations. UDEs use separate neural networks to model each component of a PDE and have to be redesigned manually for every new PDE. PINNs are a machine learning technique for neural networks which design the loss function such, that it satisfies the initial value problem of the PDE. PDE-Net 2.0 assumes a library of available components and learns the parameters of the linear combination of these components using a ResNet-like model. Finite Volume Networks (FINN)~\cite{Praditia2021} integrate the finite volume method with neural networks, but are strictly limited to advection-diffusion type equations. Our results show that none of the restrictions apply to NeuralPDE: we do not need to know the exact PDE that governed the data and make no assumption about the structure of the governing PDE. Flexible approaches include Distana~\cite{Karlbauer2019}, hidden state models~\cite{Ayed2019}, and the approaches proposed by Berg~\cite{Berg2019} and Iakovlev~\cite{Iakovlev2021}. Distana~\cite{Karlbauer2019} describes a neural network architecture that combines two types of LSTM-based kernels: predictive kernels make predictions at given spatial positions, transitional kernels model transitions between adjacent predictive kernels. Distana proved successful in modeling wave equations and is applicable for further problems. Iakovlev et al.~\cite{Iakovlev2021} propose using message passing graph neural networks in conjunction with Neural ODEs for modelling non-equidistant spatial grids and non-constant time intervals and evaluate their method on generated data. In contrast to our approach, they use message passing graph neural networks which are inherently computationally less efficient than our method. We provide a theoretical justification for using convolutional filters and use real-world as well as generated data for our experiments. \iffalse Abgrenzung: \begin{itemize} \item wir haben grid-daten \item wir rechnen mit real-world data \item unser modell ist theoretisch fundiert \item für grid data ist unser modell effizienter \end{itemize} \fi Berg~\cite{Berg2019} introduce a two step procedure: in the first step, the data is approximated by an arbitrary model. In the second step a differentiation operator is approximated by training a neural network on the data approximator and its derivatives up to a given order. Ayed et al.~\cite{Ayed2019} introduce the hidden state method with a learnable projection matrix to transform observed variables into a hidden state. The authors apply their method to training small ResNets as parametrizations of dynamics on toy data as well as real world data sets. Contrary to their method, we do not assume an underlying hidden process and instead directly learn the dynamic. Additionally we do not use residual connections in our parametrization, as our theoretical results show (\Cref{sec:our_method}) that direct convolutions are the best choice. \section{Task} Dynamical systems can be defined as a deterministic rule of evolution of a state in time~\cite{Kuznetsov1995}. At any point in time $t\in T$ the entirety of the system is assumed to be completely described by a set of space variables $x$ from the state space $X$. The evolution of the system is given by the evolution function: \begin{equation} \Phi\colon T\times X \longrightarrow X \end{equation} which describes the how an initial state $x_0\in X$ is transformed into the state $x_1\in X$ after time $t_1\in T$ as $\Phi(t_1, x_0) = x_1$. An important property of dynamical systems is their time homogeneity, meaning the evolution of the state only depends on the current state: \begin{equation} \Phi(t_1, \Phi(t_2, x)) = \Phi(t_1+t_2, x) \end{equation} The main concern of this work is dynamical systems governed by a set of partial differential equations. These are continuous spatio-temporal systems where the state at each point in time is described by a field of $k$ quantities on a given spatial domain $\Omega \subseteq \mathbb{R}^n$. Examples of dynamical systems that can be described by PDE include many physical systems such as weather phenomena~\cite{Rasp2020} or wave propagation~\cite{Karlbauer2019} These systems often exhibit chaotic behaviour which makes them difficult to model with classical machine learning models~\cite{Iooss1983}. We define the task of \textit{modeling dynamical systems from data} as a spatio-temporal time series prediction task, where from one or more states used as input the model should predict the evolution of the state for the next $H$ timesteps. As opposed to physical simulations (usually used to model such systems) where the governing equation is known, in this task the equation is assumed to be unknown. Additionally, retrieving the exact form of the equation is also not part of the task, which is the task of \textit{learning differential operators from data}~\cite{Long2019}. \section{Neural PDE} \label{sec:our_method} In this section we describe our method, which combines NeuralODEs and the Method of Lines through the use of a multi-layer convolutional neural network to model arbitrarily complex PDEs. Our primary focus lies on modelling spatio-temporal data describing a dynamical system and not on recovering the exact parameters of the differential equation(s). \subsection{Method of Lines} The Method of Lines describes a numerical method of solving PDEs, where all of the spatial dimensions are discretized and the PDE is represented as a system of ordinary differential equations of one variable, for which common ODE solvers can be applied~\cite{Schiesser2012}. Given a partial differential equation of the form \begin{equation}\label{eq:pde_system} \frac{\partial u}{\partial t} = f(t, u, \frac{\partial u}{\partial x}, \frac{\partial u}{\partial y}, \ldots) \end{equation} where $u = u(t, x, y), x\in X, y\in Y$ is the unknown function, the spatial domain $X\times Y$ is discretized on a regular grid $X\sim\{x_1, x_2, \ldots, x_N\}$ and $Y\sim\{y_1, y_2, \ldots, y_M\}$. The function $u$ can then be represented as $N\cdot M$ functions of one variable (i. e. time): \begin{equation}\label{eq:pde_discretization} u(t) \simeq \left[ \begin{array}{rrr} u(t, x_1, y_1) & \cdots & u(t, x_N, y_1) \\ \vdots & \ddots & \vdots \\ u(t, x_1, y_M) & \cdots & u(t, x_N, y_M) \\ \end{array}\right] =\colon \mathcal{U} \end{equation} From this representation one can derive the discretization of the spatial derivatives: \begin{equation} \frac{\partial u}{\partial x}(t, x_i, y_i) = \frac{u(t, x_{i+1}, y_i)-u(t, x_{i-1}, y_i)}{x_{i+1}-x_{i-1}} \end{equation} and \begin{equation} \frac{\partial u}{\partial y}(t, x_i, y_i) = \frac{u(t, x_i, y_{i+1})-u(t, x_i, y_{i-1})}{y_{i+1}-y_{i-1}} \end{equation} When a fixed grid size is used for the discretization, the spatial derivatives can thus be represented as a convolutional operation~\cite{Goodfellow2016}: \begin{equation}\label{eq:partial_derivatives} \mathcal{U}_x = conv(\frac{1}{2\Delta x} \left[ \begin{array}{rrr} 0 & 0 & 0 \\ -1 & 0 & 1 \\ 0 & 0 & 0 \\ \end{array}\right], \mathcal{U}) \qquad \mathcal{U}_y = conv(\frac{1}{2\Delta y} \left[ \begin{array}{rrr} 0 & -1 & 0 \\ 0 & 0 & 0 \\ 0 & 1 & 0 \\ \end{array}\right], \mathcal{U}) \end{equation} Where $\Delta x$ and $\Delta y$ are the constant grid sizes for both spatial dimensions: \begin{equation} \begin{aligned} \Delta x &= x_{i+1}-x_{i}, i = 1, \ldots, N \\ \Delta y &= y_{i+1}-y_{i}, i = 1, \ldots, M \end{aligned} \end{equation} Higher-order spatial derivatives can be represented in a similar fashion by a convolutional operation on the lower-order derivatives. This can be easily seen from the representation \begin{equation} \frac{\partial^{p+q} u}{\partial x^p \partial y^q} = \frac{\partial}{\partial x} \frac{\partial^{p+q-1}u}{\partial x^{p-1}\partial y^q} = \frac{\partial}{\partial y} \frac{\partial^{p+q-1}u}{\partial x^{p}\partial y^{q-1}} \end{equation} as higher-order derivatives are defined as derivatives of lower-order derivatives. The original PDE can now be represented as a system of ordinary differential equations, each representing the trajectory of a single point in the spatial domain (thus the name Method of Lines): \begin{equation}\label{eq:ode_system} \frac{d\mathcal{U}}{dt} \simeq f(t, \mathcal{U}, \mathcal{U}_x, \mathcal{U}_y, \ldots)=f^*(t, \mathcal{U}) \end{equation} for which any numerical ODE solver can be used. \subsection{NeuralPDEs} Our method makes the assumption that the spatio-temporal data to be modelled is governed by a partial differential equation of the form \Cref{eq:pde_system}, but by physical constraints of the measuring process, the data has been sampled on a discrete spatial grid as in~\Cref{eq:pde_discretization} and depicted in~ \Cref{fig:neuralPDE_overview} on the bottom left. We also assume that the dynamics of the system only depends on the state of the system itself \begin{equation} f^*(t, \mathcal{U}) = f^*(\mathcal{U}) \end{equation} As can be seen from \Cref{eq:partial_derivatives}, the spatial derivatives of the discretized PDE can be represented by a convolutional filter on the values of $\mathcal{U}$ and thus the whole dynamics of the system (which depends on the spatial derivatives) can be recovered from $\mathcal{U}$. \Cref{fig:neuralPDE_overview} shows an overview of our model. Given the state of the system $\mathcal{U}_0$ at $t=t_0$, our method uses the Method of Lines representation of the underlying PDE (given by \Cref{eq:ode_system}) and employs a multi-layer convolutional network to parametrize the unknown function~$f^*$ describing the dynamics of the system \begin{equation} \frac{d\mathcal{U}}{dt} \simeq f^*(\mathcal{U}) \simeq \textrm{CNN}_\theta(\mathcal{U}) \end{equation} Similar to NeuralODEs~\cite{Chen2018}, the parametrization of the dynamics is used in combination with differentiable ODE solvers. Predictions are made by numerically solving the ODE Initial Value Problem given by \begin{equation} \begin{split} &\frac{d\mathcal{U}}{dt} = \textrm{CNN}_\theta(\mathcal{U}) \\ &\mathcal{U}(t_0) = \mathcal{U}_0 \end{split} \end{equation} for time points $t_1, \ldots ,t_K$. The weights $\theta$ of the parametrization $\textrm{CNN}_\theta$ are updated using adjoint backpropagation as described in~\cite{Chen2018}. For higher-order equations our model is augmented with additional channels corresponding to higher order derivatives. Given the ordinary differential equation system \begin{equation} \frac{d^p \mathcal{U}}{dt^p} = f^*(t, \mathcal{U}) \end{equation} we parametrize the lower-order derivatives as separate variables \begin{equation} \frac{d \mathcal{V}_{1}}{dt} := \frac{d \mathcal{U}}{dt} \qquad \frac{d \mathcal{V}_{2}}{dt} := \frac{d^2 \mathcal{U}}{dt^2} \qquad \cdots \qquad \frac{d \mathcal{V}_{p-1}}{dt} := \frac{d^{p-1} \mathcal{U}}{dt^{p-1}} \end{equation} Using these auxiliary variables $\mathcal{V}_{1}, \ldots \mathcal{V}_{p-1}$, the original equation \Cref{eq:higher_order_ode} can be rewritten as a system of $p$ first-order ODEs: \begin{equation} \label{eq:higher_order_ode} \frac{d \mathcal{U}}{dt} = \mathcal{V}_{1} \qquad \frac{d \mathcal{V}_{1}}{dt} = \mathcal{V}_{2} \qquad \cdots \qquad \frac{d \mathcal{V}_{p-1}}{dt} = f^*(t, \mathcal{U}) \end{equation} We implement this augmentation method within NeuralPDE to represent higher-order dynamics. \section{Data} \label{sec:data} Our aim for NeuralPDE is to be applicable to the largest possible variety of dynamical data. For this, we curated a list of PDEs from related work as toy data, one simulated climate data set (PlaSim), and two reanalysis data sets (Weatherbench and Ocean Wave). \paragraph{Toy Data Sets.} We use several equation systems that are available from other publications as toy data sets: the advection-diffusion equation (AD), Burger's equation (B), the gas dynamics equation (GD), and the wave propagation equation (W). The equation systems and the parameters used for data generation are available from appendix~A. We use 50 simulations for different initial conditions for training, and 10 for validation and testing each. \paragraph{Weatherbench~\cite{Rasp2020}.} Weatherbench is a curated benchmark data set for learning medium-range weather forecasting model from data. The data is derived from ERA5 archives and is accompanied by evaluation metrics, and several baseline models. Instead of the very large raw data set, we use the data set with a spacial resolution of $5.625^{\circ}$ or $32\times 64$. Following the recommendation of Rasp et al.~\cite{Rasp2020}, we use \textit{geopotential at 500 hPa pressure} and \textit{temperature at 850 hPa pressure} as target variables. Data from years 1979 to 2014 is used for training, 2015 and 2016 for validation and 2017 and 2018 for testing. \paragraph{Ocean Wave\protect\footnotemark.} \refstepcounter{footnote} \footnotetext{\url{https://resources.marine.copernicus.eu/product-detail/GLOBAL_MULTIYEAR_WAV_001_032/INFORMATION}} \addtocounter{footnote}{-1} The Ocean Wave data set contains aggregated global data on ocean sea surface waves from 1993 to 2020. The data is on an equirectangular grid with a resolution of $1/5^{\circ}$ or approximately $20\,\mathrm{km}$ and with a temporal resolution of $3\,\mathrm{h}$. We regrid the data to a spatial resolution of $32\times 64$ to match Plasim and Weatherbench. We use \textit{spectral significant wave height (Hm0)}, \textit{mean wave from direction (VDMR)} and \textit{wave principal direction at spectral peak (VPED)} as target variables. Data from years 1993 to 2016 is used for training, 2017 and 2018 for validation and 2019 and 2020 for testing. \paragraph{PlaSim\protect\footnotemark.} \refstepcounter{footnote} \footnotetext{\url{https://www.mi.uni-hamburg.de/en/arbeitsgruppen/theoretische-meteorologie/modelle/plasim.html}} \addtocounter{footnote}{-1} The Planet Simulator (PlaSim) is a climate simulator using a medium complexity general circulation model for education and research into climate modelling and simulation. For simulation, we used the setup \textit{plasimt21} as presented in~\cite{Scher2019}, Sec. 2.1. Our simulation data contains one data point per day for 200 years. We use temperature, geopotential, wind speed in x direction and wind speed in y direction at the lowest level of the simulation as our target variables. Data from the first 180 years of the simulation is used for training, the 10 following years for validation and the years 191 through 200 for testing. \section{Experiments} We train and evaluate NeuralPDE and all selected comparison methods on the seven datasets as described below. \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{figures/architecture.png} \caption{Architecture of our NeuralPDE models. We use four convolutional layers with $k=16$ channels, $3\times 3$ kernels, SeLu activation functions, and $o$ as the number of outputs.} \label{fig:neuralpde_architecture} \end{figure} \subsection{NeuralPDE Architecture} \Cref{fig:neuralpde_architecture} shows the NeuralPDE architecture: a four layer CNN. The first convolutional layer increases the number of channels to $k$, the last convolutional layer reduces the number of channels down to the number of inputs. Then any number of intermediate layers each with $k$ channels can be used to perform the main computations. After some primary experimentation we set the number of intermediate layers to 4 and the number of channels $k$ to 16. The number of outputs $o$ depends on the choice of equation. We train and evaluate two versions of our model using a first-order and second order dynamic as described in~\Cref{eq:higher_order_ode}. We denote these models as \textit{NeuralPDE-1} and \textit{NeuralPDE-2} respectively \subsection{Comparison models} We evaluate our model against several models from related work and simple baselines. We follow \cite{Karlbauer2019} in the selection of our comparison models which we shortly describe in this section. We omit models discussed in~\Cref{sec:related_work} which require prior knowledge about the equations. \paragraph{Baseline.} \textit{Persistence} refers to a model that directly returns it input as output. It always takes the state at $t-1$ as the current prediction. \paragraph{CNN.} Similar to~\cite{Karlbauer2019} we use a CNN~\cite{LeCun1990} consisting of multiple convolutional layers as a comparison model. We use the same architecture as for our NeuralPDE model. \paragraph{ResNet.} Motivated by the recent success of ResNet type architectures for modelling weather data~\cite{Rasp2021}, we include a simple ResNet model using identity mappings as proposed in~\cite{He2016}. He et al.~\cite{He2016} use an residual unit consisting of BatchNorm layer followed by a ReLu activation, linear layer, BatchNorm, ReLu and another linear layer, which is then connected to the input by an additive skip-connection. We stack 4 residual blocks preceded and followed by a linear CNN layer during our experiments. \paragraph{Distana.} \cite{Karlbauer2019} propose the distributed spatio-temporal artificial neural network architecture (DISTANA) to model spatio-temporal data. Their model uses a graph network with learnable prediction kernels (LSTMs) at each node to learn spatio-temporal data. We adopt the implementation of Distana from~\cite{Praditia2021}. \paragraph{ConvLSTM.} The convolutional LSTM as proposed in~\cite{Xingjian2015} replaces the fully connected layers within the standard LSTM model~\cite{Hochreiter1997} with convolutional layers. It is well suited for modelling sequential grid data such as sequences of images~\cite{Wang2018}, or precipitation nowcasting~\cite{Xingjian2015}. We thus reason it might provide a strong comparison for modelling dynamical data. We stack 4 ConvLSTM layers with 16 channels preceded and followed by a linear CNN layer for our experiments. \paragraph{PDE-Net.} PDE-Net 2.0~\cite{Long2019} is a model explicitly designed to extract governing PDEs from data. Contrary to our approach it focuses on retrieving the equation in interpretable, closed form and not on modelling the data accurately. It uses a collection of learnable convolutional filters, connected together within a symbolic polynomial network to parametrize the dynamic. Our implementation is adapted from Long et al.~\cite{Long2019} and we use their parameters for our experiments. \paragraph{Hidden State.} Ayed et al.~\cite{Ayed2019} propose a hidden state model, using a learnable projection to transform the input data into a higher-dimensional hidden state, where similarily to our approach, a differentiable solver is used to predict the next states. The predictions are projected again into the observed space by taking the first $o$ dimensions, where $o$ is the number of observed variables. We adopt the original parameters from~\cite{Ayed2019} to perform our experiments. We project the observed data into a hidden state of 8 channels. \subsection{Training} Each model is trained in a closed-loop setting, where only the state of the system at $t_0$ is used as input for each of the models and the output $\hat{\mathcal{U}}_{t}$ at step $t$ is fed again into the model to make the prediction at step $t+1$. For the higher-order models we initialize the higher-order derivatives as zeroes. We train all our models using a horizon of $4$ time steps with batch size \num{8}, \num{5000} steps per epoch, and \num{5} epochs in total for both our \textit{NeuralPDE} and the \textit{Hidden State} model and \num{20} epochs for all other models. We use the Adam optimizer with the learning rate of \num{0.001}. All experiments are performed on a machine with a Nvidia RTX GPU, 16 CPUs and 32GB RAM. \iffalse \section{Results} All models are evaluated using a prediction horizon of 16 time steps, using a hold-out test set as described in~\Cref{sec:data}. \Cref{tab:results_all} compares the RMSE averaged over 16 prediction steps and all target variables. Bold entries denote the best model for any given dataset. \begin{table*}[t] \centering \caption{Average RMSE 16-step predictions for all models. For our NeuralPDE model we only show the better score between the first and second order model. Bold print denotes the best model for each dataset, underscore denotes the second-best model, $^1$ denotes NeuralPDE-1, $^2$~denotes NeuralPDE-2. \textit{AD - Advection-Diffusion, B - Burgers, GD - Gas Dynamics, OW - Ocean Wave, P - PlaSim, W - Wave Propagation, WB - Weatherbench}. } \label{tab:results_all} \setlength{\tabcolsep}{0.5em} \begin{tabular}{lccccccc} \toprule & AD & B & GD & W & OW & WB & P \\ model & & & & & & \\ \midrule persistence & 0.932 & 0.080 & 0.220 & 1.481 & 0.558 & 0.114 & 0.708 \\ CNN & 0.113 & 0.437 & 0.348 & 1.016 & 0.440 & 0.107 & 0.573 \\ Distana & 0.174 & 0.102 & 0.144 & \underline{0.958} & 0.440 & 0.108 & 0.559 \\ ConvLSTM & 0.497 & 0.079 & 0.167 & 1.102 & 0.463 & 0.107 & \underline{0.546} \\ ResNet & 0.086 & 0.314 & 0.200 & 1.043 & \textbf{0.427} & 0.103 & \textbf{0.537} \\ PDE-Net & \textbf{0.007} & 0.078 & 0.112 & 1.046 & 0.488 & 0.100 & 1.802 \\ Hidden State & 0.639 & \underline{0.066} & \underline{0.097} & 1.115 & 0.482 & \textbf{0.096} & 0.572 \\ NeuralPDE-* (Ours) & \underline{0.057$^1$} & \textbf{0.063}$^1$ & \textbf{0.092}$^1$ & \textbf{0.846}$^2$ & \underline{0.435$^1$} & \underline{0.097$^1$} & 0.563$^1$ \\ \bottomrule \end{tabular} \end{table*} \fi \section{Results} All models are evaluated using a prediction horizon of 16 time steps, using a hold-out test set as described in~\Cref{sec:data}. \Cref{tab:results_all} compares the RMSE averaged over 16 prediction steps and all target variables. Bold entries denote the best model for any given dataset. \begin{table*}[t] \centering \label{tab:results_all} \setlength{\tabcolsep}{0.5em} \begin{tabular}{lccc} \toprule & \rotatebox[origin=c]{-90}{Ocean Wave} & \rotatebox[origin=c]{-90}{Weatherbench} & \rotatebox[origin=c]{-90}{PlaSim} \\ model & & & \\ \midrule persistence & 0.558 & 0.114 & 0.708 \\ CNN & 0.440 & 0.107 & 0.573 \\ Distana & 0.440 & 0.108 & 0.559 \\ ConvLSTM & 0.463 & 0.107 & \underline{0.546} \\ ResNet & \textbf{0.427} & 0.103 & \textbf{0.537} \\ PDE-Net & 0.488 & 0.100 & 1.802 \\ Hidden State & 0.482 & \textbf{0.096} & 0.572 \\ NeuralPDE (Ours) & \underline{0.435} & \underline{0.097} & 0.563 \\ \bottomrule \end{tabular} \end{table*} The first four datasets (AD, B, GD, W) represent generated toy datasets of four different partial differential equations. Our model achieves state-of-the-art performance on all of these datasets except on the advection-diffusion equation, where the PDE-Net 2.0 model~\cite{Long2019} outperforms all other models by a large margin. We hypothesize that the very simple dynamic governing this equation (given by just one linear convolutional filter) makes it very easy for the explicit approach used by the PDE-Net model to learn the dynamic. On the other hand, our approach, which parametrizes the dynamic by a multilayer convolutional network is better at learning more complex systems of equations. On the real-world datasets (OW, WB, P) NeuralPDE-1 closely matches the best state-of-the-art models on the Oceanwave and Weatherbench datasets coming in second best. The Plasim dataset shows to be particularily difficult to learn for methods which directly parametrize the underlying dynamics (Hidden State, PDE-Net 2.0, NeuralPDE). Our results show that the ResNet model achieves best performance on this dataset. We hypothesize that the large time steps of 1 day in the simulated data makes it difficult for a continuous dynamic to be learned by our model. \begin{figure*}[t] \centering \includegraphics[width=1\textwidth]{figures/fig_horizons.png} \caption{Predictions over different horizons. The figure shows the RMSE for four different datasets and target variables for all tested models as a function of the prediction horizon.} \label{fig:predictions_horizon} \end{figure*} \Cref{fig:predictions_horizon} shows the comparison of all tested models over increasing prediction horizons. We only show a selection of different datasets and target variables, the full overview is available from Appendix~B. For all models the prediction accuracy decreases with increasing prediction horizon. \section{Discussion} Our method uses a multi-layer convolutional network as a generalized approach to represent differential equations. Our experiments demonstrate that the same architecture can be applied successfully to learn a wide variety of PDE types, including linear and non-linear equations, equations in one and two dimensions, second-order equations, and coupled PDE systems of up to four equations. In our current setting, NeuralPDE achieves state-of-the-art perfomance on generated data except for very simple equations, where we hypothesize a much simpler and less overparametrized network might perform better. On the real-world datasets models that do not approximate the dynamic directly (ResNet) outperform our model and other models of this type, albeit not by a large margin. One advantage of NeuralPDE over other flexible approaches is its inherent ability to directly capture the continous dynamics of the system. While Distana or ResNet~\cite{Rasp2021} can only make discrete predictions at the next point in time, NeuralPDE can make predictions for any future point in time. This also enables the modelling of data sampled at non-equidistant points in time. In our experiment we used a fixed-step Euler solver, but in principle our method can be applied with any black-box numerical solver, including adaptive solvers like the Dormant-Prince (dopri) family of solvers~\cite{DORMAND198019}. Currently, NeuralPDEs only encompass periodic boundary conditions. We hypothesize that NeuralPDEs can be extended to other boundary conditions by adapting the parameterization of the convolutional layer, e.g. different padding types. Moreover, the boundary conditions need to be specified beforehand and cannot yet be learned directly from data. The Method of Lines comes with its own set of limitations: most prominently, it cannot be used to to solve elliptical second-order PDEs. These limitations apply directly to NeuralPDEs as well. Our model is a black box model that comes with limited interpretability. While we do not directly learn the parametrization of a PDE, we could in theory extract the trained filters from the network for simple linear equations similarily to the PDE-Net~\cite{Long2019}. However, as the system of equations grows more complex, the exact form of the PDE cannot be recovered from the learned weights. If the order of the underlying system of equations is known, the appropriate order of our model can be chosen. This is unfortunately not the case for many real-world applications. However, as our experiments show, the first order model is a good first choice for a wide range of datasets. \section{Conclusion} In this work we proposed a novel approach to modelling dynamical data. It is based on the Method of Lines used as a numerical heuristic for solving Partial Differential Equations, by approximating the spatial derivatives using convolutional filters. In contrast to other methods, NeuralPDE does not make any assumptions about the structure of the underlying equations. Instead they rely on a deep convolutional neural network to parametrize the dynamics of the system. We evaluated our method on a wide selection of dynamical systems, including non-linear and higher-order equations and showed that it is competetive compared to other approaches. In our future work, we will address the remaining limitations: First, we are planning to adapt NeuralPDE to learn boundary conditions from data. Second, we are going to investigate combining other methods to model spatial dynamics with neural networks. This includes other arbitrary mesh discretization methods as well as methods for continuous convolutions which could replace discretization completely. \newpage \bibliographystyle{splncs04} \section{Toy Data Sets} \subsection{Equation Systems} The selected equations are listed in \Cref{tab:selected_equations} for easier overview. The number of equations refers to the number of coupled equations in the PDE system. For Burgers' equation and the gas dynamics equations the number of equations depends on the number of spatial dimensions as the velocity has one component per dimension. \begin{table}[ht] \centering \caption{Summary of the selected equations showcasing their variety, including linear and non-linear equations, first and second-order equations and number of coupled equations.} \label{tab:selected_equations} \begin{tabular}{lcccccc} \toprule Equation & Linear & Order & No. of eqns. \\ \midrule Advection-Diffusion (AD) & Yes & 1 & 1 \\ Wave (W) & Yes & 2 & 1 \\ Burgers' (B) & No & 1 & 2 \\ Gas Dynamics (GD) & No & 1 & 4 \\ \bottomrule \end{tabular} \end{table} \paragraph{Advection-Diffusion Equation.} The advection equation \begin{equation} \frac{\partial u}{\partial t} = - \nabla\cdot (\mathbf{c}u) +D\nabla^2 u \end{equation} describes the transport of a quantity described by a scalar field $u$ in a medium moving with the velocity $\mathbf{c}$ and the diffusion of a quantity from regions of higher concentration to regions of lower concentration driven by the gradient in concentration. $D$ denotes the diffusion coefficient of a medium assumed to be constant in the whole domain. \paragraph{Wave Equation.} The wave equation \begin{equation} \frac{\partial^2 u}{\partial t^2} = \omega^2 \nabla ^2 u \end{equation} describes the propagation of a wave in a given space where $u$ represents the amplitude and $\omega$ represents the speed of propagation. It is a linear, second-order PDE. \paragraph{Burgers' Equation.} Burgers' equation \begin{equation} \frac{\partial \mathbf{u}}{\partial t} = D \nabla ^2 \mathbf{u} - \mathbf{u}\cdot\nabla \mathbf{u} \end{equation} is a non-linear second order PDE that commonly describes phenomena in fluid mechanics. The equation describes the speed $u$ of a fluid in space and time with $D$ representing the fluid's viscosity. \paragraph{Gas Dynamics.} In gas dynamics, the system of coupled non-linear PDEs \begin{equation} \begin{split} &\frac{\partial \rho}{\partial t} = -\mathbf{v}\cdot\nabla\rho - \rho\nabla\cdot\mathbf{v}\\ &\frac{\partial T}{\partial t} = -\mathbf{v}\cdot\nabla T - \gamma T\nabla\cdot\mathbf{v} + \gamma\frac{Mk}{\rho}\nabla^2 T\\ &\frac{\partial \mathbf{v}}{\partial t} = - \mathbf{v}\cdot \nabla\mathbf{v} - \frac{\nabla P}{\rho} + \frac{\mu}{\rho}\nabla(\nabla\mathbf{v})\\ \end{split} \end{equation} describes the evolution of temperature $T$, density $\rho$, pressure $P$ and velocity $\mathbf{v}$ in a gaseous medium. The equations directly correspond to the conservation of mass, the conservation of energy, and Newton's second law~\cite{Anderson1995}. The parameters specify the physical characteristics of the gas, $\gamma$ being the heat capacity ratio, $M$ the mass of a molecule of gas, and $\mu$ the coefficient of viscosity. \paragraph{Parameters.} For each equation we set the parameters to reasonable values as summarized in~\Cref{tab:parameters_equations}. We additionally scale the magnitude of the derivative for each equation by a fixed parameter. \begin{table}[ht] \label{tab:parameters_equations} \centering \caption{Parameters used for data generation} \setlength{\tabcolsep}{0.5em} \begin{tabular}{lll} \toprule Equation & Parameters & Scale \\ \midrule Advection-Diffusion (AD) & $c_x = c_y = 1$, $D=0.001$ & 0.1 \\ Wave (W) & $\omega = 0.1$ & 0.1 \\ Burgers' (B) & $D=0.01$ & 0.01 \\ Gas Dynamics (GD) & $\gamma = 1$, $M = 1$, $\mu = 0.01$, $k = 0.01$ & 0.002 \\ \bottomrule \end{tabular} \end{table} \subsection{Data generation} We generate data by solving each of the selected PDE systems using a high-resolution discretization to obtain highly accurate dynamical data which is then sampled at a low resolution grid. With this, we simulate real world dynamical data (e.g. weather data) being measured at a limited spatial resolution, while the underlying physical process is continuous. Similar to~\cite{Karlbauer2019} the initial condition for each equation at $t=0$ is set as a sum of $N$ Gaussian bell curves \begin{equation} \tag{1D case} u_0(x) = \sum_{i=1}^N a_i\exp(-(x-\mu_i)^2) \end{equation} \begin{equation} \tag{2D case} u_0(x,y) = \sum_{i=1}^N a_i\exp(-(x-\mu_i)^2-(y-\nu_i)^2) \end{equation} where $a_i \sim \mathcal{U}(-1,1)$ and $\mu_1, \nu_i \sim \mathcal{U}(-5,5)$. \begin{figure}[ht] \centering \includegraphics[width=\textwidth]{figures/figure_wave_example.png} \caption{Example of a wave equation in two dimensions. Each picture shows the amplitude over the spatial domain at the given point in time.} \label{fig:wave_example} \end{figure} The spatial domain is set to $\Omega_2 = [0, 1]\times[0, 1]$ with $\Delta x = \Delta y = 0.01$ for the two dimensional case with periodic boundary conditions. We solve the underlying initial value problem using a Method of Lines based PDE solver for $t\in [0, 501]$ with solutions saved at $\Delta t = 0.1$. The ODE solver used for the Method of Lines is \textit{VCABM}, an adaptive order adaptive time Adams Moulton solver using an order adaptivity algorithm derived from Shampine's DDEABM~\cite{Rackauckas2020}. The generated high-resolution solutions are then sampled at a lower resolution of $\Delta x = \Delta y = 0.1$ and $\Delta t = 1$. The training datasets are generated by solving the corresponding PDE system for \num{50} different initial conditions, initialized with $N=5$ independently sampled gaussian curves. Both the validation and test datasets are generated for \num{10} different initial conditions with $N = 5$. \section{Further Plots} \begin{figure*}[ht] \centering \includegraphics[width=0.9\textwidth]{figures/fig_toy.png} \caption{Predictions over different horizons. The figure shows the RMSE for the Burgers, Wave and Advection-Diffusion datasets for all tested models as a function of the prediction horizon.} \label{fig:predictions_horizon} \end{figure*} \begin{figure*}[ht] \centering \includegraphics[width=0.9\textwidth]{figures/fig_gas_dynamics.png} \caption{Predictions over different horizons. The figure shows the RMSE for the Gas Dynamics dataset for all tested models as a function of the prediction horizon.} \label{fig:predictions_horizon} \end{figure*} \begin{figure*}[ht] \centering \includegraphics[width=0.9\textwidth]{figures/fig_oceanwave.png} \caption{Predictions over different horizons. The figure shows the RMSE for the Ocean Wave dataset for all tested models as a function of the prediction horizon.} \label{fig:predictions_horizon} \end{figure*} \begin{figure*}[ht] \centering \includegraphics[width=0.9\textwidth]{figures/fig_plasim.png} \caption{Predictions over different horizons. The figure shows the RMSE for the PlaSim dataset for all tested models as a function of the prediction horizon.} \label{fig:predictions_horizon} \end{figure*} \bibliographystyle{splncs04}
{'timestamp': '2022-10-12T02:10:15', 'yymm': '2111', 'arxiv_id': '2111.07671', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07671'}
arxiv
\section{Introduction} \IEEEPARstart{A}{rtificial} neural networks have shown powerful capability of feature extraction in various fields, e.g., classification \cite{wen2020multilabel}, detection \cite{tao2020detection}. To design high-performance neural networks automatically, Neural Architecture Search (NAS) is proposed. NAS has achieved unprecedented accomplishments for various structures (e.g., convolutional neural network \cite{zoph2017neural}, tensor ring \cite{li2021heuristic}, language model \cite{pham2018efficient}) design. However, it needs enormous computational requirements, e.g., more than 22000 GPU days for vanilla NAS \cite{zoph2017neural}. NASNet \cite{zoph2018learning} proposes cell search space to alleviate the time-consuming issue and delivers a higher efficiency of 1800 GPU days. However, the search cost is unbearable yet. Subsequently, weight-sharing NAS pipeline is proposed to deliver novel efficiency. Reinforcement Learning (RL) based ENAS \cite{pham2018efficient} needs only 0.45 GPU days via parameter sharing. Gradient-based DARTS \cite{liu2018darts} employs a continuous relaxation strategy to transfer the search space from discrete to continuous, and delivers a efficiency of 0.45 GPU days. Furthermore, based on the DARTS framework, PC-DARTS \cite{xu2019pc} delivers a state-of-the-art search efficiency of 0.1 GPU days via partial channel connections. Different from deep search space based approaches, BNAS \cite{ding2021bnas} proposed a broad search space named Broad Convolutional Neural Network (BCNN). Benefiting of BCNN, RL-based BNAS delivers an efficiency of 0.2 GPU days, which is 2.2$\times$ faster than ENAS \citep{pham2018efficient}. However, the training mechanism of BNAS following ENAS leads to terrible unfair training issue \cite{chu2019fairnas}. BNAS-v2 \cite{ding2021bnas-v2} was proposed to solve the above issue by a differentiable broad search space with a efficiency of 0.05 GPU days. Admittedly, BNASs achieve satisfactory performance, especially in terms of efficiency. Nevertheless, BCNN suffers two drawbacks as shown in Fig. \ref{fig::issues}: 1) insufficient representation diversity for feature fusion and enhancement and 2) time-consuming knowledge embedding design. \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth]{./figure/issues.pdf} \captionsetup{font={small}} \caption{Issues of BCNN. 1) Lack of representation diversity for feature fusion and enhancement: only deep and broad feature information is fed into the GAP layer for representation fusion and the first enhancement block for representation enhancement, respectively. 2) It is time-consuming to design knowledge embeddings by experts.} \label{fig::issues} \vspace{-0.5cm} \end{figure} This paper proposes Stacked BNAS whose scalable architecture is named Stacked BCNN, which treats mini BCNN as its basic block. Moreover, each mini BCNN can feed sufficient representations to the GAP layer and enhancement block for feature fusion and enhancement, respectively. As a new paradigm of neural networks, this paper prove also the universal approximation ability of Stacked BCNN. Furthermore, the knowledge embedding design task is transferred from discrete to continuous space, and learn appropriate knowledge embeddings in a differentiable way to solve the second issue. Our contributions can be summarized as follows: \begin{itemize} \item \textbf{Stacked BNAS:} Stacked BNAS is proposed to further improve the performance of NAS via Stacked BCNN. \item \textbf{Stacked BCNN:} This paper does not only propose a new broad search space dubbed Stacked BCNN for NAS, but also mathematically analyze the universal approximation ability of the proposed Stacked BCNN. \item \textbf{Knowledge Embedding Search:} An algorithm is also proposed for knowledge embedding design. \item \textbf{Efficiency:} Contributing to the proposed Stacked BCNN and optimization algorithm, Stacked BNAS delivers a state-of-the-art efficiency of 0.02 days on a single NVIDIA GTX 1080Ti GPU. \end{itemize} \section{Related Work} \label{sec::related_work} \subsection{Neural Architecture Search} \citet{elsken2018neural} claimed that NAS consists of three components: search space, optimization strategy and estimation strategy. The search space referred to not only primitive operators, but also the combination paradigm of those candidate operations \cite{he2021automl}. As described in \cite{zoph2017neural}, there were mainly five types of search spaces: entire-structured, cell-based \cite{zhong2018practical}, hierarchical \cite{liu2019auto}, morphism-based \cite{wei2016network} and broad \cite{ding2021bnas-v2}. These search spaces are briefly introduced as below. \subsubsection{Entire-structured Search Space} In the entire-structured search space, each layer with a specified operation (e.g., various convolutions and average pooling) was stacked one after another \cite{zoph2017neural}. Beyond that, the skip connection was used in the above search space to explore more complex neural architectures. This search space had two disadvantages: computationally expensive and insufficient transferability \cite{he2021automl}. \subsubsection{Cell-based Search Space} To mitigate the above issues of the entire-structured search space, \citeauthor{zoph2018learning} (\citeyear{zoph2018learning}) proposed a cell-based search space where each cell with a list of operations was stacked to construct a deep search space. The cell-based search space consists of normal and reduction cells that have different architectures and strides. Moreover, each cell treats the outputs of two predecessors as its inputs. Due to the effectiveness of cell-based search space in terms of efficiency and transferability, many cell-based NAS approaches were proposed, e.g., weight-sharing ENAS \cite{pham2018efficient}, differentiable DARTS \cite{liu2018darts}. \subsubsection{Hierarchical Search Space} Most cell-based NAS approaches \cite{pham2018efficient,liu2018darts} followed a two-level hierarchy: the inner cell level and the outer network level. On the one hand, the inner level chose operation and connection of each intermediate node in the cell. On the other hand, the outer level controlled the spatial-resolution changes. A general formulation \cite{liu2019auto} was proposed to learn the network-level structure. \citet{liu2018hierarchical} proposed a hierarchical architecture representation to avoid manually predefining the network block number. \subsubsection{Morphism-based Search Space} The morphism-based search space directly modified the existing architecture. Net2Net \cite{chen2015net2net} employed identity morphism (IdMorph) to design architecture based on the existing model. \citet{he2016deep} claimed that there were several issues in IdMorph: 1) limited width and depth changes and 2) identity layer drawback. To solve the above issue, a developed approach named network morphism \cite{wei2016network} was proposed. Network morphism adopted a parameter sharing strategy \cite{pham2018efficient} to inherit the knowledge from the parent network to the child network, which grew into a more robust model. Furthermore, network morphism was improved to deliver better performance in terms of optimization algorithm \cite{jin2019auto} and its level \cite{wei2017modularized}. Furthermore, \citet{chen2020modulenet} used hand-crafted and learned blocks to discover novel architecture via parameter inheriting. \subsubsection{Broad Search Space} \citet{ding2021bnas} proposed a broad search space named BCNN, which employs broad topology to obtain extreme fast search speed and satisfactory performance. BCNN belongs to the cell-based network-level search space. There are three broad search spaces: BCNN (see Fig. \ref{fig::bcnns} (a)), BCNN-CCLE (see Fig. \ref{fig::bcnns} (b)) and BCNN-CCE (see Fig. \ref{fig::issues}). BCNNs consist of convolution and enhancement blocks which densely connect with the GAP layer for multi-scale feature fusion. The main difference among BCNNs is the connection between convolution and enhancement blocks. Similarly, \citeauthor{fang2020densely} (\citeyear{fang2020densely}) proposed a network-level deep search space named dense search space where the MBConv \cite{sandler2018mobilenetv2} is treated as its basic block rather than cell. In contrast, each block of dense search space connects to several subsequent blocks. Based on the broad search space, the efficiency of BNAS \cite{ding2021bnas} was 0.2 GPU days via RL. However, BNAS suffers from unfair training issue, so its optimization mechanism does not take full advantage of the BCNN, i.e., the efficiency improvement is limited. Furthermore, a differentiable over-parameterized broad search space was proposed to solve the unfair training issue in BNAS-v2 \cite{ding2021bnas-v2}. Experimental results show that BNAS-v2 can deliver 2$\times$ faster search efficiency than BNAS when BCNN's all advantages works. \begin{figure}[!h] \centering \subfloat[The structure of BCNN]{\includegraphics[width=0.46\textwidth]{./figure/BCNN.pdf}} \\ \subfloat[The structure of BCNN-CCLE]{\includegraphics[width=0.46\textwidth]{./figure/BCNN-CCLE.pdf}} \\ \captionsetup{font={small}} \caption{Broad search space \cite{ding2021bnas}.} \label{fig::bcnns} \vspace{-0.5cm} \end{figure} \subsection{Broad Learning System (BLS)} Inspired by Random Vector Functional Link Neural Network (RVFLNN) \citep{pao1992functional} and incremental learning strategy \citep{chen1999rapid}, \citet{chen2017broad} proposed BLS and several variants \citep{chen2018universal}. Subsequently, BLSs were widely used in many fields, e.g., image classification \citep{ zhao2020semi}, industrial control \citep{chu2019weighted}. To combine the superiority of deep model and BLS, \citet{liu2020stacked} proposed Stacked BLS, whose structure is shown in Fig. \ref{fig::stacked_bls}. BLS was the basic block of Stacked BLS whose output was the combination of all BLSs' outputs. \citet{liu2020stacked} claimed that Stacked BLS only efficiently optimized trainable weights via an incremental learning algorithm, but also extracted deep representation using multiple BLSs. \begin{figure}[h] \centering \includegraphics[width=0.43\textwidth]{./figure/Stacked_BLS.pdf} \captionsetup{font={small}} \caption{The structure of Stacked BLS \citep{liu2020stacked} with $i$ BLSs.} \label{fig::stacked_bls} \vspace{-0.5cm} \end{figure} \section{Stacked Broad Neural Architecture Search} \label{sec::methodology} In this section, a developed broad search space named Stacked BCNN is first proposed to solve the first issue of vanilla BCNN, i.e., insufficient presentation diversity for feature fusion and enhancement. Then, Knowledge Embedding Search (KES) algorithm is proposed to solve the second issue of vanilla BCNN, i.e the time consumption of knowledge embedding design by human experts. Finally, the optimization algorithm of Stacked BNAS is given. \subsection{Search Space: Stacked BCNN} \label{sec::ss} To improve the feature diversity, mini BCNN based Stacked BCNN is proposed. The structures of Stacked BCNN and mini BCNN are shown in Fig. \ref{fig::Stacked_BCNN}. \subsubsection{Stacked BCNN} As shown in Fig. \ref{fig::Stacked_BCNN} (a), the proposed Stacked BCNN consists of $u$ mini BCNNs, where $u$ is determined by the input size of the first mini BCNN (mini BCNN$_1$). To preserve the multi-scale feature fusion ability of the vanilla BCNN, the Stacked BCNN feed the output of each mini BCNN into GAP layer. \begin{figure}[t] \centering \captionsetup{font={small}} \subfloat[Stacked BCNN]{\includegraphics[width=0.41\textwidth]{./figure/Stacked_BCNN.pdf}} \\ \subfloat[Mini BCNN]{\includegraphics[width=0.49\textwidth]{./figure/mini_BCNN.pdf}} \\ \caption{Search space of Stacked BNAS. The output of $(i-1)$-th mini BCNN $C_{i-1}$ whose channels are set to $c$, is treated as the inputs for $i$-th mini BCNN. The output channels of each deep, broad and enhancement cells are $4c$, $8c$ and $8c$, respectively. Subsequently, they are fed into the knowledge embeddings whose output channels are $c$, $2c$ and $8c$ for the outputs of deep, broad and enhancement cells, respectively. For the GAP layer and $(i+1)$-th mini BCNN, the output channels of $i$-th mini BCNN are $2c$ except the last one which feeds its all channels to the GAP layer.} \label{fig::Stacked_BCNN} \vspace{-0.5cm} \end{figure} \subsubsection{Mini BCNN} Fig. \ref{fig::Stacked_BCNN} (b) shows the structure of mini BCNN. Mini BCNN consists of $k+1$ convolution cells ($k$ 1-stride deep cells, single 2-stride broad cell) and 1 enhancement cell with stride 1. Deep and broad cells are used for deep and broad feature extraction, respectively. The enhancement cell treats both the outputs of deep and broad cells as inputs to obtain a comprehensive enhancement representation. Furthermore, a family of $1\times 1$ convolutions is inserted into fixed locations as the knowledge embeddings. There are two main differences between BCNN and Stacked BCNN: 1) the output of each mini BCNN is the combination of all outputs of three cells rather than the outputs of deep and enhancement cells, and 2) the enhancement cell treats the outputs of convolution cells as inputs. The above two differences provide sufficient feature diversity to the GAP layer and enhancement block for representation fusion and enhancement so that better performance can be obtained. \subsubsection{Mathematical Information Flow} The Stacked BCNN employs a $3\times3$ convolution as the stem layer, and its output is treated as the two inputs of the first deep cell of mini BCNN$_1$, denoted as $y^{(1)}_{-1}$ and $y^{(1)}_{0}$. Similarly, we treat the output of mini BCNN$_i$ as the two inputs of mini BCNN$_{i+1}$. For mini BCNN$_i (i=1,2,\dots,u)$, its output $y^{(i)}$ can be obtained by the outputs of three cells: \begin{align} y^{(i)}=\phi(\delta_{do}^{(i)}(y^{(i)}_{k}), \delta_{bo}^{(i)}(y^{(i)}_{k+1}), \delta_{eo}^{(i)}(y^{(i)}_{k+2})), \label{eq::mini_bcnn} \end{align} where, $\phi$ and $\delta_{*o}^{(i)}$ are concatenation of the channel dimension and knowledge embeddings with respect to mini BCNN$_i$'s output, respectively. Moreover, $y^{(i)}_{k}$ is the output of the last deep cell with a list of operations $\varphi_d$ and can be computed by \begin{align} y^{(i)}_{k}=\varphi_{d}(y^{(i)}_{k-2}, y^{(i)}_{k-1}; {\pmb{W}^{(i)}_d, \pmb{\theta}^{(i)}_d)}, \label{deep} \end{align} $y^{(i)}_{k+1}$ is the output of a broad cell with a list of operations $\varphi_b$ that can be obtained by \begin{align} y^{(i)}_{k+1}=\varphi_{b}(y^{(i)}_{k-1}, y^{(i)}_{k}; {\pmb{W}^{(i)}_b, \pmb{\theta}^{(i)}_b)}, \label{broad} \end{align} and $y^{(i)}_{k+2}$ is the output of the enhancement cell with a list of operations $\varphi_e$ that can be calculated by \begin{align} y^{(i)}_{k+2}=\varphi_{e}(\delta_{de}^{(i)}(y^{(i)}_{k}), \delta_{be}^{(i)}(y^{(i)}_{k+1}); {\pmb{W}^{(i)}_e, \pmb{\theta}^{(i)}_e)}, \label{en} \end{align} where, $\delta_{*e}^{(i)}$ represents knowledge embeddings with respect to the enhancement cell of mini BCNN$_i$ and $\pmb{W}^{(i)}_{*}$ and $\pmb{\theta}^{(i)}_{*}$ are the weight and bias matrices of corresponding cells in mini BCNN$_i$, respectively. The output of Stacked BCNN can be computed by \begin{align} \pmb{y}=\phi(y^{(1)}, y^{(2)}, \dots, y^{(u)}). \label{eq::output} \end{align} \subsubsection{Channel Flow Graph} As shown in Fig. \ref{fig::Stacked_BCNN} (a), for mini BCNN$_i$, the channel number of the deep cell's output $c_{deep}^{(i)}$ can be obtained by \begin{align} c_{deep}^{(i)}=N_{in} \times 2^{i-1} \times c, \quad i=1,2,\dots,u \end{align} where $N_{in}$ represents the pre-defined intermediate node number of the cell, and $c$ is the input channel number of mini BCNN$_1$. The channel numbers of broad and enhancement cells' outputs in mini BCNN$_i$ are both $2 \times c_{deep}^{(i)}$. For those direct-connected cells and output nodes, corresponding knowledge embedding does not reduce the feature significance. In contrast, the significance of the indirect-connected features is reduced by a factor of a quarter, as shown in Fig. \ref{fig::embedding_search} (a). \subsection{Knowledge Embedding Search} \label{sec::embedding} Different from vanilla BNAS, Knowledge Embedding Search (KES) algorithm which treats an over-parameterized knowledge embedding module as a basic unit, is proposed to learn appropriate knowledge embedding in a differentiable way rather than designing by human. \subsubsection{Over-parameterized Knowledge Embedding Module} For each knowledge embedding on an indirect edge, an over-parameterized knowledge embedding module, as shown in Fig. \ref{fig::embedding_search} (b), is constructed to discover appropriate knowledge embeddings. Moreover, for the case of $2^n$==$c_e$, we employ two $1\times1$ convolutions with $c_e$ output channels. \begin{figure}[h] \centering \includegraphics[width=0.45\textwidth]{./figure/embedding_search.pdf} \captionsetup{font={small}} \caption{Embedding between indirectly connected cells and the output node. (a) Hand-crafted knowledge embedding and (b) over-parameterized knowledge embedding module.} \label{fig::embedding_search} \vspace{-0.5cm} \end{figure} There is an assumption that $c_e$ channels are fed into the indirect-connected knowledge embedding. The over-parameterized knowledge embedding consists of $n$ learnable knowledge embeddings with $2^i (i=1,2,\dots,n)$ output channels and a single learnable knowledge embedding with $c_{e}$ output channels, where $n$ is the largest power of 2 less than $c_{e}$ determined by \begin{align} \mathop{{\rm argmax}}\limits_{n} \; 2^n \quad {\rm s.t.} \; 2^n<c_{e}. \label{eq::embedding} \end{align} Subsequently, the output of the over-parameterized knowledge embedding module $y_{e}$ is obtained by the channel-dimension concatenation of weighted $n+1$ learnable knowledge embedding outputs as \begin{align} y_{e} = \phi(\gamma_{1}y^{(1)}_e, \gamma_{2}y^{(2)}_e, \dots, \gamma_{n+1}y^{(n+1)}_e), \label{eq::embedding_concat} \end{align} where, $y^{(l)}_e$ and $\gamma_l$ $(l=1,2,\dots,n+1)$ represent the weighted output and weight of $l$-th learnable knowledge embedding, respectively. \subsubsection{Learning Strategy} After over-parameterized knowledge embedding module construction, Stacked BNAS aims to jointly optimize the knowledge embedding weights $\gamma$ and network weights $w$. The goal of KES is to discover $\gamma^*$ that minimizes the validation loss $\mathcal{L}_{val}(w^*,\gamma^*)$, where $w^*$ is obtained by minimizing the training loss $\mathcal{L}_{train}(w, \gamma^*)$. The bilevel optimization problem with lower-level variable $w$ and upper-level variable $\gamma$ can be represented as \begin{align} \begin{aligned} \mathop{\rm{min}}\limits_{\gamma}\quad & \mathcal{L}_{val}(w^*(\gamma), \gamma), \\ \rm{s.t.}\quad & w^*(\gamma) = \mathop{\rm{argmin}}\limits_w \ \mathcal{L}_{train}(w, \gamma). \end{aligned} \label{eq::embedding_search} \end{align} \begin{algorithm}[!t] \caption{Stacked BNAS} \small \label{algorithm} Define $p$ as the early stopping epoch number, $q$ as the stable epoch number with zero initialization, $kes$ as the flags represented using KES or not, $arch_{prev}$ as previous architecture with None initialization\; For each edge $(i,j)$, use \eqref{eq::pc} and \eqref{xpc} for continuous relaxation as $f^{PC}_{(i,j)}(x_{(j)}^{PC}; M_{(i,j)})$ parameterized by $\alpha_{(i,j)}$ and $\beta_{(i,j)}$\; Define architecture weight set $\Theta = [\alpha, \beta]$\; \If {$kes$}{ Use \eqref{eq::embedding} and \eqref{eq::embedding_concat} to construct over-parameterized knowledge embedding module parameterized by $\gamma$\; $\Theta = [\alpha, \beta, \gamma]$\;} \While{not converged} {Optimize $w$ by descending $\nabla_{w}\mathcal{L}_{train}(w,\Theta)$\; Optimize $\Theta$ by descending $\nabla_{\Theta}\mathcal{L}_{val}(w-\xi\nabla_{w}\mathcal{L}_{train}(w,\Theta),\Theta)$\; Determine current architecture $arch_{curr}$ by taking {\rm argmax}\; $arch_{prev}=arch_{curr}$\; \eIf{$arch_{curr} == arch_{prev}$} {$q = q+1$\; \If {$q \geq p$}{break}} {$q = 1$\;}} Output $arch_{curr}$ as the best architecture. \end{algorithm} The optimization of \eqref{eq::embedding_search} exactly is prohibitive because $w^*(\gamma)$ needs to be recomputed by the second term of \eqref{eq::embedding_search} whenever $\gamma$ takes place any change \cite{liu2018darts}. Therefore, an approximate iterative optimization process is proposed as follows. For each gradient descent step, network weights $w$ and knowledge embedding weights $\gamma$ are optimized by alternating in the network and knowledge embedding spaces, respectively. At step $t$, given the current knowledge embedding $\gamma_{t-1}$, $w_t$ is optimized by descending the training loss $\mathcal{L}_{train}(w_{t-1}, \gamma_{t-1})$. Subsequently, $w_t$ is kept fixing and the over-parameterized knowledge embedding module is optimized with learning rate $\xi$ by descending \begin{align} \nabla_{\gamma}\mathcal{L}_{val}(w_t-\xi\nabla_{w}\mathcal{L}_{train}(w_t,\gamma_{t-1}),\gamma_{t-1}). \label{eq::val_loss} \end{align} Finally, every over-parameterized knowledge embedding module is replaced as the knowledge embedding with the largest weight by taking argmax. \subsection{Optimization Algorithm} \label{sec::optimization} Reinforcement learning \cite{pham2018efficient}, evolutionary algorithm \cite{shang2011novel,shang2015improved} and gradient-based \cite{liu2018darts} are three common optimization techniques for NAS. In this paper, we employ the combination of gradient-based optimization algorithm and the proposed Stacked BCNN to achieve extreme fast search efficiency. To discover a high-performance Stacked BCNN, the gradient-based optimization pipeline is constructed as: 1) a continuous relaxation strategy for over-parameterized Stacked BCNN construction, 2) partial channel connections (PC) for memory reduction and 3) early stopping for efficiency improvement. In the over-parameterized Stacked BCNN, a mixture operation with respect to all candidate operators is inserted between two nodes of each cell to construct the NAS pipeline for differentiable architecture search. In particular, we call the Stacked BCNN which consists of several mixture operation based mini BCNNs, as the over-parameterized Stacked BCNN. Moreover, the over-parameterized Stacked BCNN used in Stacked BNAS without KES (dubbed as case 1) and with KES (dubbed as case 2) are different. In case 1, the cell is over-parameterized, and the knowledge embedding is not over-parameterized as Fig. 5 (a). In case 2, for knowledge embedding search, both the cell and knowledge embedding are over-parameterized (see Fig. 5 (b)). The optimization algorithm of Stacked BNAS is shown in \textbf{Algorithm 1}. \subsubsection{Continuous Relaxation} In mini BCNN, each cell consists of 2 input nodes $\{x_{(0)}, x_{(1)}\}$, $N-3$ intermediate nodes $\{x_{(2)},\dots,x_{(N-2)}\}$ and a single output node $\{x_{(N-1)}\}$. Each intermediate node $x_{(i)}$ can be computed by \begin{align} x_{(i)} = \sum_{j<i}o_{(i,j)}(x_{(j)}), \label{intermediate output} \end{align} where, $o_{(i,j)}$ is the operator between $x_{(i)}$ and $x_{(j)}$ chosen from candidate operation set $\mathcal{O}$. Moreover, the outputs of all intermediate nodes are combined to deliver $x_{(N-1)}$ by channel-dimension concatenation. Subsequently, the over-parameterized Stacked BCNN is constructed by continuous relaxation \cite{liu2018darts}. Particularly, edge $(i,j)$ of each cell is relaxed for mini BCNN by \begin{align} f_{(i,j)}(x_{(j)}) = \sum_{o \in \mathcal{O}}\frac{{\rm exp}(\alpha_{(i,j)}^o)}{\sum_{o' \in \mathcal{O}}{\rm exp}(\alpha_{(i,j)}^{o'})}o(x_{(j)}), \label{relaxation} \end{align} where operation $o(\cdot)$ is weighted by architecture weight $\alpha^o$. \subsubsection{Partial Channel Connections} The strategy of PC \cite{xu2019pc} is employed to improve the memory efficiency of Stacked BNAS and alleviate the performance collapse issue described in BNAS-v2 \cite{ding2021bnas-v2}. The continuous relaxation of Stacked BNAS with PC can be obtained by \begin{align} \begin{aligned} f^{PC}_{(i,j)}(x_{(j)}; M_{(i,j)}) &= \sum_{o \in \mathcal{O}}\frac{{\rm exp}(\alpha_{(i,j)}^o)}{\sum_{o' \in \mathcal{O}}{\rm exp}(\alpha_{(i,j)}^{o'})}o(M_{(i,j)} * x_{(j)})\\ &+(1-M_{(i,j)})*x_{(j)},\\ \end{aligned} \label{eq::pc} \end{align} where, $M_{(i,j)}$ represents the mask of the channel sample whose values are chosen from $\{0,1\}$. Moreover, edge normalization is used to mitigate the undesired fluctuation in the search phase via $\beta_{(i,j)}$ as \begin{equation} x_{(i)}^{PC}=\sum_{j<i}\frac{{\rm exp}(\beta_{(i,j)})}{\sum_{j'<i}{\rm exp}(\beta_{(i,j')})}\cdot f_{(i,j)}(x_{(j)}). \label{xpc} \end{equation} Finally, each operation of the best architecture is obtained by taking argmax as \begin{equation} o_{(i,j)}=\mathop{{\rm argmax}}\limits_{o \in \mathcal{O}}\frac{{\rm exp}(\alpha_{(i,j)}^o)}{\sum_{o' \in \mathcal{O}}{\rm exp}(\alpha_{(i,j)}^{o'})} \cdot \frac{{\rm exp}(\beta_{(i,j)})}{\sum_{j'<i}{\rm exp}(\beta_{(i,j')})}. \label{product} \end{equation} \subsubsection{Early Stopping (ES)} As described in DARTS+ \cite{liang2019darts+}, there are two indices for ES: 1) the \textit{skip connection} number in a single cell and 2) the number of stable epochs. On the one hand, the search procedure is stopped when there is more than one \textit{skip connection} in one cell to avoid the performance collapse issue. PC contributes to reducing the predominance of \textit{skip connections}, so this paper does not choose the first index. On the other hand, the search procedure is stopped when the ranking of architecture weights is no longer changed for a determined number of epochs. This index means that the search procedure stops when arriving at a saturated state. Above all, the second index is chosen for early stopping of Stacked BNAS using the following criterion: \textbf{Criterion 1}: \textit{Stop the search procedure when the rank of architecture weights is no longer changed for three epochs.} Moreover, in the following sections, we employ repetitive time to represent the consistent epoch number where the rank of architecture weights is invariable. \section{Universal Approximation of Stacked BCNN} Given the initial input channel number $c$, the output of mini BCNN$_i$ with $C_i$ channels, i.e., \eqref{eq::mini_bcnn} can be rewritten as \begin{align} y^{(i)}=\phi(\pmb{x}; \{\delta^{(i)}, \varphi^{(i)}, \pmb{W}^{(i)}_d, \pmb{\theta}^{(i)}_d, \pmb{W}^{(i)}_b, \pmb{\theta}^{(i)}_b,\pmb{W}^{(i)}_e, \pmb{\theta}^{(i)}_e \}), \label{eq::mini_bcnn_rewrite} \end{align} where $\pmb{x}$ represents input data. After GAP, each channel of $y^{(i)}$ is transformed into a single-pixel neuron-like feature map, so that it can be treated as $C_i$ neurons. Given standard hypercube $\textbf{I}^d = [0;1]^d \in \mathbb{R}^d$ and any continuous function $f \in {\rm C}(\textbf{I}^d)$, the proposed Stacked BCNN can be equivalently represented as \begin{align} f_{\pmb{p}_{k,u}}=\sum_{z=1}^{Z}w_z\sigma(\pmb{x}; \{\phi, \delta, \varphi, \pmb{W}^{(1)}, \pmb{\theta}^{(1)}, \dots, \pmb{W}^{(u)}, \pmb{\theta}^{(u)} \}), \end{align} where $Z=\sum_{i=1}^{u}C_i$ is the neuron number of the GAP output, $w$ represents the weight of the fully connected layer, $\pmb{p}_{k,u}=(k,u,c,w_1,\dots,w_{Z},\pmb{W}, \pmb{\theta})$ represents the set of overall parameters for the Stacked BCNN, and $\sigma$ is the activation function. Given the probability measure $\zeta_{k,u}$, randomly generates variables on $\pmb{\xi}_{k,u}=(w_1,\dots,w_{Z},\pmb{W}, \pmb{\theta})$. For compact set $\Omega$ of $\textbf{I}^d$, the distance between any continuous function and Stacked BCNN can be calculated as \begin{align} \chi_{\Omega}(f,f_{\pmb{p}_{k,u}})=\sqrt{\mathbb{E}\left[ \int_{\Omega}(f(\pmb{x})-f_{\pmb{p}_{k,u}}(\pmb{x}))^2d\pmb{x} \right]}. \end{align} Based on the above hypotheses, a theorem with proof of Stacked BCNN is given below. \emph{Theorem 1}: Given any continuous function $f \in {\rm C}(\textbf{I}^d)$ and any compact set $\Omega \in \textbf{I}^d$, Stacked BCNN with nonconstant bounded functions $\phi,\delta,\varphi$, and absolutely integrable activation function $\sigma$ whose definition domain is $\textbf{I}^d$ so that $\int_{\mathbb{R}_d}\sigma^2(\pmb{x})d\pmb{x}< \infty$, has a sequence of $\{f_{\pmb{p}_{k,u}}\}$ with probability measures $\zeta_{k,u}$ satisfied that \begin{align} \mathop{\rm{lim}}\limits_{u \rightarrow \infty}\chi_{\Omega}(f,f_{\pmb{p}_{k,u}})=0. \end{align} Moreover, the trainable parameters $\pmb{\xi}_{k,u}$ are generated by $\zeta_{k,u}$. \emph{Proof}: Define input data $\pmb{x}$, nonconstant bounded functions $\phi, \delta, \varphi$, approximation function $f_{\pmb{p}_{k,u'}}$ of Stacked BCNN with $u'$ mini BCNNs, probability distribution $\zeta_{k,u'}$ for trainable parameter generation, the weight matrix of fully connected layer $\pmb{w}'=[w'_{1},\dots,w'_{Z'}]^{\rm T}$ where $Z'=\sum_{z=1}^{u'}C_z$ and supplement weight $\pmb{w}''= [w''_{1},\dots,w''_{C_{u'+1}}]^{\rm T}$. Stacked BCNN with $u'$ (any integer) mini BCNNs can be computed by \begin{align} f_{\pmb{w}'}=&\sum_{z=1}^{Z'}w'_{z}\sigma(\pmb{x}; \{\phi, \delta, \varphi, \pmb{W}^{(1)}, \pmb{\theta}^{(1)}, \dots, \pmb{W}^{(u')}, \pmb{\theta}^{(u')} \}). \end{align} Subsequently, Stacked BCNN with input data $\pmb{x}$ can approximate continuous function $f$ with bounded and integrable resident function $f_{r_{u'}} \in \textbf{I}^d$ as \begin{align} f_{r_{u'}}(\pmb{x}) = f(\pmb{x})-f_{\pmb{w}'}(\pmb{x}). \end{align} As described in previous work \cite{rudin2006real}, for $\forall \varepsilon>0$, a function $f_{b_{u'}} \in {\rm C}(\textbf{I}^d)$ can always be found to satisfy: \begin{align} \chi_{\Omega}(f_{b_{u'}},f_{r_{u'}})<\frac{\varepsilon}{2}. \label{buru} \end{align} An extra mini BCNN (i.e., mini BCNN$_{u'+1}$) is defined to approximate $f_{b_{u'}}$ with $C_{u'+1}$ channels. Mini BCNN$_{u'+1}$ can be equivalently expressed as \begin{align} f_{\pmb{w}''}=\sum_{z=1}^{C_{u'+1}}w''_{z}\underbrace{\sigma(\pmb{x}; \{\phi, \delta, \varphi, \pmb{W}^{(u'+1)}, \pmb{\theta}^{(u'+1)} \})}_{\vartheta}, \label{fwe} \end{align} Similarly, the composition function $\vartheta$ in \eqref{fwe} is absolutely integrable. According to \emph{Theorem 1} in \cite{igelnik1995stochastic}, for $\forall \varepsilon>0$, a sequence of $f_{\pmb{w}''}$ can be found to satisfy: \begin{align} \chi_{\Omega}(f_{b_{u'}},f_{\pmb{w}''})<\frac{\varepsilon}{2}. \end{align} Moreover, the output of Stacked BCNN can be rewritten as \begin{align} f_{\pmb{p}_{k,u}} = f_{\pmb{w}'}+f_{\pmb{w}''}. \end{align} The distance between $f$ and $f_{\pmb{p}_{k,u}}$ can be obtained by \begin{align} \begin{aligned} \chi_{\textbf{I}^d}(f,f_{\pmb{p}_{k,u}})&=\sqrt{\mathbb{E}\left[ \int_{\Omega}(f(\pmb{x})-f_{\pmb{p}_{k,u}}(\pmb{x}))^2d\pmb{x} \right]}\\ &= \sqrt{\mathbb{E}\left[ \int_{\Omega}\left((f(\pmb{x})-f_{\pmb{w}'}(\pmb{x}))-f_{\pmb{w}''}(\pmb{x})\right)^2d\pmb{x} \right]}\\ &= \sqrt{\mathbb{E}\left[ \int_{\Omega}\left(f_{r_{u'}}-f_{\pmb{w}''}\right)^2d\pmb{x} \right]}\\ &= \chi_{\Omega}(f_{r_{u'}},f_{\pmb{w}''})\\ &\leq \chi_{\Omega}(f_{b_{u'}},f_{r_{u'}}) + \chi_{\Omega}(f_{b_{u'}},f_{\pmb{w}''}) \\ &< \frac{\varepsilon}{2} + \frac{\varepsilon}{2} \\ &<\varepsilon\\ \end{aligned} \end{align} Therefore, a conclusion can be drawn as \begin{align} \mathop{\rm{lim}}\limits_{u,v\rightarrow \infty}\chi_{\Omega}(f,f_{\pmb{p}_{k,u}})=0. \end{align} In other words, the proposed Stacked BCNN can completely appropriate any continuous function. \section{Experiments and Results} \label{sec::Experiments} In this section, the datasets used and implementation details are given first. Next, architecture search of Stacked BNAS without/with KES are introduced. Then, the best-performing architecture learned by Stacked BNAS on CIFAR-10 is transferred to solve large-scale image classification task on ImageNet, and the experimental results are analysed. Furthermore, the learned architecture is also transferred to four image classification datasets to verify the generalization ability of the proposed Stacked BNAS. Finally, two groups of ablation experiments are performed to verify the effectiveness of Stacked BNAS in terms of efficiency and performance. \subsection{Datasets and Implementation Details} \subsubsection{Datasets} CIFAR-10 and ImageNet are used to verify the effectiveness of the proposed Stacked BNAS. CIFAR-10 is a small-scale image classification dataset with 32$\times$32 pixels that contains 50K training images and 10K test images. ImageNet contains approximately 1.3 M training data and 50K validation data with various pixels over 1000 object categories. \subsubsection{Implementation Details} The data preprocessing technique follows BNAS-v2 for CIFAR-10 and ImageNet. Architecture search without or with KES ar e performed. For architecture search, the implementation is repeated with five times. For architecture evaluation, the mean value of three repetitive retraining experiments is treated as the index to determine the best architecture. Furthermore, the best architecture learned on CIFAR-10 is transferred to ImageNet, MNIST, FashionMNIST, NORB and SVHN. \subsection{Experiments on CIFAR-10} \subsubsection{Experimental Settings} As mentioned above, two experiments are implemented on CIFAR-10: 1) Stacked BNAS without KES and 2) Stacked BNAS with KES. The above two experiments use many identical experimental settings for architecture search, as shown below. The initial input channel number is set to 16. The above over-parameterized Stacked BCNN is trained for 50 epochs. All training images are equally divided into two parts. On the one hand, 25K images are treated as the training data to update the network weights $w$. On the other hand, another part is used as the validation data to optimize the architecture/embedding weights. To optimize the network weights $w$, the SGD optimizer is used with a dynamic learning rate using an annealed decay manner, momentum of 0.9 and weight decay of 3$\times$10$^{-4}$. Beyond that, the Adam optimizer is used to update the architecture/embedding weights, with weight decay of 1$\times$10$^{-3}$. Architecture search is implemented on a single NVIDIA GTX 1080Ti GPU. For architecture search of Stacked BNAS without KES, the over-parameterized Stacked BCNN consists of 2 mini BCNNs, where each one contains 1 broad cell and 1 enhancement cell. The batch size and network learning rate are set to 512 and 0.2, respectively. Moreover, the architecture learning rate is set to 6$\times$10$^{-4}$. For architecture search of Stacked BNAS with KES, the over-parameterized Stacked BCNN consists of 2 mini BCNNs, where each one contains 1 deep cell, 1 broad cell and 1 enhancement cell. Due to more memory requirements of KES, the batch size and network learning rate are set to 128 and 0.05, respectively. Beyond that, a larger learning rate of 2$\times$10$^{-3}$ is set for architecture/embedding weights when knowledge embedding is learned. \begin{figure}[!t] \centering \subfloat[Convolution cell]{\includegraphics[width=0.47\textwidth]{./figure/deep.png}} \\ \subfloat[Enhancement cell]{\includegraphics[width=0.47\textwidth]{./figure/enhancement.png}} \\ \captionsetup{font={small}} \caption{Architecture learned by Stacked BNAS without KES.} \label{fig::cells} \vspace{-0.5cm} \end{figure} \begin{figure}[!t] \centering \subfloat[Convolution cell]{\includegraphics[width=0.27\textwidth]{./figure/deep_embedding.png}} \\ \subfloat[Enhancement cell]{\includegraphics[width=0.37\textwidth]{./figure/enhancement_embedding.png}} \\ \captionsetup{font={small}} \caption{Architecture learned by Stacked BNAS with KES.} \label{fig::cells_embedding} \vspace{-0.5cm} \end{figure} \begin{table*}[!t] \centering \small \begin{threeparttable}[tbq] \captionsetup{font={small}} \caption{Comparison of the proposed Stacked BNAS and other state-of-the-art NAS approaches on CIFAR-10.} \label{tab::cifar10} \begin{tabular}{lcccccc} \hline \multirow{2}{*}{\textbf{Architecture}} & \textbf{Error}& \textbf{Params}& \textbf{Search Cost} &\textbf{Number} & \multirow{2}{*}{\textbf{Search Method}} & \multirow{2}{*}{\textbf{Topology}}\\ & \textbf{(\%)} & \textbf{(M)} & \textbf{(GPU days)} & \textbf{of Cells} & \\ \hline LEMONADE \cite{elsken2018efficient} & 3.05 & 4.7 & 80 & - & evolution & deep\\ DARTS (1st order) \cite{liu2018darts} & 3.00 & 3.3 & 0.45$\dag$ & 20 & gradient-based & deep\\ DARTS (2nd order) \cite{liu2018darts} & 2.76 & 3.3 & 1.50$\dag$ & 20 & gradient-based & deep\\ DARTS (random) \cite{liu2018darts}& 3.49 & 3.1 & - & 20 & - & deep\\ SNAS + mild constraint \cite{xie2018snas} & 2.98 & 2.9 & 1.50 & 20 & gradient-based & deep\\ SNAS + moderate constraint \cite{xie2018snas} & 2.85 & 2.8 & 1.50 & 20 & gradient-based & deep\\ SNAS + aggressive constraint \cite{xie2018snas} & 3.10 & \textbf{2.3} & 1.50 & 20 & gradient-based & deep\\ P-DARTS \cite{chen2019progressive} & \textbf{2.50} & 3.4 & 0.30 & 20 & gradient-based& deep\\ GDAS-NSAS \cite{zhang2020overcoming} & 2.73 & 3.5 & 0.40 & 20 & gradient-based & deep \\ PC-DARTS \cite{xu2019pc} & 2.57 & 3.6 & 0.10 & 20 & gradient-based & deep\\ ENAS \cite{pham2018efficient} & 2.89 & 4.6 & 0.45 & 17 & RL & deep\\ \hline \hline BNAS \cite{ding2021bnas} & 2.97 & 4.7 & 0.20 & \textbf{5} & RL & broad\\ BNAS-CCLE \cite{ding2021bnas} & 2.95 & 4.1 & 0.20 & \textbf{5} & RL & broad\\ BNAS-CCE \cite{ding2021bnas} & 2.88 & 4.8 & 0.19 & 8 & RL & broad\\ BNAS-v2 \cite{ding2021bnas-v2} & 2.79 & 3.7 & 0.05 & 8 & gradient-based & broad\\ \hline \hline Random & 3.12 & 3.1 & - & 8 & - & broad\\ Stacked BNAS w/o KES (Ours) & 2.71 & 3.7 & \textbf{0.02} & 8 & gradient-based & broad\\ Stacked BNAS w/ KES (Ours) & 2.73 & 3.1 & 0.15 & 10 &gradient-based & broad\\ \hline \end{tabular} \footnotesize \begin{tablenotes} \item[$\dag$] Obtained by DARTS using the code publicly released by the authors at https://github.com/quark0/darts on a single NVIDIA GTX 1080Ti GPU. \end{tablenotes} \end{threeparttable} \end{table*} For architecture evaluation, identical settings are employed except the number of deep cell which is 2 and 3 for Stacked BNAS without/with KES, respectively. The stacked BCNN consists of two mini BCNNs, where each one contains 1 broad cell and 1 enhancement cell. Following BNAS-v2, the learned Stacked BCNN with 44 input channels is trained for 2000 epochs using the SGD optimizer with a batch size of 128, learning rate of 0.05, momentum of 0.9 and weight decay of 3$\times$10$^{-4}$. Moreover, architecture evaluation is implemented on a single NVIDIA Tesla P100 GPU. \subsubsection{Results and Analysis} For Stacked BNAS, the learned architecture is visualized in Fig. \ref{fig::cells}. For Stacked BNAS with KES, the best architecture and knowledge embedding are shown in Fig. \ref{fig::cells_embedding} and \ref{fig::embedding}, respectively. Furthermore, TABLE \ref{tab::cifar10} summarizes the comparison of the proposed Stacked BNAS with other novel NAS approaches on CIFAR-10. Contributing to the combination of Stacked BCNN and optimization strategy, Stacked BNAS delivers a state-of-the-art efficiency of 0.02 GPU days and competitive test accuracy of 97.29\% with 3.7 M parameters. Beyond that, Stacked BNAS with KES discovers a Stacked BCNN with 2.73\% test error and just 3.1 M parameters (approximately 16.2\% less than Stacked BNAS). Moreover, the over-parameterized knowledge embedding module leads to more trainable parameters and memory requirements than vanilla Stacked BNAS, so larger costs are needed. As shown in Fig. \ref{fig::embedding}, one indirect-connected knowledge embedding of each mini BCNN has more output channels than hand-crafted embedding. The above knowledge embedding changes lead to parameter reduction of the architecture learned by Stacked BNAS with KES. \begin{figure}[!t] \centering \subfloat[The first mini BCNN]{\includegraphics[width=0.43\textwidth]{./figure/learned_embedding.pdf}} \\ \subfloat[The second mini BCNN]{\includegraphics[width=0.43\textwidth]{./figure/learned_embedding_2.pdf}} \\ \caption{The knowledge embedding learned by Stacked BNAS with KES, where $c=44$.} \label{fig::embedding} \vspace{-0.5cm} \end{figure} Compared with NAS approaches with deep topology, Stacked BNAS obtains the best efficiency and competitive accuracy. In terms of random architecture, Stacked BCNN obtains 0.38\% better accuracy than DARTS, which further examines the effectiveness of the proposed Stacked BCNN. Furthermore, Stacked BNAS is 5$\times$ faster than PC-DARTS whose efficiency ranks the best among all NAS approaches. Compared with BNASs, the proposed Stacked BNAS delivers better efficiency and accuracy. On the one hand, the efficiency of Stacked BNAS is approximately 10$\times$ and 2.5$\times$ faster than BNAS-v1 and BNAS-v2, respectively. On the other hand, the accuracy of Stacked BNAS is approximately 0.2\% and 0.1\% better than BNAS-v1 and BNAS-v2, respectively. Compared with previous BNASs, Stacked BNAS with KES can deliver better accuracy with approximately 16\% and 33\% parameter reduction, respectively. \subsubsection{Efficiency Difference between Stacked BNAS without or with KES} As shown in TABLE \ref{tab::cifar10}, the efficiencies of Stacked BNAS without/with KES are 0.02 and 0.15 GPU days, respectively. For that, there are two main reasons: 1) different structures of used Stacked BCNNs in the search phase, and 2) various degrees of difficulty meeting \textbf{Criterion 1}. On the one hand, in the architecture search phase of Stacked BNAS with KES, each mini BCNN contains a deep cell for learning appropriate knowledge embedding. Consequently, the first advantage of fast single-step training speed does not work. On the other hand, Stacked BNAS with KES has difficult satisfying \textbf{Criterion 1} for early stopping. \begin{table*}[!t] \centering \small \begin{threeparttable}[tbq] \captionsetup{font={small}} \caption{Comparison of the proposed Stacked BNAS and other state-of-the-art NAS approaches on ImageNet.} \label{tab::imagenet} \begin{tabular}{lccccccc} \hline \multirow{2}{*}{\textbf{Architecture}} & \multicolumn{2}{c}{\textbf{Test Err. (\%)}} & \textbf{Params} & \textbf{Search Cost} & \textbf{FLOPs} & \multirow{2}{*}{\textbf{Search Method}} & \multirow{2}{*}{\textbf{Topology}} \\ \cline{2-3} & \textbf{top-1} & \textbf{top-5} & \textbf{(M)} & \textbf{(GPU days)} & \textbf{(M)} \\ \hline AmoebaNet-A \citep{real2018regularized}& 25.5 & 8.0 & 5.1 & 3150 & 555 & evolution & deep\\ NASNet-A \citep{zoph2018learning} & 26.0 & 8.4 & 5.3 & 1800 & 564 & RL & deep\\ PNAS \citep{liu2018progressive} & 25.8 & 8.1 & 5.1 & 225 & 588 & SMBO & deep\\ GHN \citep{zhang2019graph} & 27.0 & 8.7 & 6.1 & 0.84 & 569 & SMBO & deep\\ DARTS (2nd order) \citep{liu2018darts} & 26.7 & 8.7 & 4.7 & 1.50 & 574 & gradient-based & deep\\ SNAS (mild) \citep{xie2018snas} & 27.3 & 9.2 & 4.3 & 1.50 & 522 & gradient-based & deep \\ BayesNAS \citep{zhou2019bayesnas} & 26.5 & 8.9 & \textbf{3.9} & 0.20 & - & gradient-based & deep\\ PC-DARTS \citep{xu2019pc} & 25.1 & 7.8 & 5.3 & 0.10 & 586 & gradient-based & deep\\ PC-DARTS (ImageNet) \citep{xu2019pc} & \textbf{24.2} & \textbf{7.3} & 5.3 & 3.80 & 597 & gradient-based & deep\\ BNAS-v2 (PC) (2nd order) \cite{ding2021bnas-v2} & 27.2 & 8.8 & 4.6 & 0.09 & \textbf{475} & gradient-based & broad \\ \hline \hline Stacked BNAS (Ours) & 26.4 & 8.9 & 4.7 & \textbf{0.02} & 485 & gradient-based & broad \\ \hline \end{tabular} \end{threeparttable} \end{table*} \begin{figure}[!t] \centering \captionsetup{font={small}} \includegraphics[width=0.41\textwidth]{./figure/ES.pdf} \caption{Early stopping for Stacked BNAS without KES. For instant, (12, 3) means that the proposed approach can satisfy the early stopping condition of 3 epochs when arriving at 12-th epoch.} \label{fig::ES} \vspace{-0.5cm} \end{figure} \begin{itemize} \item The architecture repetitive times of Stacked BNAS are shown in Fig. \ref{fig::ES}. In the architecture search phase of Stacked BNAS, both the repetitive times of convolution and enhancement cells should be larger than 2. Each implementation can stop early before arriving at the maximum epoch so that Stacked BNAS delivers state-of-the-art efficiency. \item For Stacked BNAS with KES, the architecture and embedding repetitive times are shown in Fig. \ref{fig::ES_kes}. In this experiment, the ES strategy is that the convolution cell, enhancement cell, and knowledge embedding do not change in three epochs. Each implementation cannot satisfy the aforementioned early stopping criterion. Beyond that, over-parameterized knowledge embedding without a partial channel connections strategy leads to more memory usages than vanilla BNAS. As a result, the batch size is set as 128 instead of 256. Above all, the efficiency of Stacked BNAS is not satisfactory when using KES. \end{itemize} \begin{figure}[!t] \centering \small \subfloat[Repetitive times of both architecture and embedding]{\includegraphics[width=0.41\textwidth]{./figure/ES_kes.pdf}} \\ \subfloat[Repetitive times of architecture]{\includegraphics[width=0.41\textwidth]{./figure/ES_arch.pdf}} \\ \subfloat[Repetitive times of embedding]{\includegraphics[width=0.41\textwidth]{./figure/ES_embed.pdf}} \\ \captionsetup{font={small}} \caption{Early stopping for Stacked BNAS with KES where both architecture and embedding weight should satisfy the \textbf{Criterion 1} \textit{simultaneously}.} \vspace{-0.5cm} \label{fig::ES_kes} \end{figure} \subsection{Experiments on ImageNet} \subsubsection{Experimental Settings} To transfer the architecture learned by Stacked BNAS on ImageNet, three 3$\times$3 convolutions are treated as the stem layers that reduce the input size from 224$\times$224 to 28$\times$28. Subsequently, a Stacked BCNN is constructed by 2 mini BCNNs, where each one contains 2 deep cells, 1 broad cell and 1 enhancement cell. For architecture evaluation, the SGD optimizer is chosen with a learning rate of 0.1 followed by a linear decay method, momentum of 0.9 and weight decay of 3$\times$10$^{-5}$. Moreover, the Stacked BCNN is trained for 250 epochs with a batch size of 512 on 4 NVIDIA Tesla P100 GPUs. Other experimental settings follow PC-DARTS. \subsubsection{Results and Analysis} TABLE \ref{tab::imagenet} summarizes the comparison of the proposed Stacked BNAS with other novel NAS approaches on ImageNet. Compared with previous impactful NAS approaches \cite{zoph2018learning,real2018regularized,liu2018progressive}, the proposed Stacked BNAS delivers competitive or better performance with a state-of-the-art efficiency of 0.02 GPU days which is 5 or 6 magnitudes faster. For efficient NAS approaches \cite{liu2018darts,xu2019pc}, Stacked BNAS also obtains competitive or better performance with 1 or 2 magnitudes faster efficiency. Compared with BNAS-v2, Stacked BNAS obtains better performance in terms of top-1 and top-5 accuracy. As mentioned above, the main difference between BNAS-v2 and the proposed Stacked BNAS is the broad scalable architecture, so that the effectiveness of Stacked BCNN can be promised. Moreover, the search cost of BNAS-v2 is 4.5$\times$ higher than Stacked BNAS. Due to the broad topology of Stacked BCNN, Stacked BNAS delivers the best performance in terms of FLOPs, which is an important index to show the hardware friendliness of deep models. \subsection{Experiments on Other Datasets} To further verify the effectiveness of Stacked BNAS, similar with BNAS-v2, the architecture learned on CIFAR-10 is transferred to MNIST, FashionMNIST, NORB and SVHN. Stacked BNAS employs identical experimental settings for the above four datasets. The Stacked BCNN consists of 2 mini BCNNs where each one has 3 deep cells, 1 broad cells and 1 enhancement cells. SGD is chosen as the optimizer to train the Stacked BCNN from scratch for 300 epochs. Here, several important hyper-parameters are listed as follows: a batch size of 128 and an initial learning rate of 0.05. Other training hyper-parameters are identical to BNAS-v2. Similar to BNAS-v2, deep search space-based NAS approaches (e.g., NASNet \cite{zoph2018learning}, AmoebaNet \cite{real2018regularized}, DARTS \cite{liu2018darts} and PC-DARTS \cite{xu2019pc}) consist of 20 cells and employ identical settings to Stacked BNAS except the learning rate of 0.025. Moreover, BNAS-v2 consists of 8 cells and sets the learning rate to 0.025. Experimental results are shown in TABLE \ref{tab::datasets}. \begin{table*}[!t] \centering \small \begin{threeparttable}[tbq] \captionsetup{font={small}} \caption{Comparison of Stacked BNAS and other novel classifiers on four image classification datasets} \label{tab::datasets} \begin{tabular}{lccccccc} \hline \multirow{2}{*}{\textbf{Architecture}} & \textbf{Params} & \multicolumn{4}{c}{\textbf{Accuracy (\%)}} & \textbf{Number} & \textbf{Search Cost} \\ \cline{3-6} & \textbf{(M)} & \textbf{MNIST} & \textbf{FashionMNIST} & \textbf{NORB} & \textbf{SVHN} & \textbf{of Cells} & \textbf{(GPU Days)}\\ \hline NASNet \cite{zoph2018learning} & 1.5/1.3$\dag$ & \textbf{99.64} (1) & \textbf{95.47} (1) & 93.34 (4) & 96.87 (4) & 20 & 1800\\ AmoebaNet \cite{real2018regularized} & 1.5 & 99.62 (4) & 95.33 (3) & \textbf{93.73} (1) & 96.85 (5) & 20 & 3150\\ DARTS \cite{liu2018darts} & 1.5 & 99.58 (6) & 95.24 (6) & 91.83 (6) & 96.76 (6) & 20 & 0.45\\ PC-DARTS \cite{xu2019pc} & 1.4 & 99.61 (5) & 95.26 (5) & 93.00 (5) & 96.98 (2) & 20 & 0.1\\ BNAS-v2 \cite{ding2021bnas-v2} & 1.5 & 99.63 (3) & 95.33 (3) & 93.37 (3) & 96.98 (2) & \textbf{8} & 0.09\\ \hline Stacked BNAS (ours) & 1.5 & \textbf{99.64} (1) & 95.35 (2) & 93.52 (2) & \textbf{97.12} (1) & 10 & \textbf{0.02} \\ \hline \end{tabular} \footnotesize \begin{tablenotes} \item[$\dag$] The error of out of memory arises on a NVIDIA Tesla P100 GPU when using 1.5 M parameters for NORB and SVHN classification. \end{tablenotes} \end{threeparttable} \end{table*} Compared with the comparative approaches, Stacked BNAS delivers the best generalization ability. For MNIST, both Stacked BNAS and NASNet obtain the best performance, i.e., 99.64\% accuracy. For FashionMNIST, NASNet also delivers the highest accuracy. The accuracy of Stacked BNAS is second-ranked. For NORB, the accuracy of Stacked BNAS is also second-ranked and AmoebaNet performs the best. For SVHN, Stacked BNAS is tied for the first place with 97.12\% accuracy. Above all, Stacked BNAS shows the best generalization ability on all tasks. \subsection{Ablation Studies} Here, two groups of experiments are implemented: 1) one is to examine the effectiveness of PC and ES for efficiency improvement of Stacked BNAS, and 2) the other is to verify the effectiveness of two scales of information, i.e., the output of the broad cell to the output node is denoted as b2o and the output of the deep cell to the enhancement cell is denoted as d2e. \subsubsection{PC and ES for Efficiency Improvement} In this group of experiments, there are four cases: 1) using neither PC nor ES, 2) using only PC, 3) using only ES and 4) using both PC and ES. Each case is repeatedly performed five times following the experimental setting used for architecture search of Stacked BNAS without KES. Experimental results are shown in TABLE \ref{tab:efficiency_ablation}. \begin{table}[!h] \centering \small \captionsetup{font={small}} \caption{Ablation experiments for the efficiency of Stacked BNAS on CIFAR-10.} \label{tab:efficiency_ablation} \begin{tabular}{cccccc} \hline \multirow{2}{*}{\textbf{Case}} & \multirow{2}{*}{\textbf{PC}} & \multirow{2}{*}{\textbf{ES}} & \multirow{2}{*}{\textbf{Epochs}} & \multirow{2}{*}{\textbf{Batch Size}} & \textbf{Efficiency}\\ &&&&&\textbf{(GPU days)}\\ \hline \hline 1 & \XSolidBrush & \XSolidBrush & 50 & 128 & 0.140 \\ 2 & \Checkmark & \XSolidBrush & 50 & \textbf{512} & 0.068 \\ 3 & \XSolidBrush & \Checkmark & 15 & 128 & 0.047 \\ 4 & \Checkmark & \Checkmark & \textbf{12} & \textbf{512} & \textbf{0.018} \\ \hline \end{tabular} \end{table} In case 1, the search cost of Stacked BNAS without PC and ES is 0.14 GPU days under a single NVIDIA GTX 1080Ti GPU. In case 2, Stacked BNAS employs PC to deliver an efficiency of 0.068 GPU days, which is 2$\times$ faster than case 1, because the strategy of PC contributes to improving a higher memory efficiency (using a larger batch size, i.e., 512) of Stacked BNAS than case 1. In the case of using ES, Stacked BNAS can stop the search phase at the 15th epoch and obtain an efficiency of 0.047 GPU days. When using both PC and ES, Stacked BNAS can not only search architecture with efficient memory of 512 batch size, but also stop early at the 12th epoch and delivers a state-of-the-art efficiency of 0.018 GPU days. Above all, both PC and ES play important roles in the efficiency improvement of Stacked BNAS. \subsubsection{Multi-scale Feature Fusion for Performance Improvement} In this group of experiments, there are four cases: 1) using neither b2o nor d2e, 2) using only b2o, 3) using only d2e and 4) using both b2o and d2e. Each case is repeatedly performed three times following the experimental setting used for architecture evaluation of Stacked BNAS without KES. Moreover, the mean accuracy of three repetitive experiments is treated as the final result. Experimental results are shown in TABLE \ref{tab:fusion_ablation}. \begin{table}[!h] \centering \small \captionsetup{font={small}} \caption{Ablation experiments for multi-scale feature fusion of Stacked BCNN on CIFAR-10.} \label{tab:fusion_ablation} \begin{tabular}{ccccc} \hline \multirow{2}{*}{\textbf{Case}} & \multicolumn{2}{c}{\textbf{Scale Information}} & \textbf{Parameters} & \textbf{Test Error}\\ \cline{2-3} & \textbf{d2e} & \textbf{b2o} & \textbf{(M)} & \textbf{(\%)} \\ \hline \hline 1 & \XSolidBrush & \XSolidBrush & 3.56 & 3.14 \\ 2 & \Checkmark & \XSolidBrush & \textbf{3.36} & 3.05 \\ 3 & \XSolidBrush & \Checkmark & 3.64 & 2.88 \\ 4 & \Checkmark & \Checkmark & 3.70 & \textbf{2.71} \\ \hline \end{tabular} \end{table} When using neither b2o nor d2e, Stacked BCNN degrades into vanilla BCNN, which lacks feature diversity for representation fusion and enhancement, so its test error is 3.14\%. For case 2, each mini BCNN employs the scale information from the broad cell to the output node and delivers 96.95\% accuracy, which is approximately 0.1\% higher than case 1. Compared with the scale information of b2o, d2e shows a greater contribution to performance improvement and obtains 97.12\% accuracy, which is approximately 0.3\% higher than case 1. In the last case, the combination of b2o and d2e further improves the performance of Stacked BCNN, i.e., 2.71\% test error. Above all, multi-scale feature fusion is effective for performance improvement of Stacked BCNN. \section{Conclusions} \label{sec::Conclusions} BNASs deliver state-of-the-art efficiency via a novel broad scalable architecture named BCNN, which employs multi-scale feature fusion and hand-crafted knowledge embedding to yield satisfactory performance with shallow topology. However, there are two issues in BCNN: 1) feature diversity loss for representation fusion and enhancement and 2) time consumption of knowledge embedding design. To solve the above issues, this paper proposes Stacked BNAS. On the one hand, Stacked BNAS proposes a new broad scalable architecture named Stacked BCNN that can provide more feature diversities for representation fusion and enhancement than vanilla BCNN. On the other hand, a differentiable algorithm named KES is also proposed to learn appropriate knowledge embedding for Stacked BCNN in an automatic way instead of designing by machine learning experts. Benefiting from the combination of Stacked BCNN and an efficient optimization algorithm, the proposed Stacked BNAS delivers a state-of-the-art efficiency of 0.02 GPU days with competitive performance. Moreover, KES contributes to discovering a high-performance Stacked BCNN with fewer parameter counts. Moreover, the proposed Stacked BNAS shows powerful generalization ability on four image classification datasets. Nevertheless, there has also a performance gap between deep and broad search spaces in terms of accuracy on ImageNet. In the future, knowledge distillation technique will be introduced to improve the performance on ImageNet. \bibliographystyle{IEEEtranN}
{'timestamp': '2022-08-02T02:34:22', 'yymm': '2111', 'arxiv_id': '2111.07722', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07722'}
arxiv
\section{Introduction} Advances in deep learning technology have prompted a variety of high-resolution generative models to be proposed, most of the generated image restores fine details without losing the macroscopic reality. This technology has played an important role in the fields of super-resolution reconstruction, data augmentation and image de-occlusion, but it also brings hidden dangers to the security of digital contents. In recent years, an AI-based face forgery method called DeepFakes has become popular, which can replace the face with any target object while retaining the voice, expression, and demeanor of the original video. Benefit from easy operation and no need for professional knowledge, the manipulated video can be widely disseminated on the Internet in a short time. This kind of identity manipulation video may be maliciously generated to spread rumors and fake news, thereby threatening democratic elections and social stability. In addition, the work of \cite{korshunov2018deepfakes} \etal proved that DeepFakes can attack the current advanced face recognition algorithms, which will further affect personal property security. In order to prevent the excessive proliferation of forgery videos and cause people's trust crisis in the media, the corresponding detection methods have been gradually proposed \cite{mirsky2021creation,nguyen2019deep,lyu2020deepfake,verdoliva2020media}. However, the past methods often focus on the defects in the DeepFakes generation pipeline (e.g. artifacts generated during affine transformation), which will limit the applicable conditions and reduce the cross-domain robustness of the model. Later, Ciftci \etal in their work \cite{ciftci2020fakecatcher,ciftci2020hearts} proposed to use remote Photoplethysmography (rPPG), a remotely monitored physiological signal, as a feature for detecting DeepFakes. They proved that in the generated contents, the spatial coherence and temporal consistency of physiological signal will be destroyed. Since the current generative models cannot prefectly restore the pixel variations caused by expansion and contraction of facial capillaries, detection methods based on physiological information have stronger cross-data domain robustness, and are suitable for a variety of DeepFakes generation sources. Unfortunately, rPPG signals extracted based on traditional methods are sensitive to video compression and target motion \cite{zhao2018novel}, which makes their signal-based detection method difficult to apply to Internet videos in complex conditions. Inspired by previous works, we choose to use physiological information to detect DeepFakes for its generalization ability, but we are not limited to extracting physiological signals and their time-frequency characteristics. Instead, we extract the spatial average of each color channel from multiple regions of the face frame by frame to form a set of multivariate sequences, which both containing temporal and spatial features. We believe that these features can characterize the distribution of human physiological information in space and time, and can be robustly used as evidence for detecting facial manipulation. Considering the excellent and mature performance of the self-attention mechanism in text and sequence processing, we use the powerful data mining ability of Transformer \cite{vaswani2017attention} to implicitly find the representation of this kind of time-series, so as to expose the difference between real videos and synthetic videos. In our work, we first apply multi-scale Eulerian color magnification to the original video to enlarge the faint variations in facial pixels caused by heartbeat. Then, we delineate a number of RoIs, extract the spatial average of each channel in the RoIs of the original video and magnified videos frame by frame and convert it into a spatial-temporal map. Next, we disassemble and reshape the MEMSTmap into patches in column units to highlight the temporal independence, and then send these patches and their corresponding frame position into a vision Transformer to learn the pattern differences between real videos and synthetic videos from the multivariate time-series. Finally, we feed the output feature embedding into a classification dense layer to get the prediction of real or fake. We demonstrated the superiority performance of our detection method and robustness to video compression on the FaceForensics++ \cite{rossler2019faceforensics++} dataset, and we also verified the generalization ability of the method across data domains on the DeepFake Detection dataset. We summarize our contributions as follows: \begin{itemize} \item We propose FakeTransformer, to the best of our knowledge, we first introduce the perspective of time-series processing into physiological information-based DeepFakes detection method, and essentially expose the temporal inconsistency in synthetic videos; \item We propose a novel spatial-temporal map based on multi-scale Eulerian Video Magnification (MEMSTmap) to represent the spatial-temporal features of the physiological information extracted from the face; \item In order to effectively protect the integrity of spatial-temporal representation, we input the spatial pixel information of each frame into the Transformer as a token to expose the frame level artifacts in synthetic videos. We verified our detector on FaceForensics++ and DeepFake Detection, and both achieved excellent performance. \end{itemize} \begin{figure*} \begin{center} \includegraphics[width=1.0\linewidth]{./image/MEMSTmap.pdf} \end{center} \caption{\textbf{An illustration of MEMSTmap generation from original video.} We first apply Gaussian spatial decomposition (GSD) on different octaves to the original video, multiply the filtered physiological related contents by a certain amplification factor (AF) and superimpose it back to the original video to obtain 3 EVM videos. Then we extract the average YUV signals for each RoI region of each video frame by frame, normalize the values to form the spatial-temporal map of the whole video, and finally segment several MEMSTmaps with 196 frames as the window length and 0.5s as the sliding length.} \label{fig:MEMSTmap} \end{figure*} \section{Related Work} \subsection{Video Magnification} Video magnification is a kind of video enhancement method, which aims to amplify subtle variations (including color, motion, etc.) in the video that are difficult to detect by the naked eye. MIT’s Computer Science and Artificial Intelligence Lab has been committed to solving such problems. In their work \cite{liu2005motion}, they tracked the trajectory of feature points by Lagrangian method to measure motion, then divided pixel clusters and layered by a certain similarity measurement method, and finally realized motion magnification by amplifying the motion vector of a specific layer. Wadhwa \etal \cite{wadhwa2013phase} Proposed a phase-based magnification method to amplify small motions by analyzing the local phase varying with time in different directions and scales, which can support greater magnification. In their follow-up work \cite{wadhwa2014riesz}, they proposed Riesz pyramid to further improve the processing speed. Recently, Oh \etal \cite{oh2018learning} Proposed a filter based on deep learning to extract the components to be amplified more accurately and reduce noise and artifacts. In order to facilitate the implementation, we choose to use the Eulerian Video Magnification (EVM) proposed by Wu \etal in their work \cite{wu2012eulerian}. Specifically, they extract the components within the range of heartbeat frequency through Gaussian pyramid decomposition and temporal filter, multiply it by the amplification factor, and then superimpose it back to the original video to enhance the expression of physiological information. \subsection{Time-Series Processing} Time-series is a common data form, time-series-based prediction, classification and anomaly detection are widely used in signal processing, stock market analysis, warehouse prediction, system early warning and other fields. Early time-series tasks are often based on Nearest Neighbor (NN) classifier and Dynamic Time Warping (DTW) distance \cite{lines2016hive, kate2016using, bagnall2015time}. With the expansion of data, neural networks such as MLP \cite{amarasinghe2018toward}, RNN \cite{malhotra2017timenet} and CNN \cite{strodthoff2019detecting, geng2018cost, basumallik2019packet} are widely used to extract robust temporal representation, among them, CNN benefits from its translation invariance and shows better performance in the task of time-series processing. The Transformer \cite{vaswani2017attention} proposed in recent years has a global self-attention mechanism and has better performance than RNN in capturing the long-distance correlation of sequences. Zhou \etal \cite{zhou2021informer} proposed a efficient Transformer architecture for long sequence time-series forecasting and proved that Transformer has great potential in time-series representation, which brings directional help to our work. \begin{figure*} \begin{center} \includegraphics[width=0.95\linewidth]{./image/New_architecture.pdf} \end{center} \caption{\textbf{Overview of our proposed FakeTransformer.} In order to decompose the MEMSTmap into the input token of the vision Transformer, and ensure that the input embedding transformation will not destroy the temporal information hidden in each column of the spatial-temporal map when segment the picture into patches, we interpolate and reshape each column of MEMSTmap, encapsulate the spatial color information of each facial video frame into a patch, and input these patches and their corresponding frame positions into the Transformer encoder to learn the temporal and spatial pattern differences of facial pixel variations in real and forgery videos.} \label{fig:architecture} \end{figure*} \subsection{DeepFakes Detection Methods} At present, the mainstream DeepFakes detection methods mainly have two directions. The first one is to detect the intra-frame image artifacts introduced during face synthesis or affine transformation, such as inconsistent head pose \cite{yang2019exposing}, color cues different from real cameras \cite{mccloskey2018detecting}, broken local PRNU patterns \cite{koopman2018detection,lukas2006digital} or detectable differences based on image quality measures (IQM) \cite{galbally2014face,korshunov2018deepfakes}. The other one is to detect inter-frame artifacts in an attempt to discover the artificial temporal inconsistency caused by frame by frame operation. As a representative, Sabir \etal \cite{sabir2019recurrent} proposed an RCN model to detect the temporal artifacts with inconsistent features across frames, and similarly, Guera and Delp \cite{guera2018deepfake} chose to use CNN and LSTM to create a time series descriptor to detect the authenticity of the video. Ciftci \etal \cite{ciftci2020fakecatcher} first proposed to use physiological signals to detect DeepFakes, their statistics found that the time-frequency characteristics of rPPG signals extracted from synthetic videos are significantly different from those in real videos and they made a series of hand-craft descriptors to identify DeepFakes. In their follow-up work \cite{ciftci2020hearts}, they further used CNN to extract the differencs in rPPG signal and its spectrum, which improved the accuracy of detection. \subsection{Remote Photoplethysmography} Remote Photoplethysmography (rPPG) is a vision-based contactless remote physiological monitoring method that can seperate the physiological information of the human body (e.g. heart rate, respiration rate, BVP signal and $SpO_2$) from the facial pixel variations recorded by RGB cameras. Its technical focus is to separate physiologically related components from noise such as illumination, skin tone, and motion. Early traditional methods include blind source separation (BSS) methods based on PCA \cite{lewandowska2011measuring} and ICA \cite{poh2010advancements}, or CHROM \cite{de2013robust}, PBV \cite{de2014improved} and POS \cite{wang2016algorithmic} methods based on skin reflection models. However, most of these methods have strict requirements on video conditions and are deeply affected by compression and motion. Later works proposed some methods based on deep neural networks \cite{niu2020video,chen2018deepphys,yu2019remote}, which improved the situation to some extent. \section{Proposed Method} In this paper, with the perspective of modeling spatial-temporal representation, we hope to find the temporal and spatial difference between real videos and synthetic videos from the color sequence extracted from the face. Therefore, we propose FakeTransformer and the overview is shown in the figure \ref{fig:architecture}. Our workflow will be described in three parts, firstly, we give the analysis of the target task, then introduce the generation of MEMSTmap, and finally give the details of FakeTransformer. \subsection{Analysis of Our Work} Previous work has proved that the current generative model can not perfectly restore the color variation caused by the change of capillary blood volume. Therefore, part of the physiological information in the GAN-generated contents is destroyed. Combining the previous research results, we give the following hypotheses. 1) Due to the frame by frame face swapping operation in the DeepFakes generation pipeline, the physiological variations extracted from the face are not continuous in time sequence. 2) Human facial capillaries have a certain distribution pattern, which will cause the phase difference of periodic color signals in different facial areas in the heart beat cycle, and the GAN-generated face does not have this fixed pattern, so the physiological information in real videos and synthetic videos also has spatial differences. The past physiological information-based DeepFakes detection methods often extract rPPG signals through traditional methods, and then find detectable differences from the time or frequency domain, however, these traditional methods often obtain physiological components from facial color sequence through linear dimension reduction methods such as PCA. Unfortunately, the error caused by manipulation is often not within the principal component, so it is easy to be eliminated. At the same time, rPPG signals based on manual extraction are easy to be affected by video factors such as illumination, skin color or motion, so that it is difficult to adapt to the actual Internet video conditions. In order to solve these problems, we extract the spatial average of each color channel from several face regions frame by frame to form a signal group, and hope to find the pattern difference between real video and forged video from the temporal and spatial variations of facial pixels. Intuitively speaking, the spatial-temporal signal group can be regarded as an interdependent multivariate time-series, in which the spatial dimension (i.e. the variable dimension of the series) contains the physiological information of different facial positions, and the time dimension contains the characteristics of temporal variations between frames. Therefore, we can turn the problem into how to find the spatial and temporal patterns from the multivariate time-series. As we all know, in language or time-series tasks, the Transformer structure model can effectively capture the correlation between each token in a long sequence for its powerful global self-attention mechanism, so we choose to use Transformer to encode the given multivariate time-series and obtain a robust descriptor to expose spatial and temporal artifacts. Inspired by the practical experience of some advanced language models (e.g. Bert \cite{devlin2018bert}, GPT \cite{radford2018improving}), which training on large corpora and fine tuning on specific dataset, we choose to use the pre-trained Transformer encoder with excellent initialization parameters. Each column of the spatial-temporal signal group (i.e. each frame in the video) can be regarded as an input word embedding of the Transformer after a certain linear transformation. However, due to the limited length of the pre-trained word vector and the output of the pixel value vector after the linear layer is uncontrollable, the word embedding is prone to overflow, so we choose to use the vision Transformer (ViT) \cite{dosovitskiy2020image} as our backbone because it has more suitable embedding transformation for pixel input. We convert the spatial-temporal signal groups into spatial-temporal maps and reshape them in units of columns to ensure that the time information will not be damaged during patch segmentation. It is worth mentioning that although we use the vision Transformer to learn the spatial-temporal map, the reshaped map does not have any image meaning. We encapsulate the spatial color information of each frame into a patch, and use the input embedding transformation of the vision Transformer to convert it into a form that can be accepted by the encoder, so essentially, our method is still modeling a multivariate sequence, aiming to learn the inter-frame temporal consistency and the intra-frame spatial coherence. \subsection{Multi-Scale Eulerian Magnified Spatial-Temporal map} The optical absorption variations of facial area caused by heartbeat is always subtle, and this fine signal is easy to be disturbed by lighting or motion. At the same time, only using the source video frame as the input of the detection model will bring unnecessary redundant information to the training, so as to reduce the accuracy. In order to solve this problem, we first decompose the original video into multiple Gaussian scales, filter the heart-rate related contents from the corresponding octave and enlarge it. Then the color signals of the facial region of the original video and physiological enhanced videos are extracted frame by frame. Finally, after normalization and segmentation, a fixed length spatial-temporal representation is formed as the input of our model. Specifically, the generation pipeline of MEMSTmap is shown in Figure \ref{fig:MEMSTmap}. Firstly, we decompose the input original video sequence into three Gaussian spatial octaves, these contents are then temporal band-pass filtered in the range of heart rate frequency (0.75Hz to 3Hz). For each octave, we multiply it by an appropriate amplification factor to ensure that there is no overflow of pixel values when superimposing back to the original video. Then, considering that a large area of occlusion (hair, hat or headdress) often appears on the forehead, which affects the extraction of skin information, we divide the remaining facial area into 15 RoIs through landmarks. For each RoI of each video sequence, we calculate the spatial average of Y, U and V color channels (As described in work \cite{niu2019rhythmnet}, YUV color space is effective in representing the physiological information than RGB color space) frame by frame to form three temporal signals. Finally, we normalize the signals, take 196 frames as the window length and 0.5s as the sliding length to form several 3-channels (YUV) MEMSTmaps with a width of 196 and a height of 60 (4 videos × 15 RoIs). \subsection{FakeTransformer} In this section, we will detail the pipeline of our proposed FakeTransformer. As we mentioned in 3.1, we intend to use MEMSTmap to fine-tune the parameters of the pre-trained vision Transformer. Each column of MEMSTmap represents the color information extract from each RoI in the original video and the enhanced video. If we send it directly to the vision Transformer for further learning, the forced segmentation will destroy the time information hidden in each column. Therefore, we reshape each column of MEMSTmap and encapsulate the spatial color information of each frame into an independent patch to meet the input requirements of the vision Transformer, so that retain important inter-frame temporal features without modifying the input embedding transformation of the pre-trained model. Specifically, we use a pre-trained vision Transformer with an input image size of 224 and a patch size of 16. So we interpolate each column of MEMSTmap to 256, and then reshape it to 16 by 16 to form a input patch. Then, we orderly input each patch and its corresponding frame position into the Transformer encoder, and obtain a 762 dimensional spatio-time descriptor from the output position corresponding to the class token. Finally, we use a dense layer to purify the feature embedding and use a softmax layer to output the probability of judging whether the MEMSTmap is real or fake. \section{Experiment and Analysis} In this section, we will give the implementation details of our proposed FakeTransformer, the results of comparison with the baseline method on each sub-datasets, and a series of ablation study result. \subsection{Training Details} \subsubsection{DeepFakes Datasets and Pre-processing} Our work mainly uses FaceForensics++ dataset \cite{rossler2019faceforensics++} to train and test our model, and randomly selects a certain number of real videos and forged videos from DeepFake Detection dataset to form a test set to verify the cross-domain generalization ability of our approach. It should be noted that the DeepFake Detection dataset was first released by Google and now has been incorporated into FaceForensics++. The FaceForensics++ dataset consists of real videos and synthetic videos from four different generation sources (i.e. DeepFakes, Face2Face, FaceSwap and NeuralTextures). The number of videos of each type is 1000. We establish sub datasets for each kind of forged videos, and constructed training sets, validation sets and test sets in the proportion of 8:1:1. In addition, due to the video length in FaceSwap and NeuralTextures is slightly shorter, in order to ensure the balance of samples, we take the first $70\%$ of the real videos to generate MEMSTmap when preparing the corresponding sub-datasets. The DeepFake Detection dataset consists of 363 real videos and 3068 synthetic videos. We randomly selected 100 real videos and 100 synthetic videos to form our cross data domain test set. For each video, we use Dlib \cite{kazemi2014one} to detect the face position and locate the landmarks. If a video has more than 10 frames without finding a face, the video will be discarded. We convert all videos to the form of MEMSTmap, in which the training set and validation set are in the unit of map, and the test set is in the unit of video. The number of MEMSTmap for each sub-dataset is shown in Table \ref{tab:table1}. \subsubsection{Training Settings} In our training process, we choose the cross entropy function as the classification loss function and Adam \cite{kingma2014adam} as the optimizer. We use the base version pre-trained ViT with the input image size of 224 and the patch size of 16 as our backbone, and fine tune the parameters at the learning rate of 0.00005 for total 60 epochs. In order to prevent over fitting, we add dropout \cite{srivastava2014dropout} on the output embedding of ViT with a probability of 0.1. \begin{table}[t] \Large \centering \renewcommand\arraystretch{1.6} \begin{center} \resizebox{0.48\textwidth}{!}{% \begin{tabular}{|c|c|cc|cc|cc|} \hline \rowcolor[HTML]{EFEFEF} \cellcolor[HTML]{EFEFEF} & \cellcolor[HTML]{EFEFEF} & \multicolumn{2}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Train}} & \multicolumn{2}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Validation}} & \multicolumn{2}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Test}} \\ \cline{3-8} \rowcolor[HTML]{EFEFEF} \multirow{-2}{*}{\cellcolor[HTML]{EFEFEF}\textbf{Sub-Dataset}} & \multirow{-2}{*}{\cellcolor[HTML]{EFEFEF}\textbf{Total}} & \textbf{Real} & \textbf{Fake} & \textbf{Real} & \textbf{Fake} & \textbf{Real} & \textbf{Fake} \\ \hline \textbf{DeepFakes} & 44430 & 18370 & 18085 & 2011 & 1935 & 2058 & 1971 \\ \textbf{Face2Face} & 44851 & 18370 & 18323 & 2011 & 1982 & 2058 & 2107 \\ \textbf{FaceSwap} & 30669 & 12943 & 12099 & 1428 & 1365 & 1459 & 1375 \\ \textbf{NeuralTextures} & 30718 & 12943 & 12141 & 1428 & 1365 & 1459 & 1383 \\ \hline \textbf{DeepFake Detection} & 9547 & - & - & - & - & 5091 & 4456 \\ \hline \end{tabular}% } \end{center} \caption{We list the number of MEMSTmap of Real videos and Fake videos in each sub-dataset, DeepFake Detection is only used as the test set, so there are no training and validation samples.} \label{tab:table1} \end{table} \begin{table*}[t] \centering \renewcommand\arraystretch{1.4} \resizebox{0.9\textwidth}{!}{% \begin{tabular}{|c|cccc|c|} \hline \rowcolor[HTML]{EFEFEF} \cellcolor[HTML]{EFEFEF} & \multicolumn{5}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Sub-Dataset}} \\ \cline{2-6} \rowcolor[HTML]{EFEFEF} \multirow{-2}{*}{\cellcolor[HTML]{EFEFEF}\textbf{Baseline}} & \textbf{DeepFakes} & \textbf{Face2Face} & \textbf{FaceSwap} & \textbf{NeuralTextures} & \textbf{DeepFake Detection} \\ \hline Inception V3 \cite{szegedy2016rethinking} & 83.76\% & 84.50\% & 82.91\% & 69.00\% & 56.50\% \\ MesoNet \cite{afchar2018mesonet} & 95.94\% & 96.50\% & 96.98\% & 79.50\% & 66.50\% \\ Xception \cite{chollet2017xception} & \textbf{98.98\%} & 97.50\% & 96.48\% & 83.00\% & 62.50\% \\ PPG cell \cite{ciftci2020hearts} & 94.42\% & 93.00\% & 93.47\% & 77.00\% & 64.00\% \\ \hline \textbf{ours} & \textbf{98.98\%} & \textbf{98.50\%} & \textbf{98.49\%} & \textbf{86.50\%} & \textbf{68.00\%}\\ \hline \end{tabular}% } \caption{The binary classification accuracy of our method compared with other baseline methods on each sub-dataset, we highlight the optimal results in the table. We also list the cross-domain detection results of each model on the DeepFake Detection dataset.} \label{tab:table2} \end{table*} \subsection{Baseline Comparision on Accuracy} \subsubsection{Selection of Baseline} We selected Xception \cite{chollet2017xception}, Inception V3 \cite{szegedy2016rethinking}, MesoNet \cite{afchar2018mesonet} and PPG cell \cite{ciftci2020hearts} as our baseline for comparison. These methods have well performance in the DeepFakes detection task. For Xception and Inception V3, we modified the final dense layer to adapt to our classification target. For MesoNet, we use the source code provided by the author and retrain the model. For PPG cell method, we re-implemented the model with the length of 64 frames according to the paper. It should be noted that since Xception, Inception V3 and MesoNet use image as input, so we need to make some adjustments to the training and testing process in our video task. Specifically, we split the video into frames and extract the facial region. Similarly, these frames are divided into training, validation and test sets according to the video unit. When testing the model, we use the network to predict each frame in the video, count the number of frames judged as real or fake, and finally determine the attribute of the video by majority voting. \subsubsection{Accuracy on FaceForensics++} When verifying our model, since a video contains more than one MEMSTmap, we make prediction for the authenticity of each map, and then majority vote for the result of the video. If the number of real predictions and fake predictions are the same, the predicted output of each MEMSTmap is counted and averaged, and the video attribute with high probability is taken as the final result. We list the binary detection accuracy of our method compared with other baselines on each sub-dataset of FaceForensics++ in the Table \ref{tab:table2}, It can be seen that, in general, our method has better performance than other baseline methods. Specifically, our FakeTransformer achieves $98.50\%$, $98.49\%$ and $86.50\%$ accuracy on Face2Face, FaceSwap and NeuralTextures respectively, which are higher than other baselines. It is worth mentioning that our method is far better than the second in the more realistic NeuralTextures sub-dataset (i.e. $83.00\%$ of Xception). On the DeepFakes sub-dataset, both our approach and Xception achieve $98.98\%$ accuracy and has better performance than other models. Compared with PPG cell, which is also a physiological information-based approach, our model shows higher detection accuracy on all sub-datasets, confirming that our model has SOTA performance in similar methods. \subsection{Robustness Experiment} \subsubsection{Cross-Dataset Robustness} In order to verify the cross-data domain robustness of our model, we randomly select 200 videos (100 real videos and 100 synthetic videos respectively) from the DeepFake Detection dataset and form a independent test set. For the model to be verified, we uniformly train with the DeepFakes sub-dataset, and use all videos to train the models, without separating the validation set and test set. The results for cross-data experiment are also list in Table \ref{tab:table2}. Obviously, the cross-data domain robustness of inception V3 is the worst among all baselines, and the accuracy on the test set of DeepFake Detection is only $56.5\%$. Although Xception shows strong performance in binary classification tasks, due to its complex network structure, it may show a certain over-fitting for cross-data domain samples, with an accuracy of only $62.5\%$. On the contrary, the lightweight network MesoNet shows better cross domain robustness, and has reached an accuracy of $66.5\%$. Our method is good at exposing the widespread physiological artifacts in forged videos, and achieves the highest cross-data domain classification accuracy compared with other baseline, that is, $68\%$, which is $4\%$ higher than the similar PPG cell model based on rPPG signal and its spectrum. \begin{figure}[t] \begin{center} \includegraphics[width=0.95\linewidth]{./image/compress.pdf} \end{center} \caption{We show the differences of MEMSTmap under different compression levels and highlight several obvious inconsistent areas. It can be seen that the variations of the compressed MEMSTmap are reduced both in temporal and spatial dimensions.} \label{fig:compress} \end{figure} \subsubsection{Video Compression Robustness} physiological information-based Deepfake detection models are often seriously affected by video compression, which is due to the limitations of remote physiological monitoring method. People often compress the video with large storage space to ensure that the video can be transmitted through the channel with limited bandwidth. In this process, a lot of facial details will be deleted and replaced, and adjacent pixel blocks will be combined as much as possible to reduce the amount of information carried by the video. Therefore, the color variation signal extracted from the face will be destroyed, which will affect the judgment of the model on the spatial-temporal sequence. We show the differences of MEMSTmap under different compression levels in figure \ref{fig:compress}. Due to the facial details are downsampled, the color differences between different regions are eliminated, and the colors of each region of the face tend to be consistent, which also destroys the variations in temporal dimension. We use three different compression levels (i.e. raw, C23 and C40) DeepFakes sub-datasets to implement video compression robustness experiments, and compare with PPG cell, which is also based on physiological information. The results are shown in the Table \ref{tab:table3}. It can be seen that our method has less accuracy degradation than PPG cell when facing highly compressed video, Specifically, for C23 video, our method accuracy decreases by $3.07\%$, PPG cell decreases by $5.39\%$, and for C40 video, our method accuracy decreases by $11.28\%$, PPG cell decreases by $16.67\%$. We believe that the past physiological information-based detection method extracted the rPPG signal manually. When performing PCA on the pixel sequence, the introduced compression artifact will be amplified, so that the detectable cues that can distinguish between real videos and synthetic videos may be ignored. Our method is not limited to extracting physiological signals, instead, we uses Transformer to model the temporal-spatial sequence of facial pixel variations, which reduces the impact of compression on the detection accuracy. \begin{table}[] \centering \renewcommand\arraystretch{1.4} \tiny \resizebox{0.45\textwidth}{!}{% \begin{tabular}{|c|ccc|} \hline \rowcolor[HTML]{EFEFEF} \cellcolor[HTML]{EFEFEF} & \multicolumn{3}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Compression Level}} \\ \cline{2-4} \rowcolor[HTML]{EFEFEF} \multirow{-2}{*}{\cellcolor[HTML]{EFEFEF}\textbf{Method}} & \textbf{raw} & \textbf{C23} & \textbf{C40} \\ \hline PPG cell & 94.42\% & 89.33\% & 78.68\% \\ \hline \textbf{ours} & 98.98\% & 95.94\% & 87.82\% \\ \hline \end{tabular}% } \caption{Experiment results for video compression robustness on DeepFakes sub-dataset.} \label{tab:table3} \end{table} \subsection{Ablation Study} In this section, we will do ablation study on our method from the following three aspects: 1) effectiveness of Vision Transformer (ViT), 2) effectiveness of Eulerian Video Magnification and 3) effectiveness of reshaping the map. Among them, in order to verify the effectiveness of ViT, we use ResNet18 (RN) to replace Transformer as the backbone to learn from MEMSTmap. In order to verify the effectiveness of Eulerian Video Magnification, we use the MSTmap proposed in work \cite{niu2020video} instead of MEMSTmap as learning samples. The spatial-temporal map proposed by Niu \etal does not contain enlarged physiological information. In order to verify the effectiveness of reshaping the map, we use ViT to train and test with the unmodified MEMSTmap. The results of ablation experiment are shown in Table \ref{tab:table4}. By comparing the first and third rows of the table, the detection accuracy based on ResNet18 is much lower than that based on ViT, which proves that Transformer's global self attention mechanism plays an important role in finding spatial-temporal artifacts caused by forgery. By comparing the second and fourth rows of the table, it can be seen that the detection accuracy of MEMSTmap with enhanced facial physiological variation information is better than that of MSTmap without enhancement, which proves the effectiveness of enhancing physiological expression on multiple octave scales. By comparing the third and fourth rows of the table, in general, the reshaped MEMSTmap has higher detection accuracy than the unmodified map, which proves that the retained time information is helpful for the neural network to find temporal inconsistency in the manipulation videos. \begin{table}[t] \centering \LARGE \renewcommand\arraystretch{1.4} \resizebox{0.5\textwidth}{!}{% \begin{tabular}{|c|cccc|} \hline \rowcolor[HTML]{EFEFEF} \cellcolor[HTML]{EFEFEF} & \multicolumn{4}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Sub-Dataset}} \\ \cline{2-5} \rowcolor[HTML]{EFEFEF} \multirow{-2}{*}{\cellcolor[HTML]{EFEFEF}\textbf{Settings}} & \textbf{DeepFakes} & \textbf{Face2Face} & \textbf{FaceSwap} & \textbf{NeuralTextures} \\ \hline RN + MEMSTmap & 84.26\% & 83.00\% & 85.43\% & 74.50\% \\ ViT + MSTmap(r) & 92.38\% & 91.00\% & 92.46\% & 79.00\% \\ ViT + MEMSTmap & 96.95\% & 97.50\% & 96.98\% & 87.50\% \\ ViT + MEMSTmap(r) & 98.98\% & 98.50\% & 98.49\% & 86.50\% \\ \hline \end{tabular}% } \caption{The ablation study of the model proposed in this paper by progressively setting ResNet18 (RN), Vision Transformer (ViT), MSTmap and reshape (r) operation.} \label{tab:table4} \end{table} \section{Conclusion} In this paper, we propose a face manipulation detection method, which we named FakeTransformer. For the first time, we regard the facial pixel variation sequence as a multivariate time-series, and look for detectable artifacts that can distinguish face forgery from the physiologically enhanced spatial-temporal representation through the Transformer's powerful self-attention mechanism. We have verified the effectiveness and cross-data domain robustness of our model on FaceForensics++ and DeepFake Detection datasets, and both of them have achieved excellent performance. Due to the inherent limitations of facial physiological feature extraction methods, our model will reduce the expansion ability for highly compressed video. Therefore, In our follow-up work, we intend to combine the measurement of facial region trajectory features to improve the ability of resisting video compression. {\small \bibliographystyle{ieee}
{'timestamp': '2021-11-16T02:28:15', 'yymm': '2111', 'arxiv_id': '2111.07601', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07601'}
arxiv
\section{Introduction} Cellular networks are a vital component of a truly mobile augmented reality (AR) system/application such as ``Pokemon Go," as they offer the widest coverage to the end-users. With the rising demand for immersive AR experience, the AR market is set to cross \$100 Billion and the total mobile network traffic is expected to exceed 300 Exabytes per month in 2026 \cite{EriccsonMobilityReport2021}. However, mobile AR traffic is latency-critical, uplink-heavy, and bursty in nature and the current LTE/LTE-A (Long Term Evolution/Long Term Evolution-Advanced) networks lack the capability to offer a seamless mobile AR experience \cite{ARLTE}. Consequently, cellular operators have taken several measures such as dense deployment of small-cells (SCs) and access points (APs) and utilization of the unlicensed spectrum through LTE-WiFi coexistence. The prospect of effectively utilizing the unlicensed spectrum through \textit{LTE in unlicensed spectrum} (LTE-U) and \textit{LTE license assisted access} (LTE-LAA) appeals to the mobile operators. Hence, there is a rapid deployment of both LTE small-cells and Wi-Fi APs in the 5GHz band where 500 MHz of the unlicensed spectrum is shared by both LTE and Wi-Fi networks \cite{ACM,icdcn}. This work focuses on two aspects of LTE-WiFi coexistence \emph{viz.,} coexistence network performance analysis and time-critical optimization. To that end, a comparative performance analysis of unlicensed LTE standards (LTE-U/LAA) is done through network feature relationship parameters learned from network data. Thereafter, the learned feature relationships are utilized to reduce the time-cost of performance optimization in a dense coexistence network. \subsection{Motivation} With the proliferation of unlicensed coexistence networks, there has been a significant debate on the comparison of LTE-U and LAA standards and their performance. While cellular operators such as AT\&T and Verizon have opted in favor of LAA deployments \cite{ACM}, recent works claim that LTE-U may offer better coexistence with Wi-Fi under specific conditions \cite{UvsLaa}. The existing comparative studies of LTE unlicensed standards are lacking in three respects. First, they primarily rely on simulations and make several assumptions \cite{LTEvsWiFi, UvsLaa}. Secondly, the offered comparative analysis is based only on \textit{measurements}, \emph{i.e.,} by simply comparing several network performance evaluation metrics such as throughput, latency, number of re-transmissions, \emph{etc.} In contrast, \textit{feature relationship analysis} looks for patterns in network data that can reveal relationships between network variables such as dependence, correlation, causation, \emph{etc.} Finally, the variation in performance of LTE unlicensed variant with the variation in coexisting Wi-Fi standard is often overlooked. In addition, the impact of factors such as bandwidth allocation and signaling data is rarely studied. With the increase in the deployment of small-cells and access points, dense networks (DNs) with inter-site distance $\leq$ 10m, and ultra-dense networks (UDNs) with inter-site distance $\leq$ 5m, have proliferated in most urban centers \cite{dense2}. Thus, performance optimization of the rapidly growing dense coexistence networks is a major challenge. This becomes particularly important when time-critical mobile AR services/applications need to be supported by coexistence networks. However, the literature currently lacks network feature relationship (NFR) analysis from the perspective of dense LTE-WiFi coexistence networks. Further, to the best of our knowledge no existing study makes use of network feature relationships in dense coexistence network optimization. \subsection{Contributions} In this work, we address these concerns through the following contributions \begin{itemize} \item Study network feature relationship in dense coexistence networks such as SINR-Capacity relationship, through machine learning algorithms. \item Analyze the impact of factors such as the choice of LTE unlicensed standard, coexisting Wi-Fi standard, and bandwidth allocation on NFRs in coexistence networks. \item Compare LTE-LAA/LTE-U and Wi-Fi 802.11n/ac coexistence performance based on NFR parameters such as the choice of predictor variable, R-sq (model validity), residual error (absolute and normalized), outliers, \emph{etc.} \item Utilize NFRs to optimize dense coexistence network performance through network capacity and signal strength optimization. \end{itemize} The comparative analysis in this work is distinct from the state-of-the-art studies \cite{LTEvsWiFi, UvsLaa} in that it is not limited to measuring and analyzing individual network variables. It involves data-learning to discover feature relationship patterns which determine network performance. Further, the data is gathered through real-time experiments instead of simulations. For the experiments, dense and ultra-dense co-existence networks were implemented with the help of USRP NI-SDRs and WiFi APs. The \textit{learning model selection policy} considered for feature relationship analysis is also explicitly described for replication and validation. \begin{figure}[ht] \centering \includegraphics[width=0.9\linewidth,trim=5mm -5mm 0mm -3mm]{Plots/LTE_INT.pdf} \caption{Interference in Dense Unlicensed Coexistence Networks} \label{LTEINT} \end{figure} \section {A Review of Related Works} \label{related} \subsection{Network Feature Relationships in Dense Networks} In the recent past, several state-of-the-art studies have used regression algorithms, decision trees, and other machine learning techniques for NFR analysis \cite{regmswim, regsigcom, regwcnc, icdcn}. Some of these works leverage the learned NFRs to improve network performance. For example, learning 802.11n feature relationships can facilitate improved configuration selection and enhanced rate adaption \cite{regmswim}. Yet, the current literature lacks a robust analysis of NFRs, such as the capacity-interference relationship (CIR) in unlicensed coexistence networks. Further, as shown in Figure~\ref{LTEINT}, densification of LTE-WiFi coexistence systems will exacerbate the adverse impact of interference and pose additional challenges. While densification may lead to an initial gain in LTE-WiFi coexistence system capacity, network performance eventually deteriorates with rise in density \cite{CoexDense1}. Moreover, the impact of factors \emph{e.g.,} unlicensed LTE variant, Wi-Fi standard, bandwidth allocated, and signaling data, \emph{etc.,} on dense coexistence CIR also remains unexplored. For example, the analysis presented in \cite{smkcomsnets} is limited to demonstrating how the SINR-Capacity relationship differs in regular and dense/ultra-dense networks, and fails to explore the impact of the factors listed above. Therefore, this work focuses on various aspects of the relationship between interference and network performance in a dense coexistence network. \subsection{Optimization Challenges in Dense Networks} The need for low association times and fast-handovers in a dense environment makes network optimization \textbf{time-critical}. However, consistent densification significantly increases network scale and complexity which leads to high convergence times and computational overhead to arrive at optimal solutions \cite{dense2}. This is a major challenge for ultra-low-latency AR applications as already the LTE/LTE-A deployments account for almost 30\% of the end-to-end AR latency \cite{ARLTE}. With densification, the latency problem will exacerbate and diminish the gains in throughput. Thus, it is important not only to study the impact of densification on NFRs but also ascertain how these feature relationships can be used to accelerate optimization in dense coexistence networks by making it computationally less expensive \cite{OptCIR}. Broadly speaking, wireless network performance can be optimized through three major frameworks \emph{viz.,} optimization, machine learning, and a hybrid approach that involves machine learning based optimization \cite{MLOPT, OptCIR}. This work paves the way for an empirical and practical approach to \textit{\textbf{network feature relationship based optimization}} (NeFRO). NeFRO adopts the hybrid model wherein feature relationships learned from network data serve as a constraint in network optimization formulations. By using the feature relationship equation for performance optimization, NeFRO accounts for the ambient network environment and is free from theoretical pre-suppositions. Due to these factors, NeFRO is shown to significantly reduce the time-costs in dense network performance optimization. \section{Experimental Set-up} This section describes the experimental platform designed to create a dense LTE-WiFi coexistence environment in the 5GHz unlicensed spectrum. The testbed is used to collect data for NFR analysis. \begin{figure}[h!] \centering \includegraphics[width=0.95\linewidth,trim=5mm -5mm 0mm -3mm]{Plots/CAM.pdf} \caption{Wi-Fi, LTE-LAA, and LTE-U: Channel Access Mechanisms} \label{COMAC} \end{figure} \subsection{Testbed Design} Two variants of LTE unlicensed operation have been standardized and released, viz., LTE-U and LTE-LAA, albeit with starkly different medium sensing and access mechanisms. LTE-U relies on a load-dependent duty-cycle mechanism based on Carrier Sense Adaptive Transmission (CSAT). On the other hand, LTE-LAA depends on a Listen-Before-Talk (LBT) mechanism which is similar to the CSMA/CD MAC protocol of Wi-Fi, making it relatively easier for LAA to coexist with IEEE 802.11 WLANs. The medium access mechanisms of the two LTE unlicensed variants and Wi-Fi are juxtaposed in Figure~\ref{COMAC}. \par\textbf{LAA-LTE/LTE-U Platform} The National Instruments \textit{NI RIO} testing-platform is used as the LAA/LTE-U testbed as shown in Figure~\ref{exp}~(a). The PHY on the NI Labview system is the standard PHY implementation as prescribed in the LTE-A 3GPP release. More technical details on the testbed are presented in Table~\ref{sim}. The system offers high operational flexibility through advanced user-defined configuration of signal transmission and reception. Several network parameters can be configured, such as the sub-carrier modulation scheme, resource block allocation, LAA transmission opportunity (TXOP), Energy Detection (ED) threshold, LBT category option, LTE-U duty cylce ON \& OFF, transmission power, OFDM parameters (\emph{e.g.,} 1 to 3 control channels), carrier frequency offset, and timing offset estimation. \par\textbf{Wi-Fi Platform} Netgear wireless routers are used to design the Wi-Fi testbed. The off-the-shelf Wi-Fi routers, supporting both 802.11n and 802.11ac in the 5 GHz band serve as the typical Wi-Fi nodes. The Wi-Fi testbed supports easy modification and monitoring of parameters and functions in both the MAC and PHY layers of Wi-Fi such as DIFS, CWmin, CWmax, channel bandwidth, and transmission power. \subsection{Experiment Design} All experiments are carried out in the typical setting of an indoor office at the University of Chicago campus. This work focuses mainly on gathering SNR and throughput data for NFR analysis. Other network parameters such as contention window size, request to send (RTS), clear to send (CTS), inter-beacon interval time, power range, channel assignment (static or dynamic), and bandwidth in the PHY layer are also configured as required. In the experiments, the LAA transmitter always uses LBT protocol to sense if the channel is available and the maximum TXOP is 8 ms, which is similar to the transmission of LTE-A in licensed bands. The Power Spectral Density (PSD) of LAA transmissions is controlled so as to ensure that the power of the interference from LAA is below Clear Channel Assessment (CCA) threshold of Wi-Fi communications. \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[Representative Testbed] {\includegraphics[width=.5\linewidth]{Plots/test-bed.pdf}}\hspace*{0.1cm}\hfill% \subfloat[Representative Topology] {\includegraphics[width=.40\linewidth]{Plots/topology.pdf}}\hspace*{0.1cm}\hfill% \end{tabular} \caption{Experimental Set-up} \label{exp} \end{figure*} Several experiments were designed to explore dense unlicensed coexistence performance by creating combinations of LAA/LTE-U, 802.11n/802.11ac, and different bandwidths (5/10/15/20 MHz). LAA and LTE-U use the same underlying mechanism of Dynamic Bandwidth Adaptation (DBA) for spectral efficiency as LTE-A. Therefore, while Wi-Fi APs generally operate in a bandwidth of 20 MHz, LAA and LTE-U possess the capability to support multiple bandwidths (1.4/3/5/10/15/20 MHz). Bandwidth is an important factor that may influence capacity interference relationship due to cross-talk interference. Therefore, this work considers bandwidth to be an important parameter for CIR analysis. Further, dense random topologies are considered where LAA/LTE-U/Wi-Fi nodes are placed at inter-nodal distances of 5m to 10m. A representative illustration is presented in Figure~\ref{exp}~(b). Apart from a small inter-nodal distance, a dense coexistence scenario in an indoor setting is also interesting due to the prevalence of significant multi-path fading and presence of obstacles such as walls, furniture, objects, etc. \begin{table}[h]\centering \caption{Experiment Parameters} \resizebox{0.65\textwidth}{!}{\begin{tabular}{|c|c|} \hline \textbf{Parameter} & \textbf{Value} \\ \hline Number of nodes & 6 \\ \hline Transmission Power & 23 dBm \\ \hline Operating Frequency & 5 GHz \\ \hline LTE-U/LAA RF Transmission & Loopback \\ \hline LTE Transmission Channel & PDSCH, PDCCH \\ \hline Data Traffic & Full buffer \\ \hline Wi-Fi Channel Access Protocol & CSMA \\ \hline LAA Channel Access Protocol & LBT \\ \hline \multicolumn{2}{l}{\footnotesize *PDSCH - Physical Downlink Shared Channel} \end{tabular}} \label{sim} \end{table} \section{Network Feature Relationship Analysis Methodology} Regression is a popular machine learning paradigm used to determine the relationship between network parameters in continuous space~\cite{regmswim, regsigcom, regwcnc, icdcn}. Regression algorithms not only offer reliable feature relationships, but also provide insights into the relationship in terms of model validity, outliers, residual error \emph{etc.} Thus CIR is modeled as a bi-directional regression problem where the goal is to estimate or predict network capacity through SINR feature points, and vice versa. \subsection{Learning Algorithms for Relationship Analysis} Let $N$ represent the number of training points and let dimensionality of the feature vector be denoted by $D$. Then, the coexistence network data can be represented as $\{\v x_i, y_i\}_{i=1}^N$, where $\v x_i \in \mathbb{R}^D$ is the feature vector and $y_i \in \mathbb{R}$ is the ground truth value for $i^{th}$ training point. The goal is to learn a mapping $f: \v x_i \xrightarrow{} y_i$ where $x_i$ is the predictor (SINR or Capacity) and $y_i$ is the response (Capacity or SINR). This work considers the following basket of learning algorithms for the regression analysis: \begin{itemize} \item \textbf{Linear Regression} This group of algorithms learns a linear relationship by solving $\argmin_{\v w, b} \sum_{i=1}^N ||(\v w^{\top} \v x_i+b) - y_i||_2^2 + \alpha\v w^{\top}\v w$~\cite{murphy2012machine}. Here, the weight vector is denoted by $\v w \in \mathbb{R}^D$ and the bias term is $b \in \mathbb{R}$. Further, the weightage (importance) of the $l_2$-regularization term is controlled by the hyper-parameter denoted by $\alpha$, which is set to zero for Ordinary Least Squares Linear Regression~(OLS). However, for Ridge Regression~(RR), $\alpha$ is set through $k$-fold cross validation (kCV). \item\textbf{Kernel Ridge Regression} A non-linear mapping is expected to be more suitable for the SINR-Capacity relationship \cite{Manas}. Therefore, we make use of the Kernel Ridge Regression~\cite{murphy2012machine} that employs non-linear transformations such as Polynomial and Radial Basis Function~(RBF). Its goal is to solve $\argmin_{\v w, b} \sum_{i=1}^N ||K(\v w, \v x_i)+b - y_i||_2^2 + \alpha\v w^{\top}\v w$. Here, $\v w \in \mathbb{R}^D$ is the weight vector, $b \in \mathbb{R}$ is the bias term, and $\alpha$ is a hyper-parameter defined above. Finally, $K(a, b)$ is a kernel function which allows to compute dot product in an arbitrary large space without the need to explicitly project features in high dimensional space. Varying the kernel function as RBF and Polynomial leads to Kernel RBF Regression~(RBF) and Multi-variate Polynomial Regression~(MPR), respectively. \end{itemize} \subsection{Selection of Regression Models} Regression Model selection depends upon objective criteria such as R-sq, higher-order terms, \emph{etc.,} and some subjective value-judgments, \emph{e.g.,} selecting a model with a higher R-sq even if the higher-order terms are not significant. However, studies often discuss network feature relationships and existence of correlation without going into the details of the underlying regression models \cite{regsigcom}. Failure to highlight such details poses a challenge while replicating these studies. To avoid this problem, the model selection policy considered in this work is described below. \par\textbf{Regression Model Selection Policy} \label{RMSP} The regression algorithms are subjected to \textit{k-Fold Cross-validation (kCV)} averaged over 30 runs (for $k=5$). Feature relationship models are evaluated based on their R-sq or \textit{Regression Model Validity} (RMV). A high RMV value signifies the \textit{goodness} of the fit. Also, outlier detection and removal is performed using the Local Outlier Factor (LOF) algorithm. First, CIR models with 1--3 degree polynomials are learned and to avoid over-fitting of feature point data, the higher-order terms considered are limited to statistically significant cubic terms. Further, the optimal model is chosen on the basis of RMV via kCV as it best explains the feature relationship \cite{Reg2}. For example, between a CIR model learned from the baseline data-set and the model learned from the data-set processed through LOF outlier removal, the model and feature relationship with the higher RMV is considered. This work focuses primarily on quadratic CIR models for the following reasons. First, the \% difference in average RMVs of linear \& quadratic and quadratic \& cubic models is 3.63\% and 0.98\% respectively. Thus, as compared to quadratic models, the linear models exhibit a relatively weak CIR and the RMV gain in cubic models is very low. Second, CIR in wireless networks is expected to be quadratic \cite{2Gupta}. Finally, low convergence time is a primary constraint in dense network optimization. Whatever little gain the higher RMV of a cubic model might offer in performance optimization, will be irrelevant compared to the increase in the computational overhead of a third-degree polynomial constraint. \subsection{Analytical Methodology} To study the impact of dense network configuration on NFRs, it is necessary to isolate individual network parameters and observe the consequent variation in the feature relationship. \par\textbf{Comparative Themes} The analysis seeks to draw a comparison between the performance of LTE unlicensed variants (LTE-U and LTE-LAA) in coexistence with the Wi-Fi variants (802.11n/ac). We also study the impact of bandwidth allocation and the choice of predictor variable on CIR in these network configurations. Thus, a total of 32 Test Scenarios are considered (denoted by TS$_{i}$, where $i\in \{1\ldots32\}$). Each TS$_{i}$ indicates a unique unlicensed coexistence network scenario based on the LTE unlicensed variant (LTE-U/LTE-LAA), coexisting Wi-Fi standard (802.11n/ac), bandwidth allocated (5/10/15/20 MHz), and predictor variable (SINR/Capacity). For each TS$_{i}$, the CIR model is selected through the regression model selection policy outlined earlier. \par\textbf{Comparison Parameters} The performance of different LTE-WiFi network configurations is evaluated through analysis of learning parameters such as model validity, standard deviation in RMV, residual standard deviation (RSD), outliers, \emph{etc.}. Trends of average network values observed in the experiments are used as well. For each of these parameters, two types of comparisons are carried out, \emph{viz.} scenario-specific comparison and component-specific comparison for LTE-WiFi-Predictor configurations. The former is aimed at a comparative analysis of individual network scenarios (\emph{e.g.,} LTE-U, 802.11n, at 5MHz vs. LTE-LAA, 802.11n, at 5MHz ) while the second is aimed at capturing component level trends (\emph{e.g.,} SINR as a predictor vs. Capacity as a predictor). Reliable inferences are drawn only if the findings are consistent at both levels of comparative analysis. Wherever possible, plausible explanations are offered. \section{CIR in Dense Unlicensed Coexistence Networks} \label{CIRDCN} CIR model parameters are analyzed, and the results are presented for scenario-specific comparisons in Figure~\ref{scenario}, and configuration-level trends in Figure~\ref{average}. Please note that only for Figure~\ref{average}~(b), a logarithmic scale is used to show ``\% Difference" due to a high variation in values. Based on these results, various aspects of unlicensed coexistence network performance are discussed ahead. Some results, such as those related to outliers, are mentioned during the course of the discussion itself. \subsection{Unlicensed LTE: LTE-U vs LAA} We begin with measurement based observations on average network capacity, as most comparative studies primarily focus on this metric \cite{UvsLaa}. In 75\% of the test-scenarios, LTE-LAA outperforms LTE-U in coexistence with corresponding Wi-Fi variant (n/ac). Likewise, in 87.5\% scenarios, 802.11ac outperforms 802.11n in coexistence with corresponding LTE variant (LTE-U/LAA). Further, LTE-LAA in coexistence with 802.11n/ac offers a higher SINR on average than LTE-U in all scenarios save one. The LBT mechanism of LAA is quite similar to the CSMA channel access protocol of Wi-Fi and leads to a higher network capacity on average in LTE-LAA. Further, LAA nodes sense the energy level on the medium (-72 dBm) prior to transmission which mitigates co-channel interference from Wi-Fi and other LAA APs, ensuring higher SINR on average than LTE-U. On the contrary LTE-U has a duty-cycle based channel access mechanism which leads to inefficient transmissions and packet-collisions in both, the LTE-U and Wi-Fi components of the coexistence system. \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[LTE-LAA vs. LTE-U] {\includegraphics[width=.45\linewidth]{Plots/UvLAA.pdf}}\hspace*{0.1cm}\hfill% \subfloat[802.11ac vs. 802.11n] {\includegraphics[width=.45\linewidth]{Plots/nVac.pdf}}\hspace*{0.1cm}\hfil \\ \subfloat[SINR vs. Capacity (P$_{var}$)] {\includegraphics[width=.45\linewidth]{Plots/Predictor.pdf}}\hspace*{0.1cm}\hfil \end{tabular} \caption{Test-scenario Specific Comparative Analysis} \label{scenario} \end{figure*} \par\textbf{Regression Model Validity (RMV)} LAA and LTE-U models fare equally well, in a scenario specific comparison with $\leq$5\% difference in RMVs in 13/16 comparisons (26/32 scenarios). CIR in LAA seems to be only slightly better as it outperforms LTE-U in the remaining 3 scenarios. In terms of average RMVs across all 32 scenarios, LAA and LTE-U are comparable, although LAA has a slight edge ($<$1\%). Likewise, in LAA-WiFi-Predictor configuration combinations, LAA has a slight edge (0--2\%). Prima facie, based on RMV alone, CIR does not seem to be impacted by the unlicensed LTE variant. However, RMV can not be considered to be the sole goodness-of-fit measure for feature relationships. Higher RMV is an indicator of the variation in dependent variable explained by the model, but it does not indicate how far the data-points lie from the regression line. Further, the standard deviation of RMV with kCV for a specific scenario must also be low. The analysis ahead explores these dimensions. \par\textbf{Residual Standard Deviation (RSD)} The capability of a feature relationship model to make accurate predictions is highly desirable for the model to be deployed in real-world network performance management. Thus, residual error or RSD is a measure of precision of the model's predictions and should ideally be low for a robust CIR. Higher residual error is observed in twice as many LTE-U scenarios as compared to LAA scenarios (5\% margin of error). On average, LTE-U scenarios have a 6\% higher RSD than LAA. Further, average residual error in all LTE-WiFi-Predictor network-configurations is lower for LAA when compared to LTE-U. Thus, LAA models seem to be more precise in their ability to predict coexistence network performance, regardless of the response variable (Capacity or SINR). \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[Avg. RMV and Residual Error] {\includegraphics[width=.5\linewidth]{Plots/R2RSD.pdf}}\hspace*{0.2cm}\hfill% \subfloat[Avg. \% Gain \& Std. Deviation in RMV] {\includegraphics[width=.5\linewidth]{Plots/GSTD.pdf}}\hspace*{0.1cm}\hfill% \end{tabular} \caption{Configuration-level Comparative Analysis} \label{average} \end{figure*} \par\textbf{Gain and Standard Deviation in RMV} It is important to notice the standard deviation (SD) in CIR model validities when subjected to kCV, especially after LOF outlier removal. While outlier reduction yields higher RMVs, the Gain in RMV should be accompanied with low SD in RMV, averaged across all kCV runs. Thus, we consider high Gain and low SD as a characteristic for stable CIR models. LTE-U fares much worse than LAA in terms of both Gain and SD. LAA outperforms LTE-U by 47.67\% in Gain and registers a 24.5\% lower SD, averaged across all scenarios. A similar trend can be observed in LTE-WiFi-Predictor combinations as well. Thus, LAA has a higher Gain post-outlier-removal along with a lower SD, which demonstrates robustness of the LAA CIR models. \par\textbf{Outliers} For a network system, the outlier \% may be considered to be a good indicator of the degree of fluctuation in network performance, and consequently the ability of a network to deliver the promised Quality of Service (QoS). However, the selection of outlier detection algorithm is a subjective choice. While this work steers clear of making inferences based on outliers, we compare the outliers in LTE-U and LAA data detected by LOF algorithm with the outliers detected by ``Minitab," a standard tool for data-analysis \cite{minitab}. Minitab's outlier detection algorithm labels samples with extreme ``leverage points" and ``large residuals" as outliers. As expected the percentage of data-points labeled as outliers is different in LOF and Minitab. However, LTE-U has higher a fraction of outliers as compared to LAA in both LOF (by 9.11\%) and Minitab (by 5.14\%). The reason for high fluctuation in LTE-U can be attributed to greater susceptibility of an LTE-U node to the unpredictable interference from Wi-Fi APs in its proximity. This primarily happens during the LTE-U ON state as there are no energy detection thresholds in LTE-U. Unlike LTE-U, Wi-Fi considers the energy threshold as -62 dBm and preamble detection threshold as -82 dBm. Similar to Wi-Fi, the LBT mechanism in LAA has an energy threshold of -72 dBm, making it less vulnerable to interference from Wi-Fi APs, and ensuring fewer extreme network performance fluctuations. Thus, LAA seems to offer a more reliable performance from the perspective of end-user QoS experience. \par\textbf{LTE-LAA vs LTE-U: A Feature Relationship Perspective} A clear pattern emerges after the analysis of various learning model parameters. Residual error, standard deviation in RMV, and outlier \% in LTE-U is higher than LAA, while post-outlier-removal Gain in RMV is lower. This is true for the majority of test-scenarios regardless of the choice of Wi-Fi variant, predictor variable, and bandwidth allocated. Thus, CIR in LTE-LAA networks is qualitatively better in terms of the spread of data along the expected curve fit. This implies that LAA offers greater consistency in networks performance and lower fluctuations in system variables such as the signal strength or the throughput at the end-user device. This finding has a strong correlation with the industry trends. The Global Mobile Suppliers Association (GMSA) report states that 38 operators in 21 countries have made investments in LAA as compared to only 11 operators investing in LTE-U. In terms of global deployments, 30 operators are planning to deploy or are actively deploying LAA networks in 18 countries, in contrast to LTE-U which is being deployed in only 3 countries. Further, LTE-U deployments are designed with an upgrade path to LAA and eLAA \cite{LAA2}. Clearly, LAA is the preferred choice of industry for LTE unlicensed networks. From a data-learning perspective, this appears to be reasonable as LAA offers a more robust network performance than LTE-U. \subsection{Wi-Fi: 802.11n vs 802.11ac} \par\textbf{Measurement Based Analysis} 802.11ac outperforms 802.11n in 87.5\% scenarios in terms of average network capacity. This is expected as 802.11ac supports 80 MHz channels (with optional support up to 160 MHz), higher modulation schemes (256 QAM), and 8x8 Multi-user Multiple-input Multiple-output (MU-MIMO), among other features. \par\textbf{Feature Relationship Analysis} 802.11ac is slightly better than 802.11n in scenario-specific RMV comparison, while in terms of component-specific average RMV, the two are comparable. The post-outlier-removal Gain in 802.11n is much higher, even though the average RMVs are comparable. However, 802.11ac has a lower deviation in model validities, which implies more reliable CIR models than 802.11n. In terms of residual error, 802.11ac registers lower error in 33\% more models as compared to 802.11n. This signifies more accurate predictive modeling in 802.11ac. \par\textbf{802.11ac vs 802.11n : A Feature Relationship Perspective} The CIR analysis reveals only a marginal advantage in coexistence performance for 802.11ac as compared to 802.11n. The trends are underwhelming because the 802.11ac standard supports compressed \textit{beamforming} which along with channel state information (CSI) is quite efficient in mitigating link-conflicts \cite{ac}. Hence, a stronger relationship between network capacity and SINR was expected. However, the observations can be reasonably explained through two facts. First, in an LTE-WiFi coexistence system, the unlicensed LTE (LTE-U/LAA) subsystem has a greater impact on the performance of the Wi-Fi subsystem than the latter has on the former. Thus, the unlicensed LTE subsystem is the primary determinant of the overall system performance. Second, the adverse impact of LTE-U on coexisting Wi-Fi (n/ac) performance is much worse than that of LAA on Wi-Fi \cite{UvsLaa}. The duty cycling mechanism of LTE-U combined with the LTE-U's transmission at energy threshold's lower than those prescribed by Wi-Fi cause interference to Wi-Fi transmissions \cite{LTEU-WiFi1}. LAA's LBT avoids collisions with Wi-Fi transmissions, and leads to a better coexistence system performance. This is observed in the LTE-WiFi-Predictor combination analysis as well. Thus, from a data analysis perspective, the unlicensed LTE is the dominant subsystem in the coexistence paradigm, and determines the overall system performance. Further, the feature relationship analysis of network-data also supports the findings from measurement based studies that LTE-U has a higher adverse impact on Wi-Fi performance as compared to LAA \cite{UvsLaa}. Another major takeaway is that it seems more appropriate to study the Wi-Fi (n/ac/ax) subsystems performance only in conjugation with the coexisting unlicensed LTE (LTE-U/LAA) or 5G NR-U subsystem. \subsection{Choice of Network Predictor Variable} A bidirectional regression analysis reveals the impact that the choice of predictor variable \emph{e.g.,} SINR (P$_{SINR}$) or Capacity (P$_{Cap}$), has on network feature relationships. We find that network capacity is a much better predictor of SINR than SINR is of network capacity. This is a pattern that can be clearly and consistently seen across all CIR model parameters and all comparative themes without any ambiguity. In scenario-specific comparison, RMV of P$_{SINR}$ models is always either comparable to, or lower than P$_{Cap}$ models. RMV of P$_{Cap}$ models is higher on average for both LTE-U and LAA components when compared to RMV of corresponding P$_{SINR}$ models. P$_{Cap}$ models also exhibit a significantly higher post-outlier-removal Gain and lower average standard deviation in RMV. Finally, the residual error is higher in P$_{SINR}$ on average, and in twice as many scenarios, when compared to P$_{Cap}$. It may seem counter-intuitive that it is more accurate to predict the expected values of SINR for given values of network capacity, than the reverse. However, recent analysis of operator data gathered from public LAA deployments shows that high SINR doesn't always guarantee high throughput in coexistence deployments, as end-user QoS depends on other factors such as resource block allocation \cite{icdcn}. On the other hand, for high throughput a high SINR is a necessary, if not a sufficient condition. Thus, the direction of NFR analysis and the choice of predictor has a clear effect on the learned network model, regardless of the unlicensed LTE and Wi-Fi variants considered. Further, this also indicates that other variables may also be relevant to the unlicensed coexistence NFR analysis such as resource block allocation, physical cell-id, \emph{etc.} \subsection{Impact of Bandwidth} From Figure~\ref{bandwidth}~(a), prima facie it appears that when throughput is the response variable, the residual error of the models increases consistently with bandwidth. This pattern seems consistent for both LTE-U and LAA models. This would make sense as well, because with higher bandwidth allocation there is a greater possibility of fluctuation in network capacity values in real-world systems due to poor resource allocation and temporal variation in factors such as interference. To confirm this pattern, we normalized the coexistence data and learned the feature relationships and associated parameters again. The data was normalized as $\hat{\mathbf{z}} = \frac{\mathbf{z} - \mathbf{\mu}}{\mathbf{\sigma}}$, where $\mathbf{\mu}, \sigma$ are the mean and the standard deviation of the data. As a result, the processed data is zero mean and unit variance, and thus more suited to evaluate the impact of bandwidth. Prior to normalization, in 11 out of 12 scenario-specific comparisons the RSD had increased with an increase in bandwidth. However, after normalization, in almost half the scenarios there is no increase in residual error with increase in bandwidth and the earlier trend is non-existent. This finding has serious implications for QoS promised to the end-user. Cellular operators attempt to satisfy the guaranteed user demand according to the data plan. Had higher bandwidth allocation exhibited an association (if not causation) with greater fluctuation in network performance, it would be worrisome. However, this does not seem to be the case. \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[RSD and Bandwidth] {\includegraphics[width=.5\linewidth]{Plots/RSDBW.pdf}}\hspace*{0.2cm}\hfill% \subfloat[Normalized RSD and Bandwidth] {\includegraphics[width=.5\linewidth]{Plots/RSDBWN.pdf}}\hspace*{0.1cm}\hfill% \end{tabular} \caption{Impact of Bandwidth} \label{bandwidth} \end{figure*} \begin{figure}[t!] \centering \includegraphics[width=0.95\linewidth,trim=5mm -5mm 0mm -3mm]{Plots/nefro.pdf} \caption{Network Feature Relationship based Optimization} \label{nefro} \end{figure} \section{NFRs and Dense Network Optimization} The feature relationships learned from network-data can be further utilized in improving dense network performance. \subsection{Network Feature Relationship based Optimization (NeFRO)} To facilitate the use of NFRs in network performance enhancement, this work proposes the \textit{\textbf{Network Feature Relationship based Optimization}} (NeFRO) framework. The high-level schema of the NeFRO framework is outlined in Figure~\ref{nefro}. First, data is collected for a network deployment periodically. In each epoch, network feature relationship analysis is performed using machine learning algorithms. Strong NFRs are identified and selected for possible utilization in network performance optimization. These NFRs are fed to a \textit{constraint selector module} that selects relevant constraints for the optimization model/formulation. The module compares an NFR learned from network data for a network feature-point set $\{f_1, f_2,\ldots,f_n\}$ with available theoretical constraints relevant to the feature point set. While the NFR is more ``suitable," as it is derived from actual network data, it still has to be tested for \textit{convergence time viability}. Thus the constraint selector module compares the NFR with the theoretical constraint for complexity, and selects the more viable constraint for network optimization. Although the illustration highlights the process-flow for a coexistence network, the NeFRO approach will apply similarly to network optimization in all wireless networks, with minor modifications, if required. \par\textbf{Benefits of the NeFRO Approach} There are several advantages of the proposed NeFRO framework over conventional network optimization. First, since the learned NFRs are grounded in empirical data, they reflect the ambient network conditions. Therefore, it is more practical to use them in network performance optimization than theoretical constraints involving similar network variables. Second, NFRs can be used ``as is" in optimization without making any assumptions, unlike theoretical constraints which need to be justified through assumptions. Finally, if the learned NFRs are less complex than the theoretical constraints, it automatically solves the problem of arbitrary or forced relaxation of constraints. Even if the NFRs are of a comparable complexity and require similar computational overhead, they have the advantage of reflecting the actual network parameter dynamics, which facilitates a more informed network optimization. \subsection{Implementation and Validation of NeFRO} Convergence time and accuracy trade-off is a primary challenge in dense network performance optimization \cite{dense5}. Therefore, NeFRO envisions the twin objectives of \textit{convergence time reduction}, while maintaining high \textit{accuracy}, vis-à-vis the baseline optimization model. The validation of NeFRO is done by implementing it on recent state-of-the-art studies on coexistence network optimization. \par\textbf{Validation Methodology} The validation methodology involves the following steps. First, works with two optimization objectives are considered, \emph{viz.} network signal strength optimization and network capacity optimization. The proposed optimization models are implemented on GAMS \cite{GAMS}, as per the network configuration and specifications of the testbed/experiments. Second, the baseline optimization models are implemented for the test-scenarios considered in this work. Further, two values are observed, (a) the optimal value of network performance metric (SINR or Capacity), and (b) the \textit{convergence time} required by the formulation to arrive at the optimal value. Thereafter, the complex theoretical SINR-Capacity constraint in each of the proposed optimization formulation is replaced with the second-degree polynomial CIR equation derived from feature relationship analysis in this work. Please note that the baseline models that optimize network capacity are considered for test-scenarios with SINR as the predictor, and vice-versa. \par\textbf{Evaluation of NeFRO} Two yardsticks are considered to carry out the performance evaluation of NeFRO. First, is the closeness of the ``NeFRO Optimal" value generated by the NeFRO model, to the optimal value generated by the baseline literature model. This is referred to as the \textbf{Accuracy} of the NeFRO model. Accuracy can be defined as, the \textit{```\% difference in the optimal value generated by the baseline model and the NeFRO-optimal value."} Second, is the reduction in the time taken by the NeFRO model to arrive at the optimal value. This is defined as \textbf{Convergence Time Fraction} (CTF). CTF indicates \textit{``what fraction (\%) of the baseline model's convergence time is NeFRO's convergence time."} \footnote{For example, if baseline model takes $10ms$ to converge at the optimal solution, and NeFRO requires $9ms$ to arrive at the NeFRO-optimal value, then CTF is 90\%} Thus, NeFRO is evaluated on its ability to offer a \textit{low CTF} while maintaining \textit{high Accuracy}, with respect to the baseline optimization model. Please note that the state-of-the-art optimization models are implemented for the small-scale dense unlicensed coexistence scenarios implemented on the experimental testbed. We expect that in a real-world network of a much higher scale and density, the benefits of NeFRO will be far more pronounced. \par\textbf{Baseline Optimization Models Considered} Four recent works are considered that propose formulations to optimize coexistence network performance. Two of these works aim at optimizing network capacity, while the other two optimize signal strength available to the UEs. A brief description is presented, starting with the capacity optimization works. An optimal resource allocation scheme aimed at maximizing LTE-LAA capacity in a LTE-WiFi coexistence network is proposed in \cite{Cap1}. Another study proposes an LBT-compliant channel access approach for both LTE-U/LAA in the 5GHz band that seeks to maximize system throughput, while also mitigating the impact of interference from the unlicensed LTE on the Wi-Fi subsystems capacity \cite{Cap2}. Further, \cite{SINR2} seeks to enhance and optimize network signal strength for LTE-U/LAA coexistence networks through strategic optimal placement of nodes. Finally, the model proposed in \cite{SINR1}, aims to optimize network performance by taking into account the spectrum usage of Wi-Fi APs in addition to the optimal placement of nodes. Henceforth, the capacity optimization models \emph{viz.,} \cite{Cap1} and \cite{Cap2}, are referred to as COM$_1$ and COM$_2$, respectively. Likewise, signal-strength optimization models \emph{viz.,} \cite{SINR1} and \cite{SINR2}, are referred to as SOM$_1$ and SOM$_2$, respectively. \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[NeFRO vs. COM$_1$ ] {\includegraphics[width=.45\linewidth]{Plots/LAANCOM1.pdf}}\hfill% \subfloat[NeFRO vs. COM$_2$] {\includegraphics[width=.45\linewidth]{Plots/LAANCOM2.pdf}}\hfill \\ \subfloat[NeFRO vs. SOM$_1$] {\includegraphics[width=.45\linewidth]{Plots/LAANSOM1.pdf}}\hfill% \subfloat[NeFRO vs. SOM$_2$] {\includegraphics[width=.45\linewidth]{Plots/LAANSOM2.pdf}}\hfill \end{tabular} \caption{NeFRO Performance in LAA Capacity and SINR Optimization} \label{nefroLAA} \end{figure*} \subsection{Optimization Results and Performance Evaluation} The results of the optimization simulations run on GAMS are presented in Figure~\ref{nefroLAA} and Figure~\ref{nefroLTU}, for LAA and LTE-U test-scenarios, respectively. Further, Figures~\ref{nefroLAA}~(a), \ref{nefroLAA}~(b), \ref{nefroLTU}~(a), and \ref{nefroLTU}~(b), present results for test-scenarios where the objective is to optimize network capacity. The remaining figures show results for signal-strength optimization test-scenarios. It can be discerned that NeFRO performs remarkably well by reducing the required convergence times while delivering NeFRO-optimal values very close to the optimal results of the respective models. A scenario-specific evaluation of NeFRO can be performed by observing the difference in the length of bars of Accuracy and CTF for a particular test-scenario. The greater the difference in their height, the lower is the trade-off, and the better is the NeFRO performance. Two points are noteworthy. First, in LAA scenarios NeFRO offers a significant reduction in convergence time, while in LTE-U scenarios, the CTF is somewhat subdued. Network optimization in LTE-U is inherently more challenging due to its channel access mechanism. Hence, it is more computationally intensive, and requires a longer convergence time. Second, for LAA scenarios the difference in NeFRO performance for capacity optimization and SINR optimization is negligible. However, in LTE-U, there appears to be a difference in NeFRO performance for these two objectives. Particularly, the CTF for SINR optimization in LTE-U is rather low. The average performance of NeFRO across all test-scenarios for the four optimization models is presented in Table~\ref{nefroT}. On average, when compared to SOM$_1$ and SOM$_2$, the CTF of NeFRO is lower than its average Accuracy, showing a marginal gain. However, Figure~\ref{nefroLTU}~(d) shows that for two scenarios there seems to be no overall gain from NeFRO as compared to SOM$_2$. Thus one dimension that needs to be further investigated is the variation in accuracy and convergence time-trade off with application of NeFRO. It is possible that the correlation or association between the RMV of the learned model and the network performance metric which is the objective of the optimization (SINR or Capacity), may explain this variation. In general, NeFRO outperforms the baseline model across all test-scenarios, and both unlicensed LTE variants, by significantly reducing the convergence time. The average Accuracy, as shown in Table~\ref{nefroT}, is very high as well. Further, NeFRO seems to perform better in LTE-LAA scenarios as compared to LTE-U, which can be expected based on the discussion and findings presented in this work. Thus, the NeFRO framework stands validated. \begin{figure*}[ht!] \centering% \begin{tabular}{cc} \subfloat[NeFRO vs. COM$_1$ ] {\includegraphics[width=.45\linewidth]{Plots/LTEUNCOM1.pdf}}\hfill% \subfloat[NeFRO vs. COM$_2$] {\includegraphics[width=.45\linewidth]{Plots/LTEUNCOM2.pdf}}\hfill \\ \subfloat[NeFRO vs. SOM$_1$] {\includegraphics[width=.45\linewidth]{Plots/LTEUNSOM1.pdf}}\hfill% \subfloat[NeFRO vs. SOM$_2$] {\includegraphics[width=.45\linewidth]{Plots/LTEUNSOM2.pdf}}\hfill \end{tabular} \caption{NeFRO Performance in LTE-U Capacity and SINR Optimization} \label{nefroLTU} \end{figure*} \begin{table} [hbt \caption{Performance Trends in Test-scenarios} \centering \small \begin{tabular}{|m{1.5cm}|m{0.85cm}|m{0.85cm}|m{0.85cm}|m{0.85cm}||m{0.85cm}|m{0.85cm}|m{0.85cm}|m{0.85cm}|} \hline \multicolumn{1}{|c|}{\textbf{NeFRO}}&\multicolumn{4}{|c||}{\textbf{LTE-LAA Scenarios} ($\%$)}&\multicolumn{4}{|c|}{\textbf{LTE-U Scenarios} ($\%$)}\\ \cline{2-9} \multicolumn{1}{|c|}{\textbf{Parameter}}&\textit{COM$_1$}&\textit{COM$_2$}&\textit{SOM$_1$}&\textit{SOM$_2$}&\textit{COM$_1$}&\textit{COM$_2$}&\textit{SOM$_1$}&\textit{SOM$_2$}\\ \hline CTF&76.46&78.25&79.89&76.02 &90.10&89.05&94.17&93.60\\ \hline Accuracy&95.04&93.31&92.28&93.82 &94.97&96.12&96.38&97.16\\ \hline \end{tabular} \label{nefroT} \vspace{-0.1cm} \end{table} \section{Conclusion and Future Direction} This work presented a comparative study of unlicensed coexistence networks through network feature relationship analysis. Network-data was collected through comprehensive real-world experiments and then analyzed through a family of regression algorithms. The relevance of network feature relationships was highlighted by analyzing LTE-WiFi networks on a variety of regression model parameters such a R-sq, residual error, \emph{etc.} Several insightful inferences were made on aspects such as the impact of bandwidth, residual error, and outliers on coexistence network performance. Further, NeFRO, a feature relationship based optimization framework was proposed and validated through signal strength and capacity optimization. NeFRO offered reduced convergence times by as much as 24\% and offered accuracy as high as 97.16\% on average. In the future, we will investigate convergence time and accuracy trade-off by considering feature relationships of varying degrees. Further, studying the association between the R-sq of the learned models and the network performance metrics is also a relevant topic. The impact of control/signaling data on network feature relationships will be explored as well. Most importantly, we intend to implement an AR system on a simulator and employ NeFRO to reduce latency. \bibliographystyle{splncs04}
{'timestamp': '2021-11-16T02:27:35', 'yymm': '2111', 'arxiv_id': '2111.07583', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07583'}
arxiv
\section{Introduction} Safety is critical when applying state-of-the-art artificial intelligence studies to real-world applications, like autonomous driving \citep{sallab2017deep,chen2021interpretable}, robotic control \citep{richter2019open,ray2019benchmarking}. Safe control is one of the most common tasks among these real-world applications, requiring that the hard safety constraints must be obeyed persistently. However, learning a safe control policy is hard for the naive trial-and-error mechanism of RL since it penalizes the dangerous actions \emph{after} experiencing them. Meanwhile, in the control theory, there exist studies about \emph{energy-function-based} provable safety guarantee of dynamic systems called the \emph{safety certificate}, or \emph{safety index} \citep{wieland2007constructive,ames2014control,liu2014control}. These methods first synthesize energy functions such that the safe states have low energy, then design control laws satisfying the \emph{safe action constraints} to make the systems dissipate energy \citep{wei2019safe}. If there exists a feasible policy for \emph{all states} in a safe set to satisfy the \emph{safe action constraints} dissipating the energy, the system will never leave the safe set (i.e., forward invariance). Despite its soundness, the safety index synthesis (SIS) by hand is extremely hard for complex systems, which stimulates a rapidly growing interest in learning-based SIS \citep{chang2020neural,saveriano2019learning,srinivasan2020synthesis,ma2021model,qin2021learning}. Nevertheless, These studies usually require known dynamical models (white-box, black-box or learning-calibrated) to design control laws. Furthermore, obtaining the policy satisfying safe action constraints is also challenging. Adding \emph{safety shields or layers} to obtain supervised RL policies is a common approach \citep{wang2017safety,Agrawal2017a,cheng2019end,taylor2020learning}, but these studies usually assume to know the valid safety certificates. In general safe control tasks with unknown dynamics, one usually has access to \emph{neither} the control laws \emph{nor} perfect safety certificates, which makes the previous two kinds of studies fall into a paradox---they rely on each other as the prior knowledge. Therefore, this paper proposes a novel algorithm without prior knowledge about model-based control laws or valid safety certificates. We define a loss function for SIS by minimizing the occurrence of energy increases. Then we formulate a CRL problem (rather than the commonly used shield methods) to unify the loss functions of SIS and CRL. By adding SIS as an outer loop to the Lagrangian-based solution to CRL, we jointly update the policies and safety certificates, and prove that they will converge to their respective local optima, the optimal safe policies and the valid safety certificates. \textit{\textbf{Contributions.}} Our main contributions are: 1. We propose an algorithm of joint CRL and SIS that learns the safe policies and synthesizes the safety certificates simultaneously. This is the first algorithm requiring no prior knowledge of control laws or valid safety certificates. 2. We unify the loss function formulations of SIS and CRL. We therefore can form the multi-timescale adversarial RL training and prove its convergence. 3. We evaluate the proposed algorithm on multiple safety-critical benchmark environments Results demonstrate that we can simultaneously synthesize valid safety certificates and learn safe policies with zero constraint violation. \subsection{Related works} Representative energy-function-based safety certificates include barrier certificates \citep{prajna2007framework}, control barrier functions (CBF) \citep{wieland2007constructive}, safety set algorithm (SSA) \citep{liu2014control} and sliding mode methods \citep{gracia2013reactive}. Recent learning-based studies can be mainly divided into \emph{learning-based SIS} and \emph{learning safe control policies supervised by certificates}. \citet{chang2020neural,luo2021learning} use explicit models to rollout or project actions to satisfy safe action constraints. \citet{jin2020neural,qin2021learning} guide certificate learning with LQR controllers, \citet{anonymous2021modelfree} requires a black-box model to query online, and \citet{saveriano2019learning,srinivasan2020synthesis} use labeled data to fit certificates with supervised learning. The latter one, learning safe policy with supervisory usually assumed a valid safety certificate \citep{wang2017safety,cheng2019end,taylor2020learning}. It's a natural thought that one could learn the dynamic models to handle these issues \citep[like][]{cheng2019end,luo2021learning}, but learning models is much more complex than only learning policies, especially in RL tasks. \section{Problem Formulations} We consider the safety specification that the system state $s$ should be constrained in a connected and closed set $\mathcal{S}_s$ which is called the \emph{safe set}. $\mathcal{S}_s$ should be a zero-sublevel set of a safety index function $\phi_0(\cdot)$ denoted by $\mathcal{S}_s = \{s|\phi_0(s)\leq0\}$. We study the Markov decision process (MDP) with deterministic dynamics (a reasonable assumption when dealing with safe control problems), defined by the tuple $(\mathcal{S}, \mathcal{A}, \mathcal{F}, r, c, \gamma,\phi)$, where $\mathcal{S},\mathcal{A}$ is the state and action space, $\mathcal{F}: \mathcal{S}\times \mathcal{A}\to\mathcal{S}$ is the unknown system dynamics, $r,c:\mathcal{S} \times \mathcal{A} \times \mathcal{S} \rightarrow \mathbb{R}$ is the reward and cost function, $\gamma$ is the discounted factor, and $\phi:\mathcal{S}\to\mathbb{R}$ is the energy-function-based safety certificate, or called the \emph{safety index}. A safe control law with respect to safety index $\phi$ should keep the system energy low, ($\phi\leq0$) and dissipate the energy when the system is at high energy ($\phi> 0$). We use $s'$ to represent the next state for simplicity. Then we can get the \emph{safe action constraint}: \begin{definition}[Safe action constraint] For a given safety index $\phi$, the safe action constraint is \begin{equation} \phi(s')<\max \{\phi(s)-\eta_D, 0\} \label{eq:cstr0} \end{equation} where $\eta_D$ is a slack variable controlling the descent rate of safety index. \end{definition} \begin{definition}[Valid safety certificate] If there always exists an action $a\in\mathcal{A}$ satisfying \eqref{eq:cstr0} at $s$, or the safe action set $\mathcal{U}_s(s)=\{a|\phi(s')<\max \{\phi(s)-\eta_D, 0\}\}$ is always nonempty, we say the safety index $\phi$ is a \textbf{valid}, or \textbf{feasible} safety certificate. \end{definition} \begin{figure} \centering \includegraphics[width=0.5\linewidth]{fig/region4.png} \caption{Safety index synthesis (SIS). Inevitably unsafe states should be excluded during the SIS.} \label{fig:my_label} \label{fig:intro} \end{figure} A straightforward approach is to use the $\phi_0$ as the safety certificate. However, these safe action constraints are possibly not satisfied with all the states in $\mathcal{S}_s$ as shown in \figureref{fig:intro}. This problem is common in real-world tasks with actuator saturation and high relative-degree from safety specifications to control inputs (i.e., $\|\frac{\partial\phi_0}{\partial u}\|=0$). For example, if $\phi_0$ measures the distance between two autonomous vehicles, the collision may be inevitable because the relative speed is too high and brake force is limited. In this case, $\mathcal{S}_s$ includes inevitably unsafe states. We need to assign high energy values to these inevitably-unsafe states, for example, by linearly combining the $\phi_0$ and its high-order derivatives \citep{liu2014control}. The valid safety certificate will guarantee safety by ensuring the \emph{forward invariance} of a subset of $\mathcal{S}_s$. \begin{lemma}[Forward invariance \citep{liu2014control}] Define the zero-sublevel set of a valid safety index $\phi$ as $\mathcal{S}_s^\phi=\{s|\phi(s)\leq0\}$. If $\phi$ is a valid safety certificate, then there exist policies to guarantee the forward invariance of $\mathcal{S}_s^\phi\cap\mathcal{S}_s$. \end{lemma} We therefore can formulate the CRL problem by adding the safe action constraints to RL optimization objective: \begin{equation} \max_{\pi}\ \mathbb{E}_{\tau\sim\pi}\Big\{\sum\nolimits_{t=0}^{\infty}\gamma^t r_t\Big\} = \mathbb{E}_{s}\big\{v^{\pi}(s)\big\} \quad \text{s.t.} \ \phi(s')-\max \{\phi(s)-\eta_D, 0\}<0, \forall s \in \mathcal{D} \label{eq:statewiseop} \end{equation} where $v^\pi(s)$ is the state-value function of $s$, $\mathcal{D}=\{s|f(s)>0\}$ is the set of all possible states ($f$ is the state distribution density). \begin{remark} \eqref{eq:statewiseop} has \textbf{state-dependent} constraints; it can not be solved by previous model-free CRL since their constraint objectives are defined on the \textbf{expectation} over $\mathcal{D}$ \citep{uchibe2007constrained,achiam2017constrained,chow2017risk,tessler2018reward,ray2019benchmarking,stooke2020responsive}. \end{remark} We solve \eqref{eq:statewiseop} based on our previous framework to solve state-dependent safety constraints in \citep{ma2021feasible} using the Lagrange multiplier networks $\lambda(s)$ in a Lagrangian-based approach. The Lagrange function is \citep{ma2021feasible} \begin{equation} \mathcal{L}'(\pi,\lambda) = \mathbb{E}_{s}\big\{-v^{\pi}(s) + \lambda(s)\big(\phi(s')-\max \{\phi(s)-\eta_D, 0\}\big)\big\} \label{eq:SL2} \end{equation} We can solve \eqref{eq:statewiseop} by locating the saddle point of $\mathcal{L}'(\pi,\lambda)$, $\max _{\lambda} \min _{\pi}\mathcal{L}'(\pi,\lambda)$. \section{Joint Synthesis of Safety Certificate and Safe Control Policy} The key idea of this section is to unify the loss functions of CRL and SIS; we provide theoretical analyses of their equivalence. \label{sec:joint} \subsection{Loss Function for Safety Index Synthesis} We construct the loss for optimizing a parameterized safety index by a measurement of the \emph{violation of constraint} \eqref{eq:cstr0} \begin{equation} J(\phi)=\left.\mathbb{E}_{s}\Big\{\left[\phi(s')-\max \{\phi(s)-\eta_D, 0\}\right]^{+}\Big\}\right|_{\pi=\pi^*} \label{eq:philoss1} \end{equation} where $[\cdot]^+$ means projecting the values to the positive half-space $[0, +\infty)$, $\pi^*$ is the optimal safe policy (also a feasible policy when $\phi$ is a valid safety index) of \eqref{eq:statewiseop}, and $\cdot|_{\pi=\pi^*}$ represents the agent takes $\pi^*(s)$ to reach $s'$. Ideally, if $\phi$ is a valid safety index, there always exists control to satisfy \eqref{eq:cstr0}, and $J(\phi)=0$. For those imperfect $\phi$, the inequality constraint in \eqref{eq:statewiseop} may not hold for all states in $\mathcal{D}$, so we can optimize the loss to get better $\phi$. The joint synthesis algorithm is tricky since we need to handle \emph{two different optimization problems}, \eqref{eq:SL2} and \eqref{eq:philoss1}. Recent similar studies integrate two optimizations by weighted sum \citep{qin2021learning} or alternative update \citep{luo2021learning}, but their methods are more like intuitive approaches and lack a solid theoretical basis. \subsection{Unified Loss Function for Joint Synthesis} \begin{lemma}[Statewise complementary slackness condition \citep{ma2021feasible}] \label{prop:scsc} For the problem \eqref{eq:statewiseop}, if the safe action set is not empty at state $s$, the optimal multiplier and optimal policy $\lambda^*,\pi^*$ satisfies \begin{equation} \lambda^*(s)\{\phi(s')- \max \{\phi(s)-\eta_D, 0\}|_{\pi*}\}=0 \end{equation} If the safe action set is empty at state $s$, then $\lambda^*(s)\to \infty$. \label{lemma:1} \end{lemma} \noindent The lemma comes from the Karush-Kuhn-Tucker (KKT) necessary conditions for the problem \eqref{eq:statewiseop}. Consider the Lagrange function \eqref{eq:SL2} with the additional variable $\phi$ to optimize, \begin{equation} \mathcal{L}'(\pi,\lambda,\phi) = \mathbb{E}_{s}\left\{-v^\pi(s)+\lambda(s)\big(\phi(s') - \max \{\phi(s)-\eta_D, 0\}\big)\right\} \label{eq:lagwithphi} \end{equation} we have the following lemma for the relationship between the loss function of policy and certificate synthesis \begin{lemma} If $\lambda$ is clipped into a compact set $[0,\lambda_{\max}]$, where $\lambda_{\max}>\max_{s\in\{s|\mathcal{U}_s(s)\neq\emptyset\}}\lambda^*(s)$. Then \begin{equation} \mathcal{L}'(\pi^*,\lambda^*,\phi)= \lambda_{\max} J(\phi) + \Delta \end{equation} where $\Delta$ is a constant irrelevant with $\phi$. \label{lemma:propto} \end{lemma} \begin{proof} See
{'timestamp': '2022-05-27T02:11:00', 'yymm': '2111', 'arxiv_id': '2111.07695', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07695'}
arxiv
\section{Proof of invariance with respect to $\lambda_{\max}$} \label{app:invariance} To prove that Algorithm~\ref{alg:counterfactual-lewis} is invariant with respect to the choice of $\lambda_{\max}$ as long as $\lambda_{\max} \geq \lambda_m(t)$ for all $m \in \Mcal$ and $t \in \RR^{+}$, we only need to prove that \begin{equation*} \text{(i)} \quad \lambda_{m}(t) P^{\Ccal \given X = 1, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}(X) \quad \text{ whenever } \quad \lambda_m(t) < \lambda_{m'}(t) \end{equation*} and \begin{equation*} \text{(ii)} \quad \lambda_{m}(t) + \left( \lambda_{max} - \lambda_{m}(t) \right) P^{\Ccal \given X = 0, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}(X) \quad \text{ whenever } \quad \lambda_m(t) \geq \lambda_{m'}(t) \end{equation*} are invariant to the specific choice of $\lambda_{max}$. To prove that (i) is invariant, we first rewrite the counterfactual probability $P^{\Ccal \given X = 1, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}$ in terms of uniform random variables, following Section~4.2 in Huijben et al.~\cite{huijben2022review}: \begin{multline*} P^{\Ccal \given X = 1, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}(X = 1) = \\ % \PP_{U_0, U_1} \left[ -\log\left(-\log(U_1)\right) + \log\left(\frac{\lambda_{m'}(t)}{\lambda_{\max}}\right) - \log\left(\frac{\lambda_{m}(t)}{\lambda_{\max}}\right) \right. > \\ \left. -\log\left(-\log(U_1) - \frac{\log(U_0)}{1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}}\right) + \log\left(1 - \frac{\lambda_{m'}(t)}{\lambda_{\max}}\right) - \log\left(1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}\right) % \right] \end{multline*} where $U_0, U_1 \sim U[0, 1]$. Now, for a fixed $U_0$ and $U_1$, the above inequality can be rewritten as follows: \begin{align*} -\log \left[ - \log(U_1) \frac{\lambda_{m}(t)}{\lambda_{\max}} \frac{\lambda_{\max}}{\lambda_{m'}(t)} \right] &> -\log \left[ \left( -\log(U_1) - \frac{\log(U_0)}{1-\frac{\lambda_m(t)}{\lambda_{\max}}} \right) \frac{1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}}{1 - \frac{\lambda_{m'}(t)}{\lambda_{\max}}} \right] \\ - \log(U_1) \frac{\lambda_{m}(t)}{\lambda_{m'}(t)} \left( 1 - \frac{\lambda_{m'}(t)}{\lambda_{\max}} \right) &< -\log(U_1) \left(1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}\right) - \log(U_0) \\ - \log(U_1) \left( \frac{\lambda_{m}(t)}{\lambda_{m'}(t)} - \frac{\lambda_{m}(t)}{\lambda_{\max}} \right) &< -\log(U_1) \left(1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}\right) - \log(U_0) \end{align*} In the last inequality, the terms containing $\lambda_{\max}$ on the left and right hand side are identical and can be canceled. This proves that (i) is invariant to the specific choice of $\lambda_{max}$. To prove that (ii) is also invariant, we proceed similarly as in (i) and first rewrite the counterfactual probability $P^{\Ccal \given X = 0, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}$ in terms of uniform random variables: \begin{multline*} P^{\Ccal \given X = 0, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}(X = 1) = \\ % \PP_{U_0, U_1} \left[ -\log\left(-\log(U_0) - \frac{\log(U_1)}{\frac{\lambda_{m}(t)}{\lambda_{\max}}} \right) + \log\left(\frac{\lambda_{m'}(t)}{\lambda_{\max}}\right) - \log\left(\frac{\lambda_{m}(t)}{\lambda_{\max}}\right) \right. > \\ \left. -\log\left(-\log(U_0) \right) + \log\left(1 - \frac{\lambda_{m'}(t)}{\lambda_{\max}}\right) - \log\left(1 - \frac{\lambda_{m}(t)}{\lambda_{\max}}\right) % \right] \end{multline*} where $U_0, U_1 \sim U[0, 1]$. Now, for a fixed $U_0$ and $U_1$, the above inequality can be rewritten as follows: \begin{equation*} \log(U_0) \left( 1 - \frac{\lambda_m(t)}{\lambda_{m'}(t)} \right) \leq \log(U_1) \left( \frac{\lambda_{\max}}{\lambda_{m'}(t)} - 1 \right) \end{equation*} Now, using the fact that $-\log(U_0)$ and $-\log(U_1)$ are distributed as exponential random variables with rate $\lambda = 1$ and the CDF of the ratio $X = \log(U_0) / \log(U_1)$ of two exponential random variables with rate $\lambda_1$ is given by $\PP[X \leq x] = 1 / (1/x + 1)$, we have that: \begin{equation*} P^{\Ccal \given X = 0, \Lambda = \lambda_{m}(t) \,;\, \text{do}(\Lambda = \lambda_{m'}(t))}(X = 1) = \PP_{U_0, U_1} \left[ \frac{\log(U_0)}{\log(U_1)} > \frac{ \frac{\lambda_{\max}}{\lambda_{m'}(t)} - 1} {1 - \frac{\lambda_m(t)}{\lambda_{m'}(t)}} \right] = \frac{\lambda_{m'}(t) - \lambda_m(t)}{\lambda_{\max} - \lambda_m(t)}. \end{equation*} Then, it readily follows that \begin{equation*} \left( \lambda_{\max} - \lambda_{m}(t) \right) \frac{\lambda_{m'}(t) - \lambda_m(t)}{\lambda_{\max} - \lambda_m(t)} = \lambda_{m'}(t) - \lambda_m(t). \end{equation*} This proves that (ii) is invariant to the specific choice of $\lambda_{max}$. \section{Proof of Proposition~\ref{prop:monotonicity}} \label{app:prop:monotonicity} If $\lambda_m(t_i) \geq \lambda_{m'}(t_i)$, then we have: \begin{equation*} \lambda_m(t_i) \geq \lambda_{m'}(t_i) \implies\\ \lambda_m(t_i)\left(1-\frac{\lambda_{m'}(t_i)}{\lambda_{\text{max}}}\right) \geq \lambda_{m'}(t_i)\left(1-\frac{\lambda_m(t_i)}{\lambda_{\text{max}}}\right) \implies\\ \frac{1-\frac{\lambda_{m'}(t_i)}{\lambda_{\text{max}}}}{1-\frac{\lambda_m(t_i)}{\lambda_{\text{max}}}} \geq \frac{\frac{\lambda_{m'}(t_i)}{\lambda_{\text{max}}}}{\frac{\lambda_m(t_i)}{\lambda_{\text{max}}}}, \end{equation*} Now, by Eq.~\ref{eq:distribution}, the last inequality is equivalent to: \begin{equation} \label{eq:stability} \frac{P^{\Ccal \,;\, \text{do}(\Lambda = \lambda_{m'}(t_i))}(X = 0)}{P^{\Ccal \,;\, \text{do}(\Lambda = \lambda_m(t_i))}(X = 0)} \geq \frac{P^{\Ccal \,;\, \text{do}(\Lambda = \lambda_{m'}(t_i))}(X = 1)}{P^{\Ccal \,;\, \text{do}(\Lambda = \lambda_m(t_i))}(X = 1)}, \end{equation} which is exactly the counterfactual stability property. Finally, by Theorem $2$ in~\cite{oberst2019counterfactual}, we know that the Gumbel-Max SCM satisfies the counterfactual stability property. As a result, Eq.~\ref{eq:stability} implies that \begin{equation*} P^{\Ccal \given X = 0, \Lambda = \lambda_{m}(t_i) \,;\, \text{do}(\Lambda = \lambda_{m'}(t_i))}(X = 1) = 0, \end{equation*} as desired. The proof for the second case is exactly the same. \clearpage \newpage \section{Lewis'{} thinning algorithm} \label{app:lewis} Within Algorithm~\ref{alg:lewis}, lines 4--6 sample an event from a Poisson process with constant intensity $\lambda_{\text{max}}$ using inversion sampling and lines 11--14 accept/reject the event according to the ratio between the intensity of interest and $\lambda_{\text{max}}$ at the time of the event. \IncMargin{1.2em} \begin{algorithm}[h] \small \SetKwProg{Fn}{function}{:}{end} \textbf{Input}: $\lambda(t)$, $\lambda_{\text{max}}$, T. \\ \textbf{Initialize}: $s = 0$, $\Hcal = \emptyset$. \\ \vspace{2mm} \Fn{$\textsc{Lewis}(\lambda(t), \lambda_{\text{max}}, T)$} { \While{\normalfont{true}}{ $u_1 \sim \text{Uniform}(0, 1)$ \\ $w \leftarrow - \ln u / \lambda_{\text{max}}$ \\ $s \leftarrow s + w$ \\ \If{$s > T$} { break } $\Hcal_{\max} \leftarrow \Hcal_{\max} \cup \{ s \}$ \\ $u_2 \sim \text{Uniform}(0, 1)$ \\ \If{$u_2 \leq \lambda(s) / \lambda_{\text{max}}$} { $\Hcal \leftarrow \Hcal \cup \{ s \}$ \\ } } \vspace{2mm} \textbf{Return} $\Hcal$, $\Hcal_{\max} \backslash \Hcal$ } \caption{Lewis'{} thinning algorithm} \label{alg:lewis} \end{algorithm} \DecMargin{1.2em} \section{Thinning algorithm for Hawkes processes} \label{app:hawkes-superposition} Algorithm~\ref{alg:hawkes-superposition} samples a sequence of events from a linear Hawkes process using its branching process interpretation~\citep{moore2018maximum}, where $\textsc{Lewis}(\cdot)$ samples a sequence of events using Algorithm~\ref{alg:lewis}, $\gamma_0(t) = \mu$ and $\gamma_{i}(t) = \alpha g(t-t_i)$. \IncMargin{1.2em} \begin{algorithm}[h] \small \SetKwProg{Fn}{function}{:}{end} \textbf{Input}: $\mu$, $\alpha$, $g(t)$, $\lambda_{\max}$, $T$. \\ \textbf{Initialize}: $\Hcal = \emptyset$. \\ \vspace{2mm} \Fn{$\textsc{SampleHawkes}(\lambda(t), \lambda_{\text{max}}, T)$} { $\Hcal \leftarrow \textsc{Lewis}(\gamma_{0}(t), \lambda_{\max}, T)$ \\ \vspace{2mm} $\Hcal' \leftarrow \Hcal$ \\ \While{$| \Hcal' | > 0$} { $t_i \leftarrow \min_{t \in \Hcal'} t$ \\ $\Hcal_{i}, \underline{\enskip} \leftarrow \textsc{Lewis}(\gamma_{i}(t), \lambda_{\max}, T)$ \\ $\Hcal' \leftarrow \Hcal_{i} \cup \Hcal' \backslash \{ t_i \}$ \\ $\Hcal \leftarrow \Hcal \cup \Hcal_{i}$ \\ } \vspace{2mm} \textbf{Return} $\Hcal$ } \caption{It samples a sequence of events from a linear Hawkes process using its branching process interpretation.} \label{alg:hawkes-superposition} \end{algorithm} \DecMargin{1.2em} \section{Additional Details about the Experiments on Real Data} \label{app:ebola} Table~\ref{tab:r0-ebola} shows that, under the values of the between-district probabilities estimated using grid-search, the basic reproduction numbers of the simulated outbreaks match, at a country level, those estimated from real data by WHO~\cite{who2014ebola}. \begin{table}[thb] \centering \small \begin{tabular}{|c|c|c|} \hline Country & $R_0$ (WHO) & $R_0$ (simulated) \\ \hline Guinea (GN) & 1.71 (1.44 -- 2.01) & 1.71 (1.66 -- 1.76) \\ \hline Liberia (LB) & 1.83 (1.72 -- 1.94) & 1.83 (1.74 -- 1.91) \\ \hline Sierra Leone (SL) & 2.02 (1.79 -- 2.26) & 2.02 (1.95 -- 2.10) \\ \hline \end{tabular} \caption{Reproduction numbers ($R_0$) for each of the three countries affected by the Ebola outbreak estimated from real cases by WHO~\cite{who2014ebola} and estimated from simulated cases. % In each cell, the first number is the average and the numbers in parentheses are the $95\%$ confidence interval. } \label{tab:r0-ebola} \end{table} \section{Sampling Counterfactual Events in a SIR Epidemic Model} \label{app:sir-counterfactuals} As discussed in Section~\ref{sec:real}, the SIR model defined by Eq.~\ref{eq:sir} can be viewed as a (networked) multidimensional Hawkes process with stochastic triggering kernels defined by step functions. More specifically, let $t_i$ and $\tau_i = t_i + \Delta_i$ be the infection and recovery times of each node $i \in \Gcal$. Then, the intensity $\EE[dY_i(t) \given \Hcal(t)]$ can be (re-)written as: \begin{equation*} \EE[dY_i(t) \given \Hcal(t)] = \beta \sum_{j \in \Gcal(i)} g_i(t - t_j) \end{equation*} where $\Gcal(i)$ denotes the set of neighborhood of node $i$, $g_i(t) = [ 1 - Y_i(t) ] [ u(t) - u(t - \Delta) ]$ with $\Delta \sim \mathrm{Exp}(\delta)$ can be viewed as a stochastic triggering kernel, and $u(\cdot)$ is the step function. As a result, we can adapt Algorithm~\ref{alg:counterfactual-hawkes}, originally developed for unidimensional linear Hawkes processes, to sample counterfactual realizations of the SIR model. Algorithm~\ref{alg:counterfactual-sir} summarizes the resulting algorithm. \IncMargin{1.2em} \begin{algorithm*}[t] \small \textbf{Input}: $\beta_m$, $\delta$, $\beta_{m'}$, $\Gcal = (\Vcal, \Ecal)$, $\Gcal' = (\Vcal', \Ecal')$, $T$. \\ \textbf{Initialize}: $\mathrm{queue} = \mathrm{PriorityQueue}(\{ i \given i \in \Vcal \,\mathrm{and}\, \mathrm{is\_seed(i)} \})$, $\beta_{max} = max(\beta_m, \beta_{m'})$, $\mathrm{processed} = \{\}$, $\mathrm{infector} = \{\}$.\\ \vspace{2mm} \For{$i \in \Gcal$}{ $\mathrm{processed}[i] = \mathrm{False}$\\ \eIf{$\mathrm{is\_seed(i)}$}{ $t_{ i} = 0$\\ $\tau_{i} = t_{i} + \exp(\delta)$ } { $t_{i} = \infty$ } } \vspace{2mm} \While{$\neg \,\mathrm{queue.isEmpty()}$}{ $i = \mathrm{queue}.pop()$\\ \If{$\neg \, \mathrm{processed}[i]$}{ $\mathrm{processed}[i] = \mathrm{True}$\\ \For{$j \in \mathrm{\Gcal'(i)}$}{ $\gamma_{m'}(t) = \beta_{m'} u(t - t_{i}) - \beta_{m'} u(t - \tau_{i})$\\ \eIf{$\mathrm{infector}[j] == \mathrm{i}$}{ $t = t_j$\\ $\gamma_m(t) = \beta_m u(t - t_{i}) - \beta_m u(t - min(\tau_i, t))$\\ $\Hcal_{m'} = \textsc{Cf}(\gamma_{m}(t), \gamma_{m'}(t), \{t\}, \beta_{max}, T)$\\ \eIf{$\Hcal_{m'} \neq \emptyset$}{ $t = \min_{t' \in \Hcal_{m'}} t'$ }{ $t = \infty$ } }{ $\Hcal, \_ = \textsc{Lewis}(\gamma_{m'}(t), \beta_{max}, T)$\\ $t = \min_{t' \in \Hcal} t'$ } \If{$t < t_j$}{ $t_j = t$\\ $\tau_j = t_j + \exp(\delta)$\\ $\mathrm{infector}[j] = i$\\ $\mathrm{queue}.add(j, \mathrm{priority} = t_j)$ } } } } \caption{It samples a counterfactual sequence of infections given a sequence of observed infections from the SIR process defined by Eq.~\ref{eq:sir}.} \label{alg:counterfactual-sir} \end{algorithm*} \DecMargin{1.2em} \section{Introduction} \label{sec:introduction} \input{010introduction} \section{Preliminaries} \label{sec:preliminaries} \input{020preliminaries} \section{A Causal Model of Thinning} \label{sec:thinning} \input{030thinning} \section{Sampling Counterfactual Events} \label{sec:superposition} \input{040superposition} \section{Experiments on Synthetic Data} \label{sec:synthetic} \input{050synthetic} \section{Experiments on Real Data} \label{sec:real} \input{060real} \section{Conclusions} \label{sec:conclusions} \input{070conclusions} \section{Acknowledgements} \label{sec:acknowledgements} We would like to thank William Trouleau for sharing with us a pre-processed version of the Ebola dataset as well as the fitted stochastic block model we used in our simulation experiments. Gomez-Rodriguez acknowledges support from the European Research Council (ERC) under the European Union'{}s Horizon 2020 research and innovation programme (grant agreement No. 945719). \bibliographystyle{unsrt}
{'timestamp': '2022-05-23T02:12:01', 'yymm': '2111', 'arxiv_id': '2111.07603', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07603'}
arxiv
\section{Background: Modular Continual Learning} \label{sec:background} Let $\mathcal{F}(x;\theta): \mathcal{X} \rightarrow \mathcal{Y}$ be a learner parametrized with a set of parameters $\theta$. In task-incremental CL, the learner is exposed to a sequence of tasks. Each task is composed of a training set $D_t$ of $(x,y)$ pairs and a task identifier (ID) $t$ % \cite{veniat2020efficient,kirkpatrick2017overcoming}. % The goal is to learn an optimal $\theta^*$ that minimizes the loss $\mathcal{L}$ for all observed tasks: \begin{align} \theta^* = \argmin_\theta \sum_{t=1}^T \mathbb{E}_{(x,y)\sim D_t} [\mathcal{L}(\mathcal{F}(x;\theta), y)]. \end{align} The parameter sharing trade-off between tasks can be addressed through different architectural design choices for $\mathcal{F}$. For example, $\mathcal{F}$ can be a monolithic network that shares parameters $\theta$ across all tasks. Most existing task incremental CL methods use a task-specific output head, requiring the task ID to select the output head corresponding to the task at hand \cite{kirkpatrick2017overcoming,serra2018overcoming,Aljundi17}. At the other end of the spectrum are the expert based solutions that learn an independent model, a.k.a. expert, for each task \cite{aljundi2017expert,rusu2016progressive}. In this case, each expert trains task-specific parameters $\theta=\{\theta^{(t)}\}_{t=1}^T$. To balance parameter sharing and transfer, modular methods organize their parameters in a series of modules $M = \{m_k^{(l)}\}$ with parameters $\theta = \{\theta_k^{(l)}\}$, where $\theta_k^{(l)}$ denotes the parameters of module $k$ at layer $l$ in $\mathcal{F}$. In general, a module can be any parametric function. In our experiments, unless otherwise stated, a module consists of a single convolutional layer followed by batch-norm, ReLU activation, and a max-pooling operation. Modules can be composed conditioned on a sample, a batch of samples, or a task. Let $\psi$ denote a specific composition of modules that gives rise to a distinct prediction function; we make this dependence explicit: $\mathcal{F}(x;\theta,\psi)$. Importantly, sharing modules across tasks should lead to desirable transfer properties. \citet{veniat2020efficient} frames modular CL as finding an optimal layout $\psi^{(t)}$ for each task, where each layout selects a single module per layer per task (hard selection): \begin{align} \theta^*&, \Psi^* = \argmin_{\theta, \Psi} \sum_{t=1}^T \mathbb{E}_{(x,y)\sim D_t} [ \mathcal{L}(\mathcal{F}(x ;\theta, \psi^{(t)}), y) ]. \end{align} In this case the set of layouts $\Psi = \{\psi^{(t)}\}$ grows with the number of tasks, while modules can be reused across different task-specific layouts resulting in sub-linear growth pattern. They design a method called MNTDP to search the exponentially large space of modular layouts by only considering layouts resulting from adding a new module per layer to the best prior path (past task's path with the highest nearest neighbor accuracy on a new task) starting at the top layer. This solution relies on task IDs to retrieve $\psi^{(t)}$ at test time. % Another way of composing modules uses dynamic routing \cite{mendez2020lifelong,rosenbaum2019routing,kirsch2018modular,meyerson2017beyond}. The module layout is generated by a structural function $\psi = s(x)$, hence different inputs take different routes through $\mathcal{F}$. It is standard to approximate the structural function using a neural network $\psi = s(x;\phi)$ with structural parameters $\phi$. This framework has been applied to CL in~\cite{mendez2020lifelong} by learning a separate structural function per task $\psi^{(t)} = s(x;\phi^{(t)})$. The task IDs are used to retrieve the correct structural function: \begin{align} \theta^*&, \Phi^* = \argmin_{\theta, \Phi} \sum_{t=1}^T \mathbb{E}_{(x,y)\sim D_t} [ \mathcal{L}(\mathcal{F}(x; \theta, s(x;\phi^{(t)})), y)], \end{align} where $\Phi = \{\phi^{(t)}\}$ is the set of structural parameters for all tasks. The above methods require task IDs at both training and testing time. Next we introduce our modular CL approach that only relies on task IDs during training. \section{Local Module Composer (LMC)}\label{sec:lmc} \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{figures/LMC_process.pdf} \caption{\textbf{Two-phase training}. Each module contains a functional (rectangle) and structural (trapezoid) component. Their color intensity denotes the strength of their activation. Components with dashed contours are trained, solid contours represent fixed components, arrows show the gradient flow: black arrow --- \textit{functional} signal, pink --- \textit{structural} signal. \textbf{(A)} All modules are trained on task 0. \textbf{(B)} Task 1 arrives, a new module is added at layer 1, which is first trained to project its output into the representation of the modules above via the \textit{structural} signal (the \textit{functional} signal is optional). No module addition is allowed during the projection phase. \textbf{(C)} Module addition is allowed again, both signals are used for training. \textbf{(D)} As task 3 arrives, a new module is added at layer 1 again, projection phase is triggered. \textbf{(E)} A new module is added at the layer 2, both new modules are now trained in the second projection phase. \textbf{(F)} Both new modules are trained using both signals.} \label{fig:schematic} \end{figure} We propose LMC, a modular approach where each module consists of a functional component $f(x;\theta_m^{(l)})$ and a structural component $s(x;\phi_m^{(l)})$, see Figure~\ref{fig:fig_1}. The functional components are responsible for learning to solve the prediction task and are trained via the usual task loss $\mathcal{L}$ (e.g.\ cross-entropy loss for classification). The structural components receive the corresponding functional output as their input (see Figure~\ref{fig:fig_1}) and are responsible for dynamic routing through $\mathcal{F}$. Structural parameters $\phi$ are trained using a structural loss $\mathcal{L}^{(st.)}$ computed locally at each module. Intuitively, the structural component of a module should serve as a density estimator of the outputs of the functional component. The module's contribution to the layer's output is proportional to the likelihood of the input sample under the estimated density. In our instantiation, the structural component produces a relatedness score: a lower score for inputs that are more likely to belong to the distribution on which a given module was trained, and a higher score for inputs that are out-of-distribution for the given module. Hence, the likelihood of the input sample is approximated by the negative relatedness score. Given an input data sample $x^{(0)}=x$, the output $x^{(l)}$ of a layer $l$ is defined as the weighted sum of the functional outputs of all $|M^{(l)}|$ local modules and used as input to the subsequent layer $l+1$: \begin{equation} x^{(l)} = \sum_{m=1}^{|M^{(l)}|} w^{(l)}_m \cdot f( x^{(l-1)};\theta^{(l)}_m) \label{eq:x_l}. \end{equation} The functional output of the network is equal to the output of the final layer: $\mathcal{F}(x;\theta,\phi)=x^{(L)}$. In the last layer $\mathcal{F}$ implements a single output-head per task. At training time, the task ID is available and we update only the output-head corresponding to the currently learned task. At test time, the task ID is not available and we select the output head with the highest activation weight $w^{(L)}_m$, i.e.,\ the last layer performs hard module selection. The module activation weights $w^{(l)}_m$ are computed by normalizing the vector of local relatedness scores $\gamma^{(l)}\in \mathbb{R}^{|M^{(l)}|}$. Each element of $\gamma^{(l)}$ is obtained from the negative structural loss which approximates the likelihood of each module: \begin{align} \gamma_m^{(l)} &= - \mathcal{L}^{(st.)}\Big(s\big[f(x^{(l-1)};\theta^{(l)}_m);\phi^{(l)}_m\big]\Big) \label{eq:gamma_l}, \\ w^{(l)}_m &= \text{softmax}(\gamma^{(l)})_m.\label{eq:w_l} \end{align} Modules with lower structural loss get higher activation weights. Note that in practice, it can be useful to bias the module selection towards the expected module selection in a batch, assuming that samples within a batch are likely to belong to the same task. We discuss this point further in \S~\ref{app:batched_module_selection}. Instead of using the softmax function, it is possible perform hard selection taking the module with the highest score \citep{rosenbaum2019routing}, or alternatively selecting top-k modules \citep{shazeer2017outrageously}. In both cases, LMC's structural parameters stay differentiable due to the local nature of structural learning. Note that in the case of global structural objective, hard module selection would require applying tools for non-differentiable learning such as Expectation Maximization~\cite{kirsch2018modular} or reinforcement-learning based methods~\cite{rosenbaum2019routing,andreas2016learning}. The overall LMC objective consists of optimizing both functional and structural losses: \begin{align} \label{eq:overall_objective} \theta^*, \phi^* & = \argmin_{\theta, \phi} \sum_{t=1}^T \mathbb{E}_{(x,y)\sim D_t} \Big[ \mathcal{L}\big(\mathcal{F}(x; \theta, \phi), y\big) + \sum_{l=0}^L \sum_{m=0}^{|M^{(l)}|} \mathcal{L}^{(st.)}_m\big(s[f(x^{(l-1)};\theta^{(l)}_m);\phi^{(l)}_m]\big)\Big]. \end{align} As in \cite{veniat2020efficient}, learning is performed w.r.t. only newly introduced modules to prevent forgetting. \paragraph{Structural component.} We test two instantiations of the structural component $s$ and loss $\mathcal{L}^{(st.)}_m$. In the first one, $s$ is an invertible neural network \citep{rezende2015variational}. Here we use the invertible architecture proposed by \citet{dinh2014nice}. As shown by \citet{hocquet2020ova}, for this invertible architecture the structural objective can be defined as $\mathcal{L}^{(st.)}_m(x)=||x||_2$. Intuitively, an invertible architecture prevents $\mathcal{L}^{(st.)}_m$ from collapsing to an all-zeros solution. In the second instantiation, $s$ and $f$ form an autoencoder and $\mathcal{L}^{(st.)}_m(x)=||x^{(l-1)} - x||^2$ is the reconstruction error with respect to the module's input $x^{(l-1)}$. \citet{aljundi2017expert} used a similar idea was for selecting the most relevant expert network conditioned on a task. Unless stated otherwise, modules in the feature extractor use the autoencoder as their structural component, while output heads use invertible $s$ --- these combinations worked well in practice. % \subsection{Expansion strategy} \label{sec:expansion_strategy} It is necessary to expand $\mathcal{F}$ as new tasks arrive to acquire new knowledge. A new module is added to a layer when all modules in this layer detect an outlier input. To this end, we track the running statistics of the relatedness score $\gamma$ for each module --- mean $\mu$ and variance $\sigma$ (see Figure \ref{fig:fig_1}), and calculate a z-score for each sample in the batch and each module at a layer: \begin{align} z_{m} = \frac{w_{m} - \mu_m}{\sigma_m} \label{eq:z_score}. \end{align} An input is considered an outlier if its z-score is larger than a predefined threshold $z^{\prime}$ (see Appendix~\ref{app:ablation_threshold} for an ablation study of $z^{\prime}$ values). The expansion decision can be made on the per-sample (i.e.,\ if an outlier sample is detected) or a per-batch basis (i.e.,\ $z$ is averaged over the mini-batch). Unless stated otherwise, in our experiments, the decision was made on a per-batch basis. Additionally, at training the parameters of existing modules are fixed once the task changes. If during a forward pass through $\mathcal{F}$ module addition is triggered at multiple layers, we start adding modules at the layer closest to the input. \subsection{Training} \label{sec:training} Each module in LMC receives two types of learning signal: a structural signal resulting from minimizing $\mathcal{L}^{(st.)}_m$, and a functional signal resulting from minimizing the global functional loss $\mathcal{L}$. All structural components $s$ are trained \textit{only} with the structural signal that is calculated locally to each module. The training of functional components proceeds in two phases: projection and accumulation. Whenever the expansion strategy triggers the addition of a new module (i.e.,\ $z_m>z^{\prime}$ $\forall m\in \{0,\dots,|M^{(l)}|\}$), starting with layers closest to the input, LMC initiates the \textit{projection phase}. During this phase, the new module is trained to minimize the structural loss from all the layers above and \textit{no new-module addition is allowed}. This procedure makes the representation of new modules compatible with subsequent modules and enables their composition. This procedure ``encourages'' already-learned modules to be reused, preventing over-spawning new modules. The functional signal is optional during projection (we kept it in all experiments unless otherwise stated). In the \emph{accumulation phase}, new module addition is allowed again and all non-frozen modules are trained with both signals. The functional components of new modules still receive a signal from the structural components of modules above. The two-phase training is explained schematically in Figure~\ref{fig:schematic} and implementation details are provided in Appendix~\ref{app:implementation_details}. \section{Conclusion} We develop LMC, a method to learn and compose a series of modules on a continual stream of tasks fulfilling some of the basic desiderata of modular CL such as module specialization, avoidance of collapse, and sublinear growth. In LMC, structural information is learned and stored locally for each module. It is the locality of the structural component that enables generalization to related but unseen tasks, and that permits combining different LMCs without fine-tuning. Future work could focus on achieving more efficient sub-linear model growth through OOD generalization and reusability of modules. Additionally, while the benefits of modularity for CL are well understood, the implications of the CL regime on modularity and compositionality have not been studied extensively. It is possible that providing knowledge to the learner in incremental chunks results in the implicit supervision needed to better disentangle it into specialized and composable modules. Another promising direction is removing the need for task boundaries during training and developing more robust architectures for the local structural component (related discussions are in Appendix \ref{app:structural_component}, and limitations in Appendix \ref{sec:limitations}). \section{Experiments} We now evaluate the performance, empirical capabilities, and properties of LMC in four different CL settings. First, in \S~\ref{sec:ctrl} we study a standard task-incremental CL setting (task-ID agnostic and aware) using the Continual Transfer Learning Benchmark (CTrL) \cite{veniat2020efficient}. Next, we explore the properties of LMC through other CL settings. In \S~\ref{sec:c_ood} we evaluate the continual OOD generalization ability of the proposed LMC. In \S~\ref{sec:pnp} we show the ability of LMC to combine modules form independently trained models. In Appendix~\ref{app:meta-cl}, we evaluate LMC in the Continual Meta-Learning setting. \subsection{Continual transfer learning using the CTrL benchmark} \label{sec:ctrl} \newcommand{\ttiny}[1]{{\fontsize{5}{5}\selectfont #1}} \newcommand{\tiny\textpm}{\tiny\textpm} \newcolumntype{g}{>{\columncolor{Gray}}c} \newcolumntype{d}{>{\columncolor{Gray}}l} \setlength{\tabcolsep}{0.8pt} \renewcommand{\arraystretch}{1} \begin{table*}[t] \centering \centerline{ \begin{scriptsize} \begin{sc} \renewcommand{\arraystretch}{1.15} \begin{tabular}{l|gcg|cgc|gcg|cgc|gcg} \toprule & \multicolumn{3}{c|}{$S^-$} & \multicolumn{3}{c|}{$S^+$} & \multicolumn{3}{c|}{$S^{in}$} & \multicolumn{3}{c|}{$S^{out}$} & \multicolumn{3}{c}{$S^{pl}$} \\ Model & $\mathcal{A}$ & $\mathcal{F}$ & M & $\mathcal{A}$ & $\mathcal{F}$ & M & $\mathcal{A}$ & $\mathcal{F}$ & M & $\mathcal{A}$ & $\mathcal{F}$ & M & $\mathcal{A}$ & $\mathcal{F}$ & M \\ \midrule HAT\tiny\citep{serra2018overcoming} & 63.7\pmt0.7 & -1.3\pmt0.6 & 24$^*$ & 61.4\pmt0.5 & -0.2\pmt0.2 & 24$^*$ & 50.1\pmt0.8 & 0.0\pmt0.1 & 24$^*$ & 61.9\pmt1.3 & -3.2\pmt1.3 & 24$^*$ & 61.2\pmt0.7 & -0.1\pmt0.2 & 20$^*$ \\ EWC\tiny\citep{kirkpatrick2017overcoming} & 62.7\pmt0.7 & -3.6\pmt0.9 & 24$^*$ & 53.4\pmt1.8 & -2.3\pmt0.4 & 24$^*$ & 56.3\pmt2.5 & -9.1\pmt3.3 & 24$^*$ & 62.5\pmt0.9 & -3.6\pmt0.9 & 24$^*$ & 54.2\pmt3.1 & -4.2\pmt2.7 & 20$^*$ \\ O-EWC\tiny\citep{schwarz2018progress} & 62.0\pmt0.7 & -3.2\pmt0.7 & 24$^*$ & 54.6\pmt0.7 & -1.3\pmt1.0 & 24$^*$ & 54.2\pmt3.1 & -10.8\pmt3.1 & 24$^*$ & 62.4\pmt0.6 & -3.0\pmt0.9 & 24$^*$ & 52.3\pmt1.4 & -5.7\pmt1.3 & 20$^*$ \\ ER\tiny\citep{rolnick2019experience,chaudhry2019continual} & 60.6\pmt0.7 & -2.1\pmt0.9 & 4$^*$ & 63.0\pmt0.6 & 3.8\pmt0.8 & 4$^*$ & 63.8\pmt1.4 & -1.9\pmt0.6 & 4$^*$ & 60.7\pmt1.0 & -1.5\pmt0.5 & 4$^*$ & 60.5\pmt1.0 & 0.5\pmt0.9 & 4$^*$ \\ \midrule \midrule Experts & 62.7\pmt0.9 & 0.0 & 24 & \textbf{63.2\pmt0.8} & 0.0 & 24 & 63.1\pmt0.7& 0.0 & 24 & 63.1\pmt0.7 & 0.0 & 24 & \textbf{63.9\pmt0.5} & 0.0 & 20 \\ MNTDP\tiny\citep{veniat2020efficient} & 66.3\pmt0.8 & 0.0 & 13.7 & 62.6\pmt0.7& 0.0 & 21.0 & 67.9\pmt0.9 & 0.0 & 16.0 & 65.8\pmt0.9 & 0.0 & 15.0 & 64.0\pmt0.2 & 0.0 & 17.2 \\ SG-F\tiny\citep{mendez2020lifelong} & 63.6\pmt1.5 & 0.0& 14.7 & 61.5\pmt0.6 & 0.0& 20.8 & 65.5\pmt1.8 & 0.0& 17.5 & 64.1\pmt1.3 & 0.0& 16.2 & 62.0\pmt1.3 & 0.0& 16.0 \\ LMC\tiny($\lnot$ A) & \textbf{66.6\pmt1.5} & -0.0\pmt0.1 & 15.3 & 60.1\pmt2.7& -1.4\pmt2.4 & 21.3 & \textbf{69.5\pmt1.0} & 0.0\pmt0.1 & 20.0 & \textbf{66.7\pmt2.2} & -0.1\pmt0.1 & 15.5 & 61.6\pmt4.8 & -3.5\pmt3.1 & 18.2 \\ \midrule MNTDP\tiny(A) & 41.9\pmt2.5 &-2.8\pmt0.6 &14.8 & 43.2\pmt1.3 & -10.8\pmt2.0& 20.7 & 32.7\pmt13.6 &-15.2\pmt13.2 &17.2 & 37.9\pmt2.7& -5.8\pmt3.5 &13.3 & 35.1\pmt3.6 & -16.4\pmt4.6 & 15.8 \\ LMC\tiny(A) & % \textbf{67.2\pmt1.5} & -0.5\pmt0.4 & 15.7 & 62.2\pmt4.5 & 2.3\pmt1.6 & 22.3 & \textbf{68.5\pmt1.7} & -0.1\pmt0.1 & 19.7 & \textbf{55.1\pmt3.4} & -7.1\pmt4.0 & 15.5 & \textbf{63.5\pmt1.9} & -1.0\pmt1.5 & 19.0 \\ LMC\tiny(A,H) & 64.9\pmt1.5 & -0.2\pmt0.2& 16.2 & 55.8\pmt2.5 & -0.3\pmt1.2 & 15.3 & 67.6\pmt2.7 & -0.8\pmt1.0 & 21.5 & 54.2\pmt3.6 & -2.9\pmt2.0 & 15.9 & 53.8\pmt5.7 &3.1\pmt5.5& 10.8 \\ SG-F\tiny(A) & 29.5\pmt3.5 & -35.3\pmt4.0 & 14.3 & 20.4\pmt4.4 & -39.3\pmt6.7 & 16.0 & 24.4\pmt5.6 & -38.7\pmt4.0 & 18.7 & 30.5\pmt4.5 & -34.0\pmt5.5 & 12.2 & 19.4\pmt1.0 & -41.8\pmt1.6 & 15.5 \\ ER\tiny(A,S)\citep{rolnick2019experience,chaudhry2019continual} & 60.4\pmt1.0 & -0.5\pmt0.7 & 4$^*$ & \textbf{65.3\pmt0.9} & 6.0\pmt1.0 & 4$^*$ & 58.8\pmt3.2 & -4.2\pmt3.7 & 4$^*$ & 47.6\pmt1.5 & -7.6\pmt1.6 & 4$^*$ & 58.6\pmt1.3 & -1.2\pmt1.5 & 4$^*$ \\ \midrule \midrule Finetune & 47.5\pmt1.5 & -14.9\pmt1.4 & 4$^*$ & 31.4\pmt3.7 & -29.3\pmt3.8 & 4$^*$ & 39.7\pmt5.0 & -23.9\pmt5.7 & 4$^*$ & 45.4\pmt4.0 & -15.5\pmt3.7 & 4$^*$ & 29.1\pmt3.1 & - 29.2\pmt3.2 & 4$^*$ \\ Finetune L & 52.1\pmt1.4 & -15.7\pmt1.7 & 24$^*$ & 38.2\pmt3.2 & -25.8\pmt3.3 & 24$^*$ & 49.3\pmt2.0 & -18.4\pmt2.0 & 24$^*$ & 49.3\pmt2.1 & -18.4\pmt2.0 & 24$^*$ & 37.1\pmt2.1 & -26.0\pmt2.2 & 20$^*$ \\ \bottomrule \end{tabular} \end{sc} \end{scriptsize} } \caption{\textbf{CTrL results:} we report accuracy ($\uparrow\mathcal{A}$), forgetting ($\uparrow\mathcal{F}$) with standard deviations calculated over 6 different runs. We report the mean number of modules (M) over these runs, where $^*$ marks methods with fixed capacity. The first block comprises a set of standard CL baselines including regularization and replay based methods. The second block are the modular methods, third -- modular and replay based methods that are task ID agnostic (A), and the last block are the two finetuning baselines. (H) indicates hard module selection. (S) indicates single-head as detailed in the main text.} \label{tab:tab1} \end{table*} The CTrL benchmark was proposed to systematically evaluate properties of CL methods with a focus on modular architectures \cite{veniat2020efficient}. It consists of 5 streams of visual image classification tasks. The first stream $S^-=(t_1^+,t_2,t_3,t_4,t_5,t_1)$ consists of a sequence of 6 tasks, where the first and last task are the same except the first has an order of magnitude more training samples (``$^+$'') than other tasks. This stream is designed to evaluate the \emph{direct transfer} ability of models, i.e.\ a modular learner should be able to \textit{reuse} the first task's modules for the last task. The $S^+=(t_1,t_2,t_3,t_4,t_5,t_1^+)$ stream is similar to $S^-$, but now the last task comes with more data than the other tasks (including the first one). Here, the modular learner should be able to \emph{update its knowledge}, i.e.\ performance on the first task should improve after learning the last task. In the $S^{in}=(t_1,t_2,t_3,t_4,t_5,t_1^{\prime})$ stream the first $t_1$ and the last $t_1^{\prime}$ tasks are similar, with a slight input distribution change (e.g.\ different background color). In the $S^{out}=(t_1^+,t_2,t_3,t_4,t_5,t_1^{\prime\prime})$ stream the first task $t_1$ and the last task $t_1^{\prime\prime}$ differ in the amount of training data and the output distribution, i.e.\ the labels of the last task are randomly permuted. % The \emph{plasticity} stream $S^{pl}=(t_1,t_2,t_3,t_4,t_5)$ evaluates the ability to learn a stream of unrelated and potentially interfering tasks, i.e.,\ transfer from unrelated tasks can harm performance. Descriptive statistics for all datasets are in Appendix~\ref{app:ctrl_streams}. We compare to several baselines. \textbf{Finetune}: trains a single model (wider model marked with \textbf{L}) for all tasks. \textbf{Experts}: trains a model per task. We also compare with the several recently proposed modular CL baselines, which achieve competitive results in CTrL and require task IDs at test time. \textbf{MNTDP}~\cite{veniat2020efficient}: a recent search-based module selection approach described in more detail in \S~\ref{sec:background}. MNTDP requires the task ID to retrieve the previously found best structure for each test task. \textbf{MNTDP\tiny(A)}: a task ID agnostic version of MNTDP we created, which selects the path with the lowest entropy in the output distribution.~ \textbf{SG-F}~\citep{mendez2020lifelong}: Soft-gating with fixed modules, a modular method mentioned in \S~\ref{sec:background}. It relies on a task-specific structural network that generates soft-gating vectors for each layer of the modular learner and fixes learned modules when new tasks arrive. We slightly adapted the original expansion strategy of SG-F in order to conform to our experimental setup; details are in Appendix~\ref{app:baseline_details}. \textbf{SG-F\tiny(A)}: a version of SG-F with a single structural network shared across tasks. \textbf{HAT}\citep{serra2018overcoming}: learns attention masks for activations that gate the gradients to prevent forgetting. The task ID is used to select a task-specific attention mask for inference. We also compare to several standard CL methods. \textbf{EWC}~\cite{kirkpatrick2017overcoming}: trains a single model for all tasks while applying parameter-regularization to minimize forgetting. \textbf{O-EWC}:\cite{schwarz2018progress} online version of EWC that does not require storing a separate approximation of the Fisher information matrix per task. \textbf{ER}~\cite{chaudhry2019continual}: trains a single model while replaying samples from previously seen tasks. The size of the replay buffer corresponds to the memory size of the LMC assuming the worse case linear growth pattern (i.e., LMC with 24 modules on a 6-task sequence). \textbf{ER\tiny(A,S)}: task ID agnostic version of ER that uses a single output head to classify all classes from all tasks: i.e.\ after learning stream $S^-$ the output head has 50 output neurons and the output classes of the last task are considered the same as the ones of the first task. We use several versions of LMC. \textbf{LMC{\tiny($\lnot$A)}} a version of LMC that uses the task ID for output head selection (not module selection as MNTDP). \textbf{LMC\tiny(A)}: the default version of LMC. It equips output heads with structural components and is therefore task ID agnostic at test time. \textbf{LMC\tiny(A,H)}: a version of task ID agnostic LMC that performs hard module selection, i.e.,\ taking the module with the highest relevance score per layer. % All methods use the same architecture (described in Appendix~\ref{app:architecture}) together with the Adam~\citep{adam2015} optimizer. HAT is the only method that uses SGD. Similar to \citet{veniat2020efficient}, we use the following evaluation metrics: ($\mathcal{A}$) \textbf{average accuracy} on all seen tasks at the end of CL training; \textbf{Forgetting} ($\mathcal{F}$) --- difference between accuracy at the end of the training and accuracy after learning the task averaged across tasks~\cite{lopez2017gradient}; \textbf{Number of modules} (M) at the end of the continual training procedure. Formal definitions of all metrics are in Appendix~\ref{app:ctrl_metrics}. Table~\ref{tab:tab1} reports performance using the CTrL benchmark. Overall, modular methods tend to outperform ER and the regularization based methods (HAT and EWC). Among the modular methods, soft-gating SG-F{\tiny(A,F)} with a single controller shared among all the tasks performed the worst. This baseline showcases the problem of forgetting in the global structural component (a.k.a. controller) of dynamic routing methods such as the one proposed by \citet{mendez2020lifelong}. A version of LMC performs the best on the $S^-$, $S^{in}$ and $S^{out}$ streams. Notably, LMC{\tiny(A)}, which does not rely on task IDs at test time, outperformed all other task ID agnostic methods such as MNTDP{\tiny(A)} and ER{\tiny(A,S)} on all streams but $S^+$, and always performed on par with task ID aware methods. On the $S^{out}$ stream low performance is expected for task-ID agnostic methods due to output distribution shift: i.e.,\ at test time we notice that LMC correctly assigns samples from the last task $t_1^{\prime\prime}$ to the first task's $t_1^+$ output head. However, the resulting classification accuracy is low because the labels of the last task are randomly permuted in this stream. The task ID agnostic LMC{\tiny(A)} outperforms task ID aware LMC on the $S^{-}$ and $S^{+}$ streams. Here, LMC{\tiny(A)} selects modules (and the output head) which were predominantly trained on the task that provided more training data (e.g.\ $t_1^+$ in $S^-$ stream), hence transferring knowledge between the first and the last tasks. In contrast, LMC{\tiny($\lnot$A)} when tested on the last task $t_1$ is forced to select the output head belonging to this task, which was trained on less data than the output head of $t_1^+$ task, leading to lower accuracy. In addition, we observed that versions of LMC often exhibit high variance (e.g. see $S^+$, $S^{out}$ and $S^{pl}$ streams). This may be caused by the larger amount of trainable parameters compared to other models and relatively small amount of training data. Finally, low performance of LMC{\tiny(A,H)} emphasizes the importance of soft modular attention for LMC. Additional results, including a transfer metric~\cite{veniat2020efficient}, are in Appendix~\ref{app:transfer_ctrl}. \begin{figure}[!t]% \centering \begin{subfigure}[t]{0.24\textwidth} \centering \includegraphics[height=1.07\textwidth]{figures/confusion_ewc.pdf} \caption{EWC} \label{fig:ood-ewc} \end{subfigure} \begin{subfigure}[t]{0.24\textwidth} \centering \hfill \includegraphics[height=1.07\textwidth]{figures/confusion_mntdp.pdf} \caption{MNTDP} \label{fig:ood-mntdp} \end{subfigure} \begin{subfigure}[t]{0.24\textwidth} \centering \includegraphics[height=1.07\textwidth]{figures/confusion_lmc.pdf} \caption{LMC{\tiny($\lnot$A)}} \label{fig:ood-lmc} \end{subfigure} \begin{subfigure}[t]{0.24\textwidth} \centering \includegraphics[height=1.08\textwidth]{figures/confusion_lmc_no_projection.pdf} \caption{LMC{\tiny($\lnot$A)} (no proj.)} \label{fig:ood-lmc_no_projection} \end{subfigure} \caption{Continual OOD-generalization: matrices show test accuracy on seen and unseen tasks (on- and off-diagonal tasks respectively). In each sub-figure x-axis shows the MNIST class-combination used to build the task, y-axis gives the foreground-background colors. Only diagonal tasks are learned continually. While non-modular EWC (a) and modular MNTDP (b) can prevent forgetting, LMC{\tiny($\lnot$A)} (c) is able to generalize to OOD tasks as well. LMC{\tiny($\lnot$A)} without projection phase performs poorly as shown in (d).}% \label{fig:ood_confusion} \end{figure} \subsection{Compositional OOD generalization} \label{sec:c_ood} This second study tests the ability of LMC to recombine modules for OOD generalization. We use a colored-MNIST dataset --- a variation of the standard MNIST dataset of hand-written digits from 0 to 9~\cite{kim2019learning} in which digits are colorized. We design a simple sequence of tasks as follows. First, we define two high-level features: the foreground-background color combination (using the colors red, black, green, blue) and the class (0--9). Then, we create five non-overlapping tasks of two (digit) classes each: \{\texttt{0--1, ..., 8--9}\}. At training time the model is continually trained using a sequence of these tasks, however, each task is only seen in one of five different foreground-background combinations \{\texttt{red-black, green-black, blue-black, black-red, black-green}\}. At test time we measure the generalization ability to seen and unseen combinations of classes and colors. In Figure~\ref{fig:ood_confusion} we present the accuracy matrices for different learners when tested on all 25 combinations of colors and classes after it has been trained only on the 5 tasks on the diagonal. We compare the performance of LMC{\tiny($\lnot$A)} with EWC~\cite{kirkpatrick2017overcoming}, MNTDP~\citep{veniat2020efficient}, and an ablated version of LMC without the projection phase. We observe that the OOD accuracy attained by LMC is significantly higher than EWC and MNTDP. Since the model trained with EWC is monolithic, the digit-background color combinations are entangled with the digits' shape for each task, hindering OOD generalization. % In contrast, modular approaches such as MNTDP and LMC learn a different module combination for each task. In contrast to MNTDP, LMC's module selection does not rely on task identifiers and each module is selected in a local manner based on its compatibility with the current input. This allows LMC to interpolate between previously seen tasks being able to dynamically compose existing modules to adapt to tasks that have not been seen at training. Because MNTDP's module selection relies on a database of task-specific structures found to be optimal for the corresponding task at training, this method must reuse the predefined module compositions based on task IDs. This forces MNTDP to use modules that were trained using a different color combination, and results in e.g.\ a $24\%$ accuracy drop with respect to LMC on \texttt{[0,1]} when the foreground and background colors are inverted w.r.t. the seen combination. In Figure~\ref{fig:ood-lmc_no_projection} we report results for LMC without applying the projection phase. The projection phase adapts the representation of newly introduced modules to match the distribution expected by the subsequent modules. As expected, we found that skipping it severely degrades performance. This result validates the usefulness of the projection phase to achieve an efficient local module selection. In Appendix~\ref{app:ood} we plot the average module selection for all 25 test tasks, showing how modules are reused for the OOD tasks. \subsection{Combining modular learners} \label{sec:pnp} \begin{wrapfigure}{r}{.5\textwidth} \begin{minipage}{\linewidth} \centering \includegraphics[width=\linewidth]{figures/pnp.pdf} \end{minipage} \caption{Performance of combining independently trained LMC1 and LMC2 into LMC3.} \label{fig:pnp} \end{wrapfigure} In earlier sections we show cross-task reusability of modules, here we test the cross-model reusability. We motivate the practical importance of this kind of reusability with a federated learning example: a privacy preserving training might be required for LMC1 and LMC2, trained on the premises of customers 1 and 2, after which their modules can be combined in a single central entity --- LMC3, located on premises of the cloud service provider. LMC3 is required to perform tasks seen by both independent LMCs but can not be finetuned as it has no access to the original training data distributions. % In Figure~\ref{fig:pnp} we test the ability of LMC to preserve and transfer knowledge in such setting. To this end, we design the following tasks: fMNIST+ and fMNIST-. Both are sampled from the fashion-MNIST dataset \citep{xiao2017fashion} but the latter comes with an order of magnitude less training data. cMNIST-\textbf{r} is a variant of the colored-MNIST dataset where the background of 95\% of the training samples is colored in \textbf{r}ed and 5\% in \textbf{g}reen. For the cMNIST-\textbf{g} dataset these proportions are inverted and 95\% of the training samples is colored in \textbf{g}reen. The test set contains 50\% of samples with green and 50\% with red background. We trained LMC1 continually on MNIST, fMNIST+, and cMNIST-r tasks. We trained LMC2 on fMNIST-, cMNIST-g, and SVHN. We then combined the modules of both LMCs layer-wise to obtain LMC3. We observed positive transfer for both cMNIST and fMNIST- tasks with LMC3. We found that LMC3 selects different modules originating from different LMCs conditioned on test samples with different background colors --- LMC1's modules were specialized on red background while LMC2's on green (selected paths presented in Appendix~\ref{app:combining_independent_models}). Notably, cross-model reusability without fine-tuning is novel to LMC and can be attributed to the local nature of the structural component. Using a global structural component as in \citep{mendez2020lifelong} would require tuning a separate structural component specifically for LMC3. In case of task-specific routing of proposed for MNTDP~\citep{veniat2020efficient}, additional search would be needed to discover task-specific paths through the consolidated LMC3 model. In both cases the access to the orinal training data distributions would be required and privacy would not be preserved. \subsection{Longer task sequences} \label{sec:longer_sequence} \begin{figure}% \centering \subfloat[\centering 30 tasks sequence $S^{long30}$]{{\includegraphics[width=0.44\textwidth]{figures/acc_module_30t_2.pdf} }}% \qquad \subfloat[\centering 100 tasks sequence $S^{long}$]{{\includegraphics[width=0.44\textwidth]{figures/acc_module_100t_2.pdf} }}% \caption{Results on $S^{long}$ and $S^{long30}$ sequences for different hyperparameter values (we select only runs with reasonably good performance, i.e. $\mathcal{A}$>60\%), same plots plots for all conducted runs can be found in Appendix~\ref{app:long_modules_vs_acc}).}% \label{fig:acc_nmodules_slong}% \end{figure} Here we study the performance LMC on longer task sequences consisting of 30 -- $S^{long30}$, and 100 -- $S^{long}$ tasks. The $S^{long}$ sequence corresponds to the one proposed by~\citet{veniat2020efficient} as part of the CTrL benchmark. $S^{long30}$ is a 30-tasks subset of $S^{long}$ (see Appendix~\ref{app:ctrl_streams} for details). We first report the average test accuracy ($\mathcal{A}$) and the total number of modules (M) of the models selected through cross-validation. $S^{long30}$: MNTDP $\mathcal{A}$=64.58, M=64; {LMC\tiny($\lnot$A)}: $\mathcal{A}$=62.44, M=50. $S^{long}$: MNTDP $\mathcal{A}$=68.92, M=142; LMC{\tiny($\lnot$A)}: $\mathcal{A}$=63.88, M=32. While the gap between the accuracy of LMC and MNTDP on $S^{long30}$ is only $1.86$\%-points, in the case of $S^{long}$ this gap grows to $6.58$\%-points. It is important to highlight that in contrast to LMC, MNTDP's module selection is performed by a task ID aware oracle. We further analyze the trade-off between the number of modules and accuracy in Figure~\ref{fig:acc_nmodules_slong}, where we plot the number of modules (M) against average test accuracy ($\mathcal{A}$) for models that resulted from training with different hyperparameters. For both streams, we observe that LMC tends to spawn much fewer modules than MNTDP. However, MNTDP shines in the presence of large number of modules and achieves higher overall test accuracy on these streams. Interestingly, as can be clearly observed on the $S^{long}$ stream, LMC reaches higher accuracy with smaller number of modules: e.g.\ $\sim$64\% with 32 modules, while adding modules leads to lower accuracy: e.g.\ $\sim$61\% with 98 modules. This result suggests that local task ID agnostic module selection becomes more challenging for LMC in presence of a large number of modules. \section{Related work} \textbf{Modularity in neural networks} is studied in the context of scalability~\cite{ballard1987modular}, and more recently as a way to achieve compositionality and systematic generalization~\cite{andreas2016neural,kirsch2018modular, chang2018automatically, bahdanau2018systematic, goyal2019recurrent, csordas2020neural} as well as for multi-task learning~\cite{meyerson2017beyond,rosenbaum2019routing}. From the causal point of view, a data generation process could be thought as a composition of independent causal modules~\cite{pearl2009causality}. Researchers model these kinds of systems using a set of independent modules, where each module is invariant to changes in the other modules induced by e.g.\ distribution shifts~\cite{scholkopf2012causal, peters2017elements}. This idea is crystallized by~\citet{parascandolo2018learning}, who propose a way to learn a set of causal independent mechanisms as mixture-of-experts. Building up on this ideas, others show evidence of compositional OOD generalization~\cite{madan2021fast}. Recently, \cite{mundt2020wholistic} argue for a more wholistic view on CL including OOD generalization as an important desiderata. % \textbf{Continual learning} methods typically address the problem of forgetting through parameter regularization ~\cite{kirkpatrick2017overcoming,Nguyen17,zeno2018task}, replay~\cite{soltoggio2015short,rebuffi2017icarl, Aljundi2019Online,ostapenko2019learning,lesort2018generative, caccia2019online, wu2018memory, isele2018selective, rolnick2019experience, caccia2021reducing} or dynamic architectures (and MoEs)~\cite{rusu2016progressive,serra2018overcoming,Dyn_expand_net_Lee,schwarz2018progress,lee2020neural,jerfel2019reconciling}. Our work falls under the umbrella of the latter and shares its advantage of having the capacity to adapt to a large number of related tasks. Our focus is on improving \textbf{modular CL} approaches, which despite their advantages, have only recently been studied in the CL literature~\cite{mendez2020lifelong,veniat2020efficient}. The main difference with our work is that we use a local composition mechanism instead of a global one. We detail this difference in \S\ref{sec:background} and also compare to these methods in \S\ref{sec:ctrl}. \textbf{Continual-meta learning} focuses on fast learning and remembering~\cite{finn2019online,he2019task,harrison2019continuous,jerfel2019reconciling}, often emphasising the online performance on OOD tasks~\cite{caccia2020online}. As argued by \citet{jerfel2019reconciling} modularity can be useful in this setting to minimize interference between tasks. They proposed a way to train a MoE model, with each expert focusing on a cluster of tasks leveraging Bayesian nonparametrics. LMC aims at decomposing knowledge into layer-wise composable modules further reducing modular granularity. Continual-meta learning is often confused with its counterpart \emph{meta-continual learning} \citep{javed2019oml,caccia2021special,von2021learning}, in which algorithm are learning to continually learn. The rapid growth of continual learning has lead researchers to work on empirical studies \citep{de2019continual,Lomonaco2020CVPR2C, lesort2021continual}, surveys \citep{hadsell2020embracing,khetarpal2020continual,lesort2021understanding, mundt2020wholistic,mundt2021clevacompass} as well as CL-specific software \citep{normandin2021sequoia, Douillard2021ContinuumSM, lomonaco2021avalanche}. \section{Introduction} The goal of continual learning (CL) is to learn efficiently from a non-stationary stream of tasks without (catastrophically) forgetting previous tasks~\cite{mccloskey1989catastrophic}. CL is often modeled as a trade-off between knowledge retention (stability) and knowledge expansion (plasticity) \cite{french1997pseudo,mermillod2013stability}. Parameter sharing can provide control over this trade-off. For example, learning a single model shared across tasks results in better knowledge transfer and faster learning at the expense of forgetting~\citep{kirkpatrick2017overcoming,li2017learning}. Conversely, learning a separate model per task eliminates forgetting but minimizes transfer and data efficiency~\citep{aljundi2017expert,jerfel2019reconciling}. Modular learning aims at balancing transfer and forgetting by learning a set of specialized modules that can be recomposed to solve (new) tasks while only updating a subset of relevant modules or adding new modules~\citep{andreas2016neural,kirsch2018modular,goyal2019recurrent}. In principle, a modular learner capable of composing modules in meaningful structures can provide additional benefits including \textbf{(i)} computational gains due to only executing modules that are relevant to a task~\cite{kirsch2018modular,amer2019review}; \textbf{(ii)} memory gains due to instantiating a sub-linear number of modules w.r.t. the number of tasks; \textbf{(iii)} systematic~\cite{bahdanau2018systematic} and out-of-distribution (OOD) generalization~\cite{corona2020modularity} through knowledge recombination; % and \textbf{(iv)} biological plausibility~\cite{sternberg2011modular, sporns2016modular,whittington2017approximation}. Designing modular methods for CL comes with two main challenges. The first is \emph{how and when to add new modules} to ensure sufficient plasticity to learn new tasks. Existing modular methods use greedy search variants, expanding the model when it improves validation performance~\citep{veniat2020efficient,mendez2020lifelong}. The second challenge is \emph{how to compose} that is, retrieve task-specific structural knowledge given a new task (previously seen or not). Existing methods rely on a task's identifier (ID) to retrieve task-specific structural knowledge, which comes either in the form of an optimal module layout~\cite{veniat2020efficient} or as a model- and task-specific controller network that generates modular layouts~\cite{mendez2020lifelong}. Unfortunately, in many realistic CL scenarios task identities are unavailable at test time~\cite{Farquhar18,he2019task,caccia2020online}. Lifting this limitation is challenging since standard mechanisms for task inference, for example, leveraging a task-inference model, could be subject to forgetting themselves. To address both challenges, we equip each module with a \emph{local structural component} that predicts a score indicating how relevant the module is for a given input. In-distribution inputs result in high scores, while out-of-distribution inputs result in low scores. In other words, modules self-determine their relevance given an input. This local component is used for composing modules: for each datum, modules are combined at each layer according to their normalized scores without requiring a task's ID (\S\ref{sec:lmc}). The local component is also used for module expansion: a new module is instantiated if all the current modules flag their input as being locally out-of-distribution (\S\ref{sec:expansion_strategy}). Further, new shallow modules (i.e. closer to the input) are first trained in a \emph{projection phase} to maximize the relatedness scores of subsequent, deeper, modules (\S\ref{sec:training}). This process projects the output of new modules into the representation space expected by the subsequent modules and ensures the compatibility between low- and high-level modules. In a set of studies, we explore the performance and versatility of our local structural approach, which we call Local Module Composer (LMC). First, we show that LMC reaches superior or comparable performance to existing modular and non-modular methods without requiring task IDs at test time using the Continual Transfer Learning (CTrL) benchmark, designed to evaluate transfer and forgetting in CL~\cite{veniat2020efficient} (\S\ref{sec:ctrl}). Then, we demonstrate how LMC, relying on its projection phase, can solve out-of-distribution (OOD) tasks not seen during the continual training (\S\ref{sec:c_ood}). We also show it is possible to combine modules from independently trained models into a new model to solve tasks seen by each of the independent models without any finetuning (\S\ref{sec:pnp}). Finally, an analysis of longer task sequences (30 and 100 tasks) reveals that LMC tends to spawn much fewer modules to reach good performance than the fully task-aware MNTDP~\cite{veniat2020efficient} counterpart. However, LMC reaches slightly lower accuracy on longer sequences than MNTDP, which highlights the difficulty of automatic task-ID agnostic module selection in the presence of a large number of candidate modules. In Appendix~\ref{app:meta-cl} we demonstrate the applicability of LMC in the meta-continual learning (meta-CL) setting, a task-agnostic setting by nature. % We highlight that by relying on a local (per-module) structural component, LMC offers a modular CL approach that i) does not require task IDs during test in the standard task incremental settings; ii) balances parameter sharing to yield strong CL performances compared to baselines that require access to the task ID; iii) in our experiments instantiates a sub-linear number of modules; iv) permits recombination of modules at test time enabling OOD generalization as well as (v) the ability to combine independently trained models in a third model without fine-tuning. Notably, the OOD generalization is only possible if the agent is task-agnostic in the module selection process, since OOD tasks were not observed at training, the learner has to interpolate between the learned tasks, and a (categorial) task ID is of no use. \section{Implementation and Algorithm details} \label{app:implementation_details} \subsection{Batched modularity} \label{app:batched_module_selection} Activation weights $w_m^{(l)}$ can be calculated separately for each data point. However, in batched regimes sometimes it can be assumed that module selection for samples in the same batch is likely to be similar.\footnote{E.g in case of locally stationary data distribution, samples seen together are likely to belong to the same task} This can be incorporated into LMC by redefining $w^{(l)}_m$ as: \begin{align} &w^{(l)}_m =\frac{1}{Z(w)} \text{softmax}(\gamma^{(l)},\tau )_m \cdot \mu_{w,m}^{(l)}, \label{eq:w_l_batch}\\ &\mu_{w,m}^{(l)}=\mathbb{E}_{x_i\in b}\big(\text{softmax}(\gamma^{(l)}, \tau^\prime)_m\big), \end{align} where $Z(w)$ is the normalization term, $b$ denotes a batch of samples, $\tau$ and $\tau^\prime$ are the temperature hyperparameters. Lower $\tau^\prime$ would results in a stronger bias towards the expected selection $\mu_w^{(l)}$. \subsection{Training with projection phase} \label{app:projection_phase_details} The intuition behind the modular training with projection phase is the following: every time a new module addition is triggered (using the mechanism proposed in \S~\ref{sec:expansion_strategy}), we start by only adding modules on the deepest layer --- i.e.\ the one closest to the input. Then, in the \textit{projection phase}, we train this module for some time using the signal coming from the structural components of the modules above (possibly combined with the training signal of the downstream task). Projection phase makes sure that the learner first tries to efficiently \emph{reuse} the existing modules (the once above the newly added one) by trying to project it's output into the representation space expected by those modules. After some time the learner is allowed to add new modules again. If the previously added module was not enough to incorporate the distribution shift that caused the previous module addition, new module addition will be triggered in the layers above. We detail this procedure in the Algorithm~\ref{algo:lmc} and~\ref{algo:forward}. Additionally, for modules that recognize current input as outlier in the forward pass, we set their contribution for the current batch to zero (ll.14 in Algorithm~\ref{algo:forward}). This ensures that the newly added modules get enough training signal to learn. \centerline{ \scalebox{0.85}{ \begin{minipage}{0.55\linewidth} \setlength{\textfloatsep}{2mm} \begin{algorithm2e}[H] \small \SetAlgoLined \DontPrintSemicolon \textbf{Require:} $k$ projection phase length, stream $S$, $z$-score threshold $z^{\prime}$\\ \textbf{Initialize} Learner $\mathcal{F}_{\theta,\phi}$ \\ \For{ $t = 0 ... |S|$}{ $D_t \leftarrow$ get dataset for task $t$ \\ \For{e = 0 ... total epochs }{ \ForEach{ mini-batch $b \in D_t$}{ $X,y \leftarrow \text{mini-batch of samples}$ \\ $\hat{y}, \ell^{str.} \leftarrow \text{Forward Model}(\mathcal{F}_{\theta,\phi}, X, z^{\prime}, t)$ \\ \uIf{\text{new module added in last $k$ epochs}}{ \tcp{projection phase} $\ell = \ell^{(str.)}$\\ \uIf{\text{use functional loss in projection}}{ $\ell += \mathcal{L}^{(fnc.)}(\hat{y}, y)$ } }\uElse{ $\ell = \mathcal{L}^{(fnc.)}(\hat{y}, y)+\ell^{(str.)}$ \\ } Update parameters $\theta, \phi$ using $\nabla_{\theta,\phi} \ell$ } } \ForEach{module $m \in \mathcal{F}$}{ \text{Fix structural parameter $\phi$ of module $m$} } } \caption{Modular training with projection} \label{algo:lmc} \end{algorithm2e} \end{minipage} \hspace{1em} \begin{minipage}{0.55\linewidth} \setlength{\textfloatsep}{3mm} \begin{algorithm2e}[H] \small \SetAlgoLined \DontPrintSemicolon \textbf{Require:} Learner $\mathcal{F}_{\theta,\phi}$ with $L$ layers, batch $X$, $z$-score threshold $z^{\prime}$, task index $t$\\ \textbf{Output:} logits $\hat{y}$, structural loss $\ell^{(st.)}$ \\ $x^{(0)}=X$\\ $\ell^{(str.)}=0$\\ \For{$l \in L$}{ Let $M^{(l)}$ denote a set of modules at layer $l$\\ Calculate:\\ $\gamma^{(l)}\in \mathbb{R}^{|M^{(l)}|\times|X|}$ using Eq.~\ref{eq:gamma_l},\\ $w^{(l)}\in \mathbb{R}^{|M^{(l)}|\times|X|}$ using Eq.~\ref{eq:w_l_batch} or~\ref{eq:w_l},\\ $z^{(l)}\in \mathbb{R}^{|M^{(l)}|\times|X|}$ using Eq.~\ref{eq:z_score}, average over $|X|$\\ $x^{(l)}$ using Eq.~\ref{eq:x_l} \\ \uIf{$t>0$}{ \ForEach{$m\in M^{(l)}$}{ \uIf{$z^{(l)}_m > z^\prime$}{ \uIf{\text{module was added at layer $l$ during task $t$}}{ $w^{(l)}_m=\vec{0}$ \tcp{does not use outlier modules} } \uElseIf{\text{\textbf{no} module added in last $k$ epochs}}{ \tcp{not in the projection phase} Fix all modules at layer $l$ \\ Add a new free module to layer $l$\\ } } } } $\ell^{(str.)} = \ell^{(str.)} - \sum_m \text{\textit{sum}}\{\vec{\gamma}^{(l)}_m \odot \vec{w}^{(l)}_m\} $\\ } $\hat{y}=x^{(L)}$ \\ \Return $\hat{y}, \ell^{(str.)}$ \caption{Forward Model} \label{algo:forward} \end{algorithm2e} \end{minipage} } } \subsection{Structural component}\label{app:structural_component} In practice, we applied the $log$-operation to the structural loss for both choices of the structural component, which resulted in a more stable training procedure. \subsubsection{Invertible architectures} Invertible architectures, such as the one proposed by \citet{dinh2014nice}, can be used to model high-dimensional density after mapping the data in a space with some desirable factorization properties. We use this idea here to directly approximation of the activation likelihood of a module $m$. More specifically, \cite{hocquet2020ova} show that maximizing the likelihood of a module under such invertible transformation is equivalent to minimizing the $L_2$ norm of the output of structural component $s(o; \phi_m)$, yielding the local structural objective: \begin{equation} \mathcal{L}^{(str.)}_m(x) = ||x||^2. \end{equation} To satisfy the invertibility constraint \cite{dinh2014nice} propose to split the input $o$ into blocks of equal size $o_1$ and $o_2$ and apply two, not necessarily invertible, transformations $s_1$ and $s_2$ as: \begin{equation} \label{eq:structural_output} \begin{split} a_1 = s_1(o_2;\phi_{2,m}) + o_1, \\ a_2 = s_2(a_1;\phi_{1,m}) + o_2. \end{split} \end{equation} The output of structural component $a$ is obtain through the concatenation of $a_1$ and $a_2$. Importantly, the input and output of the structural component have the same dimensionality $a_m, o_m \in \mathbb{R}^k$. The inverse can be obtained as: \begin{equation} \label{eq:s_1_s_2} \begin{split} o_2 = a_2 - s_2(a_1;\phi_{2,m}), \\ o_1 = a_1 - s_1(o_2;\phi_{1,m}). \end{split} \end{equation} Intuitively, the invertibility constraint prevents $a_1$ and $a_2$ from collapsing to the solution of outputting $0$-vectors, which would be useless. \subsubsection{Other possible choices of structural component} The role of structural component in LMC is to detect in-distribution and out-of-distribution samples for each module. It is natural to consider density estimates produced by deep generative models (DGM) for this task. In this work we only considered a simple encoder-decoder based architecture and a simple flow-model. Applying other more complex DGMs such as VAEs~\citep{kingma2013auto} or flow-based~\citep{behrmann2019invertible,kobyzev2020normalizing} models might further improve the efficacy of local structural component. Nevertheless, such models also come with their challenges, which include calibration difficulties as well as low data efficiency~\citep{wang2020further}. \subsection{Architecture details}\label{app:architecture} Unless otherwise stated, we initialize the learner with a single module per layer, each learned consist of 4 layers. The used architecture of each module is detailed in Table~\ref{tab:architectures}. For the CTrL experiments we used invertible structural component for the task-specific output heads (classifiers) in task ID agnostic LMC(A), while for feature extracting trunk we used an encoder-decoder architecture (i.e. structural component tasked to reconstruct the module's input). Unless stated otherwise, architectures used for all baselines closely resemble the architecture used by LMC. Thus, by default all baselines contain 4 layers with each layer's architecture and parameter count being equivalent to the architecture and the parameter count of the functional component of an LMC module. In modular baselines (MNTDP, SG-F) each module corresponds to the functional component of the LMC's module. Some of the fixed capacity baselines in Table~\ref{tab:tab1} (e.g. HAT, EWC, Finetune L) where initialized with the layer width scaled up to match the parameter count of the largest possible modular network (e.g. in case of linear growth with one new module per layer per task the largest possible modular network in our framework would have 24 modules in a 6 tasks sequence). \begin{table*}[!htb] \caption{Used architectures per module: column 'layer $\mathcal{F}$' refers to the index of the layer in the modular learner $\mathcal{F}$ (i.e. 0 is the closes layer to the input), while 'layer m' gives the layer index within the module. Note, both linear layers in (c) are used in parallel as proposed in \citep{dinh2014nice} (i.e. $s_1$ and $s_2$ from Eq.~\ref{eq:s_1_s_2}).} \begin{minipage}{1\linewidth} \begin{minipage}{.5\linewidth} \centering \setlength{\tabcolsep}{0.8pt} \begin{scriptsize} \begin{tabular}{l|c|c|ccccc} \toprule \multicolumn{8}{c}{Functional component} \\ \midrule Type & layer $\mathcal{F}$ & layer m & \#params. & \#out ch. & stride & padding & kernel \\ \midrule Conv. & 0 & 0 & 1792 & 64 & 1 & 2 & 3\\ Conv. & 1-3 & 0 & 36928 & 64 & 1 & 2 & 3\\ Batch norm & all & 1 & 128 & - & - & - \\ ReLu & all & 2 & - & - & - & - \\ Max. Pool & all & 3 & - & - & - & 2 & 2 \\ \toprule \end{tabular} \end{scriptsize} \end{minipage}% \begin{minipage}{.5\linewidth} \centering \setlength{\tabcolsep}{0.8pt} \begin{scriptsize} \begin{tabular}{l|c|c|ccccc} \toprule \multicolumn{8}{c}{Structural component (decoder)} \\ \midrule Type & layer $\mathcal{F}$ & layer m &\#params. & \#out ch. & stride & padding & kernel \\ \midrule ConvTranspose2d & all & 0 & 16448 & 64 & 2 & 2 & 2 \\ Batch norm & all & 1 & 128 & - & - & - \\ ReLu & all & 2 & - & - & - & - \\ Conv. & all & 3 & 65600 & 3 & 1 & 1 & 3\\ Sigmoid & all & 4 & - & - & - & - \\ \toprule \end{tabular} \end{scriptsize} \end{minipage} \end{minipage} \begin{minipage}{1\linewidth} \centering \begin{minipage}{.5\linewidth} \centering \setlength{\tabcolsep}{0.8pt} \begin{scriptsize} \begin{tabular}{l|c|c|cccc} \toprule \multicolumn{5}{c}{Structural component (invertible)} \\ \midrule Type & layer $\mathcal{F}$ & layer m & \#params. & \#input & \#output \\ \midrule Input $L_2$ Norm. & output head & 0 & - & - \\ Linear & output head & 1 & 83232 & 288 & 288 \\ Linear & output head & 1 & 83232 & 288 & 288 \\ \toprule \end{tabular} \label{tab:architectures} \end{scriptsize} \end{minipage} \end{minipage} \end{table*} \subsection{Dealing with batch-norms and data normalisation} While batch normalization~\citep{ioffe2015batch} is a useful device for accelerating the training of neural networks, it comes with challenges when it comes to settings with shifting data distribution such as meta-~\citep{antoniou2018train} and continual learning. Specifically, in continual learning when testing on the previously seen tasks after new tasks have been learned, the batch norm will change its statistics resulting in forgetting even if the parameters of the network have not been changed~\cite{gupta2020unreasonable}. We highlight several ways to deal with it. One way is to warm-up batch norm before testing on previous tasks by performing several forward passes through the model with unlabeled test data to let batch norms ``relearn'' the task statistics. This assumes that the test data is available in high quantity at test time (i.e. we cannot warm-up batch-norm with a single test sample). Another way is to fix batch norms completely after a task has been learned. In monolithic architectures, such fixing might limit the plasticity of the network and prevent the learning of new tasks. In modular architectures, however, batch norms of frozen modules can be kept frozen while new module's batch norms can keep learning resulting in a balance between stability and plasticity. In monolithic architecture which are task-ID aware at test time, a separate batch-norm layer can be used per task. In modular methods we fixed the batch norms whenever the modules are fixed (e.g. after learning a task in LMC and MNTDP). In HAT we used a separate batch-norm per task, as using a single batch-norm resulted in high forgetting rates. For other non-modular methods (e.g. EWC, ER) we used a single batch-norm layer for all tasks. Additionally, we observed that monolithic methods that share batch-norms across tasks result in high forgetting rate if no data normalisation is performed (and no batch-norm warm-up before testing). In the CTrL experiments we normalised tasks' data for all methods but LMC using statistics calculated on each task separately. In these experiments LMC performed better on not normalised data. In the OOD generalization experiment on cMNIST we normalised data also for LMC. Additionally, we performed batch-norm warm before testing in the OOD experiments. In meta-CL (\S~\ref{app:meta-cl}) the batch norms do not keep the estimates of running statistics ($track\_running\_stats$ is set to False) and momentum is set to 1. \bgroup \section{Continual Transfer Learning (CTrL)}\label{app:ctrl} \subsection{Streams used} As in \cite{veniat2020efficient}, all input samples were reshaped to a 32 x 32 pixels resolution. We normalized for all methods but LMC unless otherwise stated. We did not use any data augmentation techniques. The datasets used for the first 5 streams are described in the Table~\ref{tab:split_details}, datasets used for the streams $S^{long30}$ and $S^{long}$ are described in the Table~\ref{tab:split_details_long_1} and Table~\ref{tab:split_details_long_2}. \label{app:ctrl_streams} \begin{table*}[ht] \centering \centerline{ \begin{scriptsize} \begin{sc} \renewcommand{\arraystretch}{0.7} \begin{tabular}{l|lcccccc} \toprule Stream & & $T_1$ & $T_2$ & $T_3$ & $T_4$ & $T_5$ & $T_6$ \\ \midrule \multirow{3}{0.5cm}{$S^+$} & \textbf{Datasets}& Cifar-10\citep{krizhevsky2009learning} & MNIST\citep{lecun-mnisthandwrittendigit-2010} & DTD\citep{cimpoi14describing} & F-MNIST\citep{xiao2017fashion} & SVHN\citep{netzer2011reading} & Cifar-10 \\ & \textbf{$\#$Train samples} & 4000 & 400 & 400 & 400 & 400 & 400 \\ & \textbf{$\#$Val. samples} & 2000 & 200 & 200 & 200 & 200 & 200 \\ \multirow{3}{0.5cm}{$S^-$} & \textbf{Datasets} & Cifar-10 & MNIST & DTD & F-MNIST & SVHN & CIFAR-10 \\ & \textbf{$\#$Train samples} & 400 & 400 & 400 & 400 & 400 & 4000 \\ & \textbf{$\#$Val. samples} & 200 & 200 & 200 & 200 & 200 & 2000 \\ \multirow{3}{0.5cm}{$S^{in}$} & \textbf{Datasets} & R-MNIST & Cifar-10 & DTD & F-MNIST & SVHN & R-MNIST \\ & \textbf{$\#$Train samples} & 4000 & 400 & 400 & 400 & 400 & 50\\ & \textbf{$\#$Val. samples} & 2000 & 200 & 200 & 200 & 200 & 30 \\ \multirow{3}{0.5cm}{$S^{out}$} & \textbf{Datasets} & CIFAR-10 & MNIST & DTD & F-MNIST & SVHN & Cifar-10 \\ & \textbf{$\#$Train samples} & 4000 & 400 & 400 & 400 & 400 & 400 \\ & \textbf{$\#$Val. samples} & 2000 & 200 & 200 & 200 & 200 & 200 \\ \multirow{3}{0.5cm}{$S^{pl}$} & \textbf{Datasets} & MNIST & DTD & F-MNIST & SVHN & Cifar-10 & \\ & \textbf{$\#$Train samples} & 400 & 400 & 400 & 400 & 4000 & \\ & \textbf{$\#$Val. samples} & 200 & 200 & 200 & 200 & 2000 & \\ \toprule \end{tabular} \end{sc} \end{scriptsize} \caption{Details on the datasets and training/validation data amounts for the used streams~\citep{veniat2020efficient}.} \label{tab:split_details} } \end{table*} \egroup \begin{table*}[ht] \centering \centerline{ \begin{scriptsize} \begin{sc} \renewcommand{\arraystretch}{0.7} \begin{tabular}{l|ccccc} \toprule Task & Dataset & Classes & \# Train & \# Val & \# Test \\ \midrule 0 & cifar10 & deer, truck, dog, cat, bird&25 & 15 & 5000 \\ 1 & mnist & mnist 6 - six,0 - zero,7 - seven,8 - eight,4 - four&5000 & 2500 & 4894 \\ 2 & fashion-mnist & Coat, Bag, Trouser, Dress, T-shirt/top&5000 & 2500 & 5000 \\ 3 & svhn & svhn 9 - nine,8 - eight,4 - four,0 - zero,6 - six&25 & 15 & 5000 \\ 4 & cifar100 & worm, possum, aquarium fish, orchid, lizard&25 & 15 & 500 \\ 5 & cifar10 & frog, automobile, cat, truck, dog&5000 & 2500 & 5000 \\ 6 & svhn & svhn 3 - three,1 - one,5 - five,4 - four,7 - seven&25 & 15 & 5000 \\ 7 & mnist & mnist 4 - four,5 - five,3 - three,2 - two,7 - seven&5000 & 2500 & 4874 \\ 8 & fashion-mnist & Sneaker, Sandal, Ankle boot, Coat, T-shirt/top&25 & 15 & 5000 \\ 9 & fashion-mnist & Dress, Coat, Ankle boot, Bag, Trouser&5000 & 2500 & 5000 \\ 10 & svhn & svhn 3 - three,7 - seven,0 - zero,1 - one,8 - eight&25 & 15 & 5000 \\ 11 & cifar100 & otter, leopard, beetle, ray, butterfly&2250 & 1250 & 500 \\ 12 & svhn & svhn 6 - six,1 - one,9 - nine,2 - two,0 - zero&25 & 15 & 5000 \\ 13 & fashion-mnist & Sneaker, Ankle boot, T-shirt/top, Sandal, Dress&5000 & 2500 & 5000 \\ 14 & mnist & mnist 5 - five,1 - one,9 - nine,7 - seven,8 - eight&5000 & 2500 & 4866 \\ 15 & mnist & mnist 5 - five,6 - six,7 - seven,9 - nine,2 - two&25 & 15 & 4850 \\ 16 & svhn & svhn 4 - four,0 - zero,1 - one,2 - two,7 - seven&25 & 15 & 5000 \\ 17 & fashion-mnist & T-shirt/top, Sneaker, Shirt, Trouser, Sandal&25 & 15 & 5000 \\ 18 & cifar10 & cat, frog, bird, ship, deer&5000 & 2500 & 5000 \\ 19 & svhn & svhn 9 - nine,2 - two,8 - eight,4 - four,7 - seven&25 & 15 & 5000 \\ 20 & cifar10 & ship, horse, dog, truck, cat&25 & 15 & 5000 \\ 21 & fashion-mnist & Sneaker, T-shirt/top, Shirt, Dress, Pullover&5000 & 2500 & 5000 \\ 22 & cifar10 & airplane, truck, deer, frog, bird&5000 & 2500 & 5000 \\ 23 & svhn & svhn 2 - two,6 - six,4 - four,1 - one,5 - five&5000 & 2500 & 5000 \\ 24 & mnist & mnist 8 - eight,3 - three,9 - nine,4 - four,7 - seven&25 & 15 & 4956 \\ 25 & svhn & svhn 4 - four,8 - eight,2 - two,6 - six,7 - seven&25 & 15 & 5000 \\ 26 & svhn & svhn 1 - one,4 - four,7 - seven,9 - nine,2 - two&25 & 15 & 5000 \\ 27 & cifar100 & sweet pepper, cockroach, motorcycle, tank, elephant&25 & 15 & 500 \\ 28 & svhn & svhn 3 - three,2 - two,4 - four,7 - seven,1 - one&5000 & 2500 & 5000 \\ 29 & cifar100 & chimpanzee, streetcar, wolf, beaver, rose&25 & 15 & 500 \\ 30 & cifar10 & horse, airplane, deer, automobile, truck&25 & 15 & 5000 \\ 31 & svhn & svhn 5 - five,8 - eight,7 - seven,4 - four,3 - three&5000 & 2500 & 5000 \\ 32 & fashion-mnist & Coat, Dress, Sandal, Pullover, T-shirt/top&5000 & 2500 & 5000 \\ 33 & cifar10 & horse, ship, truck, frog, cat&25 & 15 & 5000 \\ 34 & cifar10 & ship, dog, bird, airplane, cat&25 & 15 & 5000 \\ 35 & cifar10 & deer, airplane, ship, truck, automobile&5000 & 2500 & 5000 \\ 36 & cifar100 & boy, beaver, willow tree, shark, tank&25 & 15 & 500 \\ 37 & svhn & svhn 3 - three,4 - four,9 - nine,1 - one,8 - eight&25 & 15 & 5000 \\ 38 & svhn & svhn 9 - nine,4 - four,5 - five,3 - three,1 - one&25 & 15 & 5000 \\ 39 & cifar10 & frog, airplane, cat, dog, truck&25 & 15 & 5000 \\ 40 & cifar10 & ship, deer, truck, horse, bird&25 & 15 & 5000 \\ 41 & fashion-mnist & Dress, Shirt, Trouser, Coat, Sneaker&25 & 15 & 5000 \\ 42 & cifar100 & streetcar, beaver, tiger, bus, raccoon&25 & 15 & 500 \\ 43 & fashion-mnist & Coat, Bag, Dress, Sneaker, Sandal&25 & 15 & 5000 \\ 44 & mnist & mnist 5 - five,9 - nine,7 - seven,6 - six,2 - two&5000 & 2500 & 4850 \\ 45 & cifar100 & hamster, pine tree, cockroach, boy, couch&25 & 15 & 500 \\ 46 & mnist & mnist 0 - zero,3 - three,2 - two,7 - seven,9 - nine&5000 & 2500 & 4980 \\ 47 & fashion-mnist & Sandal, Dress, Coat, Trouser, Bag&25 & 15 & 5000 \\ 48 & svhn & svhn 0 - zero,8 - eight,5 - five,2 - two,1 - one&5000 & 2500 & 5000 \\ 49 & cifar10 & horse, frog, airplane, dog, ship&5000 & 2500 & 5000 \\ \toprule \end{tabular} \end{sc} \end{scriptsize} \caption{Details on the datasets and training/validation data amounts used for $S^{long}$ (Part 1)~\citep{veniat2020efficient}.} \label{tab:split_details_long_1} } \end{table*} \begin{table*}[ht] \centering \centerline{ \begin{scriptsize} \begin{sc} \renewcommand{\arraystretch}{0.7} \begin{tabular}{l|ccccc} \toprule Task & Dataset & Classes & \# Train & \# Val & \# Test \\ \midrule 50 & svhn & svhn 9 - nine,4 - four,6 - six,5 - five,2 - two&25 & 15 & 5000 \\ 51 & svhn & svhn 3 - three,6 - six,8 - eight,9 - nine,1 - one&25 & 15 & 5000 \\ 52 & cifar100 & crocodile, lion, butterfly, otter, hamster&2250 & 1250 & 500 \\ 53 & mnist & mnist 9 - nine,8 - eight,6 - six,7 - seven,3 - three&25 & 15 & 4932 \\ 54 & mnist & mnist 7 - seven,3 - three,8 - eight,4 - four,2 - two&25 & 15 & 4956 \\ 55 & svhn & svhn 4 - four,2 - two,6 - six,0 - zero,5 - five&25 & 15 & 5000 \\ 56 & cifar100 & sea, chair, snake, spider, snail&25 & 15 & 500 \\ 57 & cifar100 & beetle, television, table, porcupine, cup&25 & 15 & 500 \\ 58 & cifar10 & cat, horse, frog, truck, automobile&25 & 15 & 5000 \\ 59 & svhn & svhn 8 - eight,6 - six,1 - one,5 - five,3 - three&25 & 15 & 5000 \\ 60 & cifar10 & bird, frog, horse, ship, deer&25 & 15 & 5000 \\ 61 & mnist & mnist 1 - one,9 - nine,8 - eight,7 - seven,2 - two&25 & 15 & 4974 \\ 62 & fashion-mnist & Dress, T-shirt/top, Sandal, Trouser, Sneaker&25 & 15 & 5000 \\ 63 & mnist & mnist 6 - six,4 - four,0 - zero,7 - seven,8 - eight&25 & 15 & 4894 \\ 64 & svhn & svhn 4 - four,2 - two,7 - seven,6 - six,3 - three&5000 & 2500 & 5000 \\ 65 & cifar100 & pear, skyscraper, shark, plain, dolphin&2250 & 1250 & 500 \\ 66 & cifar10 & frog, bird, airplane, ship, horse&25 & 15 & 5000 \\ 67 & cifar10 & frog, deer, ship, horse, truck&25 & 15 & 5000 \\ 68 & cifar10 & horse, deer, truck, airplane, dog&25 & 15 & 5000 \\ 69 & cifar100 & skunk, orchid, cattle, spider, lobster&25 & 15 & 500 \\ 70 & mnist & mnist 3 - three,5 - five,4 - four,9 - nine,1 - one&25 & 15 & 4874 \\ 71 & svhn & svhn 4 - four,3 - three,1 - one,7 - seven,5 - five&25 & 15 & 5000 \\ 72 & fashion-mnist & Coat, Dress, Bag, Sandal, Trouser&25 & 15 & 5000 \\ 73 & fashion-mnist & Sandal, Dress, Ankle boot, Pullover, Shirt&25 & 15 & 5000 \\ 74 & mnist & mnist 3 - three,2 - two,8 - eight,6 - six,4 - four&25 & 15 & 4914 \\ 75 & cifar10 & airplane, dog, horse, bird, ship&25 & 15 & 5000 \\ 76 & cifar10 & automobile, horse, airplane, cat, truck&25 & 15 & 5000 \\ 77 & fashion-mnist & Sandal, Coat, Shirt, Dress, Ankle boot&25 & 15 & 5000 \\ 78 & fashion-mnist & Trouser, T-shirt/top, Sandal, Sneaker, Dress&25 & 15 & 5000 \\ 79 & cifar100 & lion, turtle, cup, shrew, rose&25 & 15 & 500 \\ 80 & mnist & mnist 2 - two,4 - four,5 - five,6 - six,1 - one&25 & 15 & 4832 \\ 81 & cifar100 & turtle, mountain, kangaroo, lobster, crab&25 & 15 & 500 \\ 82 & fashion-mnist & Sandal, Sneaker, T-shirt/top, Coat, Pullover&25 & 15 & 5000 \\ 83 & cifar100 & plain, skyscraper, butterfly, train, sea&25 & 15 & 500 \\ 84 & mnist & mnist 9 - nine,5 - five,4 - four,8 - eight,2 - two&25 & 15 & 4848 \\ 85 & svhn & svhn 1 - one,7 - seven,0 - zero,5 - five,6 - six&25 & 15 & 5000 \\ 86 & mnist & mnist 2 - two,4 - four,7 - seven,3 - three,8 - eight&25 & 15 & 4956 \\ 87 & cifar10 & ship, automobile, frog, dog, horse&25 & 15 & 5000 \\ 88 & cifar100 & cloud, spider, tiger, mouse, snake&25 & 15 & 500 \\ 89 & fashion-mnist & Dress, Pullover, T-shirt/top, Bag, Shirt&25 & 15 & 5000 \\ 90 & cifar10 & automobile, truck, cat, dog, horse&25 & 15 & 5000 \\ 91 & mnist & mnist 0 - zero,8 - eight,9 - nine,7 - seven,5 - five&25 & 15 & 4846 \\ 92 & mnist & mnist 3 - three,9 - nine,7 - seven,5 - five,8 - eight&25 & 15 & 4866 \\ 93 & fashion-mnist & Bag, Coat, T-shirt/top, Ankle boot, Trouser&25 & 15 & 5000 \\ 94 & cifar100 & camel, tractor, orchid, pear, aquarium fish&25 & 15 & 500 \\ 95 & mnist & mnist 2 - two,8 - eight,9 - nine,4 - four,3 - three&25 & 15 & 4956 \\ 96 & mnist & mnist 9 - nine,8 - eight,4 - four,0 - zero,7 - seven&25 & 15 & 4936 \\ 97 & fashion-mnist & Bag, Dress, Shirt, Sandal, Pullover&25 & 15 & 5000 \\ 98 & cifar100 & mouse, snail, bed, trout, girl&25 & 15 & 500 \\ 99 & fashion-mnist & Trouser, Pullover, Sandal, T-shirt/top, Ankle boot&25 & 15 & 5000 \\ \toprule \end{tabular} \end{sc} \end{scriptsize} \caption{Details on the datasets and training/validation data amounts used for $S^{long}$ (Part 2).} \label{tab:split_details_long_2} } \end{table*} \subsection{Baselines and training details}\label{app:baseline_details} We adopted the original soft-gating with fixed modules (\textbf{SG-F}) proposed by \citet{mendez2020lifelong} in two ways: (1) instead or relying on a pool of initially pretrained modules shared across all layers, we initialize a separate set of modules per layer. This is necessary in order to comply with the experimental setup of CTrL which does not allow pretraining. (2) We used the expansion strategy proposed in MNTDP~\cite{veniat2020efficient} for SG-F, i.e. for each task different layouts with no or one new module per-layer starting at the top layer are trained, the layout with the best validation accuracy is accepted. The original expansion strategy of \citep{mendez2020lifelong} is similar in spirit, yet relies on a module pool shared between layers and an initial pretraining of modules, which allows training of only two parallel models: with and without adding a single new module to the shared pool. In \textbf{SG-F\tiny{(A)}} we share a single controller network among all tasks in the sequence. Thereby, the main network still uses task IDs to select the task-specific output head. In the controller a single head architecture is used to gate the modules. As modules are added to the learner, each head of the controller used to gate each layer of the main learner is also expanded. This baseline showcases forgetting in the controller if it is shared across tasks. For \textbf{HAT} we used a separate batch-norm layer for each task. Using shared batch-norm resulted in high forgetting rate for this method. For all task ID aware methods, the task ID was used either to select the task specific output head (as in HAT, EWC or ER) or the task specific structure as in MNTDP (which includes the output head). Thereby, we treat first and last tasks in $S^+$, $S^-$, $S^{in}$ and $S^{out}$ streams as tasks with different IDs. This corresponds to the definition provided in \cite{veniat2020efficient}, where the task ID is defined to correspond to the sequential order of the task in the sequence. We used Adam optimizer for all baseline methods but HAT~\citep{Serra18}. Using Adam for HAT resulted in more forgetting, which we believe is because HAT masks out only the gradients of some parameters and does not effect Adam's momentum. \textbf{Hyper-parameter and model selection} was performed using average mean validation accuracy over all tasks in the stream (stream level) with splits detailed in Table~\ref{tab:split_details}. When varying the seeds in the provided experiments, we did not very the seed that effects data generation (CTrL Streams) but only the seed that affected the algorithm, model initialization as well as data-loader's batch sampling. \subsection{Metrics} \label{app:ctrl_metrics} Here we formally define metrics used in the experiments. These metrics are similar to the ones used by \citet{veniat2020efficient}. $\Delta$ denotes the prediction accuracy of the predictor $\mathcal{F}$. We use subscripts to indicate the version of the parameters: e.g. $\theta_{1\ldots t}$ indicates the functional parameters of the learner after it was continually trained on $t$ tasks, while $\theta_T$ indicates the version of functional parameters after learning only task $T$ in isolation. \paragraph{Average accuracy} on all tasks seen so far. \begin{align} \mathcal{A} = \frac{1}{T} \sum_{t=1}^T \mathbb{E}_{(x,y)\sim\mathcal{D}_t}[\Delta\Big(\mathcal{F}(x;\theta_{1\ldots T},\phi_{1\ldots T}), y)\Big)] \end{align} \paragraph{Forgetting}--- the average loss of accuracy on a task at the end of training as compared to the first time the task was seen. Positive values indicate positive backward transfer. \begin{align} \mathcal{F}=\frac{1}{T-1} \sum_{t=1}^T \mathbb{E}_{(x,y)\sim\mathcal{D}_t}[\Delta\Big(\mathcal{F}(x;\theta_{1\ldots T}, \phi_{1\ldots T}), y\Big) - \Delta\Big(\mathcal{F}(x; \theta_{1\ldots t}, \phi_{1\ldots t}), y\Big) ] \end{align} \paragraph{Transfer} --- the difference in performance on the last ($T$'th) task between the modular learner trained on the entire sequence and an expert $\mathcal{F}^\prime$ trained on the last task in isolation. \begin{align} \mathcal{T} = \mathbb{E}_{(x,y)\sim\mathcal{D}_T}\Delta\Big(\mathcal{F}(x; \theta_{1\ldots T}, \phi_{1\ldots T}), y\Big) - \Delta\Big(\mathcal{F}^\prime(x; \theta_T), y\Big) \end{align} \newpage \subsection{Transfer results CTrL}\label{app:transfer_ctrl} \newcommand{\ttiny}[1]{{\fontsize{5}{5}\selectfont #1}} \newcommand{\tiny\textpm}{\tiny\textpm} \newcolumntype{g}{>{\columncolor{Gray}}c} \newcolumntype{d}{>{\columncolor{Gray}}l} \setlength{\tabcolsep}{0.5pt} \begin{table*}[!h] \centering \centerline{ \begin{scriptsize} \begin{sc} \renewcommand{\arraystretch}{1.15} \begin{tabular}{l|gcg|cgc|gcg|cgc} \toprule & \multicolumn{3}{c|}{$S^-$} & \multicolumn{3}{c|}{$S^+$} & \multicolumn{3}{c|}{$S^{in}$} & \multicolumn{3}{c}{$S^{out}$} \\ Model & Acc $t_1$ & Acc $t^-_1$ & $\mathcal{T}$ & Acc $t_1$ & Acc $t^+_1$ & $\mathcal{T}$ & Acc $t_1$ & Acc $t^{\prime}_1$ & $\mathcal{T}$ & Acc $t_1$ & Acc $t^{\prime\prime}_1$ & $\mathcal{T}$\\ \midrule Experts & 65.5\pmt0.7& 41.8\pmt1.0 & 0 & 41.3\pmt2.9 & 65.6\pmt0.5 & 0 & 98.5\pmt0.2 & 76.9\pmt4.9 & 0 & 65.9\pmt0.6 & 43.5\pmt1.6 & 0 \\ MNTDP & 63.0\pmt3.6 & 56.9\pmt5.1 & 15.1 & 43.2\pmt0.7 & 65.9\pmt0.8 & 0.3 & 98.9\pmt0.1 & 93.3\pmt1.6 & 16.4 & 65.0\pmt1.2 & 57.7\pmt1.7 & 14.2 \\ LMC\tiny{($\lnot$A)} & 65.2\pmt0.4 & 60.0\pmt1.1 & 18.2 & 42.9\pmt0.9 & 60.6\pmt1.9 & -4.7 & 98.7\pmt0.1 & 92.5\pmt7.6 & 15.6 & 65.2\pmt0.2 & 59.8\pmt1.1 & 16.3 \\ LMC\tiny{(A)} & 65.2\pmt0.4 & 63.0\pmt1.7 & 21.2 & 43.1\pmt0.6 & 62.2\pmt0.7 & -3.4 & 98.7\pmt0.1 & 88.3\pmt1.6 & 11.4 & 65.5\pmt0.6 & 42.0\pmt21.9 & -1.5 \\ S.G+FX & 64.9\pmt0.4 & 49.1\pmt7.3 & 7.3 & 43.1\pmt0.4 & 61.7\pmt1.7 & -3.9 & 98.8\pmt0.1 & 80.4\pmt6.8 & 3.5 & 65.0\pmt0.4 & 51.5\pmt6.5 & 8.0 \\ \bottomrule \end{tabular} \end{sc} \end{scriptsize} } \caption{Transfer results on the CTrL benchmark. We provide the accuracy of the first and the last task on each of the streams. Additionally, we measure transfer $\mathcal{T}$ as the difference between the last task's accuracy of the model trained on the corresponding stream and an expert model trained on the last task in isolation. } \label{tab:additional_transfer_results_ctrl} \end{table*} \subsection{Module selection: CTrL} In Figure~\ref{fig:module_selection_CTrL} we plot the average module selection of LMC for different streams of the CTrL~\citep{veniat2020efficient} benchmark after continual training on the corresponding stream. The plots correspond to the runs with the best validation accuracy on the corresponding stream. We observe that for the $S^{-}$ stream LMC reuses modules trained on the task 1 for the sixth task. On $S^{+}$, when tested on task 1 and task 6 same modules are used, yet the two modules at the last layer correspond to the ones added when learning task 6 (this task contains more training data than task 1). On $S^{in}$ the last task reuses only the last layer's module from task 1 and several other modules on the previous layers from previous tasks. Finally, for $S^{pl}$ stream, even though the tasks are unrelated, several modules are reused across the tasks. Importantly, since LMC implements soft module selections strategy several modules can be used together for the same batch of samples (see Eq.~\ref{eq:w_l}). \begin{figure}[!h]% \subfloat[Module Selection $S^-$]{% \includegraphics[clip,width=1\columnwidth]{figures/module_selection_s_minus.pdf}% } \vspace{0.5cm} \subfloat[Module Selection $S^+$]{% \includegraphics[clip,width=1\columnwidth]{figures/module_selection_s_plus.pdf}% } \vspace{0.5cm} \subfloat[Module Selection $S^{in}$]{% \includegraphics[clip,width=1\columnwidth]{figures/module_selection_s_in.pdf}% } \vspace{0.5cm} \subfloat[Module Selection $S^{pl}$]{% \includegraphics[clip,width=1\columnwidth]{figures/module_selection_s_pl.pdf}% } \caption{Average module selection for different streams at test time. Horizontal axis corresponds to the layer number, vertical axis corresponds to the module index at a layer; darker color corresponds to higher average activation strength (averaged over batches in the corresponding task).} \label{fig:module_selection_CTrL} \end{figure} \subsection{Ablation of threshold $z^{\prime}$} \label{app:ablation_threshold} To see how the z threshold influences the final number of modules (M) and the average (test) accuracy over seen tasks ($\mathcal{A}$) we report the $\mathcal{A}$ and M for LMC{\tiny($\lnot$A)} on 4 streams with fixed hyperparameters while only varying the threshold $z^{\prime}$. In Figure~\ref{fig:acc_nmodules_threshold} we plot the values of the threshold $z^{\prime}$ on the x-axis against average accuracy $\mathcal{A}$ on the y-axis: higher $z^{\prime}$ leads to fewer modules being instantiated resulting in lower average accuracy $\mathcal{A}$. Additionally, in Figure~\ref{fig:numodules_acc} we plot the same runs but now with number of modules on the x-axis and the average accuracy $\mathcal{A}$ on the y-axis. We identify the number of modules and accuracy of the MNTDP baseline with dotted lines with the corresponding stream colors in both plots. In Figure~\ref{fig:numodules_acc} we observe that LMC instantiates a comparable number of modules as MNTDP in order to reach similar accuracy, with an exception of the $S^{pl.}$ stream, where LMC tends to add mode modules to reach a similar accuracy. \begin{figure}% \centering \subfloat[$\mathcal{A}$ and M for different $z^{\prime}$.]{{\includegraphics[width=0.45\textwidth]{figures/threshold_ablation.pdf} } \label{fig:acc_nmodules_threshold} }% \qquad \subfloat[$\mathcal{A}$ for different M]{{\includegraphics[width=0.45\textwidth]{figures/nmodules_ablation.pdf}} \label{fig:numodules_acc}% }% \caption{(a) Mean test accuracy $\mathcal{A}$ and number of modules M for different values of the threshold hyperparameter $z^{\prime}$ for LMC{\tiny($\lnot$A)}. Dotted lines mark the accuracy of MNTDP\citep{veniat2020efficient}. (b) Number of modules (x-axis) against average accuracy $\mathcal{A}$ for runs with different threshold $z^{\prime}$. Dotted lines mark $\mathcal{A}$ and M for MNTDP\citep{veniat2020efficient} (best seen in color).}% \end{figure} \section{Long sequences hyperparameter search visualization} \label{app:long_modules_vs_acc} We plot number of modules against the average test accuracy over all seen tasks ($\mathcal{A}$) in Figure~\ref{fig:long_modules_vs_acc} for all executed hyperparameter search runs on both $S^{long30}$ and $S^{long}$ sequences. \begin{figure}% \centering \subfloat[30 tasks sequence $S^{long30}$.]{{\includegraphics[width=0.6\textwidth]{figures/acc_module_30t_2_full.pdf} } }% \qquad \subfloat[100 tasks sequence $S^{long}$.]{{\includegraphics[width=0.6\textwidth]{figures/acc_module_100t_2_full.pdf}}}% \caption{Results on $S^{long}$ and $S^{long30}$ sequences for different hyperparameter values for all executed hyperparameter search runs (this is an expanded version of Figure~\ref{fig:acc_nmodules_slong}).}% \label{fig:long_modules_vs_acc}% \end{figure} \section{Combining independent models} \label{app:combining_independent_models} The aim of this experiment is to show the ability of independently trained LMC models to be combined without fine-tuning, without loss in performance and also enabling positive transfer. In this experiment the test set's distributions of the cMNIST tasks are different from the training/validation sets' distributions (see \S~\ref{sec:pnp}). We used oracle model selection choosing hyperparameters on the test set. Note, that model selection is an unsolved challenge in the OOD generalization literature, where selecting model using oracle strategies is sometimes excepted if the baselines methods are also tuned using oracle strategies~\citep{gulrajani2020search,pezeshki2020gradient}. \begin{figure*}[!h]% \centering \includegraphics[width=1\columnwidth]{figures/pnp_module_selection.pdf} \caption{Average module selection per task on LMC3, which was constructed from plugging together independently trained LMC1 (first 3 tasks) and LMC2 (last 3 tasks).}% \end{figure*} \section{Compositional OOD generalization}\label{app:ood} Some examples of the raw samples used for this experiment are presented in Figure~\ref{fig:samples_cMNIST_ood}. Model selection was performed assuming access to the test sets of the OOD tasks. As mentioned in \S~\ref{app:combining_independent_models}, this is sometimes an excepted strategy is settings in which test distribution is different from the training/validation distribution. Additionally, the input samples were normalized using statistics computed on training set of each tasks, including the OOD tasks (for which no training was performed). In the main paper we presented a version of LMC with \textbf{omitted projection phase}. More precisely this means that the structural loss of the modules above was not propagated into the free modules on the lower layers (closer to the input) and that module addition was allowed during the whole training process. \begin{figure*}[!h]% \centering \includegraphics[width=0.45\textwidth]{figures/CMNIST.pdf} \caption{Examples of samples from the used colored-MNIST dataset.}% \label{fig:samples_cMNIST_ood}% \end{figure*} \newpage \subsection{Module selection} In Figure~\ref{fig:module_selection_ood} we plot average module selection per task for the compositional OOD generalization setting. \label{app:ood_gen} \begin{figure*}[h!]% \centering \includegraphics[width=0.9\textwidth]{figures/module_selection.pdf} \caption{Average module selection per task for compositional OOD generalization setting presented in \S~\ref{sec:c_ood}. Each column represents a task (e.g. 0vs.1 classification), each row corresponds to a digit-background color combination. Each square represents a modular learner, x-axis is the layer, y-axis is the modules at each layer. The color intensities correspond to the average activation strength of the module when tested on the corresponding task (the darker the higher). \textbf{B} - stands for Background and \textbf{D} - stands for digit (e.g. ``B-Blue D-Black'' stands for blue background and black digit). The diagonal tasks (with red boarder) are seen during the continual training phase, after which the model is evaluated on all 5 combinations of seen digit-background colors for each task. The last row corresponds to the module selection for tasks with digit-background color combination which was not seen during the continual learning phase (black background+blue digit).}% \label{fig:module_selection_ood}% \end{figure*} \newpage \section{Continual meta-learning} \label{app:meta-cl} In the continual meta-learning setting, a learner is exposed to tasks sampled from a sequence of environments. The goal of this setting is to construct a learner that quickly (i.e. within a few steps of gradient descent) learns tasks from new environments and relearns (or remembers) tasks from previously learned environments \citep{jerfel2019reconciling,caccia2020online,He2019TaskAC}. Methods applicable in this setting usually rely on gradient-based meta-learning strategies based on MAML~\cite{finn2017model}. The goal of MAML is to learn a good parameter initialization $\theta_0$ such that the learner can achieve low loss $\mathcal{L}_\tau$ on a randomly sampled task $\tau$ after a few steps of gradient descent. The objective of MAML can be formulated as \cite{nichol2018first}: \begin{equation} \theta_0 = arg\min_\theta \mathbb{E}_\tau(\mathcal{L}_\tau (U_\tau^k(\theta)) ), \end{equation} where where $U$ is the operator that performs $k$ inner-loop SGD updates starting with $\theta$ using data samples from task $\tau$. % MAML has been extensively used in the few-shot learning scenario~\cite{wang2020generalizing}, where similar tasks are sampled from a stationary distribution. However, as pointed out by~\citet{jerfel2019reconciling}, it is unrealistic to assume the existence of a single set of meta-parameters that is close to all tasks in heterogeneous settings with outliers and non-stationary task distributions. In such setting, dissimilar tasks worsen generalization and non-stationarity causes catastrophic forgetting~\cite{kirkpatrick2017overcoming}. Instead of learning a single set of meta-parameters for all the tasks, \citet{jerfel2019reconciling} propose to learn a set of monolithic expert models, each representing a separate parameter initialization. The meta-learner then leverages the connection between gradient-based meta-learning and hierarchical Bayes~\cite{grant2018recasting} for selecting the most likely expert for the given task at hand. The probability of an expert to be selected is calculated based on the inner-loss of each expert as well as a non-parameteric Dirichlet process prior estimated in an online fashion. Here, we construct two environment sequences. In the first one, the learner is meta-trained on a sequence of Omniglot \cite{lake2015human}, MNIST \cite{lecun-mnisthandwrittendigit-2010} and fashion-MNIST \cite{xiao2017fashion} datasets --- the OMF sequence. We evaluate models in two settings. In the first setting, we report the average meta-test test accuracy over the environments seen so far. In the second setting, models are evaluated on environment mixtures, i.e. each test task is composed of samples from the environments learned so far. A possible mixture task could contain classes 1 and 2 sampled from Omniglot, 2 and 3 from MNIST and class 5 sampled from the fashion-MNIST environment. The second sequence of environments is constructed from classes of the \textit{mini}Imagenet~\cite{ren2018meta}. We compare to the following baselines. \textbf{MAML}: non-modular MAML~\cite{finn2017model}. \textbf{MAML + ER}: MAML with experience replay --- we maintain a memory buffer of tasks sampled from previously seen environments, using a reservoir sampling procedure we retrieve a set of previously seen tasks which we then add to the task batches used for meta-training on new environments; \textbf{Meta-gating} tries to learn the relevance scores $\gamma^{(l)}$, used for gating, directly in the inner-loop. This is similar to soft-layer ordering used in~\citep{mendez2020lifelong}; \textbf{Experts}: an upper bound where separate monolithic model is trained for each environment and selected using the environment ID. We test LMCs with different levels of modular granularity: \textbf{LMCe} refers to a model that trains separate experts, but expert selection is performed using an expert-level structural component; \textbf{LMCm} is the modular LMC with module selection performed at each layer (as described in \S~\ref{sec:lmc}). In our experiments we meta-learn the structural components: in the inner-loop we update functional parameters $\theta_m$ of all modules (also the fixed ones) whereas the structural parameters $\phi_m$ are kept constant, in the outer-loop both functional and structural parameters of the free modules are updated. \textit{Importantly, we do not apply the projection phase in the meta-learning experiments.} All experiments are performed in a 5-way 5-shot setting. For LMCm we used encoder-decoder architectures in the \textit{mini}Imagenet experiments (\S~\ref{app:imnet_experiments}), while for the OMF sequence the invertible structural component was used for the entire network. Note, that task inference is done automatically using the provided meta-test train (query) data, hence, there is no need to use multiple classification heads. For the OMF task sequence each module consists of a single convolutional layer with 64 3x3 filters (padding 1), batch-normalization, ReLU activation function and a max-pooling layer with the kernel-size of 2. This resembles the architecture introduced by \citet{finn2017model}. One epoch of meta-training consists of 100 meta-updates, each performed on a batch of 25 tasks (5-way, 5-shot). For the \textit{mini}ImageNet experiment, a single convolutional layer contains 32 filters. One epoch of meta-training performs 100 meta-updates, each on a batch of 4 tasks (5-way 5-shot regime). All learners contain 4 layers, non-modular (MAML, MAML+ER) learners do not expand. In the ``Experts'' baseline, each expert network corresponds to a 4-layered net with a single module per layer. Model selection was performed using average meta-test validation accuracy over all environments. We randomly selected 10\% of the train datasets for validation purposes for MNIST and fMNIST datasets. For these datasets we did not evaluate the meta-generalization ability of the model, since the classes in meta-train and meta-test splits are the same. For the Omniglot dataset we selected 100 classes for validation purposes. We also flipped the background color of the Omniglot dataset to be black, which corresponds to the background colors of the MNIST and fMNIST datasets. For the \textit{mini}ImageNet dataset we split the 100 classes in 64-train/16-validation/20-test as in~\citep{ren2018meta}. \subsection{Module addition continual meta-learning.} \label{sec:module_addition_tricks} In this section we explain some details about the adaptation of LMC's expansion strategy (\S\ref{sec:expansion_strategy}) for continual meta-learning. The decision about module addition can be made per sample, per task, or per batch of tasks. In the per sample case, a new module is added whenever a sample is regarded as an outlier by all modules at a layer. In the per task case, a new module is added whenever the average z-score for a task is larger than a threshold. In the per batch of tasks case, the average z-score is calculated over a batch of tasks. In our experiments we found that adding new modules on a per batch of tasks base yields the best efficacy in the continual meta-learning setting. We do not freeze the modules at the environment switch, but create a checkpoint of each non-frozen (free) module. Thus, modules are allowed to learn in the outer loop until the module addition is triggered. Whenever the module addition is triggered at a layer, the existing free module is dropped back to its state from the most recent checkpoint (i.e. its state at last environment switch). \subsection{OMF results} Results on OMF are shown in Figure \ref{fig:acc_mixture_all}. These results suggest that LMC can successfully avoid catastrophic forgetting achieving final average accuracy comparable to the experience replay (MAML + ER) baseline. This can be mainly attributed to the fact that learned modules at a layer are frozen every time a new module is added --- modules are not updated on new tasks if these tasks have triggered module addition and thus were recognized as outliers at a given layer. \begin{wrapfigure}[21]{t}{.40\textwidth} \begin{minipage}{\linewidth} \centering \includegraphics[width=\linewidth]{figures/meta_test_ACC_OMF.pdf} \subcaption{Average meta-test accuracy so far} \includegraphics[width=\linewidth]{figures/mixture_accuraacy_OMF.pdf} \subcaption{Mixtures of tasks meta-test accuracy} \end{minipage} \caption{Results on the OMF sequence. Vertical dashed lines mark the environment switches.} \label{fig:acc_mixture_all} \end{wrapfigure} Results with mixtures of tasks are in Figure~\ref{fig:acc_mixture_all}b. We find that LMC attains better performance than the other baselines. The performance improvement is due to LMC assigning modules on a per-sample basis in each forward pass, effectively guiding the inner- and outer-loop gradients of the meta-training procedure to the modules with higher activation on the current input. This contrasts the selection mechanism proposed by \cite{jerfel2019reconciling} for mixture-of-experts, where estimating the probability of each expert involves computation of the inner-loss which can be performed only on a per-task level. While replay slightly underperforms LMC on the mixture task, MAML is unable to reach high accuracy due to catastrophic forgetting. Regarding the experts baseline, each expert only specializes on one of the three environments, which results in low performance on the mixture-task. In Figure~\ref{fig:omf_per_task} we show how the meta-test test accuracies evolve over the course of continual meta-training for each environment of the OMF sequence. Additionally, in Figure~\ref{fig:omf_module_selection} we plot the average module selection at meta-test test time on the OMF sequence after the entire sequence has been learned. \begin{figure*}[!h]% \centering \includegraphics[width=1\textwidth]{figures/meta_test_accs_omf.pdf} \caption{Meta-test test accuracy on the OMF task sequence. Each row shows accuracy on a specific environment, the training time on each environment is highlighted with white background. We also report the average accuracy over all environments at the end of training in the legend (ACC). For this experiment the modular learner (LMCm) was trained using inevitable network as structural component (5-way 5-shot).}% \label{fig:omf_per_task}% \end{figure*} \begin{figure*}[!h]% \centering \includegraphics[width=0.45\textwidth]{figures/masks_after_fMNIST.pdf} \caption{Average module selection of LMCm for a selected run on the OMF task sequence (after continual meta-CL training has been complete on the entire sequence).} \label{fig:omf_module_selection} \end{figure*} \subsection{Additional \textit{mini}Imagenet results.} \label{app:imnet_experiments} In this section we present additional results on the evolving \textit{mini}Imagenet sequence where, similarly to~\citep{jerfel2019reconciling}, each environment is obtained through application of filters `blur', `pencil' and `night'. Figure~\ref{fig:mini_imnet_per_task} plots per environment accuracy of each method that results in the average accuracy over the environments seen so far depicted in Figure \ref{fig:imnet_avverage_and_mixtures} (a). \begin{figure}[!t]% \begin{subfigure}[t]{0.45\textwidth} \includegraphics[width=1\linewidth]{figures/meta_test_ACC_imnet.pdf} \caption{Average meta-test accuracy so far} \label{fig:ood-ewc} \end{subfigure} \begin{subfigure}[t]{0.45\textwidth} \includegraphics[width=1\linewidth]{figures/mixture_imnet.pdf} \caption{Average meta-test accuracy on the mixture tasks} \label{fig:ood-mntdp} \end{subfigure} \caption{Meta-test test results on the sequence of \textit{mini}Imagenet environments. Vertical lines mark environment switches.}% \label{fig:imnet_avverage_and_mixtures} \end{figure} Additionally, we design a mixture-task baseline as follows: we select randomly 5 classes from the \textit{mini}ImageNet dataset, sample datapoints for these 5 classes from each of the environments seen so far (i.e. all three at the end of the sequence) to build tasks. Hence, a single mixture task for each class will contain samples from each environment seen so far. The learner is then meta-tested on these tasks. This is different from the mixture task designed for the OMF sequence, where classes from different environments were mixed. We present the results on the mixture task in Figure~\ref{fig:imnet_avverage_and_mixtures}(b). We observe that MAML+ER baselines outperforms other learners in this evaluation setting. We hypothesize that poor performance of LMC in this setting is due to the batched modularity procedure (\S\ref{app:batched_module_selection}), where biasing module activation towards majority activation withing the batch of may harm performance, since each batch contains samples from all environments seen so far. \begin{figure*}[!h]% \centering \includegraphics[width=1\textwidth]{figures/meta_test_accs_imnet.pdf} \caption{Meta-test test accuracy on the evolving \textit{mini}ImageNet task sequence. Each row shows accuracy on a specific environment, the training time on each environment is highlighted with white background. For this experiment the modular learners (LMCm and LMCe) were trained using decoder as structural component tasked to reconstruct modules' inputs (5-way 5-shot).}% \label{fig:mini_imnet_per_task}% \end{figure*} \section{Limitations} \label{sec:limitations} We identify three main limitations of LMC. The first one is that its computational footprint is not constant with respect to the number of tasks. This is caused by the fact that each forward path through the modular learner requires a forward pass through each module in order to obtain the local relevance scores. Potentially, this can be overcome by assuming local stationarity and using the same modules for several consecutive batches of samples. On the other hand, this might not be a big problem at all: we think of each module as an independent entity that can be executed on it's own dedicated device, in which case at each layer each module's computations can be executed in parallel. The recent trend towards shifting from monolithic to modular architectures can accelerate the development of such hardware devices. Another limitation of LMC is the lack of direct communication between modules at the same layer, which was shown to be important in some situations such as when different physical processes interact \citep{goyal2019recurrent,goyal2021coordination}. While explicitly modeling such communication is an interesting direction for the future work, the consolidation of modules through weighed sum in Eq.~\ref{eq:x_l} can be though of as a form of implicit communication, i.e. a form of a shared workspace similar to the one presented in~\citep{goyal2021coordination}. It is however questionable whether cross-module communication is of any benefit in a standard supervised-learning settings. Additionally, as discussed in \S~\ref{sec:longer_sequence}, module selection becomes challenging for LMC in presence of large number of candidate modules resulting in lower accuracy on long task sequences as compared to oracle based sleection strategy implemented in MNTDP~\cite{veniat2020efficient}. Finally, in its working LMC relies on the local OOD detector as well as a generative model as it's structural component. Several recent works have shown that deep generative models often mistakenly assign high likelihood values to outlier points~\cite{nalisnick2018deep,hendrycks2018deep, wang2020further}. Hence, LMC's success depends on overcoming these issues through innovation in the fields of OOD detection and generative modeling. \section{Broader societal impact}\label{app:societal_impact} This work aimed at leveraging modularity and compositionality for continual learning (CL). The goal of CL is to design systems capable to retain knowledge and transfer knowledge across tasks. Such systems can \textbf{positively impact} society in the following ways: (i) models able to retain knowledge withing neural connections do not require storing raw samples in a replay buffer, yielding systems that are more compliant with data privacy standards. (ii) Positive transfer of knowledge across tasks can result in more resource efficient training. (iii) Building modular systems can further improve resource efficiency: e.g. as shown in the experiment in \S~\ref{sec:pnp} several modular systems can be combined in a third system without any retraining. We do not identify any potential \textbf{negative societal impacts} of this work in particular beyond the potential negative societal impacts of artificial learning systems in general, which include the risk of decision bias, loss of certain jobs due to automation, risk of increased vulnerability to hacker attacks to name a few.
{'timestamp': '2021-11-16T02:33:45', 'yymm': '2111', 'arxiv_id': '2111.07736', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07736'}
arxiv
\section{Introduction} Anticipating human actions is critical for real-world applications in autonomous driving, video surveillance, human-computer interaction, \emph{etc}. According to the prediction horizons, the anticipation task is mainly investigated in two tracks: next-action anticipation~\cite{Vondrick16,Mahmud17, Qi17, Damen18, Farha18, Ke19, Fadime20} and dense anticipation~\cite{Farha18, Ke19, Fadime20}. Next action anticipation predicts upcoming actions $\tau$ seconds in advance, where the value of $\tau$ is considered as 1 in many recent works. Dense anticipation predicts multiple actions into the future and their durations for long horizons of up to several minutes or an entire video. Our paper focuses on the more challenging dense anticipation task where all existing methods~\cite{Farha18, Fadime20, Ke19} are fully supervised. Annotating videos for the fully supervised version of this task can be tedious, as it requires labelling the full set of actions in the subsequent sequence as well as their start and end times. In real-world videos, sequences are more likely to be labelled or tagged only at specific events. These tags are incomplete and instantaneous, \emph{i.e.} not present at every action and without duration information. This motivates us to develop a weakly supervised dense anticipation framework that learns from video sequences with an incomplete set of action and duration labels. Specifically, we aim to learn from a small set of fully-labelled data and predominantly from weak labels in which the video segment is annotated only with the first action class of the anticipated sequence (see Fig.~\ref{fig:01_WS-VDA}). This can greatly reduce the labelling effort as now we only need to provide the class label of a single action instead of all frames in the sequence. In practice, this type of weak label is akin to the \emph{time-stamp annotations} used in weakly-supervised temporal action segmentation, in which an arbitrary frame from each action segment is labelled~\cite{Li21,Moltisanti19,Ma20}. When annotating timestamps, annotators quickly go through a video and press a button when an action is occurring. This is $\sim$6x faster than marking the exact start and end frames of action segments~\cite{Ma20} and still provides strong cues to learn effective models for action segmentation. \begin{figure} \centering \includegraphics[width=0.9\linewidth]{images/Figure1.eps} \caption{ Dense anticipation with full supervision vs. weak supervision. The fully supervised label contains all the actions in the future video sequence as well as their durations. In this work, we consider a weak label in which only the first action label without any duration information is available. Our proposed framework is both semi- and weakly-supervised. We use a small set of fully-labelled videos, while the remainings are weakly-labelled.} \label{fig:01_WS-VDA} \end{figure} In our case, our weak label can be viewed as an incomplete version of the full label since it has only one (the first) of the full set of action labels, and no duration labels. Since each action label and action duration are all treated as separate terms in the loss for conventional anticipation methods~\cite{Mahmud17,Farha18,Fadime20}, a naive route to learn would be to ignore any missing labels from the loss. This option, while simple, does not fully leverage the data of the weakly-labelled set. We opt instead to learn an auxiliary model to generate pseudo-labels for the missing labels. The use of pseudo-labelling has become popular in unsupervised and semi-supervised learning~\cite{Helmstetter18, Yang21, Meng19, Yu20} and has been successful for tasks like image classification~\cite{Ge19, Wu17, Wangc21, Fang20} and segmentation~\cite{Dong19, Yao21, Chang20}. Inspired by these works, we propose a framework for learning a primary and conditional module for (semi-) weakly-supervised dense action anticipation. The conditional module is learned on a small fully-labelled training set to generate pseudo-labels for a larger weakly-labelled training set. The pseudo-labelled weak data is then applied to learn the primary anticipation module which will be used during inference. Directly learning on the outputs of an auxiliary model is often not better than learning on the limited set of provided labels as it does not add new knowledge into the system. The phenomenon is referred to as confirmation bias~\cite{Arazo20}; extending previous solutions such as label smoothing~\cite{Zhang17} or label sampling and augmentation~\cite{Zhu18, Berthelot19, Iscen19} is non-trivial for sequence data. As such, we introduce an adaptive refinement method which learns refined sequence labels based on the predictions of the primary and conditional module. In our experimentation, we have observed that the accuracy of dense anticipation is highly sensitive to having the correct duration prediction, especially in the earlier anticipated actions\footnote{Consider a ground truth sequence of AABBCCDD where each letter is the action of a frame; a prediction of AAAABBCCDD would score a mean-over-classes of only 0.25 since all B, C and D frames are misaligned.}. We are therefore motivated to ensure that the anticipated durations are correct. To that end, we introduce an additional duration attention module applicable to recursive dense anticipation methods~\cite{Farha18,Fadime20}. We compute an attention score between the observed video context and the hidden representation at each prediction step to explicitly emphasize the correlations, which greatly improves the duration accuracy. The contributions of this paper are summarized as follows: 1. We explore a novel and practical weakly-supervised dense anticipation task and propose an adaptive refinement method to make the most of weakly-labelled videos while using only a small number of fully-labelled videos. 2. We propose an attention scheme for predicting the duration of the anticipated actions which better accounts for the action correlations. 3. Our semi-supervised framework is flexible and applicable to a variety of dense anticipation backbones. The duration attention scheme serves as a plug-and-play module to improve the performance of recursive anticipation methods. Evaluation on standard benchmarks shows that our weakly supervised learning scheme can compete with state-of-the-art fully supervised approaches. \section{Related Work} Action recognition is the hallmark task of video understanding. In standard action recognition settings, short, trimmed video clips are classified with action labels. In contrast, action anticipation is applied to longer, untrimmed video sequences and aims to predict future actions \emph{before} they occur. The task in next action anticipation is to predict the upcoming action $\tau$ before it occurs. Various architectures ranging from recurrent neural networks (RNNs) ~\cite{Pirri19,Furnari20,Zhang20,Canuto20}, convolutional networks combined with RNNs~\cite{Mahmud17}, to transformers~\cite{Wang21} are proposed. The main focus of these works is to extract relevant information from the observations to predict the label of the action starting in $\tau$ seconds, varying between zero ~\cite{lan2014hierarchical} to 10s of seconds \cite{koppula2015anticipating}. Other models leverage external cues such as hand movements to help with the anticipation task~\cite{Liu20eccv, Dessalene21}. Dense action anticipation predicts \emph{all} subsequent actions and their durations for longer horizons of the unobserved sequence. Recursive methods~\cite{Farha18, Fadime20} use an encoder to extract visual features from the observed sequence and use an RNN as a decoder to predict future actions and their duration sequentially. As recursive predictions may accumulate and propagate errors, Ke~\emph{et al.}~\cite{Ke19} anticipates actions directly for specific future times in a single shot. When it comes to duration anticipation, all previous methods are relatively simple in that they apply a linear layer on top of the features of observed or predicted actions. Only past action features are used, without taking action correlations into account. Intuitively, actions with higher correlations with current action tend to influence more on current action's duration. Consequently, our method improves on previous works by introducing an attention mechanism for duration anticipation. To date, all methods for dense anticipation~\cite{Farha18,Fadime20,Ke19} follow a fully supervised setting and require extensive annotations for learning. Driven by the laborious demand of fully labelled data in computer vision, some researchers focus on weakly- or semi-supervised learning to reduce annotation workload~\cite{Ahn19, Liu20, Lee21, Chen20}. Previously,~\cite{Ng20} apply a weakly-supervised model on forecasting future action sequences, where only action sequences rather than frame-wise labels are provided as coarse labels. They combine the attention scheme with GRU to recurrently predict action labels with more focus on related observed actions, which is similar to our duration attention. Our work is similar in spirit to the teacher-student model~\cite{Tarvainen17, Laine16} which also uses an auxiliary model to support training. However, we do not explicitly enforce label consistency between the two models and instead use a third refinement module to directly improve the pseudo-labels. Pseudo-labels are widely used in weak supervision~\cite{ChangY20, WangJ20, Zhang21}. Most often they are only propagated for unlabelled or semi-labelled data. We also generate for fully-labelled data and by minimizing the distance between ground truth and improved pseudo labels by our refinement module, we make the model adaptive refine the accuracy of pseudo labels. \begin{figure*}[t!] \centering \includegraphics[width=1.0\linewidth]{images/Figure2.eps} \caption{Method overview. (a) The conditional module is trained on the small set of fully-labelled data to generate pseudo-labels. Once trained, it remains fixed, and does not contribute gradients in the following steps. (b) The primary module is trained on the small set of fully-labelled data and the large set of weakly-labelled data with the first future action label as the incomplete label. The weak labels are augmented into full pseudo-labels by refining the outputs of the conditional module.} \label{fig:02_overview} \end{figure*} \section{Method} Our proposed framework is both semi- and weakly-supervised. It is trained on a small set of fully labelled videos and a large set of weakly labelled videos with only the first action in the anticipated sequence. The model is comprised of three components: a primary module used during inference (Sec.~\ref{sec:primary}), a conditional module for generating pseudo-labels (Sec.~\ref{sec:conditional}), and a sequence refinement module (Sec.~\ref{sec:refinement}) to refine the estimated pseudo-labels. We treat the primary and conditional modules as black-box encoder-decoders, where the observed video is encoded into features, while the decoder generates the anticipated action labels and durations. As the proposed framework is general, we can use any previously proposed dense anticipation model~\cite{Farha18,Fadime20,Ke19} as a backbone. The training procedure can be broken down into two stages. The conditional module is trained initially on the fully-labelled set $\mathcal{F}$ so that it can be used to generate pseudo-labels for the weakly-labelled data. The combined set of the fully-labelled and the pseudo-labelled weak data $\mathcal{W}$ then merged to train the primary module. Directly using the pseudo-labels may result in confirmation bias, as these labels are generated from a model which is learned only on the small set of fully-labelled data. Therefore we refine the pseudo-labels with a sequence refinement module which is learned simultaneously with the primary module. Fig.~\ref{fig:02_overview} illustrates an overview. \subsection{Preliminaries}\label{sec:prelim} For a given video, $\textbf{x}=\{x_{1}, \dots, x_{t}, \dots, x_{T}\}$ denotes the set of $T$ observed frames. Dense anticipation aims to predict the future $M$ action labels $\textbf{c}=\{c_{1}, \dots, $ $c_{m}, \dots, c_{M}\}$ and associated durations $\textbf{d}=\{d_{1}, \dots, d_{m}, \dots, d_{M}\}$ for frames $T+1$ onwards until the end of the video sequence. Note that $t$ is a per-frame index in the video, while $m$ is a per-action index. A fully supervised setting is then associated with a set of data $\mathcal{F}=\left\{\left(\textbf{x}, \textbf{c}, \textbf{d}\right)\right\}$. We also denote the action labels and duration jointly by $\mathbf{y} = \{y_1, \dots y_m \dots y_M\}$, where $y_m = (c_m, d_m)$, and distinguish the ground truth and the corresponding predictions as ${y}_m$ and $\hat{y}_m$ respectively. Under a weakly-supervised setting, we assume we are given the set $\mathcal{W}=\left\{\left(\textbf{x},\textbf{c}'\right)\right\}$, \emph{i.e.} observed videos of $T$ observed frames $\textbf{x}=\{x_{1}, \dots, x_{t}, \dots, x_{T}\}$, along with the weak label $\textbf{c}'=c_1$, \emph{i.e.} the action label of frame $x_{T+1}$. There are no assumptions on $T$, \emph{i.e.} if the observed sequence end in the middle of an action, $c_1$ will be the current action label; if $T$ is exactly the last frame of an action, then $c_1$ will be the label of the next action. This translates to the dense anticipation protocol of previous works~\cite{Fadime20,Farha18,Ke19} in which the first $X\%$ of a video is observed and predictions are made on the following $Y\%$ from $X$ to $X+Y$. Therefore, we use as the weak label the first frame of the remaining $Y\%$. We formulate dense anticipation as a mixed classification and regression task to anticipate the action labels and duration respectively. Without any assumption on the backbone anticipation method, we will refer to the primary module as function $f(\mathbf{x})$ and the conditional module as function $f_{\text{cond}}(\mathbf{x}, \mathbf{c}')$. The conditional module is trained based on the loss in Eq.~\ref{eq:condloss}. Then, $\mathcal{F}$ and $\mathcal{W}$ are used to train the primary module with conditional module fixed as elaborated in Section ~\ref{sec:primary}. The main issue is how to adjust pseudo-labels. \subsection{Conditional Module}~\label{sec:conditional} The conditional module $\tilde{\mathbf{y}} = f_{\text{cond}}(\textbf{x},\textbf{c}')$ is an auxiliary component trained for generating pseudo labels $\tilde{\mathbf{y}}$ for the weak set $\mathcal{W}$. To do so, it is trained in the standard way using $\mathcal{F}$ with the following loss function \begin{equation} L_{\text{cond}} = \frac{1}{|\mathcal{F}|}\sum_{\mathcal{F}}\sum_{m=1}^M\left( -c_m\log(\hat{c}^{\text{cond}}_m) + (d_m-\hat{d}^{\text{cond}}_m)^2\right), \label{eq:condloss} \end{equation} where the first term is a cross-entropy loss for the anticipated action label $\hat{c}^{\text{cond}}_m$, while the second term is an MSE for the predicted action duration $\hat{d}^{\text{cond}}_m$. After training, the conditional module remains fixed. For generating pseudo labels, we simply apply $f_{\text{cond}}$. However, to make full use of the weak label, we replace the estimated $\hat{c}_1$ with the weak label $\mathbf{c}' = c_1$, \emph{i.e.} $\tilde{\mathbf{y}}= \{(c_1, \hat{d}^{\text{cond}}_1), (\hat{c}^{\text{cond}}_2,\hat{d}^{\text{cond}}_2), \dots, (\hat{c}^{\text{cond}}_M,\hat{d}^{\text{cond}}_M)\}$. \subsection{Primary model}~\label{sec:primary} The primary module $\hat{\mathbf{y}} = f(\textbf{x})$ predicts the future action and duration sequence $\hat{\mathbf{y}}$ given video $\mathbf{x}$ and is the module used for inference. During training, the objective is to minimize a loss based on the labelled ground truth $\mathcal{F}$ and the refined pseudo-labels of $\mathcal{W}$, \emph{i.e.} \begin{equation} \begin{split} L_{\text{prim}} = & \frac{1}{|\mathcal{F}|}\sum_{\mathcal{F}}\sum_{m=1}^M \left(-c_m\log(\hat{c}_m) + (d_m-\hat{d}_m)^2\right) + \frac{1}{|\mathcal{W}|}\sum_{\mathcal{W}}\left(-c_1\log(\hat{c}_1)\right)\\ +&\frac{1}{|\mathcal{W}|}\sum_{\mathcal{W}}\left(\sum_{m=2}^M \left(-\tilde{c}_m'\log(\hat{c}_m)\right) + \sum_{m=1}^M(\tilde{d}_m'-\hat{d}_m)^2\right), \label{eq:primloss} \end{split} \end{equation} where $\hat{y}_m = (\hat{c}_m, \hat{d}_m)$ is the predicted label from the primary module while $\tilde{y}_m' = (\tilde{c}_m', \tilde{d}_m')$ is the refined pseudo-labels (see Sec.~\ref{sec:refinement}) on $\mathcal{W}$. The first two terms represent the loss based on ground truth labels on $\mathcal{F}$ and $\mathcal{W}$; we term this $L_{\text{label}}$. The third term in the loss is based on pseudo-labels on $\mathcal{W}$ and we term this $L_{\text{pseudo-label}}$. \subsection{Sequence Refinement}\label{sec:refinement} Directly using the pseudo-labels from the conditional module to train the primary module does not allow us to fully benefit from $\mathcal{W}$, since the conditional module is trained only on $\mathcal{F}$. As $\mathcal{F}$ is quite small (5-15\% of the training set in our case), there is also the risk of confirmation bias~\cite{Arazo20}. To mitigate this possibility, we learn a refinement module to refine the pseudo-labels from the conditional module. For a video $\mathbf{x}$, the refinement module can be expressed as a function $F$ applied the predicted labels from the primary module and the estimated pseudo-labels from the conditional module, \emph{i.e.} \begin{equation} \tilde{\mathbf{y}}' = F(\hat{\mathbf{y}}, \tilde{\mathbf{y}}) = F \left(f(\textbf{x}), f_{\text{cond}}((\textbf{x},\textbf{c}'))\right). \end{equation} \noindent We propose two refinement schemes as different options for $F$ which we outline below.\\ \noindent \textbf{Linear Refinement.} As a naive baseline, we first propose to use a weighted geometric mean of the primary and conditional module outputs, where we consider $\hat{c}$ as a probability estimate over the classes. To that end, the refined label can be defined as \begin{equation} \tilde{\mathbf{y}}' = f(\textbf{x})^{\frac{1}{\alpha+1}} \cdot f_{\text{cond}}((\textbf{x}, \textbf{c}'))^{\frac{\alpha}{\alpha+1}}, \label{eq:klmin} \end{equation} where $\alpha$ is a hyperparameter determining the weighting of each component. Note that $\tilde{\mathbf{y}}'$ is actually the optimal solution when considering a linear weighting of the minimal KL divergences between (1) the refined pseudo-label $\tilde{\mathbf{y}}'$ and the estimate of the primary module $\hat{\mathbf{y}}$ as well as between $\tilde{\mathbf{y}}'$ and (2) the estimate of the conditional module $\tilde{\mathbf{y}}$. Intuitively, the refined output is the ``closest'' sequence to both modules' predictions. From Eq.~\ref{eq:klmin}, it can be observed that when $\alpha=\infty$, $\tilde{\mathbf{y}}'=f_{\text{cond}}(\textbf{x}, \textbf{c}')$ while $\alpha=0$ gives $\tilde{\mathbf{y}}'=f(\textbf{x})$. These two extreme cases correspond to the refinement directly using the conditional or primary module outputs as the refined sequence respectively. We define a schedule for $\alpha$ to decrease from a large to a small value. This is based on the rationale that at the outset of training, the primary module is not so accurate and will need to rely on the conditional module, but as training progresses a smaller $\alpha$ is more suitable.\\ \noindent \textbf{Adaptive Refinement.} Instead of a manually set schedule for $\alpha$, we can also directly learn a refined output. Ideally, we would like for the refined outputs $\tilde{\mathbf{y}}'$ to be more accurate than the outputs of both $f(\textbf{x})$ and $f_{\text{cond}}(\textbf{x}, \textbf{c}')$. We can do this by leveraging the ground truth labels of $\mathcal{F}$ and adding a loss on the refined output $\tilde{\mathbf{y}}'$: \begin{equation} \begin{split} L_{\text{adap}} = L_{\text{prim}} + \frac{1}{|\mathcal{F}|}\sum_{\mathcal{F}}\sum_{m=1}^M\bigg(-c_m\log(\tilde{c}'_m) + (d_m-\tilde{d}'_m)^2\bigg). \end{split} \label{eq:autoloss} \end{equation} \noindent The adaptive refinement is realized via a linear layer that takes predicted and pseudo sequences and outputs a refined one. One key change made when learning the adaptive refinement as opposed to the linear refinement is that the conditional module is trained on only a portion of $\mathcal{F}$ (we opt for half out of simplicity). We purposely limit the training of the conditional module to prevent the refinement module from fully relying on its output. Then, $\mathcal{F}$ is used to train the primary and refinement module simultaneously. The objective function contains two parts: loss between output from the primary module $\hat{y}$ and ground truth (\emph{i.e.} the first term in Eq.~\ref{eq:primloss}) and refined output $\tilde{y}'$ and ground truth (\emph{i.e.} the second term in Eq.~\ref{eq:autoloss}). Lastly, $\mathcal{F}$ as well as $\mathcal{W}$ is then applied to learn the primary and refinement module concurrently based on the loss in Eq.~\ref{eq:autoloss}. We refer readers to Supplementary Section 8 to get a better idea of the training process. \subsection{Duration Attention}\label{sec:attn} We introduce attention for the duration estimation; this is applicable only to recursive dense anticipation methods~\cite{Farha18,Fadime20}. At the decoder, the action label and duration for action $m$ would be classified and regressed directly from the hidden state $H_m$. We propose to add an attention score between the hidden state and the input video to improve the duration estimate. Specifically, given video encoding $\mathcal{I}$, the attention weighted sum of the encoding can be defined as: \begin{equation}\label{eq:attn} \mathbf{attn}(H_{m}',\mathcal{I}) = \text{softmax}(\frac{H_{m}'\mathcal{I}^{\intercal}}{\sqrt{d_I}})\mathcal{I}, \qquad \text{where} \qquad H_{m}' = WH_{m}+b \end{equation} \noindent where $W \in \mathbb{R}^{d_I\times d_h}$ and $b \in \mathbb{R}^{d_I}$ are learned parameters, $\mathcal{I}^{\intercal}$ is the transpose of $\mathcal{I}$, $d_h$ and $d_I$ are the dimensionality of $H_m$ and $\mathcal{I}$ respectively. The attention-based duration $\hat{d}_m$ is estimated as a linear transformation of the previous hidden state $H_{m-1}$ and the weighted encoding: \begin{equation}\label{eq:duration} \hat{d}_{m} = [\mathbf{attn}(H_{m}',\mathcal{I}), H_{m-1}]\mathbf{\beta}+\mathbf{\epsilon} \end{equation} \noindent where $\mathbf{\beta}$, $\mathbf{\epsilon}$ are learned parameters and $[ \cdot ]$ denotes a concatenation.\\ \noindent \textbf{Duration Attention Regularizer.} To further minimize the prediction differences between the primary and conditional module, we encourage the attention score between the two modules to be similar. To that end, we add to the objective functions Eq.~\ref{eq:primloss} and Eq.~\ref{eq:autoloss} an $l_2$-norm between the attention scores of the conditional and primary modules, \emph{i.e.} \begin{equation}~\label{eq:duration_regularizer} \begin{split} L_{\text{prim}}' = L_{\text{prim}} + \sum_{m=1}^M\|\mathbf{attn}_m^{\text{prim}}-\mathbf{attn}_m^{\text{cond}}\|_2^2 \end{split} \end{equation} where $\mathbf{attn}_m^{\text{prim}}$ and $\mathbf{attn}_m^{\text{cond}}$ represent the attention scores of step $m$ in the primary and conditional modules respectively. The same regularizer is also added to Eq.~\ref{eq:autoloss} to yield $L_{\text{adap}}'$. \section{Experiments} \subsection{Datasets, Evaluation \& Implementation Details} We evaluate our method on the two benchmark datasets used in dense anticipation: Breakfast Actions~\cite{Kuehne14} and 50Salads~\cite{Stein13}. Both datasets record realistic cooking activities, with each video featuring a sequence of continuous actions in making either a breakfast item or a salad\footnote{Dataset details are in the Supplementary Section 1.}. From the designated training splits of each dataset, we partition 15\% and 20\% of the training data for the fully labelled set $\mathcal{F}$ for Breakfast and 50Salads respectively\footnote{We use a slightly higher percentage for 50Salads due to the small dataset size}. The remaining 85\% / 80\% of training sequences are assigned to $\mathcal{W}$ and have only a weak label, \emph{i.e.} the single action label $c_1$ (see Sec.~\ref{sec:prelim}). Following the conventions of~\cite{Farha18,Fadime20,Ke19}, we observe 20\% or 30\% of the video and anticipate the subsequent 20\% and 50\% of the video sequence (with additional results on 10\% and 30\% in the Supplementary Section 2). In line with previous works, we evaluate our anticipation results with mean over classes (MoC)~\cite{Farha18}. As input features, we use the 64-dimension Fisher vectors computed on top of improved dense trajectories~\cite{IDT} as provided by~\cite{Farha18} on a per-frame basis. Currently, as all dense anticipation methods are fully supervised, there are no direct comparisons to competing state-of-the-art methods. However, as our framework is general, we experiment with 3 different anticipation methods as backbones in a series of self-comparisons. We test using (1) a naive RNN where both encoder and decoder is a one-layer LSTM with 512 hidden dimensions (2) the one-shot method of Ke~\cite{Ke19} and (3) the recursive method of Sener~\cite{Fadime20}. Our result for Ke \emph{et al.} is our re-implementation as they do not provide source code; our fully-supervised re-implementation yields similar values as their reported results. All hyperparameters follow the original settings in their papers. For the linear refinement method, $\alpha$ begins from 30 and decreases to 0.5 with a decay rate of 0.95 per epoch. The batch size is 2 for 50Salads and 16 for Breakfast. Using linear refinement, the model converges at about 20 epochs for the first step and 25 epochs for the second step. The model converges at about 15 epochs for the first step, 20 for the second and third step when using adaptive refinement. \begin{table*}[t!] \caption{MoC of different models. Results reported in Baseline (1) for Ke~\cite{Ke19} and Sener~\cite{Fadime20} are taken directly from their published results. Other results are averaged on the officially provided different splits for training (which is further split into fully- and weakly-labeled sets randomly according to the percentages mentioned above) and test set.} \begin{center} \small \begin{tabular}{|p{1.3cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|} \hline \quad & \multicolumn{4}{|c|}{Breakfast} &\multicolumn{4}{|c|}{50Salads} \\ \hline Obs. & \multicolumn{2}{|c|}{20\%} & \multicolumn{2}{|c|}{30\%} & \multicolumn{2}{|c|}{20\%} & \multicolumn{2}{|c|}{30\%} \\ \hline Pred. & 20\% & 50\% & 20\% & 50\% & 20\% & 50\% & 20\% & 50\% \\ \hline \rowcolor{green!20} \multicolumn{9}{|l|}{Baseline 1: $f(\mathbf{x})$, fully-supervised on entire training set (theoretical upper bound)}\\ \hline \rowcolor{green!20} RNN & 6.53 & 5.30 & 8.52 & 5.37 & 9.71 & 7.82 & 12.64 & 8.54\\ \rowcolor{green!20} Ke~\cite{Ke19} & 11.92 & 7.03 & 12.26 & 8.18 & 11.53 & 9.50 & 15.92 & 9.89\\ \rowcolor{green!20} Sener~\cite{Fadime20} & 13.10 & 11.10 & 17.00 & 15.10 & 19.90 & 15.10 & 22.50 & 11.20\\ \hline \rowcolor{red!20} \multicolumn{9}{|l|}{Baseline 2: $f(\mathbf{x})$, supervised on full label set $\mathcal{F}$ (theoretical lower bound)} \\ \hline \rowcolor{red!20} RNN & 3.92 & 2.35 & 5.48 & 4.26 & 8.08 & 5.45 & 8.13 & 6.70\\ \rowcolor{red!20} Ke~\cite{Ke19} & 6.81 & 5.39 & 7.32 & 5.88 & 8.36 & 4.51 & 11.19 & 8.23\\ \rowcolor{red!20} Sener~\cite{Fadime20} & 6.19 & 4.90 & 7.30 & 5.92 & 8.67 & 7.01 & 12.73 & 8.00\\ \hline \rowcolor{cyan!20} \multicolumn{9}{|l|}{Baseline 3: $f(\mathbf{x})$, supervised on full label set $\mathcal{F}$ + weak set $\mathcal{W}$ with $L_{\text{label}}$} \\ \hline \rowcolor{cyan!20} RNN & 6.01 & 4.29 & 7.56 & 5.93 & 9.33 & 6.96 & 11.45 & 8.54\\ \rowcolor{cyan!20} Ke~\cite{Ke19} & 8.89 & 5.71 & 10.05 & 7.59 & 9.25 & 6.11 & 13.17 & 9.80\\ \rowcolor{cyan!20} Sener~\cite{Fadime20} & 7.64 & 5.54 & 8.05 & 6.77 & 9.97 & 7.89 & 13.30 & 9.61\\ \hline \rowcolor{blue!20} \multicolumn{9}{|l|}{Our model with adaptive refinement but without duration attention.} \\ \hline \rowcolor{blue!20} RNN & 7.85 & 7.96 & 8.33 & 8.21 & 10.48 & 7.40 & 13.04 & 10.05\\ \rowcolor{blue!20} Ke~\cite{Ke19} & 9.74 & 6.24 & 11.02 & 9.24 & 11.84 & 9.27 & 13.88 & 12.81\\ \rowcolor{blue!20} Sener~\cite{Fadime20} & 8.98 & 7.71 & 9.71 & 7.31 & 12.62 & 9.44 & 13.94 & 10.73\\ \hline \multicolumn{9}{|l|}{Our full model with adaptive refinement and duration attention.} \\ \hline RNN & 9.12 & 8.33 & 10.17 & 8.90 & 12.11 & 9.57 & 14.37 & 10.91\\ Sener~\cite{Fadime20} & 9.74 & 8.56 & 11.63 & 8.99 & 12.41 & 9.67 & 14.94 & 12.14\\ \hline \end{tabular} \end{center} \label{tb:result} \end{table*} \subsection{Supervised Baselines} We first compare the impact that the amount of data would have on the fully supervised case (see Table~\ref{tb:result}). We design three baselines and in each case, train a stand-alone primary module. Baseline (1) is fully supervised on the entire training set -- this signifies the upper bound that our weakly-supervised method can achieve. Baseline (2) is supervised on only the labelled set $\mathcal{F}$. This baseline gives some indicator of the accuracy of the conditional module before the weak label is applied to replace $\hat{c}_1$ and acts as a lower bound. Baseline (3) supervised on the given labels of $\mathcal{F}$ and $\mathcal{W}$, \emph{i.e.} applying the first two terms or $L_{\text{label}}$ of Eq.~\ref{eq:primloss}. This baseline tells us what can be learned from the full set of provided labels. Full supervision with the entire training set, \emph{i.e.} Baseline (1) achieves the best results, with the model of Sener~\emph{et al.}~\cite{Fadime20} performing best. However, performance drops with fewer labels, \emph{i.e.} Baselines (2) and (3) and the one-shot method of Ke~\emph{et al.}~\cite{Ke19} is slightly stronger than~\cite{Fadime20}. The gains from adding the labels of the weak set $\mathcal{W}$, \emph{i.e.} from Baseline (2) to (3) demonstrate that having even a single $c_1$ label helps to improve MoC by 1-2\%. \subsection{Impact of Adding Pseudo-Labels and Duration Attention} If we add pseudo-labels to train the primary module, \emph{i.e.} by applying the full loss given in Eq.~\ref{eq:primloss} (see Table~\ref{tb:result}, fourth section) and using adaptive refinement, we observe that we gain in performance across the board when compared to Baseline (3), even though it uses the same amount of provided ground truth labels. The most impressive is the RNN encoder-decoder model. With only the pseudo-labels from the weak set, we can surpass the original fully supervised baseline. Using the one-shot method from Ke~\cite{Ke19}, we can surpass the supervised baseline when anticipating 50\% of the sequence after observing 30\% for both Breakfast and 50Salads. On Sener's model~\cite{Fadime20}, however, we are not able to surpass the fully supervised baseline, though the gap closes progressively. Our full model (Table~\ref{tb:result}, fifth section) which incorporates the attention duration sees additional gains in most settings. There is also a visual explanation in Supplementary Section 4 which intuitively illustrates different correlations between different observed actions and current predicted action. Note that we do not apply the duration attention to the model of Ke~\cite{Ke19} since it is not recursive. All three backbones improve from Baseline (3) when adding adaptive refinement and duration attention. Given the challenge of the dense anticipation task, however, the overall performance is still very low, especially for the simple RNN and Ke's~\cite{Ke19} model. This is likely the reason why adding our framework can outperform the fully supervised case. As the models are rather simplistic, we speculate they cannot fully leverage all the ground truth labels from the entire training dataset (Table~\ref{tb:result}, Baseline (1)). Training with our framework (Table~\ref{tb:result}, our model in purple and white section) may result in even higher accuracies because our refined pseudo-labels, while less accurate than ground truth, model a simpler distribution. \subsection{Future Horizon of Anticipated Actions} We analyze in Table~\ref{tb:action_acc} the anticipated actions over time by computing the accuracy for the first future action (weak label) versus the next three actions (no label). The trends for the two settings are very different; Baseline 3 without the conditional module has a sharp drop-off from the second action. This is unsurprising since most videos have only a weak label of the first future action. Incorporating our conditional module with the refined pseudo-labels improves the first action's accuracy and decreases the drop-off of subsequent actions. Refer to Supplementary Section 7 for a visualization of the anticipated action sequence. \begin{table}[H] \caption{Accuracy of the predicted actions at different time steps.} \centering \begin{tabular}{|c|c|c|c|c|} \hline \quad & First & Second & Third & Fourth\\ \hline Baseline 3 & 16.17 & 6.49 & 3.22 & 1.67\\ Our full model & 18.75 & 14.33 & 9.09 & 5.49\\ \hline \end{tabular} \label{tb:action_acc} \end{table} \subsection{Ablation Study} In the following experiments we use Sener's~\cite{Fadime20} method as the backbone, an observation of 30\% and anticipation of 10\%. Table~\ref{tb:corr} verifies that refining the pseudo-labels is more effective than training with them directly. Furthermore, the learned adaptive refinement is better than the linear refinement as it improves upon the linear scheme by 4\% on both datasets. In addition to Fisher vector IDT features, we also experiment with the ground truth labels and the stronger I3D features~\cite{Carreira17} as inputs, the result is shown in Table~\ref{tb:feat}. To use ground truth labels as input, we simply use a one-hot vector. It gives much higher accuracy, indicating that there is still some gap in recognition performance. The same gap was also confirmed in~\cite{Fadime20}. In line with previous results which use both features, I3D achieves higher MoC than Fisher vector. We observe, however, that using I3D features requires longer training time, \emph{i.e.} 20 epochs in step 1 and 2, 25 epochs in step 3 (we refer readers to Section 3.4 in the main paper and Section 8 in the Supplementary for a detailed training procedure), likely due to the larger dimensionality of I3D compared to Fisher vectors. \begin{table}[H] \quad \parbox{0.45\linewidth}{ \caption{MoC on different refinements.} \centering \begin{tabular}{|c|c|c|} \hline \quad & Breakfast & 50Salads \\ \hline No refinement & 6.28 & 10.31\\ Linear & 7.79 & 12.17 \\ Adaptive & 12.78 & 16.24 \\ \hline \end{tabular} \label{tb:corr} } \quad \parbox{0.45\linewidth}{ \caption{MoC on different video features.} \centering \begin{tabular}{|c|c|c|} \hline \quad & Breakfast & 50Salads \\ \hline Ground truth & 61.30 & 35.40 \\ Fisher vector & 12.78 & 16.24 \\ I3D & 15.65 & 21.30 \\ \hline \end{tabular} \label{tb:feat} } \end{table} \section{Conclusion} In this paper, we investigate a novel dense anticipation task, emphasizing pseudo labels to promote anticipation accuracy using weakly-labelled videos. To predict accurate action/duration sequences, we propose a sequence refinement method that generates pseudo sequences conditioned on the next-step action and adaptively refines the pseudo sequences to guide prediction. We also introduce duration attention which takes action correlations into account to boost duration anticipation. The proposed method outperforms, if not better than, other fully supervised methods while requiring far less annotation effort. More datasets will be involved in future works. \noindent\textbf{Acknowledgements }This research is supported by the National Research Foundation, Singapore under its NRF Fellowship for AI (NRF-NRFFAI1-2019-0001). \bibliographystyle{unsrt} \section{Dataset Details} \noindent \textbf{Breakfast Actions} contains 1712 videos which are performed by 52 different individuals in 18 different kitchens. The videos are unscripted and uncontrolled with natural lighting, view points and environments. \textbf{50Salads} is food preparation dataset capturing 25 people preparing 2 mixed salads each. Both datasets have standardized train-test splits which we follow. We further split the training set into fully- and weakly-labelled sets, with specific proportions and other details in Table~\ref{tb:info}. \begin{table}[H] \caption{Basic information of dataset.} \begin{center} \small \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline Dataset & fps & \tabincell{c}{Video duration\\median, mean$\pm$std} & Classes & Total & Train & Full & Weak & Test \\ \hline Breakfast & 15 & 91s, 140s$\pm$122 & 48 & 1712 & 1460& 15\% & 85\% & 252\\ 50Salads & 30 & 389s, 370s$\pm$106 & 19 & 50 & 40 & 20\% & 80\% & 10\\ \hline \end{tabular} \end{center} \label{tb:info} \end{table} \section{Complete Results} \begin{table*} \caption{MoC of different methods on Breakfast. Better viewed in colour.} \begin{center} \small \begin{tabular}{|p{1.3cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|} \hline Observed & \multicolumn{4}{|c|}{20\%} & \multicolumn{4}{|c|}{30\%} \\ \hline Predicted & 10\% & 20\% & 30\% & 50\% & 10\% & 20\% & 30\% & 50\% \\ \hline \rowcolor{green!20} \multicolumn{9}{|l|}{Baseline 1: $f(\mathbf{x})$, fully-supervised on entire training set (theoretical upper bound)} \\ \hline \rowcolor{green!20} RNN & 8.39 & 6.53 & 5.93 & 5.30 & 9.19 & 8.52 & 7.92 & 5.37 \\ \rowcolor{green!20} Ke & 13.04 & 11.92 & 7.76 & 7.03 & 14.24 & 12.26 & 11.60 & 8.18 \\ \rowcolor{green!20} Sener & 15.60 & 13.10 & 12.10 & 11.10 & 19.50 & 17.00 & 15.60 & 15.10 \\ \hline \rowcolor{red!20} \multicolumn{9}{|l|}{fully-supervised on the fully labelled subset (theoretical lower bound)} \\ \hline \rowcolor{red!20} RNN & 5.48 & 3.92 & 3.45 & 2.35 & 5.98 & 5.48 & 5.23 & 4.26 \\ \rowcolor{red!20} Ke & 7.18 & 6.81 & 5.32 & 5.39 & 9.83 & 7.32 & 6.33 & 5.88 \\ \rowcolor{red!20} Sener & 7.47 & 6.19 & 5.18 & 4.90 & 7.93 & 7.30 & 5.47 & 5.92 \\ \hline \rowcolor{cyan!20} \multicolumn{9}{|l|}{Baseline 3: $f(\mathbf{x})$, supervised on full label set $\mathcal{F}$ + weak set $\mathcal{W}$ with $L_{\text{label}}$} \\ \hline \rowcolor{cyan!20} RNN & 7.29 & 6.01 & 5.16 & 4.29 & 8.34 & 7.56 & 6.62 & 5.93 \\ \rowcolor{cyan!20} Ke & 9.76 & 8.89 & 6.51 & 5.71 & 11.71 & 10.05 & 8.52 & 7.59 \\ \rowcolor{cyan!20} Sener & 8.09 & 7.64 & 6.37 & 5.54 & 9.38 & 8.05 & 7.45 & 6.77 \\ \hline \rowcolor{blue!20} \multicolumn{9}{|l|}{Our model with adaptive refinement but without duration attention.} \\ \hline \rowcolor{blue!20} RNN & 9.87 & 7.85 & 6.89 & 7.96 & 10.90 & 8.33 & 8.31 & 8.21 \\ \rowcolor{blue!20} Ke & 11.82 & 9.74 & 7.32 & 6.24 & 13.75 & 11.02 & 10.06 & 9.24 \\ \rowcolor{blue!20} Sener & 9.03 & 8.98 & 7.64 & 7.71 & 10.11 & 9.71 & 8.11 & 7.31 \\ \hline \multicolumn{9}{|l|}{Our full model with adaptive refinement and duration attention} \\ \hline RNN & 9.93 & 9.12 & 8.70 & 8.33 & 12.55 & 10.17 & 9.54 & 8.90 \\ ours & 10.09 & 9.74 & 7.99 & 8.56 & 12.78 & 11.63 & 10.73 & 8.99 \\ \hline \end{tabular} \end{center} \label{tb:breakfast} \end{table*} \begin{table*} \caption{MoC of different methods on 50Salads. Better viewed in colour.} \begin{center} \small \begin{tabular}{|p{1.3cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|p{0.7cm}|} \hline Observed & \multicolumn{4}{|c|}{20\%} & \multicolumn{4}{|c|}{30\%} \\ \hline Predicted & 10\% & 20\% & 30\% & 50\% & 10\% & 20\% & 30\% & 50\% \\ \hline \rowcolor{green!20} \multicolumn{9}{|l|}{Baseline 1: $f(\mathbf{x})$, fully-supervised on entire training set (theoretical upper bound)}\\ \hline \rowcolor{green!20} RNN & 11.49 & 9.71 & 9.60 & 7.82 & 12.97 & 12.64 & 11.83 & 8.54 \\ \rowcolor{green!20} Ke & 12.29 & 11.53 & 10.97 & 9.50 & 16.34 & 15.92 & 11.56 & 9.89 \\ \rowcolor{green!20} Sener & 25.50 & 19.90 & 18.20 & 15.10 & 30.60 & 22.50 & 19.10 & 11.20 \\ \hline \rowcolor{red!20} \multicolumn{9}{|l|}{Baseline 2: $f(\mathbf{x})$, supervised on full label set $\mathcal{F}$ (theoretical lower bound)} \\ \hline \rowcolor{red!20} RNN & 9.81 & 8.08 & 6.59 & 5.45 & 10.65 & 8.13 & 7.52 & 6.70 \\ \rowcolor{red!20} Ke & 9.16 & 8.36 & 7.65 & 4.51 & 12.69 & 11.19 & 8.31 & 8.23 \\ \rowcolor{red!20} Sener & 11.36 & 8.67 & 7.30 & 7.01 & 13.16 & 12.73 & 10.95 & 8.00 \\ \hline \rowcolor{cyan!20} \multicolumn{9}{|l|}{Baseline 3: $f(\mathbf{x})$, supervised on full label set $\mathcal{F}$ + weak set $\mathcal{W}$ with $L_{\text{label}}$} \\ \hline \rowcolor{cyan!20} RNN & 10.60 & 9.33 & 8.31 & 6.96 & 13.25 & 11.45& 10.55 & 8.54 \\ \rowcolor{cyan!20} Ke & 11.87 & 9.25 & 8.83 & 6.11 & 14.97 & 13.17 & 10.74 & 9.80 \\ \rowcolor{cyan!20} Sener & 12.91 & 9.97 & 8.86 & 7.89 & 14.63 & 13.30 & 11.19 & 9.61 \\ \hline \rowcolor{blue!20} \multicolumn{9}{|l|}{Our model with adaptive refinement but without duration attention.} \\ \hline \rowcolor{blue!20} RNN & 12.72 & 10.48 & 9.84 & 7.40 & 14.52 & 13.04 & 12.72& 10.05 \\ \rowcolor{blue!20} Ke & 15.00 & 11.84 & 10.96 & 9.27 & 15.66 & 13.88 & 12.89 & 12.81 \\ \rowcolor{blue!20} Sener & 13.07 & 12.62 & 10.01 & 9.44 & 15.25 & 13.94 & 11.44 & 10.73 \\ \hline \multicolumn{9}{|l|}{Our full model with adaptive refinement and duration attention} \\ \hline RNN & 14.53 & 12.11 & 10.06 & 9.57 & 15.09 & 14.37 & 13.25 & 10.91 \\ ours & 16.80 & 12.41 & 10.12 & 9.67 & 16.24 & 14.94 & 13.53 & 12.14 \\ \hline \end{tabular} \end{center} \label{tb:salad} \end{table*} We provide a complete set of anticipations (10\%, 20\%, 30\% and 50\%) in Tables~\ref{tb:breakfast} and~\ref{tb:salad} for Breakfast and 50Salads respectively. Findings are consistent with the 20\% and 50\% results in the main paper. Baseline 1 is a fully supervised version; the MoC of Baseline 2 drops because we omit a large proportion of videos from the training set. We observe an increase in the performance of Baseline 3 compared to Baseline 2 when weak labels are added back to help training. The boosts manifested in Baseline 4 and 5 indicate the advantage of pseudo labels and duration attention respectively. \section{Variance in One Split} To further prove the randomness of our data choice and observe the variance in one split, we run 10 times on each split and plot the means and standard deviations. Here we use observation of 30\% and prediction of 20\% and use Sener's method as the backbone. As shown in Figure~\ref{fig:barchart}, we can see standard deviations of 50Salads are higher than those of Breakfast. The Reason may be that 50Salads has fewer videos, which is more unstable. \begin{figure} \begin{center} \includegraphics[width=0.8\linewidth]{images/variance.eps} \end{center} \caption{Bar charts of means and standard deviations in each split.} \label{fig:barchart} \end{figure} \section{Visualization of Attention Scheme} We use a heat map (Figure~\ref{fig:heatmap}) to further illustrate the advantage of our duration attention scheme. Take a video in 50Salads as an example, we track the attention score between current predicted action and observed actions. In the heat map, it's obvious that the correlation between ``cut cucumber'' and ``peel cucumber'' as well as the correlation between ``place tomato into bowl'' and ``cut tomato'' are the highest, which indicates that more relevant actions have more influence on current action duration. \begin{figure} \begin{center} \includegraphics[width=0.8\linewidth]{images/heatmap.eps} \end{center} \caption{Heat map of attention score between current predicted action and observed actions. x-axis is observed actions and y-axis is predicted actions. Deeper colour indicates higher attention score.} \label{fig:heatmap} \end{figure} \section{Full-Weak Split} We vary the proportion of fully-labelled data in the training set in Table~\ref{tb:split} and observe that by increasing the proportion of fully-labelled data (the total amount of data is fixed), the performance gets progressively closer to the fully supervised model. For the RNN and Ke's model, we are able to exceed the performance of the fully supervised model, though this is largely due to their poor baseline performance even with 100\% of the training data fully supervised. It is likely that these models, being simpler and having fewer parameters, require a smaller proportion of fully-labelled data. For a larger model like that of Sener, 25\% / 30\% of the data is not sufficient to match the fully-supervised performance. We omit experiments for RNN with split 25\% on Breakfast and split 30\% on 50Salads because MoC with smaller splits already exceeds fully-supervised results. \begin{table}[H] \caption{MoC on different full vs. weak data splits. Percentages indicate the proportion of fully-labelled data in the training set. RNN and Sener use our full model in the weakly-supervised setting,\emph{i.e.} with duration attention while Ke, as a one-shot method, does not have duration attention. $^*$100\% indicates the original fully-supervised model (also without duration attention).} \begin{center} \small \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline \quad & \multicolumn{4}{c|}{Breakfast} & \multicolumn{4}{c|}{50Salads} \\ \hline \quad & 5\% & 15\% & 25\% & 100\%$^*$ & 10\% & 20\% & 30\% & 100\%$^*$ \\ \hline RNN & 11.03 & 12.55 & \myslbox & 9.19 & 8.84 & 15.09 & \myslbox & 12.97 \\ \hline Ke & 12.40 & 13.75 & 17.45 & 14.24 & 11.73 & 15.66 & 20.00 & 16.34 \\ \hline Sener & 11.90 & 12.78 & 17.22 & 19.50 & 14.63 & 16.24 & 17.37 & 30.60 \\ \hline \end{tabular} \end{center} \label{tb:split} \end{table} \section{Memory Complexity Analysis} A simple comparison of memory complexity (expressed by the number of hyperparameters) of three baseline models (with fully-supervised setting) and our full model with adaptive refinement is shown in Table~\ref{tb:complexity}. Not surprisingly, the more complicated model has more hyperparameters. The number of hyperparameters of our full model is approximately two times the corresponding backbone's, which is in accordance with our intuition that the primary and conditional module is similar and are both based on the backbone. We omit time complexity analysis because it is not comparable between fully- and weakly-supervised models. \begin{table}[H] \caption{Memory complexity analysis.} \begin{center} \begin{tabular}{|c|c|c|c|c|c|} \hline \quad & RNN & Ke & Sener & Ours with RNN & Ours with Sener's\\ \hline 50Salads & 3579944 & 8937316 & 36997429 & 7159894 & 75374068 \\ \hline Breakfast & 3624546 & 9845839 & 40270080 & 7249098 & 81590790 \\ \hline \end{tabular} \end{center} \label{tb:complexity} \end{table} \section{Visualized Result} Figure~\ref{fig:visual} shows an example of anticipating 50\% of the sequence after observing 30\%, where each colour indicates an action. We can see that the action sequence is correct, but there are some errors in the predicted duration. \begin{figure}[H] \begin{center} \includegraphics[width=0.6\linewidth]{images/visualization.eps} \end{center} \caption{Visualized result for dense anticipation on Breakfast.} \label{fig:visual} \end{figure} \section{Pseudo Codes} Below are pseudo codes for linear refinement and adaptive refinement respectively. \begin{algorithm} \caption{Linear Refinement} \begin{algorithmic} \Require \text{initial model }$Prim, Cond$; $\mathcal{W}, \mathcal{F}$; \text{Epoch} $N_1, N_2$; $\alpha$, \text{decay parameter} $d$ \State $\text{Step 1:}$ \For {$n = 1\text{ to }N_1$} \State $pseudo\_label \leftarrow Cond(\mathcal{F})$ \State $L \leftarrow Loss(ground\_truth, pseudo\_label)$ \State \text{Update} $Cond$ \text{by minimizing} $L$ \EndFor \State \text{Fix} $Cond$ \State $\text{Step 2:}$ \For {$n = 1\text{ to }N_2$} \State $predicted\_label \leftarrow Prim(\mathcal{F})$ \State $L_1 \leftarrow Loss(ground\_truth, predicted\_label)$ \State $predicted\_label \leftarrow Prim(\mathcal{W})$ \State $pseudo\_label \leftarrow Cond(\mathcal{W})$ \State $refined\_label \leftarrow predicted\_label^{\frac{1}{\alpha+1}}*pseudo\_label^{\frac{\alpha}{\alpha+1}}$ \State $L_2 \leftarrow Loss(refined\_label, predicted\_label)$ \State \text{Update} $Prim$ \text{by minimizing} $L_1+L_2$ \State $\alpha \leftarrow d*\alpha$ \EndFor \end{algorithmic} \end{algorithm} \begin{algorithm}[t!] \caption{Adaptive Refinement} \begin{algorithmic} \Require \text{initial model }$Prim, Cond, Refine$; $\mathcal{W}, \mathcal{F}$; \text{Epoch} $N_1, N_2, N_3$ \State $\text{Step 1:}$ \For {$n = 1\text{ to }N_1$} \State $pseudo\_label \leftarrow Cond(\mathcal{F})$ \State $L \leftarrow Loss(ground\_truth, pseudo\_label)$ \State \text{Update} $Cond$ \text{by minimizing} $L$ \EndFor \State \text{Fix} $Cond$ \State $\text{Step 2:}$ \For {$n = 1\text{ to }N_2$} \State $predicted\_label \leftarrow Prim(\mathcal{F})$ \State $pseudo\_label \leftarrow Cond(\mathcal{F})$ \State $refined\_label \leftarrow Refine(predicted\_label, pseudo\_label)$ \State $L_1 \leftarrow Loss(ground\_truth, predicted\_label)$ \State $L_2 \leftarrow Loss(refined\_label, predicted\_label)$ \State \text{Update} $Prim, Refine$ \text{by minimizing} $L_1+L_2$ \EndFor \State $\text{Step 3:}$ \For {$n = 1\text{ to }N_3$} \State $predicted\_label \leftarrow Prim(\mathcal{F})$ \State $pseudo\_label \leftarrow Cond(\mathcal{F})$ \State $refined\_label \leftarrow Refine(predicted\_label, pseudo\_label)$ \State $L_1 \leftarrow Loss(ground\_truth, predicted\_label)$ \State $L_2 \leftarrow Loss(refined\_label, predicted\_label)$ \State $predicted\_label \leftarrow Prim(\mathcal{W})$ \State $pseudo\_label \leftarrow Cond(\mathcal{W})$ \State $refined\_label \leftarrow Refine(predicted\_label, pseudo\_label)$ \State $L_3 \leftarrow Loss(refined\_label, predicted\_label)$ \State \text{Update} $Prim, Refine$ \text{by minimizing} $L_1+L_2+L_3$ \EndFor \end{algorithmic} \end{algorithm} \end{document}
{'timestamp': '2021-11-16T02:27:46', 'yymm': '2111', 'arxiv_id': '2111.07593', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07593'}
arxiv
\section{Introduction} \IEEEPARstart{G}{raph} data structure is typically represented by an adjacency matrix, which has extensive sparsity. It relies on traditional matrix compression format, e.g., CSR, CSC, and COO, to save substantial storage resources, and is effectively processed by the sparse-based computing algorithm or library (SpMM, SpMV) on traditional computing devices (CPU, GPU, or TPU). However, in terms of PIM or computation-in-memory (CIM) platforms, which are typically implemented by memristive crossbars, the graph data must be restored from the storage format to the computing format (adjacency matrix) \cite{song2018graphr} before mapping. Apparently, directly mapping large-scale sparse graph data on a crossbar is not appropriate, for it will seriously affect the utilization and power consumption of memristive crossbars. In addition to the large-scale graph data, it is also fatal for batch graphs computing, in which the adjacency matrices are usually integrated into a large-scale super-matrix, with only the sub-graphs being internally connected, and the adjacency relationship across the graphs are null \cite{balog2019fast}. In recent years, some PIM-based literature \cite{cui2016towards, song2018graphr, dai2019graphsar} has made effective attempts in the efficient computation of sparse graphs on the neuromorphic computing platforms. Following clustering or reordering \cite{10.1145/800195.805928} of the sparse adjacency matrix, some fixed-size partitions or progressive block partition scheme \cite{balog2019fast, dai2019graphsar, song2018graphr} are proposed, among which only the blocks with non-zero entries need to be stored or mapped to participate in the computation. From our perspective, these schemes are static solutions, and fine-grained sparsity-aware \cite{dai2019graphsar} is not achieved, for they all fail to propose an effective mapping scheme for the graph data, which should be feasible, scalable, dynamic, and flexible, especially in the scenario of large-scale graph or batch graphs computing. This paper focuses on this blank field, for it is unavoidable for the optimization of large-scale graph's computing/storage efficiency and resource utilization on the PIM/CIM platforms, even it is crucial in Machine Learning and Artificial Intelligence. According to the scenarios and characteristics of PIM/CIM crossbar, we first propose several principles of dynamic sparsity-aware mapping and coding framework, base on which the problem is modeled as a sequential decision-making problem, and is heuristically sampled and trained by a policy gradient-based reinforcement learning algorithm. Eventually, our experiments show remarkable mapping results on both small-scale and large-scale graph/matrix datasets. Overall, our contributions can be summarized as follows: \begin{itemize} \item \textbf{Modeling} We transform and simplify the problem, then exploit the \textit{LSTM + Dynamic-fill} to model the generating of block schedule. \item \textbf{Optimization} We further formulate the optimization of the scheme generating as a sequential decision-making problem and solve the problem heuristically by the reinforcement learning algorithm. \item \textbf{Scalability} Our method is capable to meet the real constraint (allowable limited crossbar size, the complexity of peripheral circuits, et.al) from the deployed platforms, that is, it is flexible and scalable. \item \textbf{Adaptability} The scheme code from our model can be directly adapted to the compilation and deployment systems of PIM platforms, following the graph data itself. \end{itemize} Finally, our work makes the large-scale graph's computing based on memristive crossbar no longer depends on large-scale integrated crossbars, but ones with discrete limited-size (e.g. $4 \times 4$ or $8 \times 8$) may realize the propagation, thus improving the utilization and feasibility of the memristive crossbars and achieving the dynamic sparsity-aware mapping. Our code is available at: \url{https://github.com/blyucs/AutoGMap}. \section{Related work} \textbf{Processing-in-memory and neuromorphic computing.} Data exchange between PUs and off-chip storage devices (hard drives, flashes) consumes two orders of magnitude more energy than a floating-point operation \cite{keckler2011gpus}. This becomes more serious for neural networks, which substantially rely on data storage and memory exchange (both w.r.t. feature maps and weight parameters). The ``Memory Wall'' problem in von-Neumann architecture will surely become a bottleneck for progress in these areas. Because of its capacity to achieve low-power consumption and low inference latency, processing-in-memory (PIM) \cite{ahn2015scalable, zhang2014top,chi2016prime} is a feasible solution to tackle these issues \cite{zhuo2019graphq,lin2019learning}, which conventionally have the computation logic arranged in or near the memory \cite{chen2014dadiannao}. \textbf{Memristor crossbar-based computation.} The emerging studies of memristor \cite{chua1971memristor, strukov2008missing} have shown its great potential on PIM platforms. With the memristors structured into the crossbar, it can perform matrix-vector multiplication efficiently and has been widely studied to accelerate neural network (NN) applications. Much more works have studied the deployment of different types of neural networks (ex-situ) w.r.t. different benchmark tasks on memristor crossbar arrays \cite{wen2018memristor, wen2019memristive, yakopcic2017extremely, yang2020retransformer}. Other works also study the training procedure of neural networks (in-situ) \cite{yan2020training, prezioso2015training, kataeva2015efficient, lyu2021tnd, li2014training, cheng2017time}. Wen et al. \cite{wen2018memristor} propose a novel memristor-based computational architecture for the Echo State Network (MESN) with the online Least Mean Square (LMS) algorithm. Recently, as a newly evolutionary neural network structure, the Transformer \cite{vaswani2017attention}, has also been studied under the scenario of memristor crossbar arrays \cite{yang2020retransformer}. \textbf{Resource-aware computation and energy saving.} Recently, much more attention has been paid to the resources and energy consumption of computing. Some significant work on resource-aware computation optimization methods, and software/hardware co-design models \cite{lyu2021multiobjective, lyu2021resource, lyu2021neural} are proposed. Targeting the resource-consumption and energy saving on neuromorphic computing platforms, some works \cite{wen2019memristor, wen2020ckfo} propose some effective ways for accelerating the memristor-based CNNs on classification or segmentation tasks. \textbf{Graph data processing and acceleration.} Towards the sparse matrix-vector multiplication based on memristor crossbar, Cui et.al. \cite{cui2016towards} propose an improved/generalized reordering algorithm based on Cuthill-McKee reordering to reduce the bandwidth of graph adjacency matrix, thus improving the efficiency of the crossbars. Whereas no blocks mapping scheme is studied after reordering. Balong et.al. \cite{balog2019fast} directly utilize the Cuthill-McKee reordering algorithm followed by three densified diagonal-blocks coverage, to speed up the training efficiency, thus demonstrating the competitive efficiency on TPUv2 (dense acceleration hardware) to GPU (sparse acceleration hardware). After reordering, three batches of diagonals of densified blocks (with the same size) are resorted to cover the original adjacency matrix, among which one is distributed along with the diagonal, and two are arranged to ``fill the gaps''. Targeting the heterogeneous accelerators for graph computation on PIM architecture, some works \cite{song2018graphr, dai2019graphsar} propose sparse graph partition schemes to improve the storage efficiency. GraphR \cite{song2018graphr} statically partitions adjacency matrix, and combine sparse compression format, to reduce memory consumption. On WikiNote dataset, it cost only 0.2\% of the original size when combined with the COO representation. GraphSAR \cite{dai2019graphsar} proposes the sparsity-aware partition scheme to store the large-scale sparse matrix. After partition the adjacency matrix into fixed-small-size (e.g. $8 \times 8$). It only directly stores the blocks with a non-zero density larger than 0.5, otherwise further divides the blocks into $4 \times 4$. By this means, the large-scale graphs are stored in the form of small matrices, thus greatly increasing the utilization of the discrete fragmentary memory. Although these works all endeavor to improve the computation efficiency and resource utilization by block partition scheme, no dynamic and real sparsity-aware partition methods are proposed. \section{Preliminary} In parallel computing on conventional hardware (CPU, GPU), the Intel MKL \cite{Mkl}, NVIDIA cuBLAS \cite{cublas} library, cuSparse, and other libraries directly implement SpMV based on the compressed format. However, for large-scale graph data or batch graphs, although the memristor-based crossbar operation utilizes a process-in-memory architecture to reduce the complexity of matrix-vector multiplication from $O(n^2)$ to $O(1)$, it is clear that the complete mapping of the integrated matrix to the crossbar is unwise. Taking spectral-based GCN \cite{kipf2016semi} as an example, layer-wise propagation as Eq. \eqref{eq:Z_l}: \begin{equation} \begin{array}{ll} \label{eq:Z_l} Z_{l+1}=\sigma(\hat{D}^{-1/2}\hat{A}\hat{D}^{-1/2}Z_{l}W_{l}) \end{array} \end{equation} it involves the whole sparse adjacency matrix, so full mapping of graphs on crossbar/hypercube is very resource-consuming. A preferable way is to divide the sparse matrix into blocks, and only the blocks containing non-zero elements are mapped, as mentioned in \cite{cui2016towards, balog2019fast}. However, the non-zero elements of the sparse matrix with graph structure are generally scattered, which will increase the complexity of peripheral circuits and communication between sub-crossbars (blocks), as mentioned in \cite{cui2016towards}. Targeting the goal of ``communication optimal'' \cite{cui2016towards}, the communication of the blocks in the same row needs to be minimized, thus reducing the complexity of the peripheral circuit. To achieve this, non-zeros need to be located closer enough and preferably distributed around with the diagonal. Matrxi-vector multiplication is normally the atomic-operation of current Artificial Intelligence applications (e.g. CNNs \cite{lecun1998gradient, simonyan2014very, he2016deep}, RNNs \cite{hochreiter1997long}, GNNs \cite{hamilton2017inductive, kipf2016semi, velivckovic2017graph}), and is consist of the multiplication and accumulation. In the computation of the memristive crossbar, multiplication is implemented by Ohm's law, and accumulation is implemented by Kirchhoff’s Current Law in analog domain \cite{Dot-Product-Engine}. Fig. \ref{fig:diag_mapping} showcases the circuit simulation process of a matrix-vector multiplication propagation ($y = Ax$) by reordering and its corresponding post-transformation. The original calculation of the matrix-vector multiplication is: $y=Ax$. By Cuthill-Mckee reordering, the matrix $A$ is transformed to $A^{'}$: $A^{'}=PAP^{T}$, which is feasible to be deployed on the crossbar with fewer cost \cite{cui2016towards}. To ensure the calculation rules of block matrix multiplication, the input vector needs the transformation, denoted as $x^{'}=Px$. The calculation after the transformation is represented as $y^{'}=A^{'}x^{'}=PAP^{T}Px=PAx=Py$. Then, after the calculation of crossbars, the compositive output vector $y^{'}$ needs to be reversely transformed back to $y$, denoted as $y=P^{T}y^{'}$, which may be realized by the switch circuit during the hardware design. \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./diag_mapping} \caption{Diagram of matrix-vector multiplication propagation ($y=Ax$) with the matrix reordering method. The matrix $A^{'}$ is programmed into a batch of small-scale crossbars, and the transformed vector $x^{'}$ serves as the inputs of the crossbars. Finally, the switch circuit is resorted to realize the reverse transformation $y=P^{T}y^{'}$.} \label{fig:diag_mapping} \end{figure} Considering only diagonally connected block partition, as shown in Fig. \ref{fig:preli}, different block schedule schemes come up with different coverage ratio and total area (cost). Therefore, the question worth exploring is how to generate the best mapping scheme (complete coverage) with minimum cost. \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./preli} \caption{The comparison of coverage ratio and blocks area (cost) under different mapping schemes.} \label{fig:preli} \end{figure} \section{Problem Formulation} For simplicity, we just consider the formulation of the mapping scheme with only diagonal-blocks. We have $f$ to be the reward function of one specific mapping scheme. The optimization objective is to maximize the expectation of the reward function of the candidate scheme, as Eq. \ref{eq:s_block}: \begin{equation} \begin{array}{ll} \label{eq:s_block} \mathop{argmax}\limits_{\mathop{s}}& f(s_{1}, s_{2}, s_{3}, ..., s_{n})\\ \textit { s.t. }& \sum\limits_{n=1}^{n}s_{n} = N\\ & n \leq N \end{array} \end{equation} where $s$ is the size vector of the sequential blocks, subject to their sum equal to the diagonal size. In terms of the solution space, this problem can be analogous to a typical pure numerical problem, the integer factorization by addition, that is, given a positive integer $n$, the number of the factorization schemes is $2^{N-1}$, so the algorithm complexity of the violent solution is $O(2^N)$. Considering a large numerical value $N$ (e.g. $100$, $1000$), solving this problem violently is obviously computationally impossible. Additionally, it is not feasible to formulate this problem as the integer programming or the discrete optimization problem, for the variables number is uncertain. We endeavor to transform the expression of the solution space, instead of using the size variables with an uncertain number, we resort to $N-1$ $0-1$ variables to form the solution space. This can be detailed interpreted as there exist $N-1$ decision points on the diagonal of the adjacency matrix, and the action space of each point is {0: Start a new block, 1: Continued to expand the previous block}, represented by $x_{i}$. Then the optimization problem is transformed to Eq. \eqref{eq:zero-one}: \begin{equation} \begin{array}{ll} \label{eq:zero-one} \mathop{argmax}\limits_{\mathop{x}}& f(p(x_{1}, x_{2}, x_{3}, ..., x_{N}));\\ \textit { s.t. }& \ x_{i} \in {\{0, 1\}} \end{array} \end{equation} where $p$ is the parse function that transfer 0-1 decision variable $x$ to the blocks size vector $s$. Although the size of the solution space is the same with Eq. \ref{eq:s_block}, $2^{N-1}$, consistent with the 0-1 nonlinear integer programming problem, it is easier to formulate this problem as a programming problem. Unfortunately, it still can not be solved by optimization methods, for the definition of the optimization objective is not a continuous high-dimensional hyperplane, but regarding the distribution of nonzero elements of the matrix, which is in a discrete space. \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./decision} \caption{Left: Illustration of the optimization problem defined in Eq. (2). The block size is the optimization variable, but the number of which is not determined. Right: Illustration of the optimization problem defined in Eq. (3). Each grid point on the diagonal needs a decision indicating whether to start a new block or continue the frontier one, the variable number is determined.} \label{fig:decision} \end{figure} Based on the background of the crossbar and the formulated problem, we put forward the basic principle of mapping large-scale sparse graphs on memristive crossbars: \begin{itemize} \item Complete coverage capability, valid for arbitrary non-zeros distribution, and do not exceed the whole area. \item No overlaps between blocks. \item Adaptable to the deployment and compile system, that means, coding rules should be simple for the circuit design. \item Least cost, including the memristor number and crossbar area. \end{itemize} \section{Methodology} The overall diagram of our modeling and optimization method is shown in Fig. \ref{fig:LSTM_RL}. The LSTM network and fully connected network (FCs) consist of the generating models and serve as the agent that to be optimized by policy-gradient based reinforcement learning algorithm. \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./LSTM_RL} \caption{LSTM sequentially samples the action vectors $x, z$, which represent the mapping scheme, and followed by the mapping scheme parsing and the evaluation according to non-zero elements' distribution in the original matrix. After evaluation, the reward is exploited to constitute the gradient estimation value of the agent (LSTM network + FCs).} \label{fig:LSTM_RL} \end{figure} \subsection{Modeling} \textbf{Modeling diagonal-blocks.} Base on the problem formulation and the background of crossbar-based computation (Fig. \ref{fig:diag_mapping}), optimization variables defined in Eq. \eqref{eq:zero-one} are pre-and-post related, we may treat it as a sequential generating problem and further leverage the classical LSTM networks to model it. For each time-step ($t$, stands for the decision points number), the output embedding data models the representation of each action and serves as the input vector of the next time-step. Each LSTM-layer calculates as the Eq. \eqref{eq:lstm_begin}-\eqref{eq:lstm_end}: \begin{equation} \label{eq:lstm_begin} \begin{aligned} f_{t}=\sigma(W_{f}[h_{t-1},x_{t}]+b_{f}) \end{aligned} \end{equation} \begin{equation} \label{eq:3} \begin{aligned} i_{t}=\sigma(W_{i}[h_{t-1},x_{t}]+b_{i})\\ \end{aligned} \end{equation} \begin{equation} \label{eq:4} \begin{aligned} g_{t}=tanh(W_{g}[h_{t-1},x_{t}]+b_{g})\\ \end{aligned} \end{equation} \begin{equation} \label{eq:5} \begin{aligned} o_{t}=\sigma(W_{o}[h_{t-1},x_{t}]+b_{o})\\ \end{aligned} \end{equation} \begin{equation} \label{eq:6} \begin{aligned} c_{t}=f_{t}*c_{t-1}+i_{t}*g_{t}\\ \end{aligned} \end{equation} \begin{equation} \label{eq:lstm_end} \begin{aligned} h_{t}=o_{t}*tanh(c_{t})\\ \end{aligned} \end{equation} where $W$ denotes the weights and $b$ represents the bias. At time-step $t$, $f_t$, $i_t$, $g_t$, $o_t$ represents the forget gate, input gate, cell state, and output gate, respectively. $h_{t-1}$ and $x_t$ signify the hidden state at time $t-1$ and the input at time $t$, respectively. The sequential generation technique can be formulated as a classification problem and accomplished by a fully connected network that takes the LSTM cell's output embedding vector (per time-step) as input. \begin{equation} \label{eq:8} \begin{aligned} p^t=softmax(W^t_{fc}*out_{t}+b^{t})\\ \end{aligned} \end{equation} The output indices that represent the index/operations are sampled according to the multinomial distribution $(p^t_{1}, \cdot\cdot\cdot, p^t_{C})$, where $C$ is the class number of FC. The details of the sampling procedure are presented in Algo. \ref{algo:sampling}. \textbf{Modeling fill-blocks.} As shown in Fig. \ref{fig:preli}, schemes with only diagonal-blocks are not enough to provide the feasible coverage solution, for the joints of two adjacent blocks are blind areas. We heuristically employ the methods in work \cite{balog2019fast}, in which ``fill the gaps'' blocks are distributed on two sides of the diagonal. The difference is that our solution is dynamic rather than static. Intuitively, we may model the decision of the ``fill the gaps'' blocks the same as the diagonal-blocks. Thus the optimization formula is presented in Eq. \eqref{eq:zero-one-fill}, in which the FCs serve as the binary classifiers to determine whether to fill the gap with fixed-size or not. Unfortunately, this strategy will inevitably come up with a waste of resources (memristors, energy). To address this, we creatively propose a dynamic-fill scheme to prevent this limitation and further improve the utilization. In this strategy, the FCs servers as the multi-classifier, and the output classification value stands for the fill-block size, in the form of a proportion of current diagonal-block. The illustration of two schemes (fixed-size fill and dynamic size fill) is shown in Fig. \ref{fig:dynamic_size}. \begin{equation} \begin{array}{ll} \label{eq:zero-one-fill} \mathop{ argmax}\limits_{\mathop{x, z}}& f(p(x, z));\\ \textit { s.t. }& x_{i} \in {\{0, 1\}}\\ & z_{i} \in {\{0, 1\}} \end{array} \end{equation} \begin{equation} \begin{array}{ll} \label{eq:dynamic-fill} \mathop{ argmax}\limits_{\mathop{x, z}}& f(p(x, z));\\ \textit { s.t. }& x_{i} \in {\{0, 1\}}\\ & z_{i} \in {\{0, 1/m, 2/m, ..., 1\}} \end{array} \end{equation} \begin{figure}[!ht] \centering \includegraphics[width=7.5cm]{./dynamic_size} \caption{Up: Fill the gaps with fixed-size blocks, with the fully-connected network model the binary classification problem, the output value means to fill or not, as Eq. (11). Down: Fill the gaps with dynamic size blocks, with the fully-connected network model the multi-classification problem, as Eq. (12), the classification output stands for the portion of current fill-block size, e.g., indices $[0, 1, 2, 3, 4, 5]$ stands for the ratio $[0, 1/5, 2/5, 3/5, 4/5, 1]$.} \label{fig:dynamic_size} \end{figure} Taking matrix-vector multiplication ($y=Ax$) as an example, Fig. \ref{fig:diag_fill_map} showcases the mapping of graph data on crossbar. Diagonal and fill-blocks are mapped to the allowable small-scale crossbars. Base on the Kirchhoff’s Current Law, blocks in the same row are connected, and the corresponding sub-vector (splitting follows the rule of ``block matrix multiplication'') is the data input of the crossbar, respectively. In this way, the allowable small-scale crossbars can be effectively utilized. \begin{figure}[!ht] \centering \includegraphics[width=7.5cm]{./diag_fill_map} \caption{Illustration of the adjacency matrix mapping on the crossbar in the case study of matrix-vector multiplication. When allowable crossbar size is limited or discrete, our dynamic mapping scheme can effectively improve the utilization of the crossbars.} \label{fig:diag_fill_map} \end{figure} \subsection{Optimization} The optimization problem is how to train the generating model to maximize the expected reward of the sampled block schedule scheme, and issues that need to be addressed are as follows: \begin{itemize} \item In such a huge action space, how to sample the block scheduling scheme directionally and heuristically. \item Reward the sampled schedule scheme efficiently and timely, which should be instructive to the training. \item When evaluating, multiple metrics need to be considered, including the coverage ratio, block area, which could be contradictory, as well as the trade-off between the two. \end{itemize} If we treat generating process as the sequential decision-making problem that regards discrete reward value and multi-objectives, the reinforcement learning algorithm may intuitively be leveraged, by which the LSTM and the FCs consist of the agent. \begin{table}[!htb] \centering \caption{Notation in the view of RL.} \setlength{\tabcolsep}{0.5mm}{ \begin{tabular} {p{70pt}p{150pt}} \toprule Notation & Definition\\ \toprule Environment ($e$) & Original matrix $A$\\ Reward ($R$) & $f(p(x,z))$\\ Agent ($\theta$) & LSTM and FCs\\ Action ($a$) & Sequential sampled decision indices by agent\\ Action space & Fixed-fill size: $2^{N}$, dynamic-fill size: $2^{N-1}*(m+1)^{N-1}$\\ \toprule \end{tabular} } \centering \label{table:notation} \end{table} Further, the reinforcement procedure of the agent is formulated as to optimize the $\theta$ to achieve the optimal reward ($R$) of the candidate mapping scheme, as Eq.\eqref{eq:theta}: \begin{equation} \label{eq:theta} \begin{aligned} \theta^{*} &= \mathop{\arg\max}_{\theta}\mathcal{J}(\theta) = \mathop{\arg\max}_{\theta}\mathbb{E}_{\pi(a_{1:T};\theta)}(R) \end{aligned} \end{equation} where $\mathcal{J}(\theta)$ is the optimization objective function, which is represented by the expectation of the reward achieved by coverage sequence action $a_{1:T}$, where $T$ is the length of action vector. \begin{equation} \label{eq:theta1} \begin{aligned} \nabla_{\theta}{\mathcal{J}(\theta)}&=\sum_{t=1}^{T}\mathbb{E}_{\pi(a_{1:T};\theta)}[R\nabla_{\theta}\log(\pi(a_{t}|a_{1:t-1};\theta))]\\ \end{aligned} \end{equation} the gradient value is approximately calculated by sampling, that is: \begin{equation} \begin{aligned} \nabla_{\theta}{\mathcal{J}(\theta)} \approx \frac{1}{M}\sum_{m=1}^{M} \sum_{t=1}^{T}\mathbb{E}_{\pi(a_{1:T};\theta)}[R_{m}\nabla_{\theta}\log(\pi(a_{t}|a_{1:t-1};\theta))]\\ \end{aligned} \end{equation} the algorithm of the training of the agent is presented in Algo. \ref{algo:tainagent}. As for the reward $R_m$, it involves two objectives: \begin{itemize} \item Coverage ratio, which relates to the performance of the computation on the crossbar. \item Area cost, which relates to memristor and energy consumption. \end{itemize} Distinctly, there exists the contradiction between the two, that is we attempt to maximize the coverage ratio (or even complete coverage) and minimize the area cost of crossbars. To achieve this, we leverage the single-policy MORL \cite{1998multi-criteria,mannor2004a,moffaert2013scalarized} which resort to the scalarization function to transform the multi-objective problem into a standard single-objective one. The scalarization function $f$ projects an objective vector $\mathbf{v}$ to a scalar one: $v_{\mathbf{w}}=f(\mathbf{v}, \mathbf{w})$ where $\boldsymbol{w}$ is a weight vector parameterizing $f$. We employ the simple way of weight-sum as the scalarization function, as Eq. \eqref{eq:multi-objective}: \begin{equation} \label{eq:multi-objective} \begin{aligned} R_{m} = a * Coverage(x, z) + (1-a) * Area(x, z) \end{aligned} \end{equation} In terms of the harmonic coefficient $a$, in general, the application scenario request complete coverage (coverage ratio is 1), consequently, what's serious is the crossbar's consumption (area). In such a large action space, an extremely large proportion of the candidate schemes is capable to reach complete coverage, but with different area ratio. So if we set $a$ to be 1 or close to 1 from the beginning, the agent would tend to sample the complete coverage schemes with high probability, which even with different costs, the reward keeps consistent, thus it makes the gradient of the controller disappear. Consequently, we must have the harmonic coefficient $a$ serves as the hyper-parameter in our experiment. In addition, the balance of exploration and exploitation is achieved by probabilistic sampling. Our whole structure of the method is presented in Algo.\ref{algo:AutoGMap}. \begin{algorithm} \label{algo:sampling} \caption{Agent.sample} \LinesNumbered \KwIn{Null} \KwOut{$diagonal\_actions,fill\_actions,log\_prob$} $inputs, hidden$ = random\_initialize\; \For{ $i \gets 0 \to action\_len-1$}{ $output, hidden$ $\gets$ LSTM($inputs, hidden$)\; logits $\gets$ diagonal\_fcs[i]($output$)\; $softmax\_logits$ $\gets$ softmax($logits$)\; $d\_action$ $\gets$ softmax\_logits.multinomial(1) \CommentSty{/*Sampling by probability*/} \; $cur\_log\_prob$ $\gets$ -nll\_loss(log($softmax\_logits$), $d\_action$)\; $log\_prob = log\_prob + curr\_log\_prob$\; $diagonal\_actions$ append $d\_action$\; $inputs \gets output$\; \ \CommentSty{/*"Fill" masked by "Diagonal", 0: Start a new block*/}\; \If {$d\_action == 0$}{ $output, hidden$ $\gets$ LSTM($inputs, hidden$)\; logits $\gets$ fill\_fcs[i]($output$)\; $softmax\_logits$ $\gets$ softmax($logits$)\; $f\_action$ $\gets$ $softmax\_logits$.multinomial(1) \CommentSty{/*Sampling by probability*/}\; $cur\_log\_prob$ $\gets$ -nll\_loss(log($softmax\_logits$), $f\_action$)\; $fill\_actions$ append $f\_action$\; $log\_prob \gets log\_prob + curr\_log\_prob$\; $inputs \gets output$\; } } \end{algorithm} \begin{algorithm} \label{algo:tainagent} \caption{train\_agent (REINFORCE with baseline)} \LinesNumbered \KwIn{$log\_prob$, $Reward$} \KwOut{Null} $baseline \gets decay*baseline + (1-decay)*reward$\; $adv \gets reward - baseline$\; loss $\gets$ $-log\_prob * adv$\; loss.backward() \CommentSty{/*Gradients ($loss$ is differentiable w.r.t. the parameter weights of the $LSTM$ and the $FCs$) calculated by $autograd$*/}\; Gradients applied \CommentSty{/*Gradient descend by the optimizer.*/}\; \end{algorithm} \begin{algorithm} \label{algo:AutoGMap} \caption{AutoGMap} \LinesNumbered \KwIn{$A(Matrix), agent\_config, a$} \KwOut{$digonal\_blks, fill\_blks$} Agent $\gets$ create\_agent(agent\_config) \For{$epoch \gets 0 \to num\_epoch-1$}{ $diagonal\_action,fill\_action,log\_prob$ $\gets$ Agent.sample()\; $diagonal\_blks$ $\gets$ parse\_d($diagonal\_action$)\; $fill\_blks$ $\gets$ parse\_f($fill\_action$)\; $C\_ratio$ $\gets$ C\_cal($diagonal\_action,fill\_action$)\; $A\_ratio$ $\gets$ A\_cal($diagonal\_action,fill\_action$)\; $Reward \gets a*C\_ratio + (1-a)*A\_ratio$\; train\_agent($log\_prob$, $Reward$)\; } \end{algorithm} \subsection{Relation and comparison with other works} In \cite{cui2016towards}, a generalized reordering method to reduce the bandwidth of the matrix \cite{10.1145/800195.805928} is proposed, which can handle any asymmetrical rectangle matrix, compared with the original Cuthill-McKee reordering algorithm that can only handle the symmetrical squares. But this work does not discuss the mapping scheme and its optimization. Our work does not focus on the innovation and generalization of the reordering algorithm, but on the automatic generation of an efficient and reasonable deployment scheme after reordering the large-scale sparse matrix. In GraphR \cite{song2018graphr}, the adjacency matrix of a graph is partitioned into four sub-graphs with the consideration of the sparsity, the method in GraphSAR \cite{dai2019graphsar} remains the same pattern that even is progressively partitioned. Their partition scheme is fixed, whereas our work makes the scheme flexible and scalable by intelligent generating. In work \cite{balog2019fast}, to improve the training efficiency of sparse graph neural networks on TPU device (sparse hardware), a batch of diagonal-blocks and two additional batches of blocks to ``fill the gap'', in which the size of the block keep consistent and the coverage schemes are fixed without considering of the distribution of the non-zero elements. Our overall mapping framework is similar with \cite{balog2019fast} (a batch of blocks are connected to cover diagonals, and two batches are used to fill the gaps), what's the difference is that our method is dynamic and sparsity-aware, with the consideration of the adaptability to the compilation and deployment system. Overall, compared with these related works, we adopt an intelligent generating method to achieve the dynamic sparsity-aware mapping, which compares favorably with these previous works. \section{Experiment} \textbf{Environment} We conduct our experiments using PyTorch $1.0$ framework on Intel CPU. For the policy gradient training in reinforcement learning, our realization relies on PyTorch's Autograd mechanism to backwardly update the parameter weights (policy). \textbf{Dataset} We first resort to a small-scale graph data, a adjacency matrix ($22 \times 22$) that numbered 5828 in a chemical molecular dataset \textbf{QM7} \cite{blum2009970,rupp2012fast}. In terms of the large-scale dataset, we experiment on two large-scale symmetric matrices \textbf{qh882} ($882 \times 882$) and \textbf{qh1484} ($1484 \times 1484$) from \cite{BAI}, which collects a variety of matrices for research. In our experiments, the matrices are reordered to lower-bandwidth symmetric matrices by Cuthill-McKee reordering algorithm as the pre-processing. \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./dataset_visual} \caption{Visualization of QM7-5828, \textit{qh882}, and \textit{qh1484}.} \label{fig:dataset_visual} \end{figure} \textbf{Metrics} $C\_ratio$, represents the coverage ratio of the non-zero elements of the scheme, defined as: \begin{equation} \begin{aligned} C\_ratio = \frac{Nonzero\_count_{mapped\ blocks}}{Nonzero\_count_{original}} \end{aligned} \end{equation} it is scaled to be $[0, 1]$, and we attempt to reach 1 in our experiment, which means all non-zero elements must be mapped. $A\_ratio$, the area ratio of the mapping blocks to the original matrix, defined as: \begin{equation} \begin{aligned} A\_ratio = \frac{Area_{mapped\ blocks\ }}{Area_{original}} \end{aligned} \end{equation} it also stays in $[0, 1]$, the lower the better of the candidate schemes. $Sparsity$, means the utilization of the mapped crossbar of the scheme, may be viewed as the comparison metric with the original sparsity, defined as: \begin{equation} \begin{aligned} Sparsity = \frac{Nonzero\_count_{mapped\ blocks}}{Area_{mapped\ blocks}} \end{aligned} \end{equation} \begin{table*}[] \caption{Comparison and ablation study results on small-scale graph QM7-5828.} \label{table:R5828} \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|} \hline \multicolumn{1}{|c|}{\multirow{2}{*}{Methods}} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Block\\ size\end{tabular}}} & \multirow{2}{*}{\begin{tabular}[c]{@{}l@{}}Grid\\ size\end{tabular}} & \multirow{2}{*}{\begin{tabular}[c]{@{}l@{}}Fill size/\\ grades num\end{tabular}} & \multicolumn{2}{l|}{Reward ratio} & \multicolumn{2}{c|}{Solutions} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Coverage\\ ratio\end{tabular}}} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Area\\ ratio\end{tabular}}} & \multirow{2}{*}{\begin{tabular}[c]{@{}l@{}}Sparsity$^\dagger$\end{tabular}} \\ \cline{5-8} \multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{} & & & \multicolumn{1}{c|}{a} & \multicolumn{1}{c|}{1-a} & \multicolumn{1}{c|}{Diagonal-blocks size} & \multicolumn{1}{c|}{Fill-blocks size} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \\ \hline \multirow{3}{*}{Original} & 4 & \multirow{3}{*}{/} & \multirow{3}{*}{/} & \multirow{3}{*}{/} & \multirow{3}{*}{/} & {[}4, 4, 4, 4, 4,2{]} & \multirow{3}{*}{/} & 0.5 & 0.174 & 0.620 \\ \cline{2-2} \cline{7-7} \cline{9-11} & 6 & & & & & {[}6, 6, 6, 4{]} & & 0.531 & 0.256 & 0.726 \\ \cline{2-2} \cline{7-7} \cline{9-11} & 8 & & & & & {[}8, 8, 6{]} & & 0.813 & 0.339 & 0.683 \\ \hline \multirow{2}{*}{Original+Fill} & 4 & \multirow{2}{*}{/} & 4 & \multirow{2}{*}{/} & \multirow{2}{*}{/} & {[}4, 4, 4, 4,4,2{]} & {[}1, 1, 1, 1, 1, 1{]} & 0.938 & 0.445 & 0.721 \\ \cline{2-2} \cline{4-4} \cline{7-11} & 6 & & 6 & & & {[}6, 6, 6, 4{]} & {[}1, 1, 1, 1{]} & 1.0 & 0.62 & 0.787 \\ \hline \multirow{2}{*}{LSTM+RL} & \multirow{2}{*}{/} & \multirow{2}{*}{2} & \multirow{2}{*}{/} & 0.6 & 0.4 & {[}8, 2, 12{]} & \multirow{2}{*}{/} & 0.875 & 0.438 & 0.735 \\ \cline{5-7} \cline{9-11} & & & & 0.8 & 0.2 & {[}8, 14{]} & & 0.938 & 0.537 & 0.769 \\ \hline \multirow{4}{*}{LSTM+RL+Fill} & \multirow{4}{*}{/} & \multirow{4}{*}{2} & 2 & 0.8 & 0.2 & {[}8, 12, 2{]} & {[}0, 1{]} & 0.938 & 0.455 & 0.727 \\ \cline{4-11} & & & 4 & 0.8 & 0.2 & {[}2, 2, 4, 2, 6, 4, 2{]} & {[}0, 1, 0, 1, 1, 1{]} & 0.969 & 0.388 & 0.670 \\ \cline{4-11} & & & 4 & 0.9 & 0.1 & {[}4, 12, 4, 2{]} & {[}1, 1, 1{]} & 1.0 & 0.521 & 0.746 \\ \cline{4-11} & & & \textbf{6} & \textbf{0.8} & \textbf{0.2} & \textbf{{[}4, 4, 2, 2, 8, 2{]}} & \textbf{{[}1, 0, 1, 1, 1{]}} & \textbf{1.0} & \textbf{0.455} & \textbf{0.709} \\ \hline \multirow{4}{*}{BiLSTM+RL+Fill} & \multirow{4}{*}{/} & \multirow{4}{*}{2} & 2 & 0.8 & 0.2 & {[}8, 12, 2{]} & {[}0, 1{]} & 0.938 & 0.455 & 0.727 \\ \cline{4-11} & & & 4 & 0.8 & 0.2 & {[}2, 2, 4, 2, 6, 4, 2{]} & {[}0, 1, 0, 1, 1, 1{]} & 0.969 & 0.388 & 0.670 \\ \cline{4-11} & & & 4 & 0.9 & 0.1 & {[}2, 2, 12, 4, 2{]} & {[}0, 1, 1, 1{]} & 1.0 & 0.504 & 0.738 \\ \cline{4-11} & & & \textbf{6} & \textbf{0.8} & \textbf{0.2} & \textbf{{[}8, 2, 2, 8, 2{]}} & \textbf{{[}0, 1, 1, 1{]}} & \textbf{1.0} & \textbf{0.471} & \textbf{0.719} \\ \hline \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}LSTM+RL+\\ Dynamic-fill\end{tabular}} & \multirow{3}{*}{/} & \multirow{3}{*}{2} & \textbf{grades num: 4} & \textbf{0.8} & \textbf{0.2} & \textbf{{[}2, 2, 14, 4{]}} & \textbf{{[}0, 2, 2{]}} & \textbf{1} & \textbf{0.558} & \textbf{0.763} \\ \cline{4-11} & & & \textbf{grades num: 4} & \textbf{0.75} & \textbf{0.25} & \textbf{{[}2, 2, 4, 2, 2, 6, 4{]}} & \textbf{{[}1, 3, 0, 2, 3, 2{]}} & \textbf{1} & \textbf{0.43} & \textbf{0.692} \\ \cline{4-11} & & & \begin{tabular}[c]{@{}l@{}}{grades num: 6}\end{tabular} & 0.75 & 0.25 & {[}2, 2, 4, 2, 8, 4{]} & {[}4, 5, 0, 3, 4{]} & 0.969 & 0.397 & 0.677 \\ \hline \end{tabular}\\ \footnotesize{$^\dagger$ Sparsity of original matrix: 0.868 }\\ \end{table*} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./R5828_visual} \caption{Visualization results of four representative solutions, which are promising solutions (bold) in the Table.II. For a $22 \times 22$ matrix, it is burdensome and challenging to manually observe and output an optimal complete coverage scheme, but our agent can easily generate reasonable solutions.} \label{fig:R5828_visual} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./5828_curve} \caption{The curves of the coverage ratio, area ratio, and reward during the training on QM7-5828 graph data, in which reward is calculated with the coverage ratio, area ratio, and coefficient $a$, as Eq. (16). After 5K epochs, the coverage ratio converges to 1 (with small fluctuation), and the area ratio converges to a specific smaller value compared with the early stage of the training.} \label{fig:5828_curve} \end{figure} \begin{table*}[] \caption{Experimental comparison results on large-scale matrix dataset: qh882 and qh1484.} \begin{tabular}{|c|l|l|l|l|l|l|l|l|l|} \hline \multirow{2}{*}{Dataset} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Grid\\ size\end{tabular}}} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Fill\\ grades\end{tabular}}} & \multicolumn{2}{l|}{Reward ratio} & \multicolumn{2}{c|}{Solutions} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Coverage\\ ratio\end{tabular}}} & \multicolumn{1}{c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Area\\ ratio\end{tabular}}} & \multirow{2}{*}{Sparsity$^\dagger$} \\ \cline{4-7} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{l|}{a} & 1-a & \multicolumn{1}{l|}{Diagonal-blocks size} & Fill-blocks size & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \\ \hline \multirow{4}{*}{qh882} & 32 & 4 & \multicolumn{1}{l|}{0.7} & 0.3 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}32, 32, 32, 192, 96, 96, 64, 64, 96, \\ 96, 64, 18\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}2, 3, 1, 2, 2, 2, 2, \\ 2, 2, 2, 2{]}\end{tabular} & 0.998 & 0.196 & 0.978 \\ \cline{2-10} & 32 & 4 & \multicolumn{1}{l|}{0.8} & 0.2 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}32, 128, 96, 128, 96, 64, 64, 96, 96, \\ 32, 50{]}\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}2, 2, 2, 2, 2, 2, 2, \\ 2, 3, 2{]}\end{tabular} & 0.998 & 0.204 & 0.979 \\ \cline{2-10} & 32 & 6 & \multicolumn{1}{l|}{0.7} & 0.3 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}32, 32, 160, 160, 128, 96, 96, 128, \\ 32, 18{]}\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}4, 4, 2, 3, 3, 3, 2,\\ 5, 3{]}\end{tabular} & 0.995 & 0.2 & 0.979 \\ \cline{2-10} & \textbf{32} & \textbf{6} & \multicolumn{1}{l|}{\textbf{0.8}} & \textbf{0.2} & \multicolumn{1}{l|}{\textbf{{[}32, 192, 160, 96, 160, 96, 64, 82{]}}} & \textbf{{[}2, 3, 4, 2, 3, 4, 3{]}} & \textbf{1} & \textbf{0.225} & \textbf{0.955} \\ \hline \multicolumn{1}{|l|}{\multirow{4}{*}{qh1484}} & 32 & 4 & \multicolumn{1}{l|}{0.7} & 0.3 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}96, 32, 32, 288, 192, 160, 64, 32, 64, \\ 64, 32, 64, 32, 128, 32, 32, 64, 32, 44{]}\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}1, 2, 1, 2, 2, 3, 3, 2, 2,\\ 3,2, 3, 1, 2, 3, 2, 2, 3{]}\end{tabular} & 0.992 & 0.148 & 0.981 \\ \cline{2-10} \multicolumn{1}{|l|}{} & 32 & 4 & \multicolumn{1}{l|}{0.8} & 0.2 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}96, 64, 288, 192, 128, 96, 128, 32, \\ 96, 32, 128, 64, 32, 96, 12{]}\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}2, 2, 2, 2, 3, 2, 3, 2, \\ 3, 1, 3, 3, 2, 2{]}\end{tabular} & 0.999 & 0.185 & 0.985 \\ \cline{2-10} \multicolumn{1}{|l|}{} & 32 & 6 & \multicolumn{1}{l|}{0.7} & 0.3 & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}{[}128, 224, 288, 224, 160, 64, 64, 160, \\ 64, 32, 64, 12{]}\end{tabular}} & \begin{tabular}[c]{@{}l@{}}{[}5, 2, 2, 3, 3, 2, 2, 4, 0, \\ 2, 4{]}\end{tabular} & 0.993 & 0.173 & 0.984 \\ \cline{2-10} \multicolumn{1}{|l|}{} & \textbf{32} & \textbf{6} & \multicolumn{1}{l|}{\textbf{0.8}} & \textbf{0.2} & \multicolumn{1}{l|}{\textbf{\begin{tabular}[c]{@{}l@{}}{[}32, 96, 256, 288, 128, 96, 64, 64, \\ 128, 160, 64, 32, 64, 12{]}\end{tabular}}} & \textbf{\begin{tabular}[c]{@{}l@{}}{[}4, 5, 2, 4, 4, 4, 5, 3,\\ 2, 2, 3, 3, 3{]}\end{tabular}} & \textbf{1} & \textbf{0.171} & \textbf{0.984} \\ \hline \end{tabular}\\ \label{table:882} \footnotesize{$^\dagger$ Sparsity of \textit{qh882}: 0.9957, sparsity of \textit{qh1484}: 0.9972 }\\ \end{table*} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./882_visual} \caption{Visualization results of four representative solutions of \textit{qh882} in Table.III. The grid size is uniformly 32. } \label{fig:882_visual} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./882_curve} \caption{The curves of the coverage ratio, area ratio, and reward during the training on \textit{qh882} graph data.} \label{fig:882_curve} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./1484_visual} \caption{Visualization results of four representative solutions of \textit{qh1484}. The grid size is uniformly 32.} \label{fig:1484_visual} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=8.5cm]{./1484_curve} \caption{The curves of the coverage ratio, area ratio, and reward during the training on \textit{qh1484} graph data. The training last for 50K epochs, the effect is consistent with that of \textit{qh882}.} \label{fig:1484_curve} \end{figure} Experimental results on QM7-5828 is presented in Table.\ref{table:R5828}, which showcases the comparison and ablation study. The comparison includes the fixed-size diagonal-block partition (\textit{Original}), fixed-size diagonal-block with additional fill-blocks (\textit{Original + fill}), our proposed method ``\textit{LSTM + RL}'' that only target on the diagonal scheduling, while ``\textit{LSTM + RL + Fill}'' additionally utilize two series of blocks to ``fill the gap''. Based on the knowledge fusion among decision points, we also study the effect of \textit{BiLSTM}. Experiments show that, compared with \textit{LSTM}, \textit{BiLSTM} achieves no significant improvements. This also happens when we significantly increase the layers number of \textit{LSTM} and the hidden size. Visualizations of several typical outstanding mapping schemes (complete coverage scheme with different area ratios) are shown in Fig. \ref{fig:R5828_visual}. These four results are the promising solutions (in bold) in Table.\ref{table:R5828} in order. The training loss of the QM7-5828 is shown in Fig. \ref{fig:5828_curve}. With the continuous rise of the coverage ratio, the area ratio gradually converges to a small value after the big fluctuation in the early stage. The area ratio converges to an ideal ratio, but not at the expense of the coverage ratio, which can steadily converge to 1 after 40k epochs of training under an Intel CPU (without GPU). Further experiments based on large-scale graph data/matrix (\textit{qh882}, \textit{qh1484}) are shown in Table. \ref{table:882}, in which we directly adopt \textit{LSTM + RL + Dynamic} strategy. To reduce the scale of the problem, we partition the original matrix into grids. Considering the grid size $k \times k$, thus the grid number is $N = D/k$, where $D$ is the size of the matrix. Empirically, we set grid size of \textit{qh882} and \textit{qh1484} to be 32, and the fill grades number to be 4, the action space is $2 ^{\lfloor 882/32 \rfloor} \times 4 ^ {\lfloor 882/32 \rfloor} = 2.4 \times 10 ^ {24}$, and $2^ {\lfloor 1484/32 \rfloor} \times 4 ^ {\lfloor 1484/32 \rfloor} = 3.4 \times 10^{41}$, respectively, following the calculation rule of action space in Table. \ref{table:notation}. As shown in Table. \ref{table:882}, fill size grades number of $6$ can achieve better results (\textit{qh882}: coverage ratio 1 with area ratio 0.225, \textit{qh1484}: Coverage ratio 1 with area ratio 0.171) than that of $4$. That means more fine-grained fill size grades can achieve better results, this is also expected because the utilization of the mapped blocks is high (with lower sparsity) by this way. Visualizations of \textit{qh882} mapping schemes are shown in Fig. \ref{fig:882_visual}, and the training reward curves of the promising configuration (bold in the table) are shown in Fig. \ref{fig:882_curve}. In the same vein, visualization of \textit{qh1484} mapping scheme is shown in Fig. \ref{fig:1484_visual}, and corresponding training curve is shown in Fig. \ref{fig:1484_curve}. In real-world scenarios, the grid size is set subject to the allowable crossbar's size. The complexity of the peripheral circuit also depends on the grid size and the granularity of the dynamic-fill grades number, which ultimately jointly affect the area consumption of the final complete coverage solution. In principle, a smaller grid size and much more grades of the dynamic-fill-blocks will result in better mapping performance (complete coverage solutions with less area cost). Unavoidably, this also increases the action space of reinforcement learning, namely, the difficulty of agent optimization. These hyper-parameters can be tuned according to actual deployment scenarios, which demonstrates that our framework is flexible and scalable. \section{Conclusion} Some recent works have made effective attempts on efficient computation of sparse graphs, e.g. map the large-scale graph data by block coverage around the diagonal after matrix reordering. But their mapping methods are fixed or static, instead of proposing an effective mapping schedule scheme, which should be feasible, scalable, and flexible in our view. Based on the background of PIM crossbar computing and the characteristics of block coverage schedule problems, we first put forward the principles of the mapping framework as the criterion of subsequent research. We creatively propose to formulate this problem into a sequential decision-making problem whose solution space is equal to the 0-1 integer programming problem, and creatively propose the dynamic-fill method to ``fill the gaps'', which well meets our proposed basic principles of the mapping framework. After modeling the transformed sequential decision-making problem by the agent that consists of LSTM and FCs, we leverage the reinforcement learning algorithm (REINFORCE) to solve it. Finally, the comparison and ablation experiments on a small dataset and two large matrix data show that flexible and scalable mapping schemes can be generated with limited training epochs and time cost, and are suitable for the deployment and compilation systems. From our perspective, the limitation lays in that we only exploit the fundamental sequence-to-sequence model. Although we have tried to increase LSTM's model scale (layers and hidden size), we did not carry out in-depth discussion and research on the knowledge fusion model, which may reach better decision-making performance. Similarly, the most fundamental reinforcement learning algorithm based on policy gradient is utilized. Future, we plan to study the fusion of automatic mapping scheme and the sparse storage (CSC, CSR, COO), thus further accelerating the pipeline of the graph processing on memristive crossbars of PIM/CIM platforms. \balance \bibliographystyle{IEEEtran} \input{main.bbl} \end{document}
{'timestamp': '2021-11-16T02:31:34', 'yymm': '2111', 'arxiv_id': '2111.07684', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07684'}
arxiv
\section{Introduction} \input{sections/introduction} \section{Related work} \input{sections/related_work} \section{Efficiently axiomatically attributable DNNs} \label{sec:methods} \input{sections/method} \section{Experiments}\label{sec:experiments} \input{sections/experiments} \section{Conclusion and broader impact}\label{sec:conclusion} \input{sections/conclusion} \acksection\label{sec:acknowledgement} \input{sections/acknowledgements} { \small \bibliographystyle{abbrvnat} \section{Proofs and further results}\label{app:sec:proofs} \begin{proof}[Proof details for Proposition 3.2] In the proof of Proposition 3.2, we make use of the property that the derivative of a $k^\text{th}$-order homogeneous and differentiable function $F$ is a $(k-1)^\text{st}$-order homogeneous function, \emph{i.e.}, \begin{equation}\label{eq:01} \frac{\partial F(\alpha x)}{\partial \alpha x_i} = \alpha^{k-1} \frac{\partial F(x)}{\partial x_i}, \end{equation} see, \emph{e.g.}, Corollary 4 in~\citelatex{Border:2000:ETH}. Assuming $k^\text{th}$-order homogeneity of $F$ and using the chain-rule, the above \cref{eq:01} follows from \begin{equation} \alpha \frac{\partial F(\alpha x)}{\partial \alpha x_i} = \frac{\partial F(\alpha x)}{\partial \alpha x_i} \frac{\partial \alpha x_i}{\partial x_i} = \frac{\partial F(\alpha x)}{\partial x_i} = \frac{\partial \alpha^k F(x)}{\partial x_i} = \alpha^k \frac{\partial F(x)}{\partial x_i}. \end{equation} \end{proof} \begin{proof}[Proof of Proposition 3.8] For any input $z \in \mathbb{R}^n$, $\alpha \in \mathbb{R}_{\geq 0}$, and piecewise linear activation function $\phi_l$ according to \cref{eq:pw_linear_activation}, we want to show that \begin{equation} \alpha \phi_l(z) = \phi_l(\alpha z). \end{equation} For $\alpha=0$, both sides evaluate to 0 and the equality holds. For $\alpha>0$, the equality holds as long as the active interval of the activation function does not change. The active interval changes either when the sign of the input is changed, \emph{i.e.},~it goes from positive to negative or vice versa, or when a positive input changes to $0$, or a value of $0$ changes to positive. Since $\alpha>0$, a multiplication with $\alpha$ can neither change the sign nor can make positive values $0$ or $0$ values positive. Therefore, scaling the input with $\alpha>0$ changes none of the active activation function intervals and nonnegative homogeneity for $\alpha \in \mathbb{R}_{\geq 0}$ holds. \end{proof} \begin{proof}[Proof of Proposition 3.9] For any input $z \in \mathbb{R}^n$, $\alpha \in \mathbb{R}_{\geq 0}$, and pooling function $\psi _l$ with the assumed properties, we want to show that \begin{equation}\label{eq:pool} \alpha \psi _l(z) = \psi _l(\alpha z). \end{equation} If the pooling function is linear, homogeneity implicitly holds. If the pooling function is selecting values based on their relative ordering, we consider two cases. For $\alpha=0$, both sides evaluate to $0$ and the equality holds. For $\alpha>0$, the relative ordering of the entries in $z$ is unchanged by a scaling with $\alpha$, hence the same entry is selected by the pooling function. Since the value of the selected entry is scaled by $\alpha$, the above \cref{eq:pool} holds for $\alpha \in \mathbb{R}_{\geq 0}$ and nonnegative homogeneity is satisfied. \end{proof} \begin{proof}[Proof that $\mathcal{X}$-Gradient satisfies nonnegative homogeneity (Definition 3.6).] Using \cref{eq:01} and nonnegative $1^\text{st}$-order homogeneity of any $\mathcal{X}$-DNN $F$, it follows that \begin{equation} \mathcal{X} \text{G} (F, \alpha x) =\alpha x_i \frac{\partial F(\alpha x)}{\partial \alpha x_i} = \alpha x_i \alpha^0 \frac{\partial F(x)}{\partial x_i} = \alpha \mathcal{X} \text{G} (F, x), \end{equation} for $\alpha \in \mathbb{R}_{\geq 0}$, and therefore, nonnegative homogeneity of the attribution is satisfied. \end{proof} \myparagraph{Axiomatic attributions.} \Cref{axioms} in the main text summarizes the axioms~\cite{Sundararajan:2017:AAD} that are satisfied by several attribution methods. For proofs of the axioms that are satisfied by Integrated Gradients, please refer to~\cite{Sundararajan:2017:AAD}. For proofs of the axioms that are satisfied by Expected Gradients, please refer to~\cite{Erion:2021:IPD}. For proofs of the axioms that are satisfied by Input$\times$Gradient\ and Gradient, please refer to~\cite{Erion:2021:IPD, Sundararajan:2017:AAD} and see below. As $\mathcal{X}$-Gradient equals Integrated Gradients for $\mathcal{X}$-DNNs according to \cref{prop:01}, all the axioms satisfied by Integrated Gradients are also satisfied by $\mathcal{X}$-Gradient (for $\mathcal{X}$-DNNs). For Expected Gradients to satisfy the same axioms that are satisfied by Integrated Gradients, convergence must have occurred, which can only be expected after multiple gradient evaluations. To emphasize the advantage of our method when only considering attribution methods that use a single gradient evaluation, in \Cref{axioms} we also show the axioms that are satisfied by Expected Gradients~\cite{Erion:2021:IPD} when using only one reference sample, \emph{i.e.},~when convergence did not yet occur. Proof sketches for the axioms satisfied by Expected Gradients with only one reference sample are as follows: \begin{enumerate} \item \textit{Sensitivity (a):} Since there exist networks for which Sensitivity (a) is not satisfied by Input$\times$Gradient{}, and Expected Gradients could choose a sample such that the approximation equals Input$\times$Gradient, Sensitivity (a) is also not satisfied by Expected Gradients in general. \item \textit{Sensitivity (b):} As the gradient \emph{w.r.t.}\ an irrelevant feature will always be zero, Sensitivity (b) is satisfied. \item \textit{Implementation invariance:} As Expected Gradients use stochastic sampling for the baseline, there is no guarantee that even for the same model two attributions are equal. \item \textit{Completeness:} Again, following the argument from Sensitivity (a), Completeness is not given. \item \textit{Linearity:} As Expected Gradients use a stochastic sampling for the baseline, there is no guarantee that Linearity holds. \item \textit{Symmetry-preserving:} Following the argument from Linearity, Symmetry-preserving does not hold. \end{enumerate} \myparagraph{Why is nonnegative homogeneity a desirable axiom for attribution methods?} Explainability is closely related to predictability. Knowing how a model behaves under certain changes to the input implies an understanding of the model. Therefore, axioms like \textit{linearity}~\cite{Sundararajan:2017:AAD} and \textit{nonnegative homogeneity}, which essentially describe a form of predictability, are generally desirable and allow for a more complete understanding of the model's behavior. \myparagraph{(Input$\times$)Gradient violates Sensitivity (a).} To see that gradients and Input$\times$Gradient ~violate Sensitivity (a), it is instructive to consider the concrete example given in~\cite{Sundararajan:2017:AAD}: Assume we have a simple ReLU network $f(x) = 1 - \text{ReLU}(1-x)$. When having a baseline $x^\prime = 0$ and an input $x = 2$, $f(x^\prime)$ respectively $f(x)$ changes from $0$ to $1$. However, as the function flattens out at $x = 1$, the above gradient-based attribution methods would yield an attribution of $0$ for the input $x=2$. \section{Experimental details}\label{app:sec:exp} In the following section we provide additional details to ensure reproducibility of our experiments. For further information, please see our public code base\footnote{\href{https://github.com/visinf/fast-axiomatic-attribution}{\nolinkurl{github.com/visinf/fast-axiomatic-attribution}}} released under an Apache License 2.0. \subsection{Removing the bias term in DNNs}\label{app:sec:exp:bias} The models for all reported results in \cref{sec:experiments:bias} have been trained for 100 epochs on the training split of the ImageNet~\cite{Russakovsky:2015:ILS} dataset with a batch size of 256 and using a single Nvidia A100 SXM4 (40GB) GPU. The training time per epoch is approximately 10 minutes for AlexNet, 60 minutes for VGG16, and 40 minutes for ResNet-50. For training the AlexNet and VGG models, we use the official PyTorch~\citelatex{Paszke:2017:ADP} implementation\footnote{\href{https://github.com/pytorch/examples/tree/master/imagenet}{\nolinkurl{github.com/pytorch/examples}}} that is published under a BSD 3-Clause license. We use an SGD optimizer with an initial learning rate of 0.01 that is decayed by a factor of 0.1 every 30 epochs, a momentum of 0.9, and a weight decay of 1e-4. For training the ResNet models, we use the settings proposed by~\cite{Zhang:2019:FIR} and rely on the publicly available code,\footnote{\href{https://github.com/hongyi-zhang/Fixup}{\nolinkurl{github.com/hongyi-zhang/Fixup}}} which is released under a BSD 3-Clause license. The hyperparameters are the same as for the AlexNet and VGG models except that we use mixup regularization~\citelatex{Zhang:2018:MBE} with an interpolation strength $\alpha=0.7$, a cosine annealing learning rate scheduler, and an initial learning rate of 0.1. The mean absolute relative difference between the attribution obtained from Integrated Gradients~\cite{Sundararajan:2017:AAD} and the attribution obtained from calculating Input$\times$Gradient\ for regular DNNs resp.~$\mathcal{X}$-Gradient for $\mathcal{X}$-DNNs is calculated as \begin{equation} d(\mathcal{A}, X) = \frac{1}{n|X|}\sum_{x \in X}\sum_{i=1}^{n}\frac{|\text{IG}_i(F, x, \mathbf{0})-\mathcal{A}_i(F, x)|}{|\text{IG}_i(F, x, \mathbf{0})|}\ , \end{equation} with $X$ denoting a dataset consisting of samples $x \in \mathbb{R}^n$. \subsection{Benchmarking gradient-based attribution methods}\label{app:sec:exp:bench} For the experimental comparison of gradient-based attribution methods in \cref{sec:experiments:metrics}, we use the models from \cref{sec:experiments:bias} (see \cref{app:sec:exp:bias} for details) and evaluate on the ImageNet validation split using a single Nvidia A100 SXM4 (40GB) GPU. To quantify the quality of attributions, we use the attribution quality metrics proposed by \citet{lundberg_local_2020}. The metrics reflect how well an attribution method captures the relative importance of features by masking out a progressively increasing fraction of the features based on their relative importance: \begin{description} \item[Keep Positive Mask (KPM)] measures the attribution method's capability to find the features that lead to the greatest increase in the model's output logit of the target class. For that a progressively increasing fraction of the features is masked out, ordered by least positive to most positive attribution. Then the AUC of the resulting curve is measured. Intuitively, if an attribution reflects the true behavior of the model, unimportant features will be masked out first and the model output logit decreases only marginally, resulting in a high value for the AUC. The other way around, when an attribution does not reflect the true behavior of the model, an important feature might be masked out too early and the target class output decreases quickly, leading to a smaller score. \item[Keep Negative Mask (KNM)] works analogously for negative features. This means that the better the attribution, the smaller the metric. Note that for KPM and KNM, all negative and positive features are masked out by default, respectively. \item[Keep Absolute Mask (KAM)] and \textbf{Remove Absolute Mask (RAM)} work similarly but using the absolute value of the attributions and measuring the AUC of the top-1 accuracy. For KAM, we keep the most important features and measure the AUC of the top-1 accuracy over different fractions of masking. A high-quality attribution method should keep the features most important for making a correct classification, and therefore, the metric should be as high as possible. RAM masks out the most important features first, meaning that the accuracy should drop fast. Therefore, a smaller value indicates a better attribution. \end{description} As we evaluate attributions for image classification models, we adapt the above metrics to work with image data. This is achieved by replacing the masked pixels with those of a blurry image, which is obtained using a Gaussian blur with a kernel size of $51\times 51$ and $\sigma=41$ applied to the original input image. The parameters were chosen such that the resulting image is visually heavily blurred. This ensures that features can properly be removed. \subsection{Training with attribution priors}\label{app:sec:exp:training} Our experiment with attribution priors in \cref{sec:experiments:sparsity} replicates the experimental setup of~\cite{Erion:2021:IPD}. We use the original code, which includes the NHANES I dataset and is published under the MIT license.\footnote{\href{https://github.com/suinleelab/attributionpriors/tree/master/sparsity}{\nolinkurl{github.com/suinleelab/attributionpriors}}} We use the attribution prior proposed by \citet{Erion:2021:IPD} to learn sparser models, which have improved generalizability. The prior is defined as \begin{equation*} \Omega_{sparse}(\bar{\mathcal{A}}) = - \frac{\sum_{i=1}^n\sum_{j=1}^n |\bar{\mathcal{A}_i} - \bar{\mathcal{A}_j}|}{m \sum_{i=1}^n \bar{\mathcal{A}_i}}\ , \end{equation*} with $\bar{\mathcal{A}}$ denoting the mean attribution of a mini-batch with $m$ samples. This prior improves sparsity of the model by minimizing the statistical dispersion of the feature attributions. We use the following attribution methods as baselines, which are commonly used for training with attribution priors: Expected Gradients (EG), the input gradient of the \textit{log} of the output logit as proposed by~\cite{Ross:2017:RRR} (RRR), and a regular input gradient (Grad). We compare these methods with our novel $\mathcal{X}$-Gradient ($\mathcal{X}$G) attribution method. For each attribution method, we perform an individual hyperparameter search to find the optimal regularization strength $\lambda \in \{0.01, 0.1, 1, 10, 100\}$. We find $\lambda=0.1$ for RRR and Grad, and $\lambda=1.0$ for $\mathcal{X}$G and EG. When training the model with Expected Gradients using more than one reference sample, we continue to use the regularization strength $\lambda$ that was found using one reference sample. All other hyperparameters are kept as in the original experiment of~\cite{Erion:2021:IPD}. To train the models, we use a Nvidia GeForce RTX 3090 (24GB) GPU. To provide a numerical comparison of the efficiency of $\mathcal{X}$-Gradient and Expected Gradients~\cite{Erion:2021:IPD}, we report the computation time and GPU memory usage for training a ResNet-50 on the ImageNet dataset with Expected Gradients using 32 reference samples and with $\mathcal{X}$-Gradient. We use a single Nvidia A100 SXM4 (40GB) GPU and a batch size of two. The number of reference samples corresponds to the number of reference samples determined in the experiment in \cref{fig:sparsity}(right), where both networks achieve the same ROC-AUC. When using Expected Gradients for training, the GPU memory usage is $14.57$ GB while for $\mathcal{X}$-Gradient the memory usage is $4.21$ GB. The computation time per iteration, averaged over $100$ iterations, is $1.12$ s for Expected Gradients and 0.0086 for $\mathcal{X}$-Gradient. To conclude, in this scenario we observe a massive improvement in the efficiency of $\mathcal{X}$-Gradient compared to Expected Gradients. Expected Gradients requires $\sim130$ times more computation time and $\sim3.46$ times more GPU memory. \begin{figure}[t] \centering \includegraphics[width=1.0\linewidth]{figures/ig_convergence.pdf} \caption{\textit{Convergence of Integrated Gradients~\cite{Sundararajan:2017:AAD}.} We plot the mean absolute difference of Integrated Gradients obtained by using 300 and different numbers of approximation steps for AlexNet on the ImageNet validation split. We find convergence to occur after approximately 128 steps.}\label{fig:ig_conv} \end{figure} \subsection[Homogeneity of X-DNNs]{Homogeneity of $\mathcal{X}$-DNNs}\label{app:sec:exp:homogeneity} For the experiment in \cref{sec:experiments:homog}, we use the same models as in \cref{sec:experiments:bias} (see \cref{app:sec:exp:bias} for details) and evaluate on the ImageNet validation split using a single Nvidia A100 SXM4 (40GB) GPU. Additional qualitative examples of the attributions for the output logit of the target class for a regular AlexNet and an $\mathcal{X}$-AlexNet, as in \cref{fig:exp4}(right), are shown in \cref{fig:qual}. Our findings in \cref{sec:experiments:homog} are consistent with the additional results. As with \cref{fig:exp4}(right) in the main paper, we observe that $\mathcal{X}$-Gradient ($\mathcal{X}$G) equals Integrated Gradients (IG) for the $\mathcal{X}$-AlexNet up to a small approximation error and that reducing the contrast of the images keeps the attribution unchanged up to a scaling factor (not visible due to normalization for display purposes). On the other hand, for the regular AlexNet the attributions obtained from Input$\times$Gradient\ and Integrated Gradients differ and change depending on the contrast. \subsection{Convergence of Integrated Gradients}\label{app:sec:exp:convergence} For our experimental comparisons with Integrated Gradients~\cite{Sundararajan:2017:AAD}, we assume convergence of the method. To empirically find a suitable number of approximation steps, we analyze the mean absolute difference of the Integrated Gradients obtained by using $n$ and $300$ approximation steps as plotted in \cref{fig:ig_conv}. We choose $300$ steps for reference because \citet{Sundararajan:2017:AAD} report 300 steps as the upper bound for convergence. We use the trained AlexNet model from \cref{sec:experiments:bias} (details in \cref{app:sec:exp:bias}), the ImageNet validation split, and $n \in [1,2,4,8,16,32,64,128,256]$. We find 128 approximation steps to be sufficient and use this number in our experiments. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{figures/suppl.pdf} \caption{\textit{Qualitative examples} of normalized attributions for the output logit of the target class for $\mathcal{X}$-AlexNet and AlexNet using the attribution methods Input$\times$Gradient\ (I$\times$G), $\mathcal{X}$-Gradient ($\mathcal{X}$G), and Integrated Gradients (IG).}\label{fig:qual} \end{figure} \subsection{Removing the bias term in DNNs}\label{sec:experiments:bias} \begin{table} \caption[Table 2]{\emph{Top-5 accuracy} on the ImageNet~\cite{Russakovsky:2015:ILS} validation split and mean absolute relative difference (see \cref{app:sec:exp:bias}) of Input$\times$Gradient \ for regular DNNs resp. $\mathcal{X}$-Gradient for $\mathcal{X}$-DNNs to the numerical approximation of Integrated Gradients. Note how removing the bias ($\mathcal{X}$-DNN) impairs the accuracy only marginally while reducing the mean absolute relative difference to Integrated Gradients significantly, confirming our theoretical finding that $\mathcal{X}$-Gradient equals Integrated Gradients.} \label{table:exp1} \centering \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} lcccccc} \toprule \multicolumn{1}{c}{} & \multicolumn{3}{c}{Top-5 accuracy (\%, $\uparrow$)} & \multicolumn{3}{c}{Mean absolute relative difference (\%, $\downarrow$)} \\ \cmidrule(r){2-4} \cmidrule(r){5-7} Model & AlexNet & VGG16 & ResNet-50 & AlexNet & VGG16 & ResNet-50\\ \midrule Regular DNN & \textbf{79.21} & \textbf{90.44} & \textbf{92.56} & 79.0 & 97.8 & 93.8 \\ $\mathcal{X}$-DNN & 78.54 & 90.25 & 91.12 & \textbf{1.2} & \textbf{0.4} & \textbf{0.0} \\ \bottomrule \end{tabular*} \end{table} Historically, the bias term plays an important role and almost all DNN architectures use one. In this first experiment, we evaluate how much removing the bias to obtain an $\mathcal{X}$-DNN affects the accuracy of different DNNs. To this end, we train multiple popular image classification networks, AlexNet~\cite{Krizhevsky:2012:INC}, VGG16~\cite{Simonyan:2015:VDC}, and the ResNet-50 variant of \cite{Zhang:2019:FIR}, as well as their corresponding $\mathcal{X}$-DNN variants obtained by removing the bias term, on the challenging ImageNet~\cite{Russakovsky:2015:ILS} dataset. The resulting top-5 accuracy on the validation split is given in \cref{table:exp1}. As we can observe, removing the bias decreases the accuracy of the models only marginally. This is a somewhat surprising result since prior work indicates that the bias term in DNNs plays an important role~\cite{Wang:2019:BAM}. We hypothesize that when removing the bias term, the DNN learns some kind of layer averaging strategy that compensates for the missing bias. For an additional comparison between a DNN with bias and its corresponding $\mathcal{X}$-DNN in a non-vision domain, see \cref{sec:experiments:sparsity}, which mirrors our findings here. Additionally, to empirically validate our finding that $\mathcal{X}$-Gradient ($\mathcal{X} G$) equals Integrated Gradients for $\mathcal{X}$-DNNs, we report the mean absolute relative difference (see \cref{app:sec:exp:bias}) between the attribution obtained from Integrated Gradients~\cite{Sundararajan:2017:AAD} and the attribution obtained from computing Input$\times$Gradient\ for regular DNNs resp.~$\mathcal{X}$-Gradient for $\mathcal{X}$-DNNs over the ImageNet validation split. For regular models with biases, Integrated Gradients produce a very different attribution compared to Input$\times$Gradient. For $\mathcal{X}$-DNNs on the other hand, the two attribution methods are virtually identical, as expected. The small deviation can be explained by the fact that the result of Integrated Gradients~\cite{Sundararajan:2017:AAD} is computed via numerical approximation, whereas our method computes the exact integral (of course only for $\mathcal{X}$-DNNs). We make the pre-trained $\mathcal{X}$-DNN models publicly available to promote a wide adoption of efficiently axiomatically attributable models. \subsection{Benchmarking gradient-based attribution methods}\label{sec:experiments:metrics} \begin{table} \caption[Table 3]{\emph{Metrics of~\citet{lundberg_local_2020} to measure the attribution quality} of different attribution methods. Please refer to the experimental setup in the beginning of \cref{sec:experiments}\ and \cref{app:sec:exp:bench} for an introduction of the metrics. We evaluate Integrated Gradients (IG)~\cite{Sundararajan:2017:AAD}, random attributions (Random), input gradient attributions (Grad), Expected Gradients (EG)~\cite{Erion:2021:IPD}, and our novel $\mathcal{X}$-Gradient ($\mathcal{X}$G) attribution on a regular AlexNet~\cite{Zhang:2019:FIR} and the corresponding $\mathcal{X}$-AlexNet. The numbers in parentheses indicate the required gradient calls. Our method is on par with IG in terms of quality while requiring two orders of magnitude less computational power. } \label{exp:metrics} \centering \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccc} \toprule \multicolumn{1}{c}{} & \multicolumn{4}{c}{AlexNet} & \multicolumn{4}{c}{$\mathcal{X}$-AlexNet}\\ \cmidrule(r){2-5} \cmidrule(r){6-9} Method & KPM $\uparrow$ & KNM $\downarrow$ & KAM $\uparrow$ & RAM $\downarrow$ & KPM $\uparrow$ & KNM $\downarrow$ & KAM $\uparrow$ & RAM $\downarrow$ \\ \midrule IG (128) & \textbf{7.57} & \textbf{1.67} & \textbf{25.22} & \textbf{11.12} & \textbf{7.38} & \textbf{2.21} & 21.79 & 11.68 \\ \midrule Random & 3.68 & 3.68 & 14.12 & 14.10 & 3.81 & 3.81 & 13.52 & 13.50 \\ Grad (1) & 3.62 & 3.88 & 20.78 & 11.82& 3.87 & 4.34 & 19.75 & \textbf{11.25} \\ EG (1) & 4.92 & 2.97 & 20.49 & 13.76 & 5.41 & 3.19 & 19.47 & 13.19 \\ $\mathcal{X}$G (1) & N/A & N/A & N/A & N/A & \textbf{7.38} & \textbf{2.21} & \textbf{21.83} & 11.68 \\ \bottomrule \end{tabular*} \end{table} As prior work~\cite{Erion:2021:IPD,Liu:2019:IPF} but also our experiment in \cref{sec:experiments:sparsity} suggest that the quality of an attribution method positively impacts the effectiveness of attribution priors, we benchmark our method against existing gradient-based attribution methods that are commonly used for training with attribution priors. For evaluation, we use the metrics from \cite{lundberg_local_2020} adapted to work with image data. Using these metrics allows for a diverse assessment of the feature importance~\cite{lundberg_local_2020} and ensures consistency with the experimental setup in~\cite{Erion:2021:IPD}. \cref{exp:metrics} shows the resulting numbers for a regular AlexNet and our corresponding $\mathcal{X}$-AlexNet. Due to the axioms satisfied by the Integrated Gradients method, it produces the best attributions for the regular network, which is in line with the results in~\cite{Yeh:2019:OIS}. However, as it approximates an integral where each approximation step requires an additional gradient evaluation, it also introduces one to two orders of magnitude of computational overhead compared to the other methods (\citet{Sundararajan:2017:AAD} recommend 20--300 gradient evaluations to approximate attributions). For the $\mathcal{X}$-AlexNet, however, our $\mathcal{X}$-Gradient method is on par with Integrated Gradients and produces the best attributions while requiring only one gradient evaluation, and therefore, a fraction of the compute power. Since the input gradient and Expected Gradients~\cite{Erion:2021:IPD} with only one reference sample do not satisfy many of the desirable axioms (see \cref{axioms}), they produce clearly lower quality attributions as expected. Note that high-qualitative attribution methods should perform well across all the listed metrics, which is why the input gradient is not a competitive attribution method even though it performs well on the RAM metric. To conclude, we can see that our $\mathcal{X}$-Gradient attribution yields a significant improvement in quality compared to state-of-the-art generic attribution methods that require similar computational cost. This suggests that our effort to produce an efficient and high-quality attribution method is justified and accomplished. \subsection{Training with attribution priors}\label{sec:experiments:sparsity} \begin{figure} \centering \includegraphics[width=1.0\linewidth]{figures/sparsity_maintext.pdf} \caption[Figure 1]{(left) \emph{Average ROC-AUC} across 200 randomly subsampled datasets for the same attribution prior using different attribution methods. ``w/o bias'' denotes that the bias term has been removed from the MLP. (right) \emph{Average ROC-AUC} across 200 randomly subsampled datasets of Expected Gradients (EG) over the number of reference samples. The current state-of-the-art EG requires approximately 32 reference samples, and thus, 32 times more computational power to outmatch $\mathcal{X}$G. Confidence intervals indicate two times the standard error of the mean.}\label{fig:sparsity} \end{figure} To benchmark our approach against other attribution methods when training with attribution priors, we replicate the sparsity experiment introduced in~\cite{Erion:2021:IPD}. To that end, we employ the public NHANES I survey data~\cite{NHANES} of the CDC of the United States, containing 118 one-hot encoded medical attributes, \emph{e.g.},~age, sex, and vital sign measurements, from 13,000 human subjects (no personally identifiable information). The objective of the binary classification task is to predict if a human subject will be dead (0) or alive (1) ten years after the data was measured. A simple MLP with ReLU activations is used as the model. Therefore, it can be transformed into an $\mathcal{X}$-DNN by simply removing the bias terms. To emulate a setting of scarce training data and to average out variance, we randomly subsample 200 training and validation datasets containing 100 data points from the original dataset. \citet{Erion:2021:IPD} proposed a novel attribution prior that maximizes the Gini coefficient, \emph{i.e.},~minimizes the statistical dispersion, of the feature attributions. They show that this allows to learn sparser models, which have improved generalizability on small training datasets. The more faithfully the attribution reflects the true behavior of the model, the more effective the attribution prior should be. \myparagraph{Comparing attribution methods.} We compare different attribution methods that have previously been used for training with attribution priors and require only one gradient evaluation; thus, they have comparable computational cost. The results in \cref{fig:sparsity}(left) show that our method ($\mathcal{X}$G w/o bias) outperforms all other competing methods. We can also see that for the unregularized model, removing the bias (Unreg w/o bias) has almost no effect on the average ROC-AUC of the method, once again showing that our modification for making attributions efficient, \emph{i.e.},~removing the bias term, is plausible in various scenarios. Since the attribution quality of Expected Gradients can be improved using more reference samples, as this yields a better approximation to the true integral, we plot the average ROC-AUC of Expected Gradients over the number of reference samples used in \cref{fig:sparsity}(right). We can clearly see that adding more samples improves the ROC-AUC when training with an EG attribution in the prior, yet again, showing that higher quality attributions lead to more effective attribution priors~\cite{Erion:2021:IPD}. However, we also find that approximately 32 reference samples are needed, and hence 32 times more computational power, to match the quality of our efficient $\mathcal{X}$-Gradient method. When using more than 32 reference samples, Expected Gradients slightly outperform our method in terms of ROC-AUC, which is due to the limitations discussed in \cref{sec:methods} (fixed baseline, no bias terms). We argue that it is often worth accepting this small accuracy disadvantage in light of the significant gain in efficiency of computing high-quality feature attributions. To put this improvement in efficiency into perspective, we measure the computation time of training a ResNet-50 on the ImageNet dataset when using Expected Gradients with 32 reference samples and $\mathcal{X}$-Gradient (see \cref{app:sec:exp:training}). Using a single GPU, the computational overhead introduced when using Expected Gradients with 32 reference samples amounts to an approximately $130$-fold increase in the required computation time compared to training with $\mathcal{X}$-Gradient, and thus, would turn several days of training into several months of training. \subsection[Homogeneity of X-DNNs]{Homogeneity of $\mathcal{X}$-DNNs}\label{sec:experiments:homog} \begin{figure} \centering \includegraphics[width=1.0\linewidth]{figures/exp4_v1.pdf} \caption[Figure 2]{(left) \emph{Top-1 accuracy} for AlexNet and $\mathcal{X}$-AlexNet on the ImageNet validation split with decreasing contrast (scaled by $\alpha$). Due to the nonnegative homogeneity of $\mathcal{X}$-AlexNet, the accuracy does not drop when reducing the contrast. (right) \emph{Qualitative examples} of normalized attributions for $\mathcal{X}$-AlexNet and AlexNet using the attribution methods $\mathcal{X}$-Gradient ($\mathcal{X}$G) resp.~Input$\times$Gradient~(I$\times$G) as well as Integrated Gradients (IG). The displayed attributions obtained from $\mathcal{X}$-AlexNet are almost identical, while attributions obtained from AlexNet differ significantly (see highlighted areas).}\label{fig:exp4} \end{figure} The fundamental difference between $\mathcal{X}$-DNNs and regular DNNs is the nonnegative homogeneity of the former. To show implications on the model and its attributions, we conduct the following experiment. Similarly to \citet{Hendrycks:2019:BNN}, we reduce the contrast of the ImageNet~\cite{Russakovsky:2015:ILS} validation split by multiplying each image with varying factors $\alpha$ and report the top-1 accuracy of AlexNet and the corresponding $\mathcal{X}$-AlexNet from \cref{sec:experiments:bias}, \emph{i.e.}, they have not been trained specifically to handle contrast changes. Results can be found in \cref{fig:exp4}(left). We can observe that decreasing the image contrast leads to a strong drop in accuracy of a regular AlexNet. On the other hand, due to the equivariance to contrast of $\mathcal{X}$-DNNs, the accuracy of the $\mathcal{X}$-AlexNet is unaffected, showing improved robustness towards multiplicative contrast changes. To give some qualitative examples, in \cref{fig:exp4}(right) we plot the attributions for the output logit of the target class (`reflex camera') for a regular AlexNet and an $\mathcal{X}$-AlexNet for an original image and the corresponding low-contrast image obtained by multiplying the normalized image with $\alpha = 0.3$. For the $\mathcal{X}$-AlexNet, our $\mathcal{X}$-Gradient method and Integrated Gradients~(IG)~\cite{Sundararajan:2017:AAD} produce attributions that are identical up to a small approximation error; reducing the image contrast keeps the attributions unchanged up to a scaling factor (not visible due to normalization for display purposes). However, the displayed attributions from the regular AlexNet differ significantly between Input$\times$Gradient~(I$\times$G) and IG, as well as for different contrasts (see highlighted areas). We argue that the above properties of $\mathcal{X}$-DNNs generally reflect desirable properties and show that they behave more predictably with contrast changes than regular DNNs. Also note how high feature attribution scores can arise in the background (\emph{e.g.}, red box), showing how DNN predictions can depend of parts of the input that do not appear salient for the category; this highlights a possible use case for attribution priors~\cite{Rieger:2020:IUP,Ross:2017:RRR} enabled by our approach.
{'timestamp': '2021-11-16T02:30:33', 'yymm': '2111', 'arxiv_id': '2111.07668', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07668'}
arxiv
\subsection{Notations} \subsection{The Transformation Bottleneck(TB) problem} Existing perspectives of CLR are based on $I(T(X); T'(X))$ (discussed more in depth in related works, Section \ref{sec:related}). In this work, we revisit the infoMax problem from a different perspective in a framework of self-supervised learning that explicitly separates the \textit{augmentation channel} in the encoding map $X \to Z$. Consider the generation process illustrated in the Figure \ref{fig:non-branching}. \begin{figure}[ht!] \centering \includegraphics[scale=0.35]{generation.png} \caption{Generation Process of $Z$} \label{fig:non-branching} \end{figure} In this process, $V=T(X)$ is produced from $X$ by applying a random augmenation $T$ sampled from some distribution $p(T|X)$. $V$ is then encoded into $Z$ through the distribution $p(Z|V)$ parametrized by some encoder $h$. Thus, the distribution of $Z$ can be written as \begin{align} p(z| x) = \int p\left(z | T(x)\right)p(T| X) dT \end{align} Using $\mathcal{G}$ to denote the family of distributions that can be written in this form, we consider the InfoMax problem $\max_{p \in \mathcal{G}} I(X; Z)$. In this definition of the map $X \to Z$, the support $\mathcal{T}$ of $p(T|X)$ determines the maximum amount of information that can be preserved. For example, if all members of $\mathcal{T}$ strongly corrupts $X$, $I(X;Z)$ would be small for all choice of $P(T|X)$. Meanwhile, if the identity transformation is included in $\mathcal{T}$, then $V=X$ can be achieved by setting $P(T|X)=\delta_{id}(T)$. However, as in training methods based on noise regularization \cite{VAT, Noise_reg,Imsat}, the identity mapping is often not included in the augmentation set because it does not help regularize the model. The infoMax problem in our framework has a deep connection with modern self supervised learning, as it can provide another derivation of simCLR that does not use a variational approximation. \begin{prop} Suppose that $p(Z \mid T(X))= C_\beta \exp(\beta \mathcal{S}(Z, h(T(X))))$ where $\mathcal{S}: \mathcal{Z} \times \mathcal{Z} \to \mathbb{R}$ is a similarity function on the range of $Z$ and $C_\beta$ is a constant dependent only on $\beta$. Then \begin{align} I(X ; Z) &= E_{X, Z} \left[ \log E_{T'|X}\left[ \frac{ \exp(\beta \mathcal{S}(Z , h(T'(X))) }{E_{T'', \tilde X}[\exp(\beta \mathcal{S}(Z, h(T'' (\tilde X)))]}\right] \right] \label{eq:TBCRL} \end{align} Also, when $P(T|X)$ is uniformly distributed on a compact set of view-transformations, the mean approximation of $Z$ and Jensen's inequality on the $E_{T'|X}$ part of \eqref{eq:TBCRL} recovers the simCLR loss. \label{thm:TBC_prop} \end{prop} For the proof of Prop \ref{thm:TBC_prop}, please see Appendix \ref{appsec:proof}. We shall note that the condition of this statement is fulfilled in natural cases, such as when $P(Z|T(X))$ is Gaussian or Gaussian on the sphere. In the proof of Prop \ref{thm:TBC_prop}, the numerator and the denominator correspond directly to $- H(Z | X)$ and $H(Z)$. If $Z$ takes its value on the sphere $\mathcal{S}^{d}$, enlarging $H(Z)$ would encourage $Z$ to be uniformly distributed over the sphere. These observations support the theory proposed in \cite{wang2020uniform}. The table in Appendix \ref{appsec:algorithm} summarizes our algorithm for optimizing the objective \eqref{eq:TBCRL} with respect to both $P(T|X)$ and $h$. \subsection{Setup} We show that, by training $P(T|X)$ together with the encoder $h$ based on the objective \eqref{eq:TBCRL}, we can learn a better representation than the original simCLR. We conducted an experiment on a dataset derived from MNIST mentioned at the introduction (Figure\ref{fig:regional}). To construct this dataset, we first prepared a blank image of size $(28 * 3) \times (28 * 3)$, which is $3$ times greater in both dimensions than the original MNIST images ($28 \times 28$). We then created our dataset by placing each MNIST image randomly at one of $3 \times 3 = 9$ grid locations in the aforementioned blank image. We set $T$ to be a random augmentation that crops a $20 \times 20$ image at one of $17 \times 17=289$ locations ranging over the $(28 * 3) \times (28 * 3)$ dimensional image with stride size $4$. On this dataset, any crop that does not intersect with the digit produces the same \emph{empty} image, which is useless in discriminating the image instances. For computational ease, we trained our encoder $h$ based on the Jensen-lower bound of \eqref{eq:TBCRL}. We shall also note that, in our setup, our $h$ corresponds to the composition of the projection head $g$ and the encoder $f$ in the context of the recent works of contrastive learning. We evaluated the representation of both $h = g \circ f$ and $f$. Also, without any additional constraint, $P(T|X)$ sometimes collapsed to the "the most discriminating" crop on the training set, resulting in a representation that does not generalize on the downstream classification task. To resolve this problem, we adopted the maximum entropy principle \cite{softQ_Haarnoja} and optimized our objective \eqref{eq:TBCRL} together with small entropy regularization $H(T|X)$, seeking the highest entropy $T$ that maximises the objective \eqref{eq:TBCRL}. \vspace{-0.15cm} \subsection{Performance of the trained representations in Linear Evaluation Protocol} \label{sec:exp_table1} To evaluate the learned representation, we followed the linear evaluation protocol as in \cite{chen2020simclr} and trained a multinomial logistic regression classifier on the features extracted from the frozen pretrained network. We used Sklearn library \cite{pedregosa2011scikit} to train the classifier. For SimCLR, it is often customary to use the "center crop" augmentation $T_{center}$ and report $h(T_{center}(X))$ as the representation for $X$. However, in this example, "center crop" would extract an empty image with high probability. Thus, we computed the representation of each $X$ by integrating the encoded variable with respect to $P(T|X)$, that is, $\hat{Z} = E_{T\sim P(T|X)}[h(T(X))]$ ($P(T|X)$ for simCLR is uniform). For the models with non-uniform $P(T|X)$ we also evaluated $Z_{topn}$, the representation obtained by averaging $h(T(X))$ over the set of $T$s having the top eight $P(T|X)$ density. As an ablation, we also evaluated the SimCLR-trained encoder by integrating its output with respect to the oracle $P(T|X)$ concentrated uniformly on the $9$ crop positions with maximal intersection with the embedded MNIST image. We conducted each experiment with $4$ seeds. The table \ref{tab:lcp} summarizes the result. \begin{table}[t] \small \caption{Linear evaluation accuracy scores. Raw Representation achieves $0.8992 \pm 0.0012$. For the description of \textit{oracle} and \textit{topn}, please see the main script (Section \ref{sec:exp_table1}).} \label{tab:lcp} \centering \scalebox{0.9}{ \begin{tabular}{lccccc} \toprule \toprule Method & Ours & Ours(topn) & SimCLR & simCLR(oracle) \\ \midrule Projection Head & $0.95505 \pm 0.0023$ & $0.9552 \pm 0.0037$ & $0.3156 \pm 0.0044$ & $0.5144 \pm 0.011$ \\ $f$ output & $0.9729\pm 0.0014$ & $0.9748 \pm 0.0012$ & $0.4598\pm 0.0056$ & $0.9354 \pm 0.0029$ \\ \bottomrule \end{tabular}} \end{table} We can see that, with our trained $P(T|X)$ and $h$, we can achieve a very high linear evaluation score, even better than the raw representation result on the ordinary MNIST dataset ($0.9256$). Interestingly, with our $P(T|X)$, the representation is competitive even at the projection head, and its performance even exceeds the representation of simCLR obtained by averaging $f(T(X))$ over the oracle $P(T|X)$. This trend was also observed in the experiment on the original MNIST(see Appendix \ref{appsec:mnist}). This result may suggest that the poor quality of simCLR representation at the level of the projection head is partially due to the fact that proper $P(T|X)$ is not used in training the model. Also, in confirmation of our problem statement in the section \ref{sec:introduction}, the representation learned without the trainable $P(T|X)$ collapses around that of the empty image (see Appendix \ref{appsec:uniformity}). In terms of the average pairwise Gaussian potential used in \cite{wang2020uniform} that measures the uniformity of the representations on the sphere(lower the better), our representation achieves $0.0845$ as opposed to $0.9757$ of the baseline simCLR. \vspace{-0.15cm} \subsection{The trained $P(T|X)$ agrees with our intuition} \begin{figure}[h!] \begin{center} \includegraphics[scale=0.3]{PTgivenX_large.png} \caption{Visualization of the trained $P(T|x)$ (bottom row) for various choice of $x$(top row). Brighter color represents higher intensity. } \label{fig:ptgivenx} \end{center} \end{figure} Figure 3 visualizes the density of $P(T|x)$(second row) for various input image $x$(second row). In each image of the second row, the intensity at $(i,j)$th pixel is $P(T_{ij}|X)$, where $T_{ij}$ is the augmentation that crops the sub-image of size $20 \times 20$ with the top left corner located at $(i,j)$. As we can see in the figure, the learned $P(T|X)$ is concentrated on the place of digit, ignoring the crop locations that would return the empty image. Our learned $P(T|X)$ in fact captures the non-trivial crop with probability $0.998 \pm 0.003$ on 10,000 test images. \section{Appendix / importatnt notes} \subsection{Formal statement and the proof of Proposition \ref{thm:TBC_prop}} \label{appsec:proof} \begin{prop*} Suppose that $p(Z \mid T(X))= C_\beta \exp(\beta \mathcal{S}(Z, h(T(X))))$ where $\mathcal{S}: \mathcal{Z} \times \mathcal{Z} \to \mathbb{R}$ is a similarity function and $C_\beta$ is a normalization constant dependent only on $\beta$, Then \begin{align} I(X ; Z) &= E_{X, Z} \left[ \log E_{T'|X}\left[ \frac{ \exp(\beta \mathcal{S}(Z , h(T'(X)))}{E_{T'', X'}[\exp(\beta \mathcal{S}(Z, h(T'' (X')))]}\right] \right]. \end{align} Also, when $P(T|X)$ is uniformly distributed over a compact set of view-transformations, we recover the loss of SimCLR by (1) applying Jensen's inequality on $E_{T'|X}$ and (2) approximating $Z$ with $h(T(X))$, the mean of $p(Z|T(X))$. \end{prop*} \begin{proof} We use upper case letter to denote the random variable and lower case letter to denote its corresponding realization ($x$ is a realization of $X$). We also use the standard notation in the measure theoretic probability that treat expressions like $P(A| B)$ and $E[A| B]:=E_{A|B}[A]$ as a random variable that is measurable with respect to $B$. Thus, in the equality $E[A] = E[E[A | B]]$, the integral $E[A | B]$ inside the RHS is a random variable with respect to $B$. To clarify, we sometimes use the subscript to represent the variable with respect to which the integral is taken. For more details about this algebra, see \cite{Durrett} for example. Here, we show the proof of the version of the statement with the application of Jensen's inequality. The proof without Jensen's inequality can be derived easily from the intermediate results of this proof. \paragraph{On $-H(Z \mid X)$} \begin{align} E_{X,Z}[\log P(Z|X)] &= E_{X,Z}[\log ( E_{T'}[P(Z|X, T') | X] )] \\ &:= E_{X,Z}[ \log E_{T'|X}[ (C_\beta \exp(\beta S(Z, h( T'(X))))) ] \\ &=E_{X,Z}[ \log E_{T'|X}[ (\exp(\beta S(Z, h(T'(X))))) ] + C_\beta \\ &\geq E_{X,Z}[ E_{T'|X}[\log (\exp(\beta S(Z, h(T'(X)))))] + C_\beta \\ &= E_{X,Z}[ E_{T'|X}[\beta S(Z, h(T'(X)))] + C_\beta \\ &:= E_{X,Z} [E_{T'|X}[\beta S(Z, h(T'(X)))] + C_\beta \end{align} \paragraph{On $H(Z)$} \begin{align} - E[\log P(Z)] &= -E_Z[\log (E_{X', T''}[P(Z|X', T'')])] \\ &= -E_Z[\log (E_{X', T''} [C_\beta \exp(\beta S(Z, h(T''( X')))) ])] \\ &= - E_Z[\log (E_{X', T''} [\exp(\beta S(Z, h(T''( X')))) ])] - C_\beta \end{align} Altogether, we see that $C_\beta$ cancels out and \begin{align} H(Z) - H(Z \mid X) &\geq E_{X,Z} [E_{T'|X}[\beta S(Z, h(T'(X)))] + C_\beta \\ & ~~~~ - \log (E_{X', T''} [exp(\beta S(Z, h(T''( X')))) ])] - C_\beta \\ &= E_{X,Z}\left[ E_{T'|X}\left[ \log \frac{\exp(\beta S(Z, h(T'(X))))}{E_{X', T''} [\exp(\beta S(Z, h(T'( X')))) ]} \right] \right] \label{eq:inequality} \end{align} The equality emerges if we do not apply Jensen's inequality on $-H(Z|X)$. To show the connection of this result with simCLR, we approximate $Z|X$ as $h(T(X))$, the mean of $P(Z|T(X))$. With this approximation, the outermost integration with respect to $(X,Z)$ will be replaced by the integration with respect to $(X,T)$. Also, because $T''$ is integrated away in the denominator of \eqref{eq:inequality}, the \textit{double prime} superscript of the $T''$ is superficial. Thus, we obtain \begin{align} &E_{X,T}\left[ E_{T'|X}\left[ \log \frac{\exp(\beta S(h(T(X)), h(T'(X))))}{E_{X', T'} [\exp(\beta S(h(T(X)), h(T'( X')))) ]} \right] \right] \\ &\cong \frac{1}{N} \sum_{x_i \sim X, T_i \sim (T|x_i)} \Bigg( \frac{1}{\tilde N} \sum_{T'_k \sim (T|x_i)}\beta S(h(T_i(x_i)), h(T'_k(x_i))) \\ - & \frac{1}{M} \log \left( \sum \sum_{x_j \sim X, T'_j \sim (T|x_j)} \exp\left( \beta S(h(T_i(x_i)), h(T'_j(x_j))) \right) \right) \Bigg) \end{align} With $i \in {1:N}, k \in {1:\tilde N}, j \in {1 : M}$. Choosing $\tilde N =1$ and $M=N$, we get \begin{align} \frac{1}{N} \sum_{x_i \sim X, T \sim (T|x_i), T'_i \sim (T|x_i)} \log \Bigg( \frac{\exp( \beta S(h(T_i(x_i)), h(T'_i(X_i)))}{\frac{1}{N} \log \left( \sum_{x_j \sim X, T'_j \sim (T|x_j)} \exp\left( \beta S(h(T_i(x_i)), h(T'_j(x_j))) \right) \right)} \Bigg) \end{align} which agrees with the simCLR loss when $T|X$ is set to be uniform. \end{proof} \subsection{Algorithm} \label{appsec:algorithm} The table shown below is the description of the algorithm based on Proposition \ref{thm:TBC_prop} that trains $h$ and $P(T|X)$ together. In this algorithm we assume that the support of $P(T|X)$ is discrete. Instead of training $h$ and $P(T|X)$ simultaneously, we train $h$ and $P(T|X)$ in turn because this strategy was able to produce more stable results. With this algorithm's notation, the very classic SimCLR would emerge if we set $m$(the number of $T$ samples) to be $2$ and set $P(T|X)$ to be uniform. In our experiments we set $m$ to be $8$, as it performed better than anything less for both fixed $P(T|X)$(SimCLR) and trainable $P(T|X)$. \begin{algorithm}[ht!] \begin{algorithmic}[1] \renewcommand{\algorithmicensure}{\textbf{Input:}} \REQUIRE A batch of samples $\{x_k\}$, an encoder model $h_\theta : x \to z$, the number of transformation samples $m$, a model for conditional random augmentation distribution $x \to P(T | x, \eta)$ \FOR {each iteration $i$} \STATE \textbf{Update phase for $h$} \STATE Sample $T_{jk} \sim P(T | x_k, \eta)$, $j=1,...,m$ \STATE Apply $\{ T_{jk} ; j = 1,...,m\}$ to each $x_k$, producing a total of $m \times k$ samples of $T_{jk}(x_k)$. \STATE Empirically compute the objective \eqref{eq:TBCRL} or its lower bound, and update $\theta$ \STATE \textbf{Update phase for $P(T|X)$} \STATE Sample $T_{jk} \sim Uniform$ \STATE Evaluate \eqref{eq:TBCRL} with $P(t_j | x_k, \eta)$ weights, and update $\eta$ \ENDFOR \end{algorithmic} \caption{Contrastive Representation learning with trainable augmentation Channel(CRL-TAC) } \label{alg:algorithm} \end{algorithm} \subsection{Model Architecture and entropy regularization } In our experiment, we used a three layer CNN with $200$ dimensional output for the intermediate encoder $f$ and a two layer MLP with $50$ dimensional output for the projection head $g$(Figure \ref{fig:encoder_model}). We chose this architecture because this choice performed stably for SimCLR on standard MNIST dataset (See Section \ref{appsec:mnist}). We trained $P(T|X)$ with three layer CNN(Figure \ref{fig:ptgivenx_model}). \begin{figure}[h!] \centering \includegraphics[scale=0.4]{encoder.png} \caption{Encoder architecture} \label{fig:encoder_model} \end{figure} \begin{figure}[h!] \centering \includegraphics[scale=0.4]{pt_given_x_map.png} \caption{$P(T|X)$ architecture} \label{fig:ptgivenx_model} \end{figure} As in \cite{wang2020uniform}, we normalized the final output of the encoder $h = f \circ g$ so that the final output is distributed on the sphere. As such, we used $S(a,b) = a^T b$, and set $\beta=0.5$ since this choice yielded stable results for the learning of $P(T|X)$. At the inference time, we normalized $E_{P(T|X)} [h((T(X))]$. To discourage $P(T|X)$ from collapsing prematurely, we imposed a regularization of $H(T|X)$ with coefficient $\lambda$. We used coefficient $\lambda =0.0025$, as it achieved the lowest contrastive loss on the training set in the range $[0.001, 0.005, 0.0025]$. This choice of $\lambda$ also produced the best linear evaluation score on the training dataset. Setting $\lambda < 0.0001$ seemed to collapse $P(T|X)$ in many cases. \subsection{Results on the original MNIST dataset} \label{appsec:mnist} Table \ref{tab:lcp_mnist} shows the results on the original MNIST dataset. We used the same setting as for the main experiment in Section \ref{sec:experiments}, except that we set $\beta = 1.0$. On this dataset, raw representation achieves $0.9255$. When trained with uniform $P(T|X)$, the projection head representation is not much better than the raw representation. However, when trained together with $P(T|X)$, the projection head representation is comparable to the $f$ output. This result also suggest that, by training $P(T|X)$ together with $h=g \circ f$, we can improve the utility of the representation at the level on which the objective function function is trained, instead of the heuristically chosen intermediate representation $f$. This result also suggests that there is much room left for the study of the stochastic augmentation and intermediate representation. \begin{table}[th!] \small \caption{Linear evaluation accuracy Scores on the original MNIST dataset. Raw Representation achieves $0.9255 \pm 0.0001$ on the original MNIST dataset.} \label{tab:lcp_mnist} \centering \scalebox{0.9}{ \begin{tabular}{lccccc} \toprule \toprule Method & ours & ours(topn) & SimCLR \\ \midrule Projection Head & $0.9642 \pm 0.0025$ & $0.9674 \pm 0.0015$ & $0.9273 \pm 0.0044$ \\ $f$ output & $0.9805 \pm 0.0006$ & $0.9859 \pm 0.0004$ & $0.9806 \pm 0.0056$ \\ \bottomrule \end{tabular}} \end{table} \subsection{Uniformity of the learned representation} \label{appsec:uniformity} \cite{wang2020uniform} reports that, for a good representation, the representation tends to be more uniformly distributed on the sphere. The graphs in Figure \ref{fig:2dim} are scatter plots of 2-dimensional representations trained with and without the trainable $P(T|X)$. The graphs in Figure \ref{fig:50dim} are superimposed plots of 50 dimensional representations with and without the trainable $P(T|X)$. On these graphs, we can visually see that what we feared in Section \ref{sec:introduction} and Figure \ref{fig:regional} happens when we fix $P(T|X)$; the majority of the representations becomes strongly concentrated around that of the empty image. This problem is successfully avoided with the trainable $P(T|X)$. In terms of the average pairwise Gaussian potential used in \cite{wang2020uniform} that measures the uniformity of the representations on the sphere(lower the better), our $50$ dimensional representation achieves $0.0845$ as opposed to $0.9757$ of the baseline SimCLR with fixed $P(T|X)$. The graphs in Figure \ref{fig:prod} are the sorted values of $|\langle h(x), h(x') \rangle|$ for a randomly sampled set of $(x, x')$ pairs. We see in these graphs that the representations with the trainable $P(T|X)$ are trained to be as orthogonal to each other as possible($|\langle h(x), h(x') \rangle|$ is concentrated around $0$) , while the representations trained with the fixed $P(T|X)$ are collapsing into one direction ($|\langle h(x), h(x') \rangle|$ is concentrated around $1$). \begin{figure}[h!] \begin{center} \includegraphics[scale=0.50]{2dim_infoSimCLR_head.png} \includegraphics[scale=0.5]{2dim_SimCLR_head.png} \end{center} \caption{Left: The scatter plot of 2 dimensional representations trained together with $P(T|X)$. Right: The scatter plot of 2 dimensional representations trained with uniform $P(T|X)$.} \label{fig:2dim} \end{figure} \begin{figure}[h!] \begin{center} \includegraphics[scale=0.385]{hypoth_repns2.png} \includegraphics[scale=0.4]{baseline_repns2.png} \caption{Left: The superimposed plot of randomly sampled 200 instances of 50 dimensional representations trained together with $P(T|X)$. The horizontal axis represents the indices of the vectors, and each curve with a different color represents one instance of the vector $h(x) \in \mathcal{R}^{50}$. Right: The superimposed plot of 50 dimensional representations trained with uniform $P(T|X)$. We see that all instances of $h(x)$ look very similar.} \label{fig:50dim} \end{center} \end{figure} \begin{figure}[h!] \begin{center} \includegraphics[scale=0.5]{hypoth_prod.png} \includegraphics[scale=0.5]{baseline_prod.png} \caption{Left : The plot of the sorted values of $|\langle h(x), h(x) \rangle|$ for a randomly sampled sets of $(x,x')$ pairs, when each $h(x)$ is a 50 dimensional representation trained together with $P(T|X)$. Right: The same figure with $h$ trained with uniform $P(T|X)$.} \label{fig:prod} \end{center} \end{figure} \section{Introduction}\label{sec:introduction} \input{01_introduction} \vspace{-0.5cm} \section{InfoMax problem with Augmentataion Channel}\label{sec:methods} \input{02_preliminaries} \input{03_methods} \vspace{-0.15cm} \section{Experiments}\label{sec:experiments} \vspace{-0.15cm} \input{04_experiments} \vspace{-0.15cm} \section{Related Works and conclusion}\label{sec:related} \vspace{-0.15cm} \input{05_related_work} \vspace{-0.15cm} \bibliographystyle{plainnat} \section{List of notations} \begin{itemize} \item Uppercase $X$ : random variable \item lowercase $x$ : realziation of $X$ \item $E_p$ : expectation with respect to $p$ \item $I_p(A, B)$ \end{itemize} \section{Method outline} We interpret the SimCLR procedure as $$ X \to T(X) \to Z \to Y$$ where $X \to T(X)$ is done by \textbf{uniform} generation of $T$ over a selected finite transformation domain. The map from $X$ to $Z$ is trained in such a way that it $H(Z|X)$ is minimized (that the the encoding does not change by the stochastic intermediate $X \to T(X)$ mapping while preventing $H(Z)$ from degeneration. In other words, we are essensially maximing $$H(Z) - H(Z|X) = I(X, Z)$$ amongst all $Z$ following the conditional law of form \begin{align} q(z | x) =\int p_1(z|T(x))p_2(T | x) dT \end{align} Now, if we want to maximize the predictor performance of $Y$ from $Z$, we will want to maximize \begin{align} \begin{split} \operatornamewithlimits{argmax}_{Z = \int p_1(Z|T(X))p_2(T | X) dT} \Big( I(X; Z) + I(Y ; Z) \Big) \end{split} \end{align} And optimize about $p_1$ and $p_2$. \subsection{Computing with $I(X;Z) = E_{X, Z \sim p} [\log p(X|Z)]+ C$} We need a decoder in this case. If $p_1(Z|T(X))$ is deterministic, $Z$ emerges as $Z = E_{p_T} [f_{enc}(Z)]$. Suppose $Z \sim f_{enc}(T(X))$ where $f_{enc}$ is a deterministic function. Then since $Z \in \sigma(X, T)$, \begin{align} I(X; Z) &= E_{X, T \sim p} [\log p( X| f_{enc}(T(X)))] = \max_q E_{X, T \sim p} [\log q(X | f_{enc}(T(X)))] \\ \end{align} With the similar argument, I need to train the classifier $q(Y | Z)$ ( This will still make the whole encoder $p(z| X)$ to be stochastic because $T$ is random.) Let us also find $q$ out of the law of \begin{align} X = f_{dec}(T(X)) + \epsilon' \end{align} The $I(X;Z)$ term is therefore \begin{align} &E_{Z, X \sim p}[\log p(X | Z)] = E_X \left[ \int \log p(X|f_{enc}^\eta (T(X))) p_2^{\theta}(T| X) dT \Bigg| X \right] \\ &=E_X \left[ \sum_T d(x - f_{dec}(f_{enc}^\eta(T(X))))) \textrm{Softmax}(g_\theta(X)^T w_T^\theta) \Bigg| X \right] \end{align} The $I(Y ; Z)$ term is the similar Cross entropy \begin{align} &E_{Y, Z} \left[ \log \big( \textrm{Softmax}(h_\alpha(Z)^T w_Y^\alpha)\big) \right] \\ &= E_{Y, X} \left[\int_T \log \left(\textrm{Softmax}(h_\alpha(T(X))^T w_Y^\alpha) \right)\textrm{Softmax}(g_\theta(X)^T w_T^\theta) \right] \end{align} We can optimize this "simulataneously" about $\eta$, $\theta$ and $\alpha$. In general, however, I would have to apply log trick like the one used in Girsanov and REINFORCE when optimizing about $\theta$. \begin{align} &\partial_{\theta}E_{Z, X \sim p}[\log p(X | Z)] \\ &=E_X \left[\int \left\{ \log p(X|f_{enc}^\eta (T(X))) \log p_2^{\theta}(T| X)\right\} p_2^{\theta}(T| X) dT \Bigg| X \right] \end{align} なんかスマートじゃないことをしてる気もするがとりあえず。。。 Question: Something makes me feel that if appropriate condition are met, the max of $I(X, Z)$ can be "done away" with $I(Y, Z)$. But we have to keep in our mind that $Z$ is not a member of $\sigma(X)$, making this intuition to fail. The removal of $I(X, Z)$, however, would make the objective function exactly like MIP and Invariant Rationalization. \pagebreak \subsection{Computing with $I(X; Z) = E_{X, Y \sim p} [\log p(Z | X) / p(Z)]$} Let us suppose $Z = f_{enc}(T(X)) + \epsilon$. Then we can directly compute the density since \begin{align} p(Z | X) &= E_{T'|X}[p(Z| X, T')] \\ &=\int p(Z | X, T') p(T'|X) dT' \\ &= \sum_T \exp(\alpha(X) -d_\epsilon(Z , f_{enc}(T'(X))) p(T'|X) \end{align} where $d$ is some metric or some similarity measure in the space of $Z$, parametrized by the variance of $\epsilon$. \begin{align} p(Z) &= E_X [p(Z | X)] \end{align} We used the fact that $E_Z[P(Z|X)/p(Z)] =1$. The computation of the former shall not be much of a problem. However, the latter can be a tad difficult because we must approximate this empirically. I will therefore attempt on an InfoNCE type bound akin to the one used in SimCLR itself. If we put \begin{align} g(Z, X) &= P(Z|X)/ p(Z) \end{align}, \begin{align} I(X;Z) &= E_{X, Z \sim P}\left[ \log g(Z, X) \right] \\ &= E_{X, Z \sim P} \left[ \log \frac{g(Z,X)}{ E_{Z' \sim P} \left[ P(Z'|X)/P(Z')\right]} \right] \\ &= E_{X, Z \sim P} \left[ \log \frac{g(Z,X)}{ E_{T'', X', \epsilon' \sim P} \left[ P(Z'|X)/P(Z')\right]} \right] \\ &\cong E_{X, Z}\left[\log \frac{g(Z, X)}{\frac{1}{K} \sum_{i=1}^K g(Z_i, X)}\right] \end{align} Where the second equation follows because the demoniator is always 1. In the denominator of the third line, we are computing the expectation with respect to $Z \in \sigma(T''. X', \epsilon')$. so $Z_i$ are generated from this sigma algebra with law $X' \sim P_X$, $T'' \sim P(T| X)$. We are using the symbol $T''$ to distinguish it from (1) $T$ used by $Z$ in the outer-most expectation, and (2) $T'$ used in the marginalization at the computation of $P(Z|X)$. Now, continuing with the algebra with substitution, we have \begin{align} &= E_{X, Z}\left[\log \frac{g(Z, X)}{ \sum_{i=1}^K g(Z_i, X)}\right] + \log K \\ &\cong E_{T, X, \epsilon} \left[ \log \frac{E_{T'|X}[ \exp(-\log p(Z) + \alpha(X)-d(f_{enc}(T(X))+\epsilon, f_{enc}(T'(X)))]}{ \sum_j \sum_{i=1}^K \exp(-\log p(Z_i) + \alpha(X)-d(f_{enc}(T''(X_i))+\epsilon, f_{enc}(T'''_j(X)))}\right] +C \\ &\geq E_{T, X, \epsilon} \left[ \frac{E_{T'|X}[\log\left( \exp(-\log p(f_{enc}(T(X)) )-d(f_{enc}(T(X))+\epsilon, f_{enc}(T'(X)))\right)]}{ \sum_{j} \sum_{i=1}^K \exp(-\log p(f_{enc}(T''(X_i)))-d(f_{enc}(T''(X_i'))+\epsilon, f_{enc}(T'''_j(X)))}\right] +C \end{align} In SimCLR, the expecation about $T'|X$ in the numerator is also evaluated numerically, thus leading to pair sampling of $T"$ and $T'$. The bottom denominator is slightly simplified by setting $T_j^{'''} = T$. Where again $T'''_j, T'' \sim P(T|X)$, $X_i \sim P(X)$. If the support of $T$ is indeed finite, it is probably the case that the denominator can better approximated by more direct sum, \begin{align} \sum_{i=1}^K E_{T''| X_i} E_{T'|X}[\log\left( \exp(-d(f_{enc}(T(X))+\epsilon, f_{enc}((T'')(X_i)))\right)] \end{align} \hline \begin{rmk}[``nearly ICLR style'' notation] \begin{itemize} \item Let $X$ be a random variable on $\mathcal{X} \subseteq \mathbb{R}^{d_X}$. Let $x_1, \ldots, x_n$ be observations of $X$. \item Let $V$ be a random variable on $\mathcal{V} \subseteq \mathbb{R}^{d_V}$. $V$ can be either discrete or continuous. \item Let $Z$ be a random variable on $\mathcal{Z}$. Suppose that a group $\mathcal{A}$ acts transitively on $\mathcal{Z}$, and let $\mu$ be a (left-)invariant measure on $\mathcal{Z}$ (This is not rigorous, but we are just interested in some concrete examples). For example, if $\mathcal{Z} = \mathbb{R}^{d_Z}$ and $\mathcal{A} = \mathbb{R}^{d_Z}$ is the set of parallel shifts $\boldsymbol{x} \mapsto \boldsymbol{x} + \boldsymbol{a}$, then $\mu$ is the Lebesgue measure on $\mathbb{R}^{d_Z}$. If $\mathcal{Z} = S^{d_Z}$ is a sphere and $\mathcal{A} = \mathcal{O}(d_Z)$ is the set of actions $\boldsymbol{x} \mapsto H \boldsymbol{x}$ that are written as multiplying orthogonal matrices from the left, then $\mu$ can be chosen as the uniform distribution on $\mathcal{Z} = S^{d_Z}$. \item Suppose we have a Markov chain \[ X \to V \to Z. \] Here, $X$, $V$ and $Z$ respectively mean the data, the ``view'' of data, and the representation of data. \item Let $P(X)$ be an arbitrary distribution on $\mathcal{X}$. \item Let $P(V \mid X)$ be the distribution of $V \mid X$. We may model this conditional distribution by some parametrized model $P_\xi (V \mid X)$ ($\xi \in \Xi$). \item Let $P(Z \mid V)$ be the distribution of $Z$ conditioned on $V$. We assume that $P(Z \mid V)$ has the density $p(Z \mid V)$ with respect to $\mu$. \item We assume that $p(Z \mid V)$ is written as \[ p(Z \mid V) = p_{g, \sigma}(Z \mid V) = C_\beta \exp(\beta \mathcal{S}(Z, g(V))). \] $C_\beta$ is a constant that depends only on a scale parameter $\beta > 0$. $g: \mathcal{V} \to \mathcal{Z}$ is a (deterministic) encoder function. $\mathcal{S}: \mathcal{Z} \times \mathcal{Z} \to \mathbb{R}$ is a similarity function that is invariant under $\mathcal{A}$, that is, $\mathcal{S}(a \circ z_1, z_2) = \mathcal{S}(z_1, a^{-1} \circ z_2)$ for any $a \in \mathcal{A}$. For example, if $\mathcal{Z} = \mathbb{R}^{d_Z}$, $\mathcal{S}(z_1, z_2) = h(z_1 - z_2)$ is invariant in this sense (where $h$ is a univariate function, e.g., $\mathcal{S}(z_1, z_2) = - \frac{1}{2}\norm{z_1 - z_2}_2$. If $\mathcal{Z} = S^{d_Z}$, $\mathcal{S}(z_1, z_2) = z_1^\top z_2$ is invariant because $\mathcal{S}(H z_1, z_2) = \mathcal{S}(z_1, H^\top z_2)$ for any orthogonal matrix $H$. \item We may consider some more complicated choices of $\mathcal{Z}$. For example, we can choose $\mathcal{Z}$ as the Stiefel manifold $V_{k, m}$ and $\mathcal{S}(Z_1, Z_2) = \mathrm{tr}(Z_1^\top Z_2)$. (In this case, $p(Z \mid V)$ is known as the matrix Langevin distribution). But I'm not sure this is useful in practice. \end{itemize} \paragraph{On $-H(Z \mid X)$} Given $x_1, \ldots, x_n$, we generate two collections of random views $(v_1, \ldots, v_n)$ and $(v_1', \ldots, v_n')$. Here, \[ v_i, v'_i \sim P(V \mid X = x_i) \quad i \in \set{1, \ldots, n}, \] and $v_i$ and $v_i'$ are conditionally independent. Also, we generate $z_1, \ldots, z_n$ according to \[ z_i \sim P(Z \mid V = v_i) \quad i \in \set{1, \ldots, n}. \] \begin{align*} - H(Z \mid X) & = \mathbb{E}_{(Z, X)}[ \log P(Z \mid X)] \\ & = \mathbb{E}_{(Z, X)}[\log \mathbb{E}_{V \sim P(V \mid X)}[P(Z \mid V)] ] \\ & \geq \mathbb{E}_{(Z, X)}[\mathbb{E}_{V \sim P(V \mid X)}[\log P(Z \mid V)] ] \\ & \approx \frac{1}{n} \sum_{i = 1}^n \mathbb{E}_{Z \sim P(Z \mid V = x_i)} \left[ \log P(Z \mid V = v_i') \right ] \\ & \approx \frac{1}{n} \sum_{i = 1}^n \log P(z_i \mid V = v_i') \\ & = \frac{1}{n} \sum_{i = 1}^n \beta \mathcal{S}(z_i, g(v_i')) + \log C_\beta \end{align*} \paragraph{On $H(Z)$} \begin{align*} P(Z) & = \mathbb{E}_{X} [ \mathbb{E}_{V' \sim P(V \mid X)}[ P(Z \mid V = V') ] ] \\ & \approx \frac{1}{n} \sum_{j=1}^n \mathbb{E}_{V' \sim P(V \mid X = x_j)} [ P(Z \mid V = V') ] \\ & \approx \frac{1}{n} \sum_{j=1}^n P(Z \mid V = v_j') \end{align*} \begin{align*} H(Z) & = \mathbb{E}_{Z \sim P(Z)}[ - \log P(Z) ] \\ & = \mathbb{E}_{X} \mathbb{E}_{V \sim P(V \mid X)} \mathbb{E}_{Z \sim P(Z \mid V)}[ - \log P(Z) ] \\ & \approx \frac{1}{n} \sum_{i=1}^n \mathbb{E}_{Z \sim P(Z \mid V = v_i)}[ - \log P(Z) ] \quad \text{(outer approximation)} \\ & \approx - \frac{1}{n} \sum_{i=1}^n \log P(Z = z_i) \\ & \approx - \frac{1}{n} \sum_{i=1}^n \log \frac{1}{n} \sum_{j=1}^n P(z_i \mid V = v_j') \quad \text{(inner approximation)} \\ & = - \frac{1}{n} \sum_{i=1}^n \log \sum_{j=1}^n \exp(\beta \mathcal{S}(z_i, g(v_j'))) - \log\frac{C_\beta}{n} \end{align*} \paragraph{To sum up} \begin{align} H(Z) - H(Z \mid X) & \approx - \frac{1}{n} \sum_{i=1}^n \log \sum_{j=1}^n \exp(\beta \mathcal{S}(z_i, g(v_j'))) + \frac{1}{n} \sum_{i = 1}^n \beta \mathcal{S}(z_i, g(v_i')) + \log n \nonumber \\ & = \frac{1}{n} \sum_{i=1}^n \log \frac{\exp(\beta \mathcal{S}(z_i, g(v_i')))}{\sum_{j=1}^n \exp(\beta \mathcal{S}(z_i, g(v_j')))} + \log n \label{eq:noisy_simclr} \end{align} This can be seen as ``Gaussian SimCLR with noisy similarities''. \begin{exa}[Gaussian encoder] Suppose $\mathcal{Z} = \mathbb{R}^{d_Z}$. Let $p(Z \mid V) = C_\beta \exp(-\frac{\beta}{2} \norm{Z - g(V)}_2^2)$ be a Gaussian encoder. In this case, each $z_i$ is generated as \[ z_i = g(v_i) + \varepsilon_i, \quad \varepsilon_i \sim N(0, \beta^{-1} I). \] Then, \eqref{eq:noisy_simclr} becomes \[ \frac{1}{n} \sum_{i=1}^n \log \frac{\exp(\beta \norm{g(v_i) - g(v_i') + \varepsilon_i}_2^2)}{\sum_{j=1}^n \exp(\beta \norm{g(v_i) - g(v_j') + \varepsilon_i}_2^2)} + \log n. \] If $\beta$ is sufficiently large, we may have $\norm{g(v_i) - g(v_j') + \varepsilon_i}_2^2 \approx \norm{g(v_i) - g(v_j')}_2^2$. \end{exa} \begin{exa}[Spherical encoder]\label{exa:spherical_encoder} Suppose $\mathcal{Z} = S^{d_Z}$. Let $p(Z \mid V) = C_\beta \exp(\beta Z^\top g(V))$ be a ``von-Mises--Fisher'' decoder. We can see that $z_i$ has the same distribution as a random variable generated as follows \[ z_i = H_i g(v_i), \] where $H_i$ is a random orthogonal matrix generated from \[ H_i \sim P(H \mid V = v_i) \propto \exp(\beta g(v_i)^\top H g(v_i)) = \exp(\mathrm{tr}(\beta G_i H)) \] with $G_i := g(v_i)g(v_i)^\top$. (Since $\mathop{\mathrm{rank}} G_i = 1$, I'm not sure if this gives a valid density. My conjecture is that if we take $\beta \to \infty$, the distribution is concentrated on the set of matrices such that $Hg(v_i) = g(v_i)$, so $z_i = g(v_i)$.) \eqref{eq:noisy_simclr} becomes \[ \frac{1}{n} \sum_{i=1}^n \log \frac{\exp(\beta g(v_i)^\top H_i^\top g(v_i'))}{\sum_{j=1}^n \exp(\beta g(v_i)^\top H_i^\top g(v_j') )} + \log n. \] Again, this can be seen as ``SimCLR with noisy similarities''. \end{exa} \if0 \begin{itemize} \item $P(Z|X) = \int P(Z|T(X)) P(T|X) \mathop{}\!\mathrm{d} T$ \item $P(Z) = \mathbb{E}_{X \sim P(X)}[P(Z|X)] = \mathbb{E}_X[\int P(Z|T(X)) P(T|X) \mathop{}\!\mathrm{d} T]$ \item $P(Z | T(X)) = C_\sigma \exp(- d_\sigma(Z, g(T(X)))) = C_\sigma \exp(-d_\sigma(Z, g(X')))$, where $C_\sigma$ depends only on $d_\sigma$. (e.g., gaussian, von-Mises--Fisher, and any shift-invariant distributions are ok). \end{itemize} \begin{align*} I(X; Z) & = H(Z) - H(Z \mid X) \end{align*} Rough approximation (1) \begin{align*} H(Z \mid X) & = \mathbb{E}_{(X, Z)}[- \log P(Z \mid X)] \\ & = \mathbb{E}_{(X, Z)}\left[- \log \int \exp(-d_\sigma(Z, g(T(X))) P(T|X) \mathop{}\!\mathrm{d} T \right] - \log C_\sigma \\ & \cong \end{align*} \[ \rho(Z, X) = \frac{P(Z | X)}{P(Z)} = \frac{\mathbb{E}_{T' \sim P(T|X)}[\exp(-d_\sigma(Z, g(T'(X))))]}{\mathbb{E}_X [\mathbb{E}_{T' \sim P(T|X)}[\exp(-d_\sigma(Z, g(T'(X)))) ]]} \] Note that $\mathbb{E}_{Z \sim P(Z)}[\rho(Z, X)] = 1$ for any $X$. \begin{align*} I(X; Z) &= \mathbb{E}_{(X, Z)}[\log \rho(Z, X)] \\ & = \mathbb{E}_{(X, Z)} \left[ \log \frac{\rho(Z, X)}{\mathbb{E}_{Z' \sim P}[\rho(Z', X)]} \right] \\ & \cong \mathbb{E}_{(X, Z)}\left[ \log \frac{\rho(Z, X)}{\frac{1}{K} \sum_{j=1}^K \rho(Z_j, X)} \right] \end{align*} Here, $Z_1, \ldots, Z_K$ are (conditionally) independent copies of $Z \sim P(Z \mid X)$. \fi \end{rmk} \hline \pagebreak \subsection{Computing with $I(X; Z) = E_{X, Y \sim p} [\log p(Z | X) / p(Z)]$: part II} We would assume that $P(Z| X, T')$ is a location family, and $Z = f_{enc}(T(X)) + \epsilon$ for $\epsilon$ being a mean $0$ perturbation of size independent of its mean. This being said, let us write \begin{align} p(Z | X) &= E_{T'|X}[p(Z| X, T')] \\ &=\int p(Z | X, T') p(T'|X) dT' \\ &= \sum_T \exp(\alpha -d_\epsilon(Z , f_{enc}(T'(X))) p(T'|X) \end{align} Now, directly computing the ratio $\log p(Z|X)/ p(Z)$, we get \begin{align} &\frac{E_{T'|X}[\exp(\alpha -d_\epsilon(Z , f_{enc}(T'(X)))]}{E_{T'', \tilde X}[\exp(\alpha -d_\epsilon(Z , f_{enc}(T'' (\tilde X)))]} \\ &=\frac{E_{T'|X}[\exp(-d_\epsilon(Z , f_{enc}(T'(X)))]}{E_{T'', \tilde X}[\exp(-d_\epsilon(Z , f_{enc}(T'' (\tilde X)))]} \\ \end{align} Now, generating $Z, X$ in the integrand from $\sigma(X, \epsilon, T)$, we get \begin{align} &E_{Z, X} \left[ \log \frac{E_{T'|X}[\exp(-d_\epsilon(Z , f_{enc}(T'(X)))]}{E_{T'', \tilde X}[\exp(-d_\epsilon(Z , f_{enc}(T'' (\tilde X)))]}\right] \\ &=E_{T, X, \epsilon} \left[ \log \frac{E_{T'|X}[\exp(-d_\epsilon(f_{enc}(T(X)) + \epsilon , f_{enc}(T'(X)))]}{E_{T'', \tilde X}[\exp(-d_\epsilon(f_{enc}(T(X))+\epsilon , f_{enc}(T'' (\tilde X)))]}\right] \\ &\geq E_{T, X, \epsilon} \left[ E_{T'|X} \left[ \log \left( \frac{ \exp(-d_\epsilon(f_{enc}(T(X))+\epsilon , f_{enc}(T'(X)))}{E_{T'', \tilde X}[\exp(-d_\epsilon(f_{enc}(T(X)) + \epsilon , f_{enc}(T'' (\tilde X)))]}\right) \right] \right] \end{align} \subsection{Implementation} \section{Regularizations} \subsection{MNIST Experiment} Create 4tiles of same size as MNIST image, make every tile except one tile all-black/random noise. We place an MNIST image in one remaining block. Two types of "Augmentation" \begin{enumerate} \item Type1 : Extraction and enlargement of one random sub-tile ; the experiment that came up in the discussion. \item Type2 : White-out of randomly selected one-subtile ; this is to check we can get $P(T| X))$ to be uniformly distributed over "multiple" information-degenerating transformations. \item Type3 : White-out of irregularly located tile ; this is to check out if we can get the soft version of our theory to work \end{enumerate} \section{Theory}
{'timestamp': '2021-11-16T02:31:18', 'yymm': '2111', 'arxiv_id': '2111.07679', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07679'}
arxiv
\section{}\label{} \input{includefiles/section01.tex} \input{includefiles/section02.tex} \input{includefiles/section03.tex} \input{includefiles/section04.tex} \input{includefiles/section05.tex} \input{includefiles/section06.tex} \section*{Acknowledgements} This work was supported by the Yunnan provincial major science and technology special plan projects: digitization research and application demonstration of Yunnan characteristic industry, under Grant: 202002AD080001, and the Practice\&Innovation Foundation for Professional Degree Graduates of Yunnan University, under Grant: 2021Y168. \bibliographystyle{model2-names} \section{Introduction}\label{sec01Introduction} Point cloud registration is playing an increasingly important role in many applications, including simultaneous localization and mapping~(SLAM), 3D reconstruction and autonomous driving. Point clouds have many specific characteristics that may increase the complexity of registration problems, including local sparsity, noise caused by acquisition equipment and a large number of points. On the one hand, point cloud sparsity and noise make it unrealistic to find correct correspondences between the source and target point clouds. On the other hand, the considerable number of points inevitably requires efficient algorithms and large computing resources. \par Traditional point cloud registration pipelines~(\citeauthor{ICP1992}, \citeyear{ICP1992}; \citeauthor{GoICP2016}, \citeyear{GoICP2016}) start with a coarse initial pose obtained by odometers and iterate until the optimal condition is satisfied. However, the registration result is highly dependent on a good initial estimation, which directly tends to cause these pipelines to become stuck in local minima. To increase registration accuracy and efficiency, researchers have proposed learning-based algorithms to replace the individual parts in the classical registration pipeline, including feature descriptors~(\citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}; \citeauthor{DeepClosetPoint2019}, \citeyear{DeepClosetPoint2019}) and pose optimization algorithms~(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016}; \citeauthor{GoICP2016}, \citeyear{GoICP2016}). Specifically, end-to-end registration networks, such as DCP~(\citeauthor{DeepClosetPoint2019}, \citeyear{DeepClosetPoint2019}), PointNetLK~(\citeauthor{PointNetLK2019}, \citeyear{PointNetLK2019}), and VCR-Net~(\citeauthor{VitualCorresponmdences2020}, \citeyear{VitualCorresponmdences2020}), have gradually emerged in recent years. Compared with other classical registration pipelines~(\citeauthor{ICP1992}, \citeyear{ICP1992}; \citeauthor{GoICP2016}, \citeyear{GoICP2016}; \citeauthor{RANSAC1981}, \citeyear{RANSAC1981}), the high efficiency of end-to-end neural networks has been fully verified. However, the robustness and application ability of end-to-end registration pipelines cannot achieve the expected effect, especially in some complex scenes. In summary, 3D point cloud registration is still an extremely challenging topic in 3D computer vision due to the point cloud characteristics mentioned above. \par In this work, we present a novel method titled deep feature consistency network to jointly solve the inlier correspondences and estimate the rigid transformation in the absence of initial transformation by leveraging the feature consistency during the feature matching stage. \par The main ideas of this paper are as follows. First, a multiscale graph feature merging network is proposed to extract the features of the correspondence set. Second, to effectively filter the outliers, we present a correspondence weighting module to estimate the confidence of each correspondence based on their features and then select a series of correspondences with a high confidence level as candidate inliers based on the confidence. These candidate inliers form a series of inlier subsets in the feature space as the input to the subsequent deep feature matching module. Finally, we present a fresh deep feature matching module, which constructs the feature consistency matrix of each inlier subset in parallel, calculates the principal vectors of the feature consistency matrix with principal component analysis~(PCA)~(\citeauthor{PCA1987}, \citeyear{PCA1987}), and then obtains the corresponding rigid transformation of each inlier subset by the weighted singular value decomposition~(SVD) optimization method. The determination of the optimal rigid transformation among the above obtained rigid transformations ultimately depends on maximizing the geometric consistency. \par To summarize, the key contributions of our work are as follows. \par First, we investigate the point cloud pairwise registration problem between two fragments with local sparsity and only a part of the correspondences. \par Second, we present a novel feature embedding method called multiscale graph feature merging network. This method is used to extract the final features of the correspondence set and can well make full use of the geometric connection information between the nearest correspondences. \par Third, we propose a deep feature matching module that is designed to predict the rigid transformation used to align the point clouds to boost the registration performance. \par Experimentally, comparison results on the 3DMatch dataset reveal that our approach achieves state-of-the-art performance, compared with both classical~(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981}; \citeauthor{ICP1992}, \citeyear{ICP1992}) and learning-based approaches~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}; \citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}). In addition, our method shows strong generalization ability over different datasets. \section{Related Work}\label{Sec02RelatedWork} \subsection{Feature Extraction} Generally, we have to take measures to extract pointwise features before performing registration. There are four mainstream methods for extracting point features. The first is to convert a point cloud into a volumetric representation and then to apply a 3D convolution neural network~(CNN) to extract features~(\citeauthor{3Dshapenets2015}, \citeyear{3Dshapenets2015}; \citeauthor{VoxNet2015}, \citeyear{VoxNet2015}). The volume representation retains relatively complete structural information of a point cloud, but this method is time-consuming and requires high computing memory costs. To this end, octree-based methods have been proposed to reduce computational costs~(\citeauthor{O-CNN2017}, \citeyear{O-CNN2017}; \citeauthor{Octnet2017}, \citeyear{Octnet2017}). The second method is called multiview-based methods~(\citeauthor{MVCNN2015}, \citeyear{MVCNN2015}; \citeauthor{MHBN2018}, \citeyear{MHBN2018}; \citeauthor{GVCNN2018}, \citeyear{GVCNN2018}; \citeauthor{View-GCN2020}, \citeyear{View-GCN2020}). These methods project an unstructured 3D point cloud into pixel-based 2D maps~(e.g., LiDAR front view, bird's eye view~(BEV), and the spherical map) and then use a well-established 2D-CNN to extract map features and fuse mapwise features from different view maps. The third method is to learn features directly from raw point clouds without any voxelization or projection. PointNet~(\citeauthor{PointNet2017}, \citeyear{PointNet2017}) was the first work to take raw point clouds as input. Specifically, PointNet extracts pointwise features with a multilayer perception~(MLP) layer and then uses a max-pooling function to generate global features. As a pioneering work, PointNet achieves state-of-the-art performance on the classification and segmentation task. However, this approach ignores local structural relationships between keypoints. Therefore, \cite{PointNetPlusPlus2017} proposed another hierarchical network, PointNet++, to obtain geometric structure information from the nearest neighbor of each point. The last is graph-based methods. Graph-based networks treat each point as graph vertices of a graph, and generate edges based on the nearest neighbors of each point. \cite{DGCNN2019}~proposed an unsupervised multitask algorithm DGCNN that constructs a local graph neural network and applies channelwise symmetric aggregation onto edges to connect the neighbors of each point. \subsection{Outlier Removal} Due to the acquisition equipment and the environmental noise where the target object is located, the correspondences inevitably contain noise, which may cause some correspondences to become outliers. The existence of outliers may reduce the point cloud alignment accuracy, so it is necessary to take measures to filter out these outliers. The task of filtering outliers is also called inlier/outlier classification~(\citeauthor{3DRegNet2020}, \citeyear{3DRegNet2020}), where a correspondence is identified as whether an inlier or an outlier according to a specific criterion. \par The traditional outlier removal methods include RANdom SAmple Consensus~(RANSAC)~(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981}) and its variants~(\citeauthor{GCRANSAC2018}, \citeyear{GCRANSAC2018}). The RANSAC method iteratively samples a small set of correspondences to ensure that the outliers are filtered out as much as possible. Other methods accomplish the task of outlier removal based on branch-and-bound~(BnB)~(\citeauthor{GoICP2016}, \citeyear{GoICP2016}), semidefinite programming~(SDP)~(\citeauthor{Sdrsac2019}, \citeyear{Sdrsac2019}; \citeauthor{Least_squares_registration2019}, \citeyear{Least_squares_registration2019}) or maximum clique schemes~(\citeauthor{maximumclique2019}, \citeyear{maximumclique2019}; \citeauthor{MaximalCliques2012}, \citeyear{MaximalCliques2012}). These methods generally require more sampling iterations and higher computational costs. However, the robustness of FGR~(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016}) and TEASER~(\citeauthor{TEASER2021}, \citeyear{TEASER2021}) remains strong in the presence of high outlier rates. The main learning-based outlier filtering schemes are DGR~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}) and 3DRegNet~(\citeauthor{3DRegNet2020}, \citeyear{3DRegNet2020}). The DGR algorithm uses a 6D convolutional network to classify the inliers and outliers, while the 3DRegNet algorithm uses multilayer ResNets as the classifier. \subsection{Point Cloud Registration} The iterative closet point~(ICP)~(\citeauthor{ICP1992}, \citeyear{ICP1992}), which alternately performs correspondence searching and least squares optimization to update the alignment state, is the best-known algorithm used for solving rigid registration problems. The literature~(\citeauthor{ReviewPointCloudReg2015}, \citeyear{ReviewPointCloudReg2015}; \citeauthor{EfficientVariantsofICP2001}, \citeyear{EfficientVariantsofICP2001}) summarized ICP and its variants in the last 20 years. The performance of the ICP algorithm is highly dependent on the accuracy of the initial estimated pose. However, the initial estimated information obtained from the odometers is not always reliable and may easily fall into local optima. To find an optimal transformation with ICP, \cite{GoICP2016} proposed the Go-ICP algorithm to determine the global optimal poses. It outperforms the ICP algorithm when point cloud registration requires the provision of a globally optimal solution. In addition, other algorithms attempt to apply convex relaxation~(\citeauthor{ConvexRelaxation2016}, \citeyear{ConvexRelaxation2016}), Riemannian optimization~(\citeauthor{SE-Sync2019}, \citeyear{SE-Sync2019}), graph-matching-based correspondence search method~(\citeauthor{Graph_matching_based_correspondence_search}, \citeyear{Graph_matching_based_correspondence_search}), and mixed-integer programming~(\citeauthor{MixedIntegerProgramming2020}, \citeyear{MixedIntegerProgramming2020}) to determine the global optimal pose, but these methods are computationally expensive and cannot meet the practical application requirements well. \begin{figure*}[hbt] \begin{subfigure}[c]{4.2cm} \begin{minipage}[t]{0.33\linewidth} \includegraphics[width=3.5\linewidth]{figures/sec1/1.2RANSAC1.png}\vspace{0.3cm} \includegraphics[width=3.5\linewidth]{figures/sec1/1.2RANSAC2.png}\vspace{0.5cm} \end{minipage} \subcaption{RANSAC (\citeauthor{RANSAC1981}, \citeyear{RANSAC1981})} \end{subfigure} \begin{subfigure}[c]{4.2cm} \begin{minipage}[t]{0.33\linewidth} \includegraphics[width=3.5\linewidth]{figures/sec1/1.3DGR1.png}\vspace{0.3cm} \includegraphics[width=3.5\linewidth]{figures/sec1/1.3DGR2.png}\vspace{0.3cm} \end{minipage} \subcaption{DGR (\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020})} \end{subfigure} \begin{subfigure}[c]{4.2cm} \begin{minipage}[t]{0.33\linewidth} \includegraphics[width=3.5\linewidth]{figures/sec1/1.4PointDSC1.png}\vspace{0.3cm} \includegraphics[width=3.5\linewidth]{figures/sec1/1.4PointDSC2.png}\vspace{0.3cm} \end{minipage} \subcaption{PointDSC (\citeauthor{PointDSC2021}, \citeyear{PointDSC2021})} \end{subfigure} \begin{subfigure}[c]{4.2cm} \begin{minipage}[t]{0.33\linewidth} \includegraphics[width=3.5\linewidth]{figures/sec1/1.5Ours1.png}\vspace{0.3cm} \includegraphics[width=3.5\linewidth]{figures/sec1/1.5Ours2.png}\vspace{0.3cm} \end{minipage} \subcaption{Ours} \end{subfigure} \caption{ Results of the transformation estimation that aligns two point clouds, ours vs. the current state-of-the-art RANSAC, DGR and PointDSC. Our method achieves more satisfactory and perfect alignment than RANSAC, DGR and PointDSC.} \label{FigPairwise registration results} \end{figure*} \par In recent years, the application of deep learning has made great progress in point cloud registration. PointNetLK~(\citeauthor{PointNetLK2019}, \citeyear{PointNetLK2019}) combines global feature descriptors based on PointNet~(\citeauthor{PointNet2017}, \citeyear{PointNet2017}) and the Lucas/Kanade optimization algorithm~(\citeauthor{LucasKanade1981}, \citeyear{LucasKanade1981}) and then iteratively solves the relative rigid transformation. DGR~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}) uses a ConvNet to estimate the inlier likelihood of each correspondence and then applies a weighted Procrustes method to align point clouds. However, 3D spatial relations are omitted in these registration pipelines~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}; \citeauthor{RANSAC1981}, \citeyear{RANSAC1981}). To focus on leveraging the spatial consistency in outlier rejection, \cite{PointDSC2021} proposes a spatial-consistency guided nonlocal module for geometric feature embedding of the correspondences and then uses a neural spectral matching~(NSM) module to compute the rigid transform for each seed. Different from the above networks, Predator~(\citeauthor{PREDATOR2021}, \citeyear{PREDATOR2021}) uses a parallel encode-decode structure and proposes a deep attention mechanism for the overlapping regions to exchange information about two unaligned point clouds. \section{Problem Formulation}\label{sec03Problem Formulation} In general, point cloud fragments are obtained with the light detection and ranging~(LiDAR) scanners by receiving laser beams reflected by objects in the surrounding environment~(\citeauthor{Deep_structural_Information_fusion2022}, \citeyear{Deep_structural_Information_fusion2022}). The task to align two or more point clouds by estimating the relative transformation between them is named the point cloud registration or pose estimation. Given two point clouds: \begin{align} P &= \{{{x}_{i}},i=1,2,\cdots ,M\}\\ Q &= \{{{y}_{i}},i=1,2,\cdots ,N\} \end{align} where $P$ and $Q$ denote the source and target point clouds, respectively, and ${{x}_{i}}\in {{\mathbb{R}}^{3}}$ and ${{y}_{i}}\in {{\mathbb{R}}^{3}}$ are the 3D point coordinates of the source and target point cloud fragments. For ease of notation, we only describe the simplest case of point cloud registration, in which $M=N$ and $\{({{x}_{i}},{{y}_{i}})\}_{i=1}^{N}$. \par The object of point cloud registration is to estimate the relatively rigid transformation that can correctly align two point clouds. We denote the rigid transformation as $[ {\mathbf{R}},{\mathbf{t}} ]$, which can be represented as follows: \begin{equation} [ {\mathbf{R}},{\mathbf{t}} ]=\text{arg} \underset{\mathbf{R},\mathbf{t}} {\mathop{\min }}\,\frac{1}{N}\sum\limits_{i}^{N}{{{w}_{i}}{{\left\| \mathbf{R}{{x}_{i}}+\mathbf{t}-{{y}_{i}} \right\|}^{2}}} \label{EqPointCloudReg} \end{equation} in which $\mathbf{R}\in SO(3)$ and $\mathbf{t}\in \mathbb{R}^{3}$ denotes the rotation matrix and the translation vector, $(x_i,y_i)$ is a pair of matched correspondence points, and ${w}_{i}$ indicates an inlier likelihood for a certain correspondence $( {x}_{i},{y}_{i} )$. \\ First, the weighted centroids of $P$ and $Q$ are defined as: \begin{equation} \overline{x}=\frac{\sum\limits_{i=1}^{N}{{{w}_{i}}{{x}_{i}}}}{\sum\limits_{i=1}^{N}{{{w}_{i}}}}, \\ \overline{y}=\frac{\sum\limits_{i=1}^{N}{{{w}_{i}}{{y}_{i}}}}{\sum\limits_{i=1}^{N}{{{w}_{i}}}} \end{equation} Then, the next step is to compute cross-covariance matrix $\mathbf{H}$: \begin{equation} \mathbf{H}=\sum\limits_{i=1}^{N}{{{w}_{i}}({{x}_{i}}-\overline{x})}{{({{y}_{i}}-\overline{y})}^{T}} \label{EqCross-CovarianceMatrix} \end{equation} Last, we need to use singular value decomposition(SVD) method to decompose $\mathbf{H}$: \begin{equation} \left[ \mathbf{U,S,V} \right] =\text{SVD}(\mathbf{H}) \end{equation} Eq.~\ref{EqPointCloudReg} gives a closed-form solution to the rigid transformation by minimizing the mean-square error~(MSE) function: \begin{equation} E_{1}=\frac{1}{N}\sum\limits_{i}^{N}{{{w}_{i}}{{\left\| \mathbf{R}{{x}_{i}}+\mathbf{t}-{{y}_{i}} \right\|}^{\text{2}}}} \end{equation} The rigid transformation $[{\mathbf{R}},{\mathbf{t}}]$ can be obtained as follows: \begin{align} {\mathbf{R}}& =\mathbf{V}diag(1,1,\cdots ,\mathrm{det}(\mathbf{V}{\mathbf{U}^\mathrm{T}})){\mathbf{U}^\mathrm{T}}\\ {\mathbf{t}}& =-{\mathbf{R}}\overline{x}+\overline{y} \end{align} where det($\cdot$) denotes the determinant. \section{Deep Feature Consistency}\label{sec03NetworkDesign} \begin{figure*}[hbt] \includegraphics[scale=0.8]{figures/sec4/4.1pipeline.pdf} \caption{Overall framework of the proposed DFC pipeline. It takes the correspondence set $\mathcal{M}$ as input, outputs the best rigid transformation and classifies the correspondences as inliers and outliers.} \label{FigPipeline} \end{figure*} Having demonstrated preliminaries about point cloud registration, we are now equipped to present the architecture of the proposed deep feature consistency, abbreviated as DFC. The overall architecture of our DFC pipeline is shown in Fig.~\ref{FigPipeline}~with three modules for feature embedding, correspondence weighting and deep feature matching. The goal of the proposed DFC method for registration is to provide an excellent end-to-end solution for correctly classifying correspondences into outliers/inliers and estimating the relative transformation between two unaligned point clouds in the absence of initial transformation prediction. \par In summary, our pairwise registration pipeline begins with embedding deep features of the putative correspondences into high dimensional space. Then, we apply the correspondence weighting module to predict the veracity of each correspondence and sample small correspondences to form multiple candidate inlier subsets. Last, we use a deep feature matching module to estimate the rigid transformation for each subset and determine the best rigid transformation among these transformations. \par It is necessary to take steps to preprocess the point cloud before feeding the original point cloud data into our pipeline. Preprocessing tasks can be divided into two steps: pointwise feature encoding and data augmentation. Here we only discuss the pointwise feature encoding task, and the data augmentation details are described in Sec.~\ref{sec05Experiments}. Similar to KPconv~(\citeauthor{Kpconv2019}, \citeyear{Kpconv2019}), DGR~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}) and PointDSC~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}), first, we use a voxelized grid filter to downsample the original point clouds $P$ and $Q$ in the feature encoding process, which can ensure $P$ and $Q$ have a reasonable point density and thus immensely reduce the computational costs. To be able to describe geometric semantic information in the form of vectors in the feature space, fully convolutional geometric features~(FCGF)~(\citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}) descriptors are used to extract pointwise features in the point cloud. FCGF descriptors can widely grasp spatial semantic information and can be easily extended to large-scale scenarios, which contributes to achieving ideal speedup. Then, we choose $N$ points with FCGF features from the source point cloud by random sampling. The target point cloud also needs to suffer the same sampling processing. On the one hand, point sampling can filter out the points with insignificant features to alleviate the influence of singular points on the registration effect; on the other hand, it can effectively reduce the computational costs and the registration time. The following notation is used throughout the paper. We can obtain the features of $N$ points from the two original point clouds: \begin{align} {{\mathcal{F}}_{x}}&=\{{\boldsymbol{f}_{{{x}_{1}}}} ,{\boldsymbol{f}_{{{x}_{2}}}} ,\cdots ,{\boldsymbol{f}_{{{x}_{N}}}}\}\\ {{\mathcal{F}}_{y}}&=\{{\boldsymbol{f}_{{{y}_{1}}}} ,{\boldsymbol{f}_{{{y}_{2}}}} ,\cdots ,{\boldsymbol{f}_{{{y}_{N}}}}\} \end{align} \subsection{Feature Embedding} The input of other state-of-the-art learning-based registration methods such as PointNetLK~(\citeauthor{PointNetLK2019}, \citeyear{PointNetLK2019}), DCP~(\citeauthor{DeepClosetPoint2019}, \citeyear{DeepClosetPoint2019}) and DeepVCP~(\citeauthor{DeepVCP2019}, \citeyear{DeepVCP2019}) only includes the coordinates of the key points located in the source and target point clouds, i.e, these methods independently extract the key-point features, thus ignoring the internal relation of the correspondences. In contrast to these methods, the input of our DFC method is not only the key points, but also the correspondence set $\mathcal{M}$: \begin{equation} \mathcal{M} =\{({x_i},\mathrm{arg} \underset{{y_j}}{\min}\,\left\| \boldsymbol{f}_{x_i}-\boldsymbol{f}_{y_j} \right\| ^2)\left| i,j\in [1,2,\cdots ,N] \right\} \end{equation} where $N$ denotes the number of correspondences. A correspondence $\left( {{x}_{i}}, {{y}_{j}} \right)$ can be represented as a specific point in 6-dimensional space $[ x_{i}^{\mathrm{T}}, y_{j}^{\mathrm{T}} ]^{\mathrm{T}}\in\mathbb{R}^6$~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}). Therefore, it is out of question that we can consider embedding features of all correspondences along with the idea of pointwise feature extraction. \begin{figure}[hbt] \centering \includegraphics[width=8cm]{figures/sec4/4.2MultiscaleGFM.pdf} \caption{Multiscale graph feature merging(GFM) network architecture for feature embedding. It consists of two blocks: graph neural network(GNN) and multiscale feature merging(FM). The first GNN layer is used to extract the graph features of the correspondences, while a multiscale FM block is designed to grasp and fuse features at different scales. Best viewed on the screen.} \label{FigMulti-ScaleGFM} \end{figure} \par The process of generating the correspondence set can filter out the noise at a certain rate~(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016}), thus effectively improving registration performance. It has been proven that fusing feature maps from different scales can significantly improve the performance on a set of computer vision tasks~(\citeauthor{DeeplySupervisedSalientObjectDetection2017}, \citeyear{DeeplySupervisedSalientObjectDetection2017}; \citeauthor{FeaturePyramidNetworksforObjectDetection2017}, \citeyear{FeaturePyramidNetworksforObjectDetection2017}; \citeauthor{MultiLevelFeatureAggregation2021}, \citeyear{MultiLevelFeatureAggregation2021}; \citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}; \citeauthor{Siamrpn++2019}, \citeyear{Siamrpn++2019}), so we follow the idea of these excellent methods to present multiscale graph feature merging~(GFM) network, which is designed for embedding features of the putative correspondences and compensating for the disadvantage of FCGF feature descriptors without geometric information of correspondences. The overall structure of the multiscale GFM network is shown in Fig.~\ref{FigMulti-ScaleGFM}, which consists of the graph neural network~(GNN)~(\citeauthor{DGCNN2019}, \citeyear{DGCNN2019}) and multiscale feature merging~(FM) block. \par \textbf{Graph Neural Network.} Let $\boldsymbol{m}_i$ and $\boldsymbol{m}_j$ denote a pair of adjacent correspondences, and $\left( i,j \right) \in \varepsilon $ the graph edge between $\boldsymbol{m}_i$ and $\boldsymbol{m}_j$. The correspondence $\boldsymbol{m}_i$ is used as the input of the GNN layer to obtain its graph feature representation using the $k$-nearest neighbor($k$-NN) in Euclidean space: \begin{equation} \mathcal{F} _{g_{m_i}}=h_{\theta}\left( \boldsymbol{m}_i,\boldsymbol{m}_j \right) =\bar{h}_{\theta}\left( \boldsymbol{m}_i,\boldsymbol{m}_j-\boldsymbol{m}_i \right) \end{equation} where the size of $\mathcal{F} _{g_{m_i}}$ is $12\times 1 \times 100$ and $\bar{h}_{\theta}\left( \cdot \right)$ denotes a nonlinear function with a series of learnable parameters $\theta$. \par By performing such steps for each correspondence among $\mathcal{M}$ in parallel, the final GNN features of all correspondences can be gained as ${\mathcal{F}}_{g}$ with the size of $12\times N \times 100$. \par \textbf{Multiscale Feature Merging.} The multiscale FM block consists of three scale layers, each of which consists of two blocks of a $1 \times 1$ convolution function followed by batchnormalization~(BN)~(\citeauthor{BatchNormalization2015}, \citeyear{BatchNormalization2015}) and ReLU activation~(\citeauthor{ReLU2010}, \citeyear{ReLU2010}). The outputs ${\mathcal{F}}_{g}$ of GNN are then fed to the multiscale FM block. For the sake of description, let ~${\mathcal{F}}_{g_{1}}, {\mathcal{F}}_{g_{2}}$ and ${\mathcal{F}}_{g_{3}}$~ define the different output graph features of the three scale layers, respectively. The spatial size between the last adjacent scale layers is reduced by half with stride 2, and the channel number between the first and second scale layers is always maintained at 64 while it becomes twice as large as 128 under the third scale layer. To smoothly merge the output graph features of the three scale layers, the feature maps ${\mathcal{F}}_{g_{2}}$ and ${\mathcal{F}}_{g_{3}}$ are upsampled to the same spatial size as ${\mathcal{F}}_{g_{1}}$ is. Finally, the graph features from the three scale layers mentioned above are merged and fed into another convolution with a $1 \times 1$ kernel and 256 channels, followed by BN and ReLU layer to obtain the final features ${{\mathcal{F}}_{\mathcal{M}}}$ with the size of $N \times D$, where $D$ means the feature embedding dims and is set to $256$. \par Let $\mathcal{F} _{\mathcal{M}}=\left\{ \boldsymbol{f}_1,\boldsymbol{f}_2,\cdots ,\boldsymbol{f}_N \right\}$ ~denote the final features of ${\mathcal{M}}$ and $\boldsymbol{f}_i$ represent a feature representation for the $i$-th correspondence $\left( {{x}_{i}}, {{y}_{i}} \right)$. The feature representations ${{\mathcal{F}}_{\mathcal{M}}}$ contain both high-level semantic information and low-level detail, which allows us to set a better balance between invariance and discriminability~(\citeauthor{MultiLevelFeatureAggregation2021}, \citeyear{MultiLevelFeatureAggregation2021}). \subsection{Correspondence Weighting} \label{SecCorrespondenceWeighting} A putative correspondence with obvious features should ideally be assigned with a higher weight. Similar to DeepVCP~(\citeauthor{DeepVCP2019}, \citeyear{DeepVCP2019}), AdaLAM~(\citeauthor{Adalam2020}, \citeyear{Adalam2020}) and PointDSC~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}), we design a correspondence weighting module to sample small correspondences with high confidence as a candidate inlier set, and then search for adjacent correspondences for each candidate inlier in the feature space to form multiple inlier subsets that will replace ${\mathcal{M}}$ as the input of the subsequent deep feature matching module. Compared with the whole correspondence set ${\mathcal{M}}$, the candidate inliers have much more probabilities to be good candidates, which can better guarantee the registration success ratio. \par As shown in Fig.~\ref{FigPipeline}, First, we decide to apply an MLP to estimate a likelihood for each correspondence among $\mathcal{M}$ based on the features ${{\mathcal{F}}_{\mathcal{M}}}$ extracted in the previous multiscale GFM network. This estimation can be viewed as likely if a correspondence paired is an inlier. The higher the confidence predicted by the MLP, the more likely the counterpart correspondence may be a good candidate to be an inlier. As the core of the correspondence weighting module, the MLP layer is composed of the three fully connected layers, where the first two layers consist of a convolution function followed by ReLU, and the last layer only consists of the convolution function, excluding ReLU activation. Then in the sampling step, we select a series of correspondences $\mathcal{S} \left( \mathcal{S} \subseteq \mathcal{M} \right)$~based on the confidence ranking in descending order by direct one-shot sampling, unlike the iterative sampling optimization of the RANSAC method. Here, we finally determine that the total sampling number $N_{\mathcal{S}}$ of $\mathcal{S}$ is set to $200$. These selected correspondences have many unique characteristics that may enhance the registration performance, including high confidence and wide distribution. These selected correspondences are referred to as candidate inliers for the sake of distinction. \par In the process of sampling candidate inliers, the correspondences among ${\mathcal{M}}$ with low confidence are identified as latent outliers, which completes the task of coarse filtering outliers. In the subsequent Sec.~\ref{Sec5.2PairwiseRegistration}, we conduct experiments to explore the effectiveness of outlier removal and how it affects the alignment accuracy. \subsection{Deep Feature Matching} \begin{figure}[h] \centering \includegraphics[width=8cm]{figures/sec4/4.3Deepfeaturematching.pdf} \caption{The detailed steps of the deep feature matching module used for estimating a rigid transformation for each candidate inlier subset.} \label{FigDeepFeatureConsistency} \end{figure} Obtaining a series of candidate inliers $\mathcal{S}$ from the previous correspondence weighting module, we construct a series of candidate inlier subsets ${\mathcal{C}}$ for each latent inlier in the feature space using the $k$-NN method, where $\left| \mathcal{C} \right|=k$ and $k$ takes the value of $40$. As shown in Fig.~\ref{FigDeepFeatureConsistency}, the overall procedure of the deep feature matching module is divided into two steps: constructing a deep feature consistency matrix and estimating the rigid transformation by the weighted SVD method. First, we need to establish a deep feature consistency matrix to estimate the inlier probability for each candidate inlier subset among $\mathcal{C}$ and then to apply the weighted SVD method to solve the corresponding rigid transformation. \par The core of the deep feature matching module is constructing the feature consistency matrix $\mathbf{M}$ that derived from the literature~(\citeauthor{PairwiseConstraints2005}, \citeyear{PairwiseConstraints2005}) and its elements can be calculated according to Eq.~\ref{EqFeatureConsistencyMatrix}: \begin{equation} e_{ij}=\left[ 1-\frac{1}{\sigma^{2}}\left\| {{\overline{\boldsymbol{f}}}_{i}}-{{\overline{\boldsymbol{f}}}_{j}} \right\|^{2} \right] \label{EqFeatureConsistencyMatrix} \end{equation} where ${{\overline{\boldsymbol{f}}}_{i}}$ and ${{\overline{\boldsymbol{f}}}_{j}}$ are the L2-normalized feature vectors of $\boldsymbol{f}_i$ and $\boldsymbol{f}_j$, respectively, and $\sigma$ is a balanced parameter to control the sensitivity to the feature difference~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}). \par The calculation to solve $e_{ij}$ makes $\mathbf{M}$ nonnegative, serving as a role to ensure the consistency between the correspondence features. After computing $\mathbf{M}$ by Eq.~\ref{EqFeatureConsistencyMatrix}, the PCA method is then used to estimate its principal vectors. Here we denote the principal vectors as $\boldsymbol{w}=\left\{ w_1,w_2,\cdots ,w_k \right\}$. In Sec.~\ref{sec5AblationStudies}, we will give an ablation study on another method named eigenvalues to calculate principal vectors. The principal component $\boldsymbol{w}$ can be considered as the inlier probability corresponding to each candidate inlier subset. Once we compute the inlier probability, the rigid transformation can be completed with Eq.~\ref{EqPointCloudReg}. Similarly, by performing the same steps for each candidate inlier subset in parallel, the rigid transformations $[{\mathbf{R}},{\mathbf{t}}]$ corresponding to each subset can be obtained simultaneously. \subsection{Hypothesis Verification} The final step of the proposed DFC method is the same as the literature~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}), i.e., to determine the optimal transformation $[ \mathbf{R}^*,\mathbf{t}^* ]$ among a series of rigid transformations $[ {\mathbf{R}},{\mathbf{t}} ]$ generated by the deep feature matching module according to a certain rule that the number of inliers computed by each transformation maximizes. The process of choosing the optimal transformation can be accomplished by maximizing the following objective function: \begin{equation} {{E}_{2}}=\underset{[{\mathbf{R}},{\mathbf{t}}] }{\mathop{max}}\,\sum\limits_{i=1}^{k}{\left[\!\left[ \left\| {\mathbf{R}}{{x}_{i}}+{\mathbf{t}}-{{y}_{i}} \right\|<\tau \right]\!\right]} \label{EqHypothesisVerification} \end{equation} where $\tau$ denotes the given inlier threshold and $ \llbracket \cdot \rrbracket $ denotes the Iverson bracket. When $\| {\mathbf{R}}{{x}_{i}}+{\mathbf{t}}-{{y}_{i}} \|$ is less than the given threshold $\tau$, the correspondence $ \left( {x}_{i},{y}_{i} \right)$ is considered an inlier~(labeled as one), and the total number of inliers will be increased by one; otherwise, $ \left( {x}_{i},{y}_{i} \right)$ will be identified as an incorrect correspondence~(labeled as zero). \subsection{Loss Function} The loss function of the proposed DFC method consists of two independent loss terms called classification loss and transformation loss. \par \textbf{Classification Loss.} The classification loss is a common metric to evaluate incorrect correspondences using binary cross entropy~(BCE)~(\citeauthor{3DRegNet2020}, \citeyear{3DRegNet2020}; \citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}): \begin{equation} {\mathcal{L}_{c}}=\text{BCE}\left( \boldsymbol{c}, \boldsymbol{l}\right) \end{equation} where $\boldsymbol{c}$ is the confidence of the correspondence set computed by the MLP mentioned in Sec. \ref{SecCorrespondenceWeighting}. $\boldsymbol{l}=\left\{ l_1, l_2, \cdots, l_N \right\}$, where $l_i$ ~(equal to one or zero) is the ground-truth label, which indicates the $i$-th point correspondence is whether an inlier or outlier. \par \textbf{Transformation Loss.} The transformation loss is commonly used to assess the agreement between the ground-truth rigid transformation $[{\mathbf{R}^{g}},{\mathbf{t}^{g}}]$ and estimated rigid transformation $[{\mathbf{R}^{*}},{\mathbf{t}^{*}}]$: \begin{equation} {{\mathcal{L}}_{t}}\text{=}{{\left\| {{({\mathbf{R}^{*}})}^{\mathrm{T}}}{\mathbf{R}^{g}}-I \right\|}^{2}}+{{\left\| {\mathbf{t}^{*}}-{\mathbf{t}^{g}} \right\|}^{2}} \end{equation} \par The total loss is a weighted sum of the above loss functions: \begin{equation} \mathcal{L}={{\mathcal{L}}_{c}}+\lambda {\mathcal{L}_{t}} \end{equation} where $\lambda$ is a hyperparameter that can be manually set to balance these two losses. \section{Experiments}\label{sec05Experiments} In this section, we analyze the robustness and generalization of the proposed DFC method in indoor, outdoor and multiway registration scenarios. As the name suggests, pairwise registration means estimating the rigid transformation between two point cloud scans as shown in Fig.~\ref{FigPairwise registration results}, and multiway registration produces a final global reconstruction map and pose estimation for all point cloud fragments. Pairwise registration plays an extremely important role in the multiway registration task. Before performing multiway registration, we need to use a pairwise registration method to estimate the initial poses and then obtain the optimal poses with robust pose graph optimization. \par For indoor alignment scenarios, we choose the 3DMatch dataset~(\citeauthor{3DMatch2017}, \citeyear{3DMatch2017}) to evaluate the performance of our method, where the scans are composed of 3D point clouds from different real-world scenes, and these point cloud scans also contain ground-truth transformations computed by the RGB-D reconstruction system. To verify the generalization ability of our pipeline across different datasets, we conduct another cross-dataset experiment on the augmented ICL-NUIM~(\citeauthor{RobustReconstructionofIndoorsScenes2015}, \citeyear{RobustReconstructionofIndoorsScenes2015}; \citeauthor{ICL-NUIM2014}, \citeyear{ICL-NUIM2014}) to quantify the average trajectory error~(ATE). In addition, we use KITTI odometry~(\citeauthor{KITTIDataset2012}, \citeyear{KITTIDataset2012}) as a benchmark dataset for large outdoor alignment scenarios. However, there is no clear official division labels for train/val/test splits, so we are determined to divide the KITTI odometry benchmark into train/val/test sets following FCGF~(\citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}). \par During training, we apply Gaussian noise with a standard deviation of 0.03, random rotations $\in [0^{\degree},360^{\degree})$ around a random axis. All experiments are performed on the platform with one single NVIDIA RTX 2080Ti graphics card and Intel Xeon E5-2630 v3 CPU. We construct our model in PyTorch, train it on the previous platform for 100 epochs and set the batch size to 8. \subsection{Pairwise Registration}\label{Sec5.2PairwiseRegistration} The scheme of the train/test splits is the same as (\citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}; \citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}; \citeauthor{PointDSC2021}, \citeyear{PointDSC2021}), i.e., 54 scenes among the 3DMatch dataset are used for training and validation, and the remaining 8 scenes are used for testing. The hyperparameter $\lambda$ and the inlier threshold $\tau$ are set to $10^{-2}$ and $10cm$, respectively. A voxelized $5cm$ grid is first used to downsample the point cloud data, and then the FCGF descriptors are applied to extract the pointwise features to prepare to construct the input correspondences. \par In this section, we compare and analyze the registration results on the test split of 3DMatch~(\citeauthor{3DMatch2017}, \citeyear{3DMatch2017}), which contains 8 different indoor scenes, as shown in Fig.~\ref{FigVisulizationEachSceneResults}. We further evaluate the performance of our method on the 3DMatch dataset by computing $\mathrm{RR}$, $\mathrm{RE}$ and $\mathrm{TE}$ based on Eq.~\ref{Eq_RE_TE}, respectively. After obtaining the initial rigid transformation, we attempt to use the ICP algorithm~(\citeauthor{ICP1992}, \citeyear{ICP1992}) for subsequent optimization of the initial predicted transformation during the testing stage. By a slight abuse of notation, we define our pipeline without subsequent ICP refinement as \textbf{DFC-v1} and the full model with ICP as \textbf{DFC}. Fig.~\ref{FigRegistrationResultsonPerScene} summarizes the detailed statistics on each test scene. Our method outperforms the other advanced classical and learning-based methods in terms of recall ratio and reaches the lowest $\mathrm{RE}$ and $\mathrm{TE}$ on most scenes, which implies that our method has much more robustness when dealing with different real scenes. \begin{figure}[hbt] \begin{subfigure}[c]{3.9cm} \includegraphics[width=5cm]{figures/sec5/5.1_7-scenes-redkitchen.png} \subcaption{Kitchen} \end{subfigure} \quad \begin{subfigure}[c]{3.9cm} \includegraphics[width=4cm]{figures/sec5/5.2_sun3d-home_at-home_at_scan1_2013_jan_1.png} \subcaption{Home1} \end{subfigure} \\ \begin{subfigure}[c]{3.9cm} \includegraphics[width=4.55cm]{figures/sec5/5.3_sun3d-home_md-home_md_scan9_2012_sep_30.png} \subcaption{Home2} \end{subfigure} \quad \begin{subfigure}[c]{3.9cm} \includegraphics[width=4cm]{figures/sec5/5.4_sun3d-hotel_uc-scan3.png} \subcaption{Hotel1} \end{subfigure} \\ \begin{subfigure}[c]{3.9cm} \includegraphics[width=4.55cm]{figures/sec5/5.5_sun3d-hotel_umd-maryland_hotel1.png} \subcaption{Hotel2} \end{subfigure} \quad \begin{subfigure}[c]{3.9cm} \includegraphics[width=4cm]{figures/sec5/5.6_sun3d-hotel_umd-maryland_hotel3.png} \subcaption{Hotel3} \end{subfigure} \\ \begin{subfigure}[c]{3.9cm} \includegraphics[width=4.6cm]{figures/sec5/5.7_sun3d-mit_76_studyroom-76-1studyroom2.png} \subcaption{Study} \end{subfigure} \quad \begin{subfigure}[c]{3.9cm} \includegraphics[width=3.5cm]{figures/sec5/5.8_sun3d-mit_lab_hj-lab_hj_tea_nov_2_2012_scan1_erika.png} \subcaption{Lab} \end{subfigure} \caption{The registration visualization results of our registration method in 8 different scenes of the 3DMatch benchmark~(\citeauthor{3DMatch2017}, \citeyear{3DMatch2017}).} \label{FigVisulizationEachSceneResults} \end{figure} \textbf{Evaluation Metrics.} ~To make a fair comparison with other state-of-the-art registration methods~(\citeauthor{DeepClosetPoint2019}, \citeyear{DeepClosetPoint2019}; \citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}; \citeauthor{PointDSC2021}, \citeyear{PointDSC2021}; \citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016}), we adopt the following three evaluation metrics to evaluate the performance of the proposed DFC method: \par (1) Rotation error~($\mathrm{RE}$) and translation error~($\mathrm{TE}$). $\mathrm{RE}$ and $\mathrm{TE}$ penalize errors between estimated poses and ground-truth poses: \begin{align} \mathrm{RE}\left( \mathbf{R}^*,\mathbf{R}^{\mathbf{g}} \right) &=\mathrm{arc}\cos \frac{\mathrm{Tr}\left( \left( \mathbf{R}^* \right) ^{-1}\mathbf{R}^{\mathbf{g}} \right) -1}{2} \\ \mathrm{TE}\left( \mathbf{t}^*,\mathbf{t}^{\mathbf{g}} \right) &=\left\| \mathbf{t}^*-\mathbf{t}^{\mathbf{g}} \right\| \label{Eq_RE_TE} \end{align} where $\mathbf{R}^{\mathbf{g}}$ and $\mathbf{t}^{\mathbf{g}}$ represent the ground-truth rotation and translation, respectively, and $\mathrm{Tr}\left( \cdot \right)$ represents the trace of one certain matrix. It is worth noting that $\mathrm{RE}$ and $\mathrm{TE}$ are calculated only when two point clouds are successfully aligned. This is because two point clouds that fail to align will return an incorrect pose estimate that differs significantly from the ground-truth transformation and makes the predictions for $\mathrm{RE}$ and $\mathrm{TE}$ unreliable. \par (2) Registration Recall~($\mathrm{RR}$)~(\citeauthor{RobustReconstructionofIndoorsScenes2015}, \citeyear{RobustReconstructionofIndoorsScenes2015}). The recall ratio metric represents the percentage of successful pairwise alignments. This means successful alignment when $\mathrm{TE}$ and $\mathrm{RE}$ are less than some thresholds at the same time. For the 3DMatch benchmark, the pairwise alignment result can be regarded as successful if $\mathrm{RE}<15^{\degree}$ and $\mathrm{TE}<30cm$. \par \textbf{Candidate inliers sampling.}~The second step of our pipeline is weighting and sampling a set of correspondences referred to as candidate latent inliers in one shot, instead of randomly sampling minimal subsets iteratively, such as RANSAC~(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981}). These selected candidate inliers are characterized by high probability, thus making them have higher probabilities of becoming inliers compared to other correspondences. \par Table~\ref{Table_PerformencewithDifferentLatentInliers} shows the comprehensive assessment results of the proposed DFC method with different numbers of samples. We conclude that the sampling strategy can greatly improve the \textit{registration recall}. To some extent, \textit{registration recall} is higher when the number of candidate inlier samples is smaller; specifically, $\mathrm{RR}$ is optimal when $N_{\mathcal{S}}$ is set to $200$, which indicates that taking a portion of the correspondences with high confidence as candidate inliers can greatly improve the alignment effect and filter out the outliers effectively. It may be possible to achieve even higher \textit{registration recall} by combining the \itshape{top-k} \upshape sampling operator scheme. We leave this task for future research. \begin{table}[hbt] \centering \caption{The performance of our method with different candidate inlier sampling strategies.} \label{Table_PerformencewithDifferentLatentInliers} \begin{tabular}{p{1.5cm} p{23 pt}<{\centering} p{23 pt}<{\centering} p{23 pt}<{\centering} p{23 pt}<{\centering} p{23 pt}<{\centering} } \toprule \multirow{2}*{Metrics}&\multicolumn{5}{c}{$N_{\mathcal{S}}$}\\ \cline{2-6} \multicolumn{1}{l}{}&100&200&300&400&500\\ \midrule $\mathrm{RR(\%)}$&92.98&$\mathbf{93.47}$&93.41&93.22&93.10\\ $\mathrm{RE(Deg)}$&1.69&$\mathbf{1.67}$&1.69&1.68&1.67\\ $\mathrm{TE(cm)}$&6.07&$\mathbf{6.04}$&6.06&6.08&6.06\\ \bottomrule \end{tabular} \end{table} \par \begin{sloppypar} \textbf{Traditional methods.}~To compare with traditional registration methods, we choose five typical traditional algorithms as benchmarks: FGR~(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016}), RANSAC~(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981}), GC-RANSAC~(\citeauthor{GCRANSAC2018}, \citeyear{GCRANSAC2018}), Point2Point-ICP and Point2Plane-ICP. All registration algorithms are implemented with the Open3D library, except for GC-RANSAC. The assessment results are shown in Table~\ref{Table_Reg_Resultson3DMatch}. \end{sloppypar} \par ICP variants, including point-to-point and point-to-plane ICP methods, fail in most indoor scenes, because the ICP algorithm is highly dependent on the initial pose estimation so that it easily falls into the local optimum and partly because the overlap ratio between 3D scans is low. The lower the overlap between two point clouds is, the more likely the point clouds fail to align. The performances of FGR, RANSAC and GC-RANSAC are better than that of the ICP variants. The FGR network achieves a recall as high as $78.62\%$ when applied with FCGF feature descriptors, and even RANSAC reaches $91.99\%$ \textit{registration recall}. When aligning point clouds with 200k sampling iterations, RANSAC can still maintain strong robustness. This conclusion is absolutely different from the literature~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}), which is due to the fast and compact characteristics of FCGF feature descriptors compared to classical FPFH descriptors. However, it is worth noting that our method is approximately 10 times faster than RANSAC-200k, and our method achieves much higher \textit{registration recall} by a significant margin. Another method named GC-RANSAC only achieves a $91.68\%$ recall ratio, and our method exceeds $1.79\%$. \par \begin{table*} \centering \caption{Quantitative comparisons of different registration algorithms on the 3DMatch benchmark. Time excludes the construction of matched correspondences.} \label{Table_Reg_Resultson3DMatch} \begin{tabular}{p{7cm} p{2cm}<{\centering} p{2cm}<{\centering} p{2cm}<{\centering} p{2cm}<{\centering}} \toprule {Methods}&$\mathrm{RR(\%\uparrow)}$& $\mathrm{RE(deg\downarrow)}$&$\mathrm{TE(cm\downarrow)}$&$\mathrm{Time(s)}$\\ \midrule FGR(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016})&78.62&2.91&8.42&0.64\\ RANSAC-2k(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981})&88.42&3.02&9.14&0.15\\ RANSAC-20k&91.13&2.67&8.03&1.05\\ RANSAC-200k&91.99&2.47&7.53&10.89\\ GC-RANSAC-1M(\citeauthor{GCRANSAC2018}, \citeyear{GCRANSAC2018}) &91.68&2.29&7.09&0.42\\ \midrule ICP(Point2Point)(\citeauthor{Open3D2018}, \citeyear{Open3D2018})&10.10&4.06&10.21&0.10\\ ICP(Point2Plane)(\citeauthor{Open3D2018}, \citeyear{Open3D2018})&11.34&2.40&6.79&0.71\\ \midrule DGR w/o safeguard&85.20&2.58&7.73&0.70\\ DGR(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020})&91.30&2.43&7.34&1.21\\ PointDSC(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021})&93.28&2.06&6.55&0.09\\ DFC-v1(Ours)&92.54&2.04&6.56&0.08\\ DFC(Ours)&$\mathbf{93.47}$&$\mathbf{1.67}$&$\mathbf{6.04}$&0.14\\ \bottomrule \end{tabular} \end{table*} \textbf{Learning-based methods.} In addition, we choose another three state-of-the-art learning-based algorithms named 3DRegNet~(\citeauthor{3DRegNet2020}, \citeyear{3DRegNet2020}), DGR~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}) and PointDSC~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}) as our comparison benchmarks, and the registration results of DGR are also recorded in the absence of a protection mechanism (i.e., the RANSAC algorithm is used to optimize the initial poses during the evaluation phase). The \textit{registration recall} of our method, especially without applying the ICP algorithm to optimize the estimated initial poses, has already exceeded $1.24\%$ compared to DGR. DGR only achieves a recall ratio of $86.2\%$ in the absence of RANSAC optimization~(called the safeguard mechanism). Compared with PointDSC, our method has a slightly higher \textit{registration recall} than PointDSC after optimizing the estimated poses using the ICP algorithm, and the model runtime is only $0.08s$ without ICP refinement. \par In conclusion, the DFC method proposed in this paper provides an efficient and robust registration method in terms of \textit{registration recall}, and achieves a better balance between efficient computation and robustness at the same time. \subsection{Multiway Registration} \begin{table*}[hbt] \centering \caption{ATE(cm) on the augmented ICL-NUIM dataset with simulated depth noise. The last column shows the average ATE of all four scenes. For BAD-SLAM, this method fails in the scene "Living room 1", so we do not compute its average ATE.} \label{Table_MultiwayRegistration} \begin{tabular}{p{7cm} p{1.6cm}<{\centering} p{1.6cm}<{\centering} p{1.6cm}<{\centering} p{1.6cm}<{\centering} p{1.6cm}<{\centering}} \toprule {Method}&Living1&Living2&Office1&Office2&Average\\ \midrule ElasticFusion(\citeauthor{ElasticFusion2015}, \citeyear{ElasticFusion2015}) &66.61&24.33&13.04&35.02&34.75\\ InfiniTAM(\citeauthor{InfiniTAM2016}, \citeyear{InfiniTAM2016})&46.07&73.64&113.8&105.2&84.68\\ BAD-SLAM(\citeauthor{BadSlam2019}, \citeyear{BadSlam2019})&-&40.41&18.53&26.34&-\\ Multiway+FGR(\citeauthor{FastGlobalRegistration2016}, \citeyear{FastGlobalRegistration2016})&78.97&24.91&14.96&21.05&34.98\\ Multiway+RANSAC(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981})&110.9&19.33&14.42&17.31&40.49\\ Multiway+DGR(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020})&21.06&21.88&15.76&11.56&17.57\\ Multiway+PointDSC(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021})&20.25&15.58&13.56&$\mathbf{11.30}$&$\mathbf{15.18}$\\ Multiway+DFC(Ours)&$\mathbf{18.15}$&$\mathbf{15.28}$&$\mathbf{12.76}$&32.44&19.66\\ \bottomrule \end{tabular} \end{table*} \par To evaluate the generalization capability of our method to new datasets, we use the training model on the 3DMatch dataset again and then evaluate the performance of multiway registration on the augmented ICL-NUIM dataset, which is also called cross-dataset generalization capability analysis. \par Following~(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021}; \citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}), we apply our method to roughly align all scan fragments and to obtain the initial poses and then trim the initial poses with multiway registration using the pose graph optimization algorithm which can be implemented with the open-source library Open3D~(\citeauthor{Open3D2018}, \citeyear{Open3D2018}). To assess multiway registration, we measure the absolute trajectory error~(ATE) on the augmented ICL-NUIM dataset with simulated depth noise, and the results are shown in Table~\ref{Table_MultiwayRegistration}. Compared with current state-of-the-art online SLAM methods and offline reconstruction systems, our method achieves the lowest level of ATE in the first three scenes. \begin{figure*}[hbt] \centering \includegraphics[width=17cm]{figures/sec5/5.9Reg_Recall.pdf}\\ \includegraphics[width=17cm]{figures/sec5/5.10RE.pdf}\\ \includegraphics[width=17cm]{figures/sec5/5.11TE.pdf} \caption{Registration results per scene of the 3DMatch benchmark. \textit{Row 1-3}: \textit{Registration recall}~(higher is better), $\mathrm{TE}$ and $\mathrm{RE}$ measured on successfully aligned pairs (lower is better). Our method consistently performs better on most scenes. The last column is the average \textit{registration recall}, $\mathrm{TE}$ and $\mathrm{RE}$ on all eight scenes. A certain missing bar means its value is zero and there are no successful alignments in the corresponding scene.} \label{FigRegistrationResultsonPerScene} \end{figure*} \subsection{Outdoor LIDAR Registration} \begin{table*} \centering \caption{Quantitative comparisons of different registration algorithms on KITTI odometry. The listed time excludes the construction of the correspondence set.} \label{Table_Reg_ResultsonKitti} \begin{tabular}{p{7cm} p{2cm}<{\centering} p{2cm}<{\centering} p{2cm}<{\centering} p{2cm}<{\centering}} \toprule {Methods}&$\mathrm{RR(\%\uparrow)}$& $\mathrm{RE(deg\downarrow)}$&$\mathrm{TE(cm\downarrow)}$&$\mathrm{Time(s)}$\\ \midrule RANSAC-1k(\citeauthor{RANSAC1981}, \citeyear{RANSAC1981})&96.58&0.48&23.41&0.30\\ RANSAC-20k&97.48&0.38&22.60&3.59\\ RANSAC-200k&97.12&0.35&22.32&37.44\\ GCRANSAC-2k(\citeauthor{GCRANSAC2018}, \citeyear{GCRANSAC2018})&96.22&0.44&23.33&0.51\\ \midrule DGR(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020})&96.90&0.33&21.29&0.86\\ PointDSC(\citeauthor{PointDSC2021}, \citeyear{PointDSC2021})&$\mathbf{98.20}$&0.33&20.94&0.31\\ DFC(Ours)&$97.30$&$\mathbf{0.24}$&$\mathbf{18.64}$&0.55\\ \bottomrule \end{tabular} \end{table*} Following~(\citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}), we use outdoor LiDAR scans from the KITTI odometry~(\citeauthor{KITTIDataset2012}, \citeyear{KITTIDataset2012}) for registration. Similar to pairwise registration in indoor scenes, we set the inlier threshold $\tau$ to $60cm$, downsample the point clouds using a voxelization filter with a $30cm$ voxel and then extract the pointwise features by applying FCGF descriptors to form the correspondence set as the input of our pipeline. As illustrated in the literature~(\citeauthor{DeepGlobalRegistration2020}, \citeyear{DeepGlobalRegistration2020}; \citeauthor{PointDSC2021}, \citeyear{PointDSC2021}; \citeauthor{FullyConvolutionalGeometricFeatures2019}, \citeyear{FullyConvolutionalGeometricFeatures2019}), the thresholds of $\mathrm{TE}$ and $\mathrm{RE}$ are set to $60cm$ and $5^{\degree}$, respectively. When both $\mathrm{TE}$ and $\mathrm{RE}$ are less than the abovementioned thresholds, the alignment of two point clouds in KITTI odometry can be considered successful. The quantified results of our network on the KITTI odometry dataset are shown in Table~\ref{Table_Reg_ResultsonKitti}, and the visualization results are shown in Fig.~\ref{Fig_VilulizationRegResultsonKITTI}. Although the recall ratio of our method is slightly below another learning-based method PointDSC, our network still appears to be strongly competitive in decreasing the transformation errors. \begin{figure}[hbt] \centering \begin{subfigure}{7cm} \includegraphics[scale=0.1]{figures/sec5/5.12KITTI_Pair1.png} \subcaption{KITTI registration test pair 1} \end{subfigure} \begin{subfigure}{7cm} \includegraphics[scale=0.1]{figures/sec5/5.13KITTI_Pair2.png} \subcaption{KITTI registration test pair 2} \end{subfigure} \begin{subfigure}{7cm} \includegraphics[scale=0.1]{figures/sec5/5.14KITTI_Pair3.png} \subcaption{KITTI registration test pair 3} \end{subfigure} \begin{subfigure}{7cm} \includegraphics[scale=0.1]{figures/sec5/5.15KITTI_Pair4.png} \subcaption{KITTI registration test pair 4} \end{subfigure} \caption{Registration visulization examples on KITTI. Our method can effectively and accurately align the outdoor point cloud scans.} \label{Fig_VilulizationRegResultsonKITTI} \end{figure} \subsection{Ablation Studies}\label{sec5AblationStudies} We designed some ablation experiments by dividing our pipeline into multiple modules and replacing each module with another different counterpart to study the role of each part. All experiments are performed on the same condition as the experiments in Sec~\ref{Sec5.2PairwiseRegistration}. \par \textbf{Ablation on feature embedding.} To discuss the effectiveness of the proposed multiscale GFM network, we design ablation experiments on the 3DMatch benchmark to make a comparison. We choose two methods: PointNet and DGCNN. The comparison results are shown in Table~\ref{TableAblationstudyofMulti-ScaleGFM}. PointNet~(\citeauthor{PointNet2017}, \citeyear{PointNet2017}) achieves state-of-the-art performance for classification and segmentation and provides a new research perspective on processing raw point clouds while DGCNN~(\citeauthor{DGCNN2019}, \citeyear{DGCNN2019}) constructs local graph geometric features by using a local neighborhood graph and convolution operations on edges. Our method performs consistently better with the proposed multiscale GFM network than PointNet and DGCNN, which provides strong evidence that our multiscale GFM module can help to improve the recall ratio. \begin{table}[H] \centering \caption{Ablation study on the multiscale GFM network.} \label{TableAblationstudyofMulti-ScaleGFM} \begin{tabular}{p{0.8cm} p{1.2cm}<{\centering} p{1.2cm}<{\centering} p{1.2cm}<{\centering} p{1.2cm}<{\centering} p{0.6cm} } \toprule \makecell[c]{Metrics}& \makecell[c]{PointNet+\\DFC-v1}& \makecell[c]{PointNet+\\DFC}& \makecell[c]{DGCNN+\\DFC-v1}& \makecell[c]{DGCNN+\\DFC}& \makecell[c]{Ours} \\ \midrule $\mathrm{RR}$&91.13&91.68&92.73&93.22&$\mathbf{93.47}$\\ $\mathrm{RE}$&2.03&1.67&2.05&1.68&$\mathbf{1.67}$ \\ $\mathrm{TE}$&6.41&$\mathbf{6.01}$&6.50&6.02&6.04\\ \bottomrule \end{tabular} \end{table} \par \textbf{Ablation on principal vectors.} In this experiment, we subsequently design ablation experiments to explore whether the eigenvalue or PCA method is better for registration. We compare PCA and Eigenvalue with both DFC-v1 and DFC networks on the 3DMatch benchmark. Table~\ref{TableAblationstudyofPrincipalVectors} shows both DFC-v1 and DFC perform better with PCA than Eigenvalue. Therefore, we can conclude that the PCA algorithm is helpful to boost the registration performance. \begin{table}[hbt] \centering \caption{Ablation study on principal vectors.} \label{TableAblationstudyofPrincipalVectors} \begin{tabular}{p{0.8cm} p{1.5cm}<{\centering} p{1.5cm}<{\centering} p{0.9cm}<{\centering} p{0.9cm}<{\centering}} \toprule \makecell[c]{Metrics}& \makecell[c]{Eigenvalue+\\DFC-v1}& \makecell[c]{Eigenvalue+\\DFC}& \makecell[c]{PCA+\\DFC-v1}& \makecell[c]{PCA+\\DFC}\\ \midrule $\mathrm{RR}$&92.17&92.79&92.73&$\mathbf{93.47}$\\ $\mathrm{RE}$&2.02&$\mathbf{1.65}$&2.05&1.67 \\ $\mathrm{TE}$&6.54&$\mathbf{6.02}$&6.50&6.04\\ \bottomrule \end{tabular} \end{table} \section{Conclusion}\label{sec06Conclusion} We propose deep feature consistency, a learning-based framework for robust, accurate and efficient point cloud registration by jointly embedding the correspondence features with a multiscale GFM network, weighting and sampling correspondences with a correspondence weighting module, and solving the rigid transformation for alignment with a deep feature matching module. The results on 3DMatch indoor scenes and KITTI odometry outdoor scenes show that our methodology outperforms the traditional and learning-based algorithms and can effectively and quickly align the point clouds. The low transformation errors and high robustness of our method make it attractive for many applications relying on the point cloud registration task. In a further extension of this work, we will explore new methods for improving the generalization capability in broader application scenarios and attempt to extend our method to other 3D computer visual tasks, such as 3D reconstruction and mapping, object pose estimation.
{'timestamp': '2021-12-14T02:30:39', 'yymm': '2111', 'arxiv_id': '2111.07597', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07597'}
arxiv
\subsection{Lemmas and Proofs} \label{sec:omitted_proofs} \setcounter{lemma}{0} \setcounter{theorem}{0} \begin{lemma} Let $X\sim p_X(x)$ and $Y\sim p_{Y}(y|x)$ be the channel input and output, respectively. Let $D(\cdot)$ be a positive function. If $\mathcal{J}_{\gamma}(D)$, $\gamma>0$, is a value function defined as \begin{align} \mathcal{J}_{\gamma}(D) = \; & \gamma \cdot \mathbb{E}_{(x,y) \sim p_{XY}(x,y)}\biggl[\log \biggl(D\bigl(x,y\bigr)\biggr)\biggr] \nonumber \\ & + \mathbb{E}_{(x,y) \sim p_{X}(x)p_{Y}(y)}\biggl[- D^{\gamma}\bigl(x,y\bigr)\biggr], \end{align} then \begin{equation} I(X;Y) \geq \tilde{I}_{\gamma DIME}(X;Y) = \mathcal{J}_{\gamma}(D^*)+1, \end{equation} where \begin{equation} D^*(x,y) = \biggl(\frac{p_{XY}(x,y)}{p_{X}(x)\cdot p_Y(y)}\biggr)^{1/\gamma} = \arg \max_D \mathcal{J}_{\gamma}(D). \end{equation} \end{lemma} \begin{proof} Consider a scaled generator $f(u) = \frac{u}{\gamma}\log u$ and for simplicity of notation, denote $p_{XY}$ and $p_Xp_Y$ with $p$ and $q$, respectively. Then \begin{equation} D_{KL}(p||q) = \gamma \int_{x}{q(x) \frac{p(x)}{\gamma q(x)}\log\biggl(\frac{p(x)}{q(x)}\biggr) \diff x}, \end{equation} and the conjugate $f^*(t)$, with $t \in \mathbb{R}$, is given by \begin{equation} f^*(t) = \frac{e^{\gamma t -1}}{\gamma}. \end{equation} Substituting in \eqref{eq:f_bound} yields to \begin{equation} D_{KL}(p||q) \geq \sup_{T\in \mathbb{R}} \biggl\{ \gamma \mathbb{E}_{x \sim p(x)} \bigl[T(x)\bigr]-\mathbb{E}_{x\sim q(x)}\bigl[e^{\gamma T(x)-1} \bigr]\biggr\}. \end{equation} Using \eqref{eq:optimal_ratio} it is easy to verify that the optimal value of $T$ is the log-likelihood ratio rather than the density ratio. Indeed, \begin{equation} T^*(x) = \frac{1}{\gamma}\log\biggl(\frac{p(x)}{q(x)}\biggr) + \frac{1}{\gamma}. \end{equation} Finally, with the change of variable $T(x)=\log(D(x))+1/{\gamma}$, the optimal discriminator has form \begin{equation} D^*(x) = \biggl(\frac{p(x)}{q(x)}\biggr)^{1/\gamma} \end{equation} and { \small \begin{equation} D_{KL}(p||q) \geq 1 + \sup_{D\in \mathbb{R}_+} \gamma \mathbb{E}_{x \sim p(x)} \bigl[\log \bigl( D(x) \bigr) \bigr] \nonumber \\ -\mathbb{E}_{x\sim q(x)}\bigl[D^{\gamma}(x) \bigr]. \end{equation} } Denoting the two terms inside the supremum with $J_{\gamma}(D)$ and replacing $p$ and $q$ with the joint and marginal distributions, concludes the proof. \end{proof} \section{Capacity-driven Autoencoders} \label{sec:autoencoders} Any communication system consists of three main blocks: the transmitter, the channel, and the receiver. The baseband transmitter maps a message $s\in \mathcal{M} = \{1,2,\dots,M\}$ into $n$ complex symbols $x \in \mathbb{C}^n$. The symbols are transmitted over the channel at a rate $R = \log_2(M)/n$ (bits per channel use), typically under a power constraint. The channel introduces impairments and modifies $x$ into a distorted and noisy version $y$. The task of the receiver is to produce an estimate $\hat{s}$ of the original $s$ from the channel output $y$. The idea proposed in \cite{Oshea2017} is to consider the full communication chain as an autoencoder, a single deep neural network optimized in an end-to-end fashion. The encoder component $F(s;\theta_E)$ acts as a symbol modulator and maps $s$ into the channel input $x$; it is represented by a neural network of parameters $\theta_E$. The channel is implemented with a set of layers that attempts to approximate the conditional transition probability $p_Y(y|x)$. For complex channel models, the generator of GANs \cite{Goodfellow2014, Oshea2018, Righini2019, Letizia2019a} mimics the channel block with a pre-trained stochastic neural network $y = H(x;\theta_H)$ and allows back-propagated gradients. The decoder block $G(y;\theta_D)$ acts as a demodulator and maps the received samples into the estimate of $\hat{s}$ and the associated a posteriori probability $p_{\hat{S}|Y}$; it consists of a neural network of parameters $\theta_D$ with a softmax layer as output. During the training process, the autoencoder parameters $(\theta_E,\theta_D)$ are jointly updated in order to minimize the categorical cross-entropy loss function \begin{equation} \mathcal{L}(\theta_E,\theta_D) = \mathbb{E}_{(x,y)\sim p_{XY}(x,y)}\biggl[-\log\bigl(p_{\hat{S}|Y}(\hat{s}|y;\theta_D)\bigr)\biggr]. \end{equation} The decoder performs a classification task as it tries to estimate the transmitted message among $M$ possibilities. However, the cross-entropy loss function is prone to overfitting issues \cite{Zhang2017} and it does not guarantee any optimality in the code and constellation design. In \cite{Letizia2021}, a twofold solution to mitigate such issues was proposed. Indeed, the label smoothing regularization technique was used to penalize confident estimations and improve the autoencoder generalization ability. To tackle the optimality issue, it was proposed to use a mutual information regularizer term computed between the channel input and output samples. Therein, it has been shown that both regularizers can be viewed as entropy penalty regularizers. The latter, in particular, was introduced to ultimately target the channel capacity. The overall proposed loss function reads as follows \begin{align} \label{eq:loss_function} \hat{\mathcal{L}}(\theta_E, \theta_D) = \; & \mathbb{E}_{(s,y)\sim \hat{p}_{\hat{S}|Y}(\hat{s}|y)\cdot p_{Y}(y|x)}\biggl[-\log\bigl(p_{\hat{S}|Y}(\hat{s}|y;\theta_D)\bigr)\biggr] \nonumber \\ & -\beta I(X;Y), \end{align} where $\hat{p}_{\hat{S}|Y}(\hat{s}|y)=(1-\epsilon)\delta_{\hat{S},S}+\epsilon u(\hat{s})$ is the smoothed target distribution, with $u(\hat{s}) = 1/M$ and $\beta, \epsilon$ are positive regularization parameters. From \eqref{eq:loss_function} it is interesting to notice that in each training iteration, the mutual information back-propagated gradient influences the encoder parameters (thus, the channel input distribution) and the energy of such gradient depends on $\beta$. The cross-entropy gradient, instead, guides both encoder and decoder towards invertible latent representations (in the limit of the channel distortion). Ideally in the non-parametric limit, a minimization of \eqref{eq:loss_function} corresponds to a maximization of the mutual information, thus, to channel capacity for a memory-less channel \begin{equation} C =\max_{p_X(x)} I(X;Y), \end{equation} where the channel input distribution $p_X(x)$ is subject to given power constraints. Hence, it is clear that an accurate and stable estimation of the mutual information $I(X;Y)$ is instrumental for the design of optimal channel coding and end-to-end communication schemes. Recently, deep neural networks have been leveraged to maximize variational lower bounds on the mutual information \cite{Nguyen2010,Mine2018, Poole2019a, LetiziaNIPS}. In particular, the use of discriminative variational lower bounds offer a promising methodology as they attempt to directly estimate the density ratio in \eqref{eq:density_ratio}. \section{Conclusions} \label{sec:conclusions} In this paper, we presented $f$-DIME, a set of novel mutual information estimators based on the $f$-divergence. When $f$ is the function generator of the KL divergence, we obtained as a special case $\gamma$-DIME, a parametric estimator that can be used both for mutual information estimation and design of optimal channel coding. We integrated $\gamma$-DIME as the mutual information regularization term inside the autoencoder loss function. A comparison in terms of estimation accuracy and BLER was done with MINE, an established neural mutual information estimator. Results show the advantage of adopting $\gamma$-DIME over MINE for the autoencoder end-to-end training especially when the aim is to estimate the achieved information rate. \section{Introduction} \label{sec:introduction} Recent advancements in machine learning for communications have fostered the design of systems with a data-driven paradigm. As a consequence, physical layer design has been reinterpreted using machine learning techniques to improve the coding and decoding scheme performance \cite{Oshea2017, Nachmani2018, Dorner2018, Alberge2019, Stark2019}. In particular, the work in \cite{Oshea2017} introduced the concept of autoencoder-based communication systems. In contrast to traditional bottom-up approaches, the encoder and decoder blocks can be jointly learned during the end-to-end autoencoder training phase \cite{Oshea2017}. The autoencoder is a deep neural network that maps a sequence of input bits $\mathbf{s}$ into a sequence of output bits $\hat{\mathbf{s}}$. The input sequence is generally transformed into data symbols $x$ that are then fed into an intermediate channel layer (or network), which introduces constraints, distortions and uncertainties. Given the intermediate channel model, the autoencoder is typically trained by minimizing the cross-entropy loss function, so that it essentially performs a classification task. However, it is known that training a classifier via cross-entropy often suffers from overfitting issues, especially for large networks \cite{Zhang2017}. Moreover, autoencoders for communications shall consider the channel capacity during the learning process in order to produce optimal channel input samples (latent codes). In this direction, the work in \cite{Letizia2021} proposed to use a mutual information regularizer to control and estimate the amount of information stored in the latent representation. In addition, it proposed to use label smoothing to improve the network decoding ability. In \cite{Letizia2021}, the mutual information was computed with the neural estimator MINE \cite{Mine2018} by inserting an appropriate block in the autoencoder architecture. MINE was also exploited in \cite{Wunder2019} to study optimal coding schemes when no channel model is attainable. Nevertheless, MINE suffers from high bias and variance. Thus, new mutual information estimators have been recently proposed to subvert such limitations \cite{Song2020, Poole2019a, LetiziaNIPS}. Among them, a promising approach is given by the discriminative mutual information estimator (DIME) \cite{LetiziaNIPS}, a neural network that directly estimates the density ratio \begin{equation} \label{eq:density_ratio} R(\mathbf{x},\mathbf{y}) = \frac{p_{XY}(\mathbf{x},\mathbf{y})}{p_X(\mathbf{x})\cdot p_Y(\mathbf{y})} \end{equation} instead of the individual densities in \eqref{eq:density_ratio}. Concurrently, it is expected that novel and optimal channel coding techniques based on mutual information learning, estimation and maximization can significantly impact the development of beyond 5G communication technologies. In this paper, inspired by the DIME estimator and the $f$-GAN training objectives \cite{Nowozin2016}, we firstly propose a new family of estimators referred to as $f$-DIME. We secondly propose $\gamma$-DIME, a family of estimators that can be used in the end-to-end autoencoder training process to target the channel capacity. We then include the developed estimators in the capacity-driven autoencoder proposed in \cite{Letizia2021} and evaluate their performance in terms of block-error-rate (BLER) and accuracy of the mutual information estimation w.r.t. to MINE. The rest of the paper is organized as follows. Section \ref{sec:autoencoders} revisits the autoencoder-based communication systems and discusses the major advantages of using a mutual information regularization term in the loss function. Section \ref{sec:theory} reviews some variational lower bounds on the mutual information and the related estimators. Section \ref{sec:f-DIME} presents a new set of discriminative estimators. Section \ref{sec:results} compares the estimators and illustrates the results. Finally, conclusions are reported. \section{Results} \label{sec:results} In the experimental results, we consider the transmission of $M$ messages at rate $R$ over an AWGN channel, for which we know the channel capacity under an average power constraint. The choice of AWGN channel shall not be seen as a limitation since the formulation transcends the channel characteristics. Moreover, it provides a reference curve for the validation of the estimators and it allows comparisons across several application domains \cite{Mine2018, LetiziaNIPS}. We describe two scenarios: a) the transmission at a rate $R>1$ and short code-length $n$ and b) the transmission at a low rate with larger code-length. For both scenarios, we train a rate-driven autoencoder (see \cite{Letizia2021}) and compare its performance for different estimators in terms of BLER and accuracy of the mutual information estimation. For all the experiments and as a proof of concept, we use simple encoder, decoder and neural mutual information estimator architectures. In particular, the encoder is a shallow neural network with $M$ neurons in the input layer, $M$ in the hidden one and $2n$ neurons at the output while the decoder is its complementary. The discriminative estimator possesses instead a fixed architecture, a two layer multilayer perceptron neural network of $200$ neurons in each layer and LeakyReLU with a negative slope coefficient of $0.2$ as activation function. The only difference in the estimators resides in the final layer where we use a linear dense layer for MINE, while a softplus layer for the DIME based estimators, defined as \begin{equation} D^*(x,y; \theta) = \log(1+\exp(W^*_L \cdot z_{L-1}+b^*_L)), \end{equation} where $W$ and $b$ are weights and biases, respectively, $z$ is the output of the previous layer and $L$ is the number of layers of the network. \begin{figure} \centering \includegraphics[scale=0.245]{pics/ber_all_2} \caption{Comparison of the BLER obtained by the autoencoder AE($3,9$) and AE($6,3$) with an AWGN intermediate layer, using different estimators with $\beta = 0.2$, $\epsilon = 0.2$.} \label{fig:ber_all} \end{figure} The training of the autoencoder was conducted at a fixed $E_b/N_0$ ratio of $7$ dB. We minimized the loss function alternating encoder and decoder weights update with the discriminator weights update. The number of iterations was set to $10$k with a learning rate of $0.01$ for both the components. For more implementation details, we refer to the code publicly available. \footnote{\url{https://github.com/tonellolab/capacity-approaching-autoencoders}} The first scenario describes a digital transmission scheme with input alphabet size $M=64$ over $3$ channel uses. We denote such system as AE($6,3$) since $k = \log_2(M)$. The communication rate is $R=2$. Fig.~\ref{fig:ber_all} shows the autoencoder performance in terms of BLER for different estimators. From the curves we can infer that the $\gamma$-DIME estimator with $\gamma=1$ provides improved performance in terms of BLER compared to both MINE and other values of $\gamma$. The result of Fig.~\ref{fig:MI_6_6} is insightful: the $\gamma$-DIME estimators provide stable estimations also at high SNRs where it is expected that the mutual information saturates to the information rate $R=2$. Thus, the DIME based estimators are more accurate compared to the divergent MINE (see theorem 2 of \cite{Song2020}). It is also interesting to notice that the concavity of $J_{\gamma}$ (shown in Fig.~\ref{fig:gammaDIME}) influences the mutual information estimation as it appears in the results. Indeed, for low values of $\gamma$, fixed learning rate and training iterations, the estimators are trained by moving on the flat curves of Fig.~\ref{fig:gammaDIME}, which is equivalent as using a small learning rate to upgrade the gradients. For completeness and to show the advantage of the proposed estimators under fading, we report in Fig.~\ref{fig:MI_6_6_Ray} the achieved estimated information rate with Rayleigh fading. Also in this case, MINE diverges for high SNR values while the DIME based estimators are much more accurate and tend to saturate to the rate $R=2$. \begin{figure} \centering \includegraphics[scale=0.245]{pics/MI_6_6_2} \caption{Comparison of different mutual information estimators for the autoencoder AE($6,3$) with $\beta = 0.2$, $\epsilon = 0.2$ on the AWGN channel.} \label{fig:MI_6_6} \end{figure} \begin{figure} \centering \includegraphics[scale=0.245]{pics/MI_6_6_Ray_2} \caption{Comparison of different mutual information estimators for the autoencoder AE($6,3$) with $\beta = 0.2$, $\epsilon = 0.2$ on the Rayleigh fading channel.} \label{fig:MI_6_6_Ray} \end{figure} The second scenario describes a digital transmission scheme with input alphabet size $M=8$ over $9$ channel uses. We denote such system as AE($3,9$). The communication rate is $R=1/3$. Fig.~\ref{fig:ber_all} shows that MINE and $\gamma$-DIME with $\gamma=1$ have similar performance in terms BLER under the same training iterations. However, Fig.~\ref{fig:MI_3_18} highlights the fact that even for a low alphabet dimension and for relatively small $n$, the DIME-based estimators are more accurate than MINE since they tend to saturate to $R=1/3$ while MINE overestimates the mutual information. We can conclude that despite MINE being a tighter bound on the mutual information compared to $\gamma$-DIME, the latter and in particular the estimator with $\gamma=1$ performs much better than MINE in terms of mutual information estimation. We leave comments about the architecture to use for future studies, although we remark that it is one of the main aspects in modern machine learning applications and therefore we expect significant improvements. \begin{figure} \centering \includegraphics[scale=0.245]{pics/MI_3_18_2} \caption{Comparison of the achieved information rate using different mutual information estimators for the autoencoder AE($3,9$) with $\beta = 0.2$, $\epsilon = 0.2$ on the AWGN channel.} \label{fig:MI_3_18} \end{figure} \section{Discriminative Mutual Information Estimators} \label{sec:theory} The mutual information $I(X;Y)$ quantifies the statistical dependence between two random variables, $X$ and $Y$, by measuring the amount of information of $X$ via observation of $Y$. Unlike the correlation, the mutual information measures linear and non-linear associations \cite{Letizia2020} since its estimation requires the knowledge of three distributions \begin{equation} I(X;Y) = \mathbb{E}_{(x,y)\sim p_{XY}(x,y)}\biggl[\log\frac{p_{XY}(x,y)}{p_X(x)p_Y(y)}\biggr], \end{equation} where $p_X(x)$ and $p_Y(y)$ are the distributions of $X$ and $Y$, respectively, and $p_{XY}(x,y)$ is the joint probability distribution. The presence of these three components renders the mutual information estimation a challenging task and several approaches have been proposed to tackle the problem. Standard and traditional approaches rely on binning, density and kernel estimation \cite{Moon1995} and $k$-nearest neighbours \cite{Kraskov2004}. However, for applications such as channel coding, high-dimensional data is often involved and classic approaches fail to scale. Moreover, they can not easily be integrated in an optimization framework that targets the channel capacity. To overcome such limitations, neural networks can be used to obtain a parametric representations of the variational lower bounds on the mutual information, where the objective of the network is to estimate the density ratio. One of the first examples of neural estimators is MINE \cite{Mine2018}. The idea behind MINE is to exploit the Donsker-Varadhan dual representation of the Kullback-Leibler (KL) divergence to produce the bound to optimize \begin{align} \label{eq:MINE} I(X;Y) \geq & I_{MINE}(X;Y) \nonumber \\ = & \sup_{\theta \in \Theta} \mathbb{E}_{(x,y)\sim p_{XY}(x,y)}[T_{\theta}(x,y)] \nonumber \\ & - \log(\mathbb{E}_{(x,y)\sim p_X(x) p_Y(y)}[e^{T_{\theta}(x,y)}]), \end{align} where $\theta \in \Theta$ parameterizes a family of functions $T_{\theta} : \mathcal{X}\times \mathcal{Y} \to \mathbb{R}$ via a deep neural network. MINE is a biased estimator, consequently, the authors suggested to replace the expectation in the denominator of the gradient with an exponential moving average. However, MINE suffers from high-variance estimations and a recent solution named SMILE \cite{Song2020} tries to alleviate such issue by clipping the density ratio between $-e^{-\tau}$ and $e^{\tau}$, with $\tau \geq 0$. SMILE is equivalent to MINE in the limit $\tau \rightarrow +\infty$. A mutual information unbiased variational lower bound that relies on the $f$-divergence representation was proposed in \cite{Nguyen2010} \begin{align} \label{eq:NWJ} I(X;Y) \geq & I_{NWJ}(X;Y) \nonumber \\ = & \sup_{\theta \in \Theta} \mathbb{E}_{(x,y)\sim p_{XY}(x,y)}[T_{\theta}(x,y)] \nonumber \\ & -\mathbb{E}_{(x,y)\sim p_X(x) p_Y(y)}[e^{T_{\theta}(x,y)-1}]. \end{align} where it is easy to verify that $I_{NWJ}\leq I_{MINE}$. In \cite{LetiziaNIPS}, the discriminative mutual information estimator (DIME) was proposed. It is a neural estimator that mimics the task of the discriminator in GANs \cite{Goodfellow2014}. Indeed, the optimal discriminator in the GAN or $f$-GAN framework can be used either as a direct or indirect mutual information estimator when it is fed with paired and unpaired input data of distribution $p_{XY}$ and $p_X p_Y$, respectively. We refer to as direct estimator, the one where the optimal discriminator $D^*$ is proportional to the density ratio in \eqref{eq:density_ratio}. An example is the d-DIME estimator, a mutual information variational lower bound that reads as follows \begin{equation} \label{eq:d_DIME} I(X;Y) \geq \tilde{I}_{dDIME}(X;Y) = \frac{\mathcal{J}_{\alpha}(D^*)}{\alpha}+1-\log(\alpha), \end{equation} where $\mathcal{J}_{\alpha}(D)$, $\alpha>0$, is a value function defined as \begin{align} \mathcal{J}_{\alpha}(D) = \; & \alpha \cdot \mathbb{E}_{(x,y) \sim p_{XY}(x,y)}\biggl[\log \biggl(D\bigl(x,y\bigr)\biggr)\biggr] \nonumber \\ & +\mathbb{E}_{(x,y) \sim p_{X}(x)p_{Y}(y)}\biggl[-D\bigl(x,y\bigr)\biggr], \label{eq:discriminator_function} \end{align} and \begin{equation} \label{eq:optimal_discriminator_2} D^*(x,y) = \alpha \cdot \frac{p_{XY}(x,y)}{p_{X}(x)\cdot p_Y(y)} = \arg \max_D \mathcal{J}_{\alpha}(D). \end{equation} Notice that when the positive function $D(\cdot)$ is parameterized by a neural network, the NWJ estimator can be thought as a special case of d-DIME with $\alpha=1$ and $T_{\theta}(x,y) = \log(D_{\theta}(x,y))+1$. In the following section we extend DIME, in particular, we introduce $f$-DIME, a discriminative mutual information estimator based on the $f$-divergence measure. \section{$f$-DIME} \label{sec:f-DIME} In this section, we describe a general methodology to estimate the mutual information by applying the variational representation of $f$-divergence functionals $D_f(P||Q)$. In detail, if the measures $P$ and $Q$ are absolutely continuous w.r.t. $\diff x$ and possess densities $p$ and $q$, then the $f$-divergence reads as follows \begin{equation} D_f(P||Q) = \int_{\mathcal{X}}{q(x)f\biggl(\frac{p(x)}{q(x)}\biggr)\diff x}, \end{equation} where $\mathcal{X}$ is a compact domain and the function $f:\mathbb{R}_+ \to \mathbb{R}$ is convex, lower semicontinuous and satisfies $f(1)=0$. Under these conditions, the authors of \cite{Nguyen2010} (and \cite{Nowozin2016} for the $f$-GAN) exploited the Fenchel convex duality to derive a lower bound on $D_f$ \begin{equation} \label{eq:f_bound} D_f(P||Q) \geq \sup_{T\in \mathbb{R}} \biggl\{ \mathbb{E}_{x \sim p(x)} \bigl[T(x)\bigr]-\mathbb{E}_{x\sim q(x)}\bigl[f^*\bigl(T(x)\bigr)\bigr]\biggr\}, \end{equation} where $T: \mathcal{X} \to \mathbb{R}$ and $f^*$ is the Fenchel conjugate of $f$ defined as \begin{equation} f^*(t) := \sup_{u\in \mathbb{R}} \{ ut -f(u)\}. \end{equation} Therein, it was shown that the bound in \eqref{eq:f_bound} is tight for optimal values of $T(x)$ and it takes the following form \begin{equation} \label{eq:optimal_ratio} T^*(x) = f^{\prime} \biggl(\frac{p(x)}{q(x)}\biggr), \end{equation} where $f^{\prime}$ is the derivative of $f$. To create a novel neural estimator based on the representation in \eqref{eq:f_bound}, we firstly substitute the mutual information $I(X;Y)$ with its KL divergence representation \begin{equation} I(X;Y) = D_{KL}(p_{XY}||p_X p_Y), \end{equation} and by defining \begin{align} \mathcal{J}_{f}(T) = \; & \mathbb{E}_{(x,y) \sim p_{XY}(x,y)}\bigl[T\bigl(x,y\bigr)\bigr] \nonumber \\ & -\mathbb{E}_{(x,y) \sim p_{X}(x)p_{Y}(y)}\bigl[f^*\bigl(T\bigl(x,y\bigr)\bigr)\bigr], \label{eq:value_function_f} \end{align} we propose to parametrize $T(x,y)$ with a deep neural network $T_{\theta}$ of parameters $\theta$ and solve with gradient ascent and back-propagation \begin{equation} \theta^* = \arg \max_{\theta} \mathcal{J}_f(T_{\theta}). \end{equation} The main idea is the following: \textit{it is possible to exploit the relation \eqref{eq:optimal_ratio} to estimate the mutual information}. Indeed, if the derivative of $f$ is invertible, \begin{equation} \bigl(f^{\prime}\bigr)^{-1}\bigl(T_{\theta^*}(x,y)\bigr) = \frac{p_{XY}(x,y)}{p_X(x)p_Y(y)}, \end{equation} thus, having access to $T_{\theta^*}$ and using the density ratio estimated above, we obtain $f$-DIME as \begin{equation} \label{eq:f_dime} I_{fDIME}(X;Y) = \mathbb{E}_{(x,y) \sim p_{XY}(x,y)}\biggl[ \log \biggl(\bigl(f^{\prime}\bigr)^{-1}\bigl(T_{\theta^{*}}(x,y)\bigr) \biggr) \biggr]. \end{equation} We argue that any value function $\mathcal{J}_f$ of the form in \eqref{eq:value_function_f}, seen as dual representation of a certain $f$-divergence $D_f$, can be maximized to estimate the mutual information using \eqref{eq:f_dime}. As a notable example, the GAN-based i-DIME estimator in \cite{LetiziaNIPS} can be derived using $f$-DIME with generator \begin{equation} f(u) = u\log u-(u+1)\log(u+1)+\log4 \end{equation} and $T(x)=\log(D(x))$. However, only a subset of $\mathcal{J}_f$ can be used inside the capacity-driven autoencoder loss function since a maximization of the mutual information is also required. In particular, only the generator $f$ of the KL divergence is suitable for the mutual information maximization, since in such case \begin{equation} \max_{p_X(x)} D_f = \max_{p_X(x)} D_{KL} = \max_{p_X(x)} I(X;Y). \end{equation} The generator function of the KL divergence is $f(u) = u\log u$ with conjugate $f^*(t) = e^{t-1}$. It easy to notice that such choice of $f$ coincides with the NWJ estimator or d-DIME when $T(x) = \log(D(x))$ and $\alpha=1$ (see \eqref{eq:d_DIME}). Nevertheless, as shown in \cite{LSGAN}, the value function plays a fundamental role during the training process of a discriminator. Consequently, we combined the approach described for the derivation of $f$-DIME with d-DIME to obtain a family of lower bounds on the mutual information that may result in more robust estimators according to specific case studies. \begin{lemma} \label{lemma:Lemma1} Let $X\sim p_X(x)$ and $Y\sim p_{Y}(y|x)$ be the channel input and output, respectively. Let $D(\cdot)$ be a positive function. If $\mathcal{J}_{\gamma}(D)$, $\gamma>0$, is a value function defined as \begin{align} \mathcal{J}_{\gamma}(D) = \; & \gamma \cdot \mathbb{E}_{(x,y) \sim p_{XY}(x,y)}\biggl[\log \biggl(D\bigl(x,y\bigr)\biggr)\biggr] \nonumber \\ & + \mathbb{E}_{(x,y) \sim p_{X}(x)p_{Y}(y)}\biggl[- D^{\gamma}\bigl(x,y\bigr)\biggr], \end{align} then \begin{equation} I(X;Y) \geq \tilde{I}_{\gamma DIME}(X;Y) = \mathcal{J}_{\gamma}(D^*)+1, \end{equation} where \begin{equation} \label{eq:optimal_discriminator_gamma} D^*(x,y) = \biggl(\frac{p_{XY}(x,y)}{p_{X}(x)\cdot p_Y(y)}\biggr)^{1/\gamma} = \arg \max_D \mathcal{J}_{\gamma}(D). \end{equation} \end{lemma} \begin{comment} \begin{proof} Consider a scaled generator $f(u) = \frac{u}{\gamma}\log u$ and for simplicity of notation, denote $p_{XY}$ and $p_Xp_Y$ with $p$ and $q$, respectively. Then \begin{equation} D_{KL}(p||q) = \gamma \int_{x}{q(x) \frac{p(x)}{\gamma q(x)}\log\biggl(\frac{p(x)}{q(x)}\biggr) \diff x}, \end{equation} with conjugate $f^*(t)$, with $t \in \mathbb{R}$ given by \begin{equation} f^*(t) = \frac{e^{\gamma t -1}}{\gamma}. \end{equation} Substituting in \eqref{eq:f_bound} yields to \begin{equation} D_{KL}(p||q) \geq \gamma \sup_{T\in \mathbb{R}} \biggl\{ \mathbb{E}_{x \sim p(x)} \bigl[T(x)\bigr]-\frac{1}{\gamma}\mathbb{E}_{x\sim q(x)}\bigl[e^{\gamma T(x)-1} \bigr]\biggr\}. \end{equation} Using \eqref{eq:optimal_ratio} it is easy to verify that the optimal value of $T$ is the log-likelihood ratio rather than the density ratio itself. Indeed, \begin{equation} T^*(x) = \frac{1}{\gamma}\log\biggl(\frac{p(x)}{q(x)}\biggr) + \frac{1}{\gamma}. \end{equation} Finally, with the change of variable $T(x)=\log(D(x))+1/{\gamma}$, the optimal discriminator has form \begin{equation} D^*(x) = \biggl(\frac{p(x)}{q(x)}\biggr)^{1/\gamma} \end{equation} and \begin{align} D_{KL}(p||q) \geq \; & \sup_{D\in \mathbb{R}_+} \biggl\{ \gamma \mathbb{E}_{x \sim p(x)} \bigl[\log \bigl( D(x) \bigr) \bigr] \nonumber \\ & -\mathbb{E}_{x\sim q(x)}\bigl[D^{\gamma}(x) \bigr]\biggr\} + 1. \end{align} Denoting the two terms inside the supremum with $J_{\gamma}(D)$ and replacing $p$ and $q$ with the joint and marginal distributions, concludes the proof. \end{proof} \end{comment} \begin{figure} \centering \includegraphics[scale = 0.255]{pics/gammaDIME} \caption{Behaviour of the functional $J_{\gamma}$ varying the parameter $\gamma$. Concavity of the neighbourhood of the maximal value depends on $\gamma$.} \label{fig:gammaDIME} \end{figure} Fig.~\ref{fig:gammaDIME} illustrates how the value function in \eqref{eq:value_function_f} (divided by $\gamma$) behaves according to the choice of the positive parameter $\gamma$. The position of the maximum depends on the density ratio as described in \eqref{eq:optimal_discriminator_gamma} ($R = 1$ in the figure). The role of $\gamma$ is to modify the concavity of the value function to improve the convergence rate of the gradient ascent algorithm. Moreover, when $D$ is parameterized by a neural network, the choice of the learning rate and activation functions may be related with $\gamma$. Indeed, notice that $\gamma$-DIME can also be derived from d-DIME using the substitution $D(x,y) \rightarrow D^{\gamma}(x,y)$.
{'timestamp': '2021-11-16T02:28:29', 'yymm': '2111', 'arxiv_id': '2111.07606', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07606'}
arxiv
\section{Introduction} Pop music is a genre developed over the last $80$ years, fusing disparate influences into a genre with its own unique lyrical characteristics, based on the goal of mass appeal \cite{frith_straw_street_2001}. Pop lyrics are often created by professional pop songwriting teams collaborating in groups to workshop individual lines until the outcome is as universal, engaging, and ``catchy" as possible \cite{bennett2012constraint}. This environment presents a unique challenge for artificial intelligence based lyric generation, requiring a system which can match the lyrical style and content of a verse in-progress while incorporating constraints given by multiple collaborators. Collaborative text generation models have been explored before, with many providing avenues for users to enrich the generated text with extra examples and seed text \cite{10.1145/2939672.2939679}. More specifically, lyric generation has been explored, with many models replicating whole verses and song fragments in more lyrically dense styles like hip hop \cite{nikolov2020conditional}, but these systems have not yet been adapted to the unique constraints of the pop genre and the use cases of collaborative pop songwriters. In this paper we present a collaborative line-level lyric generation system to aid pop songwriters in the rapid generation and refinement of memorable verses. Our system relies on transfer learning, utilizing the T5 transformer to generate lines given a variety of constraints and stylistic settings. We worked with a group of professional songwriters to identify core functionalities and constraints that our model would need to address to participate in their collaborative work setting. This setting is unique within the field of lyric generation and collaboration, as it necessitates the repeated generation of lines with different levels of contexts, meter constraints, and rhyme patterns. A full demo of the system is available online.\footnote{https://tinyurl.com/yywsy456} By training a model to assist professional song writers and evaluating it against genuine pop lyrics, we hope to provide insight into how state-of-the-art models can be leveraged to accommodate the dynamic demands of human collaborators, how creative AI can be built and customized for interaction, and how transfer learning can be used to apply broader knowledge in fields with limited data. This paper contains a technical overview of our generation system, as well as an analysis of the major constraints of pop lyric generalization. We analyze the data collection, augmentation, and modeling techniques needed to train a dynamic model to address these constraints, and evaluate our models ability to aid songwriters in their creative process and generate lines which match the style and content of the pop genre. \section{Related Work} Artificial or model-based lyric generation is a field that intersects several academic areas such as linguistics, musicology, computational creativity, deep learning for natural language processing, just to name a few. At a fundamental level, our task is that natural language generation, a diverse field which has advanced swiftly in recent years with the advent of recurrent neural networks (RNNs) \cite{vinyals2015show,jozefowicz2016exploring}, general adverserial networks (GANs) \cite{guo2018long}, and long short-term memory (LSTMs) \cite{zhang2017adversarial}. The Transformer model introduced recently \cite{vaswani2017attention} is highly successful at natural language tasks when applied through a variety of approaches including auto-encoder models, BERT \cite{devlin2018bert}, auto-regressive models, GPT-2 \cite{radford2019language}, sequence-to-sequence models, and BART \cite{lewis2019bart}. Despite this broad scope of model architectures and use cases, we found that there were no existing models which applied natural language processing techniques to line-level pop lyric generation. The most relevant tasks which have been thoroughly researched are rap verse generation \cite{savery2020shimon} and poetry generation. In the field of hip hop lyric generation, rhyme is often a focus. One group finds rhyming lines by querying for rhyming words across a vast database of rap song lyrics and picking the most semantically similar line that contains said rhyming word \cite{10.1145/2939672.2939679}. Their approach achieves high rhyme score (or density) results but does not actually generate new lyrics; instead, they find the most suitable next line from their database. Another approach uses a probabilistic model approach that mimics the Blocks Substitution Matrix (BLOSUM) protein homology alignment algorithms to detect rhymes in rap music \cite{hirjeebrown}. While yielding a high rhyme density performance, this method required the explicit creation of a dataset that labeled pairs of rhyming words. Previous approaches, including the ones listed above, make use of either phonemicization libraries like eSpeak \footnote{http://espeak.sourceforge.net/} or Festival \footnote{https://www.cstr.ed.ac.uk/projects/festival/} or self-made linguistics rules to phonemize words and handle pronunciation of slang and words that don’t exist in common English vocabulary. The generation of lyrics has also been considered from a more example-based approach by addressing the problem of rap lyric generation through a statistical machine translation (SMT) model \cite{wu2013learning}. A unique standout of this method is the lack of a use of a priori linguistic or phoneme constraints. Using transformer models, \cite{nikolov2020conditional} provides a baseline for conditional rap music generation from text as well as augmentation to existing rap lyrics. While rap lyric systems give us an idea of how to approach rhyme density, they differ greatly from pop lyrics in style, themes, and vocabulary. Poetry is a much broader area which includes more established constraints in meter and syllabic placement while often addressing the sort of themes from which pop lyrics are derived. LSTMs have been used for quatrain generation in sonnets and replicate Shakespearean meter yet cannot match emotion and readability found in human work \cite{lau2018deep}. Chinese poetry generation has seen significant development from RNNs by introducing a combination of a recurrent context model and a recurrent generation model to grasp thematic context over multiple sentences \cite{zhang2014chinese}. Although most of these approaches satisfy coherence and poetic constraints, there is difficulty in generating longer form poetry with meaning. Given that contemporary music does not follow perfect rhyme constraints, there is a need to understand the classification of “slant” or “near” rhymes. Previous work presents a methodology, from inspection of human rhyme data, for determining whether two sequences of phonemes are near rhymes \cite{ghazvininejad2016generating}. We adopt a known modification for the aforementioned approach \cite{riedl2020weird} as the revised algorithm accounts for rhyme when expressed vocally, detracting from the strict text-based approach of the former. \section{System Overview} In the following section we present, ``Say What?", a novel transformer-based architecture to aid human songwriters at line-level pop lyric generation. Our core challenge is to use given inputs from a group of users to generate a predicted line, which continues the verse in as human-like way as possible by extending the content, lyrical style, and genre conventions of the input verse. Using feedback we received from a group of songwriters, we identify three additional tasks for the project: \begin{enumerate} \item Outputs should rhyme \item Outputs should reflect specified syllable constraints \item Users should have the option to specify ending words \end{enumerate} \subsection{Dataset Collection} Data collection proved challenging as there is no pre-defined list of pop artists that can be used to outline a dataset. Thus, we approximate the ``pop" genre by filtering artists based on their success or popularity, taking into account that the genre does not necessarily encompass every song that becomes popular. We quantify popularity through the Billboard Hot 100 chart, a standard medium for tracking sales and streams of songs played in the United States. Artists for all weeks from $1958$ - $2017$ were collected and sorted by amount of appearances on chart. The top $25$ songs from each of the top $200$ artists were considered, and their respective lyrics were scraped from Genius - a website for lyric aggregation and annotation. While this approach does include some songs that do not quite fit the structure of pop music stylistically, classifying songs through an objective metric is preferred to a subjective judgement regarding the definition of ``pop". \subsection{Pre-processing} After scraping the data, we performed several filtering operations. We first removed songs that were not written in English to ensure consistency with the rhyming pronunciation format we used. To filter out choruses and refrains which are shorter and more repetitive, we deleted consecutive lines with a similarity of over $0.70$ as determined by the python \code{difflib SequenceMatcher} package, short verses (less than $50$ characters long), and verses with less than $6$ lines. Shorter verses were filtered out at a cutoff of $6$ lines in order to be able to generate at least one usable 1-5 line training example from each verse. As pop songs often have repetitive elements, with the same lyrics occurring in successive verses or repeated choruses, we split the train and test sets by song to ensure all the training examples generated from one song would go to the same set. In this manner we avoid evaluating the model on lyrics it may have seen before. \subsection{Rhyme and Phoneme Mappings} We use the International Phonetic Alphabet (IPA) phoneme representation for word pronunciation, converting each word into its IPA format (using the \code{festival}\footnote{https://www.cstr.ed.ac.uk/projects/festival/} and \code{espeak} \footnote{http://espeak.sourceforge.net/} modules) and save it in a dictionary cache. This allows for quick phoneme comparison between words, giving us the capability to identify rhymes. To account for regional dialect distinctions and for near rhyme we designate a set of phonemes and ending suffixes that are “near” to each other, allowing us to capture cases of near rhyme. Near rhymes occur when last syllables of two words are nearly identical, for example the words ``doing” and ``ruin” are both considered near rhymes of each other despite the former’s ‘NG’ ending in IPA when phonemized. To determine whether two sequences of phonemes are near rhymes we use the methodology presented by \cite{ghazvininejad2016generating}. We adopt a known modification for the aforementioned approach \cite{riedl2020weird} as the revised algorithm accounts for rhyme when expressed vocally, detracting from the strict text-based approach of the former. \subsection{Model Inputs} Our training and test datasets were formatted to match the example use cases given to us by the songwriters (see Figure \ref{fig:songwriterusecase}). \begin{figure}[h] \includegraphics[width=1\linewidth]{images/Songwriters_Use_Case.png} \caption{Example use cases given by songwriters} \label{fig:songwriterusecase} \end{figure} The given examples provided the model with a small number of lines, as input to generate suggestions to continue the verse. Notably, these input lines did not always start at the beginning of a verse, and the model was not expected to finish the verse or provide transitions between verses. To match this functionality, we iterate over verses in our dataset, creating a set of an input lines for each target line and then cutting the length of input lines randomly so that each example has somewhere from $1$ to $4$ input lines and exactly one target line. \subsection{T5 Transformer Model} After considering several state of the art transformer models, we decided to use the T5 model published in 2020 by Google \cite{raffel2019exploring}. The T5 model was structured and trained with the intention of leveraging its pre-training knowledge to the widest range of text-to-text tasks possible. The authors opted for an encoder-decoder transformer based design, trained on a variant of the Common Crawl corpus named the Colossal Common Crawl Corpus (or C4 for short). The T5 shows a remarkable ability to tackle many different tasks with one multitask model. It can also perform tasks not commonly approached as text-to-text problems like generating Semantic Textual Similarity (STS) Benchmark scores, generating the numerical response character by character. The T5 is an especially good fit for our task because of the dynamic nature of current and future feature requests by the songwriters. As we analyzed early outputs and writers' requests, the T5 multitask functionality allowed us to incorporate different types of knowledge and accommodate different constraints. We utilize the base size of the pretrained T5 model (220 million parameters), finetuning for 12 thousand additional steps. Our models were trained with a learning rate of 0.003, with a batch size of 128, and a maximum input/output length of 128. \subsection{Control Model} Figure \ref{fig:modelinputs} shows our model inputs. As a final prepossessing step, we separate lines in the input set using \code{"[LINE]"} tokens in order to indicate the divisions in lines to the model. Informed by previous work we add a \code{"finish lines:"} tag to the beginning of the example in preparation for training additional tasks in the future \cite{raffel2019exploring}. Each training example contains 1-4 lines from the verse as the inputs and the following line as the target. \begin{figure}[h] \includegraphics[width=1\linewidth]{images/Control_Model_Example.png} \caption{Model input format} \label{fig:modelinputs} \end{figure} With this data format, we train a model to be used as a baseline for our comparisons, henceforth referred to as the Control model. This model produced promising outputs especially with regards to grammatical, contextual, and stylistic quality of generated lyrics. However, when analyzing results with feedback from the songwriters we found the model fell short in its ability to rhyme and respond to user input. Specifically, the model was not able to take specified syllable count and ending word requirements necessary for pop lyric structure. \subsection{Rhymes} Less than a quarter of our dataset (exactly $17.3\%$) is composed of rhyming lyrics. In order to generate rhyming outputs, we create a new dataset by filtering out all non-rhyming lines and including a \code{[RHYME]} tag before each line-ending word which rhymed with the last word of the target. An example is shown in Figure \ref{fig:rhymetagexample}. This tag allows the model to associate rhyming words and gain intuition about rhyme. \begin{figure}[!ht] \includegraphics[width=1\linewidth]{images/rhymetagexample.png} \caption{A modified input line including our ``[RHYME]” tag} \label{fig:rhymetagexample} \end{figure} \begin{figure}[!ht] \includegraphics[width=1\linewidth]{images/Rhyme_List_Example.png} \caption{A rhyme list example} \label{fig:rhymelistexample} \end{figure} Additionally, we use our pre-built rhyme dictionary to generate a new dataset to be included in a supplementary task we call \textbf{rhyme list}. This task consists of $20,000$ training examples formatted as a list of $5$ rhyming words (separated by \code{[RHYME]} tokens) with one rhyming word as the target (see Figure \ref{fig:rhymelistexample}). These lists provide the model with additional examples of rhyming words to associate. \subsection{Syllables} To address the songwriter group's request to control for syllable count, we append the syllabic length of the target line as a numerical input preceded by a \code{syllable count:} tag as shown in Figure \ref{fig:syllabletagexample}. This tag enables the T5 architecture to map the given syllable count to the desired syllable count of the line. \begin{figure}[!ht] \centering \includegraphics[width=1\linewidth]{images/syllabletagexample.png} \caption{A modified input line with our ``syllable count" tag} \label{fig:syllabletagexample} \end{figure} \begin{figure}[!ht] \includegraphics[width=1\linewidth]{images/endingwordtagexample.png} \caption{A modified input line with our ``ending word" tag} \label{fig:endingwordtagexample} \end{figure} \subsection{Ending Words} To address the songwriters' third requirement - generating line endings with specific words - a new dataset was created. Mimicking previous methods \cite{kumar2020data}, we append the ending word of the target preceded by the phrase ``\code{ending word:}" to the input as shown in Figure \ref{fig:endingwordtagexample}. The given phrase acts as a label for the expected ending word, helping the model learn to generate lines which end with specific words. \subsection{Combined Model} After addressing each problem individually, we created a combined dataset to accommodate different combinations of rhyme, syllable, and end word constraints. To provide the model with consistent inputs, we append the syllable count tag on every example. The trivial case where syllable count is not required is handled by feeding in a count derived from the input lines. Given the limited supply of rhyming data, it is undesirable to overlap rhyming examples with the end word tags, as if a model is given the desired end word, it is not being required to generate a rhyming word on its own. Therefore we split the data into two sets: rhyme and no rhyme. \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/Combined_pre_flow_chart_times.png} \caption{The process for creating the combined dataset including rhyme (R), syllable (S), and ending word (E) tags} \label{fig:combinedmodelflowchart} \end{figure} The rhyming set is annotated with \code{[RHYME]} tags and the no rhyme set is formatted with \code{ending word:} specifications. The ending rhyme set is cut to match the size of the rhyming set to balance the data. Subsequently, we orient the two datasets as separate tasks in the T5 model, adding different task tags to the beginning of each example: \code{finish lines rhyme:} or \code{finish lines ending:}. Batches from each task are set to load equally often. This mixture is used in the Combined model. A flowchart of the model combining process is shown in Figure \ref{fig:combinedmodelflowchart}. A final model, referred to as the Combined List model, is trained with an additional third task: the rhyme list task described above in the Rhymes section. \subsection{Genre Dataset} Although the main dataset uses the Billboard Hot $100$ to approximate the pop genre, we also created an altered version of the dataset by replacing artists we subjectively deemed unrepresentative of the pop genre with those fitting our intended lyrical style. The resulting dataset shared $67$ of its $200$ artists in common with the regular Billboard dataset, and was pre-processed the same way. Hereon we refer to this new data as the Genre dataset. \subsection{Demo} An interactive application was developed and provided for a group of songwriters for evaluation. The application utilized our Combined model, allowing users to provide input lines and constraints. If no constraints were specified, inputs were fed into the rhyme task of the Combined model, using rhyme detection to annotate words which rhymed with the last word given with a \code{[RHYME]} token. The application also allowed users to force a rhyme, feeding in words from the near rhyme dictionary to the ending word task. For each query we found the top $8$ rhymes as sorted by the words' frequency in our dataset. This provided a list of rhyming words common in pop lyrics, rather than a set of random rhyming words. The users could also specify syllable count and end word if they chose. For each query the application generated multiple possible outputs for users to chose from. \section{Metrics Results} In the following section we analyze the performance of each of our models. We are particularly interested to see the extent to which each of our techniques has improved functionality in its target area. The following models listed below in Figure \ref{fig:modeldescriptions} were trained and used for this comparison: \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/Model_description_table.png} \caption{Descriptions of models trained} \label{fig:modeldescriptions} \end{figure} To quantify our model’s ability to generate authentic and semantically meaningful lyrics, we test our outputs based on three major categories: grammatical and syntactic sense, lexical similarity to our inputs, and artistic quality of our outputs. Our decision to do so, and the specific metrics we chose were based off previous literature surrounding the assessment of machine-generated text \cite{syntheticliterature,statisticalfeatures}, the musical qualities common to pop music like rhyme \cite{metricaltechniquesrap}, as well as features related to comments made by songwriters we had spoken with before adding syllable count and end word accuracy. We used BLEU score to measure how similar our outputs were in relation to our training data to capture our models' abilities to create lyrics of human-written quality. \cite{papineni2002bleu}. To measure lexical similarity between our predictions and our targets, we took the difference between the two to ascertain if our inputs were not significantly less (or more) verbose than our inputs; conceivably, we assumed, if the last line of a verse had a wider range of vocabulary than the rest of the verse, it would be a clear indication of machine-generated lyrics. Finally, we evaluate the categories specified by the songwriters; namely, the ability to rhyme, match a syllable requirement, and to end a line with a specifically inputted word. \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/Alternate_Table.png} \caption{Results across all our models} \label{fig:bigresultstable} \end{figure} \subsection{BLEU} \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/BLEU.png} \caption{BLEU scores for the Control, Combined, and Combined List models} \label{fig:bleuscores} \end{figure} As it has been a standard for assessing the quality of machine-generated text and has seen use in a variety of transformer-based text generation tasks, we opt to use BLEU score as an assessment of the similarity of our model outputs’ with the actual lyrics, which are used as targets \cite{bleuscoreusemachinetranslation,bertusesbleu}. Additionally, the use of the BLEU score provides us with a metric to compare the quality of our various models. As seen in Figure \ref{fig:bleuscores}, the Combined and Combined List models achieve similar performance at $14.35$ and $14.28$, respectively. Lyric generation is an open ended task, and we are asking our model to generate a relatively unconstrained line when given a small amount of context. Given such a broad task, achieving a BLEU score of $14$ is impressive despite being much lower than scores achieved by state-of-the-art models in more constrained tasks such as machine translation; for example a transformer based architecture for conditional rap lyric generation achieved a BLEU score of $14.3$ among the best models \cite{nikolov2020conditional}. The Control model performed significantly worse with a score of $5.065$. The key difference here is the size of the datasets. As the combined datasets were filtered to have an even number of rhyme and non-rhyme examples, the respective models were more focused and able to replicate the targets (the original song lyrics) more accurately. This reflects a general principle of transfer learning: that fine-tuning on too much data can be detrimental to a model's performance \cite{ayub2020cognitively}. \subsection{Lexical Diversity} The Lexical Diversity Root Mean Squared Error (RMSE) calculates the RMSE for the Type Token Ratio difference between predictions and targets. Among the different input data/models, all had differences in the range of $0.15$ to $0.2$. The Genre Combined List data had the greatest difference in prediction/targets with an RMSE of $0.197$ and the Ending Word model had the least difference with an RMSE of $0.155$. Over many iterations the lexical diversity RMSE is minimized as the T5 moves from arbitrary generation to matching the style and lexicon of the given lines. It is important to note that given our relatively small input data, the model is able to use the context and style of the inputs to infer the amount of lexical diversity to use in its generated output. \subsection{Rhyme Score} \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/Rhyme_Score.png} \caption{Rhyme scores for the Control, Combined, and Combined List models} \label{fig:rhymescores} \end{figure} Rhyme Score is a metric to quantify how often our models were exhibiting an end-word rhyme pattern. The metric is calculated as the percentage of the predicted lines which end with a word that rhymes with one or more of the end words of the input lines. Rhyme detection is done following the methods specified in \cite{riedl2020weird} to compare whether two words are near rhymes. The Control model was not able achieve a rhyme score of more than $.0745$ due to the lack of rhyming examples in its training data. When the dataset was filtered and \code{[RHYME]} tags were added, the resulting model (Rhyme) was able to increase in score by $297\%$, achieving a final score of $0.296$. When the ending word examples were added in the creation of the Combined model, the proportion of rhyming inputs decreased to $50\%$, but the model was still able to achieve a high rhyme score of $0.2614$. Finally, the inclusion of the rhyme list task boosted this score by $19.4\%$, achieving our best overall performance for the Rhyme Score metric: $0.3122$ with the Combined List model. The progression is visualized in Figure \ref{fig:rhymescores}. \subsection{Line Syllable Score} The Syllable RMSE calculates the difference in syllable counts between the predictions and targets. Every model exhibited an RMSE below $1.5$ syllables with the standard dataset performing marginally better (lower RMSE) than the Genre data (see Figure \ref{fig:bigresultstable}). When demoing for the songwriters we found that an error of one or two syllables was acceptable because lyrics can easily be adjusted by contracting or expanding common words. Even when we enforced our syllable requirement as a hard constraint, the model was almost always able to generate the correct syllable count within the first $5$ generations. Figure \ref{fig:syllableoutputexample} demonstrates the model's ability to match a broad range of syllable requirements despite unchanging inputs. \begin{figure}[h] \centering \includegraphics[width=1\linewidth]{images/syllable_example.png} \caption{Model outputs when given 5, 10, and 15 syllable count tags for the same input} \label{fig:syllableoutputexample} \end{figure} \subsection{End Word Accuracy} The End Word Accuracy calculates the ratio of ending words matching between each line of predictions and each line of targets. All of the models excelled for our songwriting purposes, displaying accuracies greater than $0.97$ in matching ending words of predictions and targets (see Figure \ref{fig:bigresultstable}). Note in Figure \ref{fig:endwordoutputexamples} that the generated lines integrate the context of the input lines with the ending word, leading each line to a natural conclusion. \begin{figure}[h] \centering \includegraphics[width=\linewidth]{images/endwordoutputexamples.png} \caption{Model outputs when given three different ending word tags for the same input} \label{fig:endwordoutputexamples} \end{figure} \subsection{Genre Dataset} When compared to the standard models trained with the Billboard dataset, the Genre Combined and Genre Combined List models trained using our hand-picked pop genre dataset performed comparably in all areas except BLEU Score where it outperformed its counterparts by $23.9\%$, achieving a BLEU Score of $17.21$. This increased performance suggests that when given a dataset which conforms more strictly to the lyrical style of the pop genre, our model is able to match the desired targets closely. \subsection{Model Conclusions} The best models were the Combined List and Genre Combined List models as they achieve high BLEU scores while also scoring comparably if not better than other models in Lexical Diversity, Rhyme Score, and End Word Accuracy. Both models perform the three tasks the songwriter specified, namely both satisfy rhyming, syllable, and end-word functionality without significantly sacrificing performance in any of those categories when compared to the task specific models tailored for the aforementioned functions. Thus the results show that we were able to successfully combine all three of the functionalities without sacrificing performance in any meaningful way in our metrics. \section{Human Evaluations} In addition to analyzing quantitative measures of success, we gathered qualitative assessments of our model and its ability to produce human-like lyrics. We performed an online study using Amazon’s Mechanical Turk (MTurk) as well as conducted interviews with songwriters to receive feedback on the usability and quality of our model. \subsection{Mechanical Turk Online Study} The MTurk study included $67$ participants residing in the United States and India from the ages of $26$ - $75$. Of these $67$ participants, $4$ were eliminated for not passing an attention check. The remaining 63 participants were asked to answer a variety of questions ranking the quality of the following 3 models: Combined List, Genre Combined List, and Control. It is important to note that the participants are not domain experts in songwriting nor potential users of the system, but rather a representation of future listeners who will experience the outputs generated by the system. The study is intended to evaluate the quality of outputs provided and to assess whether generated lyrics are distinguishable from actual lyrics to the common listener, the audience pop music is specifically designed for. The participants were first asked to rank outputs based on grammatical fit, stylistic fit, rhyme, and logical coherence. A second set of questions, in the style of a Turing Test, asked participants to predict the real line between a model output and the original (human) ending line of each provided verse. Although a Turing style format is not ideal for a creative task of lyric generation, the test is useful in combination with the aforementioned quantitative metrics. Analysis of the results is discussed below, excluding cases where participants indicated they recognized the provided verse. For the first set of questions, the Combined List model was ranked the highest for all the categories and the Control model the lowest (refer to Figure \ref{fig:modelrankings}). Conducting an ANOVA between the models exhibits the following p-values for the given categories: grammar ($p = 0.139$), style ($p = 0.002$), rhyme ($p < 0.001$), logic ($p = 0.0126$). There was no statistical difference in the rankings for grammar, but for style, rhyme and logic there were statistically significant differences in the generated outputs. These average rankings (displayed in Figure \ref{fig:modelrankings}) indicate that the lines generated by the Combined List model were superior in these three categories. \begin{figure}[h] \includegraphics[width=1\linewidth]{images/Ranking_Between_Models.png} \caption{Average ranking across grammar, style, rhyme, and logic} \label{fig:modelrankings} \end{figure} In asking participants to guess the real line, between model outputs and the actual line, the Combined List model and Genre Combined List were both chosen approximately $38\%$ of the time whereas the Control model was chosen $44\%$ of the time (refer to Figure \ref{fig:combinedturing}). Our architecture vastly outperforms previous results accomplished in hip-hop \cite{nikolov2020conditional} in the proportion of times participants were fooled. A pairwise t-test across the models, corrected by the Holm–Bonferroni method, yields p-values of $0.466$, $0.155$, $0.704$ for the Combined List, Genre Combined List, and Control models, respectively, when compared to the real lines. There is no significant difference between the models and the real lines. \begin{figure}[h] \includegraphics[width=1\linewidth]{images/Model_Outputs_vs_Real_Line.png} \caption{Turing Test style question results comparing model outputs to actual lines} \label{fig:combinedturing} \end{figure} \subsection{Songwriter Interviews} We interviewed three songwriters who had not been involved in the creation of the system aiming, to understand potential use cases for the lyric generator and to gather their thoughts on the system in an informal setting. We opted for longer, informal interviews in order to evaluate the songwriters experience as potential users of the system, a method which has shown past success \cite{savery2020shimon}. This also provided a contrast to the the shorter survey we performed with our MTurk participants, who represented the potential listeners. The participants were professional songwriters working in the US. We allowed each song writer to freely interact with a demo of the system that generated one line, based on a three line input, as well as a five line generation. In their interactions with the system two of the song writers started by instantly adding existing song lyrics to the system, to see how close the system came to the original lyrics. They then gradually changed these lyrics to see the effect, before adding new lyrics written on the spot or other preexisting lyrics. From these interviews several threads emerged. All three described the potential use of the system as an ``idea bank", that they would try many times for a lyric and filter through the results. They could also all imagine using the system to help further develop ideas and expand their own work. The sophistication in rhymes was well-recognized, and especially the use of near rhymes such as ``mobile" and ``local"; one songwriter noted that the ability to rhyme was ``exceptional" and by the far the best feature of the system. One songwriter commented that the generations often took the form of ``It’s not quite this, but if I change this word it’ll be perfect", describing the system as someone you can ``shoot ideas off" for ``instant feedback". Between the three musicians there were several requests and ideas for improvement. A common thread amongst all three was a desire to be able to set the ``mood", ``style", ``genre", or ``tone" of writing from the system. All three also noted a desire to be able to change the rhyme patterns, from only rhyming the last word, to more sophisticated forms. One songwriter mentioned the desire to be able to choose which rhymes lined, such as each second, or more complicated structures such as the blues form. Two of the song writers noted that in its current form the system is ``not very good if you don’t have any ideas", and is a better tool if you come in with ideas to expand on. Overall all three writers enjoyed the functionality of the system as something to expand their own work. One songwriter noted that it fulfilled what they saw as the function of computers in their work: to assist and improve their process while not necessarily replacing it. Another songwriter echoed this idea, stating that if they were to use AI in their process they would request for lyrics reflecting their needs, and quickly ignore parts that they don’t like. All three writers requested access after the interview to continue using the system. \section{Discussion and Conclusion} We built ``Say What?", a tool for line-level lyric generation in the collaborative atmosphere of pop songwriters. We approached this challenge as a line-level pop lyric generation transfer-learning task. To that end, we trained a transformer architecture to learn stylistic features of pop music by passing in pre-processed data. Multiple models were trained to learn these various tasks and evaluation was performed using pertinent genre metrics including rhyme density, consistency with expected syllable counts, and BLEU score. The results of our study reveal several takeaways. From a quantitative perspective, the ability of our Combined List models to integrate the functionalities of the three songwriter tasks without significantly sacrificing performance in any of our metrics reflects on the potential of combining tagging-based pre-processing strategies, and transformer-based architectures to solve lyric generation tasks. Qualitatively, the results of our MTurk study show that participants found our generated lyrics to be just as human-like and equally interesting as actual song lyrics suggesting that our line-level generation model is able to produce lyrics that are semantically meaningful and engaging, which are critical features to making successful pop music. Moreover interviews from the songwriters suggest new insights in lyricism, as a result of the models, that may not have been previously considered in developing their verses. We understand there exist limitations in our work, namely with the MTurk evaluation and usage of BLEU. Although all MTurk participants do not completely fit the audience for American pop music, given the presence of non-American participants, these members are still a valuable resource in understanding the effectiveness of the models. Another limitation lies in the brevity penalty of BLEU score calculations which uses length values averaged through the entire corpus. This leads to penalized scores for short lines like those in our training data that were shortened based on our syllable count pre-processing. Performing additional analysis using metrics like METEOR might allow us to better assess the quality of our lyrics. Future work in lyric generation using transformer-based approaches could be the addition of more sophisticated rhyme schemes or the inclusion of context variables like mood, tone, style as other tasks for our models to learn in addition to the ones discussed in this paper. Alternative areas to consider include a transfer-learning based approach in combination with tagging pre-processing strategies for lyric generation in other musical genres or for different creative tasks such as story generation. Because of the increased BLEU score of our Genre Combined List model (compared to the regular Billboard data), we suspect that additional work with creating a more consistent dataset of pop lyrics could result in an increase in performance by matching the pop genre more closely. The proposed approach to solving this issue is to perform a much larger scale survey asking participants to evaluate which artists they consider purely ``pop" to rectify the subjectivity in the Genre dataset. Furthermore, having an additional MTurk study for songwriters and other domain experts might allow us to gather more insight and make stronger conclusions about the quality and ranking of our models. We anticipate our architecture to generalizable to other genres given pop music's history and influences. ``Say What?" aims to facilitate meaningful and novel interactions between humans and AI and to create novel outcomes through the collaborations between them. We hope to use this tool to inspire songwriters through these experiences and hope to keep making improvements as we continue to dialogue with and receive feedback on our model. \bibliographystyle{ACM-Reference-Format}
{'timestamp': '2021-11-16T02:27:45', 'yymm': '2111', 'arxiv_id': '2111.07592', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07592'}
arxiv
\section{Introduction} Recent head reenactment methods~\cite{latentpose,ren2021pirenderer,firstorder} show impressive results on controlling a human head motion after trained with large-scale human talking head video datasets~\cite{chung2018voxceleb2,nagrani2017voxceleb}. The common approaches~\cite{fewadvneural,fastbilayer,firstorder,ren2021pirenderer} for this task is to learn diverse motion changes between two contiguous frames, which require a large amount of head videos to train a high-performing neural network model. Due to the dependency of human video datasets, such approaches show weak generalization capacity on the animation domain, because animation characters have distinct appearances (\textit{e.g.}, explicit lines and large eyes) compared to the human head ones. Our key contribution is to construct a large-scale animation head dataset, AnimeCeleb, for head reenactment, which deems as a data-centric solution to produce high-quality reenactment results on the animation domain. Obviously, a standard approach to build an animation dataset would be to collect the images from comic books and cartoon films. Instead, we propose a principled manner to construct animation dataset, where 3D animation models serve as valuable image samplers. This leads to three following benefits. First, we can ceaselessly simulate the specified pose\footnote{Throughout this paper, we mean by the 'pose' the information about head rotation, translation, and facial expression.} of a 3D animation model, enabling to generate an \textit{unlimited} number of multi-pose images of the same identity. Second, the simulated poses are easily obtainable as detailed pose vectors, where each dimension represents an individual semantic of an expression or a head angle. Lastly, a 3D vector graphics environment gives freedom to render the \textit{arbitrary} resolution images with various shaders (See Fig.~\ref{fig:teaser} horizontal axis). These strengths bring multiple use cases including the animation head reenactment and intuitive pose editing. Technically, our data creation process involves 3D animation model collection, semantic annotation and image rendering. In this process, we first collect the 3D animation models spanning a wide range of animation characters. The collected 3D models contain a set of morphs that can deform appearances of the 3D models in face and body part. To identify suitable morphs relevant to the head reenactment task, we develop an annotation system to filter the expression-irrelevant morphs. We employ Blender\footnote{https://www.blender.org/} that can execute codes for a head detection and a pose manipulation to enable an automatic image rendering. A great interest of an animation domain is to transfer a user's motion to the animation character, which is potentially applicable in a metaverse and a virtual avatar system. In this paper, we focus on transferring a user's pose to the animation character, and refer to this problem as a \textit{cross-domain head reenactment task}. A plausible solution to the task is building a shared pose representation space across the domains (\textit{i.e.}, human and animation). We use 3D morphable model (3DMM) parameters as the shared pose representation, which is widely used in recent numerous head reenactment studies~\cite{gafni2021dynamic,zhang2021facial,ren2021pirenderer,wang2021cross,guo2021ad}. 3DMM is a parametric face modeling method that provides powerful tools for describing human heads with semantic parameters. Since the AnimeCeleb pose vector is not compatible with 3DMM, we newly propose a \textit{pose-mapping} method to transform an AnimeCeleb pose vector to 3DMM parameters. To be specific, we compute a set of distinct 3DMM parameters to describe the semantics that the AnimeCeleb includes, and combine it to obtain 3DMM parameters corresponding to a AnimeCeleb pose vector. Owing to the pose mapping, we can guarantee that both the AnimeCeleb and VoxCeleb~\cite{nagrani2017voxceleb}, a human head video dataset, share the pose representations. Furthermore, we propose a new architecture called an animation motion model (\emph{AniMo}\xspace), in which datasets from different domains are used to learn how to manipulate a head image according to the motion residing in the shared representations. In this manner, our model is capable of transferring a human head motion represented as 3DMM parameters to an animation head.\footnote{Related work regarding to the AnimeCeleb and the proposed algorithm is provided in supplementary material.} In summary, our contributions to animation research are as follows: \vspace{-0.1cm} \begin{itemize} \item We propose a \emph{novel data creation pipeline} and present a \emph{public large-scale animation head dataset} AnimeCeleb\xspace, which contains groups of high-quality images and their corresponding pose vectors. \item We newly propose a \textit{pose-mapping} method and a cross-domain head reenactment model \emph{AniMo}\xspace, which jointly lead to a seamless motion transfer from a \textbf{human head} to an \textbf{animations head}. \item We demonstrate the effectiveness of AnimeCeleb\xspace in training head reenactment baselines, and experimental results show the superiority of \emph{AniMo}\xspace on cross-domain head reenactment compared to state-of-the-art methods. \end{itemize} \section{Animation CelebHeads Dataset}\label{animeceleb} \vspace{-0.1cm} We first describe each step of the data creation of the AnimeCeleb in Section~\ref{data_generation_process}. Next, AnimeCeleb properties and statistics are given in Section~\ref{dataset_description}. In Section~\ref{animation_head_reenactment}, we show the animation head reenactment results on the AnimeCeleb and other animation datasets. \vspace{-0.3cm} \subsection{Data Creation Process}\label{data_generation_process} Fig.~\ref{fig:pipeline} depicts the overall process of the data creation pipeline. In the following, we provide details of each step from (A) to (D). \noindent\textbf{Data Collection (A).} We collected 3D animation models from two different web sites: DevianArt\footnote{https://www.deviantart.com/} and Niconi solid\footnote{https://3d.nicovideo.jp/}. Since all 3D animation models are copyrighted by their creators, we carefully confirmed the scope of rights and obtained permission from reachable authors. Finally, we acquired 3613 usable 3D animation models in total. We will release all 3D animation model \textit{artists' list} along with the AnimeCeleb to acknowledge the credits of the artists. The collected 3D animation models contain two essential components. The first component is the \textbf{morphs} that can alter appearances of a 3D animation model on face or body parts. We are able to change an individual morph's continuous value ranging from [0, 1], and obtain a transformed appearance of a 3D animation model; for example, an animation head with open mouth in 0.3 proportion can be generated. The second one is the \textbf{bones} that can control head angles (\textit{i.e.}, yaw, pitch and roll axes). In specific, the head angles are controlled by applying a rotation matrix to the neck bone. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-pipeline.pdf} \vspace{-0.65cm} \caption{\textbf{Dataset Creation Pipeline Overview.} 3D animation models are collected from two different websites (A). Then, a head part of the collected model are rendered after applying a morph with maximum intensity (B); these are then used for semantic annotation (C). In a data sampling step, sampled target morphs are used to compose pose vectors that serve as conditions to produce multi-pose images with diverse facial expressions and head rotations.} \vspace{-0.75cm} \label{fig:pipeline} \end{figure} \noindent\textbf{Image Rendering (B).} To achieve an automatic sampling using 3D animation models, we develop a 2D head image creation pipeline built on Blender: an open source 3D computer graphics software that supports the visualization, manipulation and rendering of 3D animation models. To successfully render the animation head images in Blender, we need to consider three aspects: (1) camera position, (2) light condition, and (3) image resolution. We set the camera position based on a neck bone position with the aim of capturing the head part. In respect to the light condition, we use a directional light point along the negative \textbf{y}-axis: frontal direction of an animation character (See Fig.~\ref{fig:pipeline} (B)). Before rendering, we set the resolution of the images as $256 \times 256$, which is a standard resolution used in previous head reenactment methods~\cite{firstorder,ren2021pirenderer}. Nonetheless, since the AnimeCeleb images are rendered from a 3D vector graphics model, we can create a higher image resolution (\textit{e.g.}, $1024 \times 1024$). To demonstrate its extensive usage, we present various generated samples under different conditions in the supplementary material. Note that the rendered images contain an alpha channel as a transparent background, which can separate the foreground animation character and the background. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-morph.pdf} \vspace{-0.7cm} \caption{(A) Visualizing target morphs' examples and head rotation. (B) The percentage of the number of source and target morphs on 3D animation models. The number of source morphs are widely distributed ranging from 0 to over 100, and most animation models have dense usable annotations (\textit{i.e.}, target morphs).} \vspace{-0.75cm} \label{fig:morph} \end{figure} \noindent\textbf{Semantic Annotation (C).} Each 3D animation model has a significantly different number of morphs ranging from zero to even over 100. However, a morph naming convention is different according to a creator, which makes it difficult to apply a standardized criterion before annotating an accurate semantic of an individual morph. A goal of the semantic annotation is to \textit{identify} expression-related morphs and \textit{annotate} the morphs according to the unified naming convention. Importantly, this allows to sample a properly functioning expression-related source morph from a 3D animation model during rendering. For example, when a morph \begin{CJK}{UTF8}{maru}あ\end{CJK} attached to a specific 3D animation model is identified as indicating a semantic of pronouncing the syllable \lq{ah}\rq\ with a mouth, then it can be annotated as the target morph (\textit{i.e.}, Mouth (A)). After annotation, that source morph \begin{CJK}{UTF8}{maru}あ\end{CJK} of the 3D model is used, when the target morph Mouth (A) is determined to control the mouth shape. To achieve the semantic annotation, we first define 23 \textit{target} morphs, these are deemed as meaningful semantics to represent the facial expressions. We select the target morphs out of candidates collaborated with animation experts who work with cartoon makers. Fig.~\ref{fig:morph} (A) shows the examples of the target morphs that include meaningful semantics for three parts: eyes, eyebrows, and a mouth. Conversely to the target morphs, we denote the original morphs as \textit{source} morphs in the remainder of this section. Next, we attempt to match the source morphs to the target morphs. Fortunately, a group of the source morphs with the identical name tends to portray the same semantics. Therefore, we take a two-stage approach: a group annotation and an individual inspection. The former collectively match a group of the source morphs under the same name to a target morph; the latter is responsible for inspecting the matched source morphs one-by-one to confirm whether it works correctly. During the group annotation, we count the number of source morphs that 3D models have, and remove the source morphs under 50. The individual inspection reduces the erroneous annotations that occur at the group annotation. For this, we first render the head images after applying the entire source morphs independently and a neutral image without applying any morph using a 3D animation model (Fig.~\ref{fig:pipeline} (C) upper part). Afterwards, we match a group of source morphs to one of the target morphs (\textit{i.e.}, group annotation) and correct the results in a single morph-level via comparing a neutral and a morph-applied image for each source morph (\textit{i.e.}, individual inspection). The entire procedure is conducted on the newly developed annotation system (Fig.~\ref{fig:pipeline} (C) lower part). We provide the details of the defined target morphs and annotation system in the supplementary material. \input{table/dataset} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-icartoonface.pdf} \vspace{-0.7cm} \caption{(A) Head reenactment results trained with the iCartoonFace that bear an identity leakage problem. (B) An intra-variation within the same identity of the iCartoonFace is extremely large. (C) Average inception score comparison on three datasets; the average scores using 1000 identities indicate that iCartoonFace contains relatively inconsistent styles within the identity than those of the VoxCeleb and the AnimeCeleb.} \vspace{-0.7cm} \label{fig:icartoonface} \end{figure} \noindent\textbf{Data Sampling (D).} Throughout the data sampling, randomly selected target morphs for each part (\textit{i.e.,} eyes, eyebrows and a mouth) are applied to a 3D animation model. The magnitudes of the morphs are determined by sampling from a uniform distribution, $\mathcal{U}(0,1)$, independently. In respect to the head rotation, a 3D rotation matrix is computed taking yaw, pitch and roll values sampled between -20$^{\circ}$ and 20$^{\circ}$. We render a transformed head after applying the morphs and the rotation, and also acquire a paired pose vector $\mathbf{p} \in \mathbb{R}^{20}$. A detailed description of the pose sampling process is provided in supplementary material. A real-time rendering engine that Blender provides is used to produce the manipulated images and paired pose vectors. During rendering, we utilize 4 different types of shaders as shown in Fig.~\ref{fig:pipeline} to provide diverse textured 2D images. Since the morphs and the head rotation are applied independently, two image groups: a group of frontalized images with expression (\textit{frontalized-expression}) and head rotated images with expression (\textit{rotated-expression}) are included in the AnimeCeleb. The number of images sampled from the 3D model are determined differently depending on the number of annotated target morphs that a 3D animation model has. When a 3D animation model contains more than five annotated target morphs, we generate 100 images; if not (\textit{e.g.}, zero), just 20 images are obtained. \subsection{Dataset Description}\label{dataset_description} \noindent\textbf{AnimeCeleb Properties.} Fig.~\ref{fig:morph} (A) shows the examples of multiple target morphs for each part and head rotation results. The target morphs consist of 9 eye-related morphs, 9 eyebrow-related morphs and 5 mouth-related morphs. Note that the pre-defined target morphs include the semantics related to both eyes or eyebrows, which fill two values (\textit{e.g.}, left and right eye) of a 17-dimensional pose vector (\textit{expression} part). In total, 3613 different 3D models are used to generate the AnimeCeleb. As can be seen in Fig.~\ref{fig:morph} (B) left, the number of source morphs of collected raw 3D animation models are widely distributed, averaging 49 morphs. After the semantic annotation, most animation models have more than 20 target morphs as shown in Fig.~\ref{fig:morph} (B) right; this indicates the source morphs are densely matched to the target morphs. \noindent\textbf{Comparison with Other Datasets.} As shown in Table~\ref{Table:dataset}, the AnimeCeleb has three advantages compared to the public existing animation head datasets~\cite{kaggleanimeface,danbooru2019Figures,zheng2020cartoon}. The advantages mainly stem from exploiting the power of 3D software and 3D animation models. First, detailed annotations such as facial expressions and head rotations can be easily gained because we are able to manipulate the head using our morph annotation (Table~\ref{Table:dataset} Attribute Anno.). Second, the AnimeCeleb provides a massive amount of animation images that have unified styles (Table~\ref{Table:dataset} Num. of Images, Unified Style). We believe that these properties help to develop high-performing neural networks in broad applications. Lastly, the AnimeCeleb contains four different unified styles in consideration of different cartoon textures. A similar approach~\cite{Khungurn:2021} has been proposed using 3D animation models to construct an animation face dataset, and achieve a promising results on head reenactment. The contribution of AnimeCeleb is the first publicly available dataset that contains animation faces with pose annotations as well as the data sampling pipeline. \subsection{Animation Head Reenactment}\label{animation_head_reenactment} \noindent\textbf{Overview.} The head reenactment aims to transfer a pose from a driving image to a source image. A common training scheme of the head reenactment model is to extract a pose from a driving image, and feed it with a source image to a decoder to reconstruct the driving image. Therefore, training a high-performing head reenactment model requires a large-scale video dataset, containing a set of the same identity images that can serve as a source and driving image pair. In a human domain, the VoxCeleb~\cite{nagrani2017voxceleb}, a large-scale talking head dataset, plays this role. We believe that the AnimeCeleb is analogous to the VoxCeleb in an animation domain, which bears a potential to train a high-performing animation head reenactment model. Prior head reenactment approaches are categorized into two groups whether a pre-computed pose annotation is utilized during training or not. The FOMM does not use the pose annotation, and learn relative motion between two images to convey the pose to a source image. In contrast, numerous studies~\cite{fewadvneural,ren2021pirenderer,fastbilayer} take advantage of the pose annotations such as keypoints and 3DMM parameters obtained from off-the-shelf pose extractors. Among them, we train two representative head reenactment baselines~\cite{firstorder,ren2021pirenderer} from each category with the AnimeCeleb: the FOMM~\cite{firstorder} and the PIRenderer~\cite{ren2021pirenderer}, which uses 3DMM parameters to describe a head pose. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-animeceleb.pdf} \vspace{-0.7cm} \caption{(A) Qualitative results of the FOMM and PIRenderer trained with the AnimeCeleb. (B) Intuitive editing of an animation head image with different pose vectors. (C) Filling in-between frames using linearly interpolated pose vectors.} \vspace{-0.3cm} \label{fig:baseline} \end{figure} \input{table/comparison_anime_baseline} \noindent\textbf{Experiment Setup.} When training the PIRenderer, we replace 3DMM with the pose vectors of the AnimeCeleb. For the dataset comparison, we additionally train the baselines~\cite{firstorder,ren2021pirenderer} using the iCartoonFace\cite{zheng2020cartoon}. Although there exist other animation head datasets \cite{kaggleanimeface,danbooru2019Figures}, we select the iCartoonFace as a comparison dataset, acknowledging the size of it and accurate identity labels. Furthermore, with the aim of pose annotation comparison, we train the PIRenderer leveraging the keypoints for both datasets. We utilize an off-the-shelf animation keypoint detector\footnote{https://github.com/hysts/anime-face-detector} that gives 28 keypoints of an animation head image. All implementations are conducted following the hyperparameters denoted the papers with 3319 train set and 294 test dataset created with the first shader style. We evaluate the trained models on (1) Self-identity task where the same character provides the source and driving image, and (2) Cross-identity task where two frames of different character sampled from the AnimeCeleb serve as the source and driving image. For evaluation, Frechet Inception Distance (FID)~\cite{heusel2017fid} and Structural Similarity (SSIM)~\cite{wang2004ssim} are adopted to measure the generated images quality. Note that the AnimeCeleb is applicable to other existing head reenactment models~\cite{fastbilayer,marionette,fewadvneural} that need image keypoints, yet we implement two representative baselines here. \noindent\textbf{Experimental Results with the iCartoonFace.} Fig.~\ref{fig:icartoonface} (A) shows the cross-identity head reenactment outputs of two models trained with the iCartoonFace. Despite the attempts to train the FOMM and PIRenderer with the iCartoonFace, we have found that the trained models show poor performance, producing blurry outputs. We assume that excessive variation within a single identity is the main cause of the results. In fact, considering that the iCartoonFace consists of the images collected from different appearance scenes, most images have own properties as seen in Fig.~\ref{fig:icartoonface} (B). For quantitative analysis, we measure the Inception Score (IS)~\cite{salimans2016improved} by averaging 1,000 image sets of the same identity. As seen in Fig.~\ref{fig:icartoonface} (C), we confirm that the iCartoonFace records higher IS score, compared to the VoxCeleb and the AnimeCeleb. This indicates that the iCartoonFace contains unacceptable appearance complexity, hence learning from such images goes beyond the capacity of existing head reenactment models. \noindent\textbf{Advantage of Pose Annotation.} As seen in Fig.~\ref{fig:baseline} (A), the FOMM trained with the AnimeCeleb produces plausible outputs, yet still has undesirable deformation. Different from it, the trained PIRenderers successfully preserve the source head structure while imitating a given driving image with both pose annotations (\textit{i.e.}, keypoints and pose vector). Especially, the PIRenderer(w/ pose vector) accurately conveys a driving pose to the source image as shown in Fig.~\ref{fig:baseline} (A) red boxes. It is because the AnimeCeleb pose vectors hold more direct guidance (\textit{e.g.}, 80\% mouth openness) than the keypoints. This results can be quantitatively confirmed in Table~\ref{Table:talkinghead}, where the PIRenderer(w/ pose vector) outperforms other baselines on both same-identity and cross-identity head reenactment tasks. Besides, the PIRenderer(w/ pose vector) is able to intuitively edit head poses based on given pose vectors (Fig.~\ref{fig:baseline} (B)) and generate the in-between frames by interpolating the pose vectors of two different frames (Fig.~\ref{fig:baseline} (C)). \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-out-domain.pdf} \vspace{-0.7cm} \caption{Head reenactment results on other animation datasets.} \vspace{-0.8cm} \label{fig:out-domain} \end{figure} \noindent\textbf{Other Animation Results.} We demonstrate the generalization capacity of the trained model on other animation datasets. In an experiment, we evaluate the PIRenderer(w/ pose vector) on different collected head datasets including Waifu Labs~\footnote{https://waifulabs.com/} and Naver Webtoons~\footnote{https://comic.naver.com/}. As seen in Fig.~\ref{fig:out-domain}, the model successfully transfer a given driving image pose to an animation head. We provide the details of the collected animation head datasets and additional results on other examples in supplementary material. \section{Cross-Domain Head Reenactment}\label{cdhr} \vspace{-0.1cm} \noindent\textbf{Overview.} Although we show a promising animation head reenactment result in Section \ref{animation_head_reenactment}, controlling characters' head pose as a human user wants (\textit{i.e.}, cross-domain head reenactment) is another important application that bears a potential to be used in a virtual YouTuber system and a cartoon production. In this section, we address the cross-domain head reenactment using the proposed pose mapping method and the \emph{AniMo}\xspace. In a standard head reenactment training scheme, two frames are sampled from a video: a source image $s$ and driving image $d$, and reconstruct $d$. Different from previous methods~\cite{firstorder,ren2021pirenderer}, we leverage two videos from different domains, respectively. Since a direct supervision across domains is not available during training, the source and driving image pair from animation domain: $s^{(a)}$, $d^{(a)}$ and human domain: $s^{(r)}$, $d^{(r)}$ are utilized to reconstruct the driving images, $d^{(a)}$ and $d^{(r)}$, respectively. In the following, we illustrate the details of a driving pose representation(Section~\ref{subsec:driving_motion_descriptor}). Then, we describe a training pipeline and its objective functions (Section~\ref{subsec:training_pipeline}). \noindent\textbf{Difference from PIRenderer.} Our architecture design is inspired by PIRenderer~\cite{ren2021pirenderer}, yet two novel components, a pose-mapping method and separate domain-specific networks, are proposed to improve cross-domain head reenactment performance. The pose-mapping method enables to align blendshape and 3DMM, which gives the capability to handle a pose from human domain (\textit{i.e.}, cross domain). Also, the domain-specific networks help to preserve a given source image’s textures for each domain, and improve the quality of image. Note that our pose-mapping method can help PIRenderer to improve the performance on cross-domain head reenactment task. \subsection{Driving Pose Representations}\label{subsec:driving_motion_descriptor} \noindent\textbf{Human Pose Representation.} Our approach employs the 3DMM parameters to describe a pose of a driving human head image. With the 3DMM, a 3D human face shape $\mathbf{S}$ can be represented as $\mathbf{S} = \bar{\mathbf{S}} + \alpha \mathbf{B}_{id} + \beta \mathbf{B}_{exp}$, where $\bar{\mathbf{S}}$ is the average face shape, $\mathbf{B}_{id}$ and $\mathbf{B}_{exp}$ denote the principal components of identity and expression based on 200 scans of human faces~\cite{blanz1999morphable}, respectively. Also, $\alpha \in \mathbb{R}^{80}$ and $\beta \in \mathbb{R}^{64}$ indicate the coefficients that control the relative magnitude between the facial shape and expression basis. The head rotation and translation are defined as $\mathbf{R} \in SO(3)$ and $\mathbf{t} \in \mathbb{R}^{3}$. We use a pre-trained 3D face reconstruction model~\cite{deng2019accurate} to extract the 3DMM parameters from the human head images. Discarding $\alpha$ for excluding an identity-related information, we only exploit a subset space of the 3DMM parameters $\mathcal{M}$ to represent a human head pose, where $\mathbf{m} \in \mathcal{M}$ comprises of expression coefficients, head rotation and translation: $\mathbf{m} \equiv \{\beta, \mathbf{R}, \mathbf{t}\} \in \mathbb{R}^{70}$. \noindent\textbf{Pose Mapping.} The AnimeCeleb pose vector $\mathbf{p} \in \mathbb{R}^{20}$ consists of independent coefficients $\mathbf{b} \in \mathcal{B}$ and head angles $\mathbf{h} \in \mathcal{H}$, where $\mathcal{B}$ denotes a 17-dimensional space of concatenated expression coefficient and $\mathcal{H}$ indicates a 3D head angle space. In this step, we aim at discovering a mapping relationship from the AnimeCeleb pose vector to the 3DMM parameters. To this end, we propose a pose mapping function: $\mathcal{T}: \mathcal{B} \times \mathcal{H} \rightarrow \mathcal{M}$, which is responsible to find its corresponding 3DMM parameters, given a pose vector. We construct a direct mapping relationship between the coefficients $\mathbf{b}$ and the 3DMM expression parameters $\beta$ using facial landmarks as a proxy space and expressing the each coefficient's semantics via manually manipulating the landmark positions. In the following, we elaborate the details step-by-step with Fig.~\ref{fig:model} (A). (T.0) Before the landmark manipulation, we first obtain an initial landmark position, which corresponds to a neutral 3DMM coefficient. To be specific, the initial landmark position is obtained from a rendered mesh with setting the entire 3DMM coefficients as $\mathbf{0}$ expressed as $\{\alpha_0,\beta_0,\mathbf{R}_0,\mathbf{t}_0\}$, meaning that the average face shape $\bar{\mathbf{S}}$ at center location offers the initial landmark position. (T.1) Next, the initial landmarks are manipulated according to each semantic; for example, \textit{left closed eye} landmarks can be achieved by minimizing the distances between the upper and the lower eyelid keypoints at the left eye. (T.2 and T.3) Then, the manipulated landmarks $l^k$ with $k$-th semantic are used to update the initial $\beta$ by minimizing the $\ell_2$ distance between $l^k$ and the landmarks extracted from the rendered mesh using $\beta$. Also, we employ a $\ell_2$ regularization during updating $\beta$. Completing this process for each landmark, we can gain the fitted 3DMM expression parameters for each semantic: $\Phi = \{\beta^{k}\}_{k=1}^{17} \in \mathbb{R}^{17 \times 64}$. Finally, the pose mapping function can be written as: $\mathbf{m}_{i} = \mathcal{T}(\mathbf{b}_{i}, \mathbf{h}_{i}) = (\mathbf{b}_{i}\cdot\Phi) \oplus \Pi(\mathbf{h}_{i}) \oplus \mathbf{0} \in \mathcal{M},$ where $\Pi$ denotes a mapping to convert a degree into radian measurement and $\oplus, i$ indicate a concatenation operation and a data index, respectively. In addition, $\mathbf{0} \in \mathbb{R}^{3}$ is concatenated to represent translation parameters. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-model.pdf} \vspace{-0.75cm} \caption{Overview of (A) pose mapping method and (B)-(D) \emph{AniMo}\xspace.} \vspace{-0.9cm} \label{fig:model} \end{figure} \subsection{Training Pipeline}\label{subsec:training_pipeline} Fig.~\ref{fig:model} depicts an overview of our framework, which consists of three networks described below. \noindent\textbf{Motion Network.} Given a driving pose $\mathbf{m}$, our motion network $F$ generates a latent pose code $\mathbf{z} \in \mathcal{Z}$, where $\mathcal{Z}$ denotes a latent pose space. Formally, this can be written as: $ \mathbf{z}^{(a)} = F(\mathbf{m}^{(a)}), \mathbf{z}^{(r)} = F(\mathbf{m}^{(r)}),$ where $\mathbf{m}^{(a)} = \mathcal{T}(\mathbf{b},\mathbf{h})$ is a transformed driving pose corresponding to the driving image $d^{(a)}$ in an animation domain and $\mathbf{m}^{(r)}$ denotes a subset of 3DMM paramters obtained from the driving image $d^{(r)}$ in a human domain, respectively. Thanks to the pose mapping method, the motion network $F$ can be designed as \textit{domain-agnostic} manner. The learned latent pose code $\mathbf{z}$ is transformed to estimate the affine parameters for adaptive instance normalization (AdaIN)~\cite{huang2017arbitrary} operations. The pose information parameterized as the affine parameters plays a role in predicting an optical flow in the warping network $W$ and injecting a fine-detailed pose in the editing network $G$. \noindent\textbf{Warping \& Editing Network.} For sake of simplicity, we omit the domain notation unless needed, such as $\mathbf{z}=\{\mathbf{z}^{(a)}, \mathbf{z}^{(r)}\}$, $d=\{d^{(a)},d^{(r)}\}$, and $s=\{s^{(a)},s^{(r)}\}$ in the descriptions of warping and editing network. Inspired by the PIRenderer~\cite{ren2021pirenderer}, we employ \textit{domain-specific} warping networks and an editing network for each domain. A warping network $W$ takes a source image $s$ and latent pose code $\mathbf{z}$ to predict the optical flow $\mathbf{u}$ that approximates the coordinate offsets to reposition a source head alike a driving head. Next, the source image is fed into an encoder part of a editing network $G$ and the optical flow $\mathbf{u}$ is applied to the intermediate multi-scale feature maps. This leads to spatial deformation of the feature maps according to the driving pose. During decoding in $G$, the AdaIN operation is used to inject the pose information. After training, the warping network mainly focuses on causing a large pose, including the head rotation, whereas the editing network serves to portrait an detailed expression-related pose. We train our framework with a reconstruction loss and a style loss following the PIRenderer~\cite{ren2021pirenderer}. The architecture, implementation details and objective functions are elaborated in the supplementary material. \input{table/comparison_cross_baseline} \vspace{-1.0em} \subsection{Experiments} \noindent\textbf{Experiment Setup.} Different from Section~\ref{animation_head_reenactment}, we use both cartoon texture shader style AnimeCeleb and the VoxCeleb\cite{nagrani2017voxceleb} as a training dataset. The VoxCeleb contains 22,496 talking-head videos collected from online videos, and we use downloadable 18,503 videos for the train set and 504 videos for test set. We evaluate the trained models on self-identity, and cross-domain head reenactment where the images of the AnimeCeleb and the VoxCeleb alternatively serve as a source and a driving image respectively. Similar to Section~\ref{animation_head_reenactment}, FID and SSIM are used to assess the quality of generated images. In addition, we introduce a Head Angle Error (HAE) that measures the $\ell_{1}$ distances between the driving image's head angles and those of the generated image with the aim of evaluating head rotating ability. To be specific, we take advantage of a pre-trained head angle regressor, based on ResNet-18~\cite{he2016deep} architecture and trained with the AnimeCeleb train set using $\ell_{1}$ distance objective function between a predicted angle and the ground-truth $\mathbf{h}$. In experiments, we use randomly sampled 1,000 pairs of source and driving images to compute evaluation metrics. \noindent\textbf{Comparison with State of the Art.}\label{subsec:baselines} We compare the the \emph{AniMo}\xspace with state-of-the-art models~\cite{latentpose,firstorder,ren2021pirenderer} quantitatively and qualitatively. Since we leverage two datasets during training, comparable baselines are trained on either the VoxCeleb following their original implementations or both the VoxCeleb and AnimeCeleb. During evaluation, we make an inference of manipulated animation or human head by optionally leveraging the decoder of each domain. We describe the details of the baselines and settings in the supplementary material. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{figure/figure-baselines.pdf} \vspace{-0.6cm} \caption{Qualitative comparison between our model and the baselines.} \vspace{-0.7cm} \label{fig:cross_baseline} \end{figure} Table~\ref{Table:cross_baseline} shows quantitative comparisons between the \emph{AniMo}\xspace and the baselines on the self-identity and the cross-domain head reenactment. When evaluating the self-identity head reenactment within the AnimeCeleb, it is obvious that the models trained on both the AnimeCeleb and the VoxCeleb surpass those trained on the VoxCeleb. On the contrary, quantitative results on self-identity head reenactment within the VoxCeleb demonstrate that joint datasets may be harmful to the reconstruction task. Unlike these results, our model outperforms all baselines on cross-domain head reenactment tasks in terms of an image quality and an imitating head pose, indicating the superiority of our model in transferring a pose across the domains. Fig.~\ref{fig:cross_baseline} shows qualitative comparisons between the \emph{AniMo}\xspace and the baselines on the cross-domain head reenactment. The FOMM, which relies on the unsupervised landmarks, does not work well, because the model attempts to align the appearance of the source image as the driving image's head structure, and this leads to the identity leakage problem as well as introducing blurring artifacts. In contrast, the PIRenderer and latent pose descriptor (LPD)~\cite{latentpose}, where the pose is injected by the AdaIN operations, successfully retain a head structure of the source image, yet produce rather blurry outputs. As seen in the PIRenderer+$\mathcal{T}$, the blurry artifacts can be improved by incorporating the AnimeCeleb as an additional training dataset with the pose mapping $\mathcal{T}$. Meanwhile, our model clearly outperforms the baselines, preserving more vivid textures of the source image and accurately reflecting the pose of the driving image with the aid of the domain-specific networks. We conclude that the shared pose space introduced by the pose mapping and the domain-specific design help the model to transfer the pose across domains. We include more results in the supplementary material. \section{Conclusions}~\label{conclusion} In this paper, we present the AnimeCeleb, a large-scale animation head dataset, which is a valuable and practical resource for developing animation head reenactment model. Departing from existing animation datasets, we utilize 3D animation models to construct our animation head dataset by simulating facial expressions and head rotation, resulting in neatly-organized animation head dataset with rich annotations. For this purpose, we built a semi-automatic data creation pipeline based on Blender and a semantics annotation tool. We believe that the AnimeCeleb would boost and contribute to animation-related research. On the other hand, we propose the pose mapping and architecture to address cross-domain head reenactment to admit transferring a given human head motion to an animation head. Conducted experiments demonstrate the effectiveness of the \emph{AniMo}\xspace on cross-domain head reenactment and intuitive image editing. In the future work, we plan to extend the AnimeCeleb and develop more advanced cross-domain head reenactment model. \noindent\textbf{Acknowledgements.} This work was supported by the Institute of Information \& communications Technology Planning \& Evaluation (IITP) grant funded by the Korean government(MSIT) (No. 2019-0-00075, Artificial Intelligence Graduate School Program(KAIST), No. 2021-0-01778, Development of human image synthesis and discrimination technology below the perceptual threshold), and the Air Force Research Laboratory, under agreement number FA2386-22-1-4024. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Finally, we thank all researchers at NAVER WEBTOON Corp. \section{Related Work}~\label{related_work} With abundance of digital contents, numerous animation datasets collected from different media are released to community. Focusing on animation head datasets, there exist multiple studies~\cite{kaggleanimeface,danbooru2019Figures,fujimoto2016manga109,rios2021daf,zheng2020cartoon} that provide the pre-processed animation heads. Based on these datasets, early animation-related research~\cite{qin2017faster,takayama2012face,zhang2020acfd} mainly focused on recognizing and detecting an animation character in animation scenes. However, an extension of animation research to generative modeling is non-trivial. One major bottleneck is that the released datasets are collected from unlisted online source, thereby containing unexpected and noisy images (\textit{e.g.}, an occluded head). In this regard, existing datasets are forced to narrow their application scope; for example, current animation datasets are not suitable to train \textit{head reenactment models}~\cite{latentpose,marionette,firstorder,onefreeview,fastbilayer,fewadvneural}. Head reenactment aims to drive a source image to mimic a motion of a target image while preserving identity of the source image. Most approaches~\cite{latentpose,marionette,firstorder,onefreeview,fastbilayer,fewadvneural} use two frames from the same video during training; an image conveys the identity-related information while the other provides the motion-related information, which are combined to produce a final output. Also, multiple pose representations (\textit{e.g.}, keypoints and 3DMM parameters) play vital roles to deliver the head motion in previous literature~\cite{marionette,ren2021pirenderer,fastbilayer,fewadvneural}. In fact, the pose representation is an important aspect for head reenactment approaches as shown in previous work~\cite{latentpose} when training a high-performing model. Undoubtedly, the collected animation images of current datasets~\cite{kaggleanimeface,danbooru2019Figures,fujimoto2016manga109,rios2021daf,zheng2020cartoon} do not include its detailed pose annotations, and obtaining accurate pose representations is also non-trivial. In opposition, AnimeCeleb provides numerous groups of images that have the same identity, and detailed pose annotations, which bear a potential to be used for various generation tasks. \section{Details of Data Creation Process}~\label{animeceleb_details} \vspace{-0.5cm} In this section, we present the details of the data creation process as follows: \begin{itemize} \item The visualizations of entire pre-defined target morphs that a single character has (Fig.~\ref{sup-fig:all-target-morphs}). \item Detailed user interfaces of the annotation system: statistics, group annotation, and individual inspection (Fig.~\ref{sup-fig:annotation_tool}) and mapping relationships between the source morphs and the target morphs after the annotation (Table~\ref{sup-table:mapping}). \item Detailed description of pose sampling process for generating a pose vector (Algo.~\ref{alg:pose_sampling}). \item Sampling examples from a 3D animation model (Fig.~\ref{sup-fig:sampling}). \end{itemize} \noindent\textbf{Visualizations of Target Morphs.}~\label{subsec:target_morphs} Fig.~\ref{sup-fig:all-target-morphs} shows the visualizations of the manipulated poses and their corresponding target morphs, which are responsible for annotating the source morphs. For head rotation and mouth annotation, there is a single value to control each semantic, respectively. On the other hand, for eyes and eyebrows annotation, we consider left and right part separately and define three different target morphs: left-related, right-related and both-related semantics. Note that although we have defined 23 target morphs including six morphs that control both parts (\textit{e.g.}, closed eyes and raised eyebrows), during constructing a pose vector, the both-related morphs simultaneously determine two values of the pose vector (\textit{i.e.}, left and right part). Therefore, the dimensions of a pose vector become 20 (=17+3) with three additional head angle dimensions. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-morph.pdf} \vspace{-0.7cm} \caption{Visualizations of all target morphs and 3D head angles. Given a neutral image (\textit{Top-left}), we apply every annotated target morph independently with the maximum intensity (\textit{i.e.}, 1.0) to obtain the morph-applied images. We highlight the locations, where manipulations occur with \textcolor{pink}{pink} arrows.} \vspace{-0.7cm} \label{sup-fig:all-target-morphs} \end{figure} \noindent\textbf{Semantic Annotation System.}~\label{subsec:annotation_system} Fig.~\ref{sup-fig:annotation_tool} shows the components of semantic annotation system developed with Vue.js~\footnote{https://vuejs.org/}. Given a group of neutral images and morph-applied images, our system aims at visualizing the images and the source morph names. Through the annotation, the source morphs are annotated as the target morphs, considering a semantic match. The system consists of three views: statistics, group annotation and individual inspection. In statistics view, there are the number of models and unique morph names that the models contain, and annotation progress shows the ratio of the annotated models to the total models. During annotation, we match the source morphs (\textit{e.g.}, 困る and なごみ) as their corresponding target morphs (\textit{e.g.}, lowered eyebrows and closed eyes) by considering given sample images as seen in the group annotation view of Fig.~\ref{sup-fig:annotation_tool}. Next, we manually check the validity of a single morph one-by-one by examining its corresponding morph-applied image as shown in individual inspection view of Fig.~\ref{sup-fig:annotation_tool}. If the morph-applied image has an unmatched semantic, we exclude that source morph marking it as X. We present the annotation results in Table~\ref{sup-table:mapping}. \noindent\textbf{Pose Sampling Process.}~\label{subsec:pose_sampling} Algorithm~\ref{alg:pose_sampling} depicts a detailed process for sampling a pose vector $\mathbf{p} \in \mathbb{R}^{20}$. Note that the annotated target morphs can be different depending on the 3D animation model. Given the annotated target morphs $\{e_{n}\}_{n=1}^{N}$, we first select a semantic of each part: eye $\text{s}_{eye}$, eyebrow $\text{s}_{eyebrow}$, and mouth $\text{s}_{mouth}$. For example, if there exist Mouth (A), Mouth (E) and Mouth (O) as mouth semantics, we randomly sample one of them as $\text{s}_{mouth}$. Similar to this, the pre-defined target morphs are randomly sampled for $\text{s}_{eye}$ and $\text{s}_{eyebrow}$, respectively. The difference is that we check whether a 3D animation model contains independent morphs that can control left and right part separately or a single morph to adjust both parts. If there exist the independent morphs, they are used with priorities. Then, the values sampled from a uniform distribution are assigned to the selected semantics as well as head angles (\textit{i.e.}, roll, pitch, and yaw). This results in a pose vector $\mathbf{p}$ that works for manipulating a pose of an animation character. \noindent\textbf{Sampling Examples.} Fig.~\ref{sup-fig:sampling} shows the example pairs of generated images and pose vectors from a 3D animation model. The output data consists of \textit{frontalized-expression} and \textit{rotated-expression} images and their corresponding pose vectors that contain 17 different morphs and 3D head angles. In addition, we provide four different shader styles: (S.1), (S.2), (S.3) and (S.4) to boost the diversity of images and consider various drawing styles of animation creators. \begin{figure}[h!] \centering \includegraphics[width=0.7\linewidth]{supp-figure/supp-figure-sampling.pdf} \vspace{-0.5cm} \caption{Examples of sampled data. Given a 3D animation model, two groups of images are generated: (1) \textit{frontalized-expression} images using the sampled target morphs and zero head angles (\textit{Top-right}), and (2) \textit{rotated-expression} images after adding the sampled head angles (\textit{Bottom-right}). Note that four different shading styles are applied for image rendering.} \vspace{-0.5cm} \label{sup-fig:sampling} \end{figure} \begin{table}[h!] \scriptsize \centering \begin{tabular}{l | l} \toprule \textit{Source morphs} & \textit{Target morphs} \\ \toprule あ, ああ, あ2 & Mouth(A) \\ \hline え, ええ, え2, えー & Mouth(E) \\ \hline い, いい, い2, いー & Mouth(I) \\ \hline お, おお& Mouth(O) \\ \hline う, うう& Mouth(U) \\ \hline ばたき, 笑い, なごみ& Closed Eyes \\ \hline ウィンク, ウィンク.001, ウィンク2, なごみ左 & Left Closed Eye \\ \hline ウインク右, なごみ右, ウインク2右, ウィンク2右 & Right Closed Eye \\ \hline 半目, じと目, ジト目& Unimpressed Eye \\ \hline じと目左& Left Unimpressed Eye \\ \hline じと目右& Right Unimpressed Eye \\ \hline びっくり2, びっくり, 驚き & Surprised Eyes \\ \hline びっくり左, びっくり2左 & Left Surprised Eye \\ \hline びっくり2右, びっくり右 & Right Surprised Eye \\ \hline 怒り眉, 怒り2, 怒り & Angry Eyebrows \\ \hline 怒り左, '怒り眉左, 怒りL & Left Angry Eyebrow \\ \hline 怒り眉右, 怒り右, 怒りR & Right Angry Eyebrow \\ \hline 上 & Raised Eyebrows \\ \hline 上左, 上L & Left Raised Eyebrow \\ \hline 上右, 上R & Right Raised Eyebrow \\ \hline 下, 困る & Lowered Eyebrows \\ \hline 困るL, 下L, 困る左, 下左 & Left Lowered Eyebrow \\ \hline 困る右, '下R, 下右, 困るR & Right Lowered Eyebrow \\ \bottomrule \end{tabular} \caption{Examples of mapping relationships between the source morphs and the target morphs.} \vspace{-0.5cm} \label{sup-table:mapping} \end{table} \begin{figure}[t!] \centering \includegraphics[width=0.675\linewidth]{supp-figure/supp-figure-annotation_tool.pdf} \vspace{-0.2cm} \caption{Simplified semantic annotation system overview.} \vspace{-0.3cm} \label{sup-fig:annotation_tool} \end{figure} \RestyleAlgo{ruled} \SetKwComment{Comment}{/* }{ */} \begin{algorithm}[t!] \caption{Pseudo Codes for Pose Sampling}\label{alg:pose_sampling} \small \KwData{Annotated target morphs $\{e_{n}\}_{n=1}^{N}$} \Comment{N indicates the number of source morphs of a 3D animation model.} \KwResult{A sampled pose $\mathbf{p} \in \mathbb{R}^{20}$} \Comment{Select eye, eyebrow, mouth semantics and sample the values from a uniform distribution.} $\text{s}_{eye},\text{s}_{eyebrow},\text{s}_{mouth}$ $\leftarrow$ sample($\{e_{n}\}$)\\ \eIf{$\exists \: left\text{-s}_{eye},right\text{-s}_{eye} \in \{e_{n}\}$}{ $u_1, u_2 \sim \mathcal{U}(0,1)$\; $left\text{-s}_{eye}(v) \leftarrow u_1$\; $right\text{-s}_{eye}(v) \leftarrow u_2$\; }{ $u \sim \mathcal{U}(0,1)$\; $left\text{-s}_{eye}(v) \leftarrow u$\; $right\text{-s}_{eye}(v) \leftarrow u$\; } \eIf{$\exists \: left\text{-s}_{eyebrow},right\text{-s}_{eyebrow} \in \{e_{n}\}$}{ $u_1, u_2 \sim \mathcal{U}(0,1)$\; $left\text{-s}_{eyebrow}(v) \leftarrow u_1$\; $right\text{-s}_{eyebrow}(v) \leftarrow u_2$\; }{ $u \sim \mathcal{U}(0,1)$\; $left\text{-s}_{eyebrow}(v) \leftarrow u$\; $right\text{-s}_{eyebrow}(v) \leftarrow u$\; } $u \sim \mathcal{U}(0,1)$\; $\text{s}_{mouth}(v) \leftarrow u$\; \Comment{Sample roll, pitch and yaw from a uniform distribution.} $\text{roll}(v),\text{pitch}(v),\text{yaw}(v) \sim \mathcal{U}(-20^{\circ},20^{\circ})$\; \Comment{Fill $\mathbf{p}$ with sampled values. $\mathbf{p}[\cdot]$ denotes an index of each semantic.} initialize $\mathbf{p} = \{p_{m}\}_{m=1}^{20} = \{0,0,...,0\}$\; $\mathbf{p}[left\text{-s}_{eye}] = left\text{-s}_{eye}(v)$\; $\mathbf{p}[right\text{-s}_{eye}] = right\text{-s}_{eye}(v)$\; $\mathbf{p}[left\text{-s}_{eyebrow}] = left\text{-s}_{eyebrow}(v)$\; $\mathbf{p}[right\text{-s}_{eyebrow}] = right\text{-s}_{eyebrow}(v)$\; $\mathbf{p}[\text{s}_{mouth}] = \text{s}_{mouth}(v)$\; $\mathbf{p}[\text{roll}] = \text{roll}(v)$\; $\mathbf{p}[\text{pitch}] = \text{pitch}(v)$\; $\mathbf{p}[\text{yaw}] = \text{yaw}(v)$\; \end{algorithm} \section{Additional AnimeCeleb Samples and Experimental Results}~\label{animeceleb_additional} This section presents additional results as follows: \begin{itemize} \item Other examples sampled from the AnimeCeleb. \item Qualitative head reenactment results on other animation head images obtained from Waifu Labs~\footnote{https://waifulabs.com/} and Danbooru 2019~\cite{danbooru2019Figures}. \item Other applicable tasks using the AnimeCeleb: animation colorization and image harmonization. \end{itemize} \noindent\textbf{Additional Examples from AnimeCeleb.} Fig.~\ref{sup-fig:data} shows the sampled images of eight different characters. As aforementioned, we present two image groups: \textit{frontalized-expression} (the first row) and \textit{rotated-expression} (the second row), and a difference between two groups lies in whether a head rotation is applied to the animation heads or not. As seen in Fig.~\ref{sup-fig:data}, the images rendered with different shaders are generated with the exact same pose vector ((S.2-4) in Fig.~\ref{sup-fig:data}) for the purpose of providing multiple styles of images. \noindent\textbf{Other Animation Images Head Reenactment.} We present qualitative results using the PIRenderer~\cite{ren2021pirenderer} trained with the AnimeCeleb on two other animation sample images obtained from the Waifu Labs and the Danbooru 2019. We choose to use the PIRenderer(w/ pose vector) because it has strong generalization capacity compared to other models as seen in main manuscript. As shown in Fig.~\ref{sup-fig:out-of-domain-waifu}, the trained model successfully generates the head reenactment results given a source and a driving image. The PIRenderer(w/ pose vector) produces favorable outputs, imitating the head poses of driving images. Furthermore, Fig.~\ref{sup-fig:out-of-domain-danbooru} shows the outcomes on the Danbooru 2019. Due to the distribution gap between the AnimeCeleb and the Danbooru 2019, we confirm slight performance degradation for the samples from the Danbooru 2019. \noindent\textbf{Additional Applications of AnimeCeleb.} To reveal the benefits of the AnimeCeleb, we implement additional two tasks: an \textit{animation colorization}, and an \textit{image harmonization}. The third shader (\textit{i.e.}, S.3) styled images are used to train the colorization and the harmonization models. We clarify an importance of each task in the animation domain and show experimental results in the following paragraphs. First, the animation colorization is a practical task for animation creators to reduce their effort during the labor-intensive painting process. Given a trained colorization model, creators are able to obtain colorized images given sketch images. We conduct character colorization tasks using both unconditional and conditional colorization baselines~\cite{isola2017image,lee2020reference}. As can be seen in Fig.~\ref{sup-fig:colorization}, the colorization models trained with the AnimeCeleb show a promising performance at painting the animation character sketch images, producing plausible colorization outputs in an automatic manner or following a given animation reference image. To demonstrate the broad generalization capacity of the reference-based colorization model~\cite{lee2020reference} trained with the AnimeCeleb, we also use the reference images crawled from online cartoons. We find that not limited to the AnimeCeleb reference images, the model achieves high-quality colorization outputs based on other animation head images. Second, the image harmonization aims to generate natural composite images given two images from different domains, achieving a visually pleasing match for both content and style. We implement a representative optimization-based approach~\cite{zhang2020deep} to explore the applicability of the AnimeCeleb and generate more realistic animation images. Since the AnimeCeleb images only contain a foreground object (\textit{i.e.}, an animation head), a composition with suitable background is a natural extension of the AnimeCeleb. Not limited to the background composition, decorative objects (\textit{e.g.}, sunglasses, caps and masks) are available assets to be exploited for the composition. We can employ an optimization-based composition model~\cite{zhang2020deep} that requires a foreground segmentation mask because the AnimeCeleb includes the segmentation mask. As shown in Fig.~\ref{sup-fig:harmonization}, both background and decorative object composition with the AnimeCeleb produce plausible results, demonstrating a potential extension of the AnimeCeleb in that it can provide the images with diverse backgrounds and multiple objects. \begin{figure}[h!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-data.pdf} \caption{Examples of the created images from the AnimeCeleb.} \label{sup-fig:data} \end{figure} \begin{figure}[h!] \centering \includegraphics[width=0.9\linewidth]{supp-figure/supp-figure-out-domain.pdf} \vspace{-0.2cm} \caption{Additional animation head reenactment results on the images from Waifu Labs.} \label{sup-fig:out-of-domain-waifu} \centering \includegraphics[width=0.9\linewidth]{supp-figure/supp-figure-out-domain2.pdf} \vspace{-0.2cm} \caption{Additional animation head reenactment results on the Danbooru 2019.} \label{sup-fig:out-of-domain-danbooru} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-colorization.pdf} \caption{Colorization results in an automatic and reference-based manner on the AnimeCeleb and other collected images. A Pix2Pix~\cite{isola2017image} trained with the AnimeCeleb successfully outputs a plausible colorized image. Also, a reference-based model~\cite{referencecolor} successfully fills a given sketch image with the color maps extracted from reference images.} \label{sup-fig:colorization} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=0.6\linewidth]{supp-figure/supp-figure-harmonization.pdf} \caption{Image harmonization results. F.G., B.G. and Acc. denotes a foreground object, a background, and an accessory, respectively. The components for image harmonization (the \textit{1st column}) are well-blended, where the backgrounds and the accessories are refined with similar styles with an animation character.} \label{sup-fig:harmonization} \end{figure} \section{Implementation Details of the \emph{AniMo}\xspace and Baselines}~\label{animo_details} In this section, we describe the architectures of the motion network, the warping network, and the editing network in detail, and objective functions for training. Then, we elaborate the baselines~\cite{firstorder,ren2021pirenderer,latentpose} and implementation details of them, respectively. \begin{figure}[h!] \centering \includegraphics[width=0.45\linewidth]{supp-figure/supp-figure-motion_network.pdf} \caption{The architecture of the motion network.} \label{supp-fig:motion_net} \end{figure} \noindent\textbf{Motion Network.} As shown in Fig.~\ref{supp-fig:motion_net}, the motion network has a multi-layer perceptron structure, which consists of four fully-connected layers that are responsible for resulting in a latent motion code $\mathbf{z} \in \mathbb{R}^{256}$ given the 3DMM parameters $\mathbf{m} \in \mathbb{R}^{70}$. The latent motion code $\mathbf{z}$ are transformed to estimate the affine parameters for adaptive instance normalization (AdaIN)~\cite{huang2017arbitrary} operations in the warping network and the editing network. \begin{figure}[h!] \centering \includegraphics[width=0.75\linewidth]{supp-figure/supp-figure-warping_network.pdf} \caption{The architecture of the warping network.} \label{supp-fig:flow_predictor} \end{figure} \noindent\textbf{Warping Network.} As shown in Fig.~\ref{supp-fig:flow_predictor}, the warping network has a encoder-decoder architecture. In addition, we employ the skip-connection as U-Net~\cite{ronneberger2015u} to preserve the spatial information as well as AdaIN operation to inject the motion information. The optical flow $\mathbf{u} \in \mathbb{R}^{64 \times 64 \times 2}$ is upsampled or downsampled to fit the sizes of feature maps in the editing network. \begin{figure}[h!] \centering \includegraphics[width=0.75\linewidth]{supp-figure/supp-figure-editing_network.pdf} \caption{The architecture of the editing network.} \label{supp-fig:image_generator} \end{figure} \noindent\textbf{Editing Network.} Fig.~\ref{supp-fig:image_generator} shows the architecture of the editing network. The editing network employs the structure of a hourglass network~\cite{newell2016stacked}, in which intermediate encoder feature maps are passed to the decoder layers by an element-wise addition operation. When propagating the multi-scale feature maps of the encoder to the decoder, the optical flow $\mathbf{u}$ is applied to the multi-scale feature maps. In addition, as similar to the warping network, we utilize the AdaIN operation to inject the motion information. \noindent\textbf{Objective Functions.} In order to train the \emph{AniMo}\xspace, we follow the PIRenderer~\cite{ren2021pirenderer} objective functions as follows. First, a reconstruction loss encourages the warping network to estimate an accurate optical flow. For the sake of this, we apply the estimated optical flow to a source image $s$, and encourage the warped output to reconstruct a driving image $d$. Instead of pixel-level loss, we employ the perceptual loss~\cite{johnson2016perceptual} to minimize the $\ell_{1}$ distances in latent feature space between the warped source image $\mathbf{u}(s)$ and driving image $d$. Formally, this can be written as: \begin{equation} \mathcal{L}^{w}_{perc}(s, d) = \sum_{j}\norm\Big{\phi_{j}(\mathcal{W}(s, \mathbf{u})) - \phi_{j}(d)} _{1}, \end{equation} where $\phi_{j}$ represents the activation map of $j$-th layer of the pre-trained VGG-19 network~\cite{simonyan2014very} and $\mathcal{W}$ denotes a warping operation. This leads to reliable optical flow prediction of the warping network. Second, our editing network is trained with two losses: a reconstruction loss $\mathcal{L}^{g}_{perc}$ and a style loss $\mathcal{L}^{g}_{sty}$. The reconstruction loss is designed to reduce the errors between the final prediction $\hat{d}$ and the ground-truth driving image $d$. This can be formulated as: \begin{equation} \mathcal{L}^{g}_{perc}(d, \hat{d}) = \sum_{j}\norm\Big{\phi_{j}(\hat{d}) - \phi_{j}(d)} _{1}. \end{equation} Next, the style loss is introduced to match the statistics between the ground truth driving image $d$ and the final prediction as follows: \begin{equation} \mathcal{L}^{g}_{sty}(d, \hat{d}) = \sum_{j}\norm\Big{C^{\phi}_{j}(\hat{d}) - C^{\phi}{j}(d)} _{1}, \end{equation} where $C^{\phi}_{j}$ denotes the gram matrix calculated from the activation maps $\phi_{j}$. In summary, our full objective function is given as: \begin{align*} \mathcal{L}_{total} &= \lambda^{w}_{perc}(\mathcal{L}^{w}_{perc}(s^{(a)}, d^{(a)}) + \mathcal{L}^{w}_{perc}(s^{(r)}, d^{(r)})) \\ &+ \lambda^{g}_{perc}(\mathcal{L}^{g}_{perc}(d^{(a)}, \hat{d}^{(a)}) + \mathcal{L}^{g}_{perc}(d^{(r)}, \hat{d}^{(r)})) \\ &+ \lambda^{g}_{sty}(\mathcal{L}^{g}_{sty}(d^{(a)}, \hat{d}^{(a)}) + \mathcal{L}^{g}_{sty}(d^{(r)}, \hat{d}^{(r)})), \end{align*} where $\lambda^{w}_{perc}, \lambda^{g}_{perc}$ and $\lambda^{g}_{sty}$ are hyperparameters that control the relative importance of three different losses. We set $\lambda^{w}_{perc}, \lambda^{g}_{perc}$ and $\lambda^{g}_{sty}$ as 2.5, 4 and 250, respectively. Note that our framework is jointly trained on both the AnimeCeleb and VoxCeleb. We train the \emph{AniMo}\xspace in two stages, where the motion network and the warping network are trained for 100 epochs, and we train the entire network for the additional 100 epochs. We employ the Adam~\cite{kingma2014adam} optimizer, one of the widely-used optimization methods, with the learning rate of 0.0001. The learning rate is set initially as 0.0001, then decreased to 0.00002 after 150 epochs. The batch size is set to 12 for all experiments. \noindent\textbf{Head Reenactment Baselines.} We compare the \emph{AniMo}\xspace with state-of-the-art models~\cite{latentpose,firstorder,ren2021pirenderer}. Since we leverage two datasets during training, comparable baselines are trained on either the VoxCeleb following their original implementations or both the VoxCeleb and AnimeCeleb. In the following, we describe each baseline and experimental settings: \begin{itemize} \item \textbf{First-Order Motion Model (FOMM)}~\cite{firstorder} is an unsupervised landmark-based approach, which internally detects the spatial positions to transform the source image. We implement two versions of this model: a VoxCeleb-trained and a jointly-trained model using both the AnimeCeleb and the VoxCeleb. \item \textbf{PIRenderer}~\cite{ren2021pirenderer} takes the 3DMM parameters to represent a driving motion and employs the AdaIN operation to inject the motion information. Similar to FOMM, we first implement a VoxCeleb-trained model. Also, we apply our pose mapping $\mathcal{T}$ to use a shared pose representations (\textit{i.e.}, 3DMM parameters) for the purpose of achieving joint training. \item \textbf{Latent Pose Descriptor (LPD)~\cite{latentpose}} relies on the AdaIN operation to inject a motion information, where the driving image is encoded as latent pose vector in unsupervised manner. To handle an unseen identity during inference, a trained model is fine-tuned with the same-identity images to infer. For evaluation, we utilize a model trained on the VoxCeleb, and fine-tune it using a group of the same-identity images in the AnimeCeleb. \end{itemize} For the implementations of existing baselines, we follow the hyper-parameters given in the original papers and codes. \section{Additional Head Reenactment Results of \textit{AniMo}}~\label{animo_additional} \vspace{-0.4cm} This section contains additional head reenactment results with the \emph{AniMo}\xspace and the baselines as follows: \begin{itemize} \item Qualitative results on self-identity (VoxCeleb and AnimeCeleb), cross-identity (VoxCeleb and AnimeCeleb), and cross-domain head reenactment (Vox. $\rightarrow$ Anime. and Anime. $\rightarrow$ Vox.) tasks. \item Intuitive pose editing of an animation and human head images. \item Qualitative results on cross-domain head reenactment using various unseen head images. \item A user study to compare the characteristics with iCartoon and head angle distribution comparison between VoxCeleb. \end{itemize} \noindent\textbf{Additional Qualitative Head Reenactment Results of \textit{AniMo}.} In the experiments, we utilize two different training source: single dataset (VoxCeleb) and joint datasets (AnimeCeleb and VoxCeleb). We use the single dataset (VoxCeleb) to compare the original experimental setup of the previous studies~\cite{latentpose,firstorder,ren2021pirenderer}. For qualitative comparisons, we show the results of three tasks: (1) \textbf{self-identity head reenactment} where the identical being provides both a source and a driving image, (2) \textbf{cross-identity head reenactment} where the identities of a source and driving image are different within the same dataset, and (3) \textbf{cross-domain head reenactment} where two frames of different identities sampled from the AnimeCeleb and the VoxCeleb alternatively for the sake of serving as a source and a driving image; for example, Vox. $\rightarrow$ Anime. denotes a source and driving image are sampled from the AnimeCeleb and the VoxCeleb, respectively. Note the warping and the editing network for each domain: $W_A, G_A$ and $W_V, G_V$ are responsible for producing an animation and a real human head image, respectively. Fig.~\ref{supp-fig:baselines-self-identity-vox} shows qualitative comparisons on self-identity head reenactment using the VoxCeleb. As seen in Fig.~\ref{supp-fig:baselines-self-identity-vox}, our model produces the outputs that are perceptually realistic, as good as the baselines. Although the baselines show similar results on the task, there is a performance gap between the models when it comes to handling cross-identity inputs. As shown in Fig.~\ref{supp-fig:baselines-cross-identity-vox}, the FOMM~\cite{firstorder} often fails to produce photo-realistic results because a head structure of a driving image is involved to generate results (the \textit{3rd} and the \textit{5th} columns). Compared to these results, the models which rely on the 3DMM parameters successfully handle cross-identity inputs (the \textit{4th}, the \textit{6th} and the \textit{last} columns in Fig.~\ref{supp-fig:baselines-cross-identity-vox}). Meanwhile, when performing on self-identity head reenactment using the AnimeCeleb, it is obvious that the models trained only with the VoxCeleb do not work well (the \textit{3rd} and the \textit{4th} columns in Fig.~\ref{supp-fig:baselines-self-identity-anime}). In contrast, the models trained with the VoxCeleb and the AnimeCeleb show a promising performance (the \textit{6th} and the \textit{last} columns in Fig.~\ref{supp-fig:baselines-self-identity-anime}), yet the FOMM still has difficulty in synthesizing vivid textures of a source image (the \textit{5th} column in Fig.~\ref{supp-fig:baselines-self-identity-anime}). In addition, Fig.~\ref{supp-fig:baselines-cross-identity-anime} shows similar results on cross-identity head reenactment, where the models trained with the VoxCeleb have performed poorly (the \textit{3th} and the \textit{4th} columns). In contrast, the others trained with the AnimeCeleb successfully synthesize the outputs (the \textit{6th} and the \textit{last} columns\footnote{Note that both models use our pose mapping method.}) except for the FOMM (the \textit{5th} column). Furthermore, Fig.~\ref{supp-fig:baselines-cross-domain-anime-vox} and \ref{supp-fig:baselines-cross-domain-vox-anime} demonstrate that our model generates photo-realistic results compared to the baselines for cross domain head reenactment. \noindent\textbf{Intuitive Image Editing.} One of the important applications of our model is to explicit control of a facial expression and head rotation on both the animation and human domain. As shown in Fig.~\ref{supp-fig:control_animo}, the \emph{AniMo}\xspace is capable of generating high-quality images steered by diverse semantics. For example, an animation and human head can be controlled along roll, pitch and yaw axis (the \textit{1st} row in Fig.~\ref{supp-fig:control_animo}), and manipulating the facial expressions (\textit{i.e.}, eyes and a mouth) is achievable (the \textit{2nd} row in Fig.~\ref{supp-fig:control_animo}). \noindent\textbf{Head Reenactment of Other Animation Images.} In this experiment, we evaluate our model on multiple head image samples collected from different sources, including Waifu Labs, Naver Webtoon~\footnote{https://comic.naver.com/}, Face Sketches~\cite{ojha2021few}, 2D Disney~\footnote{https://toonify.photos/} as seen in Fig.~\ref{supp-fig:out-of-domain_animo}. Given the trained $W_A$ and $G_A$ of the \emph{AniMo}\xspace, the poses of other animation images can be controlled with the guidance of driving poses. However, we also find that there exist problems such as a background distortion and a lack of detailed expressions. We discuss such problems in Section~\ref{discussions}. \begin{figure}[t!] \centering \vspace{-0.3cm} \includegraphics[width=0.9\linewidth]{supp-figure/supp-figure-userstudy.pdf} \vspace{-0.5cm} \caption{(A) Comparison of head pose statistics between VoxCeleb and AnimeCeleb. (B) User study results for comparison between iCartoon and AnimeCeleb. The higher score is better.} \vspace{-0.75cm} \label{supp-fig:userstudy} \end{figure} \noindent\textbf{Head Angle Comparison and User Study.} Fig.~\ref{supp-fig:userstudy} (A) shows the ranges of head angles of 10K samples from each dataset. As can be seen, we determine the ranges of head poses in the scope of covering most samples of VoxCeleb. For purpose of quantitative comparison with iCartoon, we conduct a user study to compare the properties of datasets after see- ing 100 samples from each dataset. As shown in Fig.~\ref{supp-fig:userstudy} (B), users positively evaluate the style consistency, quality\footnote{A low-resolution or defocused image is considered as low-quality one.} and cleanness\footnote{If a face is occluded with an object or incompletely cropped, then it is considered as a noisy image} of AnimeCeleb. Also, the users respond that AnimeCeleb has a comparable diversity of head pose and expression. \clearpage \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-self-identity-vox.pdf} \caption{Qualitative comparison between our model and the baselines on self-identity head reenactment given the images of the Voxceleb.} \label{supp-fig:baselines-self-identity-vox} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-cross-identity-vox.pdf} \caption{Qualitative comparison between our model and the baselines on cross-identity head reenactment given the images of the Voxceleb.} \label{supp-fig:baselines-cross-identity-vox} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-self-identity-anime.pdf} \caption{Qualitative comparison between our model and the baselines on self-identity head reenactment given the images of the AnimeCeleb.} \label{supp-fig:baselines-self-identity-anime} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-cross-identity-anime.pdf} \caption{Qualitative comparison between our model and the baselines on cross-identity head reenactment given the images of the AnimeCeleb.} \label{supp-fig:baselines-cross-identity-anime} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-cross-domain-anime_pose-vox.pdf} \caption{Qualitative comparison between our model and the baselines on cross-domain head reenactment given the source image from the VoxCeleb and the driving image from the AnimeCeleb (Anime. $\rightarrow$ Vox.).} \label{supp-fig:baselines-cross-domain-anime-vox} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-cross-domain-vox_pose-anime.pdf} \caption{Qualitative comparison between our model and the baselines on cross-domain head reenactment given the source image from of the AnimeCeleb and the driving image from the VoxCeleb (Vox. $\rightarrow$ Anime.).} \label{supp-fig:baselines-cross-domain-vox-anime} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{supp-figure/supp-figure-control.pdf} \vspace{-0.5cm} \caption{Intuitive image editing results on animation and human heads via controlling the semantics and the head angles.} \vspace{-0.5cm} \label{supp-fig:control_animo} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=0.9\linewidth]{supp-figure/supp-figure-out-domain_animo.pdf} \vspace{-0.5cm} \caption{Additional head reenactment results on head images from various animation head samples.} \vspace{-0.5cm} \label{supp-fig:out-of-domain_animo} \end{figure} \section{Discussions}~\label{discussions} In this section, we discuss potential issues and directions for improvement of the AnimeCeleb and the \emph{AniMo}\xspace in further research. \noindent\textbf{Extension of Creation Protocol.} Due to the limited budget, the proposed pipeline is designed to generate a group of multi-pose yet single-view animation head images with the limited poses. However, we believe that the AnimeCeleb has room for improvement in three aspects: (1) constructing high-quality images higher than $256\times256$, (2) obtaining multi-view animation head images by rotating the camera, and (3) building a various light-conditioned animation head dataset from changing the light source position. To prove these concepts, we present these samples in Fig.~\ref{supp-fig:megapixel}. As seen in in Fig.~\ref{supp-fig:megapixel} (A), our data creation pipeline is able to render a higher resolution than $256\times256$ (\textit{e.g.}, $1024\times1024$). This definitely allow us to construct a high-quality dataset in future research. Next, the images of AnimeCeleb are created based on the frontal face, and thus do not span comprehensive appearances that can be created at various camera angles. This is mainly due to the goal of the AnimeCeleb lies in constructing the public animation dataset, which is suitable for head reenactment. A straightforward method to improve our creation process is to render an animation head at different camera angles in Blender as shown in Fig.~\ref{supp-fig:megapixel} (B). Also, as can be seen in Fig.~\ref{supp-fig:megapixel} (C), we can control the illumination for the aim of generating animation head images under different light conditions. \noindent\textbf{Diversity of the AnimeCeleb.} One of the AnimeCeleb strengths lies in a wide spanning of animation characters. However, we fixed the camera position with the aim of capturing frontal faces of animation characters during the AnimeCeleb generation process. Although this enables us to extract character face easily, the fixed camera position also constrained dataset diversity especially in terms of a translation. In addition, we uniformly set a background of the generated image as 0 (\textit{i.e.}, white color). Obviously, this weakens the capacity of a head reenactment model trained with the AnimeCeleb when handling a center-unaligned or complicated-background animation head image. Our planned solution to these limitations is to develop a more flexible architecture that can consider translation parameters under this constraint. \noindent\textbf{Limitations of the \emph{AniMo}\xspace.} We have found that when using 3DMM parameters obtained from the VoxCeleb, the \emph{AniMo}\xspace often fails to reflect the detailed poses (\textit{e.g.}, eye or mouth pose). Indeed, there are successful examples as shown in Fig.~\ref{supp-fig:cross-domain-detail}, our finding is that region sizes of lip and eyes are important to generate diverse images; more dynamics are tend to be entailed when a lip or eyes are noticeably large. On the other hand, this is not the case when we use 3DMM parameters acquired by our pose mapping method with a pose vector from the AnimeCeleb. We conclude that this behavior mainly stems from the fact that a pose from the VoxCeleb often does not identify the exact position of an eye or a mouth. In future work, we will address this problem by considering expression detail correctness of the outputs during training. In addition, since the images of the AnimeCeleb are center-aligned and have no background, it is no surprise that there exists a performance degradation when an animation head image does not these conditions(\textit{e.g.}, containing complicated background). To be specific, the generated outputs have an artifact at background and often loss the detailed poses (\textit{e.g.}, eye or mouth pose). This behavior is also observed in previous studies~\cite{latentpose,firstorder,fewadvneural} when a position of a given head in an image is far from the training dataset distribution. The solution to alleviate the problem by shifting a head position of a given source and driving image in the inference time~\footnote{https://github.com/shrubb/latent-pose-reenactment}. Similar to these approaches, we plan to implement an additional preprocessing pipeline for an animation source image during the inference.
{'timestamp': '2022-07-22T02:14:06', 'yymm': '2111', 'arxiv_id': '2111.07640', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07640'}
arxiv
\section{Introduction} \label{sec:intro} Scholarly peer review, also known as refereeing, has been defined as "the process of subjecting an author's manuscript to the scrutiny of others who are experts in the same field, prior to publication in a journal". "This review process varies from journal to journal but it typically consists of two or three reviewers reporting back to a journal editor who takes the final decision."~\citep{ware-stm-2015} In the current academic journal publication process, peer review has become a common practice that plays an extremely important role. It helps editors decide whether academic work can be accepted for publishing in academic journals. Apart from journal papers, conference papers, patents, research proposals, etc. are also subject to peer review. They generally go through a peer review process similar to that of journal papers. In this paper, journal paper review is our major focus. The first record of peer review can be traced back to more than 300 years ago. It was performed by Henry Oldenburg (1619-1677) in 1665, who was the founder and the first editor of the world's oldest scientific journal \textit{Philosophical Transactions of the Royal Society}~\citep{zuckerman-patterns-1971}. Before the 20th century, peer review was often conducted by editors-in-chief or editorial committees directly. At that time, editors of academic journals made publication decisions without seeking opinions from external reviewers. However, since the middle of the 20th century, in order to reduce the workload of the editorial board, some medical journals have begun to appoint external reviewers to carry out the review. This practice has later been widely adopted and major journals such as \textit{Nature} and \textit{Science} are increasingly relying on external reviewers. In several centuries, peer review evolves from a new thing to an industrial common practice in the academic publishing process. In peer review, whether or not an article can be accepted for publication depends on the review both by journal editors and experts in the certain field. The peer review panel makes a comprehensive assessment on the paper's originality, quality, clarity and significance to maintain a consistent high standard in the published academic work to come. Therefore, peer review is regarded as the "gatekeeper, the final arbiter of what is valued in academia"~\citep{marsh-improving-2008}. Through peer review, flaws in academic manuscripts can be found and questionable manuscripts can be intercepted before publication. While at the same time, peer review also serves as the coach in academia as it gives valuable feedback to authors for revision. This helps authors improve the quality of their papers. Although peer review is widely considered as the norm and its necessity is recognized by the majority of researchers, criticism from both academic and publishing circles has long been leveled at the peer review system~\citep{smith-peer-2006,brezis-arbitrariness-2020}. On the whole, it is subject to criticism surrounding the following issues. \begin{itemize} \item \textbf{Inefficiency.} According to data from~\citet{huisman-duration-2017}, the average review time, not included the revision time, for a manuscript is 17 weeks. To the author of the manuscript, this lengthy process is a profligate of academic time. In some cases, the research may even become outdated during the inappropriately long process. To scholars who dedicate to write reviews, with the ever-growing number of manuscripts, this reviewing work is an increasingly onerous burden. At the same time, reviewers usually receive few explicit rewards for their hard work. Even though some attempts have been made to record and credit peer review,\footnote{https://publons.com/} there still lack enough incentives for researcher to do the reviewing and rewards to justify such dedication. The time spent on reviewing could be spent alternatively on something more productive, like original research. That being the case, editors are scrambling to find qualified reviewers to even start the reviewing, making the originally time-costing process even more lengthy. Such a long-drawn process for sure discourages researchers from academic publishing. \item \textbf{Subjectivity.} Biases, either intentional or unintentional, are always inevitable to human beings. Reviewers are no exception. \citet{langford-arbitrariness-2015} suggested the arbitrariness in paper review, proving in an experiment that one-half to two-thirds of NIPS\footnote{Conference on Neural Information Processing Systems with its name later changed to NeurIPS in 2018.} 2014 accepted manuscripts might have been rejected if another independent round of review was conducted. Worse still, it is more likely for groundbreaking research, especially with novelty involved, to induce more subjectivity. Conservatism in peer review can lead to bias against groundbreaking and innovative research~\citep{wang-bias-2017}. Reviewers tend to be particularly critical of conclusions that contradict their viewpoints, while they are more tolerant of views that conform to theirs~\citep{grimaldo-simulation-2013}. Moreover, researchers have also proved the existence of gender bias~\citep{wenneras-nepotism-1997,budden-double-2008} and nationality bias~\citep{link-us-1998} in peer review. \item \textbf{Knowledge limits.} Due to physical and cognitive limitations, an individual human being is certain to have knowledge limits. Peer review relies on the professional judgments of experts in a certain field. However, expert reviewers still have their knowledge scope within the field and hence the limits. Knowledge is becoming more specific with more emerging subdivisions within a knowledge field. What complicate the reviewing more are the ever-accelerating knowledge explosion and the growing trend of interdisciplinary research. It is more common that the content of the manuscripts goes beyond the scope of knowledge of experts from the same field but not the same subdivisions. The lack of knowledge will lead to the neglect of problems. A flawed manuscript might be wrongfully accepted for publication. This will bring harm to the prestige of the publisher and worst still the development of science. \item \textbf{Mismatching.} To any editor, finding suitable reviewers for a given manuscript is no easy task. Corresponding authors of previously published articles in the related domains from the same journal are often chosen as suitable reviewers. This practice, however, does not necessarily make sense because usually under the same domain, there are many different subfields. Experts of one subfield might not be knowledgeable enough to review and comment on works from another subfield. There have been some solutions proposed to tackle this issue~\citep{anjum-pare-2019,pradhan-proactive-2021}, but the recommended researchers are not always available when invited for the reviewing, leaving the solution not very practical. \item \textbf{Conflicts of Interest.} Although the academic community has a rigorous system and strict academic regulations, conflicts of interest do occur from time to time. In the peer review system, reviewers are provided with extensive power and there are ways to abuse it. Reviewers could use missing citations as a rhetorical excuse to require authors to include the reviewers' own works in the references while their works might not be strongly related to the current paper. Severer examples can also be found as there is loophole in this system that ideas can be stolen. A reviewer of \textit{Annals of Internal Medicine} plagiarized a manuscript he reviewed and published it in another journal with data fraud at the same time~\citep{laine-annals-2017}. Plagiarism committed in peer review is an extreme example of reviewers abusing their power, but such examples do prove the possible damage the flawed system of peer review can cause. \end{itemize} Academic publishers use peer review to ensure the quality and integrity of science in publication. However, the problems above lead to flawed evaluation and hinder the development of science, which are running counter to the purpose of peer review. To young scientists, the defective system is especially harmful to their academic careers. The difficulty in publication can dampen their enthusiasm for doing research. Peer review is supposed to improve science, but it may now do exactly the opposite. As we have discussed above, a human-led peer review is prone to making mistakes. With the development of artificial intelligence (AI), computers have been able to defeat the best human players in many fields, including Go game~\citep{silver-mastering-2017}, Texas hold'em poker~\citep{brown-superhuman-2019} and esport Dota 2~\citep{openai-dota-2019}. A question should be asked: is AI already developed well enough to review scholarly papers independently? To answer this question, we propose the concept of automated scholarly paper review (ASPR). ASPR is defined as the process of employing computer technologies to review a scholarly paper automatically. In ASPR, the review comments and the final editorial decision are generated without human involved. It should be noted that ASPR totally breaks away from the traditional concept of computers being an assistant for manuscript reviewing. Computers in ASPR are designed to complete the whole review process all on their own, playing the full roles of both editors and reviewers. Shifting the current workload of peer review from humans to computers comes with following advantages. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{fig-publication-number.jpg} \caption{Scholarly publication number, 2011--2020} \label{fig:publication-number} \end{figure} ASPR is capable of overcoming human limitations, both physically and psychologically. Physically, there is a limit to how much information a normal human being can handle. No matter how knowledgeable a person is, one can only grasp part of the total knowledge existing in this world. Psychologically, there is a limit to how objective a person can be. It is almost inhuman to expect a human to remain fair and objective completely and constantly in evaluation. These weaknesses to humans are exactly the strengths of computers. Theoretically, all the knowledge in the world can be gathered by computers to create a unified knowledge base, which can then be used for information processing by themselves. Computers themselves are not affected by emotions, hence the non-existence of conflicts of interest in reviewing. ASPR can tackle the issue of the overwhelmingly increasing volume of submitted manuscripts. According to data from Dimensions,\footnote{https://app.dimensions.ai/discover/publication} the number of scholarly publications has been increasing constantly from 2011 to 2020, with a total growth rate of 74.9\% (Fig.~1).\footnote{Data accessed in November, 2021.} The number of manuscripts posted to preprint platforms such as arXiv\footnote{https://arxiv.org/} is also on the rise year by year. As reported by~\citet{lin-how-2020}, from 2008 to 2017, the preprints posted on arXiv in the category of computer science total 141,961, 77.1\% of which are published on peer-reviewed venues. The number of published papers itself is overwhelming enough and to add to this is the similarly enormous amount of those rejected papers which have also gone through the peer review process. To make it trickier, one manuscript generally needs at least two reviewers to counter subjectivity. All these circumstances together pose an overwhelming workload to the peer review system. To humans, these figures might look daunting, but to computers, they are not, because this is what computers are invented for. With proper architectural design and hardware support, computers can reach enormous computing power to review manuscripts in a very short period of time. ASPR helps researchers improve their manuscripts in a highly efficient manner. In the traditional peer review system, researchers usually need to wait several months before the editorial decision is made. If a manuscripts is returned for revision, it needs to be revised based on reviewers' comments and then be resubmitted for another round of review. This process really takes time. ASPR is different. A manuscript submitted to an ASPR system for reviewing can have the feedback given immediately. Such instant response provides researchers with more time to make improvements to their manuscripts. Also, ASPR has learned from the experience of countless human reviewers and is able to measure and evaluate manuscripts in a multi-dimensional way. As a result, apart from being used by the publishers for manuscript reviewing before publication, ASPR can serve as an academic writing checker provided to individual researchers in their writing. ASPR, as a highly integrated and demanding task, is beneficial to many related technologies. The introduction of a new integrated task often relies on related technologies and in turn this new task can drive the development of these related technologies. This is the same case with ASPR. The realization of ASPR can only be achieved with the most advanced technologies in several different fields. Examples include document parsing, document representation, text classification, information retrieval, text generation, etc. The development of these technologies will also drive the creation of more relevant datasets, creating a virtuous circle. At the same time, ASPR will in turn bring more studies into these fields. With the proposal of ASPR, we aim to bring overall progress to science and technology in different fields as a whole. \begin{figure*} \centering \includegraphics[width=0.60\textwidth]{fig-peer-review.jpg} \caption{Peer review pipeline} \label{fig:peer-review-pipeline} \end{figure*} ASPR can significantly cut down the high cost of time and money in the current peer review. The research conducted by~\citet{houghton-open-2009} studied alternative models for scholarly publishing from the perspective of economic factors. The cost of time and money in the peer review process was quantified in their research and it was estimated that the average cost to every article was about 1,440 euros. This research is based on the price level in 2007. Taking into consideration of the price level at present, the cost of each peer-reviewed article must have increased a lot more. From this study we can see that the overall cost of peer review is excessively high. ASPR is a highly economical alternative to the costly peer review process both in terms of time and money. With the application of ASPR, human reviewers can be freed from the increasingly heavy workload to devote more time and energy to their own research; the publication cost can be reduced to a great extent both for the publishers and the authors. \begin{figure*} \centering \includegraphics[width=0.9\textwidth]{fig-aspr.jpg} \caption{Automated scholarly paper review pipeline} \label{fig:aspr-pipeline} \end{figure*} The peer review system is a process with multiple parties involved, generally including an editor-in-chief, a review-editor, at least two reviewers and authors. The overall process of traditional peer review is shown in Fig.~2. Whereas ASPR is a one-stop solution with the computer functioning as the editor-in-chief, the review-editor and the reviewers at the same time. The computer can complete the whole review process independently, from manuscript receiving, parsing, screening, reviewing, commenting, scoring to the final editorial decision making. The pipeline for ASPR is shown in Fig.~3. Some previous studies~\citep{ruan-alternative-2018} conducted manuscript evaluation based on post-publication information. This information like citations, altmetric scores and community responses of papers is accumulated and obtained after the publication of papers and does not exist during the peer review period. ASPR is different. The process of ASPR is in comply with the reality of peer review. The computer has no less and no more information and metadata of a manuscript as well as the overall external knowledge existing during the peer review period. ASPR does not use post-publication information to evaluate manuscripts. In this paper, we review related technologies required at each stage of the ASPR pipeline. Some of them have already been incorporated into the scholarly reviewing process. Some are developed for other purposes and can be employed to achieve ASPR. Further, we discuss the challenges that these technologies have when used for ASPR and look into their future development. In our review, we mainly study English-related technologies. With some modifications, these technologies can be used to process multilingual manuscripts in ASPR\@. \section{Related work and datasets} To our best knowledge, there is no previous review paper that systematically and comprehensively investigates the whole process of achieving automated scholarly paper review. Efforts have been made in previous studies to use computers in assisting peer review and improving the editorial work, but their focus only lies in computer assistance leaving a blank in automating the whole process of peer review. \citet{price-computational-2017} used computers to match manuscripts with suitable reviewers, assemble balanced peer review panels and calibrate review scores. \citet{mrowinski-artificial-2017} used an evolutionary algorithm to optimize the editorial workflow, greatly reducing the peer review time by 30\% without relying on more reviewers. \citet{heaven-ai-2018} demonstrated various AI tools that can help publishers improve the peer review process with computational support in choosing reviewers, validating data, summarizing key findings, etc. \citet{checco-ai-2021} explored the strengths, the weaknesses and the uncertainty in using AI to assist the reviewing of research results. Currently, most researchers hold the view that AI is an assistant to editors and reviewers but not a replacement. Table~\ref{tab:existing-tools} shows the assisting tools for peer review. \begin{table*}[ht] \caption{Existing tools of assisting peer review process} \label{tab:existing-tools} \centering \small \begin{tabularx}{\textwidth}{lclX} \hline\noalign{\smallskip} \textbf{Name} & \textbf{Year} & \textbf{Official website} & \textbf{Applications} \\ \hline\noalign{\smallskip} \textbf{CrossCheck} & 2007 & https://www.ithenticate.com/ & Plagiarism checking, improper reference detection, writing scoring \\ \hline\noalign{\smallskip} \textbf{Penelope.ai} & 2015 & https://www.penelope.ai/ & Matching journal request detection, missing references checking, figure citations checking, standard format checking \\ \hline\noalign{\smallskip} \textbf{ScienceIE} & 2016 & https://scienceie.github.io/ & Key phrases identification and extraction, relationships between key phrases identification \\ \hline\noalign{\smallskip} \textbf{Statcheck} & 2016 & http://statcheck.io/ & Statistical data extraction, \textit{P} values recomputation and consistency checking \\ \hline\noalign{\smallskip} \textbf{StatReviewer} & 2016 & http://statreviewer.com/ & Numerical errors checking, statistical tests, integrity and quality checking, methodological reporting \\ \hline\noalign{\smallskip} \textbf{Recite} & 2018 & https://reciteworks.com/ & Citation match checking, reference format checking, reference stylistic errors checking \\ \hline\noalign{\smallskip} \textbf{Scholarcy} & 2018 & https://www.scholarcy.com/ & Article summarization, reference extraction, tables and figures extraction, chapter breakdowns and highlighting \\ \hline\noalign{\smallskip} \textbf{UNSILO} & 2018 & https://unsilo.ai/ & Key concept extraction, language quality assessment, journal match reviewing, reviewer finder, manuscript screening \\ \hline\noalign{\smallskip} \textbf{SciScore} & 2020 & https://sciscore.com/ & Analyze key resources, generate an MDAR report, track journal reproducibility with RTI \\ \hline\noalign{\smallskip} \textbf{ReviewAdvisor} & 2021 & http://review.nlpedia.ai/ & Review generation from eight aspects: originality, substance, replicability, clarity etc. \\ \hline\noalign{\smallskip} \end{tabularx} \end{table*} This research falls under the general domain of automated evaluation of document quality. A highly similar task to ASPR is automated essay scoring (AES)~\citep{ke-automated-2019,ramesh-automated-2022}. In the 1960s, \citet{page-imminence-1966} released the Project Essay Grade, which later becomes representative of AES system. In this system, the scoring is based on basic linguistic features. Another well-known system is Intelligent Essay Assessor~\citep{foltz-intelligent-1999}. This system grades an essay by making a comparison between this given essay and the outstanding essays stored in the system using Latent Semantic Analysis (LSA)~\citep{deerwester-indexing-1990}. Educational Testing Service (ETS) developed e-rater~\citep{attali-automated-2004} for the scoring in the Test of English as a Foreign Language (TOEFL). This tool is based on continuously updated NLP techniques and is widely accepted by English language qualification community. An essay is defined as "a short piece of writing on a particular subject, especially one done by students as part of the work for a course" in the \textit{Cambridge Dictionary}.\footnote{https://dictionary.cambridge.org/dictionary/english/essay} Compared to an essay, a scholarly paper is normally longer in length and more complex in structure. The most different part is that scholarly papers, or at least those quality ones, should present new ideas or findings. Therefore, the standards in essay evaluation and scholarly paper evaluation should have different focuses. But the techniques used in AES can also work for ASPR. Other applications of automated document evaluation include content assessments on Wikipedia articles~\citep{marresetaylor-edit-2019}, evaluation of TED talks~\citep{tanveer-causality-2019} and prediction of postgraduate program admission based on the Statement of Purpose~\citep{kanojia-is-2017}. All these systems like AES have related techniques that can be used to achieve ASPR\@. To AI research, data is especially crucial. The training and evaluation of research models cannot go without data. The realization of ASPR needs adequate annotation data, such as review comments, review scores, editorial decisions, etc. NeurIPS is a prestigious conference in machine learning. This conference offers to the public their conference papers along with reviews, meta-reviews and discussion records between the reviewers and the authors.\footnote{https://neurips.cc/Conferences/2021/Reviewer-Guidelines} Apart from NeurIPS, reviewing information can also be found in some journals, such as eLife\footnote{https://reviewer.elifesciences.org/author-guide/editorial-process} and PeerJ\footnote{https://peerj.com/benefits/review-history-and-peer-review/}, and also platforms like OpenReview\footnote{https://openreview.net/about} and F1000Research\footnote{https://f1000research.com/about}. However, the problem is that most rejected papers are not open to the public, which will lead to data imbalance between accepted manuscripts and the rejected ones, thus affecting the effectiveness of models developed based on the data. In addition to using public raw data, some researchers have built structured datasets for research purposes. \citet{kang-dataset-2018} created the first large peer review dataset PeerRead of scientific papers. This dataset contains 14.7k manuscripts and the corresponding accept/reject labels in top computer science conferences including ACL, NeurIPS and ICLR. It also collected 10.7k pieces of peer review texts written by experts, with 1.3k of them giving aspect scores. This dataset is widely used in automatic paper evaluation research. \citet{plank-citetracked-2019} constructed CiteTracked, which contains metadata, review texts and citations of 12.3k NeurIPS papers published from 2013 to 2018. \citet{stappen-uncertainty-2020} conducted experiments with an undisclosed Interspeech 2019 Submission Corpus. This corpus is the largest single-blind peer review corpus containing over 2k submissions and around 6k textual reviews. However, the research data is kept confidential. Besides comment generation, scoring and editorial decision making, ASPR also includes other tasks that rely on corresponding datasets. We present these relevant datasets and their corresponding applications in Table~\ref{tab:dataset-list} with their properties given respectively. These datasets of various domains can be used at different stages of automated review, paving the foundation for the achievement of ASPR. In addition, these datasets also enable aspect performance comparison of tasks within ASPR\@. \begin{table*}[ht] \caption{ASPR related datasets} \label{tab:dataset-list} \centering \small \resizebox{.81\paperwidth}{!}{ \begin{tabularx}{\paperwidth}{llXX} \hline\noalign{\smallskip} \textbf{Process} & \textbf{Name} & \textbf{Scale} & \textbf{Content} \\ \hline\noalign{\smallskip} \multirow{2}{*}{\textbf{Citation}} & S2ORC~\citep{lo-s2orc-2020} & 81.1M papers with abstracts, 8.1M papers with full texts and citations & Metadata, abstracts, full texts, in-text citations \\ & unarXive~\citep{saier-unarxive-2020} & 1M papers and 29.2M citation contexts & Metadata, abstracts, full texts, in-text citations \\ \hline\noalign{\smallskip} \multirow{3}{*}{\textbf{Language assessment}} & LEDAT~\citep{daudaravicius-language-2014} & 4k papers from 48 journals and books & Source texts, texts edited by professional editors \\ & Sentence-level revisions~\citep{tan-corpus-2014} & 108k sentences pairs with 500 pairs having strength annotations & Sentences comparison pairs of different versions, strength annotations \\ & TOEFL-Spell~\citep{flor-benchmark-2019} & 6k spelling errors based on 883 essays & Annotated spelling errors in contexts \\ \hline\noalign{\smallskip} \textbf{Novelty detection} & TAP-DLND 1.0~\citep{ghosal-tap-2018} & 6k online version newspapers & Documents with non-novel or novel annotations \\ \hline\noalign{\smallskip} \multirow{7}{*}{\textbf{Review}} & PeerRead~\citep{kang-dataset-2018} & 14.7k papers from ACL, NeurIPS and ICLR & Full texts, decisions, scores, review texts \\ & ACL-2018~\citep{gao-does-2019} & 4k reviews and 1.2k author responses from ACL 2018 & Decisions, scores, review texts, response texts \\ & CiteTracked~\citep{plank-citetracked-2019} & 3k papers from NeurIPS 2013--2018 & Metadata, review texts and citations \\ & AMPERE~\citep{hua-argument-2019} & 14.2k reviews with 400 annotated & Review text with propositions and their type annotations \\ & Dataset of \citet{stappen-uncertainty-2020} & 2k submissions and around 6k reviews text in Interspeech 2019 & Metadata, decisions, scores, review texts \\ & ASAP-Review~\citep{yuan-can-2021} & 17k papers from ICLR 2017--2020 and NeurIPS 2016--2019 & Full texts, decisions, reviews texts with aspect annotations \\ & COMPARE~\citep{singh-compare-2021} & 39 papers with 117 reviews covering 1.8k sentences & Decisions, categories, comparison discussion sentences \\ \hline\noalign{\smallskip} \multirow{2}{*}{\textbf{Scoring}} & AAPR~\citep{yang-automatic-2018} & 19k arXiv papers & Full text, submitted venuses, decisions \\ & ACL-BiblioMetry~\citep{dongen-schubert-2020} & 30k papers from ACL Anthology & Metadata, full text, citation scores, year-range uniformity \\ \hline\noalign{\smallskip} \textbf{SOTA comparison} & TDMSci~\citep{hou-tdmsci-2021} & 2k sentences extracted from 30k ACL Anthology papers & Entities of tasks, datasets, metrics \\ \hline\noalign{\smallskip} \multirow{4}{*}{\textbf{Summarization}} & ScisummNet~\citep{yasunaga-scisummnet-2019} & 1k most cited papers from ACL Anthology & Full texts, citation information, manual summaries \\ & TalkSumm~\citep{lev-talksumm-2019} & 1.7k papers with video talks from ACL, NAACL, EMNLP, SIGDIAL 2015--2018 and ICML 2017--2018 & Titles, URLs, automatically-generated summaries \\ & SciTDLR~\citep{cachola-tldr-2020} & 5.4k TLDRs over 3.2k papers & Full texts, author-written and expert-derived TLDRs \\ & FacetSum~\citep{meng-bringing-2021} & 60k papers from Emerald journals & URLs of papers with structured abstracts \\ \hline\noalign{\smallskip} \end{tabularx} } \end{table*} \section{Parsing and representation} \label{sec:parsing-representation} In general, when submitting a manuscript to an academic venue, the manuscript is required to be formatted in LaTeX or PDF. In traditional peer review, the reviewers first need to use corresponding tools to open the files. In the cognitive process of reading the manuscripts, the content, including texts, tables, figures, mathematical expressions and related metadata, is first taken in by the eyes and then the information flows to the brain for further processing. Similar to the peer review process, the first step for ASPR is to conduct parsing and representation just like a human reviewer selecting a suitable tool to open the file and taking in the information with their eyes before the actual comprehension and evaluation of the content. In this prerequisite step, different unstructured contents need to be parsed and represented into proper data form before they can be processed by computers. When it comes to LaTeX files, parsing is relatively easier. This is because LaTeX files is actually well-structured plain text and the files' structure and content are required to be specified with symbols. Parsing a manuscript in the format of PDF file is more challenging, because a PDF file does not come with structural tags. It takes much more effort to extract data from PDF files while preserving the original layout. Currently, the most commonly used parser for PDF files is GROBID~\citep{lopez-grobid-2009}, which is released in 2009, and has been constantly maintained and updated ever since. When it is first released, GROBID mainly performs the extraction of bibliographical data and is later updated for header extraction and parsing, in-text citation recognition and resolution, full-text extraction and structuring, etc. GROBID is a powerful tool in PDF parsing, nonetheless, it is not very good at figures, tables and mathematical expressions extracting, which are almost indispensable to scholarly papers. Efforts have been made to solve these problems. For figure extraction, \citet{li-figure-2019} presented a tool using layout information to extract figures and their corresponding captions. This tool is available online.\footnote{https://www.eecis.udel.edu/~compbio/PDFigCapX} For table extraction, \citet{zheng-global-2021} proposed Global Table Extractor (GTE) to detect tables and recognize cell structure jointly based on visual context. This framework delivers state-of-the-art (SOTA) performance. For mathematical expressions, \citet{wang-extraction-2019} presented an unsupervised font analysis-based method to extract them from PDF files. After parsing the submitted files, the next step in ASPR is to represent the structured data in suitable forms. For text, the common representation method is feature vector representation. In 2013, \citet{mikolov-efficient-2013} published the technique word2vec, which converts words into vectors efficiently. There are two methods for learning representations of words in word2vec: the Continuous Bag-of-Words (CBOW) architecture and the Continuous Skip-gram architecture. CBOW predicts words based on the surrounding context, while in the Continuous Skip-gram architecture, the given words are used to predict the surrounding context words. Despite being a great technique of natural language processing (NLP), word2vec is not flexible enough to process polysemous words, i.e.\ words with multiple meanings, as it only generates a single embedding representation for each word or phrase. To produce more semantic-rich word embeddings, \citet{peters-deep-2018} proposed a bidirectional language model ELMo, which was pretrained on a large amount of text data. Unlike word2vec, when computing word representation for given words, this model takes into account the context, either at sentence or paragraph level, for each occurrence of the words. This way words are allowed to have separate embeddings for different meanings. Similar to ELMo, BERT~\citep{devlin-bert-2019} is also a pretrained model, but it uses Transformer~\citep{vaswani-attention-2017} to generate representations for words. BERT is then use as the base for many later-come pretrained language models~\citep{qiu-pre-2020}. This makes a significant change in the representation of words, sentences, paragraphs and documents and ushers in a new era for NLP\@. For image representation, Convolutional Neural Network (CNN)~\citep{lecun-backpropagation-1989} is the classic and commonly used method. AlexNet is a typical deep architecture with 8 CNN layers. With its much deeper architecture and better performance, AlexNet proves that larger and deeper neural networks can better extract image features~\citep{alex-imagenet-2012}. However, as the number of layers increases, the risk of degradation problem also goes up. ResNet is designed by \citet{he-deep-2016} for these problems and it is proved to be an effective solution. ResNet and other networks that based on it are popularly used for image feature extraction. Recently, inspired by the successful application of Transformer in NLP, \citet{dosovitskiy-image-2021} used Transformer directly and achieved outstanding performance. With plentiful technologies for parsing and representation, the submitted files are prepared for the computers to process the content for further reviewing. \section{Screening} \label{sec:screening} Editorial screening is the initial step of academic reviewing that decides whether the submitted manuscript should be sent for further reviewing. According to data from \textit{Nature}, most of the manuscripts are desk-rejected without being sent out for external review with a desk-rejection rate of approximately 60\%.\footnote{http://blogs.nature.com/peer-to-peer/2006/12/report\_of\_natures\_peer\_review\_trial.html} Another report shows that around 80\% of the manuscripts submitted to \textit{Nature Microbiology} are already rejected after screening.\footnote{https://www.nature.com/articles/nmicrobiol2016259} In order to cope with the overwhelmingly large quantities of submissions, the top AI conference International Joint Conferences on Artificial Intelligence (IJCAI) also designs a similar mechanism called summary-rejects.\footnote{https://ijcai20.org/faq/\#summary} At the screening stage, the detailed content of the manuscripts will not be put under close scrutiny. The manuscripts are mainly checked for their formats, topics and plagiarism, etc. to ensure conformity to the style guidelines and instructions as well as the aims and scope of the journal. Most work can be completed by AI sufficiently and many publishers have been using AI in assisting screening. \subsection{Format examination} It is the researchers' responsibility to fulfill the format requirements of the academic venues in their preparation for submission. This is the most basic skill of academic literacy that researchers should acquire. Therefore, format checking is also the basic step in screening to filter out unprofessional submissions with formatting issues. Most format checkers are based on document parsing tools. The PDF format is ubiquitous in academic submission. Format checking for PDF submissions is mainly targeted at the layers, fonts, length, etc., regardless of the content. One example is PDF eXpress from IEEE.\footnote{https://www.ieee.org/conferences/publishing/pdfexpress.html} For submissions in unstructured document format, submissions can be parsed to check their differences in formatting with the standard template, for example the American Psychological Association 7th edition~\citep{american-publication-2019}. \citet{lu-xml-2014} used the XML format node template tree to detect formatting issues automatically. The model compares the format feature tree of a given paper with that of a template document and checks for the differences. \subsection{Plagiarism detection} Plagiarism is a serious academic offense, which should be detected at the earliest stage of reviewing as possible. Compared to other techniques involved in ASPR, plagiarism detection has yielded more mature methods, because of its early start in academic reviewing. Instead of solely relying on the surface string similarity, \citet{osman-improved-2012} used semantic role tagging (SRL) for plagiarism detection. \citet{abdi-plagiarism-2015} combined both semantic and syntactic information to detect external plagiarism. External Plagiarism Detection System (EPDS)~\citep{abdi-linguistic-2017} made further improvements by incorporating SRL technology, semantic, syntactic information and content word expansion approach into the model. This method can detect multiple kinds of plagiarism, such as paraphrasing, sentence transformation and word structure changing. \citet{sahi-novel-2017} measured the semantic similarity between scholarly papers by computing the similarity of their corresponding topic events, which are the combination of multiple information profiles of the papers. This method can efficiently be used for plagiarism detection. \citet{ahuja-new-2020} designed a more thorough plagiarism detection system, incorporating semantic knowledge like Dice measure, path similarity and depth estimation measure to compute the resemblance with different weights assigned. Apart from monolingual plagiarism, cross-language plagiarism is becoming a growing threat to the academic integrity. This type of plagiarism occurs when a paper or fragment is translated from another paper or fragment written in a different language without proper citation. The detection of cross-language plagiarism is more complex and less explored. \citet{ehsan-candidate-2016} proposed a keyword-based approach to multilingual plagiarism detection. In this method, text is segmented based on different topics for the computing of local similarity. \citet{roostaee-effective-2020} further proposed a method combining concept model with bag-of-words model to make use of both concept and keyword information with dynamic interpolation factor. This method achieved outstanding results in German-English and Spanish-English cross-language plagiarism detection. \citet{gharavi-scalable-2020} introduced a two-step sentence-by-sentence comparison method to detect cross-lingual plagiarism. Firstly, a comparison is conducted between sentence representations with semantic and syntactic information to measure their similarity for candidate plagiarized documents. Secondly, parameter tunings both online and offline are employed to filter out actual plagiarized documents. In addition to the plagiarism detection of text, it is equally important to check the images for plagiarism and forgery. \citet{eisa-content-2019} identified similar semantics in graphics and detected structural changes with image technology for graphic plagiarism detection. \citet{eisa-text-2020} studied the underlying features of graphics and proposed a more in-depth method, in which the graphic components are analyzed to obtain the meaning of the graphic. \citet{meuschke-analyzing-2021} conducted plagiarism detection by combining the detection of textual content and all other non-textual content for higher efficiency. \subsection{Machine generation detection} With the development of natural language generation (NLG), some programs are designed to generate research papers with figures, graphs and citations included. One famous example is SCIGen.\footnote{https://pdos.csail.mit.edu/archive/scigen/} There are cases of some researchers using these programs to generate papers for academic publishing. \citet{labbe-duplicate-2013} detected that 89 papers generated by SCIGen have been published and indexed in several prestigious academic venues. Under these circumstances, identifying machine-generated submissions should become an indispensable part of screening. \citet{amancio-comparing-2015} identified randomly generated nonsense in the form of research papers by creating a complex network through modeling on text. This network achieved at least 89\% accuracy in machine generation detection. One of its contributions lies in that it proves that network features can be used to identify randomly generated meaningless papers. \citet{nguyen-son-identifying-2017} used statistical information to identify machine-generated text based on the differences in word frequency. \citet{cabanac-prevalence-2021} designed a paper generation detector based on syntax rules, which achieved 83.6\% detection precision in recognizing SCIGen-generated papers. \subsection{Article type recognition} Academic journals publish different types of articles, majorly including original research articles, review articles, commentaries, short reports or letters, etc. Some journals only accept original research articles, some might only accept review papers and some might publish multiple types of articles. Screening submissions for the right article types is basically a task of document classification. Conventional document classifiers are often based on traditional machine learning methods. Examples include Bayes classifier~\citep{nigam-text-2000} and Latent Dirichlet Allocation (LDA)~\citep{hingmire-document-2013}. As deep learning models are proved to deliver better performance with the use of semantic information, neural network-based methods have become the mainstream way for document classification. The publishing of recurrent convolutional neural networks~\citep{lai-recurrent-2015}, hierarchical attention networks~\citep{yang-hierarchical-2016}, Graph-CNN~\citep{peng-large-2018} and BERT~\citep{adhikari-docbert-2019} has gradually improved the performance of document classification. These are all transferable frameworks and can be used for recognizing article types at the screening stage if corresponding labeled datasets are provided. \subsection{Scope evaluation} Every journal has its own aims and scope. At the screening stage, editors need to check the submissions to see whether they conform to the journals' objectives and whether the content is what the journal wants to deliver to its audience. The survey conducted by ~\citep{froese-surviving-2019} reveals that a significant cause for desk-rejection is the mismatching with the journal's aims and scope. Researcher Dr. Tirthankar Ghosal has done a large number of studies on the mismatching between submissions and the journal's aims and scope. He designed a binary classification model to help editors and authors to determine whether a manuscript matches with a journal~\citep{ghosal-is-2019}. He also used a multi-modal deep neural structure to identify mismatched submissions~\citep{ghosal-multiview-2019}. In 2020, he further found that titles and author profiles are more helpful in determining whether it is a good match between the manuscript and the journal. By doing so, mismatching of submissions and journals can be better identified~\citep{ghosal-empirical-2020}. In addition, the technology proposed for a related task of academic venue recommendation can also be employed here. \citet{wang-content-2018} was an early study into academic venue recommendation. In this study, abstracts of papers were crawled from web pages to train a chi-square feature selection and softmax regression hybrid model for recommendation. Content and Network-based Academic VEnue Recommender system (CNAVER)~\citep{pradhan-cnaver-2020} and Convolutional layer, LSTM with Attention mechanism-based scholarly VEnue Recommender system (CLAVER)~\citep{pradhan-claver-2021} are two recently proposed academic venue recommender systems. The former incorporated the paper-paper peer network model and the venue-venue peer network model, while the latter combined convolution, Bi-LSTM~\citep{graves-framewise-2005} and attention mechanism~\citep{bahdanau-neural-2015}, both of which systems can both effectively solve the cold-start, sparsity, diversity and stability problems. \section{Main review} In the traditional peer review process, after clearing the initial screening, submissions will be sent out to external experts for review. Many publishers have developed peer review guidelines for the references of the reviewers. In ASPR, the main review is conducted instead with computers taking up the workload from external experts. The focuses of the main review stage are designed based on the thorough peer review guidelines provided by the top computer science conference NeurIPS 2021.\footnote{https://neurips.cc/Conferences/2021/Reviewer-Guidelines} In the guidelines, different aspects that the reviewers should focus on during the examination of the manuscripts are listed as follows: originality, quality, clarity and significance. In this section, we review the related technologies that can enable ASPR based on the four aspects above. \subsection{Originality} Originality, or novelty is one of the most important criteria for scholarly publication. In the academic context, originality does not necessarily mean new inventions or discoveries. A study might not be able to reinvent the wheel in a certain field, but if it is a new idea that can move other ideas forward for incremental amount of advance in current knowledge, it should be considered a study with originality. From this aspect, originality is defined as recombining the components of pre-existing knowledge in an unprecedented way~\citep{schumpeter-business-1939,nelson-evolutionary-1982}. Based on this definition, reviewing a research paper for originality can be thought of as looking for the recombination of knowledge. Taking into consideration that the knowledge recombination is based on what can be found in the references section, the originality of a study can be evaluated based on the novel combinations of reference papers. \citet{dahlin-when-2005} proposed a definition of radical invention and designed a measurement method for an invention's radicalness using backward citations for patents which can be also used for papers. In this method, novelty was measured by quantified citation similarity. A patent of radical invention should have a unique citation structure distinct from those of the existing patents. \citet{matsumoto-introducing-2021} later developed this measurement method towards a larger-scale novelty analysis. They only used bibliometric information for novelty measurement of papers in various research fields, countries and time periods. \citet{uzzi-atypical-2013} assessed 17.9 million scholarly papers from the Web of Sciences (WOS) to study the relations between the combination of a paper's references and its citation counts. Their findings suggest that the most influential science is based on highly typical combinations of earlier work, with the addition of combinations that have never been matched before. This can be the basis of distinguishing papers with originality from those without. \citet{shibayama-measuring-2021} designed a more integrated method, making use of both the citations and content of a paper. In this method, the semantic distance of references is quantified to determine the novelty of a given paper. There are also methods to evaluate papers' originality from other perspectives. \citet{park-second-2014} introduced a method of novelty identification based on a generative model. In this method, the novelty of a paper is rated according to the likelihood of a paper being machine-generated. This is enabled based on the proposition that if a paper have great similarity with any machine generated paper, then it is less likely to be a novel research paper. \citet{amplayo-network-2018} introduced a graph-based novelty detection model. In this model, authors, documents, keywords, topics and words are used for feature representations to compose different graphs. Different papers added to the graphs will lead to different changes on the graphs. A paper that makes greater changes can be regarded as a paper with greater novelty. \subsection{Quality} Academic writing has its own established rigorous norms. In ASPR, quality of a paper is evaluated from three aspects: language, data and referencing. Language quality refers to linguistic issues including spelling, grammar and style. The assessment of data quality lies in its validity. For referencing, the manuscript will be checked to decide whether sources are cited properly. In terms of language quality, spelling and grammar issues are the most fundamental parts. English is the most common language of academic publishing. Authors who speak English as their mother tongue can still make spelling or grammatical mistakes, let alone those authors that use English only as their working language. These are the most common mistakes and are also relatively easy to be pointed out and to be corrected. In addition to these two types of common mistakes, there are also sentences that might be grammatically correct but make no sense. Their existence in the publications can cause confusion or distraction to readers in their reading and worst still can raise doubts in the rigor of the research as well as the publication. The simplest way to check the spelling errors is to have the word looked up in the speller lexicon, which can be enabled by algorithms like n-gram or Levenshtein distance. In this way, the detected spelling errors can also be corrected with the right version in the lexicon. Examples include the research conducted by~\citet{zamora-use-1981} and~\citet{hodge-comparison-2003}. However, these dictionary-based methods are highly time-consuming and at the same time rely heavily on the size of dictionaries. In addition, they are not incapable of more complex checking of word types. For this reason, \citet{ahmad-learning-2005} tried to use the expectation maximization algorithm~\citep{dempster-maximum-1977} to learn the edit distance weight directly from the correction log of the search without checking the lexicon. For a more advanced deep learning method, \citet{whitelaw-using-2009} utilized big data in training to build seq2seq spelling error detection models to achieve more efficient detection and correction. Most of the tools for spelling detection are developed with datasets manually created and lacking context, so \citet{flor-benchmark-2019} constructed a real dataset with contextual spelling errors in papers and designed a minimally supervised context-aware approach for spelling error correction. Grammar check is the foundation task for grammar correction. It was the focus of both the CoNLL-2013~\citep{ng-conll-2013} and CoNLL-2014~\citep{ng-conll-2014} shared tasks on grammatical error correction. Like the way spelling check develops, the early methods in grammar check are basically rule-based and data-driven. The limitation of these methods is that they can only detect certain types of grammatical errors, like erroneous prepositions~\citep{chodorow-detection-2007,felice-automatic-2013} and erroneous determiners. In order to bypass the dependence on annotation data, \citet{liu-exploiting-2017} trained a neural network-based model for grammatical error detection using unlabeled generated data. Their research showed that generated errors were also effective for automatic grammatical error detection. Deep learning is also applied to grammatical error detection. \citet{rei-compositional-2016} treated grammatical error detection as a sequence marking task and used Bi-LSTM to predict the errors tagging. \citet{bell-context-2019} made use of contextual word representations to represent words, learning semantic and component information in different contexts, and integrated the representation into the error detection model to improve the detection performance. \citet{wang-grammatical-2020} used the contextual information to represent words with pre-trained BERT-based word embeddings. A synthetic grammar error corpus was also employed. They further designed a positive and negative sample pair training mechanism to capture differences for more effective grammatical error detection. \citet{hu-considering-2021} constructed a neural network-based correction model for grammatical errors. In their method, word vector features are used for feature representations instead of direct one-hot encoding to reduce semantic redundancy. In addition, they try to further compress article features for optimization using clustering methods. Academic writing requires compliance with the formal and rigorous writing style, which is significantly different from other forms of writing. Papers written in overly casual style may come across as unprofessional or questionable. An Automated Evaluation of Scientific Writing Shared Task was conducted in 2016~\citep{daudaravicius-automated-2015,daudaravicius-report-2016}. Its goal was to access whether the style of a given sentence complied with the academic writing norms. For this shared task, the best performance was achieved by an attention-based encoder-decoder model developed by \citet{schmaltz-sentence-2016}. The second best results were delivered by a convolutional neural network model~\citep{lee-ntnu-2016} that used both word2vec and GloVe~\citep{pennington-glove-2014} embedding methods. \citet{sanchez-combined-2016} employed Tree Kernel-SVM~\citep{cortes-support-1995,collins-new-2002} based methods and achieved the third best performance. Accurate and precise data is an essential embodiment of a high-quality scholarly paper. As such, data validation is of great importance in the peer review process to uphold academic rigor. A common method for data validation in scientific research is the use of \textit{P} value. In academic disciplines like psychology, and econometrics, a considerable amount of data are usually involved in the research. Validating data for this kind of research through the calculation of \textit{P} values is formidably laborious for human reviewers. To automate the calculation for data validation, \citet{nuijten-statcheck-2020} used statcheck to identify statistical inconsistency. Statcheck can be used as an R package or in a browser to automatically extract statistical research results from PDF or HTML files and recompute the \textit{P} values. In addition, they further explored the use of statcheck in meta-analyses. StatReviewer is an automated reviewing tool developed to examine whether statistical methods are appropriately used in scientific papers. This tool was used in the biological field, to check whether papers in this field followed the reporting standards Consolidated Standards of Reporting Trials (CONSORT)~\citep{heaven-ai-2018} for randomized controlled trials. This tool is now used in the Aries system for actual application in peer review.\footnote{https://www.ariessys.com/newsletter/february-2018/new-decision-support-tool-statreviewer-available-in-15-0/} Proper referencing gives scholarly papers credibility and authority. Poor citation practices are a cause of concern to the authors' academic ability and can even become a suggestion of potential plagiarism. One poor citation practice is that authors fail to provide citations to relevant major studies. For the checking of referencing quality, techniques used in citation recommendation~\citep{ma-review-2020,ali-deep-2020} can be applied to detect poor citation practices. \citet{anderson-keep-2011} also proposed several methods to access whether a cited paper has its content properly presented in the citing paper. \subsection{Clarity} Clarity in the peer review process is checked based on the organization of the manuscript. It includes two aspects: textual clarity and visual clarity. There are multiple methods proposed to quantify textual clarity for academic writing. \citet{persing-modeling-2013} worked on the clarity scoring for student essays. They first build a dataset with student essays annotated with clarity score and clarity error type. Based on this dataset, they developed a clarity scoring model through a learning-based approach. Apart from assigning clarity scores, this model can also identify clarity error types. One important aspect of text clarity is text consistency, and a number of studies have been conducted to determine text consistency. \citet{farag-multi-2019} designed a hierarchical deep learning framework to generate a coherence score. This framework was trained in a multi-task manner to measure coherence at a document level. \citet{muangkammuen-neural-2020} used local coherence between adjacent sentences to score text clarity. One common way to achieve clarity in academic writing is to structure the paper in a certain layout. There are studies making efforts to evaluate the organizational clarity of scientific papers based on their writing layout. For most scientific papers, the IMRaD is a standard structure, which includes four main sections: Introduction, Methods, Results, and Discussion. \citet{agarwal-automatically-2009} studied multiple approaches to the sentence-level classification of biomedical articles into those four IMRaD sections. In this study, a SVM classifier achieved the best results for automatic classification and annotation of sentences in biological articles. Figures are an essential part of scholarly papers that visually provides clear and intelligible support to academic arguments. In peer review, figures also need to be checked for image-text consistency. Similar works can be found in the field of social media. \citet{zhao-image-2019} proposed a multi-modal binary classification model based on sentiment analysis to predict whether the content of an image is consistent with the corresponding text. Then \citet{springstein-quti-2021} went further to quantify the image-text consistency by combining SOTA approaches from NLP and computer vision (CV). \subsection{Significance} As written in the Reviewer Guidelines of NeurIPS 2021, when evaluating a paper for its significance, the reviewer should base on the following questions, "Does the submission address a difficult task in a better way than previous work? Does it advance the SOTA in a demonstrable way?" Significance of a scholarly paper can be understood as the impact it makes. From this perspective, evaluating the significance of a paper can be achieved by evaluating its impact, which to a great extent is reflected in its citation counts. A paper with major impacts naturally and actually earns more citation counts. Therefore, in ASPR, citation count prediction can be used to automate the evaluation of significance. Apart from this, the impact of some studies is also decided by the performance of their proposed methods. In this sense, significance evaluation can also be achieved by comparing the method performance with the benchmarks to see whether the research method achieves SOTA results or not. Despite of being a controversial measure for the impact of scholarly paper~\citep{brody-earlier-2006,wang-knowledge-2016}, citation count remains a popular method for this task. \citet{fu-models-2008} used titles, abstracts, keywords and bibliometric features like the citation counts of the authors' previous works and authors' academic background as feature representations. The task of citation count prediction is completed as a classification task using SVM. This method delivered outstanding results, but using bibliometric features for citation count predictions in ASPR can cause bias against scholars in their early career and in favor of scholars from prestigious institutions. In addition to this, the main body of the research paper will be left out using this method, which will fail to deliver a thorough and all-around review of scholarly papers. The deep-learning model designed by~\citet{ma-deep-2021} is one of the pioneering studies to incorporate the overall content. It extracted semantic information from paper text first using doc2Vec~\citep{le-distributed-2014} and further using Bi-LSTM with attention mechanism for high-level features. This model achieved SOTA performance, outperforming the baseline models. One of the important and more objective aspects of significance evaluation lies in the evaluation of research results. For scientific research papers that propose new methods, this can be achieved by SOTA comparison, i.e.\ conducting performance comparison with alternative benchmark models. Authors often claim that their results reach the SOTA, but whether this is true or not needs to be verified, and it is possible that a better performing method exists that the authors are not aware of. Nevertheless, conducting SOTA comparison to check their claims is no easy task. To enable SOTA comparison in ASPR requires a thorough collection of all the existing benchmarks and this collection needs to be updated constantly to take in newly-made benchmarks. Papers With Code is a prestigious platform gathering papers and source code in machine learning. This platform also collects benchmarks respectively for different tasks in different domains through crowdsourcing. This collection leads to the creation of the PWC Leaderboards dataset.\footnote{https://paperswithcode.com/sota} The benchmarks listed for separate tasks in this constantly updated dataset can be used for SOTA comparison. \citet{hou-identification-2019} proposed a method to automatically compose datasets similar to the PWC Leaderboards. This method, developing from natural language inference, learns the similarity patterns between labels and paper's content at word level to automatically extract tasks, datasets, evaluation metrics and scores from published scientific papers. They then constructed a new corpus TDMSci composed of NLP papers manually annotated with the task, dataset and metric at document level. Based on this corpus and using the triples of the task, dataset and metric, they further designed a TDM tagger through data augmentation for automated extractions in the NLP domain~\citep{hou-tdmsci-2021}. \citet{kardas-axcell-2020} developed a machine learning tool AXCELL to extract results from research papers automatically. In AXCELL, the results extraction task is divided into three subtasks: table type classification, table semantic segmentation and linking results to baselines in leaderboards. With these extraction methods, datasets of SOTA benchmarks in different domains can be built for a systematic SOTA comparison. Existing SOTA datasets can also be included to enrich these datasets. When ASPR receives a new submission, the system will extract the triple of core tasks, datasets and metrics of this study from the manuscript. This triple will then be compared to the triples of SOTA benchmarks to determine whether the method performance in this study matches or exceeds the SOTA benchmarks in the certain domain. The significance of a study is reviewed based on this comparison. \section{Review report generation} A review report is the end product of the peer review process. Constructive review reports provide valuable feedback to authors for them to improve their manuscripts. A comprehensive review report should contain a summary of the manuscript, comments highlighting its strength and weakness, scores to quantify the evaluation and the final editorial decision on accepting or rejecting the manuscript. Review report generation is of great importance in ASPR\@. \subsection{Summarization} According to the Reviewer Guidelines from NeurIPS that ASPR is based on, as well as the requirements of most other peer review guidelines, a review report should first include a summary section, briefly outlining the manuscript and its main contributions. This summary presents the basic knowledge and understanding of the reviewer on this manuscript. In ASPR, this is a task of automated text summarization, a common task in NLP. \citet{mohamed-srl-2019} innovatively adopted a Wikipedia graph-based approach to build a summary generation model. In this model, explicit semantic analysis (ESA) is used to label words and represent them as vectors with weighted Wikipedia concepts. Semantic role labeling (SRL) is adopted to identify semantic arguments based on the predicate verbs in the sentence. The summarization is achieved by the construction of a concept graph representation on semantic role-based multi-node vertices. A neural abstractive summarization framework newly proposed by \citet{pilault-on-2020} is capable of producing abstractive summaries for long documents. The hybrid framework is composed of a hierarchical encoder-based extractive model and a Transformer language model. An initial extractive step is undertaken to reduce the context for the next abstractive step. The input to the Transformer language model is reordered to identify the introduction, the extracted sentences, the abstract or summary and the rest-of-the-article. This way the hybrid model is more focused for the summarization task and outperforms baseline methods on the arXiv, PubMed and bigPatent datasets. \citet{gupta-effect-2021} conducted a study to improve model performance on the task of scientific article summarization and proved in experiments the advantages of transfer learning via intermediate pretraining for this task. \subsection{Comment generation} The second section of a review report should present reviewer comments on the strength and weakness of the manuscript. Automatic comment generation for scholarly papers is a challenging task for ASPR. There exists already relevant research on this field, but it remains inadequate. Many existing studies have adopted an NLP approach in the generation of review text for scholarly papers using slot filling models. In NLP-enabled slot filling, the models generate review text by filling in a preset review format with extracted information. \citet{bartoli-your-2016} proposed a corpus-based method to generate review based on the full text of a paper and a preset overall evaluation. \citet{wang-reviewrobot-2020} designed a knowledge-driven end-to-end framework ReviewRobot to automatically generate knowledgeable and explainable scores and comments. They achieved this by comparing the knowledge graphs built from the given paper and a large amount of other papers in the same domain. \citet{yuan-can-2021} built a paper dataset and annotated the review comments for different aspects, so as to train a review generation model by using BART~\citep{lewis-bart-2020}. Experiments show that their model is capable of generating comprehensive comments, but they considered that more improvements were needed for this task. In spite of the deficiency in the research into review generation for scholarly papers, some efforts have been made in relevant tasks, including customer review generation and news article review generation, etc. With proper training corpora, neural network-based methods in these studies can be applied to generate review comments for scholarly papers. \citet{baroni-linguistic-2019} proved in experiments that syntactic rules can be captured through deep learning and further used to generate meaningful natural-language sentences. Apart from syntactic generation methods, topic and semantics are also used for review generation. \citet{li-generating-2019} proposed an aspect-aware generation method and made full use of semantic, syntactic and contextual information. In this aspect-aware model, the reviewing of each aspect is set as a main task and this main task is assisted by auxiliary tasks. Two decoders are used in their model with one predicting a structural draft and another filling in words. Through this aspect-aware coarse-to-fine generation process, the model delivers a great performance in review generation in terms of overall generation quality, aspect coverage, and fluency. \subsection{Scoring} Scores to quantify the review comments are generally included in the review report. This is particularly common in peer review of conference papers. In ASPR, automated paper scoring is the second to last and also a crucial stage that can only be completed based on all the results from the previous stages. There are relevant technologies that can be used to fulfill this task. The task of automated paper scoring is considered by most researchers as a multiclass classification problem, i.e., treating each score as a class and solving it using classification techniques. \citet{qiao-modularized-2018} designed an attention-based modularized recurrent convolutional network to produce scoring on various aspects of scholarly papers, including appropriateness, clarity, originality, etc. Experiments showed that this method outperformed two baseline methods on the average quadratic weighted kappa. In addition to scoring different aspects of a paper, there are also methods proposed to produce an overall score directly. \citet{leng-deepreviewer-2019} introduced an attention-based framework DeepReviewer that assigns scores for papers on OpenReview based on the semantic, grammatical and innovative features combined. This framework is composed of a hierarchical recurrent convolutional neural network, a customized unsupervised deep context grammar model, an unsupervised high-dimensional spatial density-based innovation model and an attention layer to generate the final review score. Experimental results showed that DeepReviewer outperformed many baseline models. \citet{li-multi-2020} presented a multi-tasking shared structure encoding method that can choose shared network structures and auxiliary resources in an automatic way. This method is especially helpful in the case of insufficient data. \subsection{Decision making} The prediction task of review decision on the acceptance or rejection of a manuscript can be recognized as a binary classification problem. \citet{yang-automatic-2018} proposed a model of modularized hierarchical convolutional neural network to predict the acceptance result. This model was trained on positive samples of published arXiv papers and negative samples of unpublished arXiv papers. Experimental results showed that the model achieved 67.7\% accuracy in its prediction. Additionally, in the paper, the influence of authors, abstract, conclusion and title on the prediction was also analyzed and authors were found to have greater impact on the results. \citet{skorikov-machine-2020} built a machine learning-based model to predict paper acceptance in prestigious AI conferences. In this study, a comparison was made between seven different machine learning algorithms. Random forest~\citep{breiman-random-2001}, a classifier consisting of many decision trees delivered the best results. The model that used this classifier achieved an accuracy of 81\% on the PeerRead dataset. \citet{lamarre-textual-2021} analyzed the full text of both accepted and rejected manuscripts to explore their semantic, lexical and psycholinguistic feature differences. They found that the readability of accepted manuscripts was lower than that of rejected manuscripts. By using a logistic regression of bag-of-words to predict the peer review outcome, they found that their model performed the best benchmark model when using the introduction text for prediction. \citet{bao-predicting-2021} proposed an algorithm to build up decision sets for acceptance prediction of scholarly papers in a simple, effective and interpretable way. Apart from the textual content of a scholarly paper, its structure and layout also make a difference in its quality~\citep{sun-structuring-2014}. \citet{huang-deep-2018} treated paper review as image classification and trained a classifier that built on deep convolutional neural networks to predict the acceptance results for scholarly papers based solely on their visual features. They further provided tools that directly learned the mapping in the image space to provide authors with suggestions to enhance their papers visually. Moreover, visual features were also combined with text features to conduct document quality evaluation in the study of \citet{shen-joint-2019}. They used Inception V3 to generate visual feature embedding of a manuscript's snapshot and Bi-LSTM to produce textual feature embedding. The two embeddings were used to train a classification model that delivered the SOTA performance on the PeerRead dataset. \section{Current challenges} In the sections above, we explore the existing technologies for achieving ASPR. Through the review, relevant implementation is found available at each stage of ASPR. Nonetheless, ASPR, as a high demanding task at its very early stage, is in the face of many challenges. In this section, we will discuss some of the major challenges. \begin{itemize} \item \textbf{Imperfect document parsing and representation} As reviewed in Section~\ref{sec:parsing-representation}, there are already related technologies available for document parsing and representation to achieve ASPR, but necessary improvements are still needed to be made. First of all, the accuracy in the parsing of PDF files needs to be improved. Currently, existing parsers are highly capable of extracting content and structure from PDF files, but they still fall short in the face of some special characters and unusual branches of typography. To live up to the rigor of academic reviewing, parsers used in ASPR should not be allowed to make even one punctuation error. However, this is still not realized at the very moment. A compromise solution will be requiring the writing on LaTeX and the submission of all related LaTeX files. Second, the representation of long documents needs to be refined. Scholarly papers are generally of great length. However, with the current presentation methods, long documents can only be poorly represented because of their length. Available long document representation methods demand powerful hardware and are computationally ineffective. This task is greatly in need of further study. Last but not least, parsing of other types of resources, like videos, websites and source code, also needs to be developed. With the advancement of technology, the content of academic writing is extended to include more supplemental materials, such as demonstration videos, related websites and corresponding source code. To cope with the new changes, multi-model parsing has become a hot spot in recent studies~\citep{zhang-multimodal-2020,uppal-multimodal-2022}. In ASPR, computers should be able to review all different types of data, which can only be enabled by multi-modal parsing technologies. \item \textbf{Inadequate data} Through our review, we can see that there are indeed quite a few datasets available for ASPR. But it is still far from being enough and data insufficiency is still a major problem in ASPR. For one thing, existing datasets do not cover all the fields in academic studies. The vast majority of them only focus on computer science, since it is the field that is the most closely related. The ideal dataset to achieve the best performance in ASPR within the interdisciplinary trend should be a complete collection of all the papers from all different domains. Moreover, these data need to be structured in a predefined manner for machine learning. There are four main review dimensions in ASPR, which are originality, quality, clarity and significance. Each dimension shall be treated as a sub-task with corresponding datasets provided. This means that the review comments need to be labeled and segmented based on the content so as to build these corresponding datasets for the four review dimensions. Most of the available review comments, like those on OpenReview, are usually in plain text without content labels, therefore efforts are needed to create separate sub-datasets for each review dimension. To add to the problem of data insufficiency is data imbalance between accepted papers and rejected papers. Existing datasets are mostly composed of peer-reviewed accepted papers. With these datasets, computers can learn to recognize papers of good quality. However, for those papers with insufficient quality, computers lack enough learning materials to identify what are bad scholarly papers. Some platforms, OpenReview for example, provide the public access to rejected papers and the review comments on them, but most rejected papers are not made public, especially those papers that are desk-rejected. Some datasets like PeerRead do claim to include rejected papers. But it is hard to be sure whether these papers are really peer-reviewed and rejected as it is not confirmed officially by the academic publishers. "If you build a decision making system based on the articles which your journal has accepted in the past, it will have in-built biases"~\citep{heaven-ai-2018}. Data imbalance gives rise to even severer big data bias. The current ASPR is largely enabled by deep learning and big data, which usually means building models that are trained on certain datasets. Thus, the data distribution and data features of these datasets affect the learned models. For one thing, computers might not be able to identify papers with great novelty as these papers are in minority and deviate from the learned patterns of quality papers. Human reviewers with knowledge and experience might recognize these papers through acute senses, but computers will tend to reject such papers as they are off the beaten track. For another, computers trained with imbalanced data are more capable of recognizing quality papers and are less sensitive to detect flaws in the manuscripts. This can lead to inappropriate acceptance of unqualified papers. \item \textbf{Defective human-computer interaction} The interactions between reviewers and authors are at the core of the whole peer review process. A manuscript might be accepted, revised or rejected in traditional peer review. These decisions are made by the editors majorly based on the review comments and also in some cases the interactions between the reviewers and the authors. These interactions are especially important for those manuscripts that are revisions. In the case of those manuscripts that are revisions, usually after the first round of peer review, authors of these manuscripts will be provided with feedback from the reviewers, based on which they can make proper revisions to improve the manuscripts. In this review process, both the reviewers and the authors should communicate with each other in order to properly address all concerns about the manuscript. These interactions provide the editor with important information for the final editorial decision on whether a paper should be accepted for publication or not. In ASPR, technologies required for interactions between the ASPR system and the authors are still not mature enough. Therefore, in the early form of ASPR that we propose in this paper, interactions between the computer reviewers and the authors are not included. If a manuscript is rejected by the ASPR system, after making revisions based on the computer-generated comments, the author can submit the revised manuscript to ASPR for reviewing as a new manuscript. \item \textbf{Flawed deep logical reasoning} Peer review is a highly demanding task for reviewers' reasoning ability. Reviewers need to read through the whole manuscript to scrutinize the consistency and soundness in the study and the writing. Some examples of the issues that need to be assessed by reviewers with strong reasoning ability include: are the methods used able to answer the research questions; do the conclusions match the research results and the research aims? To answer these questions, reviewers are required to be knowledgeable in a certain field and capable of logical reasoning. Induction, abduction and deduction are all closely involved in the peer review process, making it an error-prone process. Errors here mean that those logical flaws are not detected in time and thus the problematic paper is accepted for publication. For human reviewers, vilifying a study's consistency and soundness through logical reasoning is no easy task. For computer reviewers, it is even more so. To achieve this part in ASPR relies on the full realization of automated reasoning. There are related studies~\citep{antoniou-survey-2018,chen-review-2020,storks-recent-2020}, but there is still a certain period of development to be used for ASPR. Besides, academic studies are trending toward an interdisciplinary future. The integration of knowledge from multiple fields also poses greater difficulty to the knowledge-based logical reasoning of computers. \end{itemize} In summary, the major challenges hindering the full realization of ASPR are also the major issues in certain subfields in AI. From this, we can see that ASPR is an advanced integration of AI technologies. Its realization and the new era of strong AI will come hand in hand. \section{Discussion of morality and ethics} The rapid development of AI has been accompanied by increasing discussions about its morality and ethics~\citep{jobin-global-2019,hagendorff-ethics-2020}. ASPR, which is an integrated application of AI, faces the same situation. In this section, we discuss the possible moral and ethical issues of using ASPR in terms of the different phases of its development. In the coexistence phase of ASPR and peer review, ASPR is still in the early phase of development and it is not mature enough to make decisions independently. At this phase, ASPR is acted as an assistant role, and humans are who give comments and make final decisions. So, it is also humans who bear the responsibility in the peer review. The main concern at this phase is the proper use of ASPR. As editors, while ASPR is making the screening results, especially the decision of desk-reject, they must also read the paper personally to determine whether the paper is really not necessary to send for external review and avoid rejecting valuable papers. As reviewers, they are required to review the paper carefully and write their review comments independently. On this basis, they should compare the review comments given by ASPR with their own review comments, judge whether their comments are omitted or biased, and improve their review comments accordingly. The ASPR review comments could not be adopted directly and submitted as their own without independent review. In general, at the coexistence phase, humans cannot use the results of ASPR to replace their own work. In the independent phase of ASPR, the related technologies of ASPR have been developed and ASPR is capable of operating independently. At this phase, ASPR no longer requires human participants, and ASPR itself is the main body of responsibility. Some regular and often discussed moral and ethical issues of AI also appear on ASPR during this period. The first one is the authority. ASPR, at the independent phase, combines the roles of editors and reviewers in traditional peer review and has enormous power. Where does the authority of this right come from? Who is responsible for and supports such authority? By convention, before the launch of such an AI system like ASPR, an evaluation should be conducted by a qualified independent third-party organization. The evaluation should involve the algorithm, training data and performance of ASPR. In this way, a series of questions deserve to be discussed. What are the criteria for ASPR to be able to enter the independent phase? Is it bounded by meeting and exceeding the performance of human experts? If so, how was the standard developed? Which human experts were selected as representatives to benchmark this standard? These are questions worth exploring but very difficult to reach an agreement on. The second is the issue of responsibility. If ASPR makes mistakes, such as giving insulting and discriminatory comments, providing error revision suggestions, rejecting valuable papers, or agreeing to publish defective papers. As the main body of responsibility, whether relevant people and organizations are jointly and severally responsible? Who are they? The users, the developers, or the independent third-party organizations of the evaluation? Generally speaking, the main issue to consider at the independent phase is responsibility. Moreover, whether in the coexistence phase or in the independent phase, authors should not deliberately write papers in unconventional ways in order to obtain positive feedback in ASPR. Still less should they use the adversarial attack~\citep{zhang-adversarial-2020,ren-adversarial-2020} to train and generate papers that can obtain high scores. This completely deviates from the original purpose of ASPR, and also makes academic writing lose its purity. ASPR providers should not use the papers submitted by authors for other purposes, strictly enforce the confidentiality agreement in peer review, and use encryption to save the papers and other metadata uploaded by users. \section{Conclusion and future directions} In this paper, we review the relevant literature and technologies as a means of answering the question that whether AI is already developed well enough to review scholarly papers independently. To answer this question, we propose the concept and pipeline of automated scholarly paper review (ASPR). Through our review, we found that there are already corresponding technologies and resources that have been applied or can be applied to each stage of ASPR for its implementation. Taking into consideration of the surging number of manuscripts and the steady development of relevant studies, ASPR is evaluated to be of great potential and feasibility. We further discuss the current challenges hindering the full realization of ASPR. The major challenges in its development lie in imperfect document parsing and representation, inadequate data, defective human-computer interaction and flawed deep logical reasoning. For future directions, studies on technologies that can address the above challenges are suggested. As these challenges are solved, ASPR will become better in terms of process and outcomes. Furthermore, research about the interpretability and explainability of AI in ASPR is recommended in that sufficient interpretability and explainability will make the ASPR results more convincing to users. Moreover, the current design of ASPR system is a pipeline model according to each point of peer review guideline. An end-to-end model that enables all points to be considered simultaneously is encouraged. An integrated model will be more comprehensive and thoughtful in analyzing papers. In summary, the application and development of ASPR will bring academic publishing into an era of more fair, more efficient and more scientific. In its full realization, computers will be able to carry the onerous reviewing workload for humans and both the research and publishing circles will benefit greatly from ASPR. Before this time, ASPR will continue to coexist with peer review as a reinforcement in scholarly publishing. \section*{Acknowledgments} This work is partly funded by the 13th Five-Year Plan project Artificial Intelligence and Language of State Language Commission of China (Grant No. WT135-38). Special and heartfelt gratitude goes to the first author's wife Fenmei Zhou, for her understanding and love. Her unwavering support and continuous encouragement enable this research to be possible. \section*{Compliance with ethical standards} \textbf{Conflict of interest} The authors declare that there is no conflict of interest regarding the publication of this paper.
{'timestamp': '2022-04-28T02:27:52', 'yymm': '2111', 'arxiv_id': '2111.07533', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07533'}
arxiv
\section{Introduction} \label{sec:introduction} Football is one of the most popular sports worldwide and European or World Championships, especially the finals, are among the most watched sporting events. The Euro 2016 Final was watched by more than 20 million people in France \cite{variety2016soccer}, or the Germany vs. France semifinal was watched by almost 30 million people in Germany \cite{variety2016soccer}. But, what about Hungary? According to the MTVA (Media Services and Support Trust Fund), that operates the television channel M4~Sport, the first Hungarian match was watched by about 1.734 million people, the second by about 1.976 million and the third group match by about 2.318 million people\footnote{According to the Hungarian Central Statistical Office (\acrshort{ksh}), the population of Hungary was about 9.83 million in 2016 \cite{ksh22.1.1.1}.}. With these ratings, the M4~Sport, turned out to be the most watched television channel in Hungary, during those days \cite{hiradohu2016csoportgyoztes}. The whole participation of the Hungarian national football team was beyond expectations and raised interest, even among those, who generally, do not follow football matches. But, is it possible to measure/correlate this interest, with a mobile phone network? Mobile phones can function as sensors, that detect the whereabouts and movement of their carrier. In this day and age, practically everyone has a mobile phone, that makes it possible to use large scale analyses. With enough data, the general mobility customs and reactions to events can also be studied. The first step is to prepare the data and select the appropriate individuals for the study. Filtering the subscribers of the \acrshort{cdr} data sets is always a crucial step. Not just to eliminate the inactive users: a subscriber, who only appears a few times in a data set, cannot be used for mobility analysis, but the abnormally active subscribers can also bias the result. Especially if their location does not change, as \acrshort{cdr} data may not only contain records for cell phones, that are carried by people. Csáji et al. took into account subscribers who had at least 10 activity during the observation period (15 months) \cite{csaji2013exploring}. Xu et al. chose to use those subscribers, who had at least one activity record at least half of the days during the observation period \cite{xu2018human}. Pappalardo et al. discarded the subscribers who had only one location, and the individuals have at least half as many calls as hours are in the data set. Furthermore, the abnormally active (more than \num{300} calls per day) \acrshort{sim} cards are excluded \cite{pappalardo2015returners}. In \cite{pinter2021evaluating}, we selected the \acrshort{sim} cards, that have activity at least 20 days (out of 30), the daily mean activity number is at least 40 on workdays and at least 20 on weekends, but not more than \num{1000}. The upper limit is especially important to remove \acrshort{sim} cards, that possibly operate in mobile broadband modems, for example. Filtering by activity is not necessarily sufficient to keep only individuals in the data set. Type Allocation Codes (\acrshort{tac}), on the other hand, can determine the type of the device and the exact model of a cell phone. After the right subscribers have been selected, it is common to determine the home and work locations \cite{vanhoof2018assessing,mamei2019evaluating,pappalardo2021evaluation}, then between these two crucial locations, the commuting trends can be identified. The commuting is studied between cities \cite{lee2018urban,zagatti2018trip,mamei2019evaluating,barbosa2020uncovering} or within a city \cite{diao2016inferring,jiang2017activity,fiadino2017call,fan2018estimation,ni2018spatial,ghahramani2018mobile,ghahramani2018extracting,pinter2021evaluating}. Apart from commuting and connectivity analysis, \acrshort{cdr} processing is often used \cite{traag2011social,xavier2012analyzing,mamei2016estimating,furletti2017discovering,marques2018understanding,pinter2019activity,rotman2020using,hiir2020impact} for large social event detection. When thousands of people are on the same place at the same time, they generate a significant `anomaly' in the data, whereas small groups usually do not stand out from the `noise'. This is especially true when the passive, transparent communication between the mobile phone device and the cell are not included in the data, but only the active communication (voice calls, text messages and data transfer) are recorded. In \cite{pinter2019activity} and \cite{rotman2020using}, mass protests are analyzed via mobile phone network data. In \cite{traag2011social,mamei2016estimating,xavier2012analyzing} and \cite{hiir2020impact}, the authors examined the location of stadiums, where the football matches took place. Traag et al. \cite{traag2011social} and Hiir et al. \cite{hiir2020impact} also found that the mobile phone activity of the attendees decreased significantly. In \cite{traag2011social}, z-score is also used to express the activity deviation during the social event from the average. Xavier et al. compared the reported number of attendees of these events with the detected ones. Furletti et al. also analyzed sociopolitical events, football matches and concerts, in Rome \cite{furletti2017discovering}. This paper focuses on football matches, that however, took place in a remote country (France), and the fans' activity are studied in Budapest. Mobility indicators, such as Radius of Gyration or Entropy, are often calculated \cite{pappalardo2015returners,xu2018human} to describe and classify the subscribers' mobility customs. Furthermore, using mobility to infer about Social Economic Status (\acrshort{ses}) is a current direction of mobility analysis \cite{xu2018human,cottineau2019mobile,barbosa2020uncovering,pinter2021evaluating}. Cottineau et al. \cite{cottineau2019mobile} explored the relationship between mobile phone data and traditional socioeconomic information from the national census in French cities. Barbosa et al. found significant differences in the average travel distance between the low and high income groups in Brazil \cite{barbosa2020uncovering}. Xu et al. \cite{xu2018human} found opposite travel tendencies in mobility of Singapore and Boston. In our previous work \cite{pinter2021evaluating}, we showed that the real estate price of the home and work locations characterize the mobility and validated our results with census data. In this paper, the price and the age of the subscribers' mobile phones are proposed as a source of the socioeconomic indicator. While Blumenstock et al. used the call history as a factor of socioeconomic status \cite{blumenstock2015predicting}, Sultan et al. \cite{sultan2015mobile} applied mobile phone prices as socioeconomic indicator and identified areas where more expensive phones appear more often, however, only manually collected market prices were used. Mobile phone network data is also used to analyze the human mobility during COVID-19 pandemic and the effectiveness of the restrictions. Willberg et al. identified a significant decrease of the population presence in the largest cities of Finland after the lockdown compared to a usual week \cite{willberg2021escaping}. Bushman et al. analyzed the compliance to social distancing in the US using mobile phone data \cite{bushman2020effectiveness}. Gao et al. found negative correlation in stay-at-home distancing and COVID-19 increase rate \cite{gao2020association}. Still, these analyses might not be common enough. Oliver et al. asked: `Why is the use of mobile phone data not widespread, or a standard, in tackling epidemics?' \cite{oliver2020mobile}. This, however, is not within the scope of this paper. In this study, we analyzed the mobile phone network activity before, during and after the matches of the Hungarian national football team. The Call Detail Records (\acrshort{cdr}), analyzed in this study, have been recorded Budapest, however the matches took place in France. We present another example of social sensing, using \acrshort{cdr}s, in an indirect and a direct way. Indirectly, as the mobile phone activity of the sport fans, residing in Budapest, are studied during matches played in France. Directly, as the spontaneous festival on the streets of Budapest after the third match, and the welcome event at the Heroes' Square are presented from a data perspective. The Call Detail Records are filtered by the Type Allocation Codes (\acrshort{tac}) to remove those Subscriber Identity Module (\acrshort{sim}) cards, that do not operate in mobile phones, thus not used by actual people. The price and age of the cell phones are also analyzed in contrast of the subscribers' age and mobility customs. The contributions of this paper are summarized briefly as follows: \begin{enumerate} \item Fusing \acrshort{cdr} data set with mobile phone prices and release dates. \item Filtering out \acrshort{sim} cards, that do not operate in mobile phones. \item Demonstrating connection between the phone price and the mobility customs. \item Proposing mobile phone price as a \acrshort{ses} indicator. \item Attendees of the large social events are compared to the rest of the subscribers based on their mobility and \acrshort{ses}. \end{enumerate} The rest of this paper is organized as follows. The utilized data is described in Section~\ref{sec:materials}, then, in Section~\ref{sec:methodology}, the applied methodology is summarized, and in Section~\ref{sec:results}, the results of this study are introduced. Finally, in Section~\ref{sec:conclusions}, the findings of the paper are summarized and concluded. \section{Materials} \label{sec:materials} Vodafone Hungary, one of the three mobile phone operators providing services in Hungary, provided anonymized \acrshort{cdr} data for this study. The observation area was Budapest, capital of Hungary and its agglomeration, and the observation period is one month (June 2016). In 2016 Q2, the nationwide market share of Vodafone Hungary was 25.3\% \cite{nmhh_mobile_market_report}. This data set contains \num{2291246932} records from \num{2063005} unique \acrshort{sim} cards, and does not specify the type of the activity (voice calls, text messages or data transfers). \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/sim_activity} \caption{\acrshort{sim} cards categorized by the number of activity records. The \acrshort{sim} cards with more than 1000 activity records (26.98\% of the \acrshort{sim} cards) provide the majority (91.31\%) of the activity.} \label{fig:vod201606_sim_activity} \end{figure} Figure~\ref{fig:vod201606_sim_activity}, shows the activity distribution between the activity categories of the \acrshort{sim} cards. The dominance of the last category, \acrshort{sim} cards with more than 1000 activity records, is even more significant. This almost 27\% of the \acrshort{sim} cards produce the more the 91\% of the activity. Figure~\ref{fig:vod201606_activity_by_days}, shows the \acrshort{sim} card distribution by the number of active days. Only the 34.59\% of the \acrshort{sim} cards have activity on at least 21 different days. There were \num{241824} \acrshort{sim} cards (11.72\%), that have appearance at least two days, but the difference between the first and the last activity is not more the seven days. This may indicate the presence of tourists. High tourism is usual during this part of the year. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/sim_activity_by_days} \caption{\acrshort{sim} card distribution by the number of active days.} \label{fig:vod201606_activity_by_days} \end{figure} The obtained data was in a `wide' format, and contained a \acrshort{sim} ID, a timestamp, cell ID, the base station (site) coordinates in \acrshort{wgs84} projection, the subscriber (age, sex) and subscription details (consumer/business and prepaid/postpaid) and the Type Allocation Code (\acrshort{tac}) of the device. The \acrshort{tac} is the first 8 digits of the International Mobile Equipment Identity (\acrshort{imei}) number, allocated by the GSM Association and uniquely identifies the mobile phone model. The Type Allocation Codes are provided for every record, because a subscriber can change their device at any time. Naturally, most of the subscribers (\num{95.71}\%) use only one device during the whole observation period, but there are some subscribers, maybe mobile phone repair shops, who use multiple devices (see Figure~\ref{fig:num_of_diff_tac}). As a part of the data cleaning, the wide format has been normalized. The CDR table contains only the \acrshort{sim} ID, the timestamp and the cell ID. A table is formed from the subscriber and the subscription details, and another table to track the device changes of the subscriber. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/daily_activity} \caption{Number of daily activity records, during two weeks of June 2016. The matches of the Hungarian national football team took place from June 14 to June 26.} \label{fig:vod201606_daily_activity} \end{figure} While the subscription details are available for every \acrshort{sim} cards, the subscriber information is missing in slightly more than 40\% of the cases, presumably because of the subscribers' preferences of personal data usability. Figure~\ref{fig:age_histogram}, shows the age distribution of the subscribers, whose data is available (\num{58.65}\%), in respect of the subscription type. Note that, this may not represent the age distribution of the population, not even the customers of Vodafone Hungary, as one is allowed to have multiple subscription and the actual user of the phone may differ from the owner of the subscription. Nevertheless, it is still clear that among the elderly people, the prepaid subscriptions are more popular. Figure~\ref{fig:vod201606_daily_activity}, shows number of daily activity records during the second half of the month. Weekends (brown bars) show significantly fewer activity, hence the activity during the matches compared to the weekday or weekend activity average, respectively to the day of the match. Although the data contains cell IDs, only the base station locations are known, where the cell antennas are located. As a base station usually serve multiple cells, these cells has been merged by the serving base stations. After the merge, 665 locations (sites) remained with known geographic locations. To estimate the covered area of these sites, the Voronoi Tessellation, has been performed on the locations. This is a common practice \cite{pappalardo2016analytical,csaji2013exploring,vanhoof2018comparing,candia2008uncovering,novovic2020uncovering,trasarti2015discovering} for \acrshort{cdr} processing. \begin{figure}[ht] \centering \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/num_of_diff_tac} \caption{Number of used phones.} \label{fig:num_of_diff_tac} \end{subfigure} \hfill \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/age_histogram} \caption{Subscribers' age distribution.} \label{fig:age_histogram} \end{subfigure} \caption{The number of different \acrshort{tac}s used by the subscribers, and the subscriber' age distribution in respect of the subscription type.} \label{fig:subscriber_age_device_num} \end{figure} \subsection{Resolving Type Allocation Codes} The socioeconomic status \acrshort{ses} of the members in the celebrating crowd have been intended to characterize by the mobile device they use. The preliminary assumption was that the price of the mobile phone represents the \acrshort{ses} of a person. According to our knowledge, there is no publicly available \acrshort{tac} database to resolve the \acrshort{tac}s to manufacturer and model, although some vendors (e.g., Apple, Nokia) publishes the \acrshort{tac}s of their products. The exact model of the phone is required to know how recent and expensive a mobile phone is. Although this is not even enough to determine how much the cell phone costed for the subscriber as they could have bought it on sale or discount via the operator in exchange for signing an x-year contract. Still, the consumer price should designate the order of magnitude of the phone price. The dataset of \acrshort{tac}s provided by ``51Degrees'' has been used, representing the model information with three columns: `HardwareVendor', `HardwareFamily' and `HardwareModel'. The company mostly deals with smartphones that can browse the web, so feature phones and other GSM-capable devices are usually not covered by the data set. Release date and inflated price columns are also included, but these are usually not known, making the data unsuitable to use on its own. Although it cannot be separated by type, but the \acrshort{cdr} data contains not only call and text message records, but data transfer as well. Furthermore, some \acrshort{sim} cards do not operate in phones, but in other -- often immobile -- devices like a 3G router or a modem. 51Degrees managed to annotate several \acrshort{tac}s as modem or other not phone devices. This was extended by manual search on the most frequent \acrshort{tac}s. There were \num{324793} \acrshort{sim} cards that uses only one device during the observation period and operates in a non-phone device. \subsection{Fusing Databases} For a more extensive mobile phone price database, a scarped GSMArena database\cite{mohit_gsmarena} has been used. GSMArena\footnote{\url{https://www.gsmarena.com/}} has a large and respectable database, that is also used in other studies\cite{reddi2018two,zehtab2021multimodal}. The concatenation of the brand and model fields of the GSMArena database could serve as an identifier for the database fusion. 51Degrees stores the hardware vendor, family and model, where hardware family is often contains a marketing name (e.g., [Apple, iPhone 7, A1778]). As these fields are not always properly distinguished, the concatenation of the three fields may contain duplications (e.g., [Microsoft, Nokia Lumia 820, Lumia 820]). So, for the 51Degrees records, three identifiers are built using the concatenation of fields (i) vendor + family, (ii) vendor + model and (iii) vendor + family + model, and all the three versions are matched against the GSMArena records. Another step of the data cleaning is to correct the name changes. For example, BlackBerries were manufactured by RIM (e.g., [RIM, BlackBerry Bold 9700, RCM71UW]), but later, the company name was changed to BlackBerry and the database records are not always consistent in this matter. The same situation occurs due to the Nokia acquisition by Microsoft. To match these composite identifiers, the simple string equality cannot be used, due to writing distinction, so Fuzzy String match is applied using the FuzzyWuzzy Python package, that uses Levenshtein Distance to calculate the differences between strings. This method is applied for all the three identifiers from the 51Degrees data set and the duplicated matches (e.g., when the family and the model is the same) were removed. Mapping the GSMArena database to the 51Degrees adds phone price and release date information to the \acrshort{tac}s, that can merged with the \acrshort{cdr}s. From the GSMArena data, two indicators have been extracted: (i) price of the phone (in EUR), and (ii) the relative age of the phone (in months). The phone price was left intact without taking into consideration the depreciation, and the relative age of the phone is calculated as the difference of the date of the \acrshort{cdr} data set (June 2016) and the release date of the phone. \section{Methodology} \label{sec:methodology} The framework, introduced in our earlier work\cite{pinter2021evaluating}, has been applied to process the mobile phone network data. The \acrshort{cdr}s are normalized, cleaned and the mobility metrics (Section \ref{sec:mobility_metrics}) are determined for every subscriber. The records can be filtered spatially and temporally, both of these filtering is applied for this work. Additionally, a group of \acrshort{sim} cards can be selected from the activity records. Only temporal filtering is applied to visualize the activity trends during the football matches. Figures \ref{fig:aut_hun_timeseries}, \ref{fig:isl_hun_timeseries}, \ref{fig:hun_prt_timeseries}, \ref{fig:post_match_festival_timeseries}, \ref{fig:hun_prt_activity_fan_activity} and \ref{fig:hun_bel_timeseries}), illustrate the activity of the subscribers in the whole observation area during the matches, including the two hours before and after the matches. For the celebration after the Hungary vs. Portugal match, spatial and temporal filtering is applied to select the area of interest (Budapest downtown) in the given time interval. To determine the activity levels for the map, Figure~\ref{fig:post_match_festival}, the match-day activity, the average weekdays activity (without the match-day) and the Z-scores \footnote{The standard score (or z-score) is defined as ${z = \frac{x-\mu}{\sigma}}$, where $\mu$ is the mean and $\sigma$ is the standard deviation.} are determined for the sites of the area of interest (downtown), in the selected time interval (20:15--20:20). We observed that the standard deviation would be higher, without removing the target-day activity from the reference average, consequently the Z-score would be lower and the relative differences less consistent. The histogram of the Z-score were generated for the selected sites (Figure~\ref{fig:zscore_hist}) to determine the activity categories. Zero value means that, the activity level equals to the average, but a wider interval (between $-2$ and $2$) is considered average to allow some variation. Sites with Z-score between $2$ and $8$ are considered having high activity during the given time interval. There are sites with either low (below $-2$) or very high activity (over $8$). The same method is applied for the map of Figure~\ref{fig:heroes_square_welcoming}, but as the area of interest and the event differs, the thresholds are not the same (see Section~\ref{sec:homecoming}). \begin{figure}[t!] \centering \includegraphics[width=\linewidth]{figures/downtown_cells_zscore_hist} \caption{Z-score distribution of the downtown sites, with the activity level thresholds at $-2$, $2$ and $8$, using the same colors as in Figure~\ref{fig:post_match_festival}.} \label{fig:zscore_hist} \end{figure} The groups of football fans are formed from the subscribers based on only the activity during the Hungary vs. Portugal match. The owner of those non-phone \acrshort{sim} cards, that were active after at least two goals are considered active football fans. The properties of these subscribers, including the age, mobility metrics, phone age and price are compared to the rest of the subscribers (Figure \ref{fig:phone_age_and_price_of_subscribers}). \subsection{Mobility Metrics} \label{sec:mobility_metrics} The metrics of Radius of Gyration and Entropy has been used to characterize human mobility. These indicators are determined for every subscriber, omitting those \acrshort{sim} cards, that operate in non-phone devices. In this study, locations are represented by the base stations. The Radius of Gyration \cite{gonzalez2008understanding} is the radius of a circle, where an individual (represented by a \acrshort{sim} card) can usually be found. It was originally defined in Equation~(\ref{eq:gyration}), where $L$ is the set of locations visited by the individual, $r_{cm}$ is the center of mass of these locations, $n_i$ is the number of visits at the i-th location. \begin{equation} \label{eq:gyration} r_g = \sqrt{\frac{1}{N} \sum_{i \in L}{n_i (r_i - r_{cm})^2}} \end{equation} The entropy characterizes the diversity of the visited locations of an individual's movements, defined as Equation~(\ref{eq:entropy}), where $L$ is the set of locations visited by an individual, $l$ represents a single location, $p(l)$ is the probability of an individual being active at a location $l$ and $N$ is the total number of activities of an individual \cite{pappalardo2016analytical,cottineau2019mobile}. \begin{equation} \label{eq:entropy} e = - \frac{\sum_{l \in L}{p(l) \log p}}{\log N} \end{equation} \subsection{Socioeconomic Status} \label{sec:ses} In our earlier work \cite{pinter2021evaluating}, the real estate price of the subscribers' home locations were used to describe the socioeconomic status. In this study, the \acrshort{cdr}s are enriched by phone prices and the phone price is assumed to apply as a socioeconomic indicator. To demonstrate the applicability of the mobile phone price as a socioeconomic indicator, it was examined in respect of the mobility indicators, applying Principal Component Analysis (\acrshort{pca}). The \acrshort{sim} cards are aggregated by the subscriber age categories (5-year steps between 20 and 80) and the phone price categories (100 EUR steps to 700 EUR), the Radius of Gyration and Entropy categories. For the Radius of Gyration, 0.5 km distance ranges are used between 0.5 and 20 km, and the Entropy values are divided into twelve bins between \num{0.05} and \num{1.00}. The structure of the data used for the Principal Component Analysis defined as follows. A table has been generated where, every row consists of 40 columns, representing 40 Radius of Gyration bins between 0.5 and 20 km and 20 columns representing 20 Entropy bins, between \num{0.05} and \num{1.00}. The subscribers, belonging to each bin are counted, and the cardinality have been normalized by metrics to be able to compare them. The categories are not explicitly labeled by them, so the subscriber age and the phone price descriptor columns are not provided to the \acrshort{pca} algorithm. The same table is constructed using weekend/holiday metrics and its rows are appended after the weekdays ones. When the \acrshort{pca} is applied, the 60-dimension vector is reduced to two dimensions based on the mobility customs, where the bins are weighted by the number of subscribers. The cumulative variance of the two best components is about 61\% (see Figure~\ref{fig:age_pp_pca_var}). The bins, representing the two new dimensions (PC1 and PC2) are plotted (see Figure~\ref{fig:age_pp_pca}) and the markers are colored by the phone price, marker sizes indicate the subscriber age category, using larger markers for younger subscribers. \section{Results and Discussion} \label{sec:results} As Figure~\ref{fig:age_pp_pca} shows, the markers are clustered by color, in other words, the phone price, that is proportional to PC1, but inversely proportional to PC2. Within each phone price group, the younger subscribers (larger markers) are closer to the origin, indicating that the mobility custom of the younger subscribers differs from the elders, although this difference is smaller within the higher price categories. This finding coincides with \cite{fernando2018predicting}, where Fernando et al. found correlation between subscribers' age and mobility metrics. To give context to Figure~\ref{fig:age_pp_pca}, Figure~\ref{fig:pp_hist}, shows the phone price distribution: most of the phones are within the 50--200 EUR range. Note that, there are only a few phones over 550 EUR, but the owners of those have significantly different mobility patterns. Figure~\ref{fig:age_pp_pca} does not only show that the phone price forms clusters, but also reveals the effect of the subscription type to the mobility. Within the phone price categories, except the highest with only a very few subscribers, the postpaid groups are usually closer to the origin. Prepaid subscriptions are usually for those, who do not use their mobile phone extensively, and it seems that people with a prepaid subscription have similar mobility customs as people with less expensive phones but postpaid subscription. That is most notable at (-6, 2) and (-5, -1). \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/age_pp_st_pca} \caption{Scatter plot of the 2-component \acrshort{pca}. Marker sizes indicate subscriber age category, the color represents the phone price category and the subscription type (Prepaid/Postpaid) is distinguished by the marker type.} \label{fig:age_pp_pca} \end{figure} \begin{figure}[ht] \centering \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/pp_hist} \caption{Phone price distribution.} \label{fig:pp_hist} \end{subfigure} \hfill \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/age_pp_st_pca_var} \caption{The Pareto histogram for the \acrshort{pca}.} \label{fig:age_pp_pca_var} \end{subfigure} \caption{Phone price distribution and the Pareto histogram for the 60 components of the Principal Component Analysis.} \label{fig:pp_dist_and_pca} \end{figure} Sultan et al. identified areas in Jhelum, Pakistan, where more expensive phones appear more often \cite{sultan2015mobile}. Using the same method, Budapest and its agglomeration was evaluated: the average phone prices from the activity records are determined for every site. The ground truth is that the real estate prices are higher on Buda side (West of river Danube) of Budapest and downtown \cite{pinter2021evaluating}, and this tendency can be clearly seen in Figure~\ref{fig:avg_phone_price_map}. The airport area has a significantly higher average than its surroundings, that is not surprising. The spatial tendencies of the mobile phone price, along with the result of the \acrshort{pca} (Figure~\ref{fig:age_pp_pca}), clearly demonstrates the expressiveness of the phone price as a socioeconomic indicator. \begin{figure}[ht] \centering \includegraphics[width=.85\linewidth]{figures/avg_phone_price_map} \caption{Average price (in EUR) of the mobile phones, that generated the activity records in each site, during the whole observation period (June 2016).} \label{fig:avg_phone_price_map} \end{figure} The rest of this section examines the results, in the time order of the Hungarian Euro 2016 matches. \subsection{Austria vs. Hungary} The first match against Austria (Figure~\ref{fig:aut_hun_timeseries}) was started at 18:00, on Tuesday, June 14, 2016. Before the match, the activity level was significantly higher than the average of the weekdays, and later decreased until the half-time. During the second half, the activity level dropped to the average, which indicated that more people started to follow the match. Right after the Hungarian goals, there are two significant peaks have been observed in the activity, which exactly indicates increased attention and the massive usage of mobile devices during the match. As the data source cannot distinguish the mobile phone activities by type, it cannot be examined what kind of activities caused the peaks. It is supposed that the activity was mostly data transfer or text messages, not phone calls. It simply does not seem to be lifelike to call someone during the match just because of a goal, but sending a line of text via one of the popular instant messaging services, is very feasible. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/aut_hun_20160614_16-22} \caption{Mobile phone activity during and after the Austria--Hungary Euro 2016 match, in comparison with the average activity of the weekdays.} \label{fig:aut_hun_timeseries} \end{figure} \subsection{Iceland vs. Hungary} The match against Iceland was played on Saturday, June 18, 2016. Figure~\ref{fig:isl_hun_timeseries}, shows the mobile phone activity levels before, during and after the match. As the weekend activity is generally lower (see Figure~\ref{fig:vod201606_daily_activity}), the average of the weekdays are used as a reference. The match began at 18:00, and from that point, the activity level was significantly below the average, except the half-time break and, again, the peak after the Hungarian goal. Interestingly, the Icelandic goal does not result such a significant peak, only a very moderate one can be seen in the time series. Traag et al. \cite{traag2011social} also found activity drop during a game, but in that case the area of the stadium was analyzed, where the match was played and there was no peak during the match. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/isl_hun_20160618_16-22} \caption{Mobile phone activity during and after the Iceland--Hungary Euro 2016 match, in comparison with the average activity of the weekends.} \label{fig:isl_hun_timeseries} \end{figure} \subsection{Hungary vs. Portugal} On Wednesday, June 22, 2016, as the third match of the group state of the 2016 UEFA European Football Championship, Hungary played draw with Portugal. Both teams scored three goals and with this result, Hungary won their group and qualified for the knockout phase. During the match, the mobile phone activity dropped below the average, but the goals against Portugal resulted significant peaks, especially the first one (see Figure~\ref{fig:hun_prt_timeseries}). On the other hand, the Portuguese equalizer goal(s) did not cause significant mark in the activity. In the second half, the teams scored four goals in a relatively short time period, but only the Hungarian goals resulted in peaks. This observation suggests that the football fans had notable influence on the mobile network traffic. After the match, the activity level is over the average, that might represent the spontaneous festival in downtown Budapest. According to the \acrshort{mti} (Hungarian news agency), thousands of people celebrated in the streets, starting from the fan zones, mainly from Erzsébet square (Figure~\ref{fig:post_match_festival} a), Margaret Island (Figure~\ref{fig:post_match_festival} b) and Erzsébet square (Figure~\ref{fig:post_match_festival} c) direction Budapest Nyugati railway station. The Grand Boulevard was completely occupied by the celebrating crowd and the public transportation was disrupted along those affected lines. This social event is comparable to mass protests from a mobile phone network perspective. In an earlier work \cite{pinter2018analysis}, we have analyzed the mobile phone activity at the route of a mass protest. The activity of the cells were significantly high when the protesters passed through the cell. In this case, however, the affected area were smaller and the sites along the Grand Boulevard were very busy at the same time after the game. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/hun_prt_20160622_16-22} \caption{Mobile phone activity during and after the Hungary--Portugal Euro 2016 match, in comparison with the average activity of the weekdays.} \label{fig:hun_prt_timeseries} \end{figure} The activities of the sites (multiple cells aggregated by the base stations), in Budapest downtown, are illustrated on Figure~\ref{fig:post_match_festival_timeseries}. The highlighted site covers mostly Szabadság square (for the location, see Figure~\ref{fig:post_match_festival} a), where one of the main fan zones was set up with a big screen. The activity curve actually follows the trends of the whole data set (see Figure~\ref{fig:hun_prt_timeseries}). There is high activity before the match, during half-time and, for a short period, after the match. During the match, the activity decreased except four, not so significant, peaks around the goals. In the highlighted site, in Figure~\ref{fig:post_match_festival_timeseries}, almost 7 thousand \acrshort{sim} cards had been detected between 17:00 and 20:00. The data shows that 53.57\% of the subscribers were between 20 and 50 years old, while 33.49\%, had no age data. After the match, there is a significant increase in the activity in some other sites. These sites are (mostly) around the Grand Boulevard, where the fans marched and celebrated the advancement of the national football team to the knockout phase. Figure~\ref{fig:post_match_festival}, shows the spatial distribution of this social event, using Voronoi polygons generated around the base stations locations. The polygons are colored by the mobile phone network activity increase at 20:15, compared to average of the weekday activity. For the comparison, the standard score was determined for every base station with a 5-minute temporal aggregation. The darker colors indicate the higher activity surplus in an area. The figure also denotes the three main fan zones in the area, routes of the fans by arrows, and the affected streets are emphasized. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/post_match_festival_timeseries} \caption{Site activities, in Budapest downtown, on the day of the Hungary vs. Portugal football match (June 22, 2016). The highlighted site covers mostly the Szabadság Square, where one of the main fan zones was set up.} \label{fig:post_match_festival_timeseries} \end{figure} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/post_match_festival} \caption{After the Hungary vs. Portugal football match, the fans, delirious with joy, filled the streets. The arrows show their route from the main fan zones to and along the Grand Boulevard. Voronoi polygons colored by the mobile phone network activity at the peak of the event, at 20:15.} \label{fig:post_match_festival} \end{figure} \subsubsection*{Who are responsible for the peaks?} There were three Hungarian goals during the match, hence there were three peaks, starting at 18:18, 19:02 and 19:18. All of them had about 5-minute fall-times. To answer this question, the \acrshort{sim} cards that were active during any two of the peaks were selected. Selecting \acrshort{sim} cards that were active during any of the peaks, would also include many subscribers, that cannot be considered as football fan. The participation of all the three peaks, on the other hand, would be too restrictive. Figure~\ref{fig:hun_prt_activity_of_fans}, presents the activity of the selected \num{44646} \acrshort{sim} cards and the owner of these cards, which may belong to the football fans. Removing these \acrshort{sim} cards from the data set, should result an activity curve without peaks, and at the same time similar, in tendency, to the average activity. However, as Figure~\ref{fig:hun_prt_activity_without_fans} shows, the activity still drops during the match. Therefore, the `football fan' category should be divided to `active' and `passive' fans, from the mobile phone network perspective. Active fans are assumed to express their joy using the mobile phone network (presumably to access the social media) and cause the peaks. It seems that the passive fans ceased the other activities and watched the game, that caused some lack of activity, compared to the average. By removing the active fans from the observed set of \acrshort{sim} cards, the activity level decreased in general (Figure~\ref{fig:hun_prt_activity_without_fans}). However, this is not surprising, as these people reacted to the goals, they must often use the mobile phone network. There are also some negative peaks, indicating that the selection is not perfect. Is there any difference between the active fans regarding the phone age and price compared to the other subscribers? Figure~\ref{fig:phone_age_of_subscribers}, shows the relative age of the phones in respect of the subscribers' behavior after the goals. No significant difference has been realized between the active fans and other subscribers, the median of the phone relative age is about two years, and there are some much older (nearly ten years old) phones in use. It should be noted that older devices are used by elderly people. The price of the phones show opposite tendency: the younger subscribers own more expensive phones (Figure~\ref{fig:phone_price_of_subscribers}). Naturally, not all of these \num{169089} \acrshort{sim} card (without the ones operating non-phone devices) generated activity after all the goals. \num{83352} devices were active after the first goal, \num{70603} after the second and \num{68882} after the third. After at least two goals \num{44646}, and after all the three goals only \num{9102} devices had activity, within 5 minutes. \begin{figure}[ht] \centering \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/hun_prt_activity_of_fans} \caption{Activity of fans.} \label{fig:hun_prt_activity_of_fans} \end{subfigure} \hfill \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/hun_prt_activity_without_fans} \caption{Activity without the fans.} \label{fig:hun_prt_activity_without_fans} \end{subfigure} \caption{Mobile phone network activity of the \acrshort{sim} cards (fans), that had activity right after any two of the Hungarian goals, and the mobile phone activity of the other \acrshort{sim} cards.} \label{fig:hun_prt_activity_fan_activity} \end{figure} Why would they use the mobile phone network to access social media? If they were at home, they would have used the wired connection, via Wi-Fi for mobile devices. In Hungary, the \num{79.2}\% of the households had wired internet connection, according to the \acrshort{ksh}\cite{ksh12.8.1.9}, and it could be even higher in Budapest. However, if they were at fan zones, for example in Szabadság Square, using the mobile network is more obvious. \begin{figure}[ht] \centering \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/phone_age_of_subscribers} \caption{Relative age of the phones.} \label{fig:phone_age_of_subscribers} \end{subfigure} \hfill \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/phone_price_of_subscribers} \caption{Price of the Phones.} \label{fig:phone_price_of_subscribers} \end{subfigure} \caption{Mobile phone relative age and the price distributions in different age categories, comparing the fans, who had activity right after any two of the Hungarian goals, and the rest of the \acrshort{sim} cards.} \label{fig:phone_age_and_price_of_subscribers} \end{figure} As Figure~\ref{fig:phone_age_and_price_of_subscribers} shows, there is no significant difference in the phone age between the active football fans and the rest of the subscribers. The medians are almost the same within the young adult and the middle-age categories, but elders tend to use older devices, especially those, who did not react to the goals. The active football fans' median phone price is 180 EUR, in contrast of the 160 EUR median of the rest of the subscribers. However, the older subscribers tend to use less expensive phones. This tendency is also present within the football fans, but stronger within the other group. Figure~\ref{fig:gyration_and_entropy_of_subscribers}, illustrates the mobility metrics in different age categories, also comparing the football fans and the rest of the subscribers. The Radius of Gyration median is almost the same in all the age categories and groups. The Entropy medians have a notable difference between the two groups, but do not really change between the age categories. This means, that the mobility customs of the football fans, who use the mobile phone network more actively, are similar, regardless of the subscribers' age. \begin{figure}[ht] \centering \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/gyration_of_subscribers} \caption{Radius of Gyration of the subscribers.} \label{fig:gyration_of_subscribers} \end{subfigure} \hfill \begin{subfigure}[t]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{figures/entropy_of_subscribers} \caption{Entropy of the subscribers.} \label{fig:entropy_of_subscribers} \end{subfigure} \caption{Radius of Gyration and Entropy distributions in different age categories, comparing the fans, who had activity right after any two of the Hungarian goals, and the rest of the \acrshort{sim} cards.} \label{fig:gyration_and_entropy_of_subscribers} \end{figure} \subsection{Hungary vs. Belgium} On Sunday, June 26, 2016, Hungary played the fourth and last Euro 2016 match against Belgium. Figure~\ref{fig:hun_bel_timeseries}, shows the mobile phone network activity before, during and after the match. During the match, the activity level was below the weekend average. The activity after the match was slightly higher than average, since the match ended late on Sunday, when the activity average is usually very low. This activity surplus may only indicate that the fans were simply leaving the fan zones and going home. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/hun_bel_20160626_16-22} \caption{Mobile phone activity during and after the Hungary--Belgium Euro 2016 match, in comparison with the average activity of the weekends.} \label{fig:hun_bel_timeseries} \end{figure} \subsection{Homecoming} \label{sec:homecoming} The Hungarian national football team returned to Budapest, on June 27, 2016. A welcome event at the Heroes' Square have been held, where the football fans can greet the national football team. According to the M4 Sport television channel, approximately 20 thousand people attended to the event \cite{hiradohu2016tizezrek}. Between 18:00 and 19:30, there were \num{4246} unique, non-phone \acrshort{sim} cards active in the site, that covers the Heroes' Square. \num{3425} are known to use smartphone, based on the operating system column of the GSMArena data set. The cells of this base station cover a larger area, so not all of these subscribers actually attended to the event, but on the other hand, it is not compulsory to use the mobile phones during this event. Supposing that the mobile phone operator preferences among the attendees corresponded to the nationwide trends in 2016, there could even be about 17 thousand people, as the data provider had \num{25.3}\% market share \cite{nmhh_mobile_market_report}. Figure~\ref{fig:heroes_square_welcoming} shows, a part of District 6 and the City Park with the Heroes' Square and the Voronoi polygons of the area are colored according to the Z-score values, to indicate the mobile phone activity in the area, at 18:35. The activity is considered low below $-1$, average between $-1$ and $1$, high between $1$ and $2.5$ and very high above $2.5$. Figure~\ref{fig:heroes_square_welcoming_time_series} shows, the mobile phone network activity (upper), and the Z-score (bottom) of the site, covering Heroes' Square. It is clear, that during the event, the activity is significantly higher than the weekday average, and the Z-score values are also follows that. \begin{figure}[ht] \centering \begin{subfigure}[t]{0.5\linewidth} \centering \includegraphics[width=\linewidth]{figures/heroes_square_welcoming_time_series} \caption{Activity and Z-score of the site, at Heroes' square.} \label{fig:heroes_square_welcoming_time_series} \end{subfigure} \hfill \begin{subfigure}[t]{0.475\linewidth} \centering \includegraphics[width=\linewidth]{figures/heroes_square_welcoming} \caption{Spatial view of the activity at 18:35.} \label{fig:heroes_square_welcoming} \end{subfigure} \caption{Mobile phone network activity at Heroes' Square and its neighborhood, during the welcoming event of the Hungarian national football team.} \label{fig:welcoming} \end{figure} \subsection{Limitations} We associated subscribers' \acrshort{ses} with the release price of their cell phones, however, it is not necessary for them to buy their phones at that price. Many people buy their phone on sale or discount via the operator in exchange for signing an x-year contract. Also, subscribers can change their phone devices at any time. We have taken into consideration only those subscribers, who had used only one device during the observation period, or had a dominant device that generated most of the activity records of the given subscriber. We have fused three data sets to exclude the non-phone \acrshort{sim} cards, but the identified devices are not complete. There remained devices, that models are unknown and there are phones, that release date and price are unknown. It is not possible to determine \acrshort{ses} of these subscribers with the proposed solution. \subsection{Future Work} Although, the current solution to select the football fans' \acrshort{sim} cards, in other words, the \acrshort{sim} cards, that caused the peaks gives a reasonable result, but could be improved by analyzing the activity during the whole observation period. For example, applying a machine learning technique. Extending the list of the non-phone \acrshort{tac}s could also help to refine the results, and combining the mobile phone prices with the real estate prices of the home location would most certainly enhance the socioeconomic characterization. The relative age of the cell phone might be used as a weight for the phone price, when applied as \acrshort{ses} indicator to distinguish between the phone price categories. As an expensive, but older phone is not worth as much as a newer one with the same price. \section{Conclusions} \label{sec:conclusions} In this study, we demonstrated that mobile phone network activity shadows precisely the football fans' behavior, even if the matches are played in another country. This analysis focused the people followed the matches on TV (at home) or big screens at the fan zones, but not in the stadium, where the matches were actually played. The mobile phone network data and the mobile phone specification database has been applied to characterize the \acrshort{ses} of the football fans. The data fusion allowed us to remove a considerable number of \acrshort{sim} cards from the examination that certainly operates in other devices than mobile phones. Although, there are some still unidentified \acrshort{tac}s in the data set, but this way, the activity records, involved in this study, have a significantly higher possibility to used by an actual person during the events. The time series of mobile network traffic clearly show that the activity was below the average during the matches, indicating that many people followed their team. This observation coincides with other studies \cite{traag2011social, mamei2016estimating, xavier2012analyzing, hiir2020impact}, where the activity of the cells at the stadium were analyzed. We also demonstrated that a remote football match can also have notable effect on the mobile phone network. Moreover, the joy felt after the Hungarian goals, is clearly manifested in the data, as sudden activity peaks. The \acrshort{cdr} data is certainly capable of social sensing. The spontaneous festival after the Hungary vs. Portugal match and the welcoming event at the Heroes' Square are direct applications of social sensing and comparable to mass protests from a data perspective. During the events, the mobile phone network activity was significantly higher than the average in affected areas. The price of the mobile phone was proved to be an expressive socioeconomic indicator. It is capable not only to cluster the areas of a city, but also to distinguish the subscribers by mobility customs. On the other hand, it does not seem to affect the interest in football. \vspace{6pt} \section*{Author Contributions} Conceptualization, G.P; methodology, G.P.; software, G.P.; validation, G.P.; formal analysis, G.P.; investigation, G.P.; resources, G.P. and I.F.; data curation, G.P.; writing---original draft preparation, G.P.; writing---review and editing, G.P. and I.F.; visualization, G.P.; supervision, I.F.; project administration, I.F.; funding acquisition, I.F. All authors have read and agreed to the published version of the manuscript. \section*{Funding} This research supported by the project 2019-1.3.1-KK-2019-00007 and by the Eötvös Loránd Research Network Secretariat under grant agreement no. ELKH KÖ-40/2020. \section*{Acknowledgments} The authors would like to thank Vodafone Hungary and 51Degrees for providing the Call Detail Records and the Type Allocation Code database for this study. For plotting the map, OpenStreetMap data is used, that is copyrighted by the OpenStreetMap contributors and licensed under the Open Data Commons Open Database License (ODbL). \section*{Conflicts of Interest} The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results. \printglossary[title=Abbreviations, toctitle=Abbreviations, nogroupskip=true] \printbibliography \end{document}
{'timestamp': '2021-11-16T02:31:42', 'yymm': '2111', 'arxiv_id': '2111.07685', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07685'}
arxiv
\section{Introduction} \label{sec_intro} \reviewComment{% Where does the definition of series-parallel matroids and matrices come from? }{ Added some more background and links to the literature. }% We consider binary matrices $A \in \{0,1\}^{m \times n}$ and the matroids represented by those (see the \reviewFix{% books of Oxley~\cite{Oxley92} or }% Truemper~\cite{Truemper98} for relevant matroid concepts). \emph{Series-parallel matroids} are those represented by \emph{series-parallel matrices}, which are defined recursively: every binary $m$-by-$n$ matrix with $m,n \leq 1$ is series-parallel. For $m \geq 2$ or $n \geq 2$, $A$ is series-parallel if and only if it can be obtained from another series-parallel matrix $A'$ by adjoining a row vector (resp.\ column vector) that is a copy of a row (resp.\ column) vector of $A'$ or is a unit or zero vector. The removal of such a row or column is called an \emph{SP-reduction}, more precisely a \emph{copy reduction}, \emph{unit reduction} or \emph{zero reduction}, respectively. In other words, a matrix is series-parallel if there is a sequence of SP-reductions that yields the empty (i.e., $0$-by-$0$) matrix. Matrices for which no SP-reduction is possible are called \emph{SP-reduced}. The main problem of interest is the following. \begin{problem} \label{prob_sp} Determine whether a given binary matrix is series-parallel. \end{problem} \reviewFix{% Series-parallel matroids were invented as generalizations of the well-known \emph{series-parallel graphs}. The latter are those graphs }% that can be obtained from the graph with one node and a loop edge by iteratively duplicating an edge or subdividing an edge by a new node. \reviewFix{% Series-parallel graphs naturally arise in electrical networks~\cite{Duffin65} and are well studied~\cite{BrandstaedtLS99}. Moreover, the application of series-parallel extensions (the inverse operations of SP-reductions) to uniform matroids were studied by Chaourar and Oxley~\cite{ChaourarO03}. }% It is \reviewFix{well known} that there is a one-to-one correspondence between the series-parallel graphs and the series-parallel matroids. \reviewFix{% A matrix $A \in \F^{m \times n}$ \emph{represents a matroid} over some field $\F$ in the following sense: The ground set $E$ of the matroid is the set of columns of the matrix $[\onevec \mid A]$, where $\onevec$ is the identity matrix of order $m$, and a subset $Y \subseteq E$ is independent if the corresponding columns are linearly independent over $\F$. A binary matrix $A$ \emph{represents a graph} $G = (V,E)$ with respect to a spanning tree $T \subseteq E$ if the rows of $A$ can be indexed by the edges in $T$, the columns of $A$ correspond to the non-tree edges $E \setminus T$ and $A_{e,f} = 1$ holds if and only if the fundamental cycle $T \cup \{f\}$ contains edge $e$. If this is the case, }% a \emph{copy reduction} (resp.\ \emph{unit reduction}) of a row corresponds to a contraction of \reviewFix{a tree} edge that is in series with (resp.\ parallel to) another edge. Conversely, a \emph{copy reduction} (resp.\ \emph{unit reduction}) of a column corresponds to the deletion of \reviewFix{a non-tree} edge that is parallel to (resp.\ in series with) another edge. \reviewComment{% What is a cut edge in this context? }{Clarified}% Finally, a \emph{zero reduction} of a row corresponds to the contraction of a cut edge \reviewFix{% (i.e., an edge whose removal disconnects its endnodes)}, while a \emph{zero reduction} of a column corresponds to the deletion of a loop. See Chapter~4.3 in Truemper's book~\cite{Truemper90} for proofs. \reviewComment{% The paper says in the introduction that one can obtain an ``almost-linear'' time algorithm by applying the recognition algorithm for series-parallel graphs. Here, it is unclear what ``almost-linear'' means and whether the algorithm presented in the present paper improved upon this. }{Clarified both aspects.}% \reviewComment{% ``The recognition problem for series-parallel graphs can be solved in linear time'' --> should this be ``almost linear'' time? Or is forming the graph the step that is almost linear? }{Indeed it is forming the graph step.} \reviewComment{% It should be defined in which sense the algorithm is linear (= number of nonzeros). }{Made this precise.}% \reviewFix{% Not every matrix represents a graph, but one can recognize in almost-linear time whether this is the case~\cite{Fujishige80,BixbyW88}. Here, \emph{linear} refers to the number $k$ of nonzeros of the given matrix, where assume $k \geq m,n$ throughout the paper. Moreover, almost linear refers to $\orderO(k \cdot \alpha(k))$, where $\alpha$ denotes the \emph{inverse Ackermann function}~\cite{Tarjan75}. The term ``almost linear'' is justified since $\alpha(k) \leq 4$ holds for all practically relevant values of $k$, namely for $k \leq 2^{65536}$. }% The recognition problem for series-parallel graphs can be solved in linear time~\cite{ValdesTL82} \reviewFix{(in the number of nodes and edges of the graph).} This immediately yields an almost-linear-time algorithm for \cref{prob_sp} by computing a graph $G$ represented by $A$ and then testing whether $G$ is series-parallel. \reviewComment{% It also remains unclear whether there are certifying algorithms based on the recognition problem for graphs. }{Added a discussion on this below.}% \reviewFix{% \paragraph{Contribution.} First, our work improves upon the almost linear running time by removing the factor $\alpha(k)$. Second, it yields a much simpler algorithm since the computation of $G$ is quite involved. Third, our extended algorithm find, for a given non-series-parallel matrix, a forbidden submatrix as a certificate for not begin series-parallel. It is unclear how to obtaining such a certificate via the alternative approach sketched above, in particular because the algorithms~\cite{Fujishige80,BixbyW88} are not certifying. Of course, one can always construct such a matrix by successively removing rows or columns and running the recognition algorithm again, but this clearly increases the running time from linear to quadratic. Fourth, our algorithm can -- in contrast to the previous approach -- }% determine a maximal sequence of SP-reductions that can be applied to a given matrix (see \cref{sec_reduction}). This is a useful preprocessing step for every recognition problem for matrix classes that are closed under adjoining zero or unit vectors or copies of existing rows/columns. \reviewFix{Examples} of such a matrix \reviewFix{classes are} totally unimodular~\cite[Chapters~19 and~20]{Schrijver86}, \reviewFix{balanced~\cite{Berge72}, perfect~\cite{Padberg84} and ideal~\cite{Lehman79} matrices}. In particular, \reviewFix{the algorithm} contributes to improvements for the state-of-the-art implementation of a total unimodularity test~\cite{WalterT13}. \reviewFix{The latter is used regularly by researchers when studying specific mixed-integer programs.} \paragraph{Outline.} In \cref{sec_reduction} we describe our main algorithm. In \cref{sec_nonsp} we describe an extension that computes for a non-series-parallel matrix in linear time a minimal submatrix with the same property. The short \cref{sec_ternary} is about the extension to ternary matrices, i.e., those with entries in $\{-1,0,+1\}$. In \cref{sec_computations} we describe our implementation of the algorithm and report about computational results. \reviewFix{% In particular, we show the practical benefit for the total unimodularity matrix recognition. }% \section{Recognizing series-parallel matrices} \label{sec_reduction} \DeclareDocumentCommand\reduced{}{\mathcal{R}} \DeclareDocumentCommand\queue{}{\mathcal{Q}} \DeclareDocumentCommand\hashtable{}{\mathcal{H}} The definition of series-parallel matrices is symmetric with respect to rows and columns. Hence, we call their (disjoint) union $A$'s \emph{elements} and denote them by $E$. For an element $e \in E$, $A(e)$ denotes the row vector $A_{r,\star}$ if $e$ is row $r$, while it denotes the column vector $A_{\star,c}$ if $e$ is column $c$. We will present an algorithm that sequentially removes elements from the input matrix $A$ until it is SP-reduced. It is easy to see that if an SP-reduction for element $e \in E$ is possible, and another one for $e' \in E$ is carried out, then an SP-reduction for $e$ will also be possible for the reduced matrix. This shows that the order of removal does not matter, and hence $A$ is series-parallel if and only if the SP-reduction procedure terminates with an empty matrix. Due to the simplicity of this algorithm, the only challenge lies in the running time. \subsection{Data structures} In order to achieve its running time, our algorithm relies on a couple of data structures. First, in order to efficiently carry out a sequence of SP-reductions, we store the nonzeros of $A$ in a grid of doubly-linked lists. More precisely, for each nonzero we store pointers to the previous and next nonzeros in the same row and to those in the same column, respectively. We assume that the input matrix $A$ is given in a form that allows the creation of this data structure in linear time. For instance, this is the case if the nonzeros are given as a list that is ordered lexicographically by rows and columns. Moreover, since an SP-reduction would formally cause re-numbering of rows or columns, we actually replace nonzero entries by zeros. Second, for each element $e \in E$, we store the number of nonzeros of $A(e)$, denoted by $|A(e)|_1$ for convenience. This allows us to identify zero or unit reductions in constant time. Third, we maintain a queue $\queue$ that contains all candidate elements for SP-reductions. The main iteration of the algorithm consists in finding out whether an element extracted from $\queue$ admits an SP-reduction. If this is the case, the reduction will be carried out, which may imply the addition of other elements to the queue. Fourth, a hash table $\hashtable$ is used in order to identify copy reductions in constant time. The corresponding hash function $h : E \to \Z$ shall depend on $A(e)$ only. Moreover, we frequently update the hash value of an element $e \in E$ after a nonzero entry has been removed, which means that after one entry of $A(e)$ is modified, re-computing $h(e)$ shall be done in constant time. We present such a hash function $h$ that requires randomization. Let $(p,q) \in \N^n \times \N^m$ be a vector obtained by rounding a vector randomly chosen from a sphere in $\R^{m + n}$ of sufficiently large radius $R$, intersected with the first orthant. We define \begin{equation} h(e) \coloneqq \begin{cases} \transpose{p} \transpose{A(e)} & \text{if $e$ is a row element,} \\ \transpose{q} A(e) & \text{if $e$ is a column element.} \end{cases} \end{equation} Notice that for row elements $e \in E$, $A(e)$ is a row vector, while it is a column vector for column elements. By the choice of $p$ and $q$, $h(e)$ is almost-surely collision-free for large radius $R$. Moreover, if a $1$-entry of $A(e)$ is turned into a $0$-entry, $h(e)$ decreases by a corresponding entry of $p$ or $q$. Hence, the hash value of an element can be updated in constant time. \pagebreak[4] \subsection{Reduction algorithm} With these data structures at hand, we can now state our recognition algorithm. \bigskip \reviewComment{% One could combine steps 2 and 5 of \cref{algo_reduce}. }{Done}% \reviewComment{ Step 16 of \cref{algo_reduce}: write ``with'' instead of ``:''? }{Added this improvement suggestion.}% \begin{algorithm}[H] \DontPrintSemicolon \SetAlgoLined \KwIn{Matrix $A \in \Z^{m \times n}$} \KwOut{Maximal sequence of SP-reductions \newline} Initialize list representation of $A$. \; Initialize empty hash table $\hashtable$ for keys $e \in E$ and values $A(e)$ \reviewFix{and compute $h(e)$ for all $e \in E$.} \; Initialize queue $\queue$ with all $e \in E$. \; Initialize the set $\reduced := \varnothing$ of recorded SP-reductions. \; \While{$\queue$ is not empty} { Extract element $e$ from $\queue$. \label{algo_reduce_extract} \; \uIf{$|A(e)|_1 = 0$} { Add $e$ to $\reduced$ and mark it as \emph{zero reduction}. \label{algo_reduce_zero_record} \; } \uElseIf{$|A(e)|_1 = 1$} { Add $e$ to $\reduced$ and mark it as \emph{unit reduction}. \label{algo_reduce_unit_record} \; Let $f \in E$ be such that $\{e,f\}$ are row and column indices of the $1$-entry of $A(e)$. \; Remove nonzero $\{e,f\}$ from $A$, add $f$ to $\queue$ if necessary, update hash value of $f$, and remove $f$ from $\hashtable$ if necessary. \label{algo_reduce_unit_nonzero} \; } \Else { Check via $\hashtable$ whether there is an element $e' \in E$ such that $A(e) = A(e')$. \label{algo_reduce_copy_check} \; \uIf{$\hashtable$ contains element $e' \in E$ \reviewFix{with} $A(e) = A(e')$} { Add $e$ to $\reduced$ and mark it as \emph{copy reduction for $e'$}. \label{algo_reduce_copy_record} \; \For{each $f$ such that $A(e)_f = 1$} { Remove nonzero $\{e,f\}$ from $A$, add $f$ to $\queue$ if necessary, update hash value of $f$, and remove $f$ from $\hashtable$ if necessary. \label{algo_reduce_copy_nonzero} } } \Else { Add $e$ to $\hashtable$. \label{algo_reduce_add_to_hash} } } } \Return{$\reduced$} \caption{Finding a maximal sequence of SP-reductions.} \label{algo_reduce} \end{algorithm} \bigskip \reviewComment{% \cref{thm_algo_reduce}: One can assume that $k \geq m$ and $k \geq n$, so $\orderO(m + n + k ) = \orderO(k)$. }{Adapted it and added the assumption to the introduction.}% \begin{theorem} \label{thm_algo_reduce} For input matrices with $k$ nonzeros, \cref{algo_reduce} finds a maximal sequence of SP-reductions in expected $\orderO(k)$ time. \end{theorem} \reviewComment{% \cref{algo_reduce} and \cref{thm_algo_reduce}: It should be noted how collisions in the hash table are dealt with. }{Does this really matter? The hash table never contains identical elements, but of course may contain elements with the same hash value. For the analysis, it should not matter whether we use separate chaining or open addressing. However, I added a remark in paragraph about how it is done in the actual implementation.}% \begin{proof} We first show that the algorithm actually finds a maximal sequence of SP-reductions. It is easy to see that all modifications of $A$ correctly reflect the recorded SP-reductions. We claim that the following invariants are satisfied for all elements $e \in E$ throughout the algorithm: \begin{enumerate}[label=(\roman*)] \item \label{eq_algo_reduce_partition} either $e \in \queue$ or $e \in \hashtable$ or $e \in \reduced$; \item \label{eq_algo_reduce_reducible} if an SP-reduction for $e$ is possible for $A$, then $e' \in \queue$ holds for some element with $A(e') = A(e)$. \end{enumerate} \reviewComment{% ``\dots are satisfied at the beginning.'' }{Fixed.}% Since we initialize $\queue$ as $E$, both statements are satisfied \reviewFix{at the beginning}. Now consider an iteration of the main loop in which element $e \in E$ was extracted from $\queue$. Either $e$ is added to $\reduced$ in line~\ref{algo_reduce_zero_record}, line~\ref{algo_reduce_unit_record} or line~\ref{algo_reduce_copy_record} or $e$ is added to $\hashtable$ in line~\ref{algo_reduce_add_to_hash}. Moreover, if the SP-reduction causes the removal of nonzeros $\{e,f\}$ in line~\ref{algo_reduce_unit_nonzero} or line~\ref{algo_reduce_copy_nonzero}, then it is ensured that $f \in \queue$ and $f \notin \hashtable$ hold. This establishes invariant~\ref{eq_algo_reduce_partition}. Consider, for the sake of contradiction, a first iteration after which invariant~\ref{eq_algo_reduce_reducible} is violated, i.e., an SP-reduction for $\hat{e}$ is possible, but no $e' \in E$ with $A(e') = A(\hat{e})$ is in the queue. Moreover, for each such $e'$ we have $e' \notin \reduced$ and thus $e' \in \hashtable$ by the invariant~\ref{eq_algo_reduce_partition}. If $\hat{e}$ was extracted from $\queue$ in this iteration, i.e., $\hat{e} = e$ holds, then we must have added $\hat{e}$ to $\hashtable$ in line~\ref{algo_reduce_add_to_hash}. In particular, the SP-reduction must be a copy reduction for some other element $e' \in E$. Since we argued that $e' \in \hashtable$ holds, we obtain a contradiction to the fact that we reached line~\ref{algo_reduce_add_to_hash}. Otherwise, $\hat{e}$ must have become SP-reducible, i.e., $\hat{e} = f$ holds for some element $f \in E$ for which $\{e,f\}$ is a nonzero of $A$. However, in the corresponding lines~\ref{algo_reduce_unit_nonzero} and~\ref{algo_reduce_copy_nonzero}, such elements $f$ are added to $\queue$, which yields a contradiction. We conclude that also invariant~\ref{eq_algo_reduce_reducible} holds. The total number of iterations is bounded by $m + n + k$ since $|\queue| = |E| = m + n$ holds initially, and since further additions to $\queue$ happen at most once per (removed) nonzero. This shows that the algorithm terminates, and by invariants~\ref{eq_algo_reduce_partition} and~\ref{eq_algo_reduce_reducible} with maximal $\reduced$. It also shows that lines~\ref{algo_reduce_extract}, \ref{algo_reduce_zero_record}, \ref{algo_reduce_unit_record}, \ref{algo_reduce_unit_nonzero}, \ref{algo_reduce_copy_check}, \ref{algo_reduce_copy_record} and~\ref{algo_reduce_add_to_hash} are each executed at most $m+n+k$ times. Clearly, lines~\ref{algo_reduce_copy_record} and~\ref{algo_reduce_copy_nonzero} are executed at most $k$ times since each time a nonzero is removed from $A$. Due to the data structures and the properties of the hash function, each of these lines can be executed in constant time, where this holds for lines~\ref{algo_reduce_unit_nonzero} and~\ref{algo_reduce_copy_nonzero} almost surely. We conclude that the overall running time is linear in $m + n + k$ in expectation. \end{proof} \section{Certifying non-series-parallel matrices} \label{sec_nonsp} \reviewComment{% The importance of \cref{sec_nonsp} was also not clear to me. In \cref{sec_intro}, the author mentions that ``a matrix is series-parallel if there is a sequence of SP-reductions that yields the empty matrix.'' Then, in the beginning of Section II, it is stated that ``$A$ is series-parallel if and only if the SP-reduction procedure terminates with an empty matrix'' Given these two statements, it seems that \cref{prob_sp} can be answered by executing \cref{algo_reduce}, and checking whether the result is an empty matrix. Then, what is the added value of \cref{algo_wheel_search}? Are there cases where a wheel sub-matrix is more valuable that \cref{algo_reduce} returning a non-empty matrix? }{Added a paragraph for motivating why a certificate submatrix is valuable.}% \reviewComment{% Clearly, to have a certificate for not being series-parallel is a nice thing. However, it would be helpful to at least discuss where this might be used. For instance, the author could discuss how (large) submatrices that are series-parallel can be found or how one can change the entries of the matrix to obtain a series-parallel matrix. }{Added a paragraph for motivating why a certificate submatrix is valuable. I fully agree that knowledge of the submatrices helps to find large series-parallel submatrices. However, I was unable to motivate why one would want to search for these. However, I added another actual application.}% \reviewFix{% In case a given matrix $A$ is series-parallel, the list of SP-reductions produced by \cref{algo_reduce} yields a certificate, i.e., an easily verifiable reason for begin series-parallel. However, in the case that $A$ is not series-parallel, a user has to trust the correctness of its implementation. Hence, it is desirable to be able to provide a simple reason for this negative outcome as well. The goal of this section is to extend the algorithm as to provide such a certificate in terms of forbidden submatrices. The latter are minimal non-series-parallel matrices, i.e., matrices that are not series-parallel, but for which every proper submatrix is series-parallel. }% \reviewFix{% Moreover, these matrices are required as a starting point in Truemper's the total unimodularity testing algorithm~\cite{Truemper90}. There, a submatrix that is the representation matrix of a \emph{wheel graph $W_\ell$ with $\ell$ spokes} (that is, a cycle of length $\ell$ plus one node that is connected to every other node via a \emph{spoke} edge) must be found, which is then, by applying so-called pivot operations to the matrix, turned into one for $W_3$. To see that this is possible, observe that every wheel graph with at least 4 spokes can be turned into a wheel graph with one spoke less by deleting a spoke edge and contracting a \emph{rim} edge, i.e., an edge from the cycle. }% \reviewComment{% Two of its representation matrices \dots" -- this is unclear. That is, it is unclear how the two matrices correspond to a wheel. $M_\ell$ actually is the incidence matrix of a cycle, not a wheel. Similarly, $M_\ell'$ corresponds to a cycle with one additional edge. }{In the introduction it is now defined what the representation matrix of a graph actually is. Also added a concrete explanation for wheel matrices.}% Two of its representation matrices are of interest to us, namely \begin{align*} M_\ell &\coloneqq \begin{pmatrix} 1 & 0 & 0 & 0 & \dotsb & 0 & 1 \\ 1 & 1 & 0 & 0 & \dotsb & 0 & 0 \\ 0 & 1 & 1 & 0 & \dotsb & 0 & 0 \\ 0 & 0 & 1 & 1 & \ddots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & 0 & \dotsb & 1 & 0 \\ 0 & 0 & 0 & 0 & \dotsb & 1 & 1 \end{pmatrix} ,& M_\ell' &\coloneqq \begin{pmatrix} 1 & 1 & 0 & 0 & \dotsb & 0 & 1 \\ 1 & 1 & 0 & 0 & \dotsb & 0 & 0 \\ 0 & 1 & 1 & 0 & \dotsb & 0 & 0 \\ 0 & 0 & 1 & 1 & \ddots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & 0 & \dotsb & 1 & 0 \\ 0 & 0 & 0 & 0 & \dotsb & 1 & 1 \end{pmatrix}, \end{align*} which we call \emph{wheel matrices}. \reviewFix{% To see that $M_{\ell}$ represents $W_\ell$, consider the spanning tree $T$ consisting of only the spokes. Then every rim edge closes a cycle containing exactly two rim edges, which correspond to the 1s in its column. For $M_{\ell}'$, the spanning tree is almost the same, except that one spoke edge is replaced by an adjacent rim edge. }% Notice that $M_\ell$ and $M_\ell'$ differ only in the entry in the first row and second column. It is easy to see that both matrices are SP-reduced. We say that a matrix \emph{contains a wheel-submatrix} if it contains a wheel matrix as a submatrix, possibly after permuting rows or columns. We will show that the following holds. \reviewComment{% ``We will show that the following holds \dots'' -- actually the proof is omitted. }{We add a proof after \cref{thm_algo_wheel_search}.}% \begin{theorem} \label{thm_characterization} A binary matrix is either series-parallel or it contains a wheel-submatrix. \end{theorem} \reviewComment{ Should \cref{thm_characterization} be moved a place after \cref{thm_algo_wheel_search}? }{I think that it is useful that the reader knows that all forbidden submatrices are wheel matrices.}% The proof is delayed as it follows from the correctness of our algorithm that returns one of these matrices as a submatrix when confronted with a matrix that is not series-parallel (see \cref{thm_algo_wheel_search}). Using matroid operations, the certificate can be simplified even further. The following corollary is a strengthening of Theorem~4.2.13 in Truemper's book~\cite{Truemper98}, where only the case of connected matroids is discussed. \begin{corollary} A binary matroid is either series-parallel or contains the graphic matroid of $W_3$ as a minor. \end{corollary} \begin{proof} The result follows from \cref{thm_characterization} by observing that a graphic matroid of $W_\ell$ with $\ell \geq 3$ contains the graphic matroid of $W_3$ as \reviewFix{a} minor. In fact, a binary pivot operation on the entry in the second row and first column of $M_\ell$ yields $M_\ell'$, and $M_\ell'$ contains $M_{\ell-1}$ as a submatrix. Repeated application yields $M_3$ after $\ell-3$ pivots. \end{proof} \subsection{Bipartite graph} \label{sec_nonsp_bipartite_graph} \reviewComment{% Add a sentence of what this section tries to achieve? }{Added an explanation.}% \reviewFix{% We now introduce a graph-theoretic viewpoint on our matrix $A$ that is important for the detection of wheel matrices. }% \reviewComment{% ``on on'' -> ``on one'' }{Fixed.}% A binary matrix $A \in \{0,1\}^{m \times n}$ gives rise to a \emph{bipartite graph}, denoted by $\BG(A)$, which has $m$ nodes on \reviewFix{one} side $R$ and $n$ nodes on the other side $C$ of the bipartition and those edges $\{r,c\}$ (with $r \in R$, $c \in C$) for which $A_{r,c} = 1$. It is easy to see that $\BG(M_\ell)$ is a chordless cycle of length $2\ell$. Hence, the basic idea of our recognition algorithm is to first apply \cref{algo_reduce} and then to find a chordless cycle in $\BG(A)$ of length at least $6$ in the SP-reduced matrix $A$. Chordless cycles can be found using breadth-first search. However, it may turn out that all found cycles have length $4$, which corresponds to a $2$-by-$2$ matrix with only $1$s. \reviewComment{% ``we can use a the following'' --> I think the ``a'' should be dropped }{Fixed.}% \reviewComment{% What is the contribution of~\cite{Truemper90}? }{Rephrased to make that clearer.}% \reviewFix{In his paper~\cite{Truemper90}, Truemper describes a way to enforce finding a longer cycle (if one exists).} Grow the submatrix consisting of $1$s to an inclusion-wise maximal one, indexed by rows $X$ and columns $Y$. Search for a shortest path $P$ from $X$ to $Y$ in $\BG(A)$ without using an edge corresponding to a $1$ in this submatrix. \reviewComment{% missing parenthesis }{Fixed.}% If $P$ exists, then the submatrix induced \reviewFix{by} $P$ and one additional row and column is of type $M_{\ell}'$ (the top-left $2$-by-$2$ submatrix of $M_{\ell}'$ is part of the all-$1$s submatrix\reviewFix{)}. \begin{figure}[htb] \begin{equation*} \begin{pmatrix} 1 & 1 & 1 & 1 & 0 & \textcolor{red}1 & 0 & 0 & \textcolor{red}1 \\ 1 & 1 & 1 & 1 & 0 & \textcolor{red}1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & \textcolor{red}1 & \textcolor{red}1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & \textcolor{red}1 & \textcolor{red}1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & \textcolor{red}1 & \textcolor{red}1 \\ 0 & 0 & 0 & 0 & 0 & 0 & \textcolor{red}1 & 0 & \textcolor{red}1 \\ \textcolor{blue}1 & \textcolor{blue}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & \textcolor{blue}1 & \textcolor{blue}1 & 0 & \textcolor{blue}1 & 0 & 0 & 0 & 0 \\ \textcolor{blue}1 & \textcolor{blue}1 & 0 & 0 & \textcolor{blue}1 & 0 & 0 & 0 & 0 \end{pmatrix} \end{equation*} \caption{An SP-reduced matrix $A$ with inclusion-wise maximal all-$1$s submatrix in the upper left part. Every path in $\BG(A)$ from the first three rows $X$ to the first four columns $Y$ must use an edge from this submatrix. The edges corresponding to the part reachable from $X$ are colored red, while those reachable from $Y$ are colored blue.} \label{fig_bipartite_graph_no_path} \end{figure} \pagebreak[4] \subsection{Separations} \label{sec_nonsp_separations} In case such a path does not exist, we have found a \emph{$2$-separation} of $A$, which is a partitioning of $A$'s rows into $X^1$ and $X^2$ and $A$'s columns into $Y^1$ and $Y^2$ such that $\rank(A_{X^1,Y^2}) + \rank(A_{X^2,Y^1}) = 1$ and $|X^i|+|Y^i| \geq 2$ holds for $i=1,2$. After reordering of rows and columns, $A$ looks as in \cref{fig_two_separation}. \reviewComment{% How is the 2-sum decomposition of $A$ defined? }{Rephrased the sentence so that it is apparent that it \emph{is} the definition.}% \reviewFix{% The decomposition of $A$ into $A^1$ and $A^2$ is called a \emph{$2$-sum decomposition}. For matroids, it }% corresponds to a $2$-sum decomposition involving the corresponding represented matroids. However, we will work only on the matrix level and never exploit any matroid structure. The $2$-separation for the example in \cref{fig_bipartite_graph_no_path} can be readily seen: the rank-1 submatrix is the $7$-by-$5$ submatrix in the upper left, $B$ is the (smallest) submatrix containing all red $1$s, while $C$ is the (smallest) submatrix containing all blue $1$s. \begin{figure}[htb] \begin{center} \begin{tikzpicture} \matrix (mat) [matrix of math nodes, inner sep=0, column sep=0, nodes={inner sep=3mm,text height=1em, text width=2em,align=center},ampersand replacement=\&,nodes in empty cells] {% B \& b \transpose{c} \\ \zerovec \& C \\ }; \draw[very thick] (mat-1-1.north west) rectangle (mat-2-2.south east); \draw (mat-1-2.north west) -- (mat-2-2.south west); \draw (mat-1-1.south west) -- (mat-1-2.south east); \node[left=2mm of mat-1-1.south west] {$A = $}; \matrix (matB) [right=20mm of mat, matrix of math nodes, inner sep=0, column sep=0, nodes={inner sep=3mm,text height=1em, text width=1em,align=center},ampersand replacement=\&,nodes in empty cells] {% B \& |[inner xsep=0mm]|b \\ }; \draw[very thick] (matB-1-1.north west) rectangle (matB-1-2.south east); \draw (matB-1-1.north east) -- (matB-1-1.south east); \node[left=2mm of matB-1-1.west] {$A^1 = $}; \matrix (matC) [right=20mm of matB, matrix of math nodes, inner sep=0, column sep=0, nodes={inner sep=3mm,text height=1em, text width=1em,align=center},ampersand replacement=\&,nodes in empty cells] {% |[inner ysep=0.5mm]| \transpose{c} \\ C \\ }; \draw[very thick] (matC-1-1.north west) rectangle (matC-2-1.south east); \draw (matC-1-1.south west) -- (matC-1-1.south east); \node[right=8mm of matB-1-2.east] {$A^2 = $}; \end{tikzpicture} \end{center} \caption{Partitioned version of a $2$-separable matrix $A$ that is decomposed into a $2$-sum of $A^1$ and $A^2$ at the last column and first row, respectively. Note that it is required that $B$ and $C$ each have at least $2$ elements and that $b$ and $c$ are nonzero, i.e., $b \transpose{c}$ has rank~1.} \label{fig_two_separation} \end{figure} One may be tempted to recursively search for a wheel submatrix in both parts of the $2$-separation. However, this may lead to an increased running time, and it turns out that both parts will contain such a submatrix. \begin{lemma} \label{thm_two_separation_part} For a $2$-sum decomposition of an SP-reduced matrix $A \in \{0,1\}^{m \times n}$ as in \cref{fig_two_separation}, neither of submatrices $A^1$ and $A^2$ is series-parallel. \end{lemma} \begin{proof} By symmetry it suffices to prove the statement for $A^1$. For the sake of contradiction, assume that $A^1 = [B \mid b]$ is series-parallel and that among all $2$-separations of matrices $A$ with the same number of elements, $A^1$ has a minimum number of elements. Note that $A^1$ has at least $3$ rows and $3$ columns since otherwise there would be an SP-reduction applicable to $A$. Because $A$ is SP-reduced, the only SP-reductions applicable to $[B \mid b]$ can be column reductions that involve $b$ or a unit row reduction with a $1$-entry in $b$. We distinguish the possible reductions. \reviewComment{% Is the $c$ the same vector as in the definition of $A^2$. }{No. Replaced $c$ by $d$ to avoid confusion.}% \medskip \noindent \textbf{Case 1: $b$ is \reviewFix{identical} to a column $\reviewFix{d}$ of $B$.} We can remove the column $\reviewFix{d}$ from $B$ and attach it to $C$. Then the lower-left submatrix (in \cref{fig_two_separation}) remains a zero matrix and the upper-right matrix remains a rank-1 submatrix, just with one more column than in the given $2$-separation. This yields another $2$-separation, which violates our assumption on the size of $A^1$. \medskip \noindent \textbf{Case 2: $b$ is a unit vector.} We can remove the row $r$ in which $b$ has the unique $1$-entry from $B$ and attach it to $C$. This turns the upper-right submatrix into a zero matrix and the lower-left one into a rank-1 submatrix with nonzeros only the row $r$. This yields a $2$-separation of $\bar{A} = \transpose{A}$ into $\bar{A}^1$ and $\bar{A}^2$ such that $\bar{A}^1$ has one element less than $A^1$, which contradicts our assumption on $A$ and the $2$-separation. \medskip \noindent \textbf{Case 3: for some row $r'$, $b_{r'} = 1$ and $B_{r',\star} = \zerovec$ hold.} We can remove the row $r'$, which effectively sets $b_{r'} = 0$. Unless Case~1 or Case~2 were already applicable before, they must be applicable now, since otherwise there is no SP-reduction possible. In both cases, we also attach row $r'$ to $C$ (in addition to column $c$ or row $r$, respectively). \medskip \noindent We conclude that such a matrix $A$ with such a $2$-separation cannot exist, which completes the proof. \end{proof} Hence, it suffices to only consider the smaller of the two components $A^1$, $A^2$ for a recursive search. Note that $A^1$ (or $A^2$) is not necessarily SP-reduced, and hence we need to apply \cref{algo_reduce} again. \subsection{Wheel search algorithm} \label{sec_nonsp_algorithm} The previous discussion leads to the following recursive algorithm for searching a wheel-submatrix. \bigskip \begin{algorithm}[H] \DontPrintSemicolon \SetAlgoLined \KwIn{Matrix $A \in \{0,1\}^{m \times n}$} \KwOut{Either ``$A$ is series-parallel'' together with a list of $m+n$ SP-reductions, \newline or ``$A$ is not series-parallel'' together with a wheel-submatrix of $A$. \newline} Run \cref{algo_reduce} for $A$, obtain $\reduced$ and replace $A$ by the reduced matrix. \label{algo_wheel_search_reduce} \; \lIf{$|\reduced|=m+n$}{\Return{``$A$ is series-parallel'' \textnormal{together with} $\reduced$.}} \Else { Let $A'$ be the SP-reduced matrix. \; Run breadth-first search in $\BG(A')$ to find a chordless cycle $C$ of length $2 \ell$ for some $\ell \in \N$. \label{algo_wheel_search_first_bfs} \; \eIf{$C$ exists} { Let $B$ be the submatrix of $A$ indexed by all rows and columns of $C$. \; \lIf{$\ell \geq 3$} { \Return{``$A$ is not series-parallel'' \textnormal{together with} $B$.} \label{algo_wheel_search_long_cycle} } \Else { Grow $B$ to a maximal submatrix of $A'$ that contains only $1$s and let $X$ and $Y$ be the row and column sets of $B$, respectively. \; Define $A''$ to be $A'$ with the entries of $B$ replaced by $0$s. \; Using breadth-first search, search for a (shortest) path $P$ from $X$ to $Y$ in $\BG(A'')$. \label{algo_wheel_search_second_bfs} \; \uIf{$P$ exists} { Let $c$ be the column that comes directly after $P$'s starting node from $X$. \label{algo_wheel_search_path_column} \; Let $r' \in X$ be such that $A_{r',c} = 0$. \; Let $r$ be the row that comes directly before $P$'s end node from $Y$. \label{algo_wheel_search_path_row} \; Let $c' \in Y$ be such that $A_{r,c'} = 0$. \label{algo_wheel_search_path_row_zero} \; Let $B'$ be the submatrix indexed by all rows and columns of $P$, row $r'$ and column $c'$. \; \Return{``$A$ is not series-parallel'' \textnormal{together with} $B'$.} } \Else { The nodes reachable from $X$ induce a $2$-separation of $A$ with parts $A^1$ and $A^2$. \; Let $i \in \{1,2\}$ be such that $A^i$ has the minimum number of elements. \; \Return{} output of recursive call of \cref{algo_wheel_search} for $A^i$. \label{algo_wheel_search_recurse1} } } } { The nodes reachable from the source node of the search induce a $2$-separation of $A$ with parts $A^1$ and $A^2$. \; Let $i \in \{1,2\}$ be such that $A^i$ has the minimum number of elements. \; \Return{} output of recursive call of \cref{algo_wheel_search} for $A^i$. \label{algo_wheel_search_recurse2} } } \caption{Certifying recognition algorithm for binary series-parallel matrices.} \label{algo_wheel_search} \end{algorithm} \bigskip \begin{theorem} \label{thm_algo_wheel_search} Let $A \in \{0,1\}^{m \times n}$ have $k$ nonzeros. Then \cref{algo_wheel_search} determines in expected $\orderO(k)$ time whether $A$ is series-parallel and if not, finds a wheel-submatrix of $A$. \end{theorem} \begin{proof} We first discuss the correctness of the algorithm and then turn to its running time. After line~\ref{algo_wheel_search_reduce}, $A$ is SP-reduced, which implies that $\BG(A)$ is not a forest. Hence, the breadth-first search in line~\ref{algo_wheel_search_first_bfs} finds a chordless cycle of length at least $4$. As explained in \cref{sec_nonsp_bipartite_graph}, a chordless cycle of length at least $6$ in $\BG(A)$ corresponds to a submatrix $M_{\ell}$ for $\ell \geq 3$, which is returned in line~\ref{algo_wheel_search_long_cycle} if such a cycle is found. Otherwise, path $P$ is searched for in line~\ref{algo_wheel_search_second_bfs}. Suppose, $P$ exists. By maximality of the submatrix $B$, in line~\ref{algo_wheel_search_path_column}, $A_{X,c}$ is not the all-$1$s vector, and hence, $r'$ is well defined. Similarly, $c'$ from line~\ref{algo_wheel_search_path_row_zero} is well defined. We claim that the matrix $B'$ is of the form $M_{\ell}'$. To see this, observe that among the rows $X$, exactly two belong to $B'$, one with $A_{r',c} = 0$ and one with a $1$-entry in column $c$. Similarly, exactly two of the columns $Y$ belong to $B'$, one with $A_{r,c'} = 0$ and one with a $1$-entry in row $r$. The fact that $P$ is a shortest $X$-$Y$-path ensures that $B'$ has all other required $0/1$-entries. If $P$ does not exist, the $2$-separation of $A$ is easily verified. \cref{thm_two_separation_part} ensures that we can restrict our search to any of the parts $A^1$, $A^2$. Clearly, the recursion will terminate since $A^i$ in line~\ref{algo_wheel_search_recurse1} or line~\ref{algo_wheel_search_recurse2} has fewer elements than $A$. \reviewComment{% The evaluation of the recursion is not clear, since the run time for one call of the function is not taken into account. I would suggest to setup and solve a recursion for the run time. }{Added the recurrence relation.}% We now prove that the algorithm runs in expected linear time. The bipartite graph $\BG(A)$ has $m + n \in \orderO(k)$ nodes and $k$ edges, and hence the breadth-first search runs in $\orderO(k)$ time. Hence, all lines except for the recursive calls in lines~\ref{algo_wheel_search_recurse1} and~\ref{algo_wheel_search_recurse2} can be carried out in time $\orderO(k)$. To bound the overall running time, let $f(k)$ denote the running time of the algorithm for matrices with $k$ nonzeros (and at most $k$ rows and columns). Let $k_1$ and $k_2$ be the number of nonzeros of $A^1$ and $A^2$, respectively. We obtain \begin{equation*} k = |X| \cdot |Y| ~+~ (k_1 - |X|) ~+~ (k_2 - |Y|). \end{equation*} For the smaller of the two, $k_i$, we obtain \begin{equation*} 2k_i \leq k_1 + k_2 = k - |X| \cdot |Y| + |X| + |Y| = k - (|X|-1) \cdot (|Y|-1) + 1. \end{equation*} which implies $k_i \leq k/2$ since $|X|,|Y| \geq 2$ holds. \reviewFix{This yields the recurrence relation $f(k) = \orderO(k) + f(k/2)$, which yields $f(k) = \orderO(k)$.} \end{proof} A few remarks can be made. First, \cref{algo_wheel_search} can be modified\footnote{By removing the second row and the first column of a matrix $M_{\ell'}$.} to return an $M_{\ell-1}$ submatrix of $M_{\ell}'$ in case $\ell \geq 4$. The modified algorithm will then either return the submatrix $M_3'$ or a submatrix $M_{\ell}$ for $\ell \geq 3$, all of which are \emph{inclusion-wise minimal} non-series-parallel submatrices. Second, it can be modified to either return the sequence of SP-reductions in case $A$ is determined to be series-parallel, or return a wheel-submatrix otherwise, making it a certifying algorithm for the recognition problem. \reviewFix{% \begin{proof}[Proof of \cref{thm_characterization}.] It follows from \cref{thm_algo_wheel_search} that every matrix that is not series-parallel must contain a wheel matrix. Moreover, wheel matrices are SP-reduced, and hence they are not series-parallel. This concludes the proof. \end{proof} }% \section{Extension to ternary matrices} \label{sec_ternary} Scaling rows or columns of representation matrices by $-1$ does not change the underlying matroid. While this has no effect for the binary field due to $-1 \equiv +1 \pmod 2$, it does matter for the ternary field. Our techniques easily be extend to this case by allowing to scale rows and columns by $-1$. Hence, a ternary series-parallel matrix is constructed from a ternary $1$-by-$1$ matrix by successively adding zero rows/columns, (negated) unit row/column vectors or (negated) copies of existing rows/columns. We call the corresponding reductions \emph{ternary SP-reductions}. \paragraph{Reduction algorithm.} \cref{algo_reduce} naturally extends as well: we can replace our hash function $h: E \to \Z$ by $h' : E \to \N$ defined via $h'(e) \coloneqq |h(e)|$. If there exist elements $e, e' \in E$ with $A(e) = -A(e')$, we will have $h(e) = -h(e')$ and thus $h'(e) = h'(e')$. Hence, we will almost surely have collisions (only) for copies and for negated copies. Clearly, also the check for equality of $A(e)$ and $A(e')$ has to be adapted to also detect negated copies. However, neither of the changes affects the asymptotic runtime. For the remainder of this section we thus consider \cref{algo_reduce} to be modified accordingly. \reviewComment{% Why not write $|A|$ instead of $\supp(A)$? }{I would expect that $|A|$ is a number, e.g., some norm of $A$.}% \paragraph{Certificates.} By definition, every SP-reduction for a ternary matrix $A$ induces a corresponding SP-reduction for the (binary) support matrix $\supp(A)$. Hence, if even $\supp(A)$ admits no (binary) SP-reduction, then any corresponding certificate also shows that $A$ is not ternary series-parallel. In other words, for $\ell \geq 3$, the submatrices $M_\ell$ or $M_{\ell}'$ of $\supp(A)$ constitute certificates that can be found in expected linear time. \reviewComment{% I do not understand why the arguments imply that $A$ contains the matrix $N_2$ (also note that $N_2$ has a name clash with the wheel matrix $N_2$). }{Renamed $M_2$ to $N_2$. Technically, there was no name clash because $M_\ell$ was only defined for $\ell \geq 3$, but of course readers should not get confused. The arguments below were elaborated.}% \reviewFix{% In addition, it is possible that our matrix $A \in \{-1,0,+1\}^{m \times n}$ is ternary SP-reduced but $\supp(A)$ is not binary SP-reduced. In this case, no zero- or unit reduction can be possible for $\supp(A)$ since the same reduction would be applicable to $A$ as well. Hence, there must exist a binary copy reduction of $\supp(A)$ that does not correspond to a ternary copy reduction of $A$. Without loss of generality, we consider only row copy reductions. Thus, there exist rows $r$ and $r'$ such that $A_{r,\star} \neq A_{r',\star}$ and $A_{r,\star} \neq -A_{r',\star}$ but $\supp(A)_{r,\star} = \supp(A)_{r',\star}$ holds. Hence, there must exist columns $c$ and $c'$ such that $A_{r,c} = A_{r',c}$ and $A_{r,c'} = -A_{r',c'}$. }% This implies that $A$ contains (up to scaling of rows/columns) the matrix \begin{align*} N_2 &\coloneqq \begin{pmatrix} -1 & 1 \\ 1 & 1 \end{pmatrix} \end{align*} as a submatrix. Clearly, $N_2$ is not series-parallel. We call a submatrix of $A$ a \emph{signed} $B$-submatrix if it contains a submatrix that can be turned to $B$ by multiplying rows or columns with $-1$. \bigskip \begin{algorithm}[H] \DontPrintSemicolon \SetAlgoLined \KwIn{Matrix $A \in \{-1,0,1\}^{m \times n}$} \KwOut{Either ``$A$ is series-parallel'' together with a list of $m+n$ ternary SP-reductions, \newline or ``$A$ is not series-parallel'' together with a signed wheel- or $N_2$-submatrix of $A$. \newline} Run modified \cref{algo_reduce} for $A$ obtaining $\reduced$. \label{algo_ternary_search_reduce} \; \eIf{$|\reduced| = m + n$} { \Return{``$A$ is series-parallel'' \textnormal{together with} $\reduced$.} } { Let $A'$ arise from $A$ by applying all SP-reductions $\reduced$. \; Run \cref{algo_wheel_search} for $\supp(A')$ obtaining either $\reduced'$ or submatrix $B'$ of $\supp(A')$. \label{algo_ternary_wheel} \; \eIf{$\supp(A')$ is not series-parallel} { Let $B''$ be the signed wheel-submatrix of $A$ corresponding to $B'$. \; \Return{``$A$ is not series-parallel'' \textnormal{together with} $B''$.} } { Let $e,e' \in E$ with $\supp(A'(e)) = \supp(A'(e'))$ be the elements of the first SP-reduction in $\reduced'$. \; Let $f,f' \in E$ be such that $A'(e)_f = A'(e')_f \in \{-1,+1\}$ and $A'(e)_{f'} = -A'(e')_{f'} \in \{-1,+1\}$. \; Let $B''$ be the submatrix of $A'$ induced by $e$, $e'$, $f$ and $f'$. \; \Return{``$A$ is not series-parallel'' \textnormal{together with} $B''$.} } } \caption{Certifying recognition algorithm for ternary series-parallel matrices.} \label{algo_ternary} \end{algorithm} \bigskip By the discussion above, correctness of \cref{algo_ternary} follows naturally. \begin{theorem} \label{thm_algo_ternary} Let $A \in \{-1,0,1\}^{m \times n}$ have $k$ nonzeros. Then \cref{algo_ternary} determines in expected $\orderO(k)$ time whether $A$ is series-parallel and if not, finds a signed wheel- or $N_2$-submatrix of $A$. \end{theorem} \paragraph{Structure.} We obtain the following characterization of ternary series-parallel matrices. \begin{theorem} A ternary matrix is either series-parallel or it contains a signed wheel- or $N_2$-submatrix. \end{theorem} The matrix $N_2$ represents the uniform matroid of rank~$2$ with $4$ elements, denoted by $U_4^2$, which is the unique forbidden minor for binary matroids~\cite{Tutte58a}. In this light, the following corollary is not surprising. \begin{corollary}[Section~4.5 in~\cite{Truemper98}] A matroid is either series-parallel or contains the graphic matroid $W_3$ or the uniform matroid $U_4^2$ as a minor. \end{corollary} \section{Computational study} \label{sec_computations} \reviewComment{% Are there other implementations of SP-reductions? If so, how does the proposed implementation compares? }{No, I am not aware of any other implementations.}% \reviewComment{% It would be good to note the implementation language. }{Added this information.}% \reviewComment{% In \cref{sec_intro}, the author mentions that an almost-linear algorithm is obtained by computing a graph represented by $A$, then testing whether $G$ is series parallel. \cite{BixbyW88} seems to indicate that the complexity of the graph-based algorithm is linear due a constant that takes small values for all practical instances. Can the author compare their implementation to the graph-based algorithm? }{Added a comparison with our implementation of the graphicness test~\cite{BixbyW88} to \cref{sec_computations_random}.}% \reviewComment{% In \cref{sec_intro}, the author mentions that SP-reductions can benefit the total unimodularity test. It would strengthen the paper's contribution if the author showed the practical benefits of performing an SP reduction before running the test described in \cite{WalterT13}. }{Added such an experiment in \cref{sec_computations_mip}.}% \reviewComment{% I also have to following suggestions about the computational results: Currently, it is not clear after how many iterations the algorithm stops. Thus, a fast run time could just mean that the algorithm terminates early. Moreover, how large are the certificates on average? }{Added this information in the evaluation for the random matrices.} \reviewComment{% In addition, I would suggest a different construction of instances: Randomly build matrices by applying series-parallel constructions. Then randomly change some entries. This would increase the chance of being series-parallel and also allow to test the run time on series-parallel instances only. Actually, the run time should be evaluated on the two cases separately as well. }{We added more instance classes and experiments. Note that the subsections are not highlighted in red since they were written from scratch.} We start by describing the changes that we made for our implementation \reviewFix{in the C programming language}. First, we decouple hashing of rows from hashing of columns by maintaining two hashtables. Second, instead of a random vector $p \in \N^n$ for hashing of columns we use a deterministic one, defined via $p_i \coloneqq 3^i \text{ mod } 2^{62}$ for $i = 1,2,\dotsc,n$. This makes the algorithm deterministic for the price of not running in linear time due to potential hashtable collisions. However, in our experiments we never encountered any collisions. Note that our integer data types would in principle admit the range $[-2^{63},2^{63}) \cap \Z$. However, we use one bit less to detect overflows, which allows us to ensure that vectors $x$ and $-x$ receive the same hash value (see \cref{sec_ternary}). \reviewFix{The implemented hash table uses separate chaining via singly linked lists in order to resolve collisions.} Hashing of rows is done in an identical way. The implementation is part of the Combinatorial Matrix Recognition Library~\cite{CMR}\footnote{See \href{https://discopt.github.io/cmr/}{discopt.github.io/cmr/} for details on the installation, compilation, instance generation / extraction and reproduction of the results.}. \reviewFix{% All the experiments were carried out on a \SI{3.0}{\giga\hertz} Intel Xeon Gold 5217 CPU on a system with \SI{64}{\giga\byte} of RAM memory. }% \reviewComment{% I would move the description of how to build the code into a footnote or the appendix. }{We added a link to the correspond web page.}% \subsection{Matrices from mixed-integer optimization} \label{sec_computations_mip} \begin{table}[htpb] \caption{% Results for 33 of 79 ternary coefficient submatrices of mixed-integer-programs from the MIPLIB~\cite{MIPLIB2017} that are series-parallel. Depicted are characteristics of the ternary submatrix of the constraint matrix as well as the running times of the total unimodularity test with and without \cref{algo_reduce}. } \label{table_mip_sp} \renewcommand{\arraystretch}{1.05} \setlength{\tabcolsep}{3pt} \sisetup{round-mode=places, round-precision=2}% \begin{center} \begin{tabular}{l|rrr|r|r} \textbf{Instance} & \multicolumn{3}{c|}{\textbf{Ternary submatrix}} & \multicolumn{1}{c}{\textbf{Without}} & \multicolumn{1}{c}{\textbf{With}} \\ & \textbf{rows} & \textbf{cols} & \textbf{nonzeros} & \multicolumn{1}{c}{\textbf{\cref{algo_reduce}}} & \multicolumn{1}{c}{\textbf{\cref{algo_reduce}}} \\ \hline \texttt{blp-ar98} & \num{913} & \num{16021} & \num{15806} & \SI{0.017859}{\s} & \SI{0.0183}{\s} \\ \texttt{blp-ic98} & \num{627} & \num{13640} & \num{13550} & \SI{0.015228}{\s} & \SI{0.015919}{\s} \\ \texttt{bnatt500} & \num{6525} & \num{4024} & \num{10053} & \SI{0.094027}{\s} & \SI{0.005173}{\s} \\ \texttt{bppc4-08} & \num{20} & \num{1456} & \num{1454} & \SI{0.002925}{\s} & \SI{0.002122}{\s} \\ \texttt{csched007} & \num{103} & \num{1758} & \num{1562} & \SI{0.0061}{\s} & \SI{0.006078}{\s} \\ \texttt{csched008} & \num{111} & \num{1536} & \num{1405} & \SI{0.007964}{\s} & \SI{0.003343}{\s} \\ \texttt{exp-1-500-5-5} & \num{300} & \num{990} & \num{1480} & \SI{0.031854}{\s} & \SI{0.002597}{\s} \\ \texttt{fhnw-binpack4-48} & \num{910} & \num{3675} & \num{3640} & \SI{0.011413}{\s} & \SI{0.013939}{\s} \\ \texttt{fhnw-binpack4-4} & \num{152} & \num{507} & \num{494} & \SI{0.004194}{\s} & \SI{0.004176}{\s} \\ \texttt{glass4} & \num{142} & \num{256} & \num{263} & \SI{0.00242}{\s} & \SI{0.002432}{\s} \\ \texttt{lotsize} & \num{725} & \num{2985} & \num{4175} & \SI{0.105616}{\s} & \SI{0.002428}{\s} \\ \texttt{mas74} & \num{1} & \num{151} & \num{150} & \SI{0.000557}{\s} & \SI{0.000567}{\s} \\ \texttt{mas76} & \num{1} & \num{151} & \num{150} & \SI{0.000438}{\s} & \SI{0.000575}{\s} \\ \texttt{mik-250-20-75-4} & \num{120} & \num{270} & \num{120} & \SI{0.004167}{\s} & \SI{0.004142}{\s} \\ \texttt{milo-v12-6-r2-40-1} & \num{4914} & \num{1764} & \num{6296} & \SI{0.073547}{\s} & \SI{0.006823}{\s} \\ \texttt{n3div36} & \num{4426} & \num{22120} & \num{27960} & \SI{0.876898}{\s} & \SI{0.044153}{\s} \\ \texttt{neos-2657525-crna} & \num{254} & \num{524} & \num{676} & \SI{0.013024}{\s} & \SI{0.001567}{\s} \\ \texttt{neos-2978193-inde} & \num{332} & \num{20800} & \num{20800} & \SI{0.016134}{\s} & \SI{0.012915}{\s} \\ \texttt{neos-3004026-krka} & \num{4225} & \num{17030} & \num{16900} & \SI{0.045863}{\s} & \SI{0.046488}{\s} \\ \texttt{neos-3381206-awhea} & \num{4} & \num{2375} & \num{1900} & \SI{0.004659}{\s} & \SI{0.00508}{\s} \\ \texttt{neos-3754480-nidda} & \num{300} & \num{201} & \num{300} & \SI{0.004189}{\s} & \SI{0.004525}{\s} \\ \texttt{neos-4338804-snowy} & \num{441} & \num{1344} & \num{2562} & \SI{0.006949}{\s} & \SI{0.007501}{\s} \\ \texttt{neos-4413714-turia} & \num{952} & \num{190401} & \num{190004} & \SI{0.097634}{\s} & \SI{0.098469}{\s} \\ \texttt{neos-4647030-tutaki} & \num{2800} & \num{12600} & \num{11200} & \SI{0.036046}{\s} & \SI{0.032161}{\s} \\ \texttt{neos-4954672-berkel} & \num{1764} & \num{567} & \num{1035} & \SI{0.02295}{\s} & \SI{0.008276}{\s} \\ \texttt{neos-787933} & \num{133} & \num{236376} & \num{61944} & \SI{0.312689}{\s} & \SI{0.312252}{\s} \\ \texttt{neos-848589} & \num{737} & \num{550539} & \num{550539} & \SI{0.265529}{\s} & \SI{0.267024}{\s} \\ \texttt{neos17} & \num{1} & \num{535} & \num{50} & \SI{0.002478}{\s} & \SI{0.002442}{\s} \\ \texttt{pk1} & \num{30} & \num{86} & \num{60} & \SI{0.001886}{\s} & \SI{0.000305}{\s} \\ \texttt{proteindesign121hz512p9} & \num{79} & \num{159145} & \num{159133} & \SI{0.078653}{\s} & \SI{0.078704}{\s} \\ \texttt{proteindesign122trx11p8} & \num{67} & \num{127326} & \num{127315} & \SI{0.064747}{\s} & \SI{0.065054}{\s} \\ \texttt{supportcase42} & \num{18439} & \num{18442} & \num{34831} & \SI{63.50751}{\s} & \SI{0.025572}{\s} \\ \texttt{tr12-30} & \num{360} & \num{1080} & \num{1068} & \SI{0.025282}{\s} & \SI{0.002093}{\s} \end{tabular} \end{center} \end{table} \begin{table}[htpb] \caption{% Results for 46 of 79 ternary coefficient submatrices of mixed-integer-programs from the MIPLIB~\cite{MIPLIB2017} that are not series-parallel. Depicted are characteristics of the ternary submatrix of the constraint matrix and its SP-reduced submatrix as well as the running times of the total unimodularity test with and without \cref{algo_reduce}. } \label{table_mip_nosp} \renewcommand{\arraystretch}{1.05} \setlength{\tabcolsep}{3pt} \sisetup{round-mode=places, round-precision=1}% \begin{center} \begin{tabular}{l|rrr|rrr|r|r} \textbf{Instance} & \multicolumn{3}{c|}{\textbf{Ternary submatrix}} & \multicolumn{3}{c|}{\textbf{SP-reduced submatrix}} & \multicolumn{1}{c}{\textbf{Without}} & \multicolumn{1}{c}{\textbf{With}} \\ & \textbf{rows} & \textbf{cols} & \textbf{nonzeros} & \textbf{rows} & \textbf{cols} & \textbf{nonzeros} & \multicolumn{1}{c}{\textbf{\cref{algo_reduce}}} & \multicolumn{1}{c}{\textbf{\cref{algo_reduce}}} \\ \hline \texttt{30n20b8} & \num{90} & \num{18380} & \num{18438} & \num{27} & \num{22} & \num{54} & \SI{0.011019}{\s} & \SI{0.010993}{\s} \\ \texttt{50v-10} & \num{50} & \num{2013} & \num{732} & \num{50} & \num{183} & \num{366} & \SI{0.021119}{\s} & \SI{0.01035}{\s} \\ \texttt{assign1-5-8} & \num{31} & \num{156} & \num{260} & \num{31} & \num{130} & \num{260} & \SI{0.003748}{\s} & \SI{0.00372}{\s} \\ \texttt{b1c1s1} & \num{2848} & \num{3872} & \num{8112} & \num{2080} & \num{2192} & \num{5728} & \SI{1.577017}{\s} & \SI{1.466902}{\s} \\ \texttt{beasleyC3} & \num{500} & \num{2500} & \num{2500} & \num{301} & \num{426} & \num{852} & \SI{0.195069}{\s} & \SI{0.015168}{\s} \\ \texttt{binkar10\_1} & \num{1016} & \num{2298} & \num{4326} & \num{785} & \num{1242} & \num{3030} & \SI{0.015872}{\s} & \SI{0.012717}{\s} \\ \texttt{cbs-cta} & \num{10112} & \num{22326} & \num{54520} & \num{244} & \num{11163} & \num{22326} & \SI{96.590535}{\s} & \SI{8.555163}{\s} \\ \texttt{cost266-UUE} & \num{1389} & \num{4161} & \num{8151} & \num{1332} & \num{2052} & \num{4104} & \SI{0.070218}{\s} & \SI{0.012924}{\s} \\ \texttt{drayage-100-23} & \num{405} & \num{11025} & \num{22050} & \num{210} & \num{10960} & \num{21920} & \SI{7.631541}{\s} & \SI{7.650101}{\s} \\ \texttt{drayage-25-23} & \num{405} & \num{11025} & \num{22050} & \num{210} & \num{10960} & \num{21920} & \SI{7.88959}{\s} & \SI{7.643947}{\s} \\ \texttt{fiball} & \num{3449} & \num{34218} & \num{34648} & \num{221} & \num{258} & \num{688} & \SI{0.055529}{\s} & \SI{0.054523}{\s} \\ \texttt{h80x6320d} & \num{238} & \num{12640} & \num{18881} & \num{80} & \num{3160} & \num{6320} & \SI{3.339353}{\s} & \SI{0.555658}{\s} \\ \texttt{ic97\_potential} & \num{1046} & \num{205} & \num{2092} & \num{523} & \num{205} & \num{1046} & \SI{0.090329}{\s} & \SI{0.005124}{\s} \\ \texttt{icir97\_tension} & \num{368} & \num{2494} & \num{2027} & \num{243} & \num{145} & \num{1078} & \SI{0.050254}{\s} & \SI{0.010911}{\s} \\ \texttt{lectsched-5-obj} & \num{33526} & \num{5651} & \num{59340} & \num{7880} & \num{127} & \num{15760} & \SI{81.153469}{\s} & \SI{1.49771}{\s} \\ \texttt{mad} & \num{30} & \num{220} & \num{400} & \num{30} & \num{200} & \num{400} & \SI{0.007793}{\s} & \SI{0.008008}{\s} \\ \texttt{mc11} & \num{400} & \num{3040} & \num{3040} & \num{400} & \num{760} & \num{1520} & \SI{0.184517}{\s} & \SI{0.015445}{\s} \\ \texttt{neos-1122047} & \num{57791} & \num{5000} & \num{115580} & \num{57790} & \num{5000} & \num{115580} & \SI{37.014054}{\s} & \SI{37.16188}{\s} \\ \texttt{neos-1445765} & \num{1024} & \num{20617} & \num{20663} & \num{10} & \num{12} & \num{24} & \SI{0.165528}{\s} & \SI{0.019002}{\s} \\ \texttt{neos-1582420} & \num{10080} & \num{10100} & \num{22407} & \num{2387} & \num{2407} & \num{7021} & \SI{59.486599}{\s} & \SI{33.566895}{\s} \\ \texttt{neos-3024952-loue} & \num{3390} & \num{3255} & \num{7725} & \num{3315} & \num{3075} & \num{7575} & \SI{0.067966}{\s} & \SI{0.05687}{\s} \\ \texttt{neos-3046615-murg} & \num{258} & \num{274} & \num{546} & \num{18} & \num{32} & \num{64} & \SI{0.002618}{\s} & \SI{0.004071}{\s} \\ \texttt{neos-3083819-nubu} & \num{4719} & \num{8644} & \num{20118} & \num{3648} & \num{6628} & \num{17031} & \SI{25.060069}{\s} & \SI{19.333827}{\s} \\ \texttt{neos-3627168-kasai} & \num{1190} & \num{1448} & \num{3038} & \num{1022} & \num{924} & \num{2674} & \SI{0.128488}{\s} & \SI{0.101996}{\s} \\ \texttt{neos-4387871-tavua} & \num{554} & \num{4004} & \num{7984} & \num{279} & \num{1012} & \num{2024} & \SI{0.393238}{\s} & \SI{0.017358}{\s} \\ \texttt{neos-4738912-atrato} & \num{918} & \num{6189} & \num{13035} & \num{768} & \num{2025} & \num{5955} & \SI{350.488336}{\s} & \SI{125.508562}{\s} \\ \texttt{neos-5107597-kakapo} & \num{6498} & \num{138} & \num{13008} & \num{1698} & \num{114} & \num{3396} & \SI{3.396775}{\s} & \SI{0.112903}{\s} \\ \texttt{neos-911970} & \num{59} & \num{888} & \num{1680} & \num{59} & \num{840} & \num{1680} & \SI{0.05078}{\s} & \SI{0.051475}{\s} \\ \texttt{nexp-150-20-8-5} & \num{2385} & \num{20115} & \num{22350} & \num{150} & \num{2119} & \num{4238} & \SI{0.245972}{\s} & \SI{0.170972}{\s} \\ \texttt{opm2-z10-s4} & \num{160625} & \num{6250} & \num{321250} & \num{160625} & \num{6250} & \num{321250} & \SI{862.460508}{\s} & \SI{861.90701}{\s} \\ \texttt{p200x1188c} & \num{200} & \num{2376} & \num{2376} & \num{200} & \num{594} & \num{1188} & \SI{0.116153}{\s} & \SI{0.011227}{\s} \\ \texttt{radiationm18-12-05} & \num{33265} & \num{40623} & \num{73885} & \num{14905} & \num{18372} & \num{36948} & \SI{695.08632}{\s} & \SI{27.964045}{\s} \\ \texttt{rd-rplusc-21} & \num{125896} & \num{118} & \num{124457} & \num{4} & \num{4} & \num{8} & \SI{1.635799}{\s} & \SI{0.096006}{\s} \\ \texttt{reblock115} & \num{4715} & \num{1150} & \num{9430} & \num{4706} & \num{1140} & \num{9412} & \SI{0.355385}{\s} & \SI{0.355089}{\s} \\ \texttt{rmatr100-p10} & \num{7260} & \num{7359} & \num{21877} & \num{7260} & \num{7259} & \num{21777} & \SI{17.001843}{\s} & \SI{13.344478}{\s} \\ \texttt{rmatr200-p5} & \num{37617} & \num{37816} & \num{113048} & \num{37617} & \num{37616} & \num{112848} & \SI{867.375674}{\s} & \SI{791.631219}{\s} \\ \texttt{rococoB10-011000} & \num{1442} & \num{4456} & \num{7787} & \num{450} & \num{2025} & \num{4050} & \SI{0.053426}{\s} & \SI{0.019739}{\s} \\ \texttt{rococoC10-001000} & \num{1088} & \num{3117} & \num{5396} & \num{330} & \num{1353} & \num{2706} & \SI{0.040037}{\s} & \SI{0.011736}{\s} \\ \texttt{sct2} & \num{2001} & \num{5884} & \num{8901} & \num{1797} & \num{2885} & \num{5770} & \SI{6.775848}{\s} & \SI{43.227286}{\s} \\ \texttt{sp150x300d} & \num{150} & \num{600} & \num{600} & \num{150} & \num{253} & \num{506} & \SI{0.014844}{\s} & \SI{0.009828}{\s} \\ \texttt{supportcase18} & \num{120} & \num{13410} & \num{14400} & \num{30} & \num{30} & \num{70} & \SI{1.013893}{\s} & \SI{0.001932}{\s} \\ \texttt{supportcase26} & \num{870} & \num{40} & \num{1700} & \num{434} & \num{40} & \num{868} & \SI{0.068498}{\s} & \SI{0.011473}{\s} \\ \texttt{swath1} & \num{503} & \num{6805} & \num{19121} & \num{102} & \num{6240} & \num{18640} & \SI{0.558728}{\s} & \SI{0.284716}{\s} \\ \texttt{swath3} & \num{503} & \num{6805} & \num{19121} & \num{102} & \num{6240} & \num{18640} & \SI{0.560856}{\s} & \SI{0.285831}{\s} \\ \texttt{trento1} & \num{1259} & \num{7687} & \num{73662} & \num{1189} & \num{6415} & \num{69590} & \SI{13.745141}{\s} & \SI{5.657498}{\s} \\ \texttt{uccase9} & \num{49061} & \num{21446} & \num{47270} & \num{8008} & \num{8008} & \num{19327} & \SI{0.904189}{\s} & \SI{0.80043}{\s} \end{tabular} \end{center} \end{table} The most important application of total unimodularity lies in mixed-integer optimization since coefficient matrices of mixed-integer programs (MIPs) that are totally unimodular have very attractive properties. Moreover, many substructures of coefficient matrices arising in practice are totally unimodular, e.g., if they encode network flows or (conditional) precedences. For this reason we created a set of ternary matrices for which testing for total unimodularity is of potential interest for mixed-integer programming. We consider the currently 240 benchmark MIP instances from the state-of-the-art benchmark library MIPLIB~2017~\cite{MIPLIB2017}. For each of these instances, we extracted a large ternary submatrix in a greedy fashion: successively remove a row or a column with a maximum number number entries not in $\{-1,0,+1\}$. For the matrices of the 9 instances \texttt{enlight\_hard}, \texttt{gen-ip002}, \texttt{gen-ip054}, \texttt{markshare2}, \texttt{markshare\_4\_0}, \texttt{ns1952667}, \texttt{pg}, \texttt{pg5\_34} and \texttt{timtab1} our greedy removal algorithm returned a matrix without any nonzeros. Moreover, for the 4 instances \texttt{neos-4763324-toguru}, \texttt{radiationm40}, \texttt{square41} and \texttt{square47} the total unimodularity test took more than an hour. Finally, for another 4 instances \texttt{buildingenergy}, \texttt{neos-873061}, \texttt{snp-02-004-104} and \texttt{thor50dday} disabling the preprocessing with \cref{algo_reduce} forced the implementation to carry out extremely many $2$-sum decompositions (which were actually SP-reductions). Since the resulting matrices of each $2$-sum decomposition are created in memory, the code ran into memory problems despite the \SI{64}{\giga\byte} available RAM. Note that this problem does not occur when using \cref{algo_reduce} since only the SP-reduced submatrix is explicitly created in memory for further computations. For further 144 instance, the computed ternary submatrices did not pass the very first step of the total unimodularity test, which is a test whether the sign pattern of the nonzeros of the given ternary matrix is \emph{balanced}. For details we refer to the respective descriptions in~\cite{Truemper90,WalterT13}. For the remaining 79 matrices we ran the total unimodularity test with and without preprocessing using \cref{algo_reduce}. In \cref{table_mip_sp,table_mip_nosp} we present the sizes of the ternary submatrices, the SP-reduced submatrices and report about the timings of the total unimodularity test in both runs. Note that for the series-parallel submatrices we do not report about the SP-reduced matrices since these are empty. For series-parallel submatrices, both running times are very short since the total unimodularity test does not need to do anything further besides searching for $2$-separations and carrying out $2$-sum decompositions. In particular, running times are very similar. Only for larger matrices the preprocessing actually gives a speed-up. The reason is that an explicit application of a $2$-sum decomposition is more costly for larger matrices. Among the more interesting instances with non-series-parallel ternary submatrices we can find more with longer running times. Here, after carrying out 2-separations, further algorithms are applied, among them the enumeration of 3-separations which is responsible for the asymptotic running time of the total unimodularity test. Here, in several cases, preprocessing reduces the running time significantly. Moreover, it rarely slows down the computation, except for one remarkable instance: for \texttt{sct2}, detailed inspection reveals that the version without preprocessing spends about \SI{2.5}{\s} for finding 2-separations 3750 times, while the SP-reduction algorithm is only called 348 times, which requires \SI{40.1}{\s}. Profiling indicated that after carrying out the SP-reductions, subsequent decisions are made differently than in the run without preprocessing. These instances show that submatrices arising in practical mixed-integer programs admit SP-reductions, and are sometimes even series-parallel. Moreover, we can conclude that in most cases the application of \cref{algo_reduce} is advantageous. \subsection{Random matrices} \label{sec_computations_random} \begin{figure}[htpb] \centering \subfloat[][% Effect of reduction type on running time. ]{% \begin{tikzpicture} \begin{axis}[ ybar stacked, enlargelimits=0.05, ymajorgrids, xmin=0, xmax=1.0, ymin=0, ymax=18, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, ytick={0,2,4,6,8,10,12,14,16,18}, x label style={yshift=-3mm}, width=0.46\textwidth, height=65mm, bar width=1.4mm, ylabel={Running time [s]}, xlabel={Fraction $\gamma = 1-\beta$ of copy extensions}, legend entries={Binary reduction,Ternary reduction,Graphicness}, legend cell align=left, legend pos=north west, legend style={font=\small}, ] \addplot+[blue!80!black, fill=blue, bar shift=-1.7mm] coordinates { (0.0, 0.005) (0.1, 0.005) (0.2, 0.006) (0.3, 0.006) (0.4, 0.008) (0.5, 0.014) (0.6, 0.035) (0.7, 0.100) (0.8, 0.358) (0.9, 1.326) (1.0, 5.674) }; \resetstackedplots \addplot+[red!80!black, fill=red, bar shift=0mm] coordinates { (0.0, 0.005) (0.1, 0.005) (0.2, 0.006) (0.3, 0.007) (0.4, 0.009) (0.5, 0.014) (0.6, 0.033) (0.7, 0.103) (0.8, 0.370) (0.9, 1.574) (1.0, 6.123) }; \resetstackedplots \addplot+[cyan!80!black, fill=cyan, bar shift=1.7mm] coordinates { (0.0,0.032) (0.1,0.034) (0.2,0.035) (0.3,0.038) (0.4,0.042) (0.5,0.054) (0.6,0.084) (0.7,0.220) (0.8,0.836) (0.9,3.720) (1.0,16.749) }; \end{axis} \end{tikzpicture} } \hfill \subfloat[][% Effect of reduction type on running time per nonzero.\label{fig_comp_series_parallel_per_nonzero} ]{% \begin{tikzpicture} \begin{axis}[ enlargelimits=0.05, grid=major, xmin=0, xmax=1.0, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, ytick={0,200,400,600,800,1000,1200,1400,1600}, x label style={yshift=-3mm}, ymin=0, ymax=1600, width=0.46\textwidth, height=65mm, ylabel={Running time per nonzero [ns]}, xlabel={Fraction $\gamma = 1-\beta$ of copy extensions}, legend entries={Binary,Ternary,Graphicness}, legend cell align=left, legend pos=north east, legend style={font=\small}, ] \addplot[blue,mark size=1mm,only marks] coordinates { (0.0,254.415) (0.1,243.886) (0.2,215.672) (0.3,185.732) (0.4,162.386) (0.5,138.960) (0.6,119.685) (0.7,98.614) (0.8,80.228) (0.9,68.103) (1.0,58.033) }; \addplot[mark=diamond*,mark size=1mm,red,only marks] coordinates { (0.0,262.330) (0.1,252.633) (0.2,226.265) (0.3,196.478) (0.4,166.679) (0.5,137.745) (0.6,121.823) (0.7,102.793) (0.8,85.754) (0.9,73.340) (1.0,62.587) }; \addplot[mark=triangle*,cyan,mark size=1mm,only marks] coordinates { (0.0,1582.953) (0.1,1489.558) (0.2,1335.169) (0.3,1100.803) (0.4,804.722) (0.5,530.022) (0.6,295.272) (0.7,205.278) (0.8,186.253) (0.9,179.435) (1.0,167.491) }; \end{axis} \end{tikzpicture} } \caption{% Results for random series-parallel matrices with $\alpha = \delta = 0$, $p=1$, $\beta = 1 - \gamma$ and varying values for $\gamma \in [0,1]$. Averaged over 1000 matrices per configuration. } \label{fig_comp_series_parallel} \end{figure} \begin{figure}[htpb] \centering \subfloat[][% Effect of number of perturbed entries on running time.\label{fig_comp_perturbed_time} ]{% \begin{tikzpicture} \begin{axis}[ ybar stacked, enlargelimits=0.05, ymajorgrids, xmin=0, xmax=20000, ymin=0, ymax=0.2, ytick={0,0.05,0.1,0.15,0.2}, width=0.90\textwidth, height=65mm, scaled x ticks={base 10:-3}, scaled y ticks={real:0.001}, ytick scale label code/.code={$\cdot 10^{-3}$}, bar width=1.9mm, ylabel={Running time [s]}, xlabel={Number of perturbed entries}, legend entries={Binary reduction,Binary wheel search,Ternary reduction,Ternary wheel search,Ternary $N_2$ search}, legend cell align=left, legend pos=north west, legend style={font=\small}, ] \addplot+[blue!80!black, fill=blue, bar shift=-1.1mm] coordinates { (0,0.011) (1000,0.011) (2000,0.010) (3000,0.010) (4000,0.010) (5000,0.010) (6000,0.010) (7000,0.009) (8000,0.009) (9000,0.009) (10000,0.009) (11000,0.009) (12000,0.009) (13000,0.009) (14000,0.009) (15000,0.008) (16000,0.008) (17000,0.008) (18000,0.008) (19000,0.008) (20000,0.009) }; \addplot+[blue!80!white, fill=blue!50!white, bar shift=-1.1mm] coordinates { (0,0.000) (1000,0.014) (2000,0.028) (3000,0.037) (4000,0.045) (5000,0.057) (6000,0.067) (7000,0.074) (8000,0.081) (9000,0.093) (10000,0.103) (11000,0.114) (12000,0.117) (13000,0.120) (14000,0.133) (15000,0.132) (16000,0.149) (17000,0.154) (18000,0.150) (19000,0.160) (20000,0.178) }; \resetstackedplots \addplot+[red!80!black, fill=red, bar shift=1.1mm] coordinates { (0,0.013) (1000,0.014) (2000,0.014) (3000,0.013) (4000,0.013) (5000,0.012) (6000,0.011) (7000,0.011) (8000,0.011) (9000,0.010) (10000,0.010) (11000,0.010) (12000,0.010) (13000,0.009) (14000,0.010) (15000,0.009) (16000,0.009) (17000,0.009) (18000,0.009) (19000,0.009) (20000,0.009) }; \addplot+[red!80!white, fill=red!50!white, bar shift=1.1mm] coordinates { (0,0.000) (1000,0.015) (2000,0.023) (3000,0.032) (4000,0.044) (5000,0.050) (6000,0.059) (7000,0.066) (8000,0.071) (9000,0.077) (10000,0.092) (11000,0.096) (12000,0.104) (13000,0.107) (14000,0.125) (15000,0.130) (16000,0.134) (17000,0.146) (18000,0.151) (19000,0.142) (20000,0.160) }; \addplot+[red!40!white, fill=red!20!white, bar shift=1.1mm] coordinates { (0,0.000) (1000,0.001) (2000,0.001) (3000,0.001) (4000,0.001) (5000,0.002) (6000,0.002) (7000,0.002) (8000,0.002) (9000,0.002) (10000,0.002) (11000,0.002) (12000,0.002) (13000,0.002) (14000,0.002) (15000,0.002) (16000,0.002) (17000,0.002) (18000,0.002) (19000,0.002) (20000,0.002) }; \end{axis} \end{tikzpicture} } \subfloat[][% Effect of number of pertubed entries on the number of possible SP-reductions.\label{fig_comp_perturbed_reductions} ]{% \begin{tikzpicture} \begin{axis}[ enlargelimits=0.05, grid=major, xmin=0, scaled y ticks={base 10:-3}, scaled x ticks={base 10:-3}, x label style={yshift=-3mm}, ymin=0, width=0.90\textwidth, height=65mm, ylabel={Number of SP-reductions}, xlabel={Number of perturbed entries}, ] \addplot[blue,mark size=1mm,only marks] coordinates { (0,20000.0) (1000,14877.741) (2000,12124.935) (3000,10135.856) (4000,8593.215) (5000,7352.385) (6000,6334.444) (7000,5486.651) (8000,4770.08) (9000,4164.125) (10000,3644.12) (11000,3197.414) (12000,2808.424) (13000,2480.052) (14000,2188.203) (15000,1933.983) (16000,1717.079) (17000,1519.384) (18000,1351.854) (19000,1204.716) (20000,1068.677) }; \addplot[mark=diamond*,mark size=1mm,red,only marks] coordinates { (0,20000.0) (1000,14874.641) (2000,12126.381) (3000,10138.297) (4000,8593.632) (5000,7349.927) (6000,6333.315) (7000,5484.406) (8000,4769.443) (9000,4160.348) (10000,3640.581) (11000,3195.554) (12000,2811.165) (13000,2477.014) (14000,2187.057) (15000,1934.97) (16000,1715.851) (17000,1521.537) (18000,1351.857) (19000,1203.337) (20000,1072.733) }; \end{axis} \end{tikzpicture} } \caption{% Results for random series-parallel matrices with $\alpha = 0$, $\beta = \gamma = 0.5$, $p=1$ and varying values for $\delta \in [0,2]$. Averaged over 1000 matrices per configuration.} \label{fig_comp_perturbed} \end{figure} \begin{figure}[htpb] \centering \subfloat[][% Effect of base matrix size on running time.\label{fig_comp_varybase_time} ]{% \begin{tikzpicture} \begin{axis}[ ybar stacked, enlargelimits=0.05, ymajorgrids, xmin=0, xmax=1.0, ymin=0, ymax=20, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, ytick={0,5,10,15,20}, x label style={yshift=-3mm}, width=0.46\textwidth, height=65mm, bar width=2mm, ylabel={Running time [s]}, xlabel={Relative base matrix size $\alpha$}, legend entries={Binary reduction,Binary wheel search,Ternary reduction,Ternary wheel search,Ternary $N_2$ search}, legend cell align=left, legend pos=north west, legend style={font=\small}, ] \addplot+[blue!80!black, fill=blue, bar shift=-1.1mm] coordinates { (0.0,0.012) (0.1,0.629) (0.2,1.241) (0.3,1.715) (0.4,2.131) (0.5,2.587) (0.6,2.741) (0.7,2.758) (0.8,2.616) (0.9,2.373) (1.0,2.057) }; \addplot+[blue!80!white, fill=blue!50!white, bar shift=-1.1mm] coordinates { (0.0,0.000) (0.1,0.135) (0.2,0.545) (0.3,1.242) (0.4,2.214) (0.5,3.634) (0.6,5.237) (0.7,7.079) (0.8,9.062) (0.9,11.280) (1.0,13.941) }; \resetstackedplots \addplot+[red!80!black, fill=red, bar shift=1.1mm] coordinates { (0.0,0.011) (0.1,0.606) (0.2,1.184) (0.3,1.669) (0.4,2.015) (0.5,2.282) (0.6,2.475) (0.7,2.559) (0.8,2.522) (0.9,2.343) (1.0,1.994) }; \addplot+[red!80!white, fill=red!50!white, bar shift=1.1mm] coordinates { (0.0,0.000) (0.1,0.132) (0.2,0.540) (0.3,1.214) (0.4,2.147) (0.5,3.357) (0.6,4.881) (0.7,6.669) (0.8,8.750) (0.9,11.128) (1.0,13.705) }; \addplot+[red!40!white, fill=red!20!white, bar shift=1.1mm] coordinates { (0.0,0.000) (0.1,0.013) (0.2,0.034) (0.3,0.055) (0.4,0.079) (0.5,0.110) (0.6,0.144) (0.7,0.185) (0.8,0.227) (0.9,0.274) (1.0,0.322) }; \end{axis} \end{tikzpicture} } \hfill \subfloat[][% Effect of base matrix size on running time per nonzero.\label{fig_comp_varybase_per_nonzero} ]{% \begin{tikzpicture} \begin{axis}[ enlargelimits=0.05, grid=major, xmin=0, xmax=1.0, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, x label style={yshift=-3mm}, ymin=0, ymax=400, width=0.46\textwidth, height=65mm, ylabel={Running time per nonzero [ns]}, xlabel={Relative base matrix size $\alpha$}, legend entries={Binary,Ternary}, legend cell align=left, legend pos=south west, legend style={font=\small}, ] \addplot[blue,mark size=1mm,only marks] coordinates { (0.0,120.693) (0.1,152.928) (0.2,179.966) (0.3,198.689) (0.4,218.672) (0.5,250.384) (0.6,267.574) (0.7,282.561) (0.8,293.352) (0.9,304.800) (1.0,321.510) }; \addplot[mark=diamond*,mark size=1mm,red,only marks] coordinates { (0.0,116.204) (0.1,151.270) (0.2,178.158) (0.3,197.307) (0.4,213.706) (0.5,231.639) (0.6,251.571) (0.7,270.334) (0.8,288.838) (0.9,306.824) (1.0,321.819) }; \end{axis} \end{tikzpicture} } \caption{% Results for random series-parallel matrices with $\delta = 0$, $p=0.5$, $\beta = \gamma = \tfrac{1}{2}(1-\alpha)$ and varying values for $\alpha \in [0,1]$. Averaged over 100 matrices per configuration.} \label{fig_comp_varybase} \end{figure} \begin{figure}[htpb] \centering \subfloat[][% Effect of nonzero probability on running time. \label{fig_comp_bigbase_time} ]{% \begin{tikzpicture} \begin{axis}[ ybar stacked, enlargelimits=0.05, ymajorgrids, xmin=0, xmax=1.0, ymin=0, ymax=45, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, ytick={0,10,20,30,40}, x label style={yshift=-3mm}, width=0.46\textwidth, height=65mm, bar width=2mm, ylabel={Running time [s]}, xlabel={Nonzero-probability $p$}, legend entries={Binary reduction,Binary wheel search,Ternary reduction,Ternary wheel search,Ternary $N_2$ search}, legend cell align=left, legend pos=north west, legend style={font=\small}, ] \addplot+[blue!80!black, fill=blue, bar shift=-1.1mm] coordinates { (0.0,0.004) (0.1,0.442) (0.2,0.895) (0.3,1.302) (0.4,1.770) (0.5,2.155) (0.6,2.510) (0.7,2.837) (0.8,3.124) (0.9,3.446) (1.0,5.611) }; \addplot+[blue!80!white, fill=blue!50!white, bar shift=-1.1mm] coordinates { (0.0,0.000) (0.1,2.380) (0.2,5.167) (0.3,8.387) (0.4,12.099) (0.5,14.873) (0.6,16.973) (0.7,18.998) (0.8,20.567) (0.9,21.802) (1.0,0.000) }; \resetstackedplots \addplot+[red!80!black, fill=red, bar shift=1.1mm] coordinates { (0.0,0.004) (0.1,0.426) (0.2,0.847) (0.3,1.230) (0.4,1.640) (0.5,2.017) (0.6,2.442) (0.7,2.808) (0.8,3.124) (0.9,3.481) (1.0,3.717) }; \addplot+[red!80!white, fill=red!50!white, bar shift=1.1mm] coordinates { (0.0,0.000) (0.1,2.268) (0.2,4.965) (0.3,7.904) (0.4,10.967) (0.5,13.798) (0.6,16.445) (0.7,18.697) (0.8,20.464) (0.9,21.987) (1.0,0.000) }; \addplot+[red!40!white, fill=red!20!white, bar shift=1.1mm] coordinates { (0.0,0.000) (0.1,0.073) (0.2,0.135) (0.3,0.199) (0.4,0.260) (0.5,0.321) (0.6,0.377) (0.7,0.431) (0.8,0.486) (0.9,0.554) (1.0,0.611) }; \end{axis} \end{tikzpicture} } \hfill \subfloat[][% Effect of nonzero probability on running time per nonzero. \label{fig_comp_bigbase_per_nonzero } ]{% \begin{tikzpicture} \begin{axis}[ enlargelimits=0.05, grid=major, xmin=0, xmax=1.0, xtick={0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, xticklabels={$0$,$\frac{1}{10}$,$\frac{2}{10}$,$\frac{3}{10}$,$\frac{4}{10}$,$\frac{5}{10}$,$\frac{6}{10}$,$\frac{7}{10}$,$\frac{8}{10}$,$\frac{9}{10}$,$1$}, x label style={yshift=-3mm}, ymin=0, ymax=400, width=0.46\textwidth, height=65mm, ylabel={Running time per nonzero [ns]}, xlabel={Nonzero-probability $p$}, legend entries={Binary,Ternary}, legend cell align=left, legend pos=south west, legend style={font=\small}, ] \addplot[blue,mark size=1mm,only marks] coordinates { (0.1,283.704) (0.2,304.751) (0.3,324.492) (0.4,348.269) (0.5,342.087) (0.6,326.161) (0.7,313.236) (0.8,297.433) (0.9,281.835) (1.0,57.379) }; \addplot[mark=diamond*,mark size=1mm,red,only marks] coordinates { (0.1,278.525) (0.2,298.944) (0.3,312.562) (0.4,323.103) (0.5,324.101) (0.6,322.429) (0.7,314.702) (0.8,302.250) (0.9,290.374) (1.0,44.539) }; \end{axis} \end{tikzpicture} } \caption{% Results for random series-parallel matrices with $\alpha = 1$, $\beta = \gamma = \delta = 0$ and varying values for $p \in [0,1]$. Averaged over 10 matrices per configuration.} \label{fig_comp_bigbase} \end{figure} In order to investigate the factors that have impact on the running time of our algorithms we generated random $N$-by-$N$ matrices in a structured way. The matrices are parameterized by four factors $\alpha$, $\beta$, $\gamma$ and $\delta$ and a probability $p$. The first factor $\alpha \in [0,1]$ indicates the portion of an $(\alpha \cdot N)$-by-$(\alpha \cdot N)$ \emph{base matrix} whose entries were drawn from a uniform distribution. For binary matrices, $p$ indicates the probability of a $1$, while for ternary matrices, $+1$ and $-1$ each occur with probability $p/2$. With high probability, this base matrix does not admit SP-reductions, unless $p$ is close to $0$ or $1$ or $\alpha$ is close to $0$. This base matrix is extended by subsequently adding $(\beta \cdot N)$ unit rows, $(\beta \cdot N)$ unit columns, $(\gamma \cdot N)$ copies of rows and $(\gamma \cdot N)$ copies of columns to it. For unit vectors the place of the unique $1$-entry is chosen uniformly at random. Similarly, for copied vectors the source vector of the copy is chosen uniformly at random among the available ones. To obtain the right matrix size always have $\alpha + \beta + \gamma = 1$. The final step in our generation procedure is perturbation as proposed by one the anonymous reviewers: in order to destroy a small amount of series-parallel structure we flip $(\delta \cdot N)$-many entries. To stay within the (memory) capacity of our computational environment we carried out all our experiments for $N = \SI{10000}{}$. \paragraph{Series-parallel matrices.} The first set of random matrices has $\alpha=0$ (technically, there exists a $1$-by-$1$ base matrix), varying $\beta$, $\gamma = 1-\beta$ and $\delta = 0$. Hence, all these matrices are series-parallel, and hence $2N$ reductions are carried out each time. The results are shown in \cref{fig_comp_series_parallel}, also in comparison to our implementation of the graphicness algorithm due to Bixby and Wagner~\cite{BixbyW88}. It is easy to see that our specialized algorithm performs significantly better than the graphicness test. However, we would like to emphasize that the main motivation for \cref{algo_reduce} is not to test for being series-parallel faster than the graphicness test, but also to compute the (largest) SP-reduced submatrix in case of a non-series-parallel matrix, as done for the matrices from mixed-integer programming. In particular, the graphicness test does not produce such a submatrix. Hence, we omit the comparison for subsequent matrices since these are mostly non-series-parallel. Now let us turn to the actual analysis of our algorithm's behavior. The visible running time increase in case of a larger number of copy reductions seems to be surprisingly high. Hence, we also depict the average running time per nonzero. As \cref{fig_comp_series_parallel_per_nonzero} shows, this value even decreases with a larger number of copy reductions. This can be explained by the fact that the algorithm spends some time per SP-reduction and some time per nonzero that is processed for such a reduction. Obviously, a unit reduction requires to process only 1 nonzero. \paragraph{Perturbed series-parallel matrices.} For the second set we kept $\alpha = 0$, $\beta = \gamma = 0.5$ and $p=1$, but now varied $\delta$, i.e., we considered random perturbations of series-parallel matrices. Results are shown in \cref{fig_comp_perturbed}. Clearly, the number of possible SP-reductions decreases with increasing $\delta$, as \cref{fig_comp_perturbed_reductions} shows. This is natural since the first perturbed entries most likely destroys the corresponding row and the corresponding column reduction at once. The running times of \cref{algo_reduce} are not affected drastically, in particular since the overall number of nonzeros of the matrices do not change much. However, the it is apparent that the running time of \cref{algo_wheel_search} is dominated by the size of the SP-reduced submatrix. \paragraph{Matrices with varying base matrix sizes.} For the third set we kept $\delta = 0$, $p = 0.5$, varied $\alpha$ and set $\beta = \gamma = \tfrac{1}{2}(1-\alpha)$, i.e., we considered different sizes of base matrices that were extended to size $N$-by-$N$. For all the generated matrices, exactly $(1-\alpha) \cdot 2N$ many SP-reductions reductions could be applied, i.e., the all generated base matrices were SP-reduced. The results are shown in \cref{fig_comp_varybase}. While the effort for \cref{algo_wheel_search} increases with $\alpha$, the running time for \cref{algo_reduce} starts to decrease again for larger $\alpha$, which can be justified by the fact that fewer reductions must actually applied. As in the previous experiments, the overall running time is dominated by that of \cref{algo_wheel_search}. In particular, searching an $N_2$-submatrix takes almost no time. Finally, while our implementation was slower for ternary series-parallel matrices than for binary ones, the situation is reversed for non-series-parallel matrices. We do not have an explanation for this, but the differences are also not very significant. \paragraph{Matrices without SP-reductions.} Our last set of randomly generated matrices has $\alpha = 1$, i.e., an $N$-by-$N$ base matrix, $\beta = \gamma = \delta = 0$, and varying nonzero probabilities $p$. For $p=0$ and for $p=1$ (in the binary case) the resulting matrices were the all-zeros and all-ones matrices, respectively, and thus series-parallel. In all other cases, all of the generated matrices were SP-reduced. Moreover, all returned forbidden submatrices were $M_3$ or $M_3'$, except for the ternary case with $p=1$, where $N_2$ was returned. Further results are shown in \cref{fig_comp_bigbase}. Both, the effort for \cref{algo_reduce} for determining that the matrix is SP-reduced, and the effort for \cref{algo_wheel_search} for finding a wheel submatrix grow with the increasing nonzero probability, which underlines our previous explanation that the number of nonzeros is the driving factor. As before, the overall running time is dominated by the search for wheel submatrices. The jump for $p=1$ is due to the special structure: for binary matrices, the algorithm has to apply SP-reductions, which is generally fast, while for ternary matrices it has to determine that no ternary SP-reduction is necessary and inspect a single binary SP-reduction in order to find an $N_2$-submatrix. \reviewComment{% I do not understand the point of the section about hereditary matrix class. Why is this interesting? }{I agree that although the open question came up while working on the manuscript, I agree that it does not really fit. Hence, I removed it.}% \paragraph{Acknowledgements.} The author is grateful to the anonymous reviewers whose comments led to improvements of this manuscript, in particular for the suggestions of further matrix classes. This publication is part of the project \emph{Making Mixed-Integer Programming Solvers Smarter and Faster using Network Matrices} (with project number \emph{OCENW.M20.151} of the research programme \emph{NWO Open Competition Domain Science -- M} which is (partly) financed by the Dutch Research Council (NWO). \bibliographystyle{plain}
{'timestamp': '2022-08-18T02:02:17', 'yymm': '2111', 'arxiv_id': '2111.07628', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07628'}
arxiv
\section{Introduction} The digitalization of physical devices, system infrastructure, and data services, as embodied by the IoT paradigm, has enabled the collection of large-scale databases which can be used for a trove of machine learning (ML) tasks, ranging from autonomous driving to health-care services and smart energy management. In this paradigm, data centralization is no longer a feasible and thus distributed ML is being hailed as the next milestone in large-scale data computing. Among the various distributed ML architectures, federated learning (FL) has received particular attention: FL consists of a central model which is trained locally at the remote clients by applying stochastic gradient descent (SGD) over a local dataset. The local gradient are then communicated to the central parameter server (PS) for aggregation into a global model. For this model, one useful concept is that of \emph{communication overhead} \cite{shlezinger2020communication}, that is the number of bits-per-iteration that are required by a decentralize training scheme to attain a certain convergence guarantee for the central model as compared to the centralized training case. The concept of communication overhead naturally points to the model in which the communication between the remote user and the PS is subject to a total constraint in the number of bits exchanged throughout training. In this paper we investigate this setting and focus on determining the relevant assumptions under which an efficient compression schemes can be used for minimizing the communication overhead for the DNN training scenario. \smallskip \noindent \underline{\bf Relevant Literature:} In the following, we shall discuss communication aspects of FL and distributed training relevant to the development of the paper. Various approaches have been proposed in the literature to improve communication efficiency in FL. The dimensionality-reduction schemes put forth in the literature mainly fall into two categories: gradient sparsification, \cite{Shalev-Shwartz2010FL_CE, Alistarh2018Spars_FL, Amir_FL}, and gradient quantization \cite{seide2014onebitSGD,Konecny2016Fl_CE, gandikota2019vqsgd}. Most of the proposed dimensionality-reduction techniques are applied to each of the gradient dimension separately, such as quantized SGD (QSGD) and its stochastic versions. Dimensionality-reduction can also be performed on the whole gradient vector as suggested in \cite{gandikota2019vqsgd} through an algorithm referred to as vector QSGD (VQSGD). From a more implementation-oriented perspective, \cite{sun2019hybrid} studies the effect of gradient quantization in the $8$-bit floating-point ($8$-fp) representation as \emph{sign-exponent-mantissa}, which is commonly adopted in numerical implementations of DNN training, \smallskip \noindent \underline{\bf Contributions:} In the following, we focus on the design of lossless compression schemes for the compression of DNN gradient after $8$-fp quantization. In particular, we aim at providing a good statistical model for DNN gradients training, that can be effectively used to design both quantization and compression schemes in decentralized training scenarios. Our main contributions are summarized as follows: \noindent \underline{\emph{GenNorm modelling:}} To the best of our knowledge, a good statistical model for modelling gradients in DNN training is currently lacking. % We argue that one can effectively model such gradients as i.i.d. random variables having a generalized normal distribution, which we refer to as $\mathsf{GenNorm}$. % We use statistical methods to validate the $\mathsf{GenNorm}$ assumption for three DNN architectures in the image classification task, namely DenseNet\cite{huang2017densely}, ResNet\cite{he2016identity}, and NASNet\cite{zoph2018learning}, across both layers and training epochs. % We also argue that (i) the gradient distribution approaches the normal ($\mathsf{Norm}$) distribution as the depth of the network increases and as the epoch number increases, additionally (ii) we contend that the kurtosis of the gradient distribution provides a useful measure of the concentration of gradient around zero. \noindent \underline{\emph{GenNorm gradient compression performance and its $8$-fp}} \underline{\emph{quantization performance:}} We investigate the communication overhead that can be attained through lossless compression of DNN gradients after $8$-fp quantization. % To argue for the effectiveness of our assumption and the DNN gradient distribution, we compare % the case in which the gradients compressed using the $\mathsf{GenNorm}$ assumption versus (i) the standard $\mathsf{Norm}$ assumption, and (ii) using an universal compression in the form of LZ78 \cite{ziv1978compression}. % Our results show that the required communication overhead with the $\mathsf{GenNorm}$ model is much less than that with the standard $\mathsf{Norm}$ model in the upper and middle layers and the performance of both distributions gradually become the same towards the lower layers. Moreover, they both have significant gains over LZ78 in all the layers. % Further investigations on the theoretical foundations of the $\mathsf{GenNorm}$ assumptions are left for future work; here we shall only focus on the numerical evaluations of this assumption. \noindent {\bf Notation.} Lowercase boldface letters (e.g., $\zv$) are used for column vectors, uppercase letters for random variables (e.g. $X$), and calligraphic uppercase for sets (e.g. $\Acal$) . We also adopt the shorthands $[m:n] \triangleq \{m, \ldots, n\}$ and $[n] \triangleq \{1, \ldots, n\}$. Additionally $\Gamma(.)$ denotes the Gamma function, $\mathsf{Norm}$ the normal distribution, and $\mathsf{GenNorm}$ the generalized normal distribution. Finally, $\Fbb_2$ is the binary field. \section{Related Results} \label{sec:Related Results} \subsection{Federated Learning and Federated Averaging }\label{subsec:FL} The FL model consists of $U$ remote users communicating their local gradient to the PS over $T$ iterations with the aim of training a global ML model capable of optimizing a given loss function $\ell\lb\ldotp\rb$ obtained as the average of the local loss functions $\ell^{(u)}$ at each of the users $u$, as evaluated on the local dataset \ea{ \Dv^{(u)} = \left\{\lb \dv_{k}^{\lb u\rb},v_k^{\lb u\rb}\rb\right\}_{k\in\left[\left|\Dc^{(u)}\right|\right]}. } The local dataset $\Dv^{(u)}$ includes $\left|\Dv^{(u)}\right|$ pairs, each comprising of a data point $\dv_{k}^{\lb u\rb}$ and the label $v_{k}^{(u)}$. The remote users collaborate with the PS during $T$ iterations in order to minimize the loss function and find the solution $\wv^\ast$ defined as \ea{ \label{eq:optim_value} \wv^{\ast} & =\arg\min_{\wv}\frac{1}{\left|\Dcal\right|} = \sum_{u\in[U]}\left|\Dcal^{(u)}\right|\ell^{(u)}\left(\wv_{t};\dv^{(u)}_{k},v^{(u)}_{k}\right), } where $\ell^{(u)}\lb\ldotp\rb$ is the local loss function at remote user $u$. A common approach for numerically determining the optimal value in \eqref{eq:optim_value} is through iterative application of synchronous (stochastic) gradient descent (SGD). In the SGD algorithm, the model parameter $\wv$ is updated at each iteration $t\in[T]$ in the negative direction of the gradient vector multiplied by an iteration-dependent step size $\gamma_t$ called the \emph{learning rate}, as in \eqref{eq:model_update}. In the federated setting, SGD can be implemented by having each remote user communicate the local gradients to the PS. The PS aggregates the local gradients so as to obtain a global gradient which is employed in the global model update. The resulting algorithms is customarily referred on as \emph{federated averaging} \cite{Konecny2016Fl_CE}. Note that, in federated averaging, the local gradient $\gtv_{t}^{(u)}$ is computed as \ea{\label{eq:stochastic_local_gradient} \gtv_{t}^{(u)} & =\dfrac{1}{\left|\Dcal^{(u)}\right|}\sum_{k\in\left[\left|\Dcal^{(u)}\right|\right]} \nabla\ell^{(u)}\left(\wv_{t};\dv^{(u)}_{k},v^{(u)}_{k}\right). } The global gradient of the loss function $\ell\lb\ldotp\rb$ at iteration $t$ is computed at the PS by aggregating the received local gradients according to a distributed mean estimation (DME) as \ea{\label{global_SG} \gov_{t}=\f{1}{U}\sum_{u\in [U]}\gtv_{t}^{(u)}. } Next, the global or final model at iteration $t+1$ is updated as \ea{\label{eq:model_update} \wv_{t+1}=\wv_{t}-\gamma_{t}\gov_{t}. } The convergence of federated averaging can be shown under various assumptions on the loss function \cite{konevcny2016federated}. \subsection{Mean Field theory} In recent years, the mean field theory has been applied to the study of DNN and has achieved a great deal of success. Consider a simple DNN with two layers minimizing the square loss over an i.i.d. dataset, \cite{mei2018mean} shows that training through SGD is well-approximated by continuous dynamics expressed through certain non-linear partial differential equation. In \cite{mei2019mean} this analysis is further extended to study the empirical distribution of the neurons after $k$ SGD steps. It is shown that, under the assumption of i.i.d. initialization of the weights, the weight distribution evolves according to a particular stochastic differential equation. Note that the analysis of SGD dynamics has been developed that connects naturally to the theory of universal approximation \cite{sirignano2020mean}. \section{System Model} \label{sec:System Model} In many distributed training scenarios of practical relevance, such as FL paradigm, the communication from the server to the remote users is unconstrained, as the PS is generally not limited in power or connectivity. Accordingly, the main bottleneck is the the up-link communication \cite{konevcny2016federated,li2019federated} i.e., the updates transferred from the users to the centralized servers. For this reason, we study distributed training scenario in which a remote user wishes to communication its local stochastic gradient in \eqref{eq:stochastic_local_gradient} to PS. To measure the transmission efficiency in the decentralized model training scenario, we introduce a measure of communication complexity as in the next section. \subsection{Rate-limited distributed DNN training} Consider the distributed DNN training scenario in which the communication between each user and the PS take place over a noiseless channel with finite capacity. To meet the finite capacity constraint, the local gradient $\gtv_{t}^{(u)}$ is first quantized via a quantizer $Q:\mathbb{R}\rightarrow \mathcal{X}$ to form the representative $\hat{\gv}_t^{(u)}=Q(\gtv_{t}^{(u)})$, where $\mathcal{X}$ is the collection of representatives (i.e., quantization levels). After that, we employ data compression $h:\mathcal{X}\rightarrow \mathbb{F}_2^{*}$ to form $\mathbf{b}_t^{(u)}=h(\hat{\gv}_t^{(u)})$, which removes the redundancy inherent in the local gradients for reducing the amount of data required to be transmitted. Note that we allow $h$ to be a variable-length coding scheme; hence, the range is $\mathbb{F}_2^{*}$. Let us assume that the local gradient is distributed i.i.d. according to $\mathbb{P}_{\tilde{G}_t}$. Also, let $r_t^{(u)}$ be the length of $\mathbf{b}_t^{(u)}$. We define the expected length of $u\in[U]$ at $t\in[T]$ as \ea{ R_t^{(u)} = \mathbb{E}_{Q,h} \left[r_t^{(u)}\right], } where the expectation is taken w.r.t. $\mathbb{P}_{\tilde{G}_t}$. We are now ready to define the {\em communications overhead} of a certain pair of $(Q,h)$ as the \underline{sum expected lengths} conveyed over the up-link channel over the training, that is \begin{equation} \label{eqn:Overhead} R = \sum_{t \in [T]} \sum_{u \in [U]} R_t^{(u)}. \end{equation} % In this paper, we consider the \emph{lossless compression} scenarios in which the PS is interested in the exact reconstruction of the quantized gradients $\hat{\gv}_t^{(u)}$ from $\mathbf{b}_t^{(u)}$. When lossless compression is considered, classical results in lossless source coding can be applied for gradient compression. When the underlying distribution $\mathbb{P}_{\tilde{G}_t}$ is unknown, one can employ Lempel-Ziv coding, which is asymptotically optimal in terms of the expected length. However, the performance of such an universal source coding scheme is not acceptable in the short to medium source length regime. In contrast, in the presence of knowledge about $\mathbb{P}_{\tilde{G}_t}$, optimal lossless compression can be easily achieved by Huffman coding \cite{cover_book}. This naturally raises the problem of statistical modeling of gradient distribution, which is the main focus of this paper. \begin{remark} Throughout the paper, we shall not investigate the lossy gradient compression case. This follows from the fact that a precise understanding of the effect of the distortion criteria used for compression on the learning performance is unclear. For instance, top-k sparsification \cite{shi2019understanding} suggests that an appropriate choice of distortion should take into account the gradient magnitude. This is in contrast with the compression error introduced by the classic MSE criteria which is commonly used in practical lossless compression algorithms. \end{remark} \section{Proposed Approach} \label{sec:Proposed Approach} Let us begin by clarifying the simulations setting used in the remainder of the section. After that, we present our main contributions, which contain a set of simulations that allow us to argue that $\mathsf{GenNorm}$ is a fair model for gradient distribution. Our evidence includes comparisons based on histogram, Wasserstein distance of order 2, and compression rates with Huffman codes. \subsection{DNN training setting} \label{subsec:DNN train setting} In this paper, we consider the training for the CIFAR-10 dataset classification task using the following three architectures: (i) DenseNet121, (ii) ResNet50V2, and (iii) NASNetMobile. For each architecture, the training is performed using SGD optimizer with a constant $\gamma_{t}=0.01$ learning rate in \eqref{eq:model_update}. The rest of the configurations of the parameters and hyperparameters used for the training are specified in Tab. \ref{tab:DNN parameters}. \begin{table} \footnotesize \centering \vspace{0.04in}\caption{Parameters and hyperparameters used for the training of the DNN models.} \label{tab:DNN parameters} \begin{tabular}{|c|c|} \hline Dataset & CIFAR-10 \\ \hline Training Samples & \num{50000} \\ \hline Test Samples & \num{10000} \\\hline Optimizer & SGD \\ \hline Learning Rate & \num{0.01} \\ \hline Momentum & 0 \\ \hline Loss & Categorical Cross Entropy \\ \hline Epochs & 100 \\ \hline Mini-Batch Sizes & 64 \\ \hline \end{tabular} \end{table} During each batch-iterations, the gradients of the trainable parameters are accumulated on a temporal memory on a per layer basis with the intention on averaging them along the epoch. At the end of the epoch, the gradients are saved and the temporal memory is freed. This process is repeated until the last epoch for the gradient analysis provided in the next subsections.\footnote{The code for the gradient modeling and analysis is available at \url{https://github.com/Chen-Zhong-Jing/Save_Model_Gradient}} As these are very deep networks as specified in Tab. \ref{tab:total network parameters}, we will limit the scope to three layers in each of the architectures: one 2-dimensional convolution layer located in the upper, middle, and lower sections of the networks. Tab. \ref{tab:network parameters} details the number of trainable weight parameters for these chosen layers. \begin{table} \footnotesize \caption{Total number of layers, weight parameters, and trainable weight parameters belonging to each architecture.} \label{tab:total network parameters} \centering \begin{tabular}{|c|c|c|c|} \hline{Architectures} & Layers & Total Params & Train Params \\ \hline{DenseNet121} & 121 & \num{7047754} & \num{6964106} \\ \hline{ResNet50V2} & 50 & \num{23585290} & \num{23539850} \\ \hline{NASNetMobile} & - & \num{4280286} & \num{4243548} \\ \hline \end{tabular} \end{table} \begin{table} \footnotesize \caption{Number of trainable weight parameters for the chosen layers of each architecture.} \label{tab:network parameters} \centering \begin{tabular}{|c|c|c|c|} \hline{Architectures} & Upper & Middle & Lower\\ \hline{ResNet50V2} & \num{4096} & \num{32768} & \num{524288} \\ \hline{DenseNet121} & \num{9408} & \num{16384} & \num{65536} \\ \hline{NASNetMobile} & \num{3872} & \num{30976} & \num{185856} \\ \hline \end{tabular} \end{table} \subsection{Gradient Quantization} For the quantizer $Q$, we adopt the $8$-bit sign-exponent-mantissa with $[1,5,2]$ to quantize the gradients. The $8$-bit $[1,5,2]$ format forms the range $[2^{-16},2^{15}]$ of numbers, which are used to establish the bin edges. The gradients are quantized to the centers of the bins they locate in. \subsection{GenNorm modeling} \label{sec:GenNorm modeling} First, we wish to argue that the gradient distribution $\mathbb{P}_{G_t}$ can be modelled as an i.i.d. $\mathsf{GenNorm}$ distribution, i.e., they have the pdf \ea{ \mathsf{GenNorm}(x,\mu, \al, \be) = \f {\be}{2\al \Gamma(1/\be)} \exp \lcb - \lb \f { \labs x-\mu\rabs} {\al} \rb^{\be}\rcb, \label{eq:gennorm} } where $(\mu, \al, \be)$ are the location, scale, and shape parameters, respectively. Some important parameters for $\mathsf{GenNorm}$ includes the mean, variance, and kurtosis that have the following expressions: \ea{ \mathrm{Mean}=\mu, \quad \mathrm{Var} = \frac{\alpha^2\Gamma(3/\beta)}{\Gamma(1/\beta)}, \quad \mathrm{Kurt} = \frac{\Gamma(5/\beta)\Gamma(1/\beta)}{\Gamma(3/\beta)^2}. \label{eq:kurtosis} } $\mathsf{GenNorm}$ is a family of distributions that subsumes Laplace ($\be=1$) and Normal $(\be=2)$ distributions. When the shape parameter $\be < 2$, the distribution is leptokurtic and has fatter tail than the normal distribution. \begin{assumption*}{\bf GenNorm DNN gradients:} For each layer and each epoch, the DNN gradients are distributed according to the $\mathsf{GenNorm}$ distribution in \eqref{eq:gennorm}. \end{assumption*} We refer to the above assumption as the \emph{GenNorm} assumption. In the remainder of the section, we shall motivate the $\mathsf{GenNorm}$ assumption from a statistical perspective. Successively, we shall motivate this assumption from a practical perspective by showing that it offers substantial advantages for the setting in Sec. \ref{sec:System Model}. \medskip \noindent {\bf Stochastic validation:} Let us begin by visually inspecting the gradient histogram for the networks in Sec. \ref{subsec:DNN train setting}, as depicted in Fig. \ref{fig:histogram}. In this figure, we plot (i) the sample distribution, (ii) the $\mathsf{GenNorm}$ fitting, and (iii) the $\mathsf{Norm}$ fitting for ResNet50V2 and NASNetMobile across three epoch: $2$, $50$, and $100$. We observe that in the earlier epochs, the gradient histogram is closer to the $\mathsf{GenNorm}$ distribution in that the sample distribution is (i) more concentrated in zero, and (ii) it contains heavier tails than the $\mathsf{Norm}$ distribution. As the training continues, the variance of the gradient distribution gradually reduces and approaches the $\mathsf{Norm}$ distribution. For instance, the gradients from ResNet50V2 seems to converge to the $\mathsf{Norm}$ distribution slower than NASNetMobile. \begin{figure} \centering \input{Plots/histogram_pdf} \caption{Histogram of gradient (blue) with PDF of $\mathsf{GenNorm}$ (red) and $\mathsf{Norm}$ (green) of top layer for epoch 2, 50, and 100 in two different network.} \label{fig:histogram} \end{figure} Fig. \ref{fig:histogram} only provides a qualitative depiction of the $\mathsf{GenNorm}$ assumption. A quantitative depiction is provided in Fig. \ref{fig:gradient_wasserstein_distance_2}: here we plot the 1D $W_2$ Wasserstein distance, defined as \ea{ W_2(X,Y)=\left(\int_{0}^{1}|F^{-1}_{X}(z)-F^{-1}_{Y}(z)|dz\right)^{1/2} } between the $\mathsf{GenNorm}$ distribution and the gradient samples versus the $\mathsf{Norm}$ distribution and the gradient samples for the lower layer DenseNet121 as a function of the epoch number. We again notice that the $\mathsf{GenNorm}$ provides a closer fitting with gradient samples than the $\mathsf{Norm}$. Additionally, we notice the relative distance between $\mathsf{GenNorm}$ and $\mathsf{Norm}$ decreases with the epoch number, again suggesting that for large enough epoch number the gradient distribution tends towards the $\mathsf{Norm}$. \smallskip \noindent {\bf Distribution parameters:} The mean and variance of the sample gradient distribution is provided in Table. \ref{tab:network mean and variance}, together with the respective confidence interval. Another important aspects of the $\mathsf{GenNorm}$ is that it highlights the role of the kurtosis in describing the behaviour of the gradients, as in \eqref{eq:kurtosis}, the kurtosis depends only on the parameter $\be$. From Figs. \ref{fig:densenet_kurtosis} and \ref{fig:nasnet_kurtosis}, we again observe the $\mathsf{GenNorm}$ modeling tending towards the $\mathsf{Norm}$ with further epochs: The excess kurtosis evolves from positive to near zero. \begin{figure} \centering \input{Plots/gradient_wasserstein_distance_2} \vspace{-0.3cm} \caption{1D Wasserstein distance of the DenseNet121 lower layer.} \label{fig:gradient_wasserstein_distance_2} \end{figure} \begin{figure} \centering \input{Plots/densenet_kurtosis} \vspace{-0.3cm} \caption{Kurtosis of the gradients of the Upper, Middle, and Lower convolution layer in the DenseNet121.} \label{fig:densenet_kurtosis} \end{figure} \begin{figure} \centering \input{Plots/nasnet_kurtosis} \vspace{-0.3cm} \caption{NASNetMobile: Kurtosis of each convolution layer.} \label{fig:nasnet_kurtosis} \end{figure} \begin{table*}[t] \footnotesize \vspace{0.04in}\caption{The mean and variance of NASNetMobile's gradient at different epochs} \label{tab:network mean and variance} \centering \begin{tabular}{|c|c|c|c|c|} \hline \hline{Layers} & & Epoch 2 & Epoch 50 & Epoch 100\\ \hline \multirow{2}{*}{Upper} & mean & \num{-1.72e-05} $\pm$ \num{1.12e-07} & \num{-8.38e-05} $\pm$ \num{1.90e-08} & \num{-5.53e-05} $\pm$ \num{2.13e-08} \\ \cline{2-5} & variance & \num{9.58e-05}$\pm$ \num{8.03e-08} & \num{1.86e-05}$\pm$ \num{3.82e-10} & \num{1.07e-05}$\pm$ \num{1.82e-11} \\ \hline \multirow{2}{*}{Middle} & mean & \num{6.66e-06}$\pm$ \num{9.53e-09} & \num{1.10e-05}$\pm$ \num{8.57e-09} & \num{3.68e-06}$\pm$ \num{1.92e-09} \\ \cline{2-5} & variance & \num{4.96e-06}$\pm$ \num{1.19e-10} & \num{3.56e-06}$\pm$ \num{7.66e-11} & \num{1.93e-06}$\pm$ \num{7.31e-13} \\ \hline \multirow{2}{*}{Lower} & mean & \num{8.97e-05}$\pm$\num{4.40e-09} & \num{4.85e-06}$\pm$\num{3.88e-10} & \num{5.10e-07}$\pm$\num{3.13e-11} \\ \cline{2-5} & variance & \num{4.74e-07 }$\pm$ \num{4.99e-14} & \num{2.24e-07}$\pm$ \num{2.52e-15} & \num{1.96e-07}$\pm$ \num{6.30e-16} \\ \hline \end{tabular} \end{table*} \subsection{GenNorm gradient compression performance} Although we are unable to substantiate the $\mathsf{GenNorm}$ assumption for a large class of networks architectures and training datasets, we can argue that treating the DNN gradients as $\mathsf{GenNorm}$ allows one to compress the gradients more effectively, both in terms of compression rate and computational complexity. In this section we consider the training performance for the model in Sec. \ref{sec:System Model} with the rate in \eqref{eqn:Overhead}. For this scenario, we wish to compare the compression performance of three compression schemes $h$: \begin{enumerate} \item Compression using LZ78, \item Huffman coding using $\mathsf{GenNorm}$ modelling, \item Huffman coding using $\mathsf{Norm}$ modelling. \end{enumerate} For 2) and 3) we use the quantized levels to compute the PMF of each bins from the CDF of fitted distribution. In Fig. \ref{fig:gradient_compression_rate} we plot the compression performance for ResNet50V2 of the three schemes above. We notice that the compression performance of the $\mathsf{GenNorm}$ modelling provides an increase in performance at very low computational cost. As argued in Sec. \ref{sec:GenNorm modeling}, the gradient distribution approaches the $\mathsf{Norm}$ distribution as the depth of the network increases: this can also be observed from the compression performance in the last panel in Fig. \ref{fig:gradient_compression_rate}. In addition to smaller communication overhead, compression with Huffman coding also enjoys much lower complexity as compared to compression with LZ78 as the latter has to reconstruct the codebook on-the-fly. Finally, in Fig. \ref{fig:accuracy}, we plot the accuracy of the network trained with the $8$ bits quantized gradients as a function of the epoch number. We would like to emphasize that the loss in accuracy comes purely from the quantization and has nothing to do with data compression as lossless data compression is adopted. \begin{figure} \centering \input{Plots/gradient_compression_rate} \vspace{-0.3cm} \caption{Gradient compression ratio for upper, middle, and lower layers from the ResNet50V2.} \label{fig:gradient_compression_rate} \end{figure} \begin{figure} \centering \input{Plots/resnet_accuracy} \vspace{-0.3cm} \caption{Test accuracy of ResNet50V2.} \label{fig:accuracy} \end{figure} \section{Conclusion} In this paper, we have investigated the assumption that the DNN gradients can be well-modelled through a generalized normal distribution. This observation has been used to implement gradient compression schemes for the rate-limited decentralized DNN training, that is the scenario in which a central DNN model is trained at remote users over local datasets. Once the DNN gradients have been obtained, the remote user quantizes these values and compresses them for transmission to the PS over a noiseless but rate limited communication channel. A series of simulations have been conducted to validate that the gradient can be modelled as having $\mathsf{GenNorm}$ distribution. Numerical evaluations have shown the effectiveness of this modelling in reducing the communication overhead between the parameter server and the remote users in the above scenario. \bibliographystyle{IEEEtran}
{'timestamp': '2021-11-16T02:28:11', 'yymm': '2111', 'arxiv_id': '2111.07599', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07599'}
arxiv
\section{Introduction} In this paper, we present a novel approach to optimally choosing the location of the next monitoring well when conducting a groundwater survey. Establishing a monitoring well is generally costly, and depends on the specific geological context and the required penetration depth, and choosing the most informative location for each well is a critical task when designing a groundwater survey. Groundwater surveying and modelling are intrinsically imbued with uncertainty and solutions and predictions are without exception non-unique \citep{anderson_applied_2015}. Hence, in this paper we assume the perspective that a useful sampling location is one that most significantly reduces the uncertainty in the solution, while simultaneously having a substantial influence on some quantity of interest (QoI). While multiple non-invasive and relatively inexpensive methods for groundwater surveying exist \citep{loke_recent_2013, saey_combining_2015, nielsen_review_2017, auken_ttem_2019}, these methods all involve solving an inverse problem to reconstruct the hydraulic head, which introduces an additional layer of uncertainty. Hence, in this work, we focus on the problem of determining aquifer characteristics from direct point measurements of hydraulic head and flux from monitoring wells, and how to optimally choose the locations of such wells, given existing data. While the method is here contextualised within this particular problem, it can easily be generalised to any setting where a continuous function and a derived QoI are approximated with point measurements. In the ``classic'' theory of optimal design, we often distinguish between optimality criteria that minimise the estimated parameter variances (e.g. $A-$, $D-$ and $E-$optimality) and those that minimise the prediction variance (e.g. $G-$, $V-$ and $I-$optimality) \citep{pukelsheim_optimal_2006, myers_response_2016}. Since in this study we are primarily concerned with the prediction variance, the method presented here belongs in the latter category. In this context, our method can broadly be considered $G-$optimal, since our vanilla acquisition function targets the location of the highest posterior dispersion \citep[see e.g.][]{myers_response_2016}. However, rather than iteratively searching for a design that maximises an optimality criterion, we directly utilise a posterior dispersion estimate to construct an acquisition function. We remark that while there are some abstract parallels between the method presented here and classic optimal design, our method is probably better understood in the context of Bayesian Optimisation, as discussed later. Additionally, the classic optimal design approach is typically centered around the problem of choosing an experimental design that is optimal with respect to an optimality criterion, \textit{before taking any measurements}. In this paper, we take an adaptive approach and assume that some measurements are already available, and we want to propose optimal \textit{new} sampling locations, given the data we already have. How the initial measurement locations are optimally chosen is beyond the scope of this paper, but we refer to e.g. \citet{cox_theory_2000, pukelsheim_optimal_2006, myers_response_2016} for an extensive overview of optimal design of experiments. We remark that our dual-weighted method could in theory be employed to choose initial measurement locations, but in that case the dispersion of the solution would be constrained only by the prior distribution of parameters and the constraints imposed by the constitutive equations. In this case, the method presented herein may be used in conjunction with some space-filling design strategy or using local penalisation functions as described in Section \ref{sec:dual_weighted}. However, either of these workarounds would require an informed prior to work well. We recycle the notion from classic optimal design that the information gain is driven by minimising the dispersion of a target distribution \citep{lindley_measure_1956}. However, rather than integrating out all possible measurements and model parameters to find the utility of a given design, we take a simpler approach. Namely, we use a Monte Carlo estimate of the (current) posterior dispersion of the solution to a Partial Differential Equation (PDE) (or some appropriate function thereof) as an acquisition function. The underlying rationale being that if we wish to know more about the distribution of our solution, the most useful place to take a new sample is at the point of the highest posterior uncertainty. In this context, our Vanilla approach (see Section \ref{sec:vanilla}) is not dissimilar to the maximum entropy approach to the optimal sensor placement problem \citep{shewry_maximum_1987}, where sensors are added at the point of the highest uncertainty of some probabilistic function that is fitted to current sensor measurements, for example a Gaussian Process (GP) emulator. While this strategy will typically place many sensors at the boundaries of the sampling space in the context of adaptive GP fitting \citep{mohammadi2021crossvalidation}, this is not necessarily the case when targeting the uncertainty of the solution to a PDE, since that will be constrained by boundary conditions. The sensor placement problem has been studied extensively in the context of GP emulators, and multiple improvements to the maximum entropy approach have been made (see e.g. \citet{krause_near-optimal_2008, beck_sequential_2016, mohammadi2021crossvalidation}). However, since our objective is to minimise the uncertainty of a PDE-derived QoI, and not a GP emulator, many of the recent developments are not immediately applicable, since they are tailored for use with a GP emulator. Hence, the Vanilla approach presented herein can be considered a reformulation of the original maximum entropy approach, particularly tailored for the (probabilistic) solution of a PDE. Our method (see Section \ref{sec:ada_design}) borrows ideas from other fields, not obviously related to classic optimal design. First, our adaptive optimal design approach is formulated in terms of an acquisition function, a term typically associated with Bayesian Optimisation (BO, \citet{mockus_bayesian_1989, frazier_tutorial_2018}). Moreover, our approach uses ideas from both prior-guided BO \citep{souza_bayesian_2021} and batch BO \citep{pmlr-v51-gonzalez16a}, the similarities with which are discussed in Section \ref{sec:remarks}. While in the context of BO, the aim is to find the maximum or minimum of some function that is expensive to evaluate, our objective is to simply reduce the uncertainty of our model predictions. Hence, our vanilla acquisition function addresses solely the uncertainty of some target function, and not the function value itself. Second, our approach is inspired by the goal-oriented error-estimation used in mesh-adaptation for PDEs \citep{prudhomme_goal-oriented_1999, oden_goal-oriented_2001}, where the intention is to refine a mesh locally and parsimoniously to reduce the simulation error with respect to some QoI using an influence function that is the solution to an adjoint PDE. This approach, however, is most useful for forward problems, where the domain and coefficients are well-known, and the groundwater flow problem is typically not of this kind. Instead, we use the same approach of computing an influence function with respect to the QoI to determine, not where the mesh should be refined, but from where we need more data. The idea of exploiting the adjoint or \textit{dual} problem to minimise the posterior uncertainty with respect to a QoI was first explored by \citet{attia_goal-oriented_2018} in a similar context as our model problem. However, there are several crucial differences between their approach and the one presented in this paper. First, their method is set in the ``classic'' optimal design context, where a number of sampling locations are determined before taking any measurements, based on the maximising the expected information gain according to some criterion derived from the Fisher Information matrix. Second, since only a finite number of designs can be explored this way, the prospective sampling locations are fixed to a relatively coarse grid. Finally, the approach described in \citet{attia_goal-oriented_2018} requires the adjoint operator to be linear -- an assumption which is suitable for only a subset of QoIs. We employ Markov Chain Monte Carlo (MCMC) techniques (see Section \ref{sec:bayes_inv}) to generate samples from the posterior distribution of the model parameters given the data $\pi(\theta \vert \mathbf{d})$, where the model parameters $(\theta)$ in this case describe hydraulic conductivity and the data ($\mathbf{d}$) are point measurements of hydraulic head and flux (see Section \ref{sec:gw_flow}). Even if the model parameters themselves are of secondary interest to a given problem, we can use the MCMC samples to construct Monte Carlo estimates of any parameter-derived quantity or function, such as the hydraulic flux across a boundary, or the peak concentration of a contaminant at a well. Additionally, unlike traditional inversion techniques, MCMC allows for rigorously quantifying the uncertainty of the inverse problem, which is useful in the context of engineering decision support systems, in particular risk assessment studies. We believe that there are many unexploited application opportunities tangential to the study of Bayesian posteriors and demonstrate, in this paper, one such application. Figure \ref{fig:concept} illustrates the proposed workflow at a high level, where new wells are sequentially established at locations of high uncertainty and influence on a QoI, as dictated by the acquisition function. This paper is mainly concerned with the construction of optimal acquisition functions based on the posterior information which would be immediately available from quantifying the uncertainty of the Bayesian inverse problem. \begin{figure}[htbp] \centering \includegraphics[width=1.0\textwidth]{concept} \caption{Conceptual diagram of the proposed adaptive optimal design workflow. Here, $\mathbb V(\mathcal Q)$ denotes the variance of the quantity of interest $\mathcal Q$ and $\mathbb V_{crit}$ the desired critical variance.} \label{fig:concept} \end{figure} In the following sections, we briefly summarise the theory of Bayesian inverse problems, MCMC and groundwater flow modelling. We then outline the proposed methodology and demonstrate the effectiveness of methodology on a synthetic example. We show that efficient acquisition functions can easily be constructed from information that would already be available from solving the Bayesian inverse problem using MCMC. The method avoids many of the complex calculations that are associated with classic optimal design and exploits information about the Bayesian posterior in a direct and straightforward way. \section{Theory} In this section, we first briefly outline the framework of Bayesian inverse problems and Markov Chain Monte Carlo (MCMC), a popular technique employed to draw samples from the Bayesian posterior. We then summarise the fundamentals of groundwater flow modelling for steady-state groundwater flow in a confined aquifer using the Finite Element Method (FEM). Finally, we describe our novel approach to adaptive optimal design of groundwater surveys. \subsection{Bayesian Inversion} \label{sec:bayes_inv} A Bayesian inverse problem can be stated compactly as: Given some data $\mathbf{d}$, find the distribution $\pi(\theta \vert \mathbf{d})$ with model parameters $\theta \in \Theta$, where $\Theta$ is the parameter space, so that \begin{equation} \label{eq:forward} \mathbf{d} = \mathcal F(\theta) + \mathbf{\epsilon} \end{equation} where $\mathcal F(\theta)$ is the model output and $\mathbf{\epsilon}$ is the measurement error, which is typically assumed to be Gaussian. Bayes theorem then states that \begin{equation} \pi(\theta \vert \mathbf{d}) = \frac{\pi_{\text{p}}(\theta) \mathcal{L}(\mathbf{d} \vert \theta)}{\pi(\mathbf{d})} \end{equation} where $\pi(\theta \vert \mathbf{d})$ is referred to as the \textit{posterior} distribution, $\pi_{\text{p}}(\theta)$ is \textit{prior} distribution, encapsulating what we already know about our model parameters and $\mathcal{L}(\mathbf{d} \vert \theta)$ is called the \textit{likelihood}, essentially a measure of misfit between the model output $\mathcal F(\theta)$ and the data $\mathbf{d}$. While the the so-called \textit{evidence} $\pi(\mathbf{d}) = \int_\Theta \pi_{\text{p}}(\theta) \: \mathcal{L}(\mathbf{d} \vert \theta) \: d\theta$ is generally infeasible or impossible to determine in most real-world scenarios, various sampling techniques allows us to make statistical inferences from $\pi(\theta \vert \mathbf d)$ anyway. Examples include Importance Sampling (IS) and Markov Chain Monte Carlo (MCMC) methods. While these methods are not the object of this study, a short summary of the main ideas of MCMC, which is the specific method employed for inversion in this study, is provided for completeness. In MCMC we exploit that $\pi(\mathbf{d})$ is constant and does not depend on the parameters $\theta$. We can therefore write \begin{equation} \pi(\theta \vert \mathbf{d}) \propto \pi_{\text{p}}(\theta) \mathcal{L}(\mathbf{d} \vert \theta) \end{equation} or equivalently, for $x, y \in \Theta$ \begin{equation} \label{eq:likelihood_ratio} \frac{\pi(y \vert \mathbf{d})}{\pi(x \vert \mathbf{d})} = \frac{\pi_{\text{p}}(y) \mathcal{L}(\mathbf{d} \vert y)}{\pi_{\text{p}}(x) \mathcal{L}(\mathbf{d} \vert x)} \end{equation} We then introduce a \textit{transition kernel} or \textit{proposal distribution} $q(y \vert x)$, allowing us to transition from one state $x$ to another $y$. Repeatedly applying the transition kernel $q(y \vert x)$ followed by an accept/reject step prescribed by equation (\ref{eq:acceptance}) we construct a Markov chain where the samples, after an initial \textit{burn-in}, are precisely from the required distribution $\pi(\theta \vert \mathbf{d})$. Here, burn-in refers to the initial MCMC samples which are discarded, since they may not be representative of the equilibrium distribution of the Markov chain. This procedure is described in the box below \citep{metropolis_equation_1953, hastings_monte_1970, gelman_bayesian_2004}. \begin{center} \fbox{\parbox{0.95\textwidth}{ \textbf{The Metropolis-Hastings Algorithm}, \hspace{0.2cm} $\theta^{(0)} \sim \pi_{\text{p}}(\theta)$, for $i = 0, \dots, N$: \begin{enumerate} \item Given a parameter realisation $\theta^{(i)}$ and a transition kernel $q(\theta' \vert \theta^{(i)})$, generate a proposal $\theta'$. \item Compute the acceptance probability of the proposal given the previous realisation: \begin{equation}\label{eq:acceptance} \alpha(\theta'|\theta^{(i)}) = \text{min} \left\{ 1, \frac{\pi_{\text{p}}(\theta') \mathcal{L}(\mathbf{d} \vert \theta')}{\pi_{\text{p}}(\theta^{(i)}) \mathcal{L}(\mathbf{d} \vert \theta^{(i)})} \frac{q(\theta^{(i)} \vert \theta')}{q(\theta' \vert \theta^{(i)})} \right\} \end{equation} \item If $u \sim U(0,1) > \alpha$ then set $\theta^{(i+1)} = \theta^{(i)}$, otherwise, set $\theta^{(i+1)} = \theta'$. \end{enumerate} }} \end{center} The acceptance probability (Eq.~\ref{eq:acceptance}) ensures that the algorithm is in detailed balance with the target (posterior) distribution $\pi(\theta \vert \mathbf{d})$. See e.g. \citet[Sec. 5.3]{liu_monte_2004} for more details. Note that when the measurement error $\mathbf{\epsilon}$ is Gaussian, $\mathbf{\epsilon} \sim \mathcal N(0, \Sigma_\epsilon)$, which we assume in the experiment in Section \ref{sec:example}, then the (unnormalised) likelihood functional takes the following form: \begin{equation} \mathcal{L}(\mathbf{d} \vert \theta) \propto \exp \left( -\frac{1}{2}(\mathcal F(\theta) - \mathbf{d})^T \Sigma_\epsilon^{-1} (\mathcal F(\theta) - \mathbf{d}) \right). \end{equation} In this study we employ a number of extensions to the Metropolis-Hastings algorithm to speed up inference, namely the Delayed Acceptance (DA, \citep{christen_markov_2005}) algorithm with finite subchains \citep{lykkegaard_multilevel_2020, lykkegaard2022multilevel}, also referred to as the \textit{surrogate transition method} by \citet{liu_monte_2004}. The DA algorithm exploits an approximate forward model (or Reduced Order Model, ROM) $\hat{\mathcal F}$ to filter MCMC proposals before evaluating them with the fully resolved forward model $\mathcal F$, resulting in a reduction in computational cost. Moreover, we employ a state-independent Approximation Error Model (AEM) to probabilistically correct for model reduction errors introduced by the approximate model, as described by \citet{cui_posteriori_2018}. Finally, we use the Adaptive Metropolis (AM) algorithm as the transition kernel \citep{haario_adaptive_2001}. In this work, we used the open-source DA MCMC framework \texttt{tinyDA}\footnote{\href{https://github.com/mikkelbue/tinyDA}{https://github.com/mikkelbue/tinyDA}} to perform the MCMC sampling. \subsection{Groundwater Flow} \label{sec:gw_flow} The groundwater flow equation for steady flow in a confined, inhomogeneous aquifer occupying the domain $\Omega$ with boundary $\Gamma$ can be written as the scalar elliptic partial differential equation \begin{equation}\label{eq:spde} -\nabla \cdot k(\mathbf{x})\nabla u(\mathbf{x}) = g(\mathbf{x}), \quad \mbox{for all} \quad \mathbf{x} \in \Omega, \end{equation} subject to boundary conditions on $\Gamma = \Gamma_D \cup \Gamma_N$ with the constraints \begin{equation} u(\mathbf{x}) = u_D(\mathbf{x}) \quad \text{on} \quad \Gamma_D \quad \text{and} \quad -(k(\mathbf{x})\nabla u(\mathbf{x})) \cdot \mathbf{n} = q_N(\mathbf{x}) \quad \text{on} \quad \Gamma_N. \end{equation} Here, $k(\mathbf{x})$ is the hydraulic conductivity, $u(\mathbf{x})$ is the hydraulic head, $g(\mathbf{x})$ are sources and sinks, and $\Gamma_D$ and $\Gamma_N$ are boundaries with Dirichlet and Neumann conditions, respectively (see e.g. \citet{diersch_feflow:_2014}). If $\theta$ somehow parameterises the conductivity, then we have $k(\mathbf{x}) = k(\mathbf{x}, \theta)$. This equation can be converted into the weak form by multiplying with a test function $v \in H^1(\Omega)$ and integrating by parts: \begin{equation} \label{eq:weak_form} \int_\Omega \nabla v \cdot (k(\mathbf{x}, \theta) \cdot \nabla u) \: d\mathbf{x} + \int_{\Gamma_N} v \: q_N(\mathbf{x}) \: ds \: = \int_\Omega v \: g({\bf x}) \: d\mathbf{x}, \quad \forall v\in H^1(\Omega) \end{equation} subject to the boundary condition $u(\mathbf{x}) = u_D(\mathbf{x}) \: \text{on} \: \Gamma_D$, where $H^1(\Omega)$ is the Hilbert space of weakly differentiable functions on $\Omega$. We approximate the solution $u(\mathbf{x})$ in a finite element space $V_\tau \subset H^1(\Omega)$ on a finite element mesh $\mathcal Q_\tau(\Omega)$, defined by piecewise linear Lagrange polynomials $\{\phi_i(\mathbf{x})\}_{i=1}^M$ associated with the $M$ finite element nodes. This can be rewritten as a sparse system of equations \begin{align} \label{eq:gw_se} \mathbf{A}(\theta)\mathbf{u} = \mathbf{b} \quad \text{where} \quad A_{ij} &= \int_\Omega \nabla \phi_i(\mathbf{x}) \cdot k(\mathbf{x}, \theta) \nabla \phi_j(\mathbf{x}) d\mathbf{x} \quad \text{and} \\ b_{i} &= - \int_{\Gamma_N} \phi_i(\mathbf{x}) \: q_N(\mathbf{x}) \: ds \: + \int_\Omega \phi_i(\mathbf{x}) \: g({\bf x}) \: d\mathbf{x} \end{align} where $\mathbf{A}(\theta) \in \mathbb R^{M \times M}$ is the global stiffness matrix and $\mathbf{b} \in \mathbb R^{M}$ is the load vector. The solution to this system $\mathbf{u} := [u_1, u_2, \dots, u_M] \in \mathbb R^M$ represents the hydraulic head at each node, which can be interpolated to the entire domain using the finite element shape functions: $u(\mathbf{x}) = \sum_{i=1}^M u_i \phi_i(\mathbf{x})$. In our numerical experiments, we used the open-source high-performance finite elements package \texttt{FEniCS} \citep{langtangen_solving_2016} to solve these equations. \subsection{Adaptive Optimal Design} \label{sec:ada_design} The overarching research question of this paper is this: if we want to collect more data to reduce the variance in our posterior Monte Carlo estimates, where in the modelling domain $\Omega$ should we do it, to maximise the benefit of the new borehole? More formally, if we let $t$ denote the current design of the survey, so that $\mathbf{d}_t$ and $\pi_t(\theta \vert {\mathbf{d}_t})$ denote, respectively, the data and posterior distribution corresponding to that design, we want to find the next sampling point $\mathbf{x}^\star$ that constrains $\pi_{t+1}(\theta \vert {\mathbf{d}_{t+1}})$ in an optimal way, after setting $\mathbf{d}_{t+1} = (\mathbf{d}_t, d^\star)^T$, where $d^\star$ is the newly collected data at $\mathbf{x}^\star$. \subsubsection{``Vanilla'' Approach} \label{sec:vanilla} As outlined in section \ref{sec:bayes_inv}, Bayesian inversion allows us to construct the posterior distribution of parameters given the data $\pi_t(\theta \vert \mathbf{d}_t)$. If the inversion was completed using MCMC, and obtaining the model output $\mathcal F(\theta)$ involved solving some partial differential equation with solution $u(\mathbf{x})$, we can cache these solutions during sampling, and would after sampling possess a set of pairs $\{(\theta^{(i)}, u^{(i)}(\mathbf{x}))\}_{i=0}^{N^\dagger}$. Since $\{\theta^{(i)}\}_{i=0}^{N^\dagger}$ are distributed exactly according to $\pi_t(\theta \vert \mathbf{d}_t)$, so are any functions of $\theta$, such as $u(\mathbf{x})$. Here, $N^\dagger$ is the number of MCMC samples after discarding the burn-in. Hence, we can easily obtain Monte Carlo estimates for \begin{equation*} \mathbb E_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)] \quad \mbox{and} \quad \mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta) \end{equation*} Here, $\mathbb D$ signifies some measure of statistical dispersion, for example variance, standard deviation, or entropy. We could, in accordance with the maximum entropy approach \citep{shewry_maximum_1987}, postulate that the accuracy of our inversion is driven by the dispersion in $u({\bf x})$ and hence we could solve the following optimisation problem \begin{equation} \label{eq:vanilla} \mathbf{x}^\star = \argmax_{\mathbf{x} \in \Omega} \mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)] \end{equation} \subsubsection{Dual-Weighted Approach} \label{sec:dual_weighted} The simple approach outlined above will improve the general quality of $u(\mathbf{x})$, but it is limited by the fact that it is not tailored for a particular quantity of interest $\mathcal Q$ and this is where the \textit{dual weighted} approach comes into play. In this context, rather than simply sampling from places with high uncertainty, we aim to pick sampling points that also have a high expected influence on our quantity of interest $\mathcal Q$. This is exactly the problem, that \textit{adjoint} or \textit{dual} state methods aim to solve \citep{plessix_review_2006}. Suppose in a particular application, we are interested in estimating a particular quantity of interest $\mathcal Q(u)$, which we can write as a functional of the solution. For example, if our quantity of interest is the hydraulic head around a point $\mathbf{x}' \in \Omega$, we could choose \begin{equation} \mathcal Q_{\mathbf{x}'}(u) = \int_\Omega u(\mathbf{x}) \exp\left(-\frac{(\mathbf{x} - \mathbf{x}')^2}{\lambda}\right)\;d\mathbf{x} \end{equation} for some sufficiently small length scale $\lambda$. This, however, is a trivial problem, since if the quantity of interest is the hydraulic head at some point, we can just place our monitoring well at that point and measure it. It would be much more useful to target a quantity of interest that we cannot measure directly. Hence, in this study we consider flux over a boundary $\Gamma'$ with the following functional: \begin{equation} \label{eq:q_boundary} \mathcal Q_{\Gamma'}(u) = \int_{\Gamma'} [-k(\mathbf{x}, \theta) \cdot \nabla u(\mathbf{x})] \cdot \mathbf{n} \: ds \end{equation} \noindent The adjoint state equation associated with Eq.~(\ref{eq:q_boundary}) is \begin{equation} \label{eq:adjoint_state_equation} \nabla \cdot k \nabla \omega = 0 \end{equation} subject to the boundary conditions \begin{align*} \omega_{D}(\mathbf{x}) &= 0 &\text{on} \quad &\Gamma_D\setminus\Gamma' \\ \omega_{\Gamma'}(\mathbf{x}) &= 1 &\text{on} \quad &\Gamma'\\ q_N^\omega(\mathbf{x}) &= (k(\mathbf{x})\nabla \omega(\mathbf{x})) \cdot \mathbf{n} = 0 &\text{on} \quad &\Gamma_N. \end{align*} The solution $\omega(\mathbf{x})$ is called the adjoint state or \textit{influence} function. Please refer to \citet{sykes_sensitivity_1985} and \ref{ap:adjoint_equation} for details on the derivation of the adjoint state equation and its associated boundary conditions. Integrating by parts and multiplying with a test function $v \in H^1(\Omega)$, we arrive at the weak form of the adjoint state equation: \begin{equation} \label{eq:adjoint} \int_\Omega \nabla v \cdot (k(\mathbf{x}, \theta) \cdot \nabla \omega) \: d\mathbf{x} + \int_{\Gamma_N} v \: q_N^\omega(\mathbf{x}) \: ds \: = 0, \; \forall v\in H^1(\Omega) \end{equation} subject to boundary conditions $\omega_{D}(\mathbf{x}) = 0 \: \text{on} \: \Gamma_D\setminus\Gamma' \: \text{and} \: \omega_{\Gamma'}(\mathbf{x}) = 1 \: \text{on} \: \Gamma'$. Given some conductivity parameters $\theta$, \eqref{eq:adjoint} can be discretised using the same finite element grid as \eqref{eq:gw_se}, leading to the following sparse system of equations: \begin{align} \mathbf{A}(\theta)\mathbf{\omega} = \mathbf{b}_{\omega} \quad \text{where} \quad A_{ij} &= \int_\Omega \nabla \phi_i(\mathbf{x}) \cdot k(\mathbf{x}, \theta) \nabla \phi_j(\mathbf{x}) d\mathbf{x} \quad \text{and} \\ b_{\omega, i} &= - \int_{\Gamma_N} \phi_i(\mathbf{x}) \: q_N^\omega(\mathbf{x}) \: ds. \end{align} It is important to note here, that the stiffness matrix $\mathbf{A}(\theta)$, since the steady-state groundwater flow equation is \textit{self-adjoint}, is exactly the same as in equation (\ref{eq:gw_se}), and the assembled system can hence be partially recycled when solving both equations. However, since the boundary conditions for the adjoint state equation are different than for the primal problem, care must be taken when assembling the adjoint system of equations. After solving this system of equations, the influence function can be interpolated to the entire domain using our finite element shape functions: \begin{equation*} \omega(\mathbf{x}) = \sum_{i=1}^M\omega_i\phi_i(\mathbf{x}) \quad \mbox{where} \quad \mathbf{\omega} = [\omega_1, \omega_2, \ldots, \omega_M]^T. \end{equation*} The influence function is commonly interpreted as the sensitivity of the quantity of interest to a unit point source anywhere on the domain \citep{sykes_sensitivity_1985, wilson_illustration_1985}, or in this particular case as the sensitivity of flow anywhere on the domain to the boundary condition. Broadly speaking, the influence function directs us towards areas of the modelling domain with a potentially high influence on our quantity of interest, which is what we required for our dual-weighted approach. We note that $\omega(\mathbf{x})$ is now a random function which depends on model parameters $\theta$, and we can obtain estimates for $\mathbb E_{\pi_t(\theta \vert \mathbf{d}_t)}[\omega({\bf x},\theta)]$. Hence, we propose the following acquisition function \begin{equation} \label{eq:dual_weighted} \mathbf{x}^\star = \argmax_{\mathbf{x} \in \Omega} \: \mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)] \cdot | \mathbb E_{\pi_t(\theta \vert \mathbf{d}_t)}[\omega(\mathbf{x},\theta)] |. \end{equation} where $|\cdot|$ denotes the absolute value. We use the absolute value of the expectation of the influence function to make sure that the weighting is always positive, since $\omega(\mathbf{x, \theta})$ is not always positive for other adjoint equations. We call this approach dual-weighted, since we are essential re-weighting the dispersion $\mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)]$, by the expected solution of the dual problem. Figure \ref{fig:procedure} illustrates the different steps in the proposed adaptive optimal design procedure. \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{procedure} \caption{Proposed adaptive optimal design procedure. As in Figure \ref{fig:concept}, $\mathbb V(\mathcal Q)$ denotes the variance of the quantity of interest $\mathcal Q$ and $\mathbb V_{crit}$ the desired critical variance.} \label{fig:procedure} \end{figure} \subsubsection{Remarks} \label{sec:remarks} (1) The dual-weighted approach can be considered a hybrid between the goal-oriented error estimation employed for mesh-adaptation in the context of various expensive and mesh-sensitive PDE problems (see e.g. \citet{prudhomme_goal-oriented_1999, oden_goal-oriented_2001}), and Bayesian Optimisation (BO), typically used to optimise some unknown function approximated with sparse and/or noisy data (see e.g. \citet{mockus_bayesian_1989, frazier_tutorial_2018}). In this context, our dual-weighted approach could be framed as a form of prior-guided BO \citep{souza_bayesian_2021}, where $\omega(\mathbf{x})$ broadly represents our prior belief that any point $\mathbf{x}$ constitutes a ``good'' sampling location. However, we remark that in our formulation $\omega(\mathbf{x})$ is not a probability distribution but a random weighting function. (2) In the above formulations, we have chosen the dispersion of the hydraulic head $\mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)]$ as the function representing uncertainty in the model. Other sensible choices of uncertainty metrics would be the dispersion of the hydraulic conductivity $\mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[k(\mathbf{x},\theta)]$, or of some norm of the flux $\mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[\lVert \mathbf{q}(\mathbf{x},\theta) \rVert_p]$. (3) Since sampling from $\pi_t(\theta \vert \mathbf{d}_t)$ can be computationally expensive, it may be desirable to pick multiple new sampling locations at each step of the algorithm. Denote the number of new sampling locations in each such batch acquisition as $N^\star$. Then this can be achieved by penalising the acquisition function by some local penalisation functions $\{\psi_{\mathbf{x}^\star_{i}}(\mathbf{x})\}_{i=1}^{N^\star-1}$, centered on the previous sampling points $\{\mathbf{x}^\star_{i}\}_{i=1}^{N^\star-1}$ of the current batch, as described in \citet{pmlr-v51-gonzalez16a}. This approach would yield the following dual-weighted batch acquisition function for $\{\mathbf{x}^\star_{i}\}_{i=2}^{N}$: \begin{equation} \label{eq:dual_weighted_batch} \mathbf{x}_{i}^\star = \argmax_{\mathbf{x} \in \Omega} \: \mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)] \cdot | \mathbb E_{\pi_t(\theta \vert \mathbf{d}_t)}[\omega(\mathbf{x},\theta)] | \cdot \prod_{j=1}^{i-1} \psi_{\mathbf{x}^\star_{j}}(\mathbf{x}). \end{equation} Similarly, the batch acquisition function for the vanilla approach takes the form \begin{equation} \label{eq:vanilla_batch} \mathbf{x}_{i}^\star = \argmax_{\mathbf{x} \in \Omega} \: \mathbb D_{\pi_t(\theta \vert \mathbf{d}_t)}[u(\mathbf{x},\theta)] \cdot \prod_{j=1}^{i-1} \psi_{\mathbf{x}^\star_{j}}(\mathbf{x}). \end{equation} A reasonable choice of penalisation functions would be the Gaussian \begin{equation}\psi_{\mathbf{x}'}(\mathbf{x}) = 1 - \exp\left(-\frac{1}{2}\frac{\lVert \mathbf{x} - \mathbf{x}'\lVert_2^2}{l_\psi} \right) \end{equation} where $l_\psi$ controls the dispersion of the function and $\lVert \cdot \lVert_2$ is the $L^2$-norm. Using such a penalisation function, the acquisition function would be exactly zero at previous sampling points from the current batch, and smoothly rebound to Eq.~(\ref{eq:dual_weighted}) or Eq.~(\ref{eq:vanilla}) as the distance to previous sampling points increases. (4) As mentioned earlier, we formulate our method in the context of steady state groundwater flow in a confined aquifer. While this is the most common approach to groundwater flow modelling, it is, naturally, not exhaustive. For a detailed analysis of the adjoint state equations for transient groundwater flow, we refer the to e.g. \citet{sun_inverse_1999} and \citet{lu_analytical_2015}. The unconfined case is considerably more complex, since the constitutive equations are nonlinear. While unconfined groundwater flow can, under some assumptions, be reasonably approximated by the constitutive equations for confined flow \citep{wang_introduction_1982}, this is not always the case. For a derivation and analysis of the adjoint equations pertaining to unconfined and coupled aquifers, we refer to e.g. \citet{sun_inverse_1999} and \citet{neupauer_adjoint_2012}. (5) Note that the constitutive and adjoint equations are discretised using FEM in the above section. We restrict ourselves to this method for brevity, but remark that the proposed acquisition functions (Eqs.~(\ref{eq:vanilla}), (\ref{eq:dual_weighted}), (\ref{eq:dual_weighted_batch}) and (\ref{eq:vanilla_batch})) are valid for any discretisation scheme. Also note that if piecewise linear shape functions are employed to approximate $u(\mathbf{x})$, the maxima of the acquisition functions will occur at finite element nodes. \section{Example} \label{sec:example} In this section, we demonstrate the vanilla and dual-weighted approach in the context of a synthetic groundwater flow example. We first outline the model setup, including the geological model and finite element representation. We then explain the particular methodology for this example in detail. Finally, we present the results. \subsection{Model Setup} We model the hydraulic conductivity as a log-Gaussian Random Field with a Matern 3/2 covariance kernel: \begin{equation} \label{eq:matern} C(\mathbf{x}, \mathbf{y}) = \left( 1 + \sqrt{3} \frac{\lVert \mathbf{x} - \mathbf{y} \lVert_2}{l} \right) \exp \left(- \sqrt{3} \frac{\lVert \mathbf{x} - \mathbf{y} \lVert_2}{l} \right) \end{equation} where $l$ is the length scale \citep{rasmussen_gaussian_2006} and $\lVert \cdot \lVert_2$ is the $L^2$-norm. The resulting random field is expanded in an orthogonal eigenbasis with $N_{\text{KL}}$ Karhunen–Loève (KL) eigenmodes. To this end, we construct a matrix of covariances between each pair of finite element nodes $\mathbf{C} \in \mathbb R^{M \times M}$ according to Eq.~(\ref{eq:matern}), so that $C_{ij} = C(\mathbf{x}_i, \mathbf{x}_j)$. This covariance matrix $\mathbf{C}$ is decomposed into the $N_{\text{KL}}$ largest eigenvalues $\{\lambda_i\}_{i=1}^{N_{\text{KL}}}$ and eigenvectors $\{\mathbf{\psi}_i\}_{i=1}^{N_{\text{KL}}}$. The nodal conductivities $\mathbf{k} := [k_1, k_2, \dots, k_M]$ are then given by \begin{equation} \log \mathbf{k} = \mathbf{\mu} + \sigma \mathbf{\Psi} \mathbf{\Lambda}^{\frac{1}{2}} \mathbf{\theta} \end{equation} with $\mathbf{\Lambda} = \text{diag}([\lambda_1, \lambda_2, \dots, \lambda_{N_{\text{KL}}}])$ and $\mathbf{\Psi} = [\mathbf{\psi}_1, \mathbf{\psi}_2, \dots, \mathbf{\psi}_{N_{\text{KL}}}]$. The vector $\mathbf{\mu} = \mu\mathbf{1}$ is the mean of the log-conductivity, $\sigma$ is the standard deviation of the log-conductivity, and $\mathbf{\theta} \sim \mathcal N(0, \mathbb I_{N_{\text{KL}}})$ \citep{dodwell_hierarchical_2015}. When defined in this way, the associated Bayesian inverse problem involves exploring $\pi(\theta \vert \mathbf{d})$, i.e. the posterior distribution of hydraulic conductivity parameters $\theta$ given measurements $\mathbf{d}$, where the aforementioned normal distribution constitutes the prior distribution of parameters: $\pi_{\text{p}}(\mathbf{\theta}) = \mathcal N(0, \mathbb I_{N_{\text{KL}}})$. We used three different models for the experiments (Fig. \ref{fig:gaussian_truth}), one \textit{data-generating} model representing the ground truth, a \textit{fine} forward model representing the fully resolved forward model $\mathcal F$ in the Bayesian inverse problem (see Eq.~(\ref{eq:forward})), and a \textit{coarse} forward model, corresponding to the reduced order forward model in the Delayed Acceptance MCMC sampler $\hat{\mathcal F}$, as described in e.g. \citet{christen_markov_2005, liu_monte_2004, cui_posteriori_2018, lykkegaard_multilevel_2020, lykkegaard2022multilevel}. Note that using the dual-weighted approach described herein does not require a Delayed Acceptance MCMC sampler. Any method capable of producing Monte Carlo samples from the posterior will do. The experiments were performed on a rectangular domain $\Omega = [0,2] \times [0,1]$ meshed using a structured triangular grid with $M_{fine} = 1326$ degrees of freedom for the data-generating model and the fine forward model, and $M_{coarse} = 703$ degrees of freedom for the coarse forward model. For the data-generating model, the log-Gaussian random conductivity was truncated at $N_{\text{KL}} = 256$ KL eigenmodes, while for the fine and coarse models it was truncated at $N_{\text{KL}} = 128$. Hence the dimensionality of the inverse problem in these experiments was $128$, which is very high and a challenging problem for any MCMC algorithm. Moreover, we set $l = 0.1$, $\mu = -2$ and $\sigma = 1.0$ for every model. This resulted in strongly anisotropic conductivity fields with log-conductivities broadly between -5 and 1 (Fig. \ref{fig:conductivity_true}). We imposed fixed head Dirichlet boundary conditions of 1 and 0 on the left and right boundaries, respectively, and no-flow Neumann conditions on the remaining top and bottom boundaries. We set the right hand side of Eq.~(\ref{eq:spde}) to $g(\mathbf{x}) = 0$. We chose flux across the right boundary $\Gamma_r$ as our quantity of interest $\mathcal Q$, corresponding to the following functional (as in equation (\ref{eq:q_boundary})): \begin{equation} \mathcal Q(u) = \int_{\Gamma_r} [-k(\mathbf{x}, \theta) \cdot \nabla u(\mathbf{x})] \cdot \mathbf{n} \: ds \end{equation} and the associated adjoint state equation shown in (\ref{eq:adjoint_state_equation}) with $\Gamma' = \Gamma_r$. Figure \ref{fig:influence_true} shows an example of the influence function generated by this adjoint state equation. The left column of Fig. \ref{fig:gaussian_truth} shows the conductivity associated with a random draw from the prior $\pi_{\text{p}}(\mathbf{\theta})$, for the data-generating model, the fine model, and the coarse model, respectively. The right column of Fig. \ref{fig:gaussian_truth} shows the corresponding hydraulic head, flux and influence function for the data-generating model. \begin{figure}[htbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{conductivity_true} \caption{Conductivity for the data-generating model.} \label{fig:conductivity_true} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{head_true} \caption{Hydraulic head.} \label{fig:head_true} \end{subfigure} % \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{conductivity_fine} \caption{Conductivity for the fine forward model $\mathcal F$.} \label{fig:conductivity_fine} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{flux_true} \caption{Flux.} \label{fig:flux_true} \end{subfigure} % \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{conductivity_coarse} \caption{Conductivity for the coarse forward model $\hat{\mathcal F}$.} \label{fig:conductivity_coarse} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{influence_true} \caption{Influence function.} \label{fig:influence_true} \end{subfigure}% \caption{A random realisation from the prior $\pi_{\text{p}}(\mathbf{\theta})$, with the corresponding primary and adjoint solutions. The left column shows the conductivity for the data-generating model (\subref{fig:conductivity_true}), the fine forward model (\subref{fig:conductivity_fine}) and the coarse forward model (\subref{fig:conductivity_coarse}) respectively. The right column shows the hydraulic head (\subref{fig:head_true}), the flux (\subref{fig:flux_true}), and the influence function (\subref{fig:influence_true}), respectively.} \label{fig:gaussian_truth} \end{figure} \subsubsection{Methodology} Using the above setup, we completed a total of $n=30$ independent numerical experiments to demonstrate the feasibility of the dual-weighted approach. We chose the standard deviation of the $L^2$-norm of the flux $S(\lVert \mathbf{q}(\mathbf{x}) \rVert_2)$ as the general measure of uncertainty in the model. For each independent experiment, the following experimental procedure was observed: \begin{enumerate*}[label=(\arabic*)] \item The hydraulic conductivity for the data-generating model was initialised with a random draw from the prior, and the primary problem was solved. \item Eight observation wells were placed randomly on the domain by Latin Hypercube sampling \citep{lhs} (see Fig. \ref{fig:acquisition}). \item \label{step:observations} For each observation well $\mathbf{x}_i$, the hydraulic head $u(\mathbf{x}_i)$ and the norm of the flux $\lVert \mathbf{q}(\mathbf{x}_i) \lVert_2$ were computed. These head and flux observations were contaminated with white noise from $\epsilon_u \sim \mathcal N(0, 0.01^2)$ and $\epsilon_{\lVert q \lVert_2} \sim \mathcal N(0, 0.001^2)$, respectively. \item Delayed Acceptance MCMC sampling was completed with $2$ independent samplers each drawing $N=25000$ fine samples with a subsampling length of 5 (see e.g. \citet{lykkegaard_multilevel_2020, lykkegaard2022multilevel}), and a burn-in of $N_{burn} = 5000$ was discarded. This resulted in a total number of MCMC samples of $N^\dagger= 40000$ for each experiment. \item The standard deviation of the $L^2$-norm of the flux $S(\lVert \mathbf{q}(\mathbf{x}) \rVert_2)$ and the mean of the influence function $\bar{\omega}(\mathbf{x})$ were computed at the finite element nodes and interpolated to the entire domain using the finite element shape functions, and eight new observation wells were placed according to the batch vanilla and dual-weighted acquisition functions, see Eq.~(\ref{eq:vanilla_batch}) and Eq.~(\ref{eq:dual_weighted_batch}). Figure \ref{fig:acquisition} shows the vanilla and dual weighted acquisition functions for one sample of the $n=30$ models. As expected, the weighting function $\bar{\omega}(\mathbf{x})$ prioritised observation wells closer to the boundary of the quantity of interest. \item Data were extracted from the four new observation wells as in step \ref{step:observations} and appended to the data vector. \item Delayed Acceptance MCMC sampling was repeated, using the new data vectors for both the vanilla and dual-weighted approaches. \end{enumerate*} \begin{figure}[htbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{vanilla} \caption{Vanilla acquisition $S(\lVert \mathbf{q}(\mathbf{x}) \rVert_2)$.} \label{fig:vanilla} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.95\textwidth]{adjoint} \caption{Dual-weighted acquisition $S(\lVert \mathbf{q}(\mathbf{x}) \rVert_2) \cdot \bar{\omega}(\mathbf{x})$.} \label{fig:adjoint} \end{subfigure} \caption{Acquisition functions of the vanilla and dual-weighted approaches for one sample of the $n=30$ models. The white dots show the initial datapoints, while the black crosses show the new datapoints suggested by each acquisition function.} \label{fig:acquisition} \end{figure} For each experiment and each posterior distribution (initial, vanilla, and dual-weighted) with each $N^\dagger = 40000$ posterior samples, we computed the mean squared error (MSE) and variance of the predicted quantity of interest $\{\mathcal Q^{(i)}\}_{i=1}^{N^\dagger}$ compared to the true value $\mathcal Q_{true}$. The MSE of the predicted value of the quantity of interest $\mathcal Q^{(i)}$ with respect to the true value $\mathcal Q_{true}$ was computed as \begin{equation} \text{MSE} = \frac{1}{N^\dagger} \sum_{i=1}^{N^\dagger} (\mathcal Q_{true} - \mathcal Q^{(i)})^2 \end{equation} Similarly, the sample variance of $\mathcal Q$ for each experiment was computed as: \begin{equation} s^2 = \frac{1}{N^\dagger - 1} \sum_{i=1}^{N^\dagger} (\mathcal Q^{(i)} - \bar{\mathcal Q})^2 \end{equation} Finally, we constructed Gaussian kernel posterior density estimates $\hat{f}_{\pi(\theta|\mathbf{d})}(\mathcal{Q})$ from the posterior samples from each experiment $\{\mathcal Q^{(i)}\}_{i=1}^{N^\dagger}$, and computed the kernel density of the true value $\mathcal Q_{true}$ with respect to this density estimate. Kernel density estimates were computed using \texttt{SciPy} \citep{2020SciPy-NMeth} with automatic bandwidth determination \citep{scott_multivariate_1992}. \subsubsection{Results} We compared the MSE, variance, and kernel density of both the vanilla and dual-weighted posterior samples with the corresponding values for the initial posterior samples for all $n=30$ experiments. With respect to the MSE, the vanilla approach yielded a median reduction of $22\%$, while the dual--weighted approach yielded a median reduction of $30\%$ (Fig. \ref{fig:MSE_violin}). This demonstrates that both acquisition strategies approach the true value when we add more datapoints, but that the dual-weighted approach is more efficient. With respect to the variance of the quantity of interest, the vanilla approach yielded a median reduction of $31\%$, while the dual--weighted approach yielded a median reduction of $34\%$ (Fig. \ref{fig:variance_violin}). This shows that for both acquisition strategies the posterior distribution contracts as more data is added, and that the two approaches differ less with respect to this feature. However, this metric shows only that the posterior contracts, and not if it moves closer to the true value. Finally, we computed the posterior densities of the true quantity of interest with respect to kernel posterior density estimates $\hat{f}_{\pi(\theta|\mathbf{d})}(\mathcal{Q})$ for each experiment. Here, the vanilla approach yielded a median improvement of $12\%$, while the dual--weighted approach yielded a median improvement of $17\%$. Since the prediction variance of the quantity of interest reduced in every experiment (Fig. \ref{fig:variance_violin}), this again shows that the posterior distribution moves closer to the true value as more data is added, but that the dual-weighted approach is better. \begin{figure}[htbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{MSE_violin} \caption{Reduction in MSE$(\mathcal{Q})$} \label{fig:MSE_violin} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=\textwidth]{variance_violin} \caption{Reduction in $\mathbb{V}(\mathcal{Q})$} \label{fig:variance_violin} \end{subfigure} \caption{Kernel densities of the sample error of the quantity of interest $\varepsilon^{(i)} = Q_{true} - Q^{(i)}$ for the initial, vanilla and dual-weighted posteriors for two samples of the $n=30$ experiments.} \label{fig:violin} \end{figure} We note that in neither method was capable of improving the posterior estimate of the quantity of interest for every experiment. Hence, in $8/30$ vanilla experiments and $5/30$ dual-weighted experiments, adding additional wells resulted in a worse posterior MSE than the initial one. This is not surprising since we are dealing with a very ill-posed inverse problem, and any new datapoint may reinforce the initial bias rather than reduce it. While both approaches occasionally failed to improve the posterior estimate, the dual-weighted approach performed better than the vanilla approach. We computed the Gaussian kernel density estimates of the error $\varepsilon^{(i)} = \mathcal Q_{true} - \mathcal Q^{(i)}$ for two samples of the $n=30$ experiments. The left panel shows a typical example, where the vanilla approach resulted in a moderate improvement while the dual-weighted approach yielded a more dramatic improvement. The right panel shows an example where both the dual-weighted and vanilla approaches failed to produce any improvement. \begin{figure}[htbp] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.9\textwidth]{density_1} \caption{} \label{fig:density_10} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=0.9\textwidth]{density_28} \caption{} \label{fig:density_28} \end{subfigure} \caption{Kernel densities of the sample error of the quantity of interest $\varepsilon^{(i)} = Q_{true} - Q^{(i)}$ for the initial, vanilla and dual-weighted posteriors for two samples of the $n=30$ experiments.} \label{fig:density} \end{figure} \section{Discussion} \label{sec:discussion} In this paper, we have proposed a novel approach to the problem of optimally choosing the next location for a monitoring well, given existing data and some quantity of interest (QoI). The proposed methodology exploits the solution of an adjoint problem to weigh such an acquisition function according to the expected influence on the QoI. Numerical experiments have demonstrated that the approach works for our model problem. We emphasize that the problem is intrinsically probabilistic, and hence subject to uncertainty. We have demonstrated that the approach works \textit{on average} for our model problem, but there were certain experiments, where the dual-weighted acquisition strategy did not approach the true QoI (see e.g. Fig. \ref{fig:density_28}). As the number of wells approach infinity, the posterior distribution will certainly approach the true value, but for any one new observation well, there are no such guarantees. In a sense, the dual-weighted approach merely increases the chance of improving the posterior distribution of the QoI. While we formulated and demonstrated the approach in the context of a groundwater surveying problem, the method could be applicable to other areas of science and engineering, where measurements are expensive. The most obvious parallel application is petroleum engineering, where there are similarities both in terms of the constituent equations and the mode of sampling, but the method could be adapted with little effort to any inverse problem where establishing sensors is expensive. We note, however, that the dual problem in our case was unusually simple, since the groundwater flow equation is self-adjoint. Clearly, the dual-weighted approach can only be used as-written for QoIs, where an adjoint problem can be formulated and solved directly. For more complicated QoIs, an alternative approach would be to perturb the posterior mean or mode to approximate the influence function. Using such an approach would yield $\omega(\mathbf{x}, \mathbb E[\theta])$ rather than $\mathbb E[\omega(\mathbf{x},\theta)]$ as a weighting function. A bottleneck of our approach is that the MCMC sampler is rerun after each (batch) data acquisition. Running MCMC for expensive forward models is notoriously computationally demanding, and while we employ various tricks to reduce the cost (such as Delayed Acceptance and proposal adaptivity), this is not the most elegant approach. One way to significantly alleviate the cost of subsequent posterior distributions would be to employ a particle filter to sequentially reweigh MCMC samples according to the new data \citep{chopin_sequential_2002}. This sequential approach was investigated in this study but it did not work well, mainly because of very high sample degeneracy. When the variance of the solution, as in our case, is relatively high at unobserved locations, only few posterior samples fit the new observations well, with the mentioned sample degeneracy as a result. Moreover, we found that the dispersion measures in Eqs.~(\ref{eq:vanilla}), (\ref{eq:dual_weighted}), (\ref{eq:dual_weighted_batch}) and (\ref{eq:vanilla_batch}) where highly sensitive to this sample degeneracy. This challenge could be alleviated by drawing more posterior samples for the initial MCMC, but that would only offset the cost. We remark that this approach might work better for lower-dimensional problems than the one investigated in this study. We highlight this problem as a potential target for future research. The methodology was demonstrated empirically in the context of a synthetic groundwater flow example. This gives rise to at least three additional interesting directions of future research. First, showing theoretically that the distribution of the quantity of interest does indeed converge faster to the true value when using the dual-weighted approach, and examining the mechanisms that govern this process in detail. Second, testing the method in practice in the context of an actual groundwater survey. While testing the method in practice would certainly expose limitations and complications that were not identified in this study, it would be difficult to validate the method further in this fashion, since the true value of the QoI is rarely known in reality. This may be overcome by testing the method under controlled (laboratory) conditions. Third, generalising the dual-weighted approach to a wider range of PDE problems with different constituent equations and QoIs. \section*{Acknowledgements} The MCMC code used for Delayed Acceptance sampling can be found at \href{https://github.com/mikkelbue/tinyDA}{https://github.com/mikkelbue/tinyDA}, and additional code will be made available in the Open Research Exeter data repository upon publication at \href{https://ore.exeter.ac.uk/repository/}{https://ore.exeter.ac.uk/repository/}. ML was funded as part of the Water Informatics Science and Engineering Centre for Doctoral Training (WISE CDT) under a grant from the Engineering and Physical Sciences Research Council (EPSRC), grant number EP/L016214/1. TD was funded by a Turing AI Fellowship (2TAFFP\textbackslash100007). The authors would like to thank Robert Scheichl and Karina Koval for advice with regards to the formulation of the adjoint state equation. The authors have no competing interests. \begin{appendices} \section{Adjoint State Equations} \label{ap:adjoint_equation} \subsection{Domain Integral as Objective Function} Given an objective function defined as an integral over the entire domain \begin{equation} \mathcal Q = \int_\Omega f \: dx \end{equation} \citet[Eq.~(15)]{sykes_sensitivity_1985} write the derivative of $\mathcal Q$ with respect to some parameter $\alpha$ as \begin{align} \begin{split} \frac{d\mathcal Q}{d\alpha} &= \int_\Omega \left[ \frac{\partial f}{\partial \alpha} + \psi \left(\frac{\partial f}{\partial u} + \nabla \cdot k \nabla \omega \right) + \omega \frac{\partial g}{\partial \alpha} - \nabla \omega \cdot \frac{\partial k}{\partial \alpha} \nabla u \right] dx \\ &+ \int_\Gamma \left[ \psi (k \nabla \omega) \cdot \mathbf{n} + \omega \frac{\partial q_N}{\partial \alpha} \right] ds \end{split} \end{align} To eliminate the unknown state sensitivities $\psi = \frac{\partial u}{\partial \alpha}$ they solve \begin{equation} \nabla \cdot k \nabla \omega + \frac{\partial f}{\partial u} = 0 \end{equation} with boundary conditions $\omega_{D} = 0$ on $\Gamma_D$ and $q_N^\omega = k\nabla \omega \cdot \mathbf{n} = 0$ on $\Gamma_N$. \subsection{Boundary Integral as Objective Function} The problem addressed in this paper involves an objective function defined on a fixed-head boundary $\Gamma'$: \begin{equation} \mathcal Q = \int_{\Gamma'} f \: ds \quad \text{with} \quad f = q = -k\nabla u \cdot \mathbf{n}^+ \end{equation} Where $\mathbf{n}^+$ is the outward normal. Hence, the derivative of the objective function instead takes the form \begin{align} \begin{split} \frac{d \mathcal Q}{d\alpha} &= \int_\Omega \left[ \psi \left(\nabla \cdot k \nabla \omega \right) + \omega \frac{\partial g}{\partial \alpha} - \nabla \omega \cdot \frac{\partial k}{\partial \alpha} \nabla u \right] dx \\ &+ \int_\Gamma \left[ \psi (k \nabla \omega) \cdot \mathbf{n}^- + \omega \left( \frac{\partial \mathbf{q}}{\partial \alpha} \cdot \mathbf{n}^- + \frac{\partial \mathbf{q}}{\partial u} \psi \cdot \mathbf{n}^- \right) \right] ds \\ &+ \int_{\Gamma'} \left[ \frac{\partial f}{\partial \alpha} + \frac{\partial f}{\partial u} \psi \right] ds \end{split} \end{align} where $\mathbf{n}^-$ is the inward normal \citep{sykes_sensitivity_1985} and \begin{equation} \frac{\partial \mathbf{q}}{\partial \alpha} \cdot \mathbf{n}^- +\frac{\partial \mathbf{q}}{\partial u} \psi \cdot \mathbf{n}^- = \frac{\partial q_N}{\partial \alpha} \quad \text{on} \quad \Gamma_N. \end{equation} To eliminate the unknown state sensitivities $\psi$, we now solve \begin{equation} \nabla \cdot k \nabla \omega = 0 \end{equation} with boundary conditions $\omega_{D} = 0$ on $\Gamma_D\setminus\Gamma'$ and $q_N^\omega = k\nabla \omega \cdot \mathbf{n}^- = 0$ on $\Gamma_N$. For the remaining boundary $\Gamma'$, we impose \begin{equation} \label{eq:gamma_bc} \frac{\partial f}{\partial u} + \omega \frac{\partial \mathbf{q}}{\partial u} \cdot \mathbf{n}^- = 0. \end{equation} Since on $\Gamma'$ we have \begin{equation} \label{eq:gamma_equality} - \frac{\partial \mathbf{q}}{\partial u} \cdot \mathbf{n}^- = \frac{\partial f}{\partial u} \end{equation} we can substitute (\ref{eq:gamma_equality}) into (\ref{eq:gamma_bc}) to get \begin{equation} \frac{\partial f}{\partial u} - \omega \frac{\partial f}{\partial u} = 0 \quad \text{on} \quad \Gamma' \end{equation} and so the operative boundary condition on $\Gamma'$ is $\omega_{\Gamma'} = 1$. \end{appendices} \bibliographystyle{unsrtnat}
{'timestamp': '2022-02-25T02:19:14', 'yymm': '2111', 'arxiv_id': '2111.07670', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07670'}
arxiv
\section{Submission of papers to NeurIPS 2021} \iffalse \section*{Checklist} \begin{enumerate} \item For all authors... \begin{enumerate} \item Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? \answerYes{}{} \item Did you describe the limitations of your work? \answerYes{} \item Did you discuss any potential negative societal impacts of your work? \answerNo{} \item Have you read the ethics review guidelines and ensured that your paper conforms to them? \answerYes{} \end{enumerate} \item If you are including theoretical results... \begin{enumerate} \item Did you state the full set of assumptions of all theoretical results? \answerNA{} \item Did you include complete proofs of all theoretical results? \answerNA{} \end{enumerate} \item If you ran experiments... \begin{enumerate} \item Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? \answerYes{Yes, will be provided in supplementary material.} \item Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? \answerYes{} \item Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? \answerNo{Experiments included are only run with one random seed due to computational requirements.} \item Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? \answerYes{Yes, included in the beginning of the experiments section.} \end{enumerate} \item If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... \begin{enumerate} \item If your work uses existing assets, did you cite the creators? \answerYes{Yes, we note where code is taken from in footnotes.} \item Did you mention the license of the assets? \answerYes{These will be mentioned in the supplementary codebase.} \item Did you include any new assets either in the supplemental material or as a URL? \answerYes{} \item Did you discuss whether and how consent was obtained from people whose data you're using/curating? \answerNA{} \item Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? \answerNA{} \end{enumerate} \item If you used crowdsourcing or conducted research with human subjects... \begin{enumerate} \item Did you include the full text of instructions given to participants and screenshots, if applicable? \answerNA{} \item Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? \answerNA{} \item Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? \answerNA{} \end{enumerate} \end{enumerate} \fi \end{document} \section{Training Details} \label{sec:appendix_training_details} We follow most experimental settings from \cite{chintagunta-etal-2021-medically}, but make modifications to the length of training to 6 epochs and increase the effective batch size to 128 for most experiments.\footnote{Experiments with fewer than 128 samples have an adjusted effective batch size that is 2-4x smaller to allow for adequate training.} These modifications were made for better optimization in the lower-data regime, compared to the 6400+ samples used in experiments from \cite{chintagunta-etal-2021-medically}. We note again that these experimental settings are applied uniformly across all iterations of self-training as well as all baselines plotted on Figure \ref{fig:saturation}. \section{Metrics} \label{sec:appendix_metrics} We measure model performance on standard metrics of ROUGE \citep{lin-2004-rouge} \footnote{\raggedright We use the following package with default configuration: \url{https://github.com/google-research/google-research/tree/master/rouge}} as well as measure a model's effectiveness in capturing the medical concepts that are of importance, and their negations \cite{joshi2020}. \noindent {\bf Medical Concept Coverage}: The concept coverage set of metrics captures the coverage of medical terms in the model's output summary with respect to the ground truth. In particular, let $\mathcal{C}$ be the set of medical concepts in the reference summary and $\hat{\mathcal{C}} $ be the set of concepts in the summary output by the model. Then: $$\textrm{Concept recall} = \frac{\sum_{n=1}^{N} |\hat{\mathcal{C}}^{(n)} \cap \mathcal{C}^{(n)}| } {\sum_{n=1}^{N}|\mathcal{C}^{(n)}|} $$$$\textrm{Concept precision} = \frac{\sum_{n=1}^{N} |\hat{\mathcal{C}}^{(n)} \cap \mathcal{C}^{(n)}| } {\sum_{n=1}^{N}|\hat{\mathcal{C}}^{(n)}|}$$. We use these to compute a concept F1\footnote{Note if there are no concepts detected in the snippet and summary by the entity extractor, then a conservative F1 score of 0 is given for that example.\label{footnote_f1}} and use an in-house medical entity extractor to extract medical concepts in the summary. Medical concepts in the decoded summary that weren't present in the original conversation would be false positives and vice versa for false negatives. \noindent {\bf Affirmation Correctness}: To measure the effectiveness of the model to identify the affirmative (alternatively, negated) status of medical concepts, we use Negex \citep{negex09} to determine negated concepts. Of the concepts present in the decoded summary, we evaluate precision and recall on whether the affirmations and negations were accurate for the decoded concepts and compute an affirmation F1.$^{\ref{footnote_f1}}$ \noindent {\bf Theoretical Maximum Derivation}: The maximum score of the concept and affirmation metrics is not 1.0 because, as in \cite{chintagunta-etal-2021-medically}, a conservative concept as well as affirmation F1 score of 0 is given for an example if there are no concepts detected in the conversation. As our affirmation tagger is not perfect, it may also ignore/miss certain concepts leading to the affirmation F1 limit not being identical to the concept F1 limit. \section{Detailed view into sampling strategy experiments} \label{sec:appendix} \begin{figure}[!h] \centering \includegraphics[width=1\linewidth]{figures/sampling_strategy.png} \caption{Concept F1 scores for each starting number of examples broken down by human-label sampling strategy and labeling iteration number. Strategy "None" corresponds to no additional human-labeling (only pseudo-labeling). The maximum value of the axis corresponds to the value achieved by training on all 6400 human labels.} \label{fig:sampling_strat} \end{figure} \section{Dataset} \label{sec:dataset} To compile our dataset, we follow the procedure described in \cite{chintagunta-etal-2021-medically} in collecting chat conversations between physicians and patients from a tele-medicine platform. We The end Our dataset was compiled oFor our task of medical conversation summarization Our dataset + relationship to GPT-3 paper Figure showing example of our data \section{Discussion} We extended active-learning and pseudo-labeling techniques to the generative setting following recent success in the classification setting. We found that for PEGASUS, a SOTA summarization model, there is a rapid performance saturation at ~1000 examples when fine tuned for medical conversation summarization. Beyond a small number of examples, providing additional labels did not improve performance. Even with few labels, we found that the choice of active labeling strategy had little effect on the performance, rather, the number of samples ended up being paramount. Compared to previous results, we also found performance saturation to occur at a lower sample count, due to hyper-parameter optimization done for fine-tuning on a smaller dataset. This provides an important lesson on ensuring hyper-parameters are well tuned before requesting more data. Through the lens of the bias-variance trade off, we believe PEGASUS represents a high bias model and this potentially allows it to generalize across domains. However, it cannot fully adapt to hyper-specialized regularities, as we struggled to over-fit to the train set. This explains why PEGASUS quickly saturates on medical dialogue data and why all sampling strategies are somewhat equivalent, since low confidence examples contain medical jargon not present during PEGASUS pre-training and tokenizer initialization. Understanding how such text generation models fine tune to fields with significant field-specific jargon presents an important area for future exploration. \section{Introduction} Medical conversation summarization can help medical providers to keep a record of patient encounters and also provide the necessary context of a patient's medical history during patient hand-offs between providers. However, creating these summaries presents a significant clerical load on medical providers, which can lead to burnout \citep{shanafelt2016}. To tackle this problem, we evaluate the use of transfer learning with abstractive summarization models, such as PEGASUS \citep{zhang2019}, to fine tune on medical conversation summarization. Availability of pre-trained models has led to tremendous progress in multiple other domains \citep{yadav2021,dai2021,xu2021}, with fine-tuning being the main strategy to derive task specificity. Notably, many tasks still require at least moderately sized datasets to capture all task-specific regularities. In the medical domain especially, obtaining labels is resource-intensive and dependent on domain expertise. Much of the recent work in label-scarce and low-data regime domains has focused on either effectively collecting informative labeled data or leveraging unlabeled data \citep{mindermann2021, du2020, chen2020}. The goal is to label enough informative samples such that the overall need for expert-labels can be alleviated while still achieving satisfactory performance. This can be done via active learning, in which an acquisition function is used to iteratively inform the labeling process and select the most ``useful" points to label. An alternate approach that has regained popularity is self-training or pseudo-labeling, in which the model's predictions are used as ground truth in subsequent re-trained iterations of a model. In particular, \cite{du2020} show that self-training with pseudo-labeling can improve performance on text classification benchmarks without the need for in-domain unlabeled data. Given the context of the success of active learning and pseudo-labeling for low-data regime classification tasks, we are interested in the following: \begin{itemize} \item Will these strategies translate from the classification setting to the generative task of medical conversation summarization? \item Is there (empirical) consensus on how we can most effectively utilize our label budget to maximize summarization performance with these strategies? \end{itemize} In this work, we explore these questions by applying batched active-learning to the task of medical conversation summarization in the low-data regime, implemented by leveraging model confidence on unlabeled samples as signal for expert-labeling and pseudo-labeling. Following our exploration, the contributions of this work are as follows: \begin{itemize} \item We find that among the strategies for selecting labels to be expert-labeled, no one strategy emerges as the best. Furthermore, performance on our conversation-summary pair dataset saturates as the number of expert labels increase, while still falling below the theoretical maximum metric values (see \S~\ref{subsec:metrics}). \item We find that naive pseudo-labeling is on-par or slightly worse than using no pseudo-labeling, often providing the biggest increase following the first iteration of self-training. \end{itemize} \section{Results} \label{sec:results} \begin{figure*}[!tbp] \centering \includegraphics[width=1\linewidth]{figures/num_points_saturation.png} \caption{(a) Concept, (b) Affirmation, and (c) Rouge F1 scores as a function of number of training points and sampling strategy. Shown are two trend-lines and their standard deviations for models trained with and without pseudo-labeled data (``PL from top 1\%'' and ``No PL'', respectively). The horizontal lines represent performance for: theoretical maximum, dataset of 6400 human labels, and combined dataset of 6400 human labels and 25600 GPT-3 derived labels \citep{chintagunta-etal-2021-medically}. Note: this paper does {\bf not} study the role of GPT-3 as a function of training set size, which we leave as future work.} \label{fig:saturation} \end{figure*} We use a human expert labeled dataset from \cite{chintagunta-etal-2021-medically} to study the effect of dataset size and iterative labeling strategies (Table~\ref{tab:experiments}). We present two main findings: (1) performance saturation with dataset size (2) effect of iterative labeling strategies in the low data regime. \subsection{Performance saturation with dataset size} Our main finding is the saturation of model performance as the number of dataset samples increase. An overview of the results can be seen in \figureref{fig:saturation}. \begin{enumerate} \item Setting $\textsf{PL} = \textsf{HL} = \textsf{None}$ and $n=1$, we find model performance saturates quickly. Specifically, we find the model with $|\mathcal{L}_0| = 1250$ achieves similar performance to $|\mathcal{L}_0| = 6400$, with concept F1 scores of 0.41 vs 0.43 respectively. \item We also find the $(n = 2, |\mathcal{L}_0| = 1000, |\mathcal{L}_2| = 1159, \textsf{PL} = \textsf{Top 1\%}, \textsf{HL} = \textsf{None})$ model beats the $(n=1, |\mathcal{L}_0| = 6400, \textsf{PL} = \textsf{HL} = \textsf{None})$ model, with concept F1 scores 0.44 vs 0.43 respectively. \end{enumerate} Furthermore, we compare our results with \cite{chintagunta-etal-2021-medically}, with whom we share the test-set. We find that our best low-data models achieve similar results to the baselines with significantly more human-labeled points and to the baseline with both human-labeled and GPT-3 labeled points. Notably, \cite{chintagunta-etal-2021-medically} saw continued improvement with additional data while we do not, which we suspect to be due to insufficient optimization of training hyper-parameters (see \ref{sec:training-details} for a comparison of hyper-parameters). Notably, however, we did not study the utility of GPT-3 generated labels in a low-data regime and leave this to future work. \vspace{1em} We also observe the saturation behavior by comparing our achieved metrics with the maximum theoretically achievable values. We find that performance is often significantly below maximum values (e.g. concept F1 of 0.44 vs 0.63, affirmation F1 of 0.31 vs 0.45, and rouge F1 of 0.62 vs 1.0 respectively). We suspect that the early saturation below the maximum theoretical values reflect the limits of PEGASUS on the medical conversation summarization task. An interesting future work would include evaluating the saturation behavior of other pre-trained abstractive summarization models. \subsection{Effect of iterative labeling strategies in low data regime} In the low data regime we examined several iterative labeling strategies consisting of adding additional human and pseudo-labeled examples (see Table~\ref{tab:experiments}). From \figureref{fig:saturation}, we find that for a given number of training points, $\textsf{PL} = \textsf{None}$ experiments have larger mean value than $\textsf{PL} = \textsf{Top 1\%}$ experiments for every metric for most values of $|\mathcal{L}_0|$ and $i$. However, these results are only statistically significant for affirmation F1 scores with $\approx 500$ training points. Overall, the performance improved with additional human labeled data consistently with the number of points added. A more detailed view of the effect of human-labeling can be seen from \figureref{fig:sampling_strat}. For our studies of up to three additional iterations, we did not find that the performance is impacted by the choice of human-labeling strategies $\textsf{HL}$, as \textsf{Top 1\%}, \textsf{Bottom 1\%} and \textsf{Random 1\%} produced similar results. We did find that in the low data regime, human labels are necessary. In \figureref{fig:sampling_strat} looking at $\textsf{HL} = \textsf{None}$ strategy, we find that pseudo-labels are ineffective at improving test performance when $|\mathcal{L}_0| = 100$. \section{Experimental Setup} \label{sec:experimental-setup} \subsection{Approaches Considered} Medical conversation summarization suffers not only from lack of annotated data but also from a high cost of annotating additional examples \citep{chintagunta-etal-2021-medically, joshi2020}. We investigate\footnote{Code at \url{https://github.com/curai/curai-research/tree/main/medical-summarization-ML4H-2021}} how to collect more labeled examples to improve PEGASUS \citep{zhang2019}, a state-of-the-art abstractive summarization model, on the task of medical conversation summarization while starting with only a small amount of human labeled data. Algorithm~\autoref{alg:training} describes our overall strategy to add labeled data following each iteration $i$ of self-training. We experiment with two ways to add labeled points to our training set. \begin{enumerate} \item \textbf{Expert/Human labeling (\textsf{HL})}: Have \textit{medical-expert} summarized conversations added to the labeled set, given that PEGASUS \textit{is not likely to do well} on these samples. \item \textbf{Pseudo-labeling (\textsf{PL})}: Have \textit{model-generated} summaries added to the labeled set, given that PEGASUS is \textit{likely to do well} on them. \end{enumerate} We allow the strategies for pseudo-labeling (\textsf{PL}) and expert-labeling (\textsf{HL}) to return empty sets. This allows us to experiment with pseudo-labeling and expert-labeling strategies in isolation as well as in tandem. For both pseudo-labeling and human labeling, we experiment with a budget of zero and 1\% of the size of $U_0$. \begin{algorithm}[H] \caption{Iterative labeling strategy} \label{alg:training} \begin{algorithmic}[1] \Require \Statex labeled set $\mathcal{L}_0$ \Statex unlabeled set $U_0$ \Statex pretrained summarization model PEGASUS $M_0$ \Statex labeling budgets $b_P$ for pseudo-labeling \Statex labeling budgets $b_E$ for expert-labeling, \Statex total number of iterations for self-training $n$ \Statex \For{$i \gets 1, \cdots, n$} \State $M_i \gets$ \text{Train $M_0$ on $\mathcal{L}_{i-1}$} \State $s_i \gets \text{log likelihood of }M_i \text{ on } U_{i-1}$ \State $P_i \gets \text{Pseudo-label $\textsf{PL}(s_i, U_{i-1}, b_P)$} \text{ using } M_i$ \State $E_i \gets \text{Expert-label $\textsf{HL}(s_i, U_{i-1}, b_E)$}$ \State $\mathcal{L}_i \gets \mathcal{L}_{i-1} + P_i + E_i$ \State $U_i \gets U_{i-1} - P_i - E_i$ \EndFor \State \Return $M_{n}$ \end{algorithmic} \end{algorithm} We derive our confidence score of how well PEGASUS can generate a summary for a given data point by using the log-likelihood of the generated summary as a proxy. The log-likelihood of class predictions has been used in prior work for classification tasks in a similar manner \citep{xie2019,sohn2020}. \subsection{Experiment Configurations} \label{subsec:expconfig} We examine performance characteristics of PEGASUS fine tuned on datasets acquired with a large number of experimental configurations. For each combination described in Table~\ref{tab:experiments}, we ran three additional iterations when either human or pseudo-labeling strategy was not \verb|None|, for a total of 264 experiments (some iteration 0 experiments are equivalent and thus were not performed, since some conditions only affect later iterations of self-training). For experiments differentiated only by the dropout value, 0.1 (default) and 0.5 (large regularization), the reported result is the best of the two. \begin{table}[t] \centering \begin{tabular}{ll} \toprule \textbf{Condition} & \textbf{Variants} \\ \midrule Dropout & 0.1 \\ & 0.5 \\ \midrule Pseudo-labeling strategy (\textsf{PL}) & None \\ & Top 1\% \\ \midrule Human-labeling strategy (\textsf{HL}) & None \\ & Bottom 1\% \\ & Middle 1\% \\ & Random 1\% \\ \midrule Starting number of samples ($|\mathcal{L}_0|$) & 100 \\ & 250 \\ & 500 \\ & 750 \\ & 1000 \\ & 1250 \\ \bottomrule \end{tabular} \caption{Overview of experimental conditions as detailed in \autoref{subsec:expconfig}.} \label{tab:experiments} \end{table} \subsection{Training Details and Metrics} \label{sec:training-details} \label{subsec:metrics} We replicate the experimental settings with small modifications\footnote{See Appendix \autoref{sec:appendix_training_details} for further training details.} for PEGASUS from \cite{chintagunta-etal-2021-medically} by importing the pre-trained PEGASUS model on the CNN/DailyMail summarization dataset from HuggingFace.\footnote{\url{https://huggingface.co/transformers/model\_doc/pegasus.html}} We apply these experimental settings uniformly across all iterations of self-training as well as all baselines plotted on Figure \ref{fig:saturation}. Performance of our model was measured using the same metrics defined in \citep{joshi2020, chintagunta-etal-2021-medically} viz. concept F1, affirmation F1 and rouge-L F1. We also computed the theoretical maximum of these metrics on our test set. The maximum value for concept F1 and affirmation F1 is computed by assuming that the predicted summary is the same as the ground truth label, i.e. we predict both the concepts and their affirmations correctly for each conversation.\footnote{We provide further explanation of these metrics and the theoretical maximum in Appendix \autoref{sec:appendix_metrics}.}
{'timestamp': '2021-11-30T02:18:07', 'yymm': '2111', 'arxiv_id': '2111.07564', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07564'}
arxiv
\section*{Abstract} Discrete Hahn polynomials (DHPs) and their moments are considered to be one of the efficient orthogonal moments and they are applied in various scientific areas such as image processing and feature extraction. Commonly, DHPs are used as object representation; however, they suffer from the problem of numerical instability when the moment order becomes large. In this paper, an efficient method for computation of Hahn orthogonal basis is proposed and applied to high orders. This paper developed a new mathematical model for computing the initial value of the DHP and for different values of DHP parameters ($\alpha$ and $\beta$). In addition, the proposed method is composed of two recurrence algorithms with an adaptive threshold to stabilize the generation of the DHP coefficients. It is compared with state-of-the-art algorithms in terms of computational cost and the maximum size that can be correctly generated. The experimental results show that the proposed algorithm performs better in both parameters for wide ranges of parameter values of ($\alpha$ and $\beta$) and polynomial sizes. \section{Introduction} Moment theory and their variants are significant tools in imaging and computer vision applications \cite{TVS2020, 2D3D}. Moments are scalar quantities used for characterization of the signal. Moments are obtained by using a set of polynomial basis functions. They are used to transform signal from time domain (such as speech) or spatial domain (such as image) into the transform domain \cite{Hameed2021,DKTT2017}. Geometric moments and moments invariants were introduced by \cite{Hu1962} to deal with the problem of pattern recognition. They are not orthogonal \cite{Zhu20071688_DD}, what causes numerical problems. Continuous moments are obtained using continuous orthogonal polynomials (COPs), e.g. Zernike \cite{deng2016stable8H} or Chebyshev with transformed radius \cite{HOSNYcolor2019}. Continuous moment functions are inaccurate because of two sources of errors: coordinate transformation of the image and the approximation of the continuous integral \cite{Mukundan2001}. As a result, during image reconstruction process, the image will be far from perfect due to discretization and approximation \cite{Mukundan2004_21H}. In order to surmount these shortcomings, researches oriented towards discrete orthogonal polynomials (DOPs). They show better capabilities in image reconstruction \cite{Mukundan2001, Mukundan2004_21H, Yap2003_}. Beside, discrete orthogonal moments (DOMs) have the ability to represent 1D and 2D signals without redundancy, high energy compaction, and spectral resolution properties \cite{Zhou2005_1B, SEA2019, den2021stable, Mahmmod2021SEA}. Several types of DOPs have been recently used for signal representation and feature extraction such as discrete Chebyshev polynomials \cite{Bello2018_6H, DTT2017}, discrete Krawtchouk moments \cite{Mahmmod2020, DKT_2021}, and discrete Hahn moments \cite{Yap2007_42H}. In addition, DOPs are used to solve linear functional differential equations \cite{mizel2008orthogonal} The robustness of DOPs is essentially based on some important properties such as energy compaction, efficient data processing, numerical stability, robust data analysis, extraction features from the signal, and localization \cite{DKTT2017,s21061999}. However, the remarkable properties of the most DOMs can be applied only to medium size images, they are not applicable for large size images or high moment orders \cite{Daoui2020_HH}. This limitation is determined by the DOP overflow, fluctuation of the polynomial values, as well as the high computational cost. Thus, new recurrence algorithms for generating the higher orders are still developed, e.g. for Chebyshev \cite{DTT2017} and Krawtchouk \cite{Mahmmod2020} polynomials. Recently, researchers have discussed other DOPs such as Charlier polynomials \cite{CHP_2020} and Hahn polynomials \cite{Daoui2020_HH}. The recursive algorithms reduce the complexity of calculating the coefficients of DOPs and the propagation of errors \cite{Zhu2010_43H,SKTP2018}. We can use either a single recursive formula with respect to degree $ n $ or a double recursive formula also with respect to spacial or time coordinate $ x $. The problem of numerical instability is solved by calculating the DOP coefficients with respect to the variable $ n $. However, this calculation is not efficient, when the size of 1D or 2D signals becomes large. For instance, the coefficients of Chebyshev polynomials have numerical instabilities since the squared norm of the scaled Chebyshev polynomials assumes small values. Mukundan \cite{Mukundan2004_21H} propoesed the recurrence algorithm in the $ x $-direction to resolve this issue. After that, many researches began to work on this problem such as \cite{Zhu2010_43H}. In general, an attention has been paid to the computation cost, which is considered to be an important point that subjects to ill-conditioning, therefore it is taking a substantial consideration in different researches \cite{spiliotis1996fast32H, Shu2010_30H}. For Meixner moment coefficients, this drawback is resolved via fast and efficient calculation in \cite{Meixner2021}. For Chebyshev moments, a fast and stable method is proposed by Abdulhussain et al. \cite{DTT2017} for higher polynomial degree by a combination of the three-term recurrence relations in the $n$- and $x$-directions. Daoui et al. \cite{Daoui2020_HH} proposed a new method using a modified Gram-Schmidt orthogonalization process. This method reduces the numerical error propagation during recursive computations. However, it is relatively slow. Motivated by this problem for the discrete orthogonal Hahn moments, this study introduces a new algorithm to tackle this issue through composing two recurrence algorithms ($ n $- and $ x $-recurrence relations) and an adaptive threshold to stabilize the generation of the DHP coefficients. The present paper is organized as follows: in Section~\ref{sec:priliminaries}, the preliminaries and the existed three-term recurrence algorithms are presented. In Section~\ref{sec:proposed}, the proposed recurrence algorithm is presented. In Section~\ref{sec:experiments}, the experimental analysis is performed to evaluate the proposed recurrence algorithm. Finally, conclusions are drawn in Section~\ref{sec:conclusion}. \section{Preliminaries}\label{sec:priliminaries} The mathematical definitions and fundamentals of DHP and discrete Hahn moments (DHMs) are introduced in this section. \subsection{The mathematical definition of DHP} DHPs of the $ n $th degree $ \dhpd $ are defined as the solution of the difference relation \cite{Zhu2010_43H, Edge2017}, which is given by \begin{equation}\label{Eq_1} \phi(x) \Delta \nabla \dhpd+\psi(x)\Delta \dhpd + \lambda_n \dhpd = 0 , \end{equation} where $ \phi(x) $ and $ \psi(x) $ are first and second order functions, respectively, and $ \lambda_n $ is a constant. $ \Delta \dhpd $ and $ \nabla \dhpd $ represent the forward and backward difference, respectively. The values of $ \phi(x) $, $ \psi(x) $, and $ \lambda_n $ are given by \cite{Zhu2010_43H} \begin{eqnarray}\label{Eq_2} \phi(x) &=& x(N+\alpha-x)\\ \psi(x) &=& (\beta+1)(N-1)-(\alpha+\beta+2)x\\ \lambda_n &=& n(\alpha+\beta+n+1) , \end{eqnarray} where $ \alpha $ and $ \beta $ are the DHP parameters ($ \alpha $ and $ \beta > -1$ or also $ \alpha $ and $ \beta < -N$). The values of $ \Delta \dhpd $ and $ \nabla \dhpd $ are defined as follows \begin{eqnarray}\label{Eq_3} \Delta \dhpd &=& \dhp{n}{x+1}-\dhp{n}{x} \label{Eq_3.1}\\ \nabla \dhpd &=& \dhp{n}{x}-\dhp{n}{x-1} \label{Eq_3.2} . \end{eqnarray} From Eqs.~\eqref{Eq_3.1} and~\eqref{Eq_3.2}, $ \Delta \nabla \dhpd $ can be written \begin{equation}\label{Eq_4} \Delta \nabla \dhpd = \dhp{n}{x+1}-2\dhpd+\dhp{n}{x-1} , \end{equation} where $ n $ represent the polynomial degree, $ x $ is the signal index, and $ N $ is the polynomial size (the number of samples). The solution of the Eq.~\eqref{Eq_1} is \begin{equation}\label{Eq_5} \dhp{n}{x}=\frac{(-1)^n \,(\beta+1)_n \,(N-n)_n}{n!}\, {}_3F_2\Hyp{-n,-x,n+1+\alpha+\beta}{\beta+1,1-N}{1} , \end{equation} where $ {}_3F_2(\cdot) $ represents the generalized hypergeometric series which is given by \begin{equation}\label{Eq_x} {}_3F_2\Hyp{a,b,c}{d,e}{z} = \sum\limits_{k=0}^{\infty} \frac{(a)_k \, (b)_k \, (c)_k}{(d)_k \, (e)_k \, k!} \left(z\right)^k \end{equation} and $ (\cdot)_k $ represents the rising factorial also known as Pochhammer symbol. It is given by \begin{equation}\label{Eq_pochhamer} (a)_k = a(a+1)(a+2)\cdots(a+k-1)\ . \end{equation} DHPs satisfy the orthogonality condition\footnote{We can find alternative definition with different range of the orthogonality from 0 to $N$ \cite{Koekoek} instead of that from 0 to $N-1$ in \eqref{Eq_11}. Then, all other formulas are modified.} as follows \begin{equation}\label{Eq_11} \sum\limits_{x=0}^{N-1}\dhp{n}{x} \dhp{m}{x} \omega_\mcc(x) = \rho_\mcc(n) \delta_{nm}\ , \end{equation} where $ \delta_{nm} $ represents the Kronecker delta, $ \omega_\mcc $ and $ \rho_\mcc $ are the weight and norm functions of DHP \begin{align} \omega_\mcc(x) &= \frac{\Gamma(N+\alpha-x)\Gamma(\beta+x+1)}{\Gamma(N-x)\Gamma(x+1)} \label{Eq_12w} \\ \rho_\mcc(x) &= \frac{\Gamma(\alpha+n+1)\Gamma(\beta+n+1)(\alpha+\beta+n+1)_N}{(2n+\alpha+\beta+1)\Gamma(n+1)\Gamma(N-n)}. \label{Eq_12n} \end{align} The weighted DHP of $ n $th degree is given by \begin{equation}\label{Eq_13} \dhpn{n}{x} = \dhp{n}{x}\sqrt{\frac{\omega_\mcc}{\rho_\mcc}} . \end{equation} \subsection{The definition of DHM} DHMs are the signal (speech or images) projection on the DHP basis. For two-dimensional signal (image), $ f(x,y) $, the DHMs, $ \eta_{nm} $, is computed as follows \begin{align} \label{Eq_2D} &\eta_{nm} = \sum\limits_{x=0}^{N_1-1} \sum\limits_{y=0}^{N_2-1}\dhpnn{n}{x;N_1} \dhpnn{m}{y;N_2} f(x,y) \\ &n = 0,1,\dots,N_1-1; \ \ \mathrm{and}\ \ m = 0,1,\dots,N_2-1, \nonumber \end{align} where $ N_1 \times N_2 $ is the size of the image $ f(x,y) $. The image can be reconstructed from Hahn moment domain into the spatial domain by \begin{align} \label{Eq_2D_Rec} &\hat{f}(x,y)=\sum\limits_{n=0}^{N_1-1}\sum\limits_{m=0}^{N_2-1}\dhpnn{n}{x;N_1} \dhpnn{n}{y;N_2} \eta_{nm} \\ &x = 0,1,\dots,N_1-1; \ \ \mathrm{and}\ \ y = 0,1,\dots,N_2-1 \nonumber . \end{align} \subsection{Existing Recurrence Algorithms} The three term recurrence relations are employed because of both the time consumption and the insufficient precision of the hypergeometric series in Eq.~\eqref{Eq_5}. In this section, the existing recurrence algorithms and their analysis are briefly presented. \subsubsection{The Three Term Recurrence Relation in the $ n $-direction (TTRRnd)} The DHP of the $ n $th degree at the $ x $th index is given by \cite{Zhu2010_43H} \begin{align}\label{Eq_nd} &\dhpn{n}{x} = \mathcal{\frac{AB}{E}} \, \dhpn{n-1}{x}+\mathcal{\frac{CD}{E}} \, \dhpn{n-2}{x} \\ &\ \ n=2,3,\dots,N-1;\ \ \mathrm{and}\ \ x=0,1,\dots,N-1 \nonumber , \end{align} where the parameters of the $ n $-direction recurrence algorithms are \begin{align}\label{Eq_nd_Param} \mathcal{A}&=x-\frac{\alpha-\beta+2N-2}{4}-\frac{(-\alpha^2+\beta^2)(\beta+\alpha+2N)}{4(\alpha+\beta+2n-2)(\alpha+\beta+2n)} \nonumber\\ \mathcal{B}&= \sqrt{\frac{n(\alpha+\beta+n)(\alpha+\beta+2n+1)}{(N-n)(\alpha+n)(\beta+n)(\alpha+\beta+2n-1)(\alpha+\beta+N+n)}} \nonumber\\ \mathcal{C}&=-\frac{(\alpha+n-1)(\beta+n-1)(\alpha+\beta+N+n-1)(N-n+1)}{(\alpha+\beta+2n-2)(\alpha+\beta+2n-1)} \\ \mathcal{D}&=\sqrt{\frac{n(n-1)(\alpha+\beta+n)(\alpha+\beta+n-1)(\alpha+\beta+2n+1)}{(\alpha+n)(\alpha+n-1)(\beta+n)(\beta+n-1)(N-n+1)(N-n)}} \times \nonumber \\ &\, \, \, \, \, \, \, \, \sqrt{\frac{1}{(\alpha+\beta+2n-3)(\alpha+\beta+N+n)(\alpha+\beta+N+n-1)}} \nonumber\\ \mathcal{E}&=\frac{n(\alpha+\beta+n)}{(\alpha+\beta+2n-1)(\alpha+\beta+2n)} \nonumber \end{align} with initial values \begin{align}\label{Eq_nd_init} \dhpn{0}{x}&=\sqrt{\frac{\omega_\mcc(x)}{\rho_\mcc(0)}} \\ \label{Eq_nd_init2} \dhpn{1}{x}&=\left[-(\beta+1)(N-1)+x(\alpha+\beta+2)\right]\sqrt{\frac{\omega_\mcc(x)}{\rho_\mcc(1)}} . \end{align} The limitation of the $ n $-direction recurrence algorithm arises from the initial values $ \dhpn{0}{x} $ and $ \dhpn{1}{x} $. They are bounded to limited polynomial size $ N $ and DHP parameters $ \alpha $ and $ \beta $. The maximum polynomial size that can be generated is 135 samples, when DHP parameters, $ \alpha $ and $ \beta $, are 20 and 20, respectively. The limitation arises from the nature of the formula used. Although this issue can be solved by reducing the complexity of the formula employed to compute the values of the initial sets, the $ n $-direction recurrence algorithm still suffers from the numerical propagation error. It is taken place when the values of the DHP coefficients (DHPCs) decrease in their values as shown in \figurename{~\ref{n-direction}}. \begin{figure} \centering \begin{tabular}{@{}c@{}c} \multicolumn{2}{c}{ \includegraphics[width=0.533\linewidth]{n-direction_plot1} } \\ \includegraphics[width=0.44\linewidth]{n-direction_plot2}& \includegraphics[width=0.383\linewidth]{n-direction_plot3} \end{tabular} \caption{Plot of DHP with different degree and a size of 150. Top row shows entire $ \dhpn{n}{0} $, bottom left shows stable values in the range of $ n=0,1,\dots,104 $, and bottom right column shows unstable values and the starting point of instability due to numerical errors in the range $ n=104,105,\dots,149 $.} \label{n-direction} \end{figure} \subsubsection{The Three Term Recurrence Relation in the $ x $-direction (TTRRxd)} DHP of $ n $th degree at the $ x $th index is computed as \cite{Zhu2010_43H} \begin{align}\label{Eq_xd} &\dhpn{n}{x} =\eta_1\left[ \eta_2 \dhpn{n}{x-1} + \eta_3 \dhpn{n}{x-2} \right] \\ &\hspace{3em}x=2,3,\dots,N-1;\ \ \mathrm{and} \ \ n=0,1,\dots,N-1 \nonumber , \end{align} where the coefficients of the $ x $-direction recurrence algorithm are \begin{equation} \label{Eq_xd_param} \begin{array}{ll} \eta_1 = \displaystyle\frac{\sqrt{\omega_\mcc(x)}}{\sigma(x-1)+\tau(x-1)} & \sigma(x) = x(N+\alpha-x) \\ \eta_2 = \displaystyle\frac{2\sigma(x-1)+\tau(x-1)-\lambda(n)}{\sqrt{\omega_\mcc(x-1)}} & \tau(x) = (\beta+1) (N-1) - x(\alpha+\beta+2) \\ \eta_3 = \displaystyle - \frac{\sigma(x-1)}{\sqrt{\omega_\mcc(x-2)}} & \lambda(n) = n (\alpha + \beta + n +1) \end{array} \end{equation} with initial values \begin{align}\label{Eq_xd_init} \dhpn{n}{0} & = (1-N)_n \, \binom{n+\beta}{n} \sqrt{\frac{\omega_\mcc(0)}{\rho_\mcc(n)}} \\ \label{Eq_xd_init2} \dhpn{n}{1} & = \frac{(n+\beta+1)(N-n-1)-n(N+\alpha-1)}{(\beta+1)(N-1)} \times \nonumber \\ &\ \ \times \sqrt{\frac{\omega_\mcc(1)}{\ \omega_\mcc(0)}} \dhpn{n}{0}. \end{align} To reduce the time required to compute the DHPCs, the following symmetry relation \cite{Daoui2020_HH} is employed \begin{equation}\label{Eq_Sym} \dhpn{n}{x}=(-1)^n \dhpn{n}{N-1-x} \text{ for } \alpha=\beta . \end{equation} Using the symmetry relation, Eq.~\eqref{Eq_Sym} reduces the computed coefficients to 50\%. However, there are two limitations in the recurrence relation in the $ x $-directions as follows: 1) the initial set $ \dhpn{n}{0} $ becomes zero when the number of samples or the parameter values becomes too big because of the nature of the formula used in Eq.~\eqref{Eq_xd_init}, and 2) the coefficient values become underflowed as the degree of the polynomial becomes large; this is because of the initial values becomes less than $ 10^{-324} $, which becomes zero in various environments, such as Matlab and C++. \figurename{~\ref{x-direction}} shows DHP using different values of parameters $ \alpha $ and $ \beta $ as well as polynomial size using the recurrence relation in the $ x $-direction. \begin{figure}[ht] \centering \includegraphics[width=0.99\linewidth]{x-direction_plot} \caption{2D plots of the DHP. (a) $ N=1600 $ and $ \alpha=\beta=10 $, (b) $ N=1600 $ and $ \alpha=\beta=40 $, (c) $ N=1600 $ and $ \alpha=\beta=80 $, (d) $ N=2000 $ and $ \alpha=\beta=10 $, (e) $ N=2000 $ and $ \alpha=\beta=40 $, and (f) $ N=2000 $ and $ \alpha=\beta=80 $} \label{x-direction} \end{figure} From \figurename{~\ref{x-direction}}, the DHPCs become zero as the polynomial degree increases. For instance, the maximum non-zero coefficients occurred at $ n=1423 $ when $ N=1600 $ and $ \alpha=\beta=10 $ (see \figurename{~\ref{x-direction}}a). \subsubsection{Recurrence Relation Based on Gram-Schmidt orthonormalization process (RRGSOP)} Recently, Daoui et al. \cite{Daoui2020_HH} presented an algorithm based on Gram-Schmidt orthonormalization process (GSOP) and the $ n $-direction recurrence relation to compute DHP. The GSOP is used to overcome the problem of the instability in the DHPCs. The presented algorithm begins with the computation of the initial sets $ \dhpn{0}{x} $ and $ \dhpn{1}{x}$. Then, the recurrence relation in the $ n $-direction is employed to compute the coefficients for $ n>1 $. Finally, the GSOP is applied to minimize the numerical errors generated by the $ n $-direction recurrence algorithm. However, the GSOP-based recurrence algorithm satisfies the orthogonality condition, it has three issues. First, the algorithm is not able to correctly generate the coefficients of the DHP when $ \alpha\ne\beta $, which is observed from the results in \cite{Daoui2020_HH}. Second, the algorithm is unable to generate DHP for a wide range of parameters $ \alpha $ and $ \beta $ because of the formula used to compute the initial values. Third, the GSOP-based recurrence algorithm has high computational cost due to the nested loops of the employed GSOP to minimize the error for each polynomial degree, which in turn increases the number of operations required to compute the coefficients of the DHP. \section{Proposed Recurrence Algorithm}\label{sec:proposed} In this section, the design of the proposed algorithm is presented. For simplicity DHP $ \dhpn{n}{x} $ is denoted as $ \dhpnn{n}{x} $. \figurename{~\ref{proposed}} shows DHP for $ \alpha\ne\beta $, which is considered to be more general than the case $ \alpha=\beta $. \begin{figure}[ht] \centering \includegraphics[width=0.5\linewidth]{proposed} \caption{Schematic diagram of the proposed algorithm} \label{proposed} \end{figure} \subsection{Initial Value and Initial Sets} The initial values are crucial and prerequisite for computation of the DHPC values. The existing algorithms (TTRRnd, TTRRxd, and RRGSOP) compute the initial sets. While TTRRnd and RRGSOP utilize Eqs.~\eqref{Eq_nd_init} and \eqref{Eq_nd_init2}, TTRRxd utilizes Eqs.~\eqref{Eq_xd_init} and \eqref{Eq_xd_init2} to determine the initial values. These equations are problematic because of the gamma and binomial functions. Thus, infinity (Inf) or not a number (NaN) are occurred in different environments such as C++, python, and MATLAB, i.e., the coefficients of the initial sets are not correctly computed. In addition, the existing algorithm computes the initial sets using the same formula, which in turn leads to increase the computation time. From Eq.~\eqref{Eq_13}, the initial values are \begin{align} \label{Eq_init_values1} \dhpnn{0}{0} &= \sqrt{\frac {\Gamma(\alpha+\beta+2) \Gamma(N+\alpha)}{\Gamma(\alpha+1) \Gamma(N+\beta+\alpha+1)}} \\ \label{Eq_init_values2} \dhpnn{0}{N-1} &=\sqrt{\frac {\Gamma(\alpha+\beta+2) \Gamma(N+\beta)}{\Gamma(\beta+1) \Gamma(N+\alpha+\beta+1)}}. \end{align} They cannot be computed for a wide range of polynomial size and parameters, $ \alpha $ and $ \beta $, because of the gamma function $ \Gamma(\cdot) $ produces infinity for argument greater than 172 in the standard double precision arithmetics. The gamma function can be written as follows \begin{equation}\label{Eq_logGamma} \Gamma(a)=e^{\mathrm{log}\Gamma(a)} , \end{equation} where $ \mathrm{log}\Gamma(\cdot) $ represents the logarithmic gamma function \cite{Hart1978}. Using Eq. \eqref{Eq_logGamma}, Eqs.~\eqref{Eq_init_values1} and \eqref{Eq_init_values2} can be expressed in terms of $ \mathrm{log}\Gamma(\cdot) $ functions \begin{align} \label{Eq_init_val1} \dhpnn{0}{0} &= e^{[\mathrm{log}\Gamma(\alpha+\beta+2)+\mathrm{log}\Gamma(N+\alpha)-\mathrm{log}\Gamma(\alpha+1)-\mathrm{log}\Gamma(N+\alpha+\beta+1)]/2} \\ \label{Eq_init_val2} \dhpnn{0}{N-1} &= e^{[\mathrm{log}\Gamma(N+\beta)+\mathrm{log}\Gamma(\alpha+1)-\mathrm{log}\Gamma(\beta+1)-\mathrm{log}\Gamma(N+\alpha)]/2}\ \dhpnn{0}{0} . \end{align} These formulas can be used for $\alpha >-1$ and $\beta >-1$. The parameters can also be less than $-N$, i.e. $\alpha <-N$ and $\beta <-N$. Then we must use slightly modified formulas \begin{align} \label{Eq_init_neg_val1} \dhpnn{0}{0} &= e^{[-\mathrm{log}\Gamma(-\alpha-\beta-1)-\mathrm{log}\Gamma(-N-\alpha+1)+\mathrm{log}\Gamma(-\alpha)+\mathrm{log}\Gamma(-N-\alpha-\beta)]/2} \\ \label{Eq_init_neg_val2} \dhpnn{0}{N-1} &= e^{[-\mathrm{log}\Gamma(-\alpha-\beta-1)-\mathrm{log}\Gamma(-N-\beta+1)+\mathrm{log}\Gamma(-\beta)+\mathrm{log}\Gamma(-N-\alpha-\beta)]/2}\ . \end{align} These formulas are used for each part P1 and P2 in \figurename{~\ref{proposed}} separately. It is noteworthy that the initial value $ \dhpnn{0}{N-1} $ is computed in terms of $ \dhpnn{0}{0} $, as given in Eq.~\eqref{Eq_init_val2}, to reduce the execution time. \figurename{~\ref{initialsproposed}} illustrates the plots for the values of the initial values using the proposed algorithm for large polynomial size $ N=8000 $ and different values of DHP parameters $ \alpha $ and $ \beta $. From the \figurename{~\ref{initialsproposed}}, it can be observed that the initial values can be computed without Inf or NaN values; thus, the proposed initial formulas for the initial values can be used to compute the rest of the DHPCs. \begin{figure} \centering \includegraphics[width=0.99\linewidth]{Initials_proposed} \caption{Plot of the initial using the proposed formula for $N=8000$ and different values of DHP parameters ($ \alpha $ and $ \beta $).} \label{initialsproposed} \end{figure} It is well known that the initial sets are used with the aim of the three term recurrence algorithm for the polynomial computation. The initial sets for part P1 are $ \dhpnn{n}{0} $ and $ \dhpnn{n}{1} $ and for part P2 are $ \dhpnn{n}{N-1} $ and $ \dhpnn{n}{N-2} $. These sets are computed using two term recurrence algorithm. The initial sets for part P1 are computed as follows \begin{equation} \label{Eq_initial_set_n_0} \begin{array}{l} \displaystyle \dhpnn{n+1}{0}\! =\! -\sqrt {\frac{(n+1+\beta)(N-1-n)(2n+3+\beta+\alpha)(n+\beta+\alpha+1)}{(n+1) (\alpha+1+n)(n+1+\beta+\alpha+N)(2n+\beta+\alpha+1)}} \times\\ \hspace{6em}\times\dhpnn{n}{0},\hspace{6em} n=1,2,\dots,N-1 \end{array} \end{equation} \begin{equation} \label{Eq_initial_set_n_1} \begin{array}{l} \displaystyle \dhpnn{n}{1}={\frac{(N-n-1)\beta-{n}^{2}-( \alpha+1)n+N-1}{(\beta+1)(N-1)}\sqrt {{\frac {( \beta+1)(N-1)}{\alpha+N-1}}}}\times\\ \hspace{6em}\times \dhpnn{n}{0}, \hspace{6em} n=0,1,\dots,N-1 . \end{array} \end{equation} The initial sets for part P2 are computed as follows \begin{equation} \label{Eq_initial_set_n_N_1} \begin{array}{l} \displaystyle \hat{\mathbfcal{H}}^{\alpha,\beta}_{n+1}\!\left(N\!\!-\!\!1\right \!=\!\!\sqrt {{\frac{(2n+3+\alpha+\beta)(n+\alpha+\beta+1)(n+1+\alpha)(N-n-1)}{(n+\beta+1)(n+1+\alpha+\beta+N)(2n+\alpha+\beta+1)(n+1) }}}\!\times\\ \hspace{6em}\times \dhpnn{n}{N-1},\hspace{6em} n=1,2,\dots,N-1 \end{array} \end{equation} \begin{equation} \label{Eq_initial_set_n_N_2} \begin{array}{l} \displaystyle \dhpnn{n}{N-2}={\frac {-{n}^{2}+( -\alpha-\beta-1)n+(N-1)(\alpha+1)}{\sqrt{(\beta+N-1)(N-1)(\alpha+1) }}} \dhpnn{n}{N-1},\\ \hspace{5em} n=0,1,\dots,N-1 . \end{array} \end{equation} \subsection{Utilization of the TTRRnd and TTRRxd in the proposed algorithm} The proposed recurrence algorithm is designed based on merging the TTRRnd and TTRRxd. For the parts P1 and P2, the coefficients of the DHP are computed using TTRRxd with a maximum degree of 40\% of $ N $. For the part P1, the modified TTRRxd (mTTRRxd) is applied as follows \begin{align} \label{Eq_mTTRRxd} &\dhpnn{n}{x} = (\nu_1+\nu_2) \dhpnn{n}{x-1} + \nu_3 \dhpnn{n}{x-2} \\ &\hspace{1.5em}n=0,1,\dots,M \ \ \mathrm{and}\ \ x=2,3,\dots,N/2-1 , \nonumber \end{align} where $ M=0.4N $ to ensure non-zero initial sets. The parameters $\nu_1, \nu_2, $ and $ \nu_3$ of the mTTRRxd are defined by \begin{align} \label{Eq_mxd_param} \nu_1&={\frac {-2\,{x}^{2}+ (2N+\alpha-\beta+2 ) x+(\beta-1)N-\alpha-1}{\nu}} \nonumber\\ \nu_2&=-{\frac {n(\alpha+\beta+n+1) }{\nu}} \\ \nu_3&=-{\frac{\sqrt{(\beta+x-1)(N-x+1)(x-1)(N+\alpha-x+1)}}{\nu}}\nonumber\\ \nu&=\sqrt{(N-x)(\beta+x)(N+\alpha-x) x} .\nonumber \end{align} For the part P2, the mTTRRxd is applied backwardly as follows \begin{align} \label{Eq_mTTRRxd_Back} &\dhpnn{n}{x-2} = \frac{1}{\nu_3} \dhpnn{n}{x} - \frac{\nu_1+\nu_2}{\nu_3} \dhpnn{n}{x-1} \\ &n=0,1,\dots,M; \ \ \mathrm{and}\ \ x=N-2,N-3,\dots,N/2 . \nonumber \end{align} After computing the coefficients in parts P1 and P2, the coefficients in parts P3 and P4 are computed using the modified TTRRnd (mTTRRnd) and mTTRRxd. The coefficients of part P3 are computed in the range $ n=M,M+1,\dots,N-1 $ and $ x=N/2-1, N/2-2, \ldots, 0 $ ($ x=(N-1)/2-1, (N-1)/2-2, \ldots, 0 $ for odd $N$) and the coefficients of part P4 are computed in the range $ n=M,M+1,\dots,N-1 $ and $ x=N/2, N/2+1, \ldots, N-1 $ ($ x=(N-1)/2, (N-1)/2+1, \ldots, N-1 $) as follows \begin{align}\label{Eq_mTTRnd} \dhpnn{n}{x}=\kappa_1\kappa_2 \dhpnn{n-1}{x} + \kappa_3 \dhpnn{n-2}{x} . \end{align} The parameters $\kappa_1$, $\kappa_2, $ and $\kappa_3$ of the mTTRRxd are defined by \begin{align} \label{eq_mTTRRnd_param} \kappa_1 =&(\alpha+\beta+2n) \sqrt{\frac{(\alpha+\beta+2n+1) (\alpha+\beta+2n-1)} {n(\alpha+\beta+n) (N-n) (\alpha+n) (\beta+n) (\alpha+\beta+N+n)}} \nonumber \\ \kappa_2 =& x-\frac{1}{4}\left[\alpha-\beta+2N-2+{\frac{({\beta}^{2}-{\alpha}^{2})(\alpha+\beta+2N)}{(\alpha+\beta+2n-2)( \alpha+\beta+2n) }}\right] \\ \kappa_3 =& -\frac{\alpha+\beta+2n} {\alpha+\beta+2n-2} \sqrt{\frac{(n-1) (\alpha+n-1) (\beta+n-1) (N-n+1)} {n(\alpha+\beta+n) (\alpha+n) (\beta+n)(N-n)}} \times \nonumber\\ & \ \ \times\sqrt{\frac{(\alpha+\beta+n-1) (\alpha+\beta+2n+1) (\alpha+\beta+N+n-1)} {(\alpha+\beta+2n-3) (\alpha+\beta+N+n)}} \nonumber \end{align} For each computed coefficient at the $ x $th index in parts P3 and P4, when the previously computed coefficient is less than the currently computed coefficient and less then $10^{-6}$, the mTTRRxd is stopped, the rest of the coefficients (part P6) is left zero and the computation continues by the next degree $ n+1 $. \subsection{Summary of the Proposed Recurrence Algorithm} For more clarification, the procedure of the proposed algorithm for $ \alpha\ne\beta $ are shown in \figurename{~\ref{proposedsteps}} and can be summarized as follows: \begin{enumerate}[label=Step \arabic*:] \item Compute the initial values $ \dhpnn{0}{0} $ and $ \dhpnn{0}{N-1} $ using Eqs.~\eqref{Eq_init_val1} and \eqref{Eq_init_val2}, respectively. (Eqs.~\eqref{Eq_init_neg_val1} and \eqref{Eq_init_neg_val2} respectively). \item Compute the initial sets $ \dhpnn{n}{0} $ and $ \dhpnn{n}{1} $ using Eqs.~\eqref{Eq_initial_set_n_0} and \eqref{Eq_initial_set_n_1}. The initial sets $ \dhpnn{n}{N-1} $ and $ \dhpnn{n}{N-2} $ are computed using Eqs.~\eqref{Eq_initial_set_n_N_1} and \eqref{Eq_initial_set_n_N_2}. \item Compute the coefficients of DHP in part P1 using mTTRxd given in Eq.~\eqref{Eq_mTTRRxd}, while the coefficients of DHP in part P2 are computed using backward mTTRRxd given in \eqref{Eq_mTTRRxd_Back}. \item Compute the coefficients of the DHP in parts P3 and P4 using backward mTTRxd given in \eqref{Eq_mTTRnd} for the range $ n=M+1,M+2,\dots,N-1 $. The coordinate $ x $ in P3 is in the range $ x = N2-1, N2-2, \dots, 0 $ and in P4 in the range $ x=N2, N2+1, \dots, N-1 $. $ N2 = N/2 $ for even $ N $ and $ N2 = (N-1)/2 $ for odd $ N $. \item For each value computed at the $ x $th index, if the absolute value of the previously computed coefficient is less than the currently computed coefficients and less than $10^{-6}$, the process is terminated and moved to the next value of $ n $, i.e., $ n+1 $. We call the zero coefficients part P6. \end{enumerate} \begin{figure} [ht] \centering \includegraphics[width=0.99\linewidth]{Proposed_Steps} \caption{Steps of the proposed algorithm} \label{proposedsteps} \end{figure} It should be noted that for the case of $ \alpha=\beta $, the proposed algorithm computes the coefficients in parts P1 and P3, while the coefficients in part P5 are computed using symmetry relation given in Eq.~\eqref{Eq_Sym}. \begin{figure}[ht] \centering \includegraphics[width=0.5\linewidth]{proposed_ab} \caption{Part of the proposed algorithm for $ \alpha=\beta $} \label{proposed_ab} \end{figure} \section{Experimental Results}\label{sec:experiments} The performance of the proposed algorithm is evaluated against existing algorithms in this section. The evaluation is performed in terms of the maximum size of the generated polynomial, signal reconstruction, and computational cost. \subsection{Analysis of Maximum Size} In this experiment, we searched maximum size of DHP generated by the proposed and existing algorithms for different values of parameters $ \alpha $ and $ \beta $. If $ R $ is the matrix of values $ \dhpnn{n}{x} $ with the size $ N \times N $, then $ R \times R^T $ should be the identity matrix $\mathbbm{1}(N)$ of the size $N\times N$. So, $\mathrm{mean}(|\mathbbm{1}(N) - R \times R^T |)$ can be used as the average orthogonality error. We searched maximum $ N $ satisfying two criteria, average orthogonality error less than $10^{-5}$ and the computing time less than 1 minute. \begin{table}[ht] \caption{Comparison between the ability of the proposed algorithm and existing algorithms to generate maximum polynomial size $N$ without propagation error.} \label{tbl_max_size} \vspace{1ex} \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline $ \alpha \text{ and } \beta $ & TTRRnd & TTRRxd & RRGSOP & Proposed \\ \hline $\alpha=100$; $ \beta=50$ & 35 & 1170 & $\emptyset$ & 9848 \\ \hline $\alpha=100$; $\beta=100$ & $\emptyset$ & 1309 & 1963 & 10749 \\ \hline $\alpha=200$; $\beta=100$ & $\emptyset$ & 1213 & $\emptyset$ & 10549 \\ \hline $\alpha=200$; $\beta=200$ & $\emptyset$ & 1414 & 1963 & 12037 \\ \hline $\alpha=400$; $\beta=200$ & $\emptyset$ & 1266 & $\emptyset$ & 11624 \\ \hline $\alpha=400$; $\beta=300$ & $\emptyset$ & 1369 & $\emptyset$ & 12907 \\ \hline $\alpha=400$; $\beta=400$ & $\emptyset$ & 1540 & 1970 & 14066 \\ \hline $\alpha=500$; $\beta=250$ & $\emptyset$ & 1285 & $\emptyset$ & 8747 \\ \hline $\alpha=500$; $\beta=400$ & $\emptyset$ & 1422 & $\emptyset$ & 11685 \\ \hline $\alpha=500$; $\beta=500$ & $\emptyset$ & 1589 & 1954 & 13527 \\ \hline \end{tabular} \end{center} \end{table} The maximum size for each algorithm is reported in \tablename{~\ref{tbl_max_size}}. From it we can observe that the proposed algorithm is able to generate DHP with different polynomial parameters without propagation error. The main problem with existing algorithms relies on: 1) the formula used to compute the initial value, and 2) the propagation error generated when the DHPCs becomes very small. The TTRRnd maximum size is 35 for a very small range of DHP parameters, while the TTRRxd is able to generate a maximum size of 1589 and it works for wide range of the DHP parameters. RRGSOP is able to generate the orthogonal polynomials only when $\alpha=\beta$. The main problem is the time of computation. All results $\neq\emptyset$ cannot be increased because of the time limit 1 minute, while the typical time of computation of the other algorithms is less than 2~s. The proposed algorithm outperforms the existing algorithms in terms of the maximum size and degree that can be generated. \begin{sloppypar} \subsection{Analysis of the Energy Compaction and Reconstruction Error} \end{sloppypar} Discrete transforms are dissimilar because of their moments distribution \cite{CHP_2020}. The sequence of moment indices is essential for the reconstruction of signal information. Therefore, the DHP distribution of the moment energy needs to be investigated before the signal reconstruction analysis. The procedure presented by Jian \cite{jain1989} has been followed to find the distribution of moments. The procedure can be summarized as follows \begin{enumerate} \item A covariance matrix $ \mathcal{CM} $ with length $ N $ and zero mean is given by \cite{jain1989} \begin{equation}\label{Eq_cov_mat} \mathcal{CM}=\begin{bmatrix} 1 & \rho & \rho^2 & \cdots & \rho^{N-1} \\ \rho & 1 & \cdots & \cdots & \vdots \\ \rho^2 & \vdots & \ddots & \vdots & \rho^2 \\ \vdots & \cdots & \cdots & \ddots & \rho \\ \rho^{N-1} & \cdots & \rho^2 & \rho & 1 \end{bmatrix} . \end{equation} \item The covariance matrix $ \mathcal{CM} $ is transformed into the discrete Hahn moment domain as follows \begin{equation}\label{Eq_CMM} T=R\times\mathcal{CM}\times R^T , \end{equation} where $ T $ is the transformed matrix that is utilized to describe the transform coefficients $ \sigma_l^2 $, and $ R $ is the DHP matrix generated with a size of $ N $ and degree $ N $. \item The diagonal coefficients of the matrix $ T $ are considered \end{enumerate} The aforementioned procedure is carried out using two values of covariance coefficients, $ \rho=0.85 $ and $ \rho=0.95 $, different values of DHP parameters, and length $ N=16 $. The results are reported in \tablename{~\ref{tbl_cm}}. It can inferred from \tablename{~\ref{tbl_cm}} that the variance values $ \sigma_l^2 $ of the DHP are arranged such that the maximum value is located at $ l=0 $ and the variance values reduced as the variance index increased. Thus, the DHP moment order, which is utilized to reconstruct signal information, is given by: $ n=0,1,\dots,N-1$. \begin{table}[ht] \caption{Transform coefficient values $ \sigma_l^2 $} \label{tbl_cm} \centering \resizebox{\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline \multirow{2}{*}{$l$} & \multicolumn{6}{c|}{$ \rho $=0.85} & \multicolumn{6}{c|}{$ \rho $=0.95} \\ \cline{2-13} & \begin{tabular}[c]{@{}c@{}}$\alpha=$20\\ $ \beta=$20\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$50\\ $ \beta=$50\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$100\\ $ \beta=$50\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$100\\ $ \beta=$100\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$200\\ $ \beta=$100\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$200\\ $ \beta=$200\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$20\\ $ \beta=$20\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$50\\ $ \beta=$50\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$100\\ $ \beta=$50\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$100\\ $ \beta=$100\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$200\\ $ \beta=$100\end{tabular} & \begin{tabular}[c]{@{}c@{}}$\alpha=$200\\ $ \beta=$200\end{tabular} \\ \hline 0 & 9.145 & 8.635 & 8.031 & 8.437 & 7.896 & 8.331 & 6.729 & 6.458 & 6.121 & 6.350 & 6.046 & 6.292 \\ \hline 1 & 2.713 & 2.850 & 2.672 & 2.886 & 2.679 & 2.902 & 2.622 & 2.434 & 2.214 & 2.359 & 2.157 & 2.318 \\ \hline 2 & 1.336 & 1.255 & 1.260 & 1.332 & 1.291 & 1.372 & 2.228 & 2.267 & 2.140 & 2.274 & 2.135 & 2.276 \\ \hline 3 & 1.053 & 1.215 & 1.141 & 1.167 & 1.100 & 1.142 & 1.287 & 1.333 & 1.291 & 1.343 & 1.282 & 1.347 \\ \hline 4 & 0.676 & 0.705 & 0.779 & 0.711 & 0.768 & 0.713 & 0.986 & 1.104 & 1.128 & 1.148 & 1.140 & 1.170 \\ \hline 5 & 0.346 & 0.472 & 0.603 & 0.530 & 0.638 & 0.563 & 0.586 & 0.673 & 0.780 & 0.708 & 0.793 & 0.727 \\ \hline 6 & 0.290 & 0.346 & 0.527 & 0.369 & 0.538 & 0.380 & 0.409 & 0.494 & 0.633 & 0.533 & 0.656 & 0.555 \\ \hline 7 & 0.107 & 0.139 & 0.315 & 0.162 & 0.339 & 0.176 & 0.253 & 0.299 & 0.453 & 0.323 & 0.478 & 0.337 \\ \hline 8 & 0.098 & 0.136 & 0.259 & 0.151 & 0.289 & 0.160 & 0.183 & 0.211 & 0.338 & 0.227 & 0.363 & 0.237 \\ \hline 9 & 0.047 & 0.054 & 0.144 & 0.058 & 0.165 & 0.061 & 0.138 & 0.148 & 0.237 & 0.154 & 0.258 & 0.159 \\ \hline 10 & 0.041 & 0.047 & 0.093 & 0.051 & 0.108 & 0.054 & 0.117 & 0.120 & 0.170 & 0.123 & 0.185 & 0.124 \\ \hline 11 & 0.033 & 0.034 & 0.055 & 0.034 & 0.062 & 0.034 & 0.105 & 0.104 & 0.128 & 0.105 & 0.135 & 0.105 \\ \hline 12 & 0.031 & 0.031 & 0.038 & 0.031 & 0.041 & 0.031 & 0.097 & 0.096 & 0.105 & 0.096 & 0.108 & 0.096 \\ \hline 13 & 0.029 & 0.029 & 0.031 & 0.029 & 0.031 & 0.028 & 0.091 & 0.090 & 0.093 & 0.090 & 0.094 & 0.090 \\ \hline 14 & 0.027 & 0.027 & 0.028 & 0.027 & 0.028 & 0.027 & 0.087 & 0.086 & 0.087 & 0.086 & 0.087 & 0.086 \\ \hline 15 & 0.026 & 0.026 & 0.026 & 0.026 & 0.026 & 0.026 & 0.083 & 0.083 & 0.083 & 0.083 & 0.083 & 0.083 \\ \hline \end{tabular}} \end{table} One of the important properties of the orthogonal-polynomial-based discrete transform is the energy compaction property. This property is employed to measure the tendency of the DHP to reconstruct a large amount of the signal information using a small number of moments coefficients. To examine the impact of the DHP parameters $ \alpha $ and $ \beta $ on the energy compaction, the restriction error, $ \mathcal{J} $, is used as follows \cite{jain1989} \begin{equation} \label{Eq_Jm} \mathcal{J}_m=\frac{\sum\limits_{a=m}^{N-1}\sigma_a^2}{\sum\limits_{a=0}^{N-1}\sigma_a^2};\ \ m=0,1,2,\dots,N-1 , \end{equation} where $ \sigma_a^2 $ represents $ \sigma_l^2 $ ordered descendingly. \figurename{~\ref{fig_jm}} illustrates the restriction error using covariance coefficient ($ \rho=0.98 $) in terms of retained samples~$ q $. From \figurename{~\ref{fig_jm}}, the DHP parameters, $ \alpha $ and $ \beta $, affect the restriction error. E.g., from \figurename{~\ref{fig_jm}}a, when parameter $ \alpha=10 $ and $ \beta=0 $ shows better energy compaction than other parameter values in the range of $ m=32,\dots,96 $. However, when $ \alpha=200 $ and $ \beta=150 $ presents better energy compaction compared to other DHP parameters in the range $ m>192 $. On the other hand, \figurename{~\ref{fig_jm}}b, the energy compaction for DHP parameters $ \alpha=\beta=0 $ and $ \alpha=\beta=10 $ shows comparable energy compaction as well as the best energy compaction in the range of retained samples $ m=32,\dots,96 $. It should be noted that as DHP parameters increases, the energy compaction becomes better in the range of $ m>192 $. \begin{figure}[ht] \centering \includegraphics[width=0.90\linewidth]{Jm} \caption{Restriction error of DHP (a) for $ \alpha\ne\beta $, and (b) $ \alpha = \beta $} \label{fig_jm} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=0.5\linewidth]{fruits} \caption{The image used for the tests.} \label{test_img} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=0.90\linewidth]{NMSE} \caption{NMSE using the proposed algorithm for different values of parameters ($\alpha$ and $\beta$).} \label{fig_nmse} \end{figure} For more evaluation of the proposed algorithm, the normalized mean square error (NMSE) is computed between the image and its reconstructed version. The formula for NMSE, $ E $, is given in \cite{CHP_2020} \begin{equation} \label{Eq_NMSE} E(I,I_r)=\frac{\sum\limits_{x,y}{(I(x,y)-I_r(x,y))^2}}{\sum\limits_{x,y}{(I(x,y))^2}} \end{equation} \begin{figure}[!ht] \centering \includegraphics[width=0.90\linewidth]{NMSE_E} \caption{Comparison of NMSE between the proposed algorithm and existing works.} \label{fig_nmse_e} \end{figure} \begin{figure}[!ht] \centering \includegraphics[width=0.8\linewidth]{Time} \caption{Comparison of execution time between the proposed algorithm and existing works.} \label{fig_time} \end{figure} The image "Fruits" shown in \figurename{~\ref{test_img}} is used as a test image for reconstruction error analysis. The reconstruction error is performed for different values of DHP parameters, $ \alpha $ and $ \beta $, as well as different polynomial size. For each polynomial size the image is resized accordingly. First, the reconstruction error analysis is performed for the case of $ \alpha=\beta $ as shown in \figurename{s~}{\ref{fig_nmse}}a, c, and e and also for the case of $ \alpha\ne\beta $ as shown in \figurename{s~}{\ref{fig_nmse}}b, d, and f. The image sizes utilized are $ 1024\times1024 $, $ 2048\times2018 $, and $ 4096\times4096 $. From \figurename{~\ref{fig_nmse}}, it can be concluded that the proposed algorithm is able to reconstruct the image remarkably for different polynomial size and different values of DHP parameters. It should be noted that when the DHP parameters increase to $ \alpha = \beta =400 $, it shows better reconstruction error than other values of DHP parameters. E.g., for image size $ 4096\times 4096 $, the reconstruction error, NMSE, is reduced to minimum for $ \alpha=\beta=400 $, when the number of moments used is greater than $ 1536\times1536 $. In addition, for the case $ \alpha\ne\beta $, the best reconstruction error is occurred at $ \alpha=400 $ and $ \beta=200 $. For image size of $ 2048\times2048 $, the NMSE declined to minimum for DHP parameters $ \alpha=400 $ and $ \beta=200 $ before other DHP parameters when the moment matrix used for reconstruction is greater than $ 896\times896 $. For comparison, the NMSE is computed using the proposed and existing algorithms for different values of DHP parameters and image sizes. \figurename{s~}{\ref{fig_nmse_e}}a, b, and c present the NMSE for image size of $ 1024\times1024 $ with DHP parameters $ \alpha=\beta=50 $, $ \alpha=\beta=100 $, and $ \alpha=\beta=200 $, respectively. In addition, \figurename{s~}{\ref{fig_nmse_e}}d, e, and f illustrate the NMSE for image size of $ 2048\times2048 $ with DHP parameters $ \alpha=\beta=50 $, $ \alpha=\beta=100 $, and $ \alpha=\beta=200 $, respectively. It can be observed that the TTRRnd is unable to reconstruct the image because of the nature of the recurrence algorithm, where the coefficient value of DHP shows high propagation error for all values of DHP parameters, while for TTRRxd, it is able to reconstruct the image for small values of DHP parameters $ \alpha=\beta=50 $, as shown in \figurename{~\ref{fig_nmse_e}}a and \figurename{~\ref{fig_nmse_e}}d, and unable to reconstruct the image for large values of DHP parameters, as shown in \figurename{s~}{\ref{fig_nmse_e}}b, c, e, and f, where the TTRRxd is unable to generate correct DHPCs for large values of DHP parameters because of the formula used to compute the initial values. Whereas for RRGSOP, the algorithm is able to reconstruct the image correctly as the moment order increases up to $ \alpha=\beta=100 $; however, it is unable to reconstruct the image for DHP parameters greater than 100, as shown in \figurename{~\ref{fig_nmse_e}}c and \figurename{~\ref{fig_nmse_e}}d, because of the formula used to compute the initial values. On the other hand, the proposed algorithm is able to compute DHPCs and to reconstruct the image correctly for different values of DHP parameters and image sizes. \subsection{Computational Cost Analysis} In this section, the proposed algorithm is evaluated in terms of computational cost. The execution time is performed for the proposed algorithm and compared to that of the existing algorithms. The execution time experiment is carried out using different DHP sizes. The experiment is performed 10 times and the average time for each algorithm is reported as shows in \figurename{~\ref{fig_time}}. It can be observed from \figurename{~\ref{fig_time}} that the execution time of the proposed algorithm for $ \alpha=\beta $ is less than that of the the proposed algorithm for $ \alpha\ne\beta $ in \figurename{~\ref{fig_time}}a. In addition, the proposed algorithm shows less computation time than that of the TTRRnd because of the proposed algorithm reduces the formula used for computation as depicted in \figurename{~\ref{fig_time}}a. Compared to TTRRxd, the proposed algorithm shows higher execution time than that of the TTRRxd. On the other hand, the execution time required to generate DHP using RRGSOP is higher than that of the proposed algorithm. The average improvement ratio computational cost for the proposed algorithm is $ \sim $0.76, 2.52, and 289.59 over TTRRxd, TTRRnd, and RRGSOP, respectively. The experiment was carried out using MATLAB environment on MSI-GT60 laptop with a memory of 16GB and core i7-4700MQ CPU. \section{Conclusion}\label{sec:conclusion} In this paper, a new recurrence algorithm for DHP is introduced. The proposed algorithm uses the logarithmic gamma function for computation of the initial values so that it is able to compute initial values for different DHP parameters and the large number of samples. The proposed algorithm combines recurrence in degree with recurrence in coordinates and with a condition criterion, so that the propagation error is suppressed. The experiments showed that the proposed algorithm remarkably reduces the computational cost with respect to the existing algorithms. It is able to eliminate propagation errors for large polynomial size and a wide range of DHP parameters. It achieves better signal reconstruction results than other recurrence algorithms for high polynomial degrees. \section*{Acknowledgments} \label{Acknowledgments} This work has been supported by the Czech Science Foundation (Grant No. GA21-03921S) and by the {\it Praemium Academiae}. We would also like to acknowledge University of Baghdad for general support. \nolinenumbers \bibliographystyle{ieeetran}
{'timestamp': '2021-11-16T02:34:02', 'yymm': '2111', 'arxiv_id': '2111.07749', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07749'}
arxiv
\section{Introduction} \label{sec:introduction} A vibro-impact process denotes any physical process where the mutual interaction between temporary (opening-closing) contacts and vibrations plays a central role \cite{Babitsky.2013}. Technical examples are machining processes (\eg pneumatic hammers, ultrasonic drillers), impact vibration absorbers, systems with backlash/freeplay (\eg hammering gears in drive trains, piping systems), rotor-stator interactions (\eg between blades and casing of aero engines or within rotor bearings). Vibro-impact processes have multi-scale character both in time and in space: The contact time of a single impact is very short compared with the periods of the critical low-frequency vibration modes. The contact region, in which high stresses are generated, is very small compared to the wavelengths of the critical vibration modes. An elastic wave is initiated from the collision point, which then propagates within the solid body. The wave decays due to dissipative effects within the solid and the boundaries. Depending on the boundary conditions, the wave is reflected, travels back, and may thus affect the contact interactions \cite{Seifried.2010}. In the presence of vibrations, recurrent impacts take place. \\ To accurately predict vibro-impact processes, an appropriate combination of models of the elastodynamics within the bodies and the contact mechanics is required \cite{wrig2006,john1989,Ibrahim.2009}. This poses a number of computational challenges, as explained in the following. \subsubsection*{Enormous model order} A fine space discretization is needed to describe the mechanics in the contact region accurately and to determine the stresses within the whole body. The short collisions transfer considerable energy into high-frequency vibration modes. The finite element model must properly resolve the shortest wavelength which is associated with the highest relevant modal frequency. This yields an enormous mathematical model order, not seldom in the range of $10^5$–$10^7$ nodal displacement degrees of freedom in the case of three-dimensional problems. As in the linear case, Component Mode Synthesis methods are popular in the vibrations community for model order reduction in the presence of nonlinear contact conditions. Here, the idea is to approximate the displacement field in terms of a linear combination of component modes, and to project the momentum balance onto the subspace spanned by these modes (Galerkin procedure) \cite{klerk2008}. As component modes, a subset of normal vibration modes can simply be used. This corresponds to the classical modal truncation, which has been applied to impact problems in combination with regular contact models like Hertzian springs \cite{Seifried.2010}. It is common to combine static deflection shapes obtained for imposed displacements or imposed forces at the contact interface with fixed- or free-interface normal vibration modes as component modes, as in the case of the Craig-Bampton or the Rubin method. The normal modes accurately describe the elastodynamics within the body in the frequency band of interest, while the static deflection shapes accurately describe the local flexibility of the contact region. \subsubsection*{Numerical issues with regularization} A popular approach in the vibrations community to deal with the complementarity inequalities describing the contact constraints is penalty regularization. This can be interpreted as replacing the rigid constraint by a unilateral spring with finite stiffness. Important advantages of the penalty regularization are its simple implementation and that the problem degenerates into an ordinary differential equation system. The delicate question now becomes how to properly set the penalty stiffness. The lower it is, the more violation of the contact constraint is allowed. For high values, on the other hand, it is well-known that the numerical treatment of the problem becomes difficult. More specifically, an extremely fine time discretization is needed to ensure stability of explicit integration methods \cite{carp1991}, and the one-step equations of implicit methods become ill-conditioned causing numerical (nonphysical) oscillations \cite{Leine.2004,Acary.2008}. It is therefore numerically more robust to view the contact stresses/forces as Lagrange multipliers enforcing the contact constraints and apply designated methods for their computation \cite{Acary.2008}. \subsubsection*{Numerical oscillations associated with standard space discretization} In the spatially continuous case, the relative contact velocity jumps to zero when a contact closes with nonzero speed. Space discretization with standard finite elements associates a finite mass to all nodes, including those located at the contact boundary. If a node with finite mass was stopped immediately upon contact, kinetic energy would be lost. To prevent this nonphysical energy loss, the relative velocity must keep its magnitude, but change its sign to avoid penetration. In contrast to the spatially continuous case, this leads to a finite impulse and causes spurious, high-frequency oscillations, both at the contact and within the flexible body, see \eg \cite{Acary.2013}. The high-frequency oscillations are an important problem for time integration: They limit the maximum stable time step for explicit schemes, and they cause high effort for the iterative solution of the contact problem in implicit schemes \cite{carp1991}. To counteract the spurious oscillations, it is common practice to add numerical damping specifically to the high-frequency modes. However, this may still lead to large computation effort and distort the wave propagation behavior \cite{Tschigg.2018}. Dedicated constraint stabilization schemes have been proposed (\eg \cite{Acary.2013,Krause.2009,krause2012,Gear.1985}), which all come at the cost of considerable computational effort \cite{Acary.2013}. Two approaches that counteract the spurious oscillations are further discussed in the following paragraphs, namely splitting the flexible body into a contact and a remaining region, and the massless boundary approach. Other methods, such as Nitsche's method \cite{Chouly.2015} also lead to a well-posed semi-discrete problem, but do not reduce the spurious oscillations to the same extent. \\ The \emph{splitting approach} was proposed by Seifried \etal for impact simulations \cite{Seifried.2010}. The idea is to replace the contact region by a force-displacement relation derived from quasi-static assumptions, and to approximate the dynamics of the remaining region in terms of the classical modal truncation. As force-displacement relation, the Hertzian contact law can be used for appropriate geometries. As alternative, the force-displacement relation can be determined by interpolating the results of static finite element analyses. The splitting approach has two major drawbacks: First, it is strictly limited to one-dimensional frictionless problems with small contact areas. Hence, the contact between conforming surfaces (as occurring in most joints), rolling-type motions or stick-slip interactions cannot be treated with this approach. Second, the need to define an artificial boundary between statically treated contact region and dynamically treated remaining region leads to an inevitable compromise between the resolution of the contact stresses and the resolution of the elastodynamics within the whole body. \\ The \emph{massless boundary approach} views the standard space discretization (which was not initially designed for impact problems) as the source of the problem. When no inertia is associated to the nodal displacement degrees of freedom at the contact interface, the differential index of the mathematical problem reduces from 3 to 1, which substantially reduces the numerical contact oscillations \cite{Ascher.1998}. The momentum balance restricted to the contact boundary is then a purely static sub-problem, and computationally robust methods are available to solve this along with the contact constraints \cite{Acary.2008}. Another important benefit of this approach is that no impact law is needed for the boundary nodes, so one does not have the delicate task to set a coefficient of restitution. The difference between the available massless boundary methods is how they get rid of the mass at the boundary. Renard \etal \cite{Khenous.2008}, who introduced the massless boundary approach, proposed to determine the mass redistribution as the solution of an optimization problem (the objective being to shift around as little mass as possible) under the constraints of retaining the 0th, 1st and 2nd mass moment of inertia. Besides the high computational effort of this strategy, it is rather questionable to what extent these constraints are relevant for vibration or wave propagation problems. Wohlmuth \etal proposed to relocate the integration points away from the boundary in such a way that no mass is associated with the contact nodes \cite{Hager.2008,Hager.2009}. Both Renard \etal \cite{Renard.2010} and Wohlmuth \etal \cite{Tkachuk.2013} later refined their methods by using shape functions different from the standard ones. \subsubsection*{Enormous effort to compute long-term behavior (vibrations)} As explained above, it is already challenging to simulate a short time interval around a single collision. For vibration problems, the steady-state behavior is of primary concern. The critical excitation occurs usually in the lowest-frequency vibration modes. Damping is relatively light (otherwise one would not have any vibration problem). Thus, long transients, and hence many cycles of the lowest-frequency modes must be simulated to determine the limit state. To ensure vibration safety, many of such simulations are generally necessary for design optimization and uncertainty quantification, due to the nonlinear dependence on excitation conditions, and due to the dependence of the long-term behavior on the initial conditions (coexisting steady states). \subsection*{Purpose and outline of the present work} We propose to unite the massless boundary concept (originating from computational mechanics) and the idea of component mode synthesis (common in structural dynamics). Time stepping schemes for massless boundary models are proposed in \sref{timestepping}. Component mode synthesis methods yielding a massless boundary are addressed in \sref{masslessCMS}. The computational performance is assessed for a series of benchmarks in \sref{results}. This article ends with the conclusions in \sref{conclusions}. \newcommand{\qq}{\mm q} \newcommand{\uu}{\mm u} \newcommand{\qqb}{\qq_{\mathrm b}} \newcommand{\qqi}{\qq_{\mathrm i}} \newcommand{\ui}{{\uu}_{\mathrm{i}}} \newcommand{\dui}{\dot{\uu}_{\mathrm{i}}} \newcommand{\ub}{{\uu}_{\mathrm{b}}} \newcommand{\fex}{\mm f \newcommand{\fexb}{{\mm f}_{\mathrm b} \newcommand{\fexi}{{\mm f}_{\mathrm i} \newcommand{\Wb}{\mm W_{\mathrm b}} \newcommand{\Wbtra}{\mm W\tra_{\mathrm b}} \newcommand{\Nb}{B} \newcommand{\Ni}{I} \newcommand{\Nc}{C} \newcommand{\half}{\frac12} \newcommand{\qqbk}{\qqb^k} \newcommand{\qqik}{\qqi^k} \newcommand{\qqikm}{\qqi^{k-1}} \newcommand{\qqikp}{\qqi^{k+1}} \newcommand{\qqbkm}{\qqb^{k-1}} \newcommand{\qqbkp}{\qqb^{k+1}} \newcommand{\ubk}{\ub^k} \newcommand{\ubkm}{\ub^{k-1}} \newcommand{\uikph}{\ui^{k+\half}} \newcommand{\uikmh}{\ui^{k-\half}} \newcommand{\fexh}{\hat{\mm f} \newcommand{\fexbh}{\hat{\mm f}_{\mathrm b} \newcommand{\fexih}{\hat{\mm f}_{\mathrm i} \newcommand{\qtil}{\tilde{\qq}} \newcommand{\Mtil}{\tilde{\mm M}} \newcommand{\Ktil}{\tilde{\mm K}} \newcommand{\Dtil}{\tilde{\mm D}} \newcommand{\eye}{\mm I} \newcommand{\nmod}{N_{\mathrm{mod}}} \newcommand{\ncon}{N_{\mathrm{con}}} \section{Time step integration of a massless boundary model\label{sec:timestepping}} In the following, we develop a simulation procedure for a massless boundary model. The procedure is directly applicable to a finite element model, provided that the mass has been accordingly redistributed. We later propose component mode synthesis methods to achieve (a) the massless boundary starting from a conventional finite element model, and (b) a reduction of the number of generalized coordinates describing the inner dynamics. \\ Consider the equations of motion of a massless boundary model subjected to contact constraints, \ea{ \mm K_{\mathrm{bb}}\qqb + \mm K_{\mathrm{bi}}\qqi - \Wb\mm\lambda &=& \fexb(t) \fk\label{eq:aeq}\\ \mm M_{\mathrm{ii}}\dui + \mm D_{\mathrm{ii}}\ui + \mm K_{\mathrm{ii}}\qqi + \mm K_{\mathrm{ib}}\qqb &=& \fexi(t) \fk\label{eq:deq}\\ \ub = \dot{\qq}_{\mathrm b}\fk \quad \ui = \dot{\qq}_{\mathrm i}\fp && \label{eq:qu} } Herein, $\qqb\in\mathbb R^{\Nb\times 1}$, $\qqi\in\mathbb R^{\Ni\times 1}$ are the vectors of displacements at the contact boundary, and remaining generalized coordinates, respectively, and $\Nb$ and $\Ni$ are the respective dimensions. Overdot denotes derivative with respect to time $t$. $\mm K_{\mathrm{bb}}\in\mathbb R^{\Nb\times\Nb}$, $\mm K_{\mathrm{bi}} = \mm K\tra_{\mathrm{ib}}\in\mathbb R^{\Nb\times\Ni}$, $\mm K_{\mathrm{ii}}\in\mathbb R^{\Ni\times\Ni}$ are the respective partitions of the symmetric and positive semi-definite stiffness matrix. $\mm M_{\mathrm{ii}}\in\mathbb R^{\Ni\times\Ni}$ is the symmetric and positive definite mass matrix associated with $\qqi$. Viscous damping is considered within the bodies (matrix $\mm D_{\mathrm{ii}}\in\mathbb R^{\Ni\times\Ni}$), but not at the boundary\footnote{Note that the damping associated with the contact boundary will in most cases be dominated by dry friction rather than viscous damping, so that this does not seem to be a strong limitation.}. $\fexb\in\mathbb R^{\Nb\times 1}$, $\fexi\in\mathbb R^{\Ni\times 1}$ denote the imposed forcing with known explicit time dependence. $\mm\lambda\in\mathbb R^{\Nc\times 1}$ is the vector of $\Nc$ Lagrange multipliers which can be interpreted as contact forces, with the constant matrix of contact force directions $\Wb\in\mathbb R^{\Nb\times \Nc}$. The algebraic equations \erefo{aeq} describe the quasi-static force balance at the boundary. The ordinary differential equations \erefo{deq} describe the dynamic generalized force balance within the body. We limit the development to linear elasticity and linear kinematics; the extension of the method to, \eg, geometric and material nonlinearity, or nonlinear and time-variant contact kinematics (with $\Wb(\qq,t)$ rather than constant $\Wb$) is left for future work. Concerning geometric nonlinearity described by multivariate polynomials, such an extension could rely on the Stiffness Evaluation Procedure or Implicit Condensation \cite{Hollkamp.2008}, which can be combined with Component Mode Synthesis \cite{Kuether.2015b}. Concerning other nonlinearities, such an extension could rely on a form of hyper-reduction. \\ The contact gap $\mm g$ and gap velocity $\mm \gamma$ are kinematically related to $\qqb$, $\ub$ via \eref{ckinematics}, \ea{ \mm g = \Wbtra \qqb + \mm g_0(t) \quad \mm\gamma = \Wbtra \ub + \dot{\mm g}_0(t) \fk \label{eq:ckinematics}\\ -\mm\gamma \in \mathcal N_{\mathcal C}\left(\mm\lambda\right) \fp \label{eq:claws} } The contact laws in \eref{claws} are here expressed as inclusion into the normal cone, $\mathcal N_{\mathcal C}$, to the admissible set, $\mathcal C$, of the contact forces $\mm\lambda$. They are formulated on velocity level here and apply to all active contacts (closed normal gap). Unilateral interaction (Signorini conditions) is considered in the normal contact direction. Coulomb's law of dry friction is considered in the tangential contact plane. With $\mm\gamma$ set up as defined in \eref{gammasetup}, the set $\mathcal C$ is given by \eref{admissibleset}, \ea{ \mm\gamma = \vector{\mm\gamma_1 \\ \vdots \\ \mm\gamma_{\ncon}}\fk \quad \mm\gamma_j = \vector{\gamma_{\mathrm n,j} \\ \mm\gamma_{\mathrm t,j}} \fk \label{eq:gammasetup}\\ \mathcal C = \mathcal C_1 \times \ldots \times \mathcal C_{\ncon}\fk \quad \mathcal C_j = \mathbb R_0^+ \times \mathcal D\left(\mu\lambda_{\mathrm n,j}+\mu\lambda_{\mathrm n,j}^0\right)\fp \label{eq:admissibleset} } Herein, $\mathcal D\left(r\right)$ denotes the planar disk of radius $r$. $\mm g$ and $\mm\lambda$ are set up analogous to \eref{gammasetup}. In the case of a preloaded contact point, $\lambda_{\mathrm n,j}^0>0$ is the normal preload; $\lambda_{\mathrm n,j}^0=0$ for initially open contacts. \\ The proposed approach is able to deal with contact among multiple flexible bodies, self-contact, and contact with a rigid wall. Also, the above formulations are applicable regardless of the contact discretization (\eg node-to-segment, segment-to-segment/Mortar). The $\ncon$ contact gaps generally correspond to certain integration points. The contact forces, $\mm\lambda$, are generally obtained by numerical integration of the contact stress field. The contact force at a certain integration point is simply the contact stress times the associated area (weight of numerical integration), see \eg \cite{Krack.2016}. The numerical examples are limited to contact with the (rigid) ground and, for simplicity, we use a node-based integration with equal weights (rather than a consistent integration). In the remainder of this paper, thus, the distinction between nodes and integration points, and the case of non-matching nodes do not receive any particular attention. \subsection{Time stepping schemes} A variety of integrators can be applied to the constrained differential-algebraic equation systems. A comparison of several integrators can be found in \cite{Doyen.2011,Dabaghi.2014}. In the course of the present work, various integrators were tested as well. In particular, we tried higher-order schemes, but found that their performance suffered from numerical oscillations again. Based on our experience, we propose the relatively simple Verlet scheme in its leapfrog form. It should be remarked that the Moreau-like integrators, which are very popular in the mass-carrying case, rely on the same scheme, but are usually formulated in the kick-drift-kick form rather than in the leapfrog form. As the symmetric Moreau-like integrator developed in \cite{Capobianco.2018}, Verlet's scheme enjoys time-reversibility. Moreover, it has favorable energy conservation properties thanks to its symplectic nature. Under fixed contact conditions, the approach enjoys second-order accuracy. Verlet's scheme leads to an explicit integration scheme for the inner coordinates, while the static contact problem restricted to the boundary is solved implicitly. Consequently, the scheme is only conditionally stable. The details of the proposed time stepping scheme are described in the following. \\ In the leapfrog form, the grids of velocities and coordinates are shifted. The time levels for $\uu$ are in the middle of the time levels for $\qq$. We use the notation $\qq^k=\qq(t^k)$, where $t^k$ is the $k$-th time level, and $\uu^{k+\half}=\uu(t^k+\frac{\Delta t}2)$ with the time step $\Delta t$. Then Verlet's scheme can be expressed as \ea{ \qq^{k+1} &=& \qq^{k}+\uu^{k+\half}\Delta t \fk \label{eq:qtrapz}\\ \uu^{k+\half} &=& \uu^{k-\half} + \dot{\uu}^{k}\Delta t \fp \label{eq:utrapz} } For a function $\mm h\left(\qq,\uu,t\right)$, one can use the approximation \e{ \mm h^k = \frac12 \left(~\mm h\left(\mm q^k,\mm u^{k-\half},t^k\right) + \mm h\left(\mm q^k,\mm u^{k+\half},t^k\right)~\right)\fk \label{eq:htrapz} } and in particular, $\uu^k = \frac12\left(\uu^{k-\half}+\uu^{k+\half}\right)$, $\qq^{k-\half} = \frac12\left(\qq^{k-1}+\qq^k\right)$. \\ In the following, it is useful to treat frictionless and frictional contact separately. The implementation of the leapfrog scheme for the given problem setting is illustrated in \fref{TimeLines}. \subsubsection{Frictionless contact} In the case of frictionless contact, the contact constraints can be formulated on the displacement level. Hence, the contact constraints in \eref{claws} can be replaced by $-\mm g \in \mathcal N_{\mathcal C}\left(\mm\lambda\right)$. The proposed algorithm is: \begin{enumerate} \item Set $k=1$, $t^1=t_{\mathrm{start}}$ and initial $\qqi^1$, $\ui^{\half}$. \item Solve \eref{aeq}, \eref{ckinematics} and the contact constraints on \emph{displacement level} evaluated at $t^k$ with respect to $\qqbk$, $\mm\lambda^k$. \item Solve \eref{deq} evaluated at $t^k$ with respect to $\uikph$. \item Evaluate \eref{qtrapz} to determine $\qqi^{k+1}$. \item If $t^k<t_{\mathrm{end}}$, increase $k$ by one and go back to step 2. \end{enumerate} Note that the boundary velocities $\ub$ are not needed in this algorithm, and thus no stepping is applied to the boundary coordinates. \subsubsection{Frictional contact} In this case, the contact constraints cannot be formulated on the displacement level, and are instead formulated on the velocity level. Hence, the boundary velocities $\ub$ are needed and a stepping rule must be employed to relate the time discrete forms of $\ub$ and $\qqb$. As in conventional Moreau-like schemes, this stepping rule for $\qqb$ is then substituted into \eref{aeq} to obtain an expression for the contact gap velocities as function of the contact forces. The proposed algorithm is: \begin{enumerate} \item Set $k=1$, $t^1=t_{\mathrm{start}}$ and initial $\qqi^1$, $\ui^{\half}$, $\qqb^0$. \item Solve \eref{aeq}, \eref{ckinematics} and the contact constraints on \emph{velocity level} evaluated at $t^k$ with respect to $\ub^{k-\half}$, $\mm\lambda^{k}$, and update $\qqbk$ using \eref{qtrapz}. \item Solve \eref{deq} evaluated at $t^k$ with respect to $\uikph$. \item Evaluate \eref{qtrapz} to determine $\qqi^{k+1}$. \item If $t^k<t_{\mathrm{end}}$, increase $k$ by one and go back to step 2. \end{enumerate} Note that steps 3-5 are identical to the frictionless case. As opposed to the frictionless case, an initial value for $\qqb^0$ is needed in the frictional case. \begin{figure}[htb] \centering \includegraphics[width=0.99\textwidth]{figures/TimeLines.pdf} \caption{Schematic illustration of the time integration schemes} \label{fig:TimeLines} \end{figure} \subsection{Active set strategy} The contact constraints are treated using an active set strategy; \ie, the contact problem is restricted to the active set of constraints. To determine the active set of constraints, $\mathcal I_{\mathrm a}$, two variants are proposed depending on whether a particular contact interface is initially open or preloaded. \\ In the \emph{initially open case}, the normal gaps are predicted with \eref{aeq} assuming $\mm\lambda=\mm 0$: \newcommand{\Kbb}{\mm K_{\mathrm {bb}}} \newcommand{\Kbi}{\mm K_{\mathrm {bi}}} \ea{ \mm g^{\mathrm{pre}} &=& \mm g_0\left(t^k\right) + \Wbtra\Kbb^{-1}\left(~\fexb\left(t^k\right) ~-~ \Kbi \qqik~\right)\fk \\ \mathcal I_{\mathrm a} &=& \lbrace j\vert g_{\mathrm n,j}^{\mathrm{pre}} \leq 0 \rbrace\fp } The active constraints are those with non-positive normal gap. \\ In the \emph{preloaded case}, the contact forces are predicted with \eref{aeq} assuming $\qqbk=\qqbkm$ (sticking contact). \ea{ \mm\lambda^{\mathrm{pre}} &=& \Wb^{-1}\left(~\Kbb\qqbkm~+~\Kbi\qqik~-~\fexb\left(t^k\right)~\right)\fk \label{eq:lambdapre}\\ \mathcal I_{\mathrm a} &=& \lbrace j\vert \lambda_{\mathrm n,j}^{\mathrm{pre}}+\lambda_{\mathrm n,j}^{0} \leq 0 ~ \lor ~ \|\mm\lambda_{\mathrm t,j}^{\mathrm{pre}}\| \geq \mu \lambda_{\mathrm n,j}^{\mathrm{pre}}+\mu \lambda_{\mathrm n,j}^{0} \rbrace\fp } The active constraints are those with non-positive normal contact forces, and/or tangential forces not inside the Coulomb cone in the frictional case. To solve \eref{lambdapre}, $\Wb$ must be invertible, which is the case under the assumptions outlined in \sref{masslessCMS}. \fig[ph!]{signalFlowPlan}{Overview of the simulation algorithms for the cases of (a) frictionless contact, (b) frictional contact}{0.9} \\ The important advantage of the described procedure is the non-iterative solution of the contact problem if the initially open contact remains open and the preloaded contact remains closed (or sticking in the frictional case). If a system contains both initially open and preloaded interfaces, the described procedure can be easily applied separately for each interface, provided that the interfaces are \emph{elastically and kinematically decoupled} in the sense that the respective coupling partitions of $\mm K_{\mathrm{bb}}$ and $\Wb$ are zero. An alternative to the described procedure is to use a stepping rule, \ie, to predict $\qqb$ at the next time level using the current value of $\ub$, and then to define the constraints with non-positive normal gap as active. Compared to the proposed procedure, we found that this leads to more iterations in the case of preloaded contact interfaces. \subsection{Initialization} It should be remarked that Moreau-like schemes commonly use the notation of starting, mid- and end point of a time interval (kick-drift-kick form). In the leapfrog form used above, actually $t^k$ corresponds to the midpoint, $t^{k-\half}$ and $t^{k+\half}$ are starting and end point, respectively. Note that stepping from midpoint to midpoint of the coordinates $\qq$ is possible since the corresponding velocity is assumed as constant in Moreau-like schemes. The proposed formulation involving a shifted grid of $\qq$ and $\uu$ is, of course, fully equivalent. However, a caveat is that the initialization is slightly more complicated if values of $\qq$ and $\uu$ are imposed at the same time instant $t_{\mathrm{start}}$. This can be addressed properly by implementing an initialization step as proposed in \cite{Capobianco.2018}. As alternative, one may omit this initialization and simply use the approximation $\ui^{\half} = \ui(t^1)$, and $\qqb^0 = \qqb(t^1)$ in the frictional case. This should be valid if the initial velocity changes only slowly in the beginning of the simulation. To reduce the error introduced by this approximation, one could also use smaller time steps at the beginning of the simulation. It should be remarked that in many cases, the long-term behavior is of primary interest and the dependence on the exact initial conditions plays only a minor role. It is also useful to note that the required initial data is readily available if the simulation is resumed using the same algorithm. \subsection{Summary of the simulation algorithms} The simulation algorithms for the frictionless and frictional case are summarized in \fref{signalFlowPlan}. Recall that an active set strategy is used; \ie, the terms $\Wb$, $\mm g$, $\mm \lambda$ \etc are restricted to the active set. The global implicit algebraic inclusion problem in the contact forces is solved using an augmented Lagrangian approach, as described in \ref{asec:AL}. \section{Massless boundary Component Mode Synthesis\label{sec:masslessCMS}} The algorithms proposed in \sref{timestepping} can be applied directly to a finite element model, provided that the mass has been accordingly redistributed. Appropriate methods for this have been mentioned in the introduction. We propose a convenient alternative, namely to achieve a massless boundary during the construction of the reduced-order model using appropriate component mode synthesis. This has the important benefit that standard finite elements can be used for the initial model. Also, component mode synthesis is capable of reducing the computational effort of vibro-impact processes substantially, without significantly sacrificing the accuracy, as discussed further in \sref{discuss}. We consider both a free-interface (MacNeal) and a fixed-interface (Craig-Bampton) component mode synthesis technique. It is expected that the former is better suited for initially open contacts, while the latter is better suited for preloaded contacts. The Craig-Bampton method is by far the most popular Component Mode Synthesis method \cite{klerk2008}. The MacNeal and the Rubin method also addressed in this work are by far the most popular free-interface techniques\footnote{The exact dual of the Craig-Bampton method (in a linear framework!) would rely on a substructure coupling via forces rather than displacements \cite{rixe2004}, which is not applicable to the proposed nonlinear contact algorithm.}. Both methods rely on splitting the vector of coordinates $\qq$ into boundary coordinates $\qqb$ and inner coordinates $\qqi$, \e{ \qq = \vector{\qqb\\ \qqi} \simeq \mm R \vector{\qqb \\ \mm\eta} = \mm R \qtil \fk \label{eq:partitioning} } and approximating these in terms of component modes (columns of matrix $\mm R$) and associated coordinates. For the ease of contact treatment, the boundary coordinates $\qqb$ are retained, while the inner coordinates are replaced by a reduced set of generalized coordinates $\mm\eta$. All Component Mode Synthesis methods discussed in this paper (standard and massless Craig-Bampton, Rubin, MacNeal) have in common that they capture the static flexibility with respect to loads applied at the boundary in an exact way. \\ In the case of linear contact kinematics, it can be shown that a regular transform to relative coordinates, \ie, the contact gaps, is always possible. With appropriate sorting, the matrix $\Wb$ in \eref{aeq} and \eref{ckinematics} is then the identity matrix. It is proposed to carry out such a coordinate transform prior to applying component mode synthesis, as this is known to improve the modal convergence. The global problem is then mathematically equivalent to that of a single body with contact to a rigid foundation. It is thus sufficient to discuss the method in terms of a model described by a single pair of stiffness and mass matrices, $\mm K$ and $\mm M$, partitioned in accordance with \eref{partitioning}. \subsection{MacNeal method} MacNeal's hybrid synthesis method is a free-interface technique \cite{macn1971}. It is well-known that the MacNeal method yields a singular mass matrix, where no inertia is associated with the boundary coordinates. To the authors' knowledge, however, the potential benefits of this property for the simulation of vibro-impact processes are still unknown. For completeness, the MacNeal method is briefly described in the following. \\ In the MacNeal method, the component modes are a subset of free-interface normal modes and residual flexibility attachment modes. The free interface normal modes $\mm\phi_k$ with associated natural frequency $\omega_k$ are determined from the eigenvalue problem \e{ \left(\mm K - \omega_k^2\mm M \right)\mm\phi_k = \mm 0\fk \quad \mm\phi\tra_k\mm M\mm\phi_k = 1\fk } and are assumed to be normalized with respect to the mass matrix $\mm M$. The set of $\nmod$ lowest-frequency modes, $\mm \Phi = \left[\mm\phi_1,\ldots,\mm\phi_{\nmod}\right]$ is retained. The retained normal modes should cover the relevant frequency range of the response. In the linear case, the frequency range of the response corresponds to that of the excitation, so that the modal truncation is usually a straight-forward task. In the nonlinear case, the nonlinear forces generally generate higher frequencies so that the cutoff frequency might have to be much higher than the highest relevant excitation frequency. \\ The flexibility matrix is denoted as $\mm F$ and defined as the inverse of the stiffness matrix, $\mm F = \mm K\inv$. The $j$-th column of $\mm F$ represents the static deflection due to a unit load applied at the $j$-th element of $\qq$. The columns of $\mm F$ corresponding to all boundary coordinates $\qqb$ are determined. The associated upper and lower sub-matrices are denoted as $\mm F_{\mathrm{bb}}$ and $\mm F_{\mathrm{ib}}$, respectively. The corresponding residual flexibility sub-matrices can then be expressed as \ea{ \vector{ \mm F_{\mathrm{bb}}^\prime \\ \mm F_{\mathrm{ib}}^\prime } = \vector{ \mm F_{\mathrm{bb}} \\ \mm F_{\mathrm{ib}} } - \mm\Phi \diag\left(\frac{1}{\omega_k^2}\right)\mm\Phi\tra_{\mathrm b} \fp } $\mm\Phi_{\mathrm b}$ is the upper part of matrix $\mm \Phi$ associated with the boundary $\qqb$, while $\mm\Phi_{\mathrm i}$ is the lower part associated with the inner coordinates $\qqi$. \\ The matrix of component modes is \e{ \mm R = \matrix{cc}{ \eye & \mm 0 \\ \mm F_{\mathrm{ib}}^\prime\left(\mm F_{\mathrm{bb}}^\prime\right)\inv & \mm\Phi_{\mathrm i} - \mm F_{\mathrm{ib}}^\prime\left(\mm F_{\mathrm{bb}}^\prime\right)\inv\mm\Phi_{\mathrm b} }\fp } Herein, $\eye$ denotes the identity matrix (of proper dimension), $\mm F_{\mathrm{bb}}^\prime$ and $\mm F_{\mathrm{ib}}^\prime$ are the corresponding partitions of the residual flexibility matrix, and $\mm\Phi_{\mathrm b}$ and $\mm\Phi_{\mathrm i}$ are the corresponding partitions of the matrix containing the truncated set of free-boundary mode shapes as columns. The MacNeal method relies on the following reduced mass and stiffness matrices: \ea{ \Mtil = \matrix{cc}{\mm 0 & \mm 0 \\ \mathrm{sym.} & \eye}\fk \quad \Ktil = \matrix{cc}{\left(\mm F_{\mathrm{bb}}^\prime\right)\inv & - \left(\mm F_{\mathrm{bb}}^\prime\right)\inv \mm\Phi_{\mathrm b} \\ \mathrm{sym.} & \diag\left(\omega_k^2\right) + \mm\Phi\tra_{\mathrm b} \left(\mm F_{\mathrm{bb}}^\prime\right)\inv\mm\Phi_{\mathrm b}}\fp \label{eq:MacNeal} } Apparently, the MacNeal method readily yields a massless boundary model, with a very simple form of the mass matrix, which is amenable to the simulation procedures developed in \sref{timestepping}. \\ It should be noted that $\Ktil = \mm R\tra \mm K\mm R$. Using $\Mtil = \mm R\tra \mm M\mm R$ instead of the relation in \eref{MacNeal} yields the \emph{Rubin method}. In the case of the Rubin method, $\Mtil$ is positive definite, which corresponds to a conventional, mass-carrying boundary model. The Rubin method serves as a reference in one of the numerical examples. Defining the reduced matrices as quadratic product with $\mm R$ can be shown to be consistent with the Galerkin requirement that the error made by the approximation $\qq=\mm R\qtil$ should be orthogonal with respect to the component modes. Hence, the Rubin method is a Galerkin method, in contrast to the MacNeal method, which is why the MacNeal method is sometimes called \emph{inconsistent}. In the MacNeal method, the mass that should be carried by the residual flexibility attachment modes is neglected. Consequently, the MacNeal method describes the dynamic stiffness less accurately than the Rubin method, particularly if only a small number of modes, $\nmod$, is retained. On the other hand, the mass-deficiency with respect to the boundary makes the MacNeal method attractive for dynamic contact problems. \\ If rigid body motion is possible, the stiffness matrix $\mm K$ is singular, and the MacNeal method cannot be applied directly. One means to overcome this is to prevent rigid body motion by adding some artificial stiffness \eg to the boundary, apply the MacNeal method, and subtract the same stiffness term again after the reduction. \subsection{Massless Craig-Bampton method} As opposed to the MacNeal method, the standard Craig-Bampton method does not yield a massless boundary \cite{crai1968}. Indeed, if the parent model has a positive definite mass matrix, as in the case of a standard finite element model, the Craig-Bampton method preserves the positive definiteness. In the following, we briefly recap the standard Craig-Bampton method and suggest adjustments to enforce a massless boundary. A similar procedure has been proposed in \cite{sher2013}. \\ In the Craig-Bampton method, the matrix of component modes is \ea{ \mm R = \matrix{cc}{ \eye & \mm 0 \\ \mm \Psi & \mm\Theta}\fk \label{eq:CB} } where $\mm \Theta$ denotes the set of $\nmod$ lowest-frequency fixed-interface normal modes (restricted to the inner coordinates), and the first columns correspond to the static constraint modes with $\mm\Psi = -\mm K\inv_{\mathrm{ii}}\mm K_{\mathrm{ib}}$. Concerning the modal truncation, what was stated about the MacNeal method still applies. The $j$-th column of $\mm\Psi$ represents the static deflection of $\qqi$ due to unit displacement imposed at the $j$-th element of $\qqb$ (with the other boundary coordinates fixed). The reduced mass and stiffness matrices satisfy $\Mtil = \mm R\tra\mm M\mm R$ and $\Ktil = \mm R\tra\mm K\mm R$, and can be expressed as \ea{ \Mtil = \matrix{cc}{\Mtil_{\mathrm{bb}} & \Mtil_{\mathrm{bi}} \\ \mathrm{sym.} & \eye} \fk \quad \Ktil = \matrix{cc}{\Ktil_{\mathrm{bb}} & \mm 0 \\ \mathrm{sym.} & \diag\left(\omega_k^2\right)} \fk \label{eq:CBred} } where $\omega_k$ are now the natural frequencies associated with the fixed-interface normal modes. In general, $\Mtil_{\mathrm{bb}}\neq \mm 0$ and $\Mtil_{\mathrm{bi}}\neq \mm 0$, so that inertia forces are associated with the boundary coordinates. \\ Now, the massless boundary is achieved in two steps: First, boundary and inner coordinates are decoupled with respect to inertia forces by a suitable regular coordinate transform. Second, the mass associated with the boundary coordinates is removed. For the first step, a linear combination of the fixed-interface normal modes is added to the static constraint modes, \ea{ \mm R_\alpha = \matrix{cc}{ \eye & \mm 0 \\ \mm \Psi-\mm\Theta\mm\alpha & \mm\Theta} \fp } The coefficient matrix $\mm\alpha$ is determined by the requirement that $\Mtil_{\mathrm {bi}}$ vanishes when replacing $\mm R$ by $\mm R_\alpha$. This leads to \e{ \mm\alpha =\mm\Theta\tra\left( \mm M_{\mathrm{ib}} + \mm M_{\mathrm{ii}}\mm\Psi\right)\fp } This, in turn, leads to the reduced mass and stiffness matrices \ea{ \Mtil = \matrix{cc}{\Mtil_{\mathrm{bb}}^* & \mm 0 \\ \mathrm{sym.} & \eye} \approx \matrix{cc}{\mm 0 & \mm 0 \\ \mathrm{sym.} & \eye} \fk \quad \Ktil = \matrix{cc}{\Ktil_{\mathrm{bb}}^* & \Ktil_{\mathrm {bi}}^* \\ \mathrm{sym.} & \diag\left(\omega_k^2\right)} \fp \label{eq:CBdec} } Thanks to the linear independence of the component modes, the reduced model in \eref{CBdec} is fully equivalent to that of the standard Craig-Bampton method. Apparently, boundary and inner coordinates are now decoupled with respect to inertia forces, but an elastic coupling is now present. The exact opposite is the case in the standard Craig-Bampton method (\eref{CBred}). \\ The second step now consists in simply neglecting the inertia forces associated with the new set of boundary coordinates by setting $\Mtil_{\mathrm{bb}}^*=\mm 0$. The resulting reduced mass matrix is identical to that obtained by the MacNeal method (\eref{MacNeal}). As the inconsistency is introduced only in the inertia terms, the static flexibility with respect to the boundary is still exactly captured. Moreover, the fixed-interface normal modes are still exactly represented. However, the free-interface dynamics is less accurately modeled, and can be expected to converge more slowly with the number of retained fixed-interface modes, as compared with the standard Craig-Bampton method. \subsection{Discussion of model order reduction and computational speed-up}\label{sec:discuss} It is useful to discuss the model order reduction achieved for typical vibro-impact processes. State-of-the-art finite element models of single-body problems often comprise a number of $10^5$–$10^7$ nodal degrees of freedom. Such a fine spatial discretization is often needed to accurately resolve the oscillatory stresses at critical locations and to predict the effect of intricate geometrical features on the higher-frequency normal modes. Assuming that the body is bulky and the contact area has a simple geometry, or the body is slender and the contact area is small compared to the overall surface, the contact interface comprises typically $10^2$–$10^3$ number of nodal degrees of freedom. The mathematical model order obtained using component mode synthesis as described in \sref{masslessCMS} (MacNeal or (massless) Craig-Bampton method) equals the number of degrees of freedom at the contact boundary, plus a number of retained normal vibration modes. Modes up to a reasonably high frequency need to be retained to accurately resolve the wave propagation. The highest natural frequency increases approximately linearly with the modal truncation order. As shown in \cite{Seifried.2010}, less than $10^2$ normal modes are sufficient in most cases to accurately resolve the elastodynamics following an impact event. With this, the model order is reduced by 2 to 5 orders of magnitude. As explained, this goes along with a substantial reduction of the highest relevant frequency, so that larger time steps are appropriate in the numerical integration. In this way, the smaller model order leads to reduced computational burden both by allowing larger time steps and by decreasing the effort of the linear algebra operations. It must be emphasized, however, that sparsity is generally lost by the proposed model order reduction techniques. That is why the computational speed-up will not simply be the ratio of the model orders. \section{Similarities and differences to the quasi-static treatment of the high-frequency modes} It has been proposed by other researchers to improve the simulation of impact problems by treating the high-frequency modes quasi-statically \cite{Tschigg.2018,Sherif.2012}. Hence, the inertia associated to the high-frequency modes is neglected. This is somewhat similar to the idea proposed in the present work. An important benefit of the proposed approach is that no empirical criterion is needed to divide the dynamics into high- and low-frequency part, but this division follows immediately from the definition of the contact boundary and the finite element discretization. Also, the proposed approach does not require to solve the eigenvalue problem of the reduced system (to sort the modes by frequency). \section{Numerical results\label{sec:results}} The computational performance of the approach developed in \sref{timestepping} is now assessed for a series of benchmarks: (1) a one-dimensional bar dropped on a rigid ground, (2) a harmonically driven three-dimensional plate under frictionless contact, and (3) a rotating blade undergoing frictional impacts with an oval casing. The proposed approach is compared against state-of-the-art methods. For each benchmark, we also compared MacNeal method with the massless Craig-Bampton method. In full agreement with other studies in linear \cite{klerk2008} and nonlinear \cite{bata2007} structural dynamics, we found that both methods overall perform similarly well. The free-interface (MacNeal) method usually performs slightly better for initially open contacts, whereas the fixed-interface (massless Craig-Bampton) method performs slightly better for preloaded contacts. The results of the direct comparisons are not show for brevity. \subsection{One-dimensional bar dropped on rigid ground} \label{sub:unidimensional_bar} The bouncing bar is a common benchmark to assess computational methods for elastodynamic contact problems \cite{Doyen.2011,Dabaghi.2014,Dabaghi.2016,Schreyer2016,Dabaghi.2019}. An important benefit of this benchmark is that an exact solution of the time- and space-continuous problem is available \cite{Doyen.2011}. The problem setting is illustrated in \fref{ex1_fig_pogo}. The bar with density $\rho$, Young's modulus $E$ and length $\ell$ is released, without initial deformation or velocity, from height $q_0$, under gravity (imposed acceleration $a_g>0$) The displacement $q(x,t)$ of the bar is governed by the equations \ea{ \rho \left(\ddot q+a_g\right) - E\frac{\partial^2 q}{\partial x^2} - \lambda = 0 \quad x\in [0,\ell]\fk\,\, t\in \mathbb R^+\fk \label{eq:barEoM}\\ q\left(0,t\right) \geq 0\fk \quad \lambda \geq 0\fk \quad \lambda~q\left(0,t\right) = 0 \fk\label{eq:barCon} \\ \frac{\partial q}{\partial x}\left(\ell,t\right) = 0 \fk \label{eq:barBC} \\ q(x,0) = q_0\fk \quad \dot q(x,0) = 0 \fp \label{eq:barIC} } Herein, overdot denotes derivative with respect to time $t$. The spatial coordinate $x$ refers to the undeformed configuration. \eref{barEoM} is a one-dimensional wave equation. \erefs{barCon} describe the unilateral contact between the bar's lower end and the rigid ground, where the Lagrange multiplier $\lambda$ can be interpreted as normal contact pressure (force per unit cross section). \eref{barBC} describes the free boundary condition at the bar's upper end. \erefs{barIC} specify the initial conditions at time $t=0$. \fig[t]{ex1_fig_pogo}{One-dimensional bar dropped on rigid ground}{0.2} \fig[th!]{ex1_plot_newTIdisp_dt4_DISP}{Displacement $q_{\mathrm b}$ of the bar's lower boundary: (a) initial time range, (b) later time range, (c) zoom into first contact phase}{1.0} \\ The parameters are specified as $\rho=1$, $E=900$, $\ell=10$. Upon release, the bar falls freely until it makes contact with the ground. The contact occurs with a finite duration, and initiates a shock wave which propagates with the speed $c= \sqrt{E/\rho} = 30$ through the bar. At a certain time, the contact is released and the bar lifts up again. The resulting displacement during the free-flight phase is a superposition of a rigid body motion with parabolic time-dependence and elastic vibrations. The initial height and gravity acceleration were selected such that this bouncing behavior is time-periodic \cite{Doyen.2011}. For the numerical solution, we first discretize the problem domain with a uniform mesh of finite elements with linear shape functions (element length $\Delta x=10^{-2}$). We then apply the massless and the standard Craig-Bampton method to obtain a reduced massless and mass-carrying boundary model, respectively, using a single static constraint mode associated with the boundary coordinate $q_{\mathrm b}(t)=q(0,t)$ and retaining the $20$ lowest-frequency fixed-interface normal modes. The simulation is carried out using the time step integration schemes described in \sref{timestepping} and \ref{asec:SymMoreau}, respectively. In the mass-carrying case, a coefficient of restitution needs to be specified in accordance with Newton's impact law. For the one-dimensional problem here, this coefficient determines the ratio between post- and pre-impact normal velocities of the boundary node. We show results for the extreme cases of $\CoR=0$ and $\CoR=1$. A time step of $\Delta t = 10^{-4}$ is used for both time stepping schemes, corresponding to a Courant number of $c\Delta t/\Delta x=0.3$ \\ \fig[t]{ex1_plot_newTIdisp_dt4_ENER}{Evolution of total energy $E_{\mathrm{tot}}$, energy in rigid body modes $E_{\mathrm{rb}}$ and energy in elastic modes (vibration energy) $E_{\mathrm{el}}$ over a longer time range; from top to bottom: exact solution, massless Craig-Bampton method, standard Craig-Bampton method with coefficient of restitution $\CoR=0$, standard Craig-Bampton method with coefficient of restitution $\CoR=1$}{1.0} The time evolution of the boundary displacement $q_{\mathrm b}$ is depicted in \fref{ex1_plot_newTIdisp_dt4_DISP}. Both numerical methods agree well with the exact reference during the first few bounces. The discrepancy grows with time. The proposed massless boundary approach predicts the long-term behavior of recurrent bounces with comparable height in a qualitatively correct way. Apparently, a small deviation in terms of the time period of the bouncing process is present, which we attribute to the removed mass. In contrast to the proposed approach, the mass-carrying boundary model does not predict the long-term bouncing behavior correctly; after some time, the boundary node does not lift up significantly anymore. \\ \fref{ex1_plot_newTIdisp_dt4_ENER} depicts the time evolution of the total energy, $E_{\mathrm{tot}}$, and the individual contributions of energy contained in rigid body modes, $E_{\mathrm{rb}}$, and energy contained in elastic modes (vibration energy), $E_{\mathrm{el}}$. Setting the restitution coefficient to $\CoR=0$ leads to artificial loss of energy. At each impact, the kinetic energy of the boundary node is erased. The energy decay goes on until there is no energy left for the dynamic process (\fref{ex1_plot_newTIdisp_dt4_ENER}c). The remaining potential energy in the rigid body modes has to be attributed to the zero level of the potential energy in the gravity field, which is arbitrarily set to $x=0$. Even in the static limit case, this energy would be larger than zero since the center of gravity is located at about $x=\ell/2$ (actually slightly below this, as the bar is compressed by its gravity load). For $\CoR=1$, the total energy is conserved. However, the finite mass at the boundary gives rise to spurious high-frequency oscillations, while the continuum model of the bar is in permanent contact for a finite time. Consequently, the energy is rapidly transferred to elastic energy (vibrations). \\ The results were also computed for $\Delta t = 10^{-3}$ and $\Delta t = 10^{-2}$, corresponding to a Courant number of $3$ and $30$, respectively. The mass-carrying boundary approach became numerically unstable for the latter case. The proposed massless boundary approach remained numerically stable and still showed the same qualitative behavior (recurrent bouncing with similar height). However, the agreement with regard to the displacement time evolution was notably worse. \subsection{Forced response of three-dimensional plate under frictionless contact} \label{sub:forced_response_of_a_cantilevered_3d_fe_beam} Next, we consider a three-dimensional cantilevered plate under concentrated external loading, $f_{\mathrm{ex}}(t)$, subjected to frictionless unilateral contact with a rigid wall as illustrated in \fref{ex2_fig_beam3D01}. The dimensions of the plate are $8~\mathrm{mm}$ x $40~\mathrm{mm}$ x $150~\mathrm{mm}$. The material properties are $\rho = 8,220~\mathrm{kg}/\mathrm{m}^3$, $E=184~\mathrm{GPa}$ and $\nu = 0.33$. The body is discretized with 8 x 20 x 101 C3D8 finite elements (8-node hexahedral elements with linear shape functions). Contact is considered at three boundary nodes on one edge of the free end (\fref{ex2_fig_beam3D01}). The asymmetry of the contact constraints ensures that torsion dynamics will be relevant besides bending dynamics. The initial gap for all contact nodes is $g_0=0.1~\mathrm{mm}$. In this example, we use the MacNeal method to derive the reduced-order model, retaining the $20$ lowest-frequency free-interface normal modes and the three residual flexibility attachment modes associated with the displacements in the contact normal direction ($y$-direction) of the three boundary nodes. \fig[h!]{ex2_fig_beam3D01}{Three-dimensional plate under frictionless contact: (a) schematic illustration of geometry and contact configuration, (b) finite element model}{1.0} \\ We analyze the frequency response to a harmonic excitation with an amplitude of $1~\mathrm{N}$ and a frequency in the range near the lowest-frequency (flap-wise) bending mode. A modal damping ratio of $1\%$ was specified for all free-interface modes. We simulate the response to forward and backward frequency sweeps, and the response to constant-frequency excitation at some representative frequencies. For the sweeps, the rate is such that the excitation frequency increases linearly with time by $1.5~\%$ in 100 pseudo-periods, where a pseudo-period is defined as the period corresponding to the considered natural frequency in the linear case of open contact. In the time step integration, 500 time levels per pseudo-period were found to yield a good compromise between accuracy and efficiency. For this benchmark, we compare the proposed time integrator with a nonlinear frequency-domain approach. More specifically, we compute the periodic steady-state vibrations using the high-order harmonic balance method in conjunction with a Dynamic Lagrangian formulation to deal with the unilateral contact (without the need for regularization). The method is described in \ref{asec:HBDL}. It was implemented in the open source Matlab tool NLvib \cite{Krack.2019}. For various values of the Dynamic Lagrangian parameter in the range $\varepsilon_{\mathrm{DL}}\in \left[10^4,10^7\right]$, the method converged to practically identical results. The nominal harmonic truncation order was set to $H=20$, which was found to provide reasonable agreement with respect to the displacement and velocity of the response coordinate. \\ An overview of the frequency response is given in \fref{ex2_plot_beam_FRF_sweep_all_relative} with respect to the negative $y$-coordinate of the response node, $q_{\mathrm R}$, indicated in \fref{ex2_fig_beam3D01}. Away from resonance, the contact is open, the system behaves linearly. For sufficiently large vibrations, contact interactions occur. The temporarily closed contact provides positive stiffness, in time-average, giving rise to a hardening nonlinearity. Moreover, the unilateral interactions limit the displacement in the direction of the wall. In contrast, the displacements in the opposite direction increase further, leading to asymmetric vibrations with a non-zero mean value. Due to the hardening nonlinearity and the light damping, the amplitude-frequency curve is bent towards the right, giving rise to two turning points connected by an overhanging branch. As is well-known, the response corresponding to the overhanging branch is unstable. The upper and lower branch of periodic responses are largely stable. Looking very closely, one can find indications of a small window of non-periodic responses during the forward sweep. As expected, jump phenomena are encountered during forward and backward sweeps near the respective turning point. An excellent agreement between harmonic balance and time integration can be ascertained for $H=20$. This agreement holds also for the phase projections depicted in \fref{HBvsTI_Harmonic_convergence} in the $u_{\mathrm R}$-$q_{\mathrm R}$ plane, which were obtained for fixed excitation frequency. \fig[h!]{ex2_plot_beam_FRF_sweep_all_relative}{Frequency response of the plate under frictionless contact}{1.0} \fig[h!]{HBvsTI_Harmonic_convergence}{Phase projections of periodic steady-state vibration response for time-constant excitation frequency}{1.0} \\ As there is no rigorous theory available for the considered problem class of non-smooth, high-dimensional models, various method parameters had to be specified based on experience. In particular, numerous different settings of the nominal step length in the pseudo arc-length continuation, the preconditioning properties, the solver tolerances and the number of time levels per period considered in the alternating frequency-time scheme were tested before the entire depicted solution branch was successfully computed. A number of $N=2^{12}$ time levels (samples) per period was found to be necessary. This is about 8 times larger than the number of time levels per period in the time step integration. Apparently, this is due to non-smooth contact interactions, where the Fourier-based harmonic balance method suffers from the Gibbs phenomenon. Consequently, a high number of significant harmonics is present in the nonlinear forces. Thus, a relatively high number of samples is needed to reduce the inevitable aliasing errors, which may otherwise lead to convergence problems of the Newton-like solver. In contrast to harmonic balance, the time integrator does not suffer from aliasing. The avoidance of the spurious oscillations (Gibbs phenomenon) permits relatively large time steps. The computational difficulties of harmonic balance for this benchmark naturally lead to a high computational effort. Harmonic balance required about 90 minutes to compute the depicted frequency response branch. Compared to this, the time integration of a sweep (either forward or backward) took only about 4 minutes. Based on further investigations on the same benchmark, considering different excitation levels, different resonances, different method parameters, we are convinced that these orders of magnitude of the computational effort are representative. This result is particularly interesting, because harmonic balance is usually orders of magnitude faster than time integration \cite{Krack.2019}. For vibro-impact processes, apparently, this is not necessarily the case. \subsection{Rotating blade in frictional contact with oval casing} \label{sec:blade_casing_rubbing} Finally, we consider a rotating turbomachinery blade subjected to frictional impacts. The technical motivation for this is that the clearance between blade tip and casing is designed to be as small as possible to improve the aerodynamic performance. An abradable coating is commonly introduced. However, if this is removed, the blade tip might come into contact with the underlying metallic casing (\emph{blade-casing rubbing}). The accurate prediction of this behavior is computationally demanding because of the degree of detail needed both for modeling the bodies and the contact interactions \cite{legr2012a,Guerin.2018,Thorin.2018}. We consider the benchmark problem illustrated in \fref{ex3_fig_bladecase_singleblade_02}. The flexibility of the disk is regarded as negligible compared to that of the blades, and the coupling among blades is neglected, so that it is sufficient to model a single blade. The geometry of the compressor blade corresponds to the NASA Rotor 37 and the finite element model is publicly available \cite{Piollet.2019}. The blade is described with C3D15 finite elements (pyramids with mid-nodes, quadratic shape functions), leading to about 62,500 nodal degrees of freedom. The material properties of the blade are $\rho=9,000~\mathrm{kg}/\mathrm{m}^3$, $E=210~\mathrm{GPa}$, and $\nu=0.3$. The metallic casing is considered as rigid, which is a common simplification. An oval geometry of the casing is considered, having a mean radius of about $317~\mathrm{mm}$, plus a sinusoidal perturbation with two waves around circumference. The resulting tip clearance is specified as \e{ g_0(t)/\mathrm{mm} = 0.356 + 0.37 \cos(2\Omega_{\mathrm{rot}} t)\fp \label{eq:g0ovalcasing} } Consequently, two contact events per revolution are expected. The angular velocity $\Omega_{\mathrm{rot}}$ is set to $\Omega_{\mathrm{rot}}=\frac{\omega_1}2$, with the lowest natural frequency $\omega_1/(2\pi)$ being $312.12~\mathrm{Hz}$. Contact is considered at the 16 nodes indicated in \fref{ex3_fig_bladecase_singleblade_02} right. In the contact normal direction, unilateral interactions are modeled in terms of the Signorini law. In the tangential contact plane, dry friction is modeled in terms of the spatial Coulomb law with a friction coefficient of $\mu=0.15$. The rotation of the blade relative to the casing is considered by an imposed velocity in the respective tangential direction. The Rubin method is commonly used in state-of-the-art simulations of blade-casing contact interactions \cite{legr2012a,bata2007}. Hence, we use the Rubin method and the proposed MacNeal method to derive a mass-carrying and a massless boundary reduced order model, respectively. Here, the 50 lowest-frequency free-interface normal modes are retained, along with the $3\cdot16=48$ residual flexibility attachment modes associated with all three degrees of freedom of the 16 contact nodes. A modal damping ratio of $D=0.5\%$ is specified for all retained free-interface modes. The simulation is carried out using the time step integration schemes described in \arefo{SymMoreau} and \sref{timestepping}, respectively. In the mass-carrying case, the restitution coefficient is set to $\CoR=0.99$. For $\CoR=1.0$, we did not find any method parameters that ensured numerical stability and provided reasonable accuracy. It should be remarked that $\CoR=0$ is also a common choice for blade-casing interactions when using Moreau-like integrators \cite{Guerin.2018,Thorin.2018}. We prefer a value closer to unity in order to avoid non-physical loss of energy. \fig[h!]{ex3_fig_bladecase_singleblade_02} {Rotating blade in frictional contact with oval casing: (a) schematic illustration of geometry and contact configuration, (b) finite element model with contact and response nodes}{1.0} \\ The time evolution of the radial displacement at the response node, $q_{\mathrm{R}}$, is depicted in \fref{ex3_COMP_REFoverviewNtd50000_RELATIVE} for the case of zero initial displacement and velocity. Here, a rather fine time discretization with $N=50,000$ time levels per revolution was used, corresponding to $\Delta t=2\pi/(N\Omega_{\mathrm{rot}})$. Massless and mass-carrying boundary models are in excellent agreement. \fig[h!]{ex3_COMP_REFoverviewNtd50000_RELATIVE} {Time evolution of the response coordinate, : (a) overview, (b) zoom into initial phase, (c) zoom into steady-state phase; simulation with $N=50,000$ time levels per revolution}{1.0} \\ Next, we analyze the convergence behavior of both numerical methods with the number of time levels. As error measure, we use the relative root-mean-square deviation, \e{ \varepsilon_{\mathrm{RMS}} = \sqrt{\frac{\sum\limits_{k} \left|q_{\mathrm R}^k - q_{\mathrm R,\mathrm{ref}}^k\right|^2}{\sum\limits_{k} \left|q_{\mathrm R,\mathrm{ref}}^k\right|^2}}\fp \label{eq:erms} } As reference, $q_{\mathrm R,\mathrm{ref}}$, the result for $N=50,000$ time levels per revolution is considered. Here, the \emph{respective reference} is taken, \ie, the result of the massless boundary method is compared to the result of the massless boundary method with finest time discretization, and analogously for the mass-carrying boundary method. We limit the analysis to the time span of the first five revolutions as illustrated in \fref{ex3_COMP_REFoverviewNtd50000_RELATIVE}b. The results are depicted in \fref{ex3_COMP_performance}a. \fig[h!]{ex3_COMP_performance} {Comparison of the massless and mass-carrying boundary methods in terms of convergence and computational effort: (a) error vs. time levels per revolution, (b) computational effort vs. time levels per revolution. The red square and the orange diamond correspond to the low and the medium $N$ depicted in \fref{ex3_COMP_3lines_BOTH}, respectively. }{1.0} \fig[h!]{ex3_COMP_3lines_BOTH} {Time evolution of the response coordinate for the initial phase: (a) massless boundary method, (b) mass-carrying boundary method. Results are shown for the largest stable time step (red, solid), largest time step leading to an error $\varepsilon_{\mathrm{RMS}}<1~\%$ (orange dash-dotted), and the reference (green, dashed). }{1.0} The respective first point in the graphs (marked by a red square) corresponds to the largest (numerically) stable time step. For the massless boundary method, $N=25$ is sufficient, while for the mass-carrying boundary method, $N=475$ time levels per revolution are needed. While the error initially decays more rapidly in the mass-carrying boundary case, the error does not further decrease below $\varepsilon_{\mathrm{RMS}}\approx 8\cdot 10^{-3}$. We attribute this to a slight numerical instability on the short time scale, associated with the spurious high-frequency oscillations. In contrast, the overall error level is much lower in case of the massless boundary method and decays almost monotonously far below $\varepsilon_{\mathrm{RMS}}=10^{-3}$. \\ The computational effort is depicted in \fref{ex3_COMP_performance}b in terms of wall time needed for the time span of the first 50 revolutions as illustrated in \fref{ex3_COMP_REFoverviewNtd50000_RELATIVE}a. To ensure that the error is $\varepsilon_{\mathrm{RMS}}<1~\%$, the massless boundary method requires $N=200$, while the mass-carrying boundary method requires $N=1,500$ time levels per revolution. The corresponding points are marked by orange diamonds in \fref{ex3_COMP_performance}. The time evolution of the response coordinate is depicted in \fref{ex3_COMP_3lines_BOTH} for three different time steps: the largest stable time step, the time step leading to $\varepsilon_{\mathrm{RMS}}<1~\%$ and the finest time step (reference). The results for $\varepsilon_{\mathrm{RMS}}<1~\%$ and the reference are indistinguishable for both methods. The wall times for $\varepsilon_{\mathrm{RMS}}<1~\%$ are $110~\mathrm s$ in the case of the massless and $2400~\mathrm s$ in the case of the mass-carrying boundary method, corresponding to a speedup by a factor of more than 20. As one may infer from \fref{ex3_COMP_3lines_BOTH}a, the result obtained using the massless boundary method for the largest stable time step ($N=25$) already gives excellent accuracy. The speedup compared to the mass-carrying boundary method is then about 100. \section{Conclusions}\label{sec:conclusions} Overall, the proposed approach was shown to offer superior convergence and numerical robustness. For the benchmarks considered in this work, the approach reduced the computational effort by about 1-2 orders of magnitude compared to the conventional mass-carrying boundary method. In this comparison, the mass-carrying boundary method also relies on component mode synthesis and thus leads to the same mathematical model order. We expect that the speedup over the initial finite element model is several orders of magnitude more, in spite of the loss of sparsity, but this still needs to be assessed. We conclude that the approach is particularly well-suited for long-term simulations of elastodynamic contact problems, for instance vibro-impact processes.
{'timestamp': '2021-11-16T02:31:55', 'yymm': '2111', 'arxiv_id': '2111.07693', 'language': 'en', 'url': 'https://arxiv.org/abs/2111.07693'}
arxiv
\section{Introduction} \label{sec:intro} High-assurance systems require compelling evidences to show that their delivered services satisfy critical properties, e.g. security and safety \cite{mclean95}. If high-assurance systems fail to meet their critical requirements, it could result in security breaches, loss of lives, or significant property damage. Due to the criticality of such systems, it is highly desired that they are developed in a rigorous process. The avionics community has developed a set of guidelines for the rigorous development of safety-critical systems, e.g., DO-178B/C \cite{DO178B,DO178C}. Whilst the Common Criteria (CC) \cite{CC} provides guidelines for security-critical systems. In high-assurance systems, Trusted Computing Base (TCB) \cite{tcb85} is defined as: ``A small amount of software and hardware that security depends on and that we distinguish from a much larger amount that can misbehave without affecting security \cite{lampson92}''. The concept of \emph{separation kernel} is introduced \cite{Rushby81} to dissociate the kernel verification from the verification of trusted code belonging to separated components. The main purpose of separation kernels is to enforce the separation of all software components while reducing the size of the TCB. Security is carried out partly by separating physically system components, and partly by means of trusted functionality accomplished within some of those components being separated. The concept of separation kernel originates the Multiple Independent Levels of Security/Safety (MILS) \cite{Alves06} which is a high-assurance security/safety architecture based on separation \cite{Rushby81} and controlled information flow \cite{Denning76}. Separation kernels first came into use in the avionics domain, with the acceptance of Integrated Modular Avionics (IMA) \cite{Parr99} in this domain in the 1990s. A significant foundation of IMA is the separation of system resources into isolated computation spaces -- called \emph{partitions}. Separation kernels are adopted as \emph{partitioning kernels} \cite{pkpp}, which mainly concerns safety. Separation kernels can be considered as a fundamental part of high-assurance systems. As a part of the TCB, separation kernels are small enough to allow formal verification of their correctness. The increasing evidences show successful applications of formal methods on software development, not only as theoretical research in the academy, but also deployed in industrial applications \cite{Woodcock09}. Traditionally, certified security is achieved by CC evaluation \cite{CC}, in which formal methods are mandated for highest assurance levels. It requires comprehensive security analysis using formal representations of the security model and functional specification as well as formal proofs of correspondence between them. In particular, the Separation Kernel Protection Profile (SKPP) \cite{SKPP07} is an instantiated profile of CC for separation kernels. Safety is usually governed by RTCA DO-178B \cite{DO178B} whose successor DO-178C \cite{DO178C} published in 2011 includes a technology supplement of formal methods. Due to the wide application of high-assurance systems, applying formal methods on separation kernels has not only been a hot research topic since the concept emerged, but also attracted industrial concerns. Although more than 20 implementations have been developed in industry or academia, and furthermore formal methods have been applied on some of them for the purpose of CC and DO-178B/C certification, high-assurance separation kernels still face challenges \cite{barhorst09,alan15,dmils14}. The approaches and techniques of formal methods for separation kernels are numerous, but the topic lacks a state of the art survey and a comprehensive taxonomy to ease the application of formal methods over them. It is therefore significant and urgent to have a thorough and comprehensive study on this topic to provide a useful reference for further research and industrial applications. To the best of our knowledge, our work is the first to systematically overview, categorize, analyze and discuss formal methods application on separation kernels. This paper aims at distilling the landscape in the field of formal methods application on separation kernels by studying, classifying, comparing, and analyzing related work for the purpose of figuring out challenges and potential research directions in future. Specifically, we present the following contributions in this paper: (1) We propose an analytical framework to understand and classify related work. In the framework, we clarify a set of concepts related to separation kernels, define a reference architecture, compare implementations, study critical properties and related standards, and then identify an application schema of formal methods for separation kernels. The analytical framework is the foundation of this survey. (2) We propose a taxonomy of applying formal methods on separation kernels according to the analytical framework. The first level of the taxonomy is designed according to the application schema of formal methods. The lower levels are based on the reference architecture and critical properties. Then, we group together the related work according to the taxonomy. (3) We present a detailed analysis and discussion of the related work. We compare formal methods and certifications used in a comprehensive set of implementations. The importance of functionalities in the reference architecture is identified in formal specifications and models. Relations among critical properties are clarified. The verified properties, used approaches, and sizes of research works on formal verification are compared. Then, we give an overall comparison of them according to the taxonomy. (4) We discuss the challenges of applying formal methods on separation kernels and figure out potential research directions in this field. We identify four challenges, i.e., eliminating specification bottleneck, automating full formal verification, multicore and concurrency, and formal development and code generation. Then, we propose technical directions to address each challenge in future. Compared to our previous work \cite{zhao16c}, contributions (1), (3), (4) and the proposed taxonomy in contribution (2) in this paper are new. The detailed description of research works in \cite{zhao16c} is reorganized by the taxonomy and shortened to a brief overview of related work in contribution (2). The previous work is also extended by the research works of two new categories under the taxonomy. The rest of this paper is organized as follows. {{Section}} \ref{sec:analy_frm} presents the analytical framework. {{Section}} \ref{sec:tax} presents the taxonomy and overview of research works in the literature. In {{Section}} \ref{sec:analy_disc}, we analyze and discuss the research works through comprehensive comparisons. {{Section}} \ref{sec:chlg} identifies challenges and potential technical directions in this field. Finally, {{Section}} \ref{sec:concl} gives the conclusion of this survey. \section{Analytical Framework} \label{sec:analy_frm} In this section, we present an analytical framework for separation kernels. The framework is the foundation of the taxonomy, analysis and discussion in the next sections. First, we clarify a set of related concepts and propose a reference architecture for separation kernels in which common and optional components are identified. Second, we survey implementations from industry and academia. Third, we classify critical properties of separation kernels and survey related standards. Finally, we sketch out an application schema of formal methods for high-assurance separation kernels. \subsection{Concepts and Reference Architecture} \label{ssec:cncpt_sk} \begin{figure} \centerline{\includegraphics[width=2.8in]{figures/fig_kernels.pdf}} \caption{Relationship of Different Types of Kernels.} \label{fig:kernels} \end{figure} We first clarify the relationship among concepts of security kernel, separation kernel, partitioning kernel, microkernel, and embedded hypervisor, which is shown in {{Fig.}} \ref{fig:kernels}. The \emph{security kernel} \cite{Ames83} is the central part of systems to implement the basic security procedures for controlling access to system resources. Security requirements of systems to be assured are specified as \emph{security policies}. A reference monitor controls the access of \emph{subjects} to \emph{resources} according to the policies. Separation kernels extend security kernels with \emph{partitions} and map exported resources into partitions. Separation kernels enforce partitions to have spatial and temporal separation, and allow subjects belonging to partitions to cause flow to transfer information among them. The \emph{partitioning kernel} \cite{Rushby00,pkpp,Leiner07} is a variant of separation kernels in the domain of IMA and concerns safe separation largely based on an ARINC 653 \cite{ARINC653p0} style separation scheme. Partitioning kernels specialize and enhance the temporal and spatial separation with a static table-driven scheduling approach \cite{Ramam94} and static resource allocation for partitions. Unlike traditional operating systems, separation kernels do not provide services such as device drivers and file systems, but a set of very specific functionalities to enforce security separation and information flow controls, in order to keep them small enough to allow formal verification of their correctness. The primary motivation of these kernels is also the one behind microkernels \cite{wulf74,Joch93,hoh04}. In terms of the source code size, these kernels are usually sizing less than 10,000 lines of code, which is the code scale of microkernels. On the other hand, with the rise of more powerful multiprocessor embedded systems, virtualization provides a promising technique to improve functionalities of high-assurance systems \cite{heiser08,agui12}. Embedded hypervisors are consequently used to implement security kernels (e.g. \cite{karger05,sailer05a,sailer05b}), separation kernels (e.g. \cite{xtratum,West16}), and partitioning kernels (e.g. \cite{vander10,han11,vander13}). \begin{figure} \centerline{\includegraphics[width=4.6in]{figures/fig_ra.pdf}} \caption{Reference Architecture of Separation Kernels.} \label{fig:sk_ra} \end{figure} Due to the increasing complexity, scale, and mixed critical requirements of high-assurance systems, various techniques and approaches are integrated \cite{barhorst09} together. From now on, we use the term {\em separation kernel} to cover the concepts of security kernel, original separation kernel, partitioning kernel, and embedded hypervisor. Based on the landscape of separation kernels, we propose a reference architecture, as shown in {{Fig.}} \ref{fig:sk_ra}, for separation kernels to provide functionalities to analyze research works. We classify the functionalities into common and optional components. \emph{Common components} represent a least set of functionalities to implement a separation kernel. \emph{Optional components} are usually supported for complex systems. Hypervisor-based separation kernels usually manage partitions (i.e., VMs) and leave process management to guest OSs. The communication mechanism supports inter- and intra-partition communication. Policies may be security, safety, real-time, and fault-tolerance policies, etc. The configuration for separation, such as memory separation configuration and scheduling windows for partitions, can also be considered in the policies. Management of hardware (e.g. clock, timer, interrupt, and memory) are necessary for hypervisor-based separation kernels. However, simple separation kernels manipulate the underlying hardware via \emph{hardware interface}. \subsection{Separation Kernel Implementations} \label{ssec:impl} Due to the wide acceptance of separation kernels, many implementations including industrial products and academic prototypes have been developed in recent years. In {{Table}} \ref{tab:impls1}, we compare twenty implementations from industry and academia. The time line in the 3rd column shows the time they started and the time they stopped development of the separation kernels. The underlying instruction set architectures (ISA) and whether they support multi-core processors are surveyed in columns 4 and 5, respectively. We also survey the development languages, the line of the code (LOC), and whether they are open-source. \begin{table}% \tbl{Comparison of Separation Kernel Implementations \label{tab:impls1}}{% \begin{tabular}{|C{0.3cm}|L{3.8cm}|C{1.0cm}|C{2.2cm}|C{0.6cm}|C{1.2cm}|C{0.6cm}|C{0.7cm}|} \hline \textbf{No} & \textbf{Name} & \textbf{Timeline} & \textbf{ISA} & \tabincell{c}{\textbf{Multi} \\ \textbf{Core}}& \textbf{Language} & \textbf{LOC} & \tabincell{c}{\textbf{Open} \\ \textbf{Source}} \\\hline \hline \multicolumn{8}{|l|}{\textbf{Industrial Implementations}} \\\hline 1&PikeOS \cite{pikeos} & {?}%{$\divideontimes$} - now & PowerPC, x86, ARM, MIPS, SPARC& \cmark & C, ASM & $<$10k & \xmark \\\hline 2&VxWorks 653 \cite{vxworks653} & {?}%{$\divideontimes$} - now & PowerPC & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 3&VxWorks MILS \cite{vxworksmils}& {?}%{$\divideontimes$} - now & PowerPC & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 4&INTEGRITY-178B \cite{integrity178b}& {?}%{$\divideontimes$} - now & ARM, x86, PowerPC, MIPS & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 5&\tabincell{l}{INTEGRITY \\Multivisor \cite{integrityvisor}} & ? - now & x86, ARM, PowerPC & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 6&LynxSecure \cite{lynxsec}& {?}%{$\divideontimes$} - now & x86 & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 7&LynxOS-178 \cite{lynxos178}& {?}%{$\divideontimes$} - now & x86 PowerPC & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 8&DDC-I Deos \cite{deos} & {?}%{$\divideontimes$} - now & x86, PowerPC, ARM, MIPS & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 9&AAMP7$^a$ \cite{aamp7g} & 2001 - now & N/A & \xmark & & {?}%{$\divideontimes$} & \xmark \\\hline 10&ED [\citeNP{Heitmeyer06};\citeyearNP{Heitmeyer08}]& 2006 - ? & {?}%{$\divideontimes$} & {?}%{$\divideontimes$} & C, ASM & $\approx$ 3k & \xmark \\\hline 11&ARLX hypervisor \cite{arlx} & {?}%{$\divideontimes$} - now & x86, ARM & \xmark & C, ASM & {?}%{$\divideontimes$} & \cmark \\\hline \multicolumn{8}{|l|}{\textbf{Academic Implementations}} \\\hline 12&seL4 [\citeNP{Murray12};\citeyearNP{Murray13}] & 2008 - now & ARM,x86 & \cmark & C, ASM & $\approx$ 9k & \cmark \\\hline 13&OKL4 Microvisor \cite{okl4mv} & 2009 - now & ARM & \cmark & C, ASM & {?}%{$\divideontimes$} & \cmark \\\hline 14&XtratuM \cite{xtratum}& 2004 - now & SPARC, x86, PowerPC, ARM & \cmark & C, ASM & $\approx$ 9k & \cmark \\\hline 15&PROSPER \cite{prosper}& 2012 - now & ARM & \xmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 16&Xenon \cite{freit11} & 2011 - {?}%{$\divideontimes$} & x86, ARM, PowerPC & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 17&Quest-V \cite{West16} & 2012 - now & x86 & \cmark & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline 18&Muen \cite{muen} & 2013 - now & x86 & \cmark & SPARK, ASM & $\approx$ 4k & \cmark \\\hline 19&POK \cite{pok} & 2009 - 2013 & PowerPC, SPARC, x86 & \xmark & C, ASM & $\approx$ 7k & \cmark \\\hline 20&AIR/AIR II \cite{air} & 2007 - 2011 & SPARC & {?}%{$\divideontimes$} & C, ASM & {?}%{$\divideontimes$} & \xmark \\\hline \end{tabular}} \begin{tabnote}% \Note{{?}%{$\divideontimes$}} {means we do not find any literature to show the evidence.} \vskip2pt \tabnoteentry{$^a$}{This is a processor, a hardware implementation of separation kernel.} \end{tabnote}% \end{table} By comparing these implementations, we have the following findings. \begin{itemize} \item Most of the separation kernels are still in use and developing. Very few open-source projects have stopped. \item In order to provide safety/security critical solutions, various ISAs are supported by separation kernels, in particular ARM, SPARC, and PowerPC. Multicore processors are increasingly deployed in safety/security critical systems to fulfil the demand of processing power in integrated systems. Therefore, multicore processors are supported by most of separation kernels regardless of in industry and academia. \item The LOC of separation kernels that we can find in the literature is less than ten thousand. Most of implementations adopt microkernels as the foundation and shift out the complex services into system partitions. For the sake of portability and efficiency, separation kernels in particulars are written in the C programming language embedded with pieces of ASM. Moreover, separation kernels in academia are usually delivered in open-source projects. \item With the trend of integrating applications on one computing platform (e.g., IMA), native interference provided by separation kernels is often not powerful for application development. The embedded hypervisor is currently a mainstream form of separation kernels in industry and academia. Virtual machine management provides a straightforward approach for the spatial separation of resources. Moreover, embedded hypervisors virtualize general-purpose operating systems (e.g., Linux) in partitions and permit the deployment of legacy applications. \end{itemize} \subsection{Critical Properties and Standards} \label{ssec:cr_prop} Traditionally, critical properties of high-assurance systems are safety, security, real-time, and fault-tolerance \cite{mclean95,rushby94}. Different from the classical categories of critical properties, \emph{NEAT} are well known properties considered in separation kernels, which stands for ``Non-bypassable, Evaluatable, Always invoked and Tamper'' proof \cite{Van05,pkpp}. However these intuitive concepts are not easy to formalize nor to provide direct proofs. Instead, separation kernels are normally verified by formally showing that they provide the right functionalities for MILS systems according to the following critical properties \cite{Alves06,Van05,Rushby00}, which is called \emph{DIDT} in this survey. \begin{itemize} \item \textbf{Data Separation}: Also known as `Data Isolation'', each partition is deployed as a separated resource. Applications in one partition can neither modify applications and private data in other partitions nor control private devices and actuators in other partitions. \item \textbf{Information Flow Security}: Also known as ``Control of Information Flow'', information flow between partitions is defined from a source partition, which is authenticated, to a set of receivers as well authenticated; additionally, the source is authenticated to the receivers. \item \textbf{Temporal Separation}: it allows partitions to share physical resources across different time periods. A resource is assigned to one component for a slice of time, then sanitized and assigned to another component. Services received from shared resources by applications in one partition cannot be affected by other partitions. \item \textbf{Damage Limitation}: damage is contained by restraining failures from propagating from one partition to others. \end{itemize} The properties of data separation, information flow security, and damage limitation are all spatial properties. They are collectively called ``spatial separation'' properties. Data separation requires memory address spaces/data of one partition to be independent of any other partition in the system. Information flow security is a variation of data separation. Pure data separation is not pragmatic, therefore separation kernels define authorized channels between partitions to provide inter-partition communication. Pure data isolation is permitted to be violated only through these channels. Damage limitation is achieved by other three properties since the damage to applications in one partition are limited. Due to criticality of high-assurance systems, there are mandatory verification and validation (V\&V) activities in their design and analysis process to ensure that the systems fully meet their functional requirements. Several specifications have been created to standardize activities in V\&V processes by international organizations. CC \cite{CC}, which is also the international standard ISO/IEC 15408, and SKPP \cite{SKPP07} are usually applied to security of separation kernels. Although the SKPP was sunset in 2011, NSA still recommend separation kernels for security-critical systems. As for safety, \citeN{espo13} has summarized a set of well-known safety standards for high-assurance systems. Many of them have also been applied to separation kernels. Another notable standard for separation kernels is the ARINC 653 standard \cite{ARINC653p0} which is a set of specifications to guide manufacturers in avionic application software towards maximum standardization. It aims at providing a standardized interface between separation kernels and application software, as well as the system functionalities of separation kernels. In {{Table}} \ref{tab:props_stand}, we overview the traditional critical properties of high-assurance systems, their related standards, and whether DIDT properties contribute to improve the assurance of traditional critical properties. \begin{table}% \tbl{Critical Properties and Standards \label{tab:props_stand}}{% \begin{tabular}{|l|L{3.0cm}||C{1.3cm}|C{2.0cm}|C{1.3cm}|C{1.4cm}|} \hline \multirow{2}*{\textbf{Property}} & \multirow{2}*{\textbf{Standards}} & \multicolumn{3}{c|}{\textbf{Spatial Separation}} & \multirow{2}*{\tabincell{c}{\textbf{Temporal} \\ \textbf{Separation}}} \\ \cline{3-5} & & Data Separation & Information Flow Security & Damage Limitation & \\\hline Safety & \tabincell{l}{DO-178B/C, ARINC 653, \\ IEC 61508, EN 50128} & \cmark & \xmark & \cmark & \cmark \\\hline Security & CC, SKPP & \cmark & \cmark & \cmark & \cmark \\\hline Real-time & ARINC 653 & \xmark & \xmark & \xmark & \cmark \\\hline Fault-tolerance & ARINC 653 & \cmark & \xmark & \cmark & \xmark \\\hline \end{tabular}} \begin{tabnote}% \Note{{\cmark}} {means a DIDT property contributes to improve the assurance of a traditional critical property.} \end{tabnote}% \end{table} \subsection{Application Schema of Formal Methods} \label{ssec:fm} In software engineering, formal methods provides a set of mathematically based techniques and tools to specify, develop, and verify software systems \cite{clarke96,bowen06}. We depict an application schema of formal methods on separation kernels in {{Fig.}} \ref{fig:fm_sw}, in which the artefacts and techniques are identified. \begin{figure} \centerline{\includegraphics[width=3.4in]{figures/fig_sw_fm.pdf}} \caption{Application Schema of Formal Methods on Separation Kernels.} \label{fig:fm_sw} \end{figure} \begin{itemize} \item Formal specification uses languages with a rigorous syntax and semantics to give a precise description of the system and its desired properties. Informal requirements may be translated into properties of the system specification. The system specification would further have formal description of system behavior, which is translated from the informal design. Formal specification can be used to validate the completeness and accuracy of the system requirements and to guide subsequent development activities. Formal specification may be refined to high-level, low-level, and implementation models step by step and furthermore be used for formal synthesis of implementations. \item Formal verification is the act to ensure the correctness of intended systems with respect to a certain formal specification or property. One approach of formal verification is model checking, which systematically and exhaustively explores the mathematical model to check satisfaction of properties. Another one is theorem proving, whose first step is to generate a collection of proof obligations from the system and its specifications. The truth of the proof obligations implies the conformance of the system to its specification. The second step is to discharge the proof obligations in an interactive or automated manner. \item There are two approaches to formal verification of separation kernels at the implementation level:: theorem proving the implementation model by abstraction from source/binary code, and software model checking \cite{Jhala09}. \end{itemize} Many security and safety standards currently mandate the use of formal methods to certify correctness of separation kernels. The Common Criteria defines clear treatment of software artefacts for different evaluation levels, which is shown in {{Table}} \ref{tab:cc_eal}. The evaluation through CC defines Evaluation Assurance Levels (EAL) from EAL 1 to EAL 7 (formally verified, designed and tested). The EAL 7 mandates formal verification of the low-level design model using mathematical models and theorem proving. As a specific profile of CC, SKPP mandates formal methods on separation kernels too. DO-178C has a formal methods supplement (DO-333) to address formal methods to complement testing. IEC 61508 defines functional safety and methods for electronic systems. Certification of Safety Integrity Level (SIL) 4 in this standard highly recommend the use of formal methods. \begin{table}% \tbl{Common Criteria Evaluation Levels and Requirements of Formal Methods \label{tab:cc_eal}}{% \begin{tabular}{|C{1.5cm}|C{1.8cm}|C{2.0cm}|C{1.8cm}|C{1.6cm}|c|} \hline \textbf{Common Criteria}&\textbf{Requirement}&\textbf{Functional Specification}&\textbf{High-Level Design}&\textbf{Low-Level Design}&\textbf{Implementation} \\\hline EAL 1 -- 4 & \Circle & \Circle & \Circle & \Circle & \Circle \\\hline EAL 5 & \CIRCLE}%{\oplus & \LEFTcircle & \LEFTcircle & \Circle & \Circle \\\hline EAL 6 & \CIRCLE}%{\oplus & \LEFTcircle & \LEFTcircle & \LEFTcircle & \Circle \\\hline EAL 7 & \CIRCLE}%{\oplus & \CIRCLE}%{\oplus & \CIRCLE}%{\oplus & \LEFTcircle & \Circle \\\hline \end{tabular}} \begin{tabnote}% \Note{Formal methods level of software artefacts:} {\Circle: informal; \LEFTcircle: semiformal; \CIRCLE}%{\oplus: formal} \end{tabnote}% \end{table} \section{Taxonomy of Applying Formal Methods on Separation Kernels} \label{sec:tax} We first propose a taxonomy of applying formal methods on separation kernels in this section. The taxonomy is to group together related work that share common objectives and characteristics to yield clear category formation and easier comparative analysis. Then, we overview the related work using the proposed taxonomy. \subsection{Taxonomy} \label{subsec:taxonomy} The taxonomy is designed based on the analytical framework and is shown in {{Fig.}} \ref{fig:taxonomy}. Level 0 is the root element. Level 1 of the taxonomy is designed according to the application schema of formal methods on separation kernels (see {{Fig.}} \ref{fig:fm_sw}). Level 2 is designed considering the functionalities in the reference architecture (see {{Fig.}} \ref{fig:sk_ra}), critical properties, and implementations. The subcategories of ``Formal Specification and Model of SKs'' are designed by considering functionalities in the reference architecture. The subcategories of ``Formalization of Critical Properties'' and ``Formal Verification of SKs'' are designed using the critical properties of separation kernels. Since the ``damage limitation'' property is enforced indirectly by the other three properties, there is no related work of formalization and formal verification of this property, and we omit it in our taxonomy. From the implementations of separation kernels (see {{Table}} \ref{tab:impls1}), we could see that they are almost developed using the C programming language. Thus, beside binary code we only consider code abstraction from the C language in the category ``Code Abstraction of SKs''. We discuss research works on each category in the following subsections. \begin{figure} \centerline{\includegraphics[width=5.5in]{figures/fig_taxonomy.pdf}} \caption{Proposed Taxonomy of Applying Formal Methods on Separation Kernel.} \label{fig:taxonomy} \end{figure} \subsection{Formal Specification and Model of SKs (Category 1)} \label{ssec:fun_spec} This subsection overviews research works about formal description of functionalities of separation kernels. Except kernel interface and policies in {{Fig.}} \ref{fig:sk_ra}, we group research works of other functionalities into the category ``functional specification and model''. \subsubsection{Policy Model (Category 1-a)} \label{sssec:policy} A formal policy is a kind of formal specification to describe what the system allows and prohibits. Formal policies of separation kernels actually define the security/safety requirements and can be categorized according to the critical properties. The policies are usually configured during system built-time and loaded during initialization of separation kernels. \emph{Data separation policy} defines strict data separation that does not allow data exchange between partitions. These policies include memory separation, device separation, etc. For instance, ARINC 653 defines a set of partitions and a static memory allocation policy for them \cite{ARINC653p13}. The \emph{inter-partition flow policy} (IPFP) \cite{Levin07} is a sort of information flow policy for separation kernels on MILS. Separation kernels map exported resources (e.g., communication objects) into partitions by a function $resource\_map: resource \rightarrow partition$. IPFP is expressed abstractly in a partition flow matrix $partition\_flow: partition \times partition \rightarrow mode$, whose entries indicate the mode of the flow. The mode indicates the direction of the flow, e.g. ``Write'' and ``Read''. Resources from a partition are addressed equivalently with respect to IPFP. One partition can be allowed to access all resources in another partition. Another type of IPFP is port and channel based information flow used in ARINC 653. \emph{Partitioned information flow policy (PIFP)} \cite{Levin10} extends IPFP in SKPP with two different granularities of requirements: partitions and subjects/resources This abstraction allows subjects from a partition to have different access privileges to resources allocated in the same partition or even in a different partition. \emph{Fault policy} is a type of damage limitation policy. A typical fault policy for separation kernels is the health monitoring (HM) in ARINC 653. The HM reports and responds to hardware, kernel, and application faults and failures. ARINC 653 supports HM by providing a set of hierarchical HM configuration tables and application level error handlers. \emph{Scheduling policy} is a type of temporal separation policy. A typical scheduling policy for separation kernels is the partition time window configuration in ARINC 653. The scheduling specified in ARINC 653 is a two-level scheduling. The partition scheduling is a fixed, cycle based scheduling and is strictly deterministic over time. This cyclic scheduling consists of a major time frame (\emph{MTF}) that is split into partition time windows (\emph{PTW}). Each \emph{PTW} has an offset and a duration, which is associated to a given partition. \subsubsection{Functional Specification and Model (Category 1-b)} \label{sssec:k_spec} We overview a set of formal specifications and models of separation kernels here. Refinement is often applied to create concrete models from abstract specifications in a step-wise manner. We categorize research works according to specification languages used, i.e. system/software specification languages, formal languages in theorem provers, and architecture description languages. \paragraph{Using system/software specification languages} A specification language is a high-level language other than a programming language for system analysis and design and to produce executable code. Many specification approaches use algebraic or model-theoretic structures to model systems step by step by refinement. In the following we describe related work using software specification languages, such as Z notation, B method, and Alley, to construct formal specifications of separation kernels. \citeN{Craig07} concerns entirely with the specification, design, and refinement of operating system kernels in Z \cite{Abrial80}, one of which is a separation kernel. Refinement goes down to a level where source code in programming languages (e.g., C and Ada) can be extracted from Z specification. The specification and proofs are done by hand on paper. This work is upgraded in \cite{Velykis10} by taking into account separation kernel requirements in \cite{Rushby81} and SKPP \cite{SKPP07}. Craig's original specification is augmented using Z notation \cite{Wood96} mechanizing it using the Z/Eves theorem prover. As a consequent, syntax errors, missing invariants and new security properties to guarantee correct operations are found. The B Method \cite{abrial96} has been used to formally specify a secure partitioning kernel (SPK) in \cite{Andre09}. The high-level specification constitutes a complete architectural design of the system and is simulated and validated in ProB \cite{Leus03}. The PIFP policy is refined to a level from which C code can be automatically generated. Finally, an open source micro kernel, i.e., PREX, is adopted to integrate the PIFP implementation. Major functionalities of the OS-K separation kernel \cite{Kawamorita10}, such as partition management, inter-partition communication, access control, are also designed in the B method. Proof obligations are generated and checked using the B4free tool. Almost the whole totality of the 2,700 proof obligations comprising the verification are automatically proven using B4free. Aiming at least privilege separation kernel (LPSK), \citeN{Phelps08} develop a formal security policy model and a top-level specification in Alloy \cite{jackson12}. They utilize the Alloy Analyzer to verify the consistency of the specification. The top-level specification is a refinement of the PIFP policy model and uses state transitions to model two separation subsystems of LPSK, system initialization and the system during runtime. In \cite{Martin00,Martin02}, three levels of abstraction and refinement are used to formally develop the MASK separation kernel in SPECWARE, which is an environment for formal specification and development. The abstract specification refines the MASK policies and concerns the communication among \emph{Cells} using \emph{strands}, which is a flow of instructions that are executed when a message is inserted into the strand of a cell. It is refined to the kernel specification primarily concerning the data structure. Finally, the bottom layer specification is manually translated into C source code. For the purpose of information flow security of the Xenon hypervisor \cite{mcdermott08}, \citeN{freit11} use \textsf{Circus} to formally model the hypercall interface behaviour of Xenon. \textsf{Circus} \cite{olive09} is a combination of Z, CSP and the refinement calculus. The whole model covers a subset of the hypercall interface and is over 4,500 pages of \textsf{Circus}. \paragraph{Using theorem provers} Theorem provers (e.g. Isabelle/HOL, Coq) generally have a small logical kernel, provide powerful expressive languages for specification, and support reasoning about high-order logic. They have been applied for formal verification of operating system kernels, such as seL4 \cite{Klein09,Klein14} and CertiKOS \cite{Gu15}. Inspired by successful application of theorem provers on general-purpose microkernels, they are adopted on kernels in recent years. The formal verification of the seL4 microkernel has been done using Isabelle/HOL \cite{Nipkow02}. The Isabelle/HOL specification of seL4 is extended in \cite{Murray13} to formally verify information flow security of seL4. In order to act as a separation kernel, seL4 is minimally extended by a static partition-based scheduler implementing a static round-robin scheduling between partitions, which are assigned fixe execution time slices. They also make small changes in the kernel APIs and add the security policy. Aiming at a precise model of PikeOS and a precise formulation of the PikeOS security policy, the EURO-MILS project \cite{euromils} creates a generic specification of separation kernels -- Controlled Interruptible Separation Kernel (CISK) \cite{Verb14} in Isabelle/HOL. This specification contains several facets that are useful to implement separation kernels, such as interrupts, context switches between domains, and control. The specification is rich in detail, making it suitable for formal verification of realistic and industrial systems. \citeN{sanan14} construct in Isabelle/HOL the functional and security model of a generic partitioning separation microkernel from a reference specification based on European Space Agency's IMA for Space project \cite{Windsor11}. The specification uses ARINC 653 for the functional requirements and SKPP for the security requirements. Aiming at implementations, the specification covers hardware virtualization, CPU timer, and memory management too. \citeN{Zhao16} present a top-level specification of ARINC 653 compliant separation kernels in Isabelle/HOL, in which partition management, partition scheduling and communication services of ARINC 653 are considered. The Coq specification of CertiKOS in \cite{Gu15} is modified to disable all explicit inter-process communication and thus formed as a separation kernel without information flow among processes \cite{Costanzo16}. \citeN{AFBMRTO02} use the concept of virtual machine for separation and provide a formal model of a multi-partition systems (MPS) by ACL2 \cite{kaufm13}. Several different models of MPS are presented, including a two-partition system without communication between partitions and an $n$-partition system with restricted communication. \paragraph{Using architecture description languages (ADLs)} In general, ADLs concentrate on system level and are not fine-grained enough to formally specify separation kernels. However, formal models of separation kernels in ADLs could support model-driven development of applications. In \cite{Singhoff07}, AADL (Architecture Analysis and Design Language) and Cheddar \cite{Singhoff04} are applied to model an ARINC 653 hierarchical scheduler and to analyze the schedulability of applications represented by AADL specifications, respectively. \subsubsection{Interface Specification (Category 1-c)} \label{sssec:api} The kernel interface defines operating system services provided to applications. Formalization of the kernel interface could support formally modelling and verification of application software on top of separation kernels. Formalization and verification of ARINC 653 has been conducted in recent years, such as a formal specification considering the architecture of ARINC 653 systems \cite{Oliveira12}, modeling ARINC 653 for IMA applications \cite{Wang11,Delan10}, and verification of application software on top of ARINC 653 \cite{de11}. \citeN{zhao15} have formalized the system functionality and all of the 57 services specified in ARINC 653 Part 1 using Event-B \cite{Abrial07}. They use the refinement structure in Event-B to formalize ARINC 653 step by step and a semi-automatic translation from service requirements of ARINC 653 into the low level specification. The formal API specification of PikeOS in Isabelle/HOL has been provided aiming at the certification of PikeOS up to CC EAL6 evaluation \cite{Klaus15}. Their specification is based on CISK \cite{Verb14}, which is instantiated to PikeOS API in detail. The formal API specification covers inter-partition communication, memory, file provider, port, and event. \subsection{Formalization of Critical Properties (Category 2)} \label{ssec:sep_plcy} Formal specification and model of separation kernels are verified with respect to critical properties. This subsection overviews the formal definition of critical properties and their sub-properties. \subsubsection{Data Separation (Category 2-a)} Data separation requires resources of a partition to be independent from resources from other partitions. Pure data separation is too strong since it does not permit communications among partitions. This property is relaxed in MASK \cite{Martin00,Martin02} and GWV \cite{Greve03}. In the project of Mathematically Analyzed Separation Kernel (MASK) \cite{Martin00,Martin02}, communication between processes is regulated based on a separation policy, which is comprised of two separation axioms: a \emph{communication policy} and an anonymous policy. The communication policy states that if a cell $y$ is modified as the result of performing a step on a cell $x$, then there is an allowed communication between $x$ and $y$. The second policy requires that the execution of an action in a cell $x$ modifies the state of the cell $y$, then any modification in $y$ has to depend only on $x$ and $y$. Based on the MASK data separation, \citeN{Greve03} propose the GWV property to model a separation kernel that enforces partitioning on applications running on mono-processors systems. The GWV property requires that the execution of a machine step modifying any arbitrary memory segment follows a mapping from the set of memory areas bound to the current partition and that are allowed to interact that memory segment. \citeN{Greve03} also define the \emph{exfiltration} and \emph{inflitration} properties for memory segments of partitions, which are special cases of the GWV property. The exfiltration and infiltration properties are similar to the communication policy and the second property of MASK respectively. \citeN{Heitmeyer08} apply the two axioms of MASK on the ED (Embedded device) separation kernel and define the \emph{no-exfiltration} and \emph{no-infiltration} properties for CC certification. The GWV property has been accepted in industry \cite{integrity08,Greve04,Greve10} and formalized using the PVS theorem prover in \cite{Rushby04}. The original GWV is weakened by allowing to connect memory areas belonging to the same partition in \cite{Alves04}. It is also extended by the concept of $subject$ and adding a restriction considering partition names in \cite{Tverdy11}. A subject is an element operating on memory areas of a partition. The GWV property has been applied in formal analysis for the INTEGRITY-178B separation kernel \cite{Richards10} and AAMP7 Microprocessor \cite{Greve04,Wilding10}. Data separation of separation kernels at the hardware level is the separation of the system's memory. In \cite{Baumann11}, the memory separation of the PikeOS separation kernel is defined as ``All memory accesses in the kernel preserve an initial disjoint partitioning of memory, and obey a security policy where a thread is only allowed to access memory from its assigned partition.'' It is preserved by a set of assertions for function contracts. \subsubsection{Information Flow Security (Category 2-b)} \label{subsubsec:ifs} Information flow security deals with the problem of preventing improper release and modification of information in complex systems. Traditionally, language-based information flow security \cite{sabelfeld03} defines security policies of computer programs and ensures the data confidentiality by preventing information leakage from \emph{High} variables to \emph{Low} ones. Language-based information flow security is often not applicable for system-level security, because (1) in many cases it is impossible to classify \emph{High} and \emph{Low} variables; (2) data confidentiality is a weak property and is not enough for system-level security; and (3) language-based IFS is not able to deal with intransitive policies straightforwardly. Therefore, state-event based noninterference \cite{rushby92,von04}, which can deal with data confidentiality and secrecy of events together, is usually adopted in formal verification of separation kernels and microkernels \cite{Murray12}. We focus on state-event based properties in this paper. The concept of noninterference was introduced in \cite{Goguen82} for the purpose of the specification and analysis of security policies. The system is configured by a set of \emph{domains} and the allowed information flow between them are specified by an information flow policy $\rightsquigarrow$, such that $u \rightsquigarrow v$ if information is allowed to flow from the domain $u$ to the domain $v$. The intuitive meaning of noninterference is that a security domain $u$ cannot interfere with a domain $v$ if no action performed by $u$ can affect the observation of $v$ to the system. Transitive noninterference is too strong and not able to model channel-control policies. Thus, intransitive noninterference is introduced in \cite{rushby92} as a declassification of transitive one. Based on noninterference in \cite{rushby92}, \citeN{von04} proposes new notions, \emph{nonleakage} and \emph{noninfluence}. Nonleakage is a state-event representation of language-based information flow security for arbitrary multi-domain policies. Noninfluence is the combination of nonleakage and intransitive noninterference. Intransitive noninterference and its new forms are usually chosen to formally verify information flow security of general purpose operating systems \cite{Murray12} and separation kernels \cite{Murray13}. Due to the scheduler in kernels, \citeN{Murray12} define special cases of nonleakage and noninfluence for operating systems. Properties of information flow security have been formally verified on seL4 \cite{Murray13}, PROSPER \cite{Dam13}, PikeOS \cite{Klaus15}, mCertiKOS \cite{Costanzo16}, and ARINC 653 \cite{Zhao16}. The standard proof of the noninterference property is discharged by examining a set of unwinding conditions \cite{rushby92} on individual execution steps of the system. The unwinding theorem states if the system is \emph{output consistent}, \emph{step consistent} and \emph{locally respects} the policy $\rightsquigarrow$, the system is secure for $\rightsquigarrow$. The three conditions are called \emph{unwinding conditions}. The unwinding theorem simplifies the security proofs by decomposing the global properties into unwinding conditions on each execution step. \subsubsection{Temporal Separation (Category 2-c)} Temporal separation usually includes sanitization/period processing and correct scheduling. \citeN{Heitmeyer08} define a sanitization property (called \emph{Temporal Separation}) on the ED separation kernel. The property ensures that the data areas of a partition are cleaned when the system is switched to process data in other partitions. As for period processing, time partitioning used in formal verification of DEOS scheduler \cite{Penix00,Penix05,Ha04,Cofer02} ensures that the access to CPU time budget by a partition cannot be affected by the execution of other partitions. Properties of correct scheduling are various according to different scheduling policies such as in \cite{Asberg11}. \subsection{Formal Verification of SKs (Category 3)} \label{ssec:veri} This subsection overviews research works about formal verification of separation kernels. We categorize the works by critical properties. \subsubsection{Data Separation Verification (Category 3-a)} For the purpose of CC evaluation, Heitmeyer et al. \shortcite{Heitmeyer06,Heitmeyer08} provide a pragmatic solution to verify data separation of the ED separation kernel at the source code level. The kernel contains 3,000 lines of C and assembly code. To simplify the verification, the code is annotated in advance using Hoare and Floyd pre-post conditions. A top-level state machine is formally verified by data separation in TAME, which is a front end to the PVS theorem prover. Then the source code is partitioned and demonstrated to conform to the state machine by refinement. The effort of code verification is remarkably reduced since more than 90 percent of the source code is not corresponding to any behavior defined by the top-level state machine. The AAMP7 microprocessors in Rockwell Collins is a hardware implementation of separation kernels. Their design is proven mathematically using the ACL2 theorem prover to achieve CC EAL 7 evaluation \cite{Greve04,Wilding10}. The \emph{intrinsic partitioning} in AAMP7 is an instantiation of the GWV property \cite{Greve03}. An abstract model meeting the GWV policy and a low-level model corresponding to the AAMP7 microcode are created, and the refinement between them is also proved. The INTEGRITY-178B separation kernel is formally analysed to obtain the EAL 6+ CC certification \cite{Richards10}. They adopt GWV \cite{Greve10} as the security policy and create three levels of specification, i.e., functional specification, high-level and low-level design, in ACL2. The functional specification is a formalization for the interfaces. The other two are semiformal representations of the system at different abstract levels. The low-level design has direct correspondence with the implementation, which simplifies the ``code-to-spec'' analysis during CC certification. \citeN{Tverdy11} presents a modular approach in Isabelle/HOL to the formal verification of the GWV property on the two layers of PikeOS. In the microkernel model, tasks and threads correspond to subjects and partitions in GWV respectively. A GWV \emph{segment} is instantiated as a physical memory address. They add ``partitions'' to the model of the separation kernel to separate tasks and physical address. Memory separation of the PikeOS separation kernel has been formally verified on the source code level \cite{Baumann11} by breaking down high-level, non-functional requirements into functional properties of memory manager that can be presented as a set of assertions. \subsubsection{Information Flow Security Verification (Category 3-b)} In the formal verification of the seL4 micro-kernel, to prove information flow security \citeN{Murray12} adopt the notions of \emph{nonleakage} and \emph{noninfluence} \cite{von04} and define their variations for OS kernels. The properties are formally verified on a revised specification of seL4 \cite{Murray13}. Because the properties are preserved by refinement, it is possible to first prove the information flow security property on the abstract model and then conclude that it holds for seL4's C source code due to the refinement relation. The verification applies to the total 8,830 lines of C code of the kernel implementation. \citeN{Dam13} have formally verified information flow security of a simple ARM-based separation kernel -- PROSPER at the binary code level using HOL4. They construct the top level specification, which satisfies noninterference, and a real model, which consists of two partitions being executed on two independent machines targeting an ARMv7 processor, and connected by an explicit communication channel. They use the bisimulation proof method to show that user observable traces of the specification are the same as those of the real model. The approach avoids reliance on the correctness of a C compiler and can transparently verify C code mixing with assembly. Explicit inter-process communication of mCertiKOS is disabled to form a strict separation kernel in which information flow among processes is not allowed. The noninterference property is verified in \cite{Costanzo16}. They use language-based information flow security and a well-designed observation function to express security at different abstract levels. A simulation preserves state indistinguishability between high and low levels. They develop a fully-formalized Coq proof to guarantee security of the assembly execution of mCertiKOS. Noninterference has also been formally verified on the PikeOS API specification \cite{Klaus15} and a top-level specification of ARINC 653 separation kernel \cite{Zhao16} using unwinding conditions. \subsubsection{Temporal Separation Verification (Category 3-c)} Here, we discuss research works about formal verification of two-level scheduler which implements the partition scheduling in separation kernels. The Honeywell DEOS is a real-time operating system supporting flexible separation. Model checking and theorem proving approaches have been applied to the DEOS scheduler to check temporal separation \cite{Penix00,Penix05,Ha04}. A major part of C++ source code of the DEOS scheduler is first translated into Promela, which is the input language for the Spin model checker \cite{Penix00,Penix05}. Time partitioning is represented as a liveness property. The verification techniques are augmented in \cite{Cofer02} by verifying the absence of a livelock, which means that time is not elapsing in any cycle that does not contain a system tick event. Due to its size and complexity, state space explosion makes only possible to check one single configuration in each analysis. Thus, they turn to theorem proving approach and use PVS to analyze the scheduler \cite{Ha04}. To model the scheduler and the execution timeline in DEOS the authors use discrete time state-transition systems. Additionally, Time partitioning is expressed as a number of predicates that are proven to be true for any reachable states. The Real-Time Specification for Java (RTSJ) is modified implementing a two-level scheduler. The first scheduling level is a priority scheduler to dispatch applications, while the second belongs to the applications \cite{Zerzelidis06b,Zerzelidis10}. The verification of this two level scheduler is carry out using time automata in UPPAAL. From a total of five verified properties, three of them concern the model correctness and others are liveness and deadlock free properties. In \cite{Asberg11}, a hierarchical scheduler for VxWorks has been modelled using task automata (timed automata with tasks) \cite{Fersman07} and automatically checked using the Times tool. They specify nine properties of the scheduler in TCTL (Timed Computation Tree Logic). \subsection{Code Abstraction of SKs (Category 4)} Formal verification of separation kernels down to their implementation or the binary code requires to provide a formal model for the semantics of the programming language or for the Instruction Set Architecture (ISA) of the target architecture, respectively. In this subsection, we overview the formal semantics and code abstraction of the C programming language and binary code. \subsubsection{Formal Semantics and Code Abstraction for C Language (Category 4-a)} It is not until the end of the 1990's that semantics covering a subset of C, large enough to make the verification of complex and large programs possible, have appeared. \citeN{N98} brings in {\em Cholera} -- an operational semantics for C89 including the C type system. {\em Cholera} has been recently leveraged to construct the tools CParser and Autocorres \cite{GAK12}, which have been applied in the seL4 microkernel \cite{Klein09,Klein10} and separation kernel \cite{Murray13} to abstract the implementation model from the seL4 source code. \citeN{P01} develops a denotational semantics of C90, which is based on monads implemented in Haskell, and covers a large subset of C90. In the formal verification of the Nova hypervisor \cite{TWVPER08}, they provide a denotational semantics for C++ which includes all the C++ primitive datatypes. As part of the Verisoft project \cite{AHLSS08}, C0 which is a subset of the C language is formalized in Isabell/HOL. \citeN{BL09} develop Clight as part of the CompCert project \cite{Leroy09}. Clight accepts most of the C types and operators, although it does not support the use of control flow instruction {\tt goto} and blocks. \citeN{ER12} provide an executable semantics for C99 standard in the K-framework, which supports LTL model checking, and like the semantic model in \cite{P01}, it is not mechanized. They provide a semantic model for almost all of the C functionalities. In the $CH_2O$ project, \citeN{KW15} provide a small step operational semantics and executable semantics model for C11 using the Coq theorem prover. The semantic model is non-deterministic covering almost the totality of the C standard. The executable semantics is used for validation purposes. \subsubsection{Formal Semantics and Code Abstraction for Binary Code (Category 4-b)} Related work in this area includes formalization of some of the most popular architectures such as Intel x86, ARM, and MIPS. Here we cover only those mechanized formal semantics that can be used in the binary code verification of separation kernels. For the Intel architecture, \citeN{GHKG14} build in the model checker ACL2 an executable semantics for the x86-64 architecture, providing a framework able to both formally analyze and simulate non-deterministic machine code programs intended to run on 64 bits Intel processors. \citeN{SSNORBMA09} provide in HOL4 an axiomatic and operational semantics for the Intel multiprocessor architecture, including not only semantics for the set of instructions implemented by the architecture, but also a total order axiomatic semantic model of the memory, and machine registers. On ARM architectures, the work in \cite{FM10} covers ARM v7 including support for Thumb-2 instructions through a monadic encoding of the architecture operations. Validation is performed throughout random generation of instructions, and the execution of the instruction on a development board and in the semantic model. Recently, ARM v8 ISA is also modeled in \cite{Flur16}. The ARM v7 ISA model has been used in formal verification of seL4 \cite{Klein14} and PROPSPER \cite{Dam13} at the binary code level. Within the CompCert project \cite{Leroy09}, a subset of 90 instructions of the PowerPC ISA is modelled using the Coq theorem-prover. This semantics is extended using the HOL4 theorem-prover in \cite{AFIMSSN09} with an axiomatic memory model for multiprocessor. An x86 machine model derived from CompCert's model has been applied in formal verification of mCertiKOS \cite{Costanzo16}. It is worth to mentioning the L3 language, introduced in \cite{F15} aiming to support a generic framework for the specification of ISAs, and the reasoning on machine code programs. Through specifying a next-step function for a subset of instructions for a given ISA, and a definition of the state, the framework is able to generate high-level functions in HOL4 for machine code programs, and a set of theorems proving the correctness of the generated function w.r.t. the input machine code and the L3 specification for the ISA. \subsection{Code Synthesis of SKs (Category 5)} \label{ssec:sk_syn} Formal synthesis \cite{Jullig93} translates formal, validated specifications into provably correct target code. Automated formal software synthesis gives a high degree of confidence that the generated code is correct with respect to the specification. Automatic code synthesis of operating systems can improve customizability \cite{Denys02} and optimize the performance at run-time \cite{Massa92}. It is time consuming and error prone when manually porting or configuring the operating systems on different target architectures, and this issue can be addressed by automatic generation of application-specific operating systems \cite{Gauthier06}. But to the best of our knowledge, there are no research works on automatic code synthesis for separation kernels. The challenges are that the source code should be very efficient and usually embedded with assembly code. Actually, separation kernels in industries are always verified by the post-development approach, i.e., formal models are abstracted from the implementations of separation kernels and formally verified to provide the required proofs for critical properties. \section{Analysis and Discussion} \label{sec:analy_disc} In this section, we analyze and discuss related work from the perspective of implementations, formal specification and model, critical properties, formal verification, and code abstraction and synthesis. Then, we give an overall comparison. \subsection{Implementations} We have surveyed twenty implementations of separation kernels from industry and academia in {{Table}} \ref{tab:impls1}. Here, we compare their objectives, standard certifications/compliance, and formal methods applications in {{Table}} \ref{tab:impls2}. The ``objective'' column presents the critical properties that implementations concern. Although separation kernels contribute to improve fault-tolerance of systems, fault-tolerance is usually considered at system levels. Therefore, we do not compare this property in the table. \begin{table}% \tbl{Comparison of Separation Kernel Implementations \label{tab:impls2}}{% \begin{tabular}{|C{0.3cm}|L{4.8cm}|C{0.8cm}|C{0.6cm}|C{0.9cm}|C{2.4cm}|C{1.0cm}|} \hline \multirow{2}{*}{\textbf{No}} & \multirow{2}{*}{\textbf{Name}} & \multicolumn{3}{c|}{\textbf{Objective}} & \multirow{2}{*}{\tabincell{c}{\textbf{Certification} \\/\textbf{Compliance}}} & \multirow{2}{*}{\tabincell{c}{\textbf{Formal} \\ \textbf{Methods}}} \\ \cline{3-5} & & Security & Safety & Realtime & & \\\hline \hline \multicolumn{7}{|l|}{\textbf{Industrial Implementations}} \\\hline 1&PikeOS \cite{pikeos} & \cmark & \cmark & \cmark & \tabincell{c}{DO-178B Level B,\\IEC 61508 SIL 3,\\EN 50128 SIL 4, \\ARINC 653}& \cmark \\\hline 2&VxWorks 653 \cite{vxworks653} & \xmark & \cmark & \cmark & \tabincell{c}{DO-178B/C Level A,\\ARINC 653} & {?}%{$\divideontimes$} \\\hline 3&VxWorks MILS \cite{vxworksmils}& \cmark & \xmark & \xmark & \tabincell{c}{SKPP, CC,\\DO-178C Level A} & {?}%{$\divideontimes$} \\\hline 4&INTEGRITY-178B \cite{integrity178b}& \cmark & \cmark & \cmark & \tabincell{c}{DO-178B Level A,\\ CC EAL 6+/SKPP, \\ ARINC 653}& \cmark \\\hline 5&\tabincell{l}{INTEGRITY \\Multivisor \cite{integrityvisor}} & \cmark & \xmark & \xmark & {?}%{$\divideontimes$} & {?}%{$\divideontimes$} \\\hline 6&LynxSecure \cite{lynxsec}& \cmark & \cmark & \cmark & \tabincell{c}{CC EAL 7,\\ DO-178B Level A} & {?}%{$\divideontimes$} \\\hline 7&LynxOS-178 \cite{lynxos178}& \xmark & \cmark & \cmark & \tabincell{c}{DO-178B Level A,\\ARINC 653} & {?}%{$\divideontimes$} \\\hline 8&DDC-I Deos \cite{deos} & \xmark & \cmark & \cmark & \tabincell{c}{DO-178B Level A,\\ARINC 653} & {?}%{$\divideontimes$} \\\hline 9&AAMP7$^a$ \cite{aamp7g} & \cmark & \cmark & N/A & CC EAL 7& \cmark \\\hline 10&ED [\citeNP{Heitmeyer06};\citeyearNP{Heitmeyer08}]& \cmark & \xmark & \xmark & CC & \cmark \\\hline 11&ARLX hypervisor \cite{arlx} & \cmark & \cmark & \xmark & \tabincell{c}{DO-178B Level A,\\ MILS EAL,\\IEC 61508} & {?}%{$\divideontimes$} \\\hline \multicolumn{7}{|l|}{\textbf{Academic Implementations}} \\\hline 12&seL4 [\citeNP{Murray12};\citeyearNP{Murray13}] & \cmark & \xmark & \xmark & \xmark & \cmark \\\hline 13&OKL4 Microvisor \cite{okl4mv} & \cmark & \xmark & \xmark & \xmark & \cmark \\\hline 14&XtratuM \cite{xtratum}& \cmark & \cmark & \xmark & ARINC 653 & \cmark \\\hline 15&PROSPER \cite{prosper}& \cmark & \xmark & \xmark & \xmark & \cmark \\\hline 16&Xenon \cite{freit11} & \cmark & \xmark & \xmark & \xmark & \cmark \\\hline 17&Quest-V \cite{questv} & \cmark & \cmark & \xmark & \xmark & \xmark \\\hline 18&Muen \cite{muen} & \cmark & \xmark & \xmark & \xmark & \xmark \\\hline 19&POK \cite{pok} & \xmark & \cmark & \cmark & ARINC 653 & \xmark \\\hline 20&AIR/AIR II \cite{air} & \xmark & \cmark & \cmark & ARINC 653 & \xmark \\\hline \end{tabular}} \begin{tabnote}% \Note{{?}%{$\divideontimes$}} {means we do not find any literature to show the evidence.} \vskip2pt \tabnoteentry{$^a$}{This is a processor, a hardware implementation of separation kernel.} \end{tabnote}% \end{table} By comparing these implementations, we have the following findings. \begin{itemize} \item Traditionally, two kinds of separation kernels have been used to assure safety and security of critical systems. For instance, VxWorks 653 was used to ensure safety-critical systems and VxWorks MILS to ensure security-critical systems. Nevertheless, a new direction in this field is to unify safety and security into a single separation kernel. For instance, recent separation micro-kernel implementations such as PikeOS and XtratuM are designed to support both solutions \cite{Zhao16}. \item The realtime property is mostly considered on separation kernels for safety-critical systems. Due to the integration of safety and security, this property has been considered with security-critical systems. \item Industrial implementations aim at highest assurance levels of different security/safety certification, in particular CC and DO-178B. Open-source/academic implementations have emerged in recent years. However, many of them do not have certification evidence now. Some of the open-source separation kernels are compliant with the ARINC 653 standard. \item From the aspect of formal methods application, formal specification and verification have been enforced on separation kernels in academia at source code and binary code levels. The objective of formal methods on industrial implementations is security/safety certification. \end{itemize} \subsection{Formal Specification and Model} We compare the research works of separation kernels on formal specification and model in {{Table}}s \ref{tab:sk_spec_comp1} and \ref{tab:sk_spec_comp2} in the ascending order of time. In {{Table}} \ref{tab:sk_spec_comp1}, we compare the formal languages they have used, the size of the specification, and whether refinement is used. In {{Table}} \ref{tab:sk_spec_comp2}, we compare the functionalities in the reference architecture that are formalized by the research works. We calculate a total score for each functionality to identify its importance in the formal specification and model of separation kernels. \begin{table} \tbl{Comparison of Separation Kernel Specification - Part 1 \label{tab:sk_spec_comp1}}{% \begin{tabular}{|l|l|c|c|} \hline \textbf{Specification/Model}&\textbf{Formal Language}&\textbf{Size of Specification}&\textbf{Refinement} \\\hline \hline \tabincell{l}{MASK {[}\citeNP{Martin00};\citeyearNP{Martin02}{]}} & SPECWARE & {?}%{$\divideontimes$} & \cmark \\\hline MPS \cite{AFBMRTO02}& ACL2 & $\approx$ 2500 LOC & \cmark \\\hline Craig \cite{Craig07}&Z&$\approx$ 100 pages& \cmark \\\hline \tabincell{l}{ARINC Scheduler \cite{Singhoff07}}& AADL & {?}%{$\divideontimes$} & \xmark \\\hline LPSK \cite{Phelps08}& Alloy & {?}%{$\divideontimes$} & \cmark \\\hline SPK \cite{Andre09}&Classical B&{?}%{$\divideontimes$}& \cmark \\\hline OS-K \cite{Kawamorita10}&Classical B&{?}%{$\divideontimes$}& \cmark \\\hline \tabincell{l}{Verified Software \cite{Velykis10}}&Z&$\approx$ 50 pages& \cmark \\\hline Xenon \cite{freit11}& Circus & $\approx$ 4500 pages & \cmark \\\hline seL4 \cite{Murray13} & Isabell/HOL & 4970 LOC & \cmark \\\hline CISK \cite{Verb14}&Isabell/HOL&$\approx$ 500 LOC& \xmark \\\hline XtratuM \cite{sanan14}&Isabell/HOL&$\approx$ 6000 LOC& \cmark \\\hline ARINC 653 Standard \cite{zhao15}&Event-B& $\approx$ 2700 LOC & \cmark \\\hline PikeOS API \cite{Klaus15}&Isabelle/HOL& $>$ 4000 LOC & \xmark \\\hline ARINC 653 Separation Kernel \cite{Zhao16}&Isabelle/HOL& $\approx$ 1000 LOC & \xmark \\\hline \end{tabular}} \begin{tabnote}% \Note{{?}%{$\divideontimes$}:}{means there is no evidence in the literature} \end{tabnote}% \end{table} \begin{table} \tbl{Comparison of Separation Kernel Specification - Part 2 \label{tab:sk_spec_comp2}}{% \begin{tabular}{|L{5.0cm}||C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}||C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|} \hline \multirow{3}{*}{\textbf{Specification/Model}}&\multicolumn{10}{c||}{\textbf{Functionalities}} & \multicolumn{4}{c|}{\multirow{2}{*}{\textbf{Policies}}} \\ \cline{2-11} &\multicolumn{5}{c|}{\textbf{Common}} & \multicolumn{5}{c||}{\textbf{Optional}} & \multicolumn{4}{c|}{} \\ \cline{2-15} & \rotatebox{90}{\textbf{Kernel Interface}} & \rotatebox{90}{\textbf{Partition Management}} & \rotatebox{90}{\textbf{Communication}} &\rotatebox{90}{\textbf{Scheduling}} & \rotatebox{90}{\textbf{Hardware Interface}} & \rotatebox{90}{\textbf{Process Management}} & \rotatebox{90}{\textbf{Monitoring}} & \rotatebox{90}{\textbf{Clock\&Timer}} & \rotatebox{90}{\textbf{Interrupt}} & \rotatebox{90}{\textbf{Memory}} & \rotatebox{90}{\textbf{Data separation}} & \rotatebox{90}{\textbf{Inter-partition flow}} & \rotatebox{90}{\textbf{PIFP}}&\rotatebox{90}{\textbf{Fault}} \\\hline \hline \tabincell{l}{MASK \\ {[}\citeNP{Martin00};\citeyearNP{Martin02}{]}} & & $\Circle$ & $\CIRCLE$ & $\CIRCLE$ & & $\Circle$ & & & & & $\CIRCLE$ & & & \\\hline MPS \cite{AFBMRTO02}& & $\Circle$ & $\LEFTcircle$ & & & $\Circle$ & & & & & $\LEFTcircle$&&& \\\hline Craig \cite{Craig07} &$\LEFTcircle$ & $\Circle$&$\CIRCLE$&$\CIRCLE$& $\LEFTcircle$& $\CIRCLE$&&&$\LEFTcircle$&$\CIRCLE$&&&& \\\hline \tabincell{l}{ARINC Scheduler\\ \cite{Singhoff07}}& & $\Circle$ & & $\CIRCLE$ & & $\Circle$ & & & & & &&& \\\hline LPSK \cite{Phelps08} & & $\Circle$ & & & & $\Circle$ & & & & $\Circle$ & &&$\CIRCLE$& \\\hline SPK \cite{Andre09} & $\LEFTcircle$&$\Circle$&$\LEFTcircle$&$\Circle$&&$\Circle$&&$\LEFTcircle$&&$\LEFTcircle$&&&$\CIRCLE$& \\\hline OS-K \cite{Kawamorita10} & $\LEFTcircle$&$\LEFTcircle$&$\LEFTcircle$&$\LEFTcircle$& & $\LEFTcircle$&&$\LEFTcircle$&&$\LEFTcircle$&&&& \\\hline \tabincell{l}{Verified Software\\\cite{Velykis10}} & $\LEFTcircle$&$\Circle$&$\LEFTcircle$&$\CIRCLE$&$\LEFTcircle$&$\CIRCLE$&&&$\LEFTcircle$&$\LEFTcircle$&&&$\CIRCLE$& \\\hline Xenon \cite{freit11} & $\LEFTcircle$ & $\Circle$ & $\LEFTcircle$ & $\LEFTcircle$ & $\LEFTcircle$ & $\Circle$ & & & $\LEFTcircle$ & & &$\CIRCLE$&& \\\hline seL4 \cite{Murray13} & $\CIRCLE$ & $\Circle$ & $\CIRCLE$ & $\LEFTcircle$ & $\LEFTcircle$ & $\CIRCLE$ & & $\LEFTcircle$ & $\LEFTcircle$ & $\LEFTcircle$ & & $\CIRCLE$&& \\\hline CISK \cite{Verb14} & &$\Circle$&$\LEFTcircle$&$\Circle$&&&&&$\LEFTcircle$&&&&$\CIRCLE$& \\\hline XtratuM \cite{sanan14} & $\LEFTcircle$ &$\CIRCLE$&$\CIRCLE$&$\LEFTcircle$&$\LEFTcircle$&&$\LEFTcircle$&$\LEFTcircle$&$\Circle$&$\LEFTcircle$&&&$\CIRCLE$& \\\hline ARINC 653 Standard \cite{zhao15} & $\CIRCLE$&$\CIRCLE$&$\CIRCLE$&$\LEFTcircle$& & $\CIRCLE$&$\LEFTcircle$&$\LEFTcircle$&&&&&&$\LEFTcircle$ \\\hline PikeOS API \cite{Klaus15} & $\LEFTcircle$&$\Circle$&$\LEFTcircle$&$\Circle$& & &&&$\LEFTcircle$&$\LEFTcircle$&&&$\CIRCLE$& \\\hline ARINC 653 Separation Kernel \cite{Zhao16} & $\LEFTcircle$&$\LEFTcircle$&$\LEFTcircle$&$\LEFTcircle$& & &&&&&&$\CIRCLE$&& \\\hline \multirow{2}{*}{\textbf{Total Score}} &\multirow{2}{*}{24}&\multirow{2}{*}{21}&\multirow{2}{*}{31}&\multirow{2}{*}{27}&\multirow{2}{*}{10}& \multirow{2}{*}{20}&\multirow{2}{*}{4}&\multirow{2}{*}{10}&\multirow{2}{*}{13}&\multirow{2}{*}{16}& 5 & 9 & 18 & 2 \\ \cline{12-15} &&&&&&&&&&&\multicolumn{4}{c|}{34} \\\hline \end{tabular}} \begin{tabnote}% \Note{$\CIRCLE$:}{has detailed specification (3 scores)} \Note{$\LEFTcircle$:}{has abstract specification (2 scores)} \Note{$\Circle$:}{only considers the concept (1 score)} \Note{}{The blank is that the specification does not cover the functionality (0 score)} \end{tabnote}% \end{table} A formal specification language has a mathematically defined syntax and semantics to give precise description of the artefacts used with formal methods. In the application of formal methods on separation kernels, numerous specification languages are used (see {{Table}} \ref{tab:sk_spec_comp1}), such as Classical B, Event-B, Z notation, Isabelle/HOL, ACL2, and model-driven architecture languages (e.g., AADL). Specification languages are often used for system analysis, requirement analysis, and systems design at a much higher level, where expressiveness and refinement \cite{RE08} are the major considerations for separation kernels. Specification languages used for separation kernels often support set theory and first-order logic as the fundamental data types. Refinement is often used to create concrete models from abstract specifications in a step-wise manner. On the other hand, for the purpose of formal verification at low level or source code level, specification languages used to specify separation kernels are focused on first-order or high-order logic languages, such as Isabelle/HOL, ACL2, PVS, and HOL4. Verification tools for these formalisms must have powerful engines for formal reasoning, supporting automatic theorem proving or providing proof assistants with a high degree of automation. \citeN{Wiedijk06} presents a detailed comparison of seventeen theorem provers and the ability of their formal notations. We have proposed a reference architecture for separation kernels in {{Fig.}} \ref{fig:sk_ra}, in which we classify the functionalities into common and optional components. In {{Table}} \ref{tab:sk_spec_comp2}, we count a total score for each functionality according to the level of abstraction at which they are formalized in research works. The importance of each functionality in the formal specification of separation kernels is thus shown by the total score. We divide the ``policies'' from ``functionalities'' in accordance with the taxonomy in subsection \ref{subsec:taxonomy}. From {{Table}} \ref{tab:sk_spec_comp2}, we could see that common components have higher scores than optional components. It is in accordance with the classification of common and optional components in the reference architecture. An exception is the ``hardware interface'' which is at low level and necessary in implementations. However, it is usually omitted in formal specifications at abstract level. Most of research works only consider the concept of ``partition'' and do not provide specification of ``partition management'', because they use the ``partition'' as a mechanism to separate resources and do not manage the life cycle of partitions. Although it is an optional component in the reference architecture, process management is often specified in research works because processes are importance resources in partitions. The PIFP policy is the most adopted policy of separation kernels in research works due to the fine-grained controls on partitions, resources, and subjects. A notable observation is that different specification languages are used in the literature, but Isabell/HOL has become recently more popular than other formalisms. The first reason is its successful, large scale application in full formal verification of the seL4 microkernel at source code level. Second, there is a big community of experts working actively on its development, with frequent updates. Finally but not less important, it has a powerful development environment with many tools supporting automation. A detailed discussion about applying Isabelle/HOL in certification processes of separation kernels is in \cite{Blasum15}. \subsection{Critical Properties} In {{Subsection}} \ref{ssec:sep_plcy}, we have presented a set of critical properties, their sub-properties, and their formal definition. We sketch out their relationship in {{Fig.}} \ref{fig:comp_props}. The evidence of the relationship are from the literature as shown in {{Table}} \ref{tab:evd_prop}. \begin{figure} \centerline{\includegraphics[width=5.0in]{figures/fig_props.pdf}} \caption{Relationship of Critical Properties.} \label{fig:comp_props} \end{figure} \begin{table}% \tbl{Evidence of Relationship of Critical Properties \label{tab:evd_prop}}{% \begin{tabular}{|l|l|} \hline \textbf{Literature}&\textbf{Labels of Relationship} \\\hline \hline \cite{Greve03} & (1 - 6) \\\hline \cite{Heitmeyer08,Heitmeyer06} & (7, 8) \\\hline \cite{Bond14} & (9, 10) \\\hline \cite{Alves04} & (9, 11, 12) \\\hline \cite{von04} & (13 - 15) \\\hline \cite{rushby92} & (14) \\\hline \cite{Murray12} & (16 - 20) \\\hline \cite{Murray13} & (23 - 25) \\\hline \cite{Zhao16} & (26) \\\hline \end{tabular}} \end{table} GWV and MASK are the two major groups of data separation properties. GWV is inspired by properties in MASK and the relationship of these two groups of properties is discussed in \cite{Greve03}. The infiltration, exfiltration, and mediation properties are actually instances of the GWV separation property. The first two are actually similar to the two properties of MASK. The properties of GWV are applied on the ED separation kernel and redefined as ED no-infiltration and ED no-exfiltration \cite{Heitmeyer08,Heitmeyer06}. Rushby's noninterference and its variants constitute the major group of information flow security. The definition and formal comparison of noninterference, nonleakage and noninfluence are studied in \cite{von04,Murray12,Zhao16}. The three unwinding conditions (see {{Subsection}} \ref{subsubsec:ifs}) imply noninterference by the unwinding theorem \cite{rushby92}. Noninfluence \cite{von04} is proposed based on noninterference and considers both data confidentiality and secrecy of events. It is a stronger property and implies noninterference and nonleakage. These properties have been instantiated in seL4 \cite{Murray12,Murray13} and in ARINC 653 separation kernels \cite{Zhao16} by extending the scheduler. Different definitions and formal comparison of noninterference are available in \cite{van2010}. The GWV property proposed in Rockwell Collins is adopted in industry as the security policy for CC certifications, such as AAMP7 microprocessor \cite{Wilding10}, INTEGRITY-178B \cite{Richards10}, and PikeOS \cite{Tverdy11}. Meanwhile, noninterference is mostly applied in academia, such as in formal verification of seL4 \cite{Murray12,Murray13}, PROSPER \cite{Dam13}, and mCertiKOS \cite{Costanzo16}. A notable work is \cite{Bond14} in which they formally compare GWV and Rushby's noninterference and present a mapping between the elements of the two models. The conclusion is that GWV is stronger than Rushby's noninterference. A similar conclusion is in \cite{Alves04}, where they state that GWV is at least as strong as general noninterference and in addition it also provides intransitive noninterference. Temporal separation has not attracted much attention in the literature and we therefore cannot find a large number of works focusing on the verification of temporal separation. It is however worth mentioning the work \cite{Penix00,Penix05,Cofer02} where time partitioning is verified in the DEOS kernel. \subsection{Formal Verification} In order to summarize formal verification of separation kernels, we compare the research works in {{Table}}s \ref{tab:sk_verify_comp1} and \ref{tab:sk_verify_comp2} focusing on the verification targets, verified properties and sub-properties, language used, sizes of specification and proofs, verification approaches and tools, and their cost. The verification targets are artefacts of formal methods in {{Fig.}} \ref{fig:fm_sw}, i.e. specification, high-level model, low-level model, and implementation model of source code and binary code. In {{Table}} \ref{tab:sk_verify_comp1}, we refine the model into high-level design and low-level design models according to the levels of formal methods application in CC certification. \begin{table}% \tbl{Comparision of Separation Kernel Verification - Part 1\label{tab:sk_verify_comp1}}{% \begin{tabular}{|L{3.8cm}|C{2.8cm}|C{2.8cm}|C{2.8cm}|} \hline \centering\textbf{Verified Kernel}& \textbf{Verification Target}& \textbf{Verified Properties} &\textbf{Verified Sub-properties} \\\hline \hline ED \cite{Heitmeyer06,Heitmeyer08} & Implementation model (source code) & Data separation, Temporal separation & \tabincell{c}{No-infiltration, \\ No-exfiltration, \\ Kernel integrity, \\ Separation of control} \\\hline AAMP7 \cite{Greve04,Wilding10}&Low-level model&Data separation & GWV \\\hline INTEGRITY-178B \cite{Richards10} &Low-level model&Data separation&GWV \\\hline PikeOS \cite{Baumann11} \cite{Tverdy11} \cite{Klaus15}&High-level model, Implementation model (source code) & Data separation, Information flow security &\tabincell{c}{Memory separation, \\ GWV, Noninterference} \\\hline seL4 \cite{Murray12,Murray13} & Implementation model (source code) & Information flow security &\tabincell{c}{Noninfluence, \\ Noninterference, \\ Nonleakage} \\\hline PROSPER \cite{Dam13} & Implementation model (binary code)&\tabincell{c}{Data separation, \\ Information flow security}&\tabincell{c}{No-infiltration, \\ No-exfiltration, \\ Noninterference} \\\hline XtratuM \cite{sanan14}&Low-level model& Information flow security & Noninterference \\\hline mCertiKOS \cite{Costanzo16} & Implementation model (source code) & Information flow security & Noninterference \\\hline ARINC 653 \cite{Zhao16} & Specification & Information flow security & \tabincell{c}{Noninfluence, \\ Noninterference, \\ Nonleakage} \\\hline DEOS \cite{Penix00,Penix05,Cofer02,Ha04}& Implementation model (source code) &Temporal separation&Time partitioning \\\hline A VxWorks scheduler \cite{Asberg11}&Low-level model&Temporal separation& \tabincell{c}{Correctness of Scheduling} \\\hline RTSJ scheduler \cite{Zerzelidis06b,Zerzelidis10}&Low-level model&Temporal separation& \tabincell{c}{Correctness of Scheduling} \\\hline \end{tabular}} \end{table} \begin{table}% \tbl{Comparision of Separation Kernel Verification - Part 2 \label{tab:sk_verify_comp2}}{% \begin{tabular}{|L{3.8cm}|C{1.5cm}|C{2.0cm}|C{1.2cm}|C{1.8cm}|C{1cm}|} \hline \centering\textbf{Verified Kernel}& \textbf{Formal Language} & \textbf{Size} & \textbf{Verification Approach} & \textbf{Tools} & \textbf{Cost} \\\hline \hline ED \cite{Heitmeyer06,Heitmeyer08} & TAME & 368 LOC of TAME spec. & R, TP & TAME, PVS theorem prover & 11 weeks \\\hline AAMP7 \cite{Greve04,Wilding10} &ACL2& 3,000 LOC of ACL2 definitions & R, TP & ACL2 theorem prover & {?}%{$\divideontimes$} \\\hline INTEGRITY-178B \cite{Richards10} &ACL2& {?}%{$\divideontimes$} & R, TP &ACL2 theorem prover & {?}%{$\divideontimes$} \\\hline PikeOS \cite{Baumann11} \cite{Tverdy11} \cite{Klaus15} & Annotated C code, Isabelle/HOL & {?}%{$\divideontimes$} & TP, MC& VCC, Isabelle proof assistant & {?}%{$\divideontimes$} \\\hline seL4 \cite{Murray12,Murray13} &Isabelle/HOL& 4,970 LOC of spec., 27,756 LoC of proof& R, TP & Isabelle proof assistant & 51 person-months \\\hline PROSPER \cite{Dam13} & HOL4& 21k LOC & R, TP &HOL proof assistant & {?}%{$\divideontimes$} \\\hline XtratuM \cite{sanan14}& Isabelle/HOL & 6,000 LOC of spec & R, TP &Isabelle proof assistant & 12 person-months \\\hline mCertiKOS \cite{Costanzo16} & Coq & 6,285 LOC of proof & R, TP & Coq proof assistant & {?}%{$\divideontimes$} \\\hline ARINC 653 \cite{Zhao16} & Isabelle/HOL & 1,000 LOC of spec, 7,000 LoC of proof & TP & Isabelle proof assistant & 8 person-months \\\hline DEOS \cite{Penix00,Penix05,Cofer02,Ha04}& Promela, PVS & 1,600 LOC of PVS &TP, MC & PVS theorem prover, SPIN & {?}%{$\divideontimes$} \\\hline A VxWorks scheduler \cite{Asberg11}& Task automata, TCTL& {?}%{$\divideontimes$} & MC &Times tool & {?}%{$\divideontimes$} \\\hline RTSJ scheduler \cite{Zerzelidis06b,Zerzelidis10}& Timed automata& {?}%{$\divideontimes$} & MC &UPPAAL & {?}%{$\divideontimes$} \\\hline \end{tabular}} \begin{tabnote}% \Note{Verification Approach:} {theorem proving (TP), model checking (MC), refinement (R)} \Note{{?}%{$\divideontimes$}:}{means there is no evidence in the literature} \end{tabnote}% \end{table} The purpose of formal verification of separation kernels in industry is mainly safety/security certification, in particular CC security certification, such as INTEGRITY-178, PikeOS, AAMP7, and ED. The highest assurance level of CC certification (EAL 7) requires comprehensive security analysis using formal representations of the security model, functional specification, high-level design, and low-level design of separation kernels as well as formal proofs of correspondence among them. The implementation is not necessary for formal analysis. Therefore, it is possible to observe from {{Table}} \ref{tab:sk_verify_comp1} that formal verification of industrial separation kernels is often conducted on the low-level design model but not the implementation. However, in academia it often reaches the levels of source and binary code for the purpose of full formal verification. On the other hand, formal verification of separation kernels usually consider data separation and information flow security other than temporal separation since CC certification of separation kernels demands a security policy model of spatial separation. From the aspect of critical properties, formal verification in industry prefers data separation, in particular the GWV property, whilst Rushby's noninterference is prefered in academia. We find that in recent five years, research works of formal verification have mostly focused on the noninterference. Almost all of research works of formal verification on spatial separation have used theorem proving and refinement approaches. The reasons are as follows. \begin{itemize} \item The methodology of formal verification using theorem proving and refinement is compliant with CC EAL 7 certification. Security proof of separation kernels is produced by the methodology. However, model checking only produces the verification result, e.g., correct or counterexamples. \item Separation kernels for safety and security critical systems often requires formal verification on low-level design or even source code. Despite the relatively small size of separation kernels, the model checking technique does not scale well to verify such complex systems due to the state space explosion problem. However, the theorem proving approach is applicable and full verification of separation kernels is therefore possible. \item Critical properties of separation kernels (e.g., GWV and information flow security) are difficult to be represented using temporal logic. A notable recent work is that noninterference can be classified as a sort of hyperproperties \cite{Clarkson10} and formulated by HyperLTL \cite{Clarkson14}. However, HyperLTL model checkers currently do not scale up to 1,000 states and are not applicable even at the abstract level of separation kernels. \end{itemize} On the other hand, temporal separation verification often uses model checking rather than theorem proving. \emph{time} is hard to express using first order or high order logics, which are the mathematical artefacts used in theorem provers. However, it is possible to conveniently express \emph{time} using temporal logics, e.g., the timed automata in UPPAAL tools. A major obstacle of this approach is that the size and complexity of separation kernels limit the approach to analyze only one configuration at a time. Honeywell has addressed this issue and turned into using the PVS theorem prover to formally verify DEOS \cite{Ha04}. From the aspect of the cost for formal verification, there are not many evidences in the literature. From the result of seL4 \cite{Klein09,Murray13}, we could see that enormous man power is often needed for formal verification of separation kernels reaching at the source code level. A possible approach to this issue is provided in \cite{Heitmeyer08}, where manual proof is enforced at abstract level and pre- and post-conditions annotated in the source code are used to automatically verify the conformance between the specification and the source code. \subsection{Code Abstraction} {{Table}} \ref{tab:sk_lang_semantics} summarises state of the art for mechanized formal semantics of the C language. The table shows the formal language used, the version of the C language the semantics formalizes, whether the formal semantics is executable, and what separation kernels they have been applied on, if any. We include a field indicating whether a semantics is executable or not since executing the semantics is a desirable property for simulation purposes. Similarly, {{Table}} \ref{tab:ISA_semantics} comprises state of the art ISAs formalization. The table shows the formal method used, the target architecture, whether it supports multicore, whether the semantics is executable, and what separation kernels they have been applied on, if any. \begin{table} \tbl{Comparison of Formal Semantics of C \label{tab:sk_lang_semantics}}{% \begin{tabular}{|L{4.4cm}|C{1.8cm}|c|c|c|} \hline \textbf{Specification}&\textbf{Formal Language}&\textbf{C Subset}&\textbf{Executable}&\textbf{Applied Kernel} \\\hline \hline Cholera \cite{N98} & Isabelle/HOL & C89 & \xmark & CParser, seL4 \\\hline \citeN{P01}& Haskell & C90 & \cmark & \\\hline \citeN{TWVPER08}&PVS& {?}%{$\divideontimes$} & \xmark & Nova Hypervisor \\\hline C0 \cite{AHLSS08}& Isabelle/HOL & C89 & \xmark & \\\hline Clight \cite{BL09}& Coq & C90 & \cmark & \\\hline \citeN{ER12}&K-framework&C99& \cmark & \\\hline $CH_2O$ \cite{KW15}&Coq&C11& \cmark & \\\hline \end{tabular}} \begin{tabnote}% \Note{{?}%{$\divideontimes$}:}{means there is no evidence in the literature} \end{tabnote}% \end{table} \begin{table} \tbl{Comparison of Formal Semantics of ISA \label{tab:ISA_semantics}}{% \begin{tabular}{|L{3.8cm}|C{1.5cm}|C{1.4cm}|c|c|c|} \hline \textbf{Specification}&\textbf{Formal Language}&\textbf{ISA}&\textbf{Executable}&\textbf{Multicore}&\textbf{Applied Kernel} \\\hline \hline \citeN{GHKG14} & ACL2 & x86-64 & \cmark & \cmark & \\\hline \citeN{SSNORBMA09}& HOL4 & x86-CC & \cmark & \cmark & \\\hline CertiKOS \cite{Costanzo16}& Coq & x86 & \cmark & \cmark & CertiKOS \\\hline \citeN{FM10}&HOL4& ARMv7& \cmark & \xmark & seL4, PROSPER \\\hline \citeN{Flur16}&Lem& ARMv8& \cmark & \cmark & \\\hline CompCert \cite{Leroy09}& Coq & Power-PC & \cmark & \xmark & \\\hline \end{tabular}} \end{table} Verification of separation kernels at source code and binary code level requires two fundamental tasks: to capture the language or ISA behaviour and to prove that the provided semantic model is correct. Due to the complexity of the C language, it is difficult to capture its whole semantics. Moreover, separation kernels are usually developed using C embedded with assembly. When it is formally verified at source code level, the kernel implementation is possible to be re-structured to make it compliant with the provided semantic model, such as in the seL4 microkernel verification \cite{Klein14}. This raises a new discussion about the validity of the new version of the kernel. However, although the modified kernel may not have the same behaviour as the original one, by the verification of functional correctness, which is carried out on the modified kernel, we obtain an implementation with the same functionality as the original kernel, and preserving the desirable set of safety and security properties. Concerning the correctness of the C and ISA model, the technique most commonly used is the validation of the provided semantic model w.r.t. the programming language or ISA. A validation framework automatically executes single instructions, or sequences of them, in the semantic model and in the real architecture, and it compares the results of both execution to check whether they are correct. In case some mismatch is found, it is possible to refine the semantic model to correct a possible error on it. The validation of hundreds of thousands of instructions will provide enough confidence about the correctness of the semantic model. \subsection{Overall Comparison} We give an overall comparison of formal methods application on separation kernels in this subsection. We compare the related work on aspects of the target of formal methods application, development processes covered by the formal methods used according to CC, verification approaches, estimated EAL in CC according to {{Table}} \ref{tab:cc_eal}, and scale of formal methods application in {{Table}} \ref{tab:overall_comp}. In addition to the normative definitions of EALs, the CC standard defines the possibility of intermediate levels of security when a requirement is evaluated at a higher level than that required by the target level. The addition of the symbol ``+'' represents this kind of evaluation. Formal verification of ED, PikeOS, and PROSPER does not have low-level design. They either prove the conformance between the high-level design and the implementation or use software model checking to analyze the implementation. \begin{table} \tbl{Overall Comparison \label{tab:overall_comp}}{% \begin{tabular}{|L{4.6cm}|C{2.3cm}|C{0.10cm}|C{0.10cm}|C{0.10cm}|C{0.10cm}|C{0.10cm}|C{1.2cm}|C{0.6cm}|c|} \hline \centering\multirow{2}{*}{\textbf{Related Work}}& \multirow{2}{*}{\textbf{Target}} & \multicolumn{5}{c|}{\textbf{\tabincell{c}{Formal Methods \\ on CC Process}}} & \multirow{2}{*}{\textbf{Approach}} & \multirow{2}{*}{\textbf{EAL}} & \multirow{2}{*}{\textbf{Scale}} \\ \cline{3-7} & & R & F & H & L & I & & & \rule{0pt}{0.3cm} \\\hline \hline GWV \cite{Greve03} & Properties & \cmark & \xmark & \xmark & \xmark & \xmark & TP & 4+ & + \\\hline Noninterference \cite{rushby92,von04,Murray12} & Properties & \cmark & \xmark & \xmark & \xmark & \xmark & TP & 4+ & ++ \\\hline MASK \cite{Martin00,Martin02} & Low-level model & \cmark & \cmark & \cmark & \cmark & \xmark & R, TP, CG & 7 & {?}%{$\divideontimes$} \\\hline MPS \cite{AFBMRTO02} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R & 5+ & ++ \\\hline An ARINC Scheduler \cite{Singhoff07} & Specification & \cmark & \cmark & \xmark & \xmark & \xmark & MC & 4+ & {?}%{$\divideontimes$} \\\hline Craig \cite{Craig07} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP & 5+ & ++ \\\hline LPSK \cite{Phelps08} & Specification & \cmark & \cmark & \xmark & \xmark & \xmark & TP & 4+ & {?}%{$\divideontimes$} \\\hline SPK \cite{Andre09} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP, CG & 5+ & {?}%{$\divideontimes$} \\\hline OS-K \cite{Kawamorita10} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP, MC & 5+ & {?}%{$\divideontimes$} \\\hline Verified Software \cite{Velykis10} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP & 5+ & ++ \\\hline Xenon \cite{freit11} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP & 5+ & +++ \\\hline CISK \cite{Verb14} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & TP & 5+ & ++ \\\hline ARINC 653 Standard \cite{zhao15} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP & 5+ & ++ \\\hline ED \cite{Heitmeyer06,Heitmeyer08} & Implementation model (source code) & \cmark & \cmark & \cmark & \xmark & \cmark & R, TP & 7 & ++ $^a$ \\\hline AAMP7 \cite{Greve04,Wilding10} & Low-level model & \cmark & \cmark & \cmark & \cmark & \xmark & R, TP & 7 & ++ $^b$ \\\hline INTEGRITY-178B \cite{Richards10} & Low-level model & \cmark & \cmark & \cmark & \cmark & \xmark & R, TP & 6+ & {?}%{$\divideontimes$} \\\hline PikeOS \cite{Baumann11,Tverdy11,Klaus15} & High-level model, Implementation model (source code) & \cmark & \cmark & \cmark & \xmark & \cmark & TP, MC & 6+ & ++ $^c$ \\\hline seL4 \cite{Murray13} & Implementation model (source code) & \cmark & \cmark & \cmark & \cmark & \cmark & R, TP, CA & 7+ & ++++ \\\hline PROSPER \cite{Dam13} & Implementation model (binary code) & \cmark & \cmark & \cmark & \xmark & \cmark & R, TP, CA & 7+ & +++ \\\hline XtratuM \cite{sanan14} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & R, TP & 5+ & ++ \\\hline mCertiKOS \cite{Costanzo16} & Implementation model (source code) & \cmark & \cmark & \cmark & \cmark & \cmark & R, TP, CA & 7+ & +++ \\\hline ARINC 653 \cite{Zhao16} & Specification & \cmark & \cmark & \xmark & \xmark & \xmark & TP & 5 & ++ \\\hline DEOS \cite{Penix00,Penix05,Ha04} & Implementation model (source code) & \cmark & \cmark & \cmark & \xmark & \cmark & TP, MC & 7 & {?}%{$\divideontimes$} \\\hline A VxWorks scheduler \cite{Asberg11} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & MC & 5+ & {?}%{$\divideontimes$} \\\hline RTSJ scheduler \cite{Zerzelidis06b,Zerzelidis10} & High-level model & \cmark & \cmark & \cmark & \xmark & \xmark & MC & 5+ & {?}%{$\divideontimes$} \\\hline \end{tabular}} \begin{tabnote}% \Note{Approach:} {Refinement (R), Theorem Proving (TP), Model Checking (MC), Code Abstraction (CA), Code Generation (CG)} \Note{Formal methods on CC process:} {Requirement (R), Functional specification (F), High-level design (H), Low-level design (L), Implementation (I)} \Note{Scale:} {+ (\textless 1k LOC), ++ (1k $\sim$ 10k LOC), +++ (10k $\sim$ 100k LOC), ++++ (\textgreater 100k LOC). The LOC includes the specification and proof} \tabnoteentry{$^{a,b,c}$}{ Only LOC of specification is available.} \end{tabnote}% \end{table} The highest assurance level of CC (EAL 7) requires formal methods application on the low-level design but not on the implementation. Aiming at security/safety of separation kernels as far as possible, a few research works have provided formal proof of refinement between the low-level design and the implementation, such as seL4 \cite{Murray13} and mCertiKOS \cite{Costanzo16}. Targeting at the source code by formal methods always means that they are applied on the implementation, which has overstepped the demand of EAL 7 in CC and estimated as EAL 7+ in {{Table}} \ref{tab:overall_comp}. Compared to the high cost of CC certification, formal verification on implementation is a low-cost way to provide more assurance of separation kernels as stated in \cite{Klein09}. Few work provides an estimation of time and cost of formal methods application on separation kernels. Thus, we cannot clearly compare them. A notable viewpoint is that the industry rules-of-thumb for CC EAL 6 certification is of $\mathdollar$1k/LOC, although it provides less assurance than formal verification \cite{Klein14}. \section{Challenges and Future Directions} \label{sec:chlg} We now discuss the remaining challenges in formal methods application on separation kernels and possible research directions that may be taken by future work. \subsection{Eliminating Specification Bottleneck} In formal methods, formal specification is a bottleneck in functional verification \cite{Beck14}. Therefore, simpler verification methods are often used in practice including (1) lightweight verification methods for finding bugs, (2) combining verification and testing, and (3) verifying generic and uniform properties. Due to high assurance of separation kernels and formal methods mandated by certification, the first method is obviously not sufficient. The second is always used in practice. The third is actually suitable for separation kernels. Using generic or uniform specifications can reduce the cost to create requirement specifications. Although lightweight properties, such as buffer overflows and null-pointer exceptions, are feasible in many cases, formal verification of relational properties, e.g. noninterference, is inevitable for separation kernels. The challenges and possible directions to eliminate specification bottleneck are shown as follows. (1) \emph{Properties of temporal separation}. The GWV and noninterference are the major properties for data separation and information flow security that have been widely applied in industry and academia. However, properties of temporal separation have not been thoroughly studied in the literature. A set of properties to clarify temporal separation are highly desired for high-assurance separation kernels. (2) \emph{Formal relations among properties}. We have figured out some formal relations in {{Fig.}} \ref{fig:comp_props}. Others are not explored. In particular, shared resources among partitions can affect the scheduling in separation kernels. But the relationship between spatial separation and temporal separation has not been studied in the literature and is not clear yet. On the other hand, there does not exist a precise and global framework for the relationship of critical properties of separation kernels and it deserves further study. (3) \emph{Generic formal specification}. For the purpose of the formal development, safety/security certification, and the study of formal relations between critical properties, it is highly necessary in the future to create a generic specification of separation kernels. This specification can be used to develop implementations using refinement and be revised gradually, and thus significantly alleviate the bottleneck. It has been attempted in the EURO-MILS project to deliver a generic specification for separation kernels \cite{Verb14}. (4) \emph{Reusability of formal specification}. Formal specification is a foundation for formal verification. Furthermore, it can also be applied to development, integration, and management of systems deployed on separation kernels \cite{Zhao16b}. A direction is to integrate domain knowledge into formal specification of separation kernels (e.g., \cite{AitAmeur16,Zhao16b}) to improve its reusability. (5) \emph{Flexibility of formal specification and proof}. Although reusability of the specification partially relies on the formal notation used and its supported tool, a well designed specification can evidently improve it. On the other hand, proofs should address how to deal with changes of formal model due to upgrading of separation kernels. Since re-verification is usually expensive for separation kernels, the proof change should be as small as possible when the uniform specification and design models are tailored or extended in real applications. A reusable design of the specification and its proof is a challenge for separation kernels. \subsection{Automating Full Formal Verification} Full formal verification of systems means that the verification is enforced not only on the specification but also covers all the source code and even the binary code with machine checkable proof. Formal verification at the implementation level can significantly improve the assurance of systems than other approaches, such as applying formal specification or lightweight properties over higher-level models \cite{Andronick12}. Full formal verification of programs had rarely been conducted and was often considered to be highly expensive \cite{Hall90} before successful practices of seL4 \cite{Klein09}, CompCert \cite{Leroy09}, and CertiKOS \cite{Gu15}. Full formal verification at the source code level is necessarily based on a set of assumptions, such as the correctness of the hardware and the compiler \cite{Klein09}. Whilst, formal verification at the binary code level overcomes assumptions on the correctness of the compiler. Full correctness of separation kernels by formal verification could be assured by a formal pervasive verification approach covering the hardware, compiler, and kernel itself exactly as proposed in the Verisoft XT project \cite{Hille08}. A major obstacle of this objective is that full formal verification of operating system kernels is usually manpower intensive, e.g., 20 person-years are invested in formal verification of seL4. We summarize a set of challenges and potential directions in automating full formal verification of separation kernels to alleviate enormous efforts as follows. (1) \emph{Automatic verification of critical properties}. As shown in {{Table}} \ref{tab:sk_verify_comp2}, existing works usually apply theorem proving to verify spatial separation of separation kernels. Automatic approaches at specification and design levels can enormously alleviate manual efforts and deserves further study. (2) \emph{Automatic refinement checking and property preservation}. A promising way to the correctness of low-level models is refinement. However, from seL4 we could see that it is often a time-consuming work to find and prove the refinement relation between two levels of specification \cite{Klein09}. Automatic refinement checking is thus worth considering in formal verification of separation kernels. \citeN{Zhao16b} have illustrated high degree of automatic refinement checking using Event-B. Second, it is critical that properties could be preserved during refinement. Refinement preservation of information flow security has been discussed in \cite{van12}. For separation kernels, refinement preservation of critical properties needs systematical study. (3) \emph{Proof generation during automatic verification}. Traditional model checking approaches produce the verification result directly. For the purpose of safety and security certification, it is necessary that automatic approaches generate proofs for the correctness. (4) \emph{Full formal verification at C source code level}. Programming in C is not sufficient for implementing separation kernels and programmers have to manipulate hardware directly by embedding assembly code in C. The assembly code is often omitted in full formal verification (e.g., seL4 \cite{Klein09}) and not supported by code abstraction tools, such as CParser \cite{GAK12} which translates a large subset of C-99 code into Isabelle/HOL. Existing works have to be extended for full formal verification considering C and assembly code together. \subsection{Dealing with Multicore and Concurrency} In the domain of high-assurance systems, an increasing trend is the adoption of multicore processor to fulfil demands of higher computing power \cite{parkinson11}. The overall performance of systems is improved by concurrent execution of instructions in multicore processors. The latest version of ARINC 653 \cite{ARINC653p14} specifies the functionality and system services of multicore separation kernels. As summarized in {{Table}} \ref{tab:impls1}, separation kernels from industry and academia mostly support multicore processors. Multicore kernels are challenging formal verification and the safety/security certification \cite{Cohen13}. To the best of our knowledge, there is no research work on formal verification of multicore kernels in the literature. Separation kernels are reactive systems whose execution is triggered by system calls and in-kernel events. In general, the execution of system calls of monocore kernels are non-preemptive. It is often assumed in formal verification that kernels do not have in-kernel concurrency and the execution of functions handling events is considered to be atomic, such as in \cite{Klein09}. In such a case, formal verification of critical properties could be decomposed to examine individual execution steps, i.e., atomic functions. This is the basic idea of the unwinding theorem \cite{rushby92} to reason about noninterference. However, kernels are preemptive when processing other interruptions and thus in-kernel concurrency exists in practice. On the other hand, multicore introduces more complicated concurrency in separation kernels. The complexity increases greatly due to concurrent execution among cores and the shared resources. Functions to handle events are shared-variable based parallel programs and are executed in an interleaved manner. A promising way of conquering this issue is compositional verification \cite{Shankar93,Young13}. Rely-guarantee method \cite{Jones83} is a fundamental approach for compositional reasoning of parallel programs with shared variables. We outline the challenges and potential directions in formal methods application on multicore separation kernels as follows. (1) \emph{Formalization of critical properties}. The original critical properties for separation kernels are usually defined on a state machine in which a transition is a big-step action (e.g., a system call). In the case of multicore, non-atomicity of events requires new formalization of critical properties. (2) \emph{Specification languages in theorem provers}. Existing specification of separation kernels uses inherent \emph{functions} of programming languages in theorem provers (e.g., Isabelle/HOL, Coq) to specify the atomic behavior of events. For multicore, specification languages which can express interleaved semantics and deal with complexity are required in theorem provers. (3) \emph{Compositional reasoning of critical properties}. Although compositional reasoning of language-based information flow security has been studied \cite{Mantel11,Murray16}, compositional reasoning of state-event based definitions, which are usually applied on operating system kernels, should be addressed in future. Compositional reasoning of other critical properties also deserves further study. Proof systems for compositional reasoning and their automation techniques are critical. (4) \emph{Parallel refinement}. Based on the specification languages, a refinement framework is certainly needed with considerations of concurrency and compositionality of refinement relation \cite{LiangFF14}. The critical properties of separation kernels are necessary to be preserved during parallel refinement of multicore specification. \subsection{Formal Development and Code Generation} \begin{table} \tbl{Statistics of Challenges \label{tab:chall_comp}}{% \begin{tabular}{|L{4.6cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|C{0.15cm}|} \hline \centering \multirow{2}{*}{\textbf{Related Work}} & \multicolumn{5}{c|}{\textbf{\tabincell{c}{Specification \\ Bottleneck}}} & \multicolumn{4}{c|}{\textbf{\tabincell{c}{Full Formal \\ Verification}}} & \multicolumn{4}{c|}{\textbf{\tabincell{c}{Multicore \\ Concurrency}}} & \multicolumn{2}{c|}{\textbf{\tabincell{c}{Formal \\ Dev.}}} \\ \cline{2-16} & 1 & 2 & 3 & 4 & 5 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 1 & 2 \\\hline \hline GWV \cite{Greve03} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & & \\\hline Noninterference \cite{rushby92,von04,Murray12} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & & \\\hline MASK \cite{Martin00,Martin02} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ \\\hline MPS \cite{AFBMRTO02} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & \\\hline An ARINC Scheduler \cite{Singhoff07} & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & & & & & & & \\\hline Craig \cite{Craig07} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & $\moon{15}$ \\\hline LPSK \cite{Phelps08} & & $\moon{15}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & $\moon[scale=0.8]{5}$ & $\moon{15}$ \\\hline SPK \cite{Andre09} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & $\moon[scale=0.8]{5}$ & & & & & & & $\moon[scale=0.8]{5}$ & \\\hline OS-K \cite{Kawamorita10} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & $\moon[scale=0.8]{5}$ & & & & & & & $\moon[scale=0.8]{5}$ & \\\hline Verified Software \cite{Velykis10} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & \\\hline Xenon \cite{freit11} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & \\\hline CISK \cite{Verb14} & & & $\moon{0}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & & \\\hline ARINC 653 Standard \cite{zhao15} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & $\moon[scale=0.8]{5}$ & \\\hline ED \cite{Heitmeyer06,Heitmeyer08} & & $\moon{15}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & & & & $\moon[scale=0.8]{5}$ \\\hline AAMP7 \cite{Greve04,Wilding10} & & $\moon[scale=0.8]{5}$ & & & & & & & $\moon[scale=0.8]{5}$ & & & $\moon{15}$ & & & $\moon[scale=0.8]{5}$ \\\hline INTEGRITY-178B \cite{Richards10} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & & & & $\moon[scale=0.8]{5}$ \\\hline PikeOS \cite{Baumann11,Tverdy11,Bond14,Klaus15} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & $\moon[scale=0.8]{5}$ & & & $\moon[scale=0.8]{5}$ & & & & & & \\\hline seL4 \cite{Murray13} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & $\moon{0}$ & & & & & & \\\hline PROSPER \cite{Dam13} & & & & & & & & & $\moon{0}$ & & & & & & \\\hline XtratuM \cite{sanan14} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & $\moon[scale=0.8]{5}$ & \\\hline mCertiKOS \cite{Costanzo16} & & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & $\moon{0}$ & & & $\moon[scale=0.8]{5}$ & & $\moon[scale=0.8]{5}$ & \\\hline ARINC 653 \cite{Zhao16} & & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & $\moon[scale=0.8]{5}$ & & & & & & & & & & $\moon[scale=0.8]{5}$ & \\\hline DEOS \cite{Penix00,Penix05,Ha04} & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & $\moon[scale=0.8]{5}$ & & & & & & \\\hline A VxWorks scheduler \cite{Asberg11} & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & & & & & & & \\\hline RTSJ scheduler \cite{Zerzelidis06b,Zerzelidis10} & $\moon[scale=0.8]{5}$ & & & & & $\moon[scale=0.8]{5}$ & & & & & & & & & \\\hline \end{tabular}} \begin{tabnote}% \Note{$\moon{0}$:}{the challenge has been addressed} \Note{$\moon[scale=0.8]{5}$:}{the challenge has been partially addressed} \Note{$\moon{15}$:}{ the authors have mentioned the challenge but failed to address it} \Note{}{The blank is that the literature does not mention this kind of problem.} \end{tabnote}% \end{table} Separation kernels are always formally verified by the post-hoc approach, i.e., formal verification on an existing implementation. One promise of formal methods is to develop formal models step by step and generate code automatically or manually from the model whose correctness and properties have been formally verified. The benefit of formal development for separation kernels is significant. First, the specification and the verification targets, i.e. implementations of separation kernel, are developed in tandem, the specification bottleneck can be greatly alleviated. Second, formal proofs requested by safety/security certification can be generated during refinement-based development. Third, developing source code is a time-consuming and error-prone process. Automatic code generation via certified/verified tools can alleviate many efforts to design and implementation and provide rigorous arguments to validate the generated code. For this purpose, the following challenges need to be addressed in the future. (1) \emph{Stepwise refinement for formal development supporting multicore}. In formal verification of seL4 \cite{Klein09,Murray13} and ED \cite{Heitmeyer08}, refinement methods have been applied. Due to the post-hoc verification objective of these projects, refinement is not a technique to develop the specification in a stepwise manner, but to prove the conformance between formalizations at different levels. Therefore, they have few levels of specification and the refinement is coarse-grained. For the purpose of formal development, a stepwise refinement framework, which is able to deal with additional design elements (e.g., new events and new state variables) and concurrency, is highly desired. (2) \emph{Verified code generation and traceability}. Formal synthesis of separation kernels is difficult since the code should be very efficient and embedded with assembly code to manipulate hardware. Therefore, the machine model have to be considered in the formal synthesis. On the other hand, verified synthesis and traceability of the code to formal models are required for certifications. \subsection{Summary} We have compared typical related work which have (partially) addressed the challenges and studied the potential directions mentioned in {{Table}} \ref{tab:chall_comp}. From the table, we could see that the challenge of specification bottleneck has been widely considered, in particular the generality and reusability of formal specification. Full formal verification has attracted large efforts in recent years, e.g., seL4, mCertiKOS, and PROSPER, in which full formal verification of the source code or binary code has been done. As a new trend in high-assurance systems, multicore and concurrency issues in formal verification of separation kernels have not been addressed. To the best of our knowledge, except some efforts to preemptive and interruptable OSs \cite{Chen16,Xu16}, there is no research work on formal verification of multicore kernels. Formal development and code generation for separation kernels has been partially considered in some research works. However, issues considering automatic code generation have not been addressed. \section{Conclusion} \label{sec:concl} We have surveyed, categorized and comparatively analyzed major research works in formal methods application on separation kernels. Our analytical framework clarifies the scope of formal methods application on separation kernels and characterizes the separation kernels. The taxonomy and survey of research works have distilled existing efforts in this field to the current date. This survey additionally gives an overview and limitations of existing works by a detailed comparison and analysis. We also highlight the challenges and future directions. With this snapshot of the overall research landscape, we thus hope the separation kernel community can better explore various potential opportunities to further improve the safety and security of separation kernel implementations and reduce the cost of development and certification by formal methods application.
{'timestamp': '2017-01-09T02:02:48', 'yymm': '1701', 'arxiv_id': '1701.01535', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01535'}
arxiv
\section{An Architecture to \\Tame the Challenges of CPS} \label{sec:arch} This section looks into the design of the proposed \emph{SD-CPS}\xspace approach, and how it attempts to tackle the identified core challenges of CPS~\cite{lee2008cyber}, including modelling, incremental building and testing, execution in a sandbox and production environments, scalability, reusability of services through service compositions, fault-tolerance, and resilience. Current software-defined approaches can broadly be categorized into: i) approaches that extend or use SDN and SDN controllers, and ii) approaches that follow a similar architecture or motivation of SDN while not actually leveraging SDN as it is. \emph{SD-CPS}\xspace employs a hybrid approach: It leverages the SDN when SDN is already a part of the deployment architecture of the CPS; however it does not make SDN a pre-requisite, to ensure a wider adoption. \subsection{\emph{SD-CPS}\xspace Controller APIs} The core of \emph{SD-CPS}\xspace is a controller deployment, that controls the ``cyber'' of the CPS and centrally orchestrates the CPS elements. \emph{SD-CPS}\xspace controller consists of a deployment of multiple SDN controllers and further software components to manage the CPS. The control plane communicates with the underlying network through OpenFlow and other SDN southbound protocol implementations, while communicating with the devices that are non-compliant with OpenFlow through a similar approach inspired by OpenFlow. This ensures that while \emph{SD-CPS}\xspace has SDN at its core, it is not limited to software-defined networks with SDN switches that are still far from widespread in IoT and CPS settings. \emph{SD-CPS}\xspace devises its APIs, adapting that of SDN~\cite{jarschel2014interfaces} for the extended distributed controller deployment for CPS. Figure~\ref{fig:bb} depicts the \emph{SD-CPS}\xspace controller along with the larger \emph{SD-CPS}\xspace ecosystem. \vspace{-1em} \begin{figure}[ht] \begin{center} \resizebox{\columnwidth}{!}{ \includegraphics[width=\textwidth]{bb-sdcps.png} } \vspace{-2em} \end{center} \caption{Controller of the ``Cyber'' of \emph{SD-CPS}\xspace} \vspace{-1em} \label{fig:bb} \end{figure} \textbf{The Northbound API} communicates with the tenant applications, and takes into account the user involvement and human interaction into the CPS. It allows management of smart devices in a tenant-aware manner respecting the tenant intents and system policies as defined from the application layer. It consists of typical SDN northbound protocols including REST and Message-Oriented Middleware (MOM)~\cite{curry2004message} protocols such as Advanced Message Queuing Protocol (AMQP)~\cite{vinoski2006advanced} or MQTT(formerly, Message Queue Telemetry Transport)~\cite{locke2010mq} for the tenant processes to interact with the controller. As MOM protocols are long researched for use with networks of wireless sensors and actuators~\cite{hunkeler2008mqtt,collina2012introducing}, extending SDN with MOM increases its applicability, in addition to scalability. \textbf{The Southbound API} controls the data plane elements which are physical devices in addition to the regular SDN switches. It handles the communication, coordination, and integration of the network data plane consisting of the CPS devices with the control plane. The southbound consists of typical SDN southbound implementations such as OpenFlow protocol~\cite{mckeown2008openflow} and additional light-weight protocols such as MOM protocols for the communication with the physical devices. \textbf{The Westbound API} enables inter-control communication among the controllers in \emph{SD-CPS}\xspace, as well as inter-domain communications across multiple \emph{SD-CPS}\xspace controller deployments, through their westbound. The controller farm provides a federated deployment of controllers in each \emph{SD-CPS}\xspace control plane consisting of multiple SDN controllers that have protected access to the internal storage of each other. Hence multi-domain networks can be controlled in a centralized, yet multi-tenanted manner, i.e. without sharing the single controller. This offers multi-tenancy and tenant isolation in the CPS networks which typically have to share the network for the data and control flows unlike the traditional data center networks that can have dedicated bandwidth for each. Thus the controller farm and the westbound API facilitate the execution and interoperability of various entities in \emph{SD-CPS}\xspace, coordinated by SDN controllers, legacy network controllers, and the other controllers of physical devices and cyberspace. \textbf{The Eastbound API} is leveraged by the administrators to configure and manage the controller deployment itself. By offering a restricted access to the tenant space in the internal data store of the controller, sensors and actuators in a sensor network can efficiently collaborate and communicate with one another and with the controller. This produces a \textbf{Software-Defined Sensor Network}, that can control sensor networks and heterogeneous smart devices, extending a controller farm of SDN controllers with lightweight southbound MOM protocols. Equipped with i) the global view of the system from the SDN controller, and ii) scalability of the control plane from the controller farm, the Software-Defined Sensor Network makes flow and process decisions based on the tenant preferences and system policies from the cyberspace application layer. \subsection{\emph{SD-CPS}\xspace Core Enablers} \emph{SD-CPS}\xspace architecture adheres to the functions and attributes of CPS while not sacrificing the capabilities of CPS and to maintain backward compatibility with existing CPS architectures. This can be articulated in a \textbf{5C level} architecture~\cite{lee2015cyber} in a bottom-up approach: i) Software-Defined Sensor Networks representing the \textbf{Smart Connection Level} stays the core bottom-most element in the 5C level architecture which is responsible for plug \& play of sensor networks. \emph{SD-CPS}\xspace further leverages the controller farm to offer a teather-free communication for the network. ii) \textbf{Data-to-Information Conversion Level} handles multi-dimensional data analytics. \emph{SD-CPS}\xspace Software-Defined Service Composition visualizes the analytics as microservices and executes the multi-dimensional data correlation as service compositions. iii) \textbf{Cyber Level} supported by the \emph{SD-CPS}\xspace modelling sandbox offers a twin representation for the physical devices and their cyber counterpart with identification and memory across time, offering data mining capabilities in the cyber representation for decision making. iv) \textbf{Cognition Level} targets the human aspects with modelling, simulation, and visual aspects of CPS. The Software-Defined Simulations enable integrated visualization and synthesis for the Cognition Level. and v) \textbf{Configuration Level} offers self-configuration and adjustment for resilience, optimization, and healing capabilities as the top-most layer of the architecture. \subsubsection{\textbf{Software-Defined Service Composition}} CPS networks share the data and control flows over the same network bandwidth, despite the heterogeneity in data flow of various CPS and devices. Hence in order to isolate the bandwidth allocation, the controller farm is leveraged to offer a tenant-aware virtual network allocation. This provides differentiated QoS for various applications and devices sharing the network. The execution is broken into sub executions to enable parallel and independent executions. This Software-Defined Service Composition enables executions as microservices in the control plane. Leveraging the potential multiple alternative execution paths that exist in the devices' execution path and those that are enabled by the virtual tenant network allocation, Software-Defined Service Composition enables breaking down complex computations into distributed service executions that can be executed in parallel in controller and CPS devices' firmware with differentiated priority and control. Through a common API and an SDN-based approach, \emph{SD-CPS}\xspace Software-Defined Service Composition enables web services to be composed through various distributed execution paradigms such as MapReduce~\cite{dean2008mapreduce} and Dryad~\cite{isard2007dryad}, in addition to the traditional web services engines to fit the requirements of the CPS. It further allows the services detection and execution to be dynamic, to balance the load across various services nodes. It does so by leveraging the network load information readily available to the SDN controller, as well as the service-level information such as requests on the fly and the requests in the queue that are available to the web services engine, and the services deployment information available to the web services registry. \subsubsection{\textbf{Modelling Sandbox}} The \emph{SD-CPS}\xspace modelling sandbox offers modelling and orchestrating capabilities, thus using the controller as a sandbox in modelling the complex CPS in real world. \textbf{Software-Defined Simulations} bring the simulations of SDN systems close to the systems that they model, where the system being simulated is separated from the simulated application logic. Following a software-defined approach, Software-Defined Simulation models and continuously and iteratively designs the CPS. Thus the simulation in cyberspace will be closer to the execution in the cyber-physical deployment. The modelling sandbox further offers dynamic management capabilities to heterogeneous systems by providing a software-defined approach to orchestrate various stages of development, from simulations, emulations, to physical deployments. \subsection{Resilience in \emph{SD-CPS}\xspace} Ensuring resilience in CPS is a primary goal of \emph{SD-CPS}\xspace. \emph{SD-CPS}\xspace attempts to leverage the global knowledge of the entire CPS network to ensure that the elements of the connected CPS are efficiently leveraged in ensuring correct and high performance execution. Computation power is often rare at the physical location to perform complex computations. Hence, computation-intensive algorithms of the physical devices is delegated to the cyberspace and executed as a composition of microservices, choosing virtual execution spaces in the controller environment. The microservice-based execution avoids repeated computation efforts. The data flow goes through various intermediaries in a traditional workflow. The workflows can be sent through the potential alternatives to ensure load balancing and fair resource utilization. The availability and readiness of redundancy in execution alternatives enables workflows to be executed in a distributed and parallel manner when possible. Figure~\ref{fig:action} models a wireframe of the underlying system of CPS with data flow between two smart devices, with multiple potential paths. The origin and destination nodes are the start and the end nodes of a communication caused by a distributed computation. In a data center network, these nodes are hosts or servers, while the intermediate nodes are traditionally switches that connect the large underlying network. However, due to the heterogeneous nature of CPS, origin and/or destination can be smart mobile devices or virtual execution spaces in the controller, while intermediate and/or destination nodes can be surrogate nodes such as computer servers. Without sacrificing the details, \emph{SD-CPS}\xspace views this as a connected network. \begin{figure}[ht] \begin{center} \resizebox{\columnwidth}{!}{ \includegraphics[width=\textwidth]{actionsc.png} } \vspace{-1.5em} \end{center} \caption{Execution as a Service Composition and Alternative Execution Paths} \label{fig:action} \end{figure} In addition, the path redundancy makes CPS fault-tolerant and ready to handle unexpected failures and congestion. With the dynamic traffic of network flows, a few service or network nodes and links may become congested. Moreover, some nodes may be prone to failures. \emph{SD-CPS}\xspace attempts to identify the congested, malfunctioning, or malicious nodes and links (that are highlighted and differentiated as unhealthy in Figure~\ref{fig:action} for the ease of reference) through its southbound API. When an intermediary is identified as failed or slow, \emph{SD-CPS}\xspace enforces a partial redundancy in the data flows to ensure correctness and end-to-end delivery. \emph{SD-CPS}\xspace approach creates subflows by diverting or cloning parts of the flows, and sends them towards a node known as the clone destination. In case 1, the clone destination is same as the original destination. However, case 2 has a clone destination that differs from the original. Here the cloned subflow is sent towards an intermediate node on the original path connecting the origin and destination. The flow is recomposed afterwards. The case 2 approach minimizes unnecessary redundancy when it is possible to recompose the flow at the clone destination or an intermediate node. When such a recompose of flows is impossible at an intermediate node due to the technical difficulties or due to the nature of the congestion or network failure itself, the flow is eventually recomposed when it reaches the destination host as in the case 1. \subsection{Security in \emph{SD-CPS}\xspace} It is essential to secure the controller in \emph{SD-CPS}\xspace for a correct execution, as an unprotected controller will become a vulnerability on its own. General researches on improving the SDN security are and will be relevant and applicable here, with further extensions for the southbound API for the CPS. The centralized control avoids the potentials for a network segmentation. Thus, with the global knowledge of the CPS, the \emph{SD-CPS}\xspace controller mitigates the risks of resource scarcity or external attacks in the intermediate nodes in the underlying network and system. Moreover, the awareness of the application and network enables the controller to differentiate the quality of service (QoS) offered to the tenant applications based on the importance or service-level agreements (SLA). Nevertheless, distributed fault-tolerance and recovery upon system and network failures are handled efficiently using the controller as a centralized arbiter in the network. As reported for the traditional networks, threats on confidentiality, integrity, availability, and consistency are inherent to the network, and are not introduced by SDN itself~\cite{schehlmann2014blessing}. The vulnerability in privacy due to the co-existence and shared space of tenants, and issues in scale are caused by poor implementation than the design of SDN. \emph{SD-CPS}\xspace avoids these through the highly available, multi-tenanted, federated controller deployment, designed as the controller farm. \section{Background} \label{sec:background} \section{Conclusion and Future Work} \label{sec:conclusion} \balance In this paper we presented \emph{SD-CPS}\xspace, an approach and architecture that aims to mitigate the application and design challenges faced by CPS. \emph{SD-CPS}\xspace leverages the SDN switches and controllers when available, while employing an approach motivated by SDN even during the absence of SDN switches. Hence it remains compatible with and applicable to existing CPS deployments that do not have SDN. \emph{SD-CPS}\xspace opens up many research avenues on envisioning and improving SDN for CPS architectures and evaluating implementation alternatives. As a future work, the proposed approach should be deployed in various CPS and tested for its efficiency in addressing the identified shortcomings. \vspace{1em} \scriptsize{ \textit{\textbf{Acknowledgements:}} This work was supported by national funds through Funda\c{c}\~{a}o para a Ci\^{e}ncia e a Tecnologia with reference UID/CEC/50021/2013 and a PhD grant offered by the Erasmus Mundus Joint Doctorate in Distributed Computing (EMJD-DC). } \section{Current Prototype} \label{sec:impl} We prototyped \emph{SD-CPS}\xspace with OpenDaylight~\cite{medved2014opendaylight} Beryllium as the core SDN controller, Oracle Java 1.8.0 as the programming language, and ActiveMQ 5.14.2~\cite{snyder2011activemq} as the message broker of MOM protocols. \subsection{Modelling and Scaling CPS with \emph{SD-CPS}\xspace} The scale and complexity of the CPS increase due to either the larger number of devices and components, or their heterogeneity. Typically, the controller is the element with the highest processing power in the \emph{SD-CPS}\xspace ecosystem. It manages the communication and coordination across all the entities, including the CPS, humans, and the tenant applications. The federated controller deployment ensures smooth scaling and decision making in the large-scale execution environments. As the controller itself is multi-tenanted with protected access to multiple domains or tenant spaces, management and orchestration of the intelligent agents and their data in the cyberspace are handled seamlessly with scale. Through Software-Defined Simulations, the designed systems are initially modelled as simulations that are still coordinated by the centralized controller in the same way the physical system that it models is coordinated. Hence, the simulations function as a virtual proxy for the system that is being designed. The systems are in practice implemented once in simulation, and then in physical deployment, reusing the same single effort, having controller as a unified execution space. As the modelling sandbox functions as a controlled modelling space of the designed CPS, unpredictability of the execution environment is significantly reduced. Figure~\ref{fig:sim} represents how the systems are modelled in the sandbox environment of \emph{SD-CPS}\xspace controller. The controller farm of \emph{SD-CPS}\xspace orchestrates both the physical systems and their simulated counterparts in the cyberspace. With a one-to-one mapping between the simulated virtual intelligent agents and interdependent components of the physical system, the interactions are modelled and closely monitored in the controlled sandbox environment before the decisions are loaded into the physical space. \vspace{-1em} \begin{figure}[ht] \begin{center} \resizebox{\columnwidth}{!}{ \includegraphics[width=\textwidth]{sim.png} } \vspace{-2em} \end{center} \caption{Modelling with \emph{SD-CPS}\xspace Approach} \vspace{-1em} \label{fig:sim} \end{figure} The model follows the Software-Defined Simulations and orchestration approach, and attempts to minimize the code duplication by executing the real code from the controller, instead of having a simulation or model running custom code independent of the real execution. As the controller is developed in a high-level language such as Java, \emph{SD-CPS}\xspace enables deployment of custom applications as controller plugins to alter or reprogram the behaviour of CPS. The physical system loads the decisions from the cyberspace. A multi-tenanted execution space ensures modelling of multiple CPS in parallel. \subsection{Implementation Details} \emph{SD-CPS}\xspace extends and leverages our previous work as the core enablers of the software-defined approach for CPS. \paragraph*{\textbf{Smart Connection and Data-to-Information Conversion Levels}} CHIEF~\cite{7527806} designs the controller farm, a federated deployment of SDN controllers, to manage scalable multi-domain cloud networks. Initially designed for community network clouds, CHIEF was exploited as the \emph{SD-CPS}\xspace controller farm for any large scale network composed of multiple tenants with heterogeneous devices and access. In addition to the network management, CHIEF offers auxiliary services such as throttling and network monitoring through its event-based extended SDN architecture. \emph{SD-CPS}\xspace extends Mayan~\cite{kathiravelu2016building} to offer Software-Defined Service Composition for microservices representing the CPS executions. Cassowary~\cite{kathiravelu2015cassowary} designs Software-Defined Sensor Networks for smart buildings leveraging SDN and MOM protocols. We extend Cassowary to facilitate a wider adoption of SDN with loose coupling to the underlying network or SDN switches. \paragraph*{\textbf{Cyber and Cognition Levels}} SDNSim~\cite{kathiravelu2016software} offers Software-Defined Simulations. Built on top of SDNSim, SENDIM~\cite{kathiravelu2016sendim} enables systems to be designed and deployed seamlessly across various realizations and deployments. Originally developed for cloud and data centers, SENDIM is extended for CPS, IoT, or any software-defined systems and networks, as the modelling sandbox of \emph{SD-CPS}\xspace. \paragraph*{\textbf{Configuration Level}} Core configuration data is stored in the controller by exposing its persistent in-memory data store through the REST and MOM protocol implementations of \emph{SD-CPS}\xspace northbound API. The data store of \emph{SD-CPS}\xspace extends the OpenDaylight controller data tree. \subsection{Feasibility Assessment} Through a few simulations and microbenchmarks, we demonstrated that \emph{SD-CPS}\xspace increases the potential scale of the CPS. \emph{SD-CPS}\xspace controller performance was increased through the deployment of controller farm~\cite{7527806}. A near-linear performance growth with the number of controller instances up to a maximum value followed by a near-logarithmic growth was observed~\cite{kathiravelu2016building}. The reduced performance gain is due to idling controllers for each service execution. Hence, the performance gain depends on the problem size and its distribution as services in service composition. Furthermore, the modelling sandbox reduces the time in modelling as it offers a dual reality of cyber-physical spaces for simulations and designs. \section{Introduction} \label{sec:intro} While the Internet of Things (IoT)~\cite{xia2012internet} motivates for a scenario where there are many smart devices that are all connected together and are accessible pervasively in the Internet, reality is still far from this. We do have several networks of things, where the smart devices (or the ``things'') are interconnected to form network of devices, or connected to an existing enterprise network. However, one needs not to have \textit{the Internet of Things} literally, as it is not necessary to connect everything to the Internet, the single unified network of networks. It is not only unnecessary, but also counter-intuitive to have everything connected and open beyond what is necessary, due to security and privacy reasons. Cyber-Physical Systems (CPS) fix the shortcomings and limitations in the definition of IoT and similar terms, in clearly defining the common larger ground of theories and practice where the physical/mechanical systems intersect and deeply intertwine with the cyber/computer systems~\cite{lee2015past}. While sharing the core architecture with IoT~\cite{atzori2010internet}, CPS is defined as a pure interdisciplinary mechanism, with applications ranging from smart homes~\cite{munir2014depsys} to smart cities~\cite{pacheco2016design}. Though CPS is a term that is coined relatively in recent times, there have been research and implementation efforts on the topic even before the inception of the term~\cite{leitao2016industrial}. Due to the scale and variety in its implementation and devices, CPS faces a set of challenges in design and practice~\cite{lee2008cyber}, including: i) unpredictability of the execution environments~\cite{lee2007computing}, ii) communication and coordination within the system~\cite{persson2015communication}, iii) security, distributed fault-tolerance, and recovery upon system and network failures~\cite{cardenas2009challenges}, iv) decision making in the large-scale geo-distributed execution environments, v) modelling and designing the systems~\cite{derler2012modeling}, and vi) management and orchestration of the intelligent agents. The challenges are imposed from both the core domains of CPS, including networking, distributed systems, or the physical systems involved, as well as the challenges that manifest due to the co-existence and interdependencies of the cyberspace and physical devices in CPS. A unified approach is necessary to address the challenges that prevent or hinder the seamless adoption, applicability, and reusability of the CPS principles and constructs pervasively. Software-Defined Networking (SDN) offers reusability and management capabilities, among many other improvements, to networks by separating the control layer as a unified controller, away from the distributed network's data forwarding elements. There have been recent researches on leveraging SDN in the implementation of CPS. SDN has been proposed to improve the resilience of multinetworks in CPS~\cite{qin2014asoftware}. SDN has been leveraged to secure the CPS networks through SDN-assisted emulations~\cite{antonioli2015minicps} and improve the resilience~\cite{dong2015software} of CPS. We propose to tackle the current and foreseen future challenges of CPS through a middleware architecture following a software-defined approach. We call the proposed approach for CPS, ``Software-Defined Cyber-Physical Systems (SD-CPS)''. Designed as a middleware platform inspired by the logically centralized control offered by the SDN controllers, \emph{SD-CPS}\xspace aims to tackle the core challenges of CPS as an architectural enhancement. \section{Related Work} \label{sec:related_work} Use cases of SDN have been steadily spanning beyond the traditional networks, from sensor networks to smart buildings. \paragraph*{\textbf{SDN and OpenFlow}} Wireless Sensor Networks (WSN)~\cite{romer2004design} have the requirement to be context-aware. They need to handle a larger control traffic due to their dynamic nature compared to data center networks, while having to share the bandwidth among control and data traffic. Sensor OpenFlow (SOF)~\cite{luo2012sensor} identifies the benefits of a Software-Defined WSN, leveraging SDN for WSN. SOF increases manageability of WSN and adapts to policy changes of wireless networks and mobile devices. Albatross~\cite{leners2015taming} discusses the challenges faced by distributed systems, and aims to mitigate them by leveraging SDN. The challenges such as split-brain scenarios and violations in consistency and availability that are addressed by Albatross are relevant for CPS too. However, while CPS is a distributed system, it has its own peculiar challenges due to its diverse nature in implementation and devices as we discussed earlier. \paragraph*{\textbf{Smart Environments and CPS}} Software-Defined Environment (SDE)~\cite{dixon2014software,li2014software} focuses on factors such as i) resource abstraction based on capability, ii) workload abstraction and definition based on policies, goals, and, business/mission objectives, iii) workload orchestration, and iv) continuous mapping and optimization of workload and the available resources. SDN controller and physical and virtual SDN switches remain the heart of SDE. The control of compute, network, and storage is built atop a virtualized network. Software-Defined Buildings (SDB)~\cite{dawson2012energy} envision a Building Operating System (BOS) which functions as a sandbox environment for various device firmwares to run as applications atop it. The BOS spans across multiple buildings in a campus, than confining itself to a single building. SDB and SDE architectures can be extended for CPS. However, they cannot cater for CPS by themselves due to the variety and heterogeneity in the architecture and requirements of CPS compared to the environments controlled by SDB and SDE. \paragraph*{\textbf{Software-Defined Internet of Things (SDIoT)}} SDIoT~\cite{jararweh2015sdiot} proposes a software-defined architecture for IoT devices by handling the security~\cite{al2015sdsecurity}, storage~\cite{darabseh2015sdstorage}, and network aspects in a software-defined approach. SDIoT proposes an IoT controller composed of controllers of software-defined networking, storage, security, and others. This controller operates as an orchestrating middleware between the data-as-a-service layer consists of end user applications, and the physical layer consists of the database pool and sensor networks. Multinetwork INformation Architecture (MINA) self-observing and adaptive middleware~\cite{qin2014mina} has been extended with a layered SDN controller to implement a controller architecture for IoT~\cite{qin2014software}. Various research and enterprise use cases are proposed and implemented, including SDIoT for smart urban sensing~\cite{liu2015software}, and end-to-end service network orchestration~\cite{vilalta2016end}. While sharing similarities with IoT, CPS is set to address a larger set of problems with more focus on ground issues on interoperability of cyber and physical spaces and dimensions in a CPS. Hence, \emph{SD-CPS}\xspace differs in scope to that of SDN for IoT researches such as SDIoT, though they share similar motivation. \vspace{-0.4em}
{'timestamp': '2017-01-09T02:06:55', 'yymm': '1701', 'arxiv_id': '1701.01676', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01676'}
arxiv
\section{Introduction} \IEEEPARstart{P}{olar} codes~\cite{Arikan_2009} are a family of codes that achieve capacity on binary, memoryless, symmetric (BMS) channels and have low-complexity construction, encoding, and decoding algorithms. This is the setting we consider. Polar codes have since been extended to a variety of settings including source-coding~\cite{arikan_2010_source, korada}, non-binary channels~\cite{sasoglu_fnt}, asymmetric channels~\cite{Honda_Yamamoto_2013}, settings with memory~\cite{sasoglu_2011_mem,sasoglu_2016,Shuval_Tal_Memory_2017}, and more. The probability of error of polar codes is given by a union of correlated error events. The union bound, which ignores this correlation, is used to upper-bound the error probability. In this work, we exploit the correlation between error events to develop a general method for lower-bounding the probability of error of polar codes. \begin{figure}[t] \centering \definecolor{mycolor1}{rgb}{1.00000,0.00000,1.00000}% \begin{tikzpicture} \begin{axis}[% width=7cm, height=7cm, scale only axis, grid = major, xmin=0.13, xmax=0.22, xlabel={Crossover probability}, ymode=log, ymin=1e-10, ymax= 0.002, ylabel={Probability of error}, legend style={at={(0.02,0.99)},anchor=north west,legend cell align=left,align=left,fill=white, draw=none} ] \addplot [color=cyan,solid,mark=x,mark options={solid}] table[row sep=crcr]{% 0.13 3.850869663323411e-10\\ 0.14 2.941405887386531e-09\\ 0.15 1.935488070643073e-08\\ 0.16 1.139631130132584e-07\\ 0.17 6.238867069515004e-07\\ 0.18 3.261014180666720e-06\\ 0.19 1.640412664303528e-05\\ 0.2 7.835253524825373e-05\\ 0.21 3.477550110270991e-04\\ 0.22 0.001403696167960\\ }; \addlegendentry{\small Upper Bound}; \addplot [color=blue,solid,mark=square,mark options={solid}] table[row sep=crcr]{% 0.13 1.545255000000000e-10\\ 0.14 1.159648000000000e-09\\ 0.15 7.346006e-09\\ 0.16 4.011035e-08\\ 0.17 1.918491e-07\\ 0.18 8.154281e-07\\ 0.19 3.115159e-06\\ 0.2 1.228296e-05\\ 0.21 5.337406e-05\\ 0.22 0.0002041444\\ }; \addlegendentry{\small Trivial Lower Bound}; \addplot [color=red,solid,mark=o,mark options={solid}] table[row sep=crcr]{% 0.13 3.821036930057008e-10\\ 0.14 2.882313752550001e-09\\ 0.15 1.881575980820003e-08\\ 0.16 1.087182732840000e-07\\ 0.17 5.730457175799999e-07\\ 0.18 2.791437222699995e-06\\ 0.19 1.299938258659999e-05\\ 0.2 5.354927595200003e-05\\ 0.21 2.158925888600008e-04 \\ 0.22 7.756549415500035e-04\\ }; \addlegendentry{\small New Lower Bound}; \end{axis} \end{tikzpicture}% \caption{Bounds on the probability of error of a rate $0.1$ polar code of length $2^{10}$ designed for a BSC with crossover probability $0.2$. The code was used over BSCs with a range of crossover probabilities. The upper bound is based on~\cite{Tal_2013}. The trivial lower bound is a lower bound on the probability of error of worst synthetic channel in the non-frozen set. The new lower bound was computed using the techniques of this paper.} \label{fig_bounds} \end{figure} \Cref{fig_bounds} shows a numerical example of the lower bound developed in this paper. We designed a polar code of length $N=2^{10}=1024$ and rate $R=0.1$ for a Binary Symmetric Channel (BSC) with crossover probability $0.2$. We plot upper and lower bounds on the probability of error of this code under successive cancellation decoding, when used over BSCs of varying crossover probabilities. Our lower bound significantly improves upon the existing (trivial) lower bound, and is tight over a large range of crossover probabilities. Our method is based on lower-bounding the probability of correlated error events. It consists of several operations and transformations that we detail throughout this article. A high-level description of the key steps appears at the end of the introduction, once we establish some notation. Polar codes are based on an iterative construction that transforms $N=2^n$ identical and independent channel uses into low-entropy and high-entropy channels. The low-entropy channels are almost noiseless, whereas the high-entropy channels are almost pure noise. Ar\i{}kan showed~\cite{Arikan_2009} that for every $\epsilon>0$, as $N \to \infty$ the proportion of channels with capacity greater than $1-\epsilon$ tends to the channel capacity $C$ and the proportion of channels with capacity less than $\epsilon$ tends to $1-C$. The polar construction begins with two identical and independent copies of a BMS channel $W$ and transforms them into two new channels, \begin{align} W^-(y_1,y_2|u_1) &= \frac{1}{2} \sum_{u_2} W(y_1| u_1\oplus u_2)W(y_2|u_2),\nonumber\\ W^+(y_1,y_2,u_1|u_2) &= \frac{1}{2} W(y_1|u_1\oplus u_2)W(y_2|u_2).\label{eq_plus transform} \end{align} Channel $W^+$ is a better channel than $W$ whereas channel $W^-$ is worse than $W$.\footnote{By this we mean that channel $W^+$ can be stochastically degraded to channel $W$, which in turn can be stochastically degraded to $W^-$.} This construction can be repeated multiple times; each time we take two identical copies of a channel, say $W^+$ and $W^+$, and polarize them, e.g., to $W^{+-}$ and $W^{++}$. We call the operation $W \mapsto W^{-}$ a `$-$'-transform, and the operation $W \mapsto W^{+}$ a `$+$'-transform. There are $N=2^n$ possible combinations of $n$ `$-$'- and `$+$'-transforms; we define channel $W_a$ as follows. Let $\langle \alpha_1,\alpha_2,\ldots, \alpha_n \rangle$ be the binary expansion of $a-1$, where $\alpha_1$ is the most significant bit (MSB). Then, channel $W_a$ is obtained by $n$ transforms of $W$ according to the sequence $\alpha_1,\alpha_2,\ldots, \alpha_n$, starting with the MSB: if $\alpha_j = 0$ we do a `$-$'-transform and if $\alpha_j = 1$ we do a `$+$'-transform. For example, if $n=3$, channel $W_5$ is $W^{+--}$, i.e., it first undergoes a `$+$'-transform and then two `$-$'-transforms. Overall, we obtain $N$ channels $W_1, \ldots, W_N$; channel $W_a$ has input $u_a$ and output $y_1,\ldots, y_N, u_1,\ldots, u_{a-1}$. That is, channel $W_a$ has binary input $u_a$, output that consists of the output and input of channel $W_{a-1}$, and assumes that the input bits of future channels $u_{a+1},\ldots,u_{N}$ are uniform. We call these \emph{synthetic channels}. One then determines which synthetic channels are low-entropy and which are high-entropy, and transmits information over the low-entropy synthetic channels and predetermined values over the high-entropy synthetic channels. Since the values transmitted over the latter are predetermined, we call the high-entropy synthetic channels \emph{frozen}. Decoding is accomplished via the successive-cancellation (SC) decoder. It decodes the synthetic channels in succession, using previous bit decisions as part of the output. The bit decision for a synthetic channel is either based on its likelihood or, if it is frozen, on its predetermined value. That is, denoting the set of non-frozen synthetic channels by $\mathcal{A}$, \[ \hat{U}_a(y_1^N, \hat{u}_1^{a-1}) = \begin{dcases} \argmax_{u_a} W_a(y_1^N,\hat{u}_1^{a-1}|u_a), & a \in \mathcal{A} \\ u_a, & a \in \mathcal{A}^c, \end{dcases} \] where we denoted $y_1^N = y_1,\ldots,y_N$ and similarly for the previous bit decisions $\hat{u}_1^{a-1}$. As non-frozen synthetic channels are almost noiseless, previous bit decisions are assumed to be correct. Thus, when $N$ is sufficiently large, this scheme can be shown to achieve capacity~\cite{Arikan_2009}, as the proportion of almost noiseless channels is $C$. To analyze the performance of polar codes, let $\mathcal{B}_a$ denote the event that channel $W_a$ errs under SC decoding while channels $1,2,\ldots,a-1$ do not. That is, \[ \mathcal{B}_a = \left\{u_1^N, y_1^N\,|\,\hat{u}_1^{a-1} = u_1^{a-1}, \, \hat{U}_a(y_1^N,\hat{u}_1^{a-1}) \neq u_a\right\}.\] The probability of error of polar codes under SC decoding is given by $\Prob{\bigcup_{a \in \mathcal{A}} \mathcal{B}_a}$. Let $\mathcal{E}_a$ denote the event that channel $W_a$ errs given that a genie had revealed to it the true previous bits, i.e. \[ \mathcal{E}_a = \left\{u_1^N, y_1^N\,|\,\hat{U}_a(y_1^N,u_1^{a-1}) \neq u_a\right\}.\] We call an SC decoder with access to genie-provided previous bits a \emph{genie-aided decoder}. Some thought reveals that $\bigcup_{a \in \mathcal{A}} \mathcal{B}_a = \bigcup_{a \in \mathcal{A}} \mathcal{E}_a$ (see~\cite[Proposition 2.1]{sasoglu_fnt} or~\cite[Lemma 1]{Mori_Tanaka_2009}). Thus, the probability of error of polar codes under SC decoding is equivalently given by $P_e^{\textrm{\textup{SC}}}(W) = \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a}$. In the sequel we assume a genie-aided decoder. The events $\{\mathcal{B}_a\}$ are disjoint but difficult to analyze. The events $\mathcal{E}_a$ are easier to analyze, but are no longer disjoint. A straightforward upper bound for $\Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a}$ is the union bound: \begin{equation} \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a} \leq \sum_{a \in \mathcal{A}} \Prob{\mathcal{E}_a}.\label{eq_union bound} \end{equation} This bound facilitated the analysis of~\cite{Arikan_2009}. An important question is how tight this upper bound is. To this end, one approach is to develop a lower bound to $\Prob{\bigcup_{a\in \mathcal{A}} \mathcal{E}_a}$, which is what we pursue in this work. A trivial lower bound on a union is \begin{equation} \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a} \geq \max_{a \in \mathcal{A}} \Prob{\mathcal{E}_a}. \label{eq_trivial lower bound} \end{equation} Better lower bounds may be obtained by considering pairs of error events: \begin{equation*} \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a} \geq \max_{a,b \in \mathcal{A}} \Prob{\mathcal{E}_a \cup \mathcal{E}_b}.\label{eq_lower bound union of two events} \end{equation*} Via the inclusion-exclusion principle, one can combine lower bounds on multiple pairs of error events to obtain a better lower bound~\cite{Hoppe_1985} \begin{equation} \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a} \geq \sum_{a \in \mathcal{A}} \Prob{\mathcal{E}_a} - \sum_{\substack{a,b \in \mathcal{A}, \\a<b}} \Prob{\mathcal{E}_a \cap \mathcal{E}_b}. \label{eq_inclusion exclusion lower bound} \end{equation} This can also be cast in terms of unions of error events using $\Prob{\mathcal{E}_a\cap\mathcal{E}_b} =\Prob{\mathcal{E}_a}+\Prob{\mathcal{E}_b}- \Prob{\mathcal{E}_a\cup\mathcal{E}_b}$. To our knowledge, to date there have been two attempts to compute a lower bound on the performance of the SC decoder, both based on~\eqref{eq_inclusion exclusion lower bound}. The first attempt was in~\cite{Mori_Tanaka_2009}, using a density evolution approach, and the second attempt in~\cite{Parizi_2013} applies only to the Binary Erasure Channel (BEC). We briefly introduce these below, but first we explain where the difficulty lies. The probability $\Prob{\mathcal{E}_a}$ is given by an appropriate functional of the probability distribution of synthetic channel $W_a$. However, the output alphabet of $W_a$ is very large. If the output alphabet of $W$ is $\mathcal{Y}$ then the output alphabet of $W_a$ has size $|\mathcal{Y}|^N 2^{a-1}$. This quickly grows unwieldy, recalling that $N = 2^n$. It is infeasible to store this probability distribution and it must be approximated. Such approximations are the subject of~\cite{Tal_2013}; they enable one to compute upper and lower bounds on various functionals of the synthetic channel $W_a$. To compute probabilities of unions of events, one must know the joint distribution of two synthetic channels. The size of the joint channel's output alphabet is the product of each synthetic channel's alphabet size, rendering the joint distribution infeasible to store. The authors of~\cite{Mori_Tanaka_2009} suggested to approximate the joint distribution of pairs of synthetic channels using a density evolution approach. This provides an iterative method to compute the joint channel, but does not address the problem of the amount of memory required to store it. Practical implementation of density evolution must involve quantization~\cite[Appendix B]{mct}. The probability of error derived from quantized joint channels approximates, but does not generally bound, the real probability of error. For the special case of the BEC, as noted and analyzed in~\cite{Mori_Tanaka_2009}, no quantization is needed, as the polar transform of a BEC is a BEC. Thus, they were able to precisely compute the probabilities of unions of error events of descendants of a BEC using density evolution. The same bounds for the BEC were developed in~\cite{Parizi_2013} using a different approach, again relying on the property that the polar transform of a BEC is a BEC. The authors were able to track the joint probability of erasure during the polarization process. Furthermore, they were able to show that the union bound is asymptotically tight for the BEC. In this work, we develop an algorithm to compute lower bounds on the joint probability of error of two synthetic channels $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. Our technique is general, and applies to synthetic channels that are polar descendants of any BMS channel. We use these bounds in~\eqref{eq_inclusion exclusion lower bound} to lower-bound the probability of error of polar codes. For the special case of the BEC, we recover the results of~\cite{Mori_Tanaka_2009} and~\cite{Parizi_2013} using our bounds. Concretely, consider two synthetic channels, $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$, which we call the a-channel and the b-channel, respectively. Their joint channel is $W_{a,b}(y_a,y_b|u_a,u_b)$. Our algorithm lower-bound the probability that a successive cancellation decoder errs on either channel. It is based on the following key steps: \begin{enumerate} \item Replace successive cancellation with a different decoding criterion (\Cref{sec_decoding two dependent channels}). \item Bring the joint channel to a different form that makes the b-channel decoding immediately apparent from the received symbol (\Cref{subsec_d value representation}). \item Apply the \emph{symmetrizing} transform, after which the output of the a-channel is independent of the input of the b-channel (\Cref{sec_Symmetrized Joint Bit-Channels}). \item Apply the \emph{upgrade-couple} transform, which splits each a-channel output to multiple symbols. However, each such new symbol is constrained to appear with only a small subset of b-channel outputs (\Cref{subsec_Upgrading $W_a$}). \item Reduce each channel's alphabet size. This is done by stochastically upgrading one channel while keeping the other channel constant. Each channel has a different upgrading procedure; the a-channel upgrading procedure is detailed in \Cref{subsec_Upgrading $W_a$}, and the b-channel upgrading procedure is detailed in \Cref{subsec_upgrading $W_b$}. \end{enumerate} \section{Overview of Our Method} In this section we provide a brief overview of our method, and lay out the groundwork for the sections that follow. We aim to produce a lower bound on the probability of error of two synthetic channels. Since we cannot know the precise joint distribution, we must approximate it. The approximation is rooted in stochastic degradation. Degradation is a partial ordering of channels. Let $W(y|u)$ and $Q(z|u)$ be two channels. We say that $W$ is (stochastically) degraded with respect to $Q$, denoted $W \preccurlyeq Q$, when there exists some channel $P(y|z)$ such that \begin{equation}\label{eq_definition of degradation} W(y|u) = \sum_{z} P(y|z)Q(z|u).\end{equation} If $W$ is degraded with respect to $Q$ then $Q$ is upgraded with respect to $W$. Degradation implies an ordering on the probability of error of the channels~\cite[Chapter 4]{mct}: if $ W \preccurlyeq Q$ then $P_e^{\star}(W) \geq P_e^{\star}(Q)$, where $P_e^{\star}$ denotes the probability of error of the optimal decoder (defined in \Cref{sec_decoding general case}). The notion of degradation readily applies to joint channels. If $W_{a,b}(y_a,y_b|u_a,u_b)$ and $Q_{a,b}(z_a,z_b|u_a,u_b)$ are two joint channels, we say that $Q_{a,b}(z_a,z_b|u_a,u_b) \succcurlyeq W_{a,b}(y_a,y_b|u_a,u_b)$ via some degrading channel $P(y_a,y_b|z_a,z_b)$ if \begin{equation} W_{a,b}(y_a,y_b|u_a,u_b) = \sum_{\mathclap{z_a,z_b}} P(y_a,y_b|z_a,z_b)Q_{a,b}(z_a,z_b|u_a,u_b). \label{eq_definition of joint degradation}\end{equation} As for the single channel case, if $Q_{a,b} \succcurlyeq W_{a,b}$ then $P_e^{\star}(W_{a,b}) \geq P_e^{\star}(Q_{a,b})$, where $P_e^{\star}$ is the probability of error of the \emph{optimal} decoder for the joint channel. Indeed our approach will be to approximate the joint synthetic channel with an upgraded joint channel with smaller output alphabet. There is a snag, however: this ordering of error probabilities does not hold, in general, for suboptimal decoders. The SC decoder, used for polar codes, is suboptimal. In the genie-aided case, which we consider here, it is equivalent to performing a maximum likelihood decision on each marginal separately. We shall demonstrate the suboptimality of the SC decoder in \Cref{sec_decoding two dependent channels}. Then, we will develop a different decoding criterion whose performance lower-bounds the SC decoder performance and is ordered by degradation. While in general finding this decoder requires an exhaustive search, for the special case of polar codes this decoder is easily found. It does, however, imply a special structure for the degrading channel, which we use to our advantage. We investigate the joint distribution of two synthetic channels in \Cref{sec_properties of joint bit channels}. We first bring it to a more convenient form that will be used in the sequel. Then, we explain how to polarize a joint synthetic channel distribution and explore some consequences of symmetry. Further consequences of symmetry are the subject of \Cref{sec_Symmetrized Joint Bit-Channels}, in which we transform the channel to another form that greatly simplifies the steps that follow. This form exposes the inherent structure of the joint channel. How to actually upgrade joint channels is the subject of \Cref{sec_upgrading procedures for joint bit channels}. We upgrade the joint channel in two ways; each upgrades one marginal without changing the other. We cannot simply upgrade the marginals, as we must consider the joint channel as a whole. This is where the above-mentioned symmetrizing and upgrade-couple transforms come into play. We present our algorithm for lower-bounding the probability of error of polar codes in \Cref{sec_lower bound procedures}. This algorithm is based on the building blocks presented in the previous sections. Details of our implementation appears in \Cref{sec_implementation}. We demonstrate our algorithm with some numerical results in \Cref{sec_numerical results}, and conclude with a short discussion in \Cref{sec_discussion}. \subsection{Notation} We denote by $y_j^k = y_j,y_{j+1},\ldots,y_k$ for $j<k$. We use an Iverson-style notation (see~\cite{knuth_notation}) for indicator (characteristic) functions. That is, for a logical expression $\mathtt{expr}$, $\kindi{\mathtt{expr}}$ is $0$ whenever $\mathtt{expr}$ is not true and is $1$ otherwise. We assume that the indicator function takes precedence whenever it appears, e.g., $n^{-1}\kindi{n>0}$ is $0$ for $n=0$. \section{Decoding of Two Dependent Channels}\label{sec_decoding two dependent channels} In this section, we tackle decoding of two dependent channels. We explain how this differs from the case of decoding a single channel, and dispel some misconceptions that may arise. We then specialize the discussion to polar codes. We explain the difficulty with combining the SC decoder with degradation procedures, and develop a different decoding criterion instead. Finally, we develop a special structure for the degrading channel that, combined with the decoding criterion, implies ordering of probability of error by degradation. \subsection{General Case}\label{sec_decoding general case} A decoder for channel $W:\mathcal{U} \to \mathcal{Y}$ is a mapping $\phi$ that maps every output symbol $y \in \mathcal{Y}$ to some $u \in \mathcal{U}$. The average probability of error of the decoder for equiprobable inputs is given by \[ P_e(W) = \sum_{u} \sum_{y} \frac{W(y|u)}{|\mathcal{U}|} \Prob{\phi(y) \neq u}. \] The decoder is deterministic for symbols $y$ for which $\Prob{\phi(y) \neq u}$ assumes only the values $0$ and $1$. For some symbols, however, we allow the decoder to make a random decision. If $W(y|u) = W(y|u')$ for some $u,u' \in \mathcal{U}$, then $P_e(W)$ is the same whether $\phi(y) = u$ or $\phi(y) = u'$. Thus, the probability of error is insensitive to the resolution of ties. We denote the error event of a decoder by $\mathcal{E} = \left\{ (u,y): \phi(y) \neq u \right\}.$ It is dependent on the decoder, i.e., $\mathcal{E} = \mathcal{E}(\phi)$; we suppress this to avoid cumbersome notation. Clearly, $P_e(W) = \Prob{\mathcal{E}}$. The maximum-likelihood (ML) decoder, well known to minimize $P_e(W)$ when the input bits are equiprobable, is defined by \begin{equation}\label{eq_Definition of ML decoder} W(y|u) > W(y|u')\quad \forall u' \neq u \Rightarrow \phi(y) = u.\end{equation} The ML decoder is not unique, as it does not define how ties are resolved. In the absence of ties, the ML decoding rule is $\phi(y) = \argmax_u W(y|u)$. We denote by $P_e^{\textrm{\textup{ML}}}(W)$ the probability of error of the ML decoder. We now consider two \emph{dependent} binary-input channels, $W_a:\mathcal{U}\to\mathcal{Y}_a$ and $W_b:\mathcal{U}\to \mathcal{Y}_b$, with joint distribution $W_{a,b}: \mathcal{U}\times\mathcal{U} \to \mathcal{Y}_a \times \mathcal{Y}_b$. A decoder is a mapping $\phi:\mathcal{Y}_a \times \mathcal{Y}_b \to \mathcal{U}\times\mathcal{U}$. The joint probability of error of the decoder is, as above, \begin{equation} \begin{split} &P_e(W_{a,b}) \\&= \sum_{u_a,u_b}\sum_{y_a,y_b} \frac{W_{a,b}(y_a,y_b|u_a,u_b)}{|\mathcal{U}|^2} \Prob{\phi(y_a,y_b) \neq (u_a,u_b)}. \end{split}\label{eq_joint prob of error} \end{equation} An optimal decoder for the joint channel considers both outputs together and makes a decision for both inputs jointly, to minimize $P_e(W_{a,b})$. We denote its probability of error by $P_e^{\star}(W_{a,b})$. When the input bits are equiprobable, $P_e^{\star}(W_{a,b}) = P_e^{\textrm{\textup{ML}}}(W_{a,b})$. Rather than jointly decoding the input bits based on the joint output, we may opt to decode each marginal channel separately. That is, consider decoders of the form $\phi(y_a,y_b) = (\phi_a(y_a), \phi_b(y_b))$. In words, the decoder of channel $W_a$ bases its decision solely on $y_a$ and completely ignores $y_b$ and vice versa. What are the optimal decoders $\phi_a$ and $\phi_b$? The answer depends on the criterion of optimality. Denote by $\mathcal{E}_i$ the error event of channel $W_i$ under some decoder $\phi_i:\mathcal{Y}_i \to \mathcal{U}$. The \emph{Individual Maximum Likelihood }(IML) decoder minimizes each individual marginal channel's probability of error. That is, we set $\phi_a$ and $\phi_b$ as ML decoders for their respective marginal channels. We denote its joint probability of error by $P_e^{\textrm{\textup{IML}}}(W_{a,b})$. Hence, $P_e^{\textrm{\textup{IML}}}(W_{a,b})$ is computed by~\eqref{eq_joint prob of error}, with $\phi(y_a,y_b) = (\phi_a^{\textrm{\textup{ML}}}(y_a), \phi_b^{\textrm{\textup{ML}}}(y_b))$, where $\phi_a^{\textrm{\textup{ML}}}$ and $\phi_b^{\textrm{\textup{ML}}}$ are ML decoders for the marginal channels $W_a$ and $W_b$, respectively. Another criterion is to minimize $\Prob{\mathcal{E}_a\cup\mathcal{E}_b}$, the probability that at least one of the decoders makes an error. We call the decoder that minimizes this probability using individual decoders for each channel the \emph{Individual Minimum Joint Probability of error} (IMJP) decoder. The event $\mathcal{E}_a \cup \mathcal{E}_b$ is not the same as the error event of the optimal decoder for the joint channel, even when the individual decoders turn out to be ML decoders. This is because we decode each input bit separately using only a portion of the joint output. Clearly, \begin{equation} \label{eq_ordering of error probabilities} P_e^{\star}(W_{a,b}) \leq \min_{\phi_a, \phi_b} \Prob{\mathcal{E}_a \cup \mathcal{E}_b} \leq P_e^{\textrm{\textup{IML}}}(W_{a,b}).\end{equation} We denote \[ P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) = \min_{\phi_a, \phi_b} \Prob{\mathcal{E}_a \cup \mathcal{E}_b}.\] The three decoders in~\eqref{eq_ordering of error probabilities} successively use less information for their decisions. The optimal decoder uses both outputs jointly as well as knowledge of the joint probability distribution; the IMJP decoder retains the knowledge of the joint probability distribution, but uses each output separately; finally, the IML decoder dispenses with the joint probability distribution and operates as if the marginals are independent channels. \begin{example}\label{ex_Joint BMS where P(EML1UEML2) is not optimal} The conditional distribution $W_{a,b}(y_a, y_b|u_a,u_b)$ of some joint channel is given in \Cref{tab_Example of channel where ML is not the same as minimizing P(E1UE2)}.\footnote{This is not a joint distribution of two synthetic channels that result from polarization. However, the phenomena observed here hold for joint distributions of two synthetic channels as well, and similar examples may be constructed for the polar case.} The marginals are channels $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$. Three decoders for this channel are shown in \Cref{tab_Example of decoders}. Note that for the IML and IMJP decoders we have $\phi(y_a,y_b) = (\phi_a(y_a),\phi_b(y_b))$. The optimal decoder for the joint channel chooses, for each output pair, the input pair with the highest probability. The IML decoder is formed by using an ML decoder for each marginal; the ML decoders of the marginals decide that the input is $0$ when $1$ is received and vice versa. The IMJP decoder is found by checking all combinations of marginal channel decoders $\phi_a$ and $\phi_b$ and choosing that pair the achieves $\min_{\phi_a, \phi_b}\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. We then have \begin{align*} P_e^{\star}(W_{a,b}) &= 1-(0.44+0.54+0.32+0.62)/4 = 0.52, \\ P_e^{\textrm{\textup{IML}}}(W_{a,b}) &= 1-(0.05+0.49+0.01+0.62)/4 = 0.7075, \\ P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) &= 1-(0.22+0.49+0.04+0.62)/4 = 0.6575. \end{align*} As expected,~\eqref{eq_ordering of error probabilities} holds. We now demonstrate that the probability of error of suboptimal decoders is not ordered by degradation. To this end, we degrade the joint channel in \Cref{tab_Example of channel where ML is not the same as minimizing P(E1UE2)} by merging the output symbols $(0,0), (1,1)$ into a new symbol, $(0',0')$ and $(0,1), (1,0)$ into a new symbol, $(1',1')$. We denote the new joint channel by $W'_{a,b}$ and provide its conditional distribution in \Cref{tab_Example of degraded channel}. For each of the marginals, the ML decoder declares $0$ upon receipt of $0'$, and $1$ otherwise. Hence, for the degraded channel, $P_e^{\textrm{\textup{IML}}}(W'_{a,b}) = 1 - (0.92+0.86)/4 = 0.555$, which is \emph{lower} than $P_e^{\textrm{\textup{IML}}}(W_{a,b})$. For the degraded channel, the IML decoder is also the optimal decoder. As this is a degraded channel, however, $P_e^{\textrm{\textup{IML}}}(W'_{a,b}) = P_e^{\star}(W'_{a,b}) \geq P_e^{\star}(W_{a,b}) = 0.52$. \begin{table}[t] \centering \caption{Conditional distribution $W_{a,b}(y_a,y_b|u_a,u_b)$. In this case, the ML decoders of the marginals do not minimize $\Prob{\mathcal{E}_a\cup\mathcal{E}_b}$.} \label{tab_Example of channel where ML is not the same as minimizing P(E1UE2)} \begin{tabular}{ccccc} \toprule \multirow{2}[3]{*}{$(u_a,u_b)$} & \multicolumn{4}{c}{$(y_a,y_b)$}\\ \cmidrule(rl){2-5} & $(0,0)$ & $(0,1)$ & $(1,0)$ & $(1,1)$ \\ \midrule $(0,0)$ & $0.30$ & $0.04$ & $0.04$ & $0.62$ \\ $(0,1)$ & $0.44$ & $0.46$ & $0.01$ & $0.09$ \\ $(1,0)$ & $0.22$ & $0.49$ & $0.24$ & $0.05$ \\ $(1,1)$ & $0.05$ & $0.54$ & $0.32$ & $0.09$ \\ \bottomrule \end{tabular} \end{table} \begin{table}[t] \centering \caption{Various decoders for joint channel $W_{a,b}$ from \Cref{tab_Example of channel where ML is not the same as minimizing P(E1UE2)}. Three decoders are shown: the optimal decoder, the IML decoder, and the IMJP decoder. The leftmost column is the received joint channel output, and the remaining columns depict the decisions of the various decoders.} \label{tab_Example of decoders} \begin{tabular}{cccc} \toprule \multirow{2}[3]{*}{$(y_a,y_b)$} & \multicolumn{3}{c}{$(\hat{u}_a,\hat{u}_b) = \phi(y_a,y_b)$}\\ \cmidrule(rl){2-4} & optimal & IML & IMJP \\ \midrule $(0,0)$ & $(0,1)$ & $(1,1)$ & $(1,0)$ \\ $(0,1)$ & $(1,1)$ & $(1,0)$ & $(1,0)$ \\ $(1,0)$ & $(1,1)$ & $(0,1)$ & $(0,0)$ \\ $(1,1)$ & $(0,0)$ & $(0,0)$ & $(0,0)$ \\ \bottomrule \end{tabular} \end{table} \begin{table}[t] \centering \caption{Channel $W'_{a,b}(y_a,y_b|u_a,u_b)$, degraded from $W_{a,b}$ of \Cref{tab_Example of channel where ML is not the same as minimizing P(E1UE2)}.} \label{tab_Example of degraded channel} \begin{tabular}{ccc} \toprule \multirow{2}[3]{*}{$(u_a,u_b)$} & \multicolumn{2}{c}{$(y_a,y_b)$}\\ \cmidrule(rl){2-3} & $(0',0')$ & $(1',1')$ \\ \midrule $(0,0)$ & $0.92$ & $0.08$ \\ $(0,1)$ & $0.53$ & $0.47$ \\ $(1,0)$ & $0.27$ & $0.73$ \\ $(1,1)$ & $0.14$ & $0.86$ \\ \bottomrule \end{tabular} \end{table} \end{example} \subsection{Polar Coding Setting}\label{subsec_Polar Coding Setting} Given a joint channel, finding an optimal or IML decoder is an easy task. In both cases we use maximum-likelihood decoders; in the first case based on the joint channel, whereas in the second case based on the marginal channels. On the other hand, finding an IMJP decoder requires an exhaustive search, which may be costly. In the polar coding setting, as we now show, the special structure of joint synthetic channels permits finding the IMJP decoder without resorting to a search procedure. \subsubsection{Joint Distribution of Two Synthetic Channels} Let $W$ be some BMS channel that undergoes $n$ polarization steps. Let $a$ and $b$ be two indices of synthetic channels, where $b>a$. The synthetic channels are $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$, where $y_a = (y_1^N,u_1^{a-1})$, $y_b = (y_1^N,u_1^{b-1})$, and $N=2^n$. We call them the \emph{a-channel} and the \emph{b-channel}, respectively. Their joint distribution is $W_{a,b}(y_a,y_b|u_a,u_b)$; this is the probability that the output of the a-channel is $y_a$ and the output of the b-channel is $y_b$, given that the inputs to the channels are $u_a$ and $u_b$, respectively. With probability $1$, the prefix of $y_b$ is $(y_a,u_a)$. Namely, $y_b$ has the form \[ y_b = ((y_1^N,u_1^{a-1}), u_a, u_{a+1}^{b-1}) \equiv (y_a,u_a,y_{r}),\] where $y_{r}$ denotes the remainder of $y_b$ after removing $y_a$ and $u_a$. Thus, \begin{equation}\label{eq_Wab and its relationship to Wb} W_{a,b} (y_a,y_b|u_a,u_b) = 2W_b(y_b|u_b)\kindi{y_b = (y_a,u_a,y_{r})},\end{equation} for some arbitrary $y_{r}$. The factor $2$ stems from the uniform distribution of $u_a$. With some abuse of notation, we will write \begin{align*} W_{a,b}(y_a,y_b|u_a,u_b) &= W_{a,b}(y_b|u_a,u_b)\\ &= W_{a,b}(y_a,u_a,y_{r}|u_a,u_b). \end{align*} The rightmost expression makes it clear that the portion of $y_b$ in which the input of the a-channel appears must equal the actual input of the a-channel. Observe from~\eqref{eq_Wab and its relationship to Wb} that we can think of $W_b(y_a,u_a,y_{r}|u_b)$ as the joint channel $W_{a,b}$ up to a constant factor. Indeed, we will use $W_b(y_a,u_a,y_{r}|u_b)$ to denote the joint channel where convenient. \subsubsection{Decoders for Joint Synthetic Channels} Which decoders can we consider for joint synthetic channels? The optimal decoder extracts $u_a$ from the output of the b-channel and proceeds to decode $u_b$. This outperforms the SC decoder but is also impractical and does not lend itself to computing the probability that is of interest to us, the probability that \emph{either} of the synthetic channels errs. A natural suggestion is to mimic the SC decoder, i.e., to use an IML decoder. The joint probability of error of this decoder may decrease after stochastic degradation, so we discard this option. Consider two decoders $\phi_a$ and $\phi_b$ for channels $W_a$ and $W_b$, respectively. As above, $\mathcal{E}_i$ is the error event of channel $W_i$ using decoder $\phi_i$, $i=a,b$. We seek a lower bound on $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. Therefore, we choose decoders $\phi_a$ and $\phi_b$ that minimize $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$; this is none other than the IMJP decoder. Its performance lower-bounds that of the IML decoder [see~\eqref{eq_ordering of error probabilities}]. As we shall later see, combined with a suitable degrading channel structure, the probability of error of the IMJP decoder increases after stochastic degradation. Conversely, it decreases under stochastic upgradation; thus, combining the IMJP decoder with a suitable upgrading procedure produces the desired lower bound. Multiple decoders may achieve $\min_{\phi_a,\phi_b}\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. One decoder can be found in a straight-forward manner; we call it \emph{the} IMJP decoder. The following theorem shows how to find it. Its proof is a direct consequence of \Cref{lem_optimal phi2 is ML decoder,lem_optimal phi1 for given phi2} that follow. \begin{theorem} \label{thm_minimizing phi_a and phi_b for polar channel} Let $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$ be two channels with joint distribution $W_{a,b}$ that satisfies~\eqref{eq_Wab and its relationship to Wb}. Then, $\min_{\phi_a,\phi_b}\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$ is achieved by setting $\phi_b$ as an ML decoder for $W_b$ and $\phi_a$ according to \begin{equation} \label{eq_phi1 as argmax} \phi_a(y_a) = \argmax_{u_a} T(y_a|u_a),\end{equation} where \begin{equation} \label{eq_def of T(y_a|x_a)} T(y_a|u_a) = \frac{1}{2}\sum_{\substack{u_b,\\y_b}} W_{a,b}(y_a,y_b|u_a,u_b) \Prob{\phi_b(y_b) = u_b}. \end{equation} \end{theorem} Note that $T(y_a|u_a)$ is not a conditional distribution; it is non-negative, but its sum over $y_a$ does not necessarily equal $1$. In the right-hand side of~\eqref{eq_def of T(y_a|x_a)}, the dependence on $y_a,u_a$ is via~\eqref{eq_Wab and its relationship to Wb}, as $W_{a,b}(y_a,y_b|u_a,u_b) = 0$ if $y_b \neq (y_a,u_a,y_{r})$ for some $y_{r}$. \begin{corollary} \Cref{thm_minimizing phi_a and phi_b for polar channel} holds for any two synthetic channels $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$ that result from the same number of polarization steps of a BMS, where index $b$ is greater than $a$. \end{corollary} \begin{IEEEproof} In the polar code case, the joint channel satisfies~\eqref{eq_Wab and its relationship to Wb}, so \Cref{thm_minimizing phi_a and phi_b for polar channel} applies. \end{IEEEproof} In what follows, denote \[\varphi_i(y_i,u_i) \triangleq \Prob{\phi_i(y_i) = u_i},\quad i=a,b.\] \begin{lemma} \label{lem_optimal phi2 is ML decoder} Let $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$ be two dependent binary-input channels with equiprobable inputs and joint distribution $W_{a,b}$ that satisfies~\eqref{eq_Wab and its relationship to Wb}. Let $\phi_a:\mathcal{Y}_a \to \mathcal{U}$ be some decoder for channel $W_a$ with error event $\mathcal{E}_a$. Then, setting $\phi_b$ as an ML decoder for $W_b$ achieves $\min_{\phi_b} \Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. \end{lemma} \begin{IEEEproof} Recall that $y_b = (y_a,u_a,y_{r})$. Using~\eqref{eq_Wab and its relationship to Wb}, \begin{align*} & 1-\Prob{\mathcal{E}_a \cup \mathcal{E}_b} \\ & \quad= \frac{1}{4} \sum_{\substack{u_a,\\u_b}} \sum_{\substack{y_a,\\y_b}} W_{a,b}(y_a,y_b|u_a,u_b) \varphi_a(y_a,u_a)\varphi_b(y_b,u_b)\\ & \quad = \frac{1}{2} \sum_{\substack{u_a,\\y_a,y_b}}\varphi_a(y_a,u_a) \kindi{y_b = (y_a,u_a,y_{r})}g(y_b), \end{align*} where \[ g(y_b) = \sum_{u_b} \varphi_b(y_b,u_b)W_b(y_b|u_b).\] The problem of finding the decoder $\phi_b$ that minimizes $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$ is separable over $u_a,y_a,y_b$; the terms $\varphi_a(y_a,u_a)$, $\kindi{y_b = (y_a,u_a,y_{r})}$ are non-negative and independent of $u_b$. Therefore, the optimal decoder $\phi_b$ is given by $ \phi_b(y_b) = \arg \max_{u'_b} W_b(y_b|u'_b).$ \end{IEEEproof} We remark that \Cref{lem_optimal phi2 is ML decoder} holds for \emph{any} a-channel decoder $\phi_a$. Thus, regardless of the selection of $\phi_a$, the optimal decoder for the b-channel (in the sense of minimizing $\min_{\phi_b} \Prob{\mathcal{E}_a \cup \mathcal{E}_b}$) is an ML decoder. \begin{lemma} \label{lem_optimal phi1 for given phi2} Let $W_a(y_a|u_a)$ and $W_b(y_b|u_b)$ be two binary-input channels with joint distribution $W_{a,b}(y_a,y_b|u_a,u_b)$ and equiprobable inputs. Let $\phi_b:\mathcal{Y}_b \to \mathcal{U}$ be some decoder for channel $W_b$. Then, the decoder $\phi_a$ for channel $W_a$ given by~\eqref{eq_phi1 as argmax} minimizes $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$. \end{lemma} \begin{IEEEproof} Since the input is equiprobable, \begin{align*} & 1-\Prob{\mathcal{E}_a \cup \mathcal{E}_b} \\ &= \frac{1}{4} \sum_{\substack{u_a,\\y_a}} \sum_{\substack{u_b,\\y_b}} W_{a,b}(y_a,y_b|u_a,u_b) \varphi_a(y_a,u_a)\varphi_b(y_b,u_b)\\ &= \frac{1}{2} \sum_{\substack{u_a,\\ y_a}} \varphi_a(y_a,u_a) \cdot \frac{1}{2}\sum_{\substack{u_b,\\ y_b}} W_{a,b}(y_a,y_b|u_a,u_b)\varphi_b(y_b,u_b) \\ &= \frac{1}{2} \sum_{\substack{u_a,\\ y_a}} T(y_a|u_a)\varphi_a(y_a,u_a), \end{align*} where the last equality is by~\eqref{eq_def of T(y_a|x_a)}. The problem of finding the decoder $\phi_a$ that minimizes $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$ is separable over $y_a$; clearly the optimal decoder is the one that sets $ \phi_a(y_a) = \arg \max_{u'_a} T(y_a|u'_a). $ \end{IEEEproof} Using~\eqref{eq_Wab and its relationship to Wb}, if $\phi_b$ is chosen as an ML decoder, as per \Cref{lem_optimal phi2 is ML decoder}, we have the following expression for $T(y_a|u_a)$: \begin{equation} \begin{split} T(y_a|u_a) &= \sum_{y_{r}}\sum_{u_b} W_b(y_a,u_a,y_{r}|u_b)\varphi_b(y_b,u_b) \\ &= \sum_{y_{r}} \max_{u_b} W_b(y_a,u_a,y_{r}|u_b). \end{split} \label{eq_expressions for T using yba} \end{equation} The IMJP and IML decoders do not coincide in general, although in some cases they may indeed coincide. We demonstrate this in the following example. \begin{example} Let $W$ be a binary symmetric channel with crossover probability $p$. We perform $n=2$ polarization steps and consider the joint channel $W_{1,4}$, i.e., $W_a = W^{--}$ and $W_b = W^{++}$. When $p=0.4$, we have $ 0.6544 = P_e^{\textrm{\textup{IMJP}}}(W_{1,4}) < P_e^{\textrm{\textup{IML}}}(W_{1,4}) = 0.6976$. On the other hand, when $p=0.2$, the IMJP and IML decoders coincide, and $P_e^{\textrm{\textup{IMJP}}}(W_{1,4}) = P_e^{\textrm{\textup{IML}}}(W_{1,4}) = 0.5136$. In either case,~\eqref{eq_ordering of error probabilities} holds. \end{example} \begin{remark} In the special case where $W$ is a BEC and $W_a$ and $W_b$ are two of its polar descendants, the IMJP and IML (SC) decoders coincide. This is thanks to a special property of the BEC that erasures for a synthetic channel are determined by the outputs of the $N=2^n$ copies of a BEC, regardless of the inputs of previous synthetic channels. We show this in Appendix~\ref{ap_IMJP for BEC}. \end{remark} \subsubsection{Proper Degrading Channels} The IMJP decoder is attractive for joint polar synthetic channels since, by \Cref{thm_minimizing phi_a and phi_b for polar channel}, we can efficiently compute it. This was made possible by the successive form of the joint channel~\eqref{eq_Wab and its relationship to Wb}. Thus, we seek degrading channels that maintain this form. Let $W_{a,b}(y_a,y_b|u_a,u_b)$ be a joint distribution of two synthetic channels and let $Q_{a,b}(z_a,z_b|u_a,u_b) \succcurlyeq W_{a,b}(y_a,y_b|u_a,u_b)$. The marginal channels of $Q_{a,b}$ are $Q_a(z_a|u_a)$ and $Q_b(z_b|u_b)$. The most general degrading channel is of the form \[ P(y_a,y_b|z_a,z_b) = P_1(y_a|z_a,z_b)\cdot P_2(y_b|z_a,z_b, y_a), \] where $P_1$ and $P_2$ are probability distributions. This form does not preserve the successive structure of joint synthetic channels~\eqref{eq_Wab and its relationship to Wb}. Even if $Q_{a,b}$ satisfies~\eqref{eq_Wab and its relationship to Wb}, the resulting $W_{a,b}$ may not. To this end, we turn to a subset of degrading channels. Recalling that $y_b = (y_a,u_a,y_{r})$, we consider degrading channels of the form \iftoggle{twocol}{ \begin{equation} \label{eq_proper form of P} \begin{split} & P(y_a,u_a,y_{r}| z_a, u_a,z_{r}) \\&\quad = P_a(y_a|z_a) \cdot P_b(y_{r} | z_a, u_a, z_{r}, y_a). \end{split} \end{equation}} { \begin{equation} \label{eq_proper form of P} P(y_a,u_a,y_{r}| z_a, u_a,z_{r}) = P_a(y_a|z_a) \cdot P_b(y_{r} | z_a, u_a, z_{r}, y_a). \end{equation} } That is, these degrading channels degrade $z_a$, the output of $Q_a$, to $y_a$, pass $u_a$ unchanged, and degrade $z_{r}$, the remainder of $Q_b$'s output, to $y_{r}$. For this to be a valid channel, $P_a$ and $P_b$ must be probability distributions. This degrading channel structure is illustrated in \Cref{fig_joint degrading channel}. By construction, degrading channels of the form~\eqref{eq_proper form of P} preserve the form~\eqref{eq_Wab and its relationship to Wb} that is required for efficiently computing the IMJP decoder as in \Cref{thm_minimizing phi_a and phi_b for polar channel}. \begin{definition}[Proper degrading channels] A degrading channel of the form~\eqref{eq_proper form of P} is called \emph{proper}. We write $Q \overset{p}{\succcurlyeq} W$ to denote that channel $Q$ is upgraded from $W$ with a proper degrading channel. We say that an upgrading (degrading) procedure is proper if its degrading channel is proper. \end{definition} \begin{figure}[t] \centering \begin{tikzpicture}[>=latex] \node (Q) [rectangle, draw, minimum height = 2.2 cm, minimum width = 1.2cm] {}; \node (Pa) [right = 1.3cm of Q.45, rectangle, draw, minimum width = 1cm, minimum height = 0.7cm] {$P_a$}; \node (Pb) [right = 3 cm of Q, rectangle, draw, minimum width = 1cm, minimum height = 0.7cm] {$P_b$}; \node at (Q.center|-Pa) {$Q_{a,b}$}; \draw[<-] (Q.135) -- +(-0.8,0) node[left] {$u_a$}; \draw[<-] (Q.225) -- +(-0.8,0) node[left] {$u_b$}; \draw[dotted] (Q.135) -- (Q.-45); \draw[->] (Pa) -- ($(Pa)!0.5!(Pa-|Pb)$) node (PaPb){} -- +(2,0) node(ya){} node [right] {$y_a$}; \fill (PaPb) circle (1pt); \draw[->] (PaPb.center) |- (Pb.150); \draw[->] (Pb) -- (ya|-Pb) node[right] {$y_r$}; \node at ($(Q-|Pa)!0.4!(Pb)$) [rounded corners, dashed, thick, draw, minimum height = 2.2 cm, minimum width = 3.4cm, label=below:$P(y_a{,}u_a{,}y_r|z_a{,}u_a{,}z_r)$] {}; \draw[->] (Q.45) -- node[pos = 0.3, above] (za) {$z_a$} node[pos=0.8] (QPa) {} (Pa); \draw[->] (Q) -- (Q-|za) node[above] {$z_r$} -- (Pb); \draw[->] (Q.-45) -- (Q.-45-|za) node[above] {$u_a$} -- (ya|-Q.-45) node [right] {$u_a$}; \fill (QPa) circle (1pt); \draw[->] (QPa.center) |- (Pb.165); \fill (PaPb |- Q.-45) circle (1pt); \draw[->] (PaPb|-Q.-45) |-(Pb.195); \end{tikzpicture} \caption{The structure of proper degrading channels.} \label{fig_joint degrading channel} \end{figure} By marginalizing the joint channel it is straight-forward to deduce the following for joint synthetic channel distributions. \begin{lemma} \label{lem_Qa and Qb are degraded from Wa and Wb} If $Q_{a,b}(z_a,u_a,z_{r}|u_a,u_b) \overset{p}{\succcurlyeq} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$, then $Q_a(z_a|u_a) \succcurlyeq W_a(y_a|u_a)$ and $Q_b(z_a,u_a,z_{r}|u_b) \succcurlyeq W_b(y_a,u_a,y_{r}|u_b)$. \end{lemma} This lemma is encouraging, but insufficient for our purposes. It is easy to take degrading channels that are used for degrading a single (not joint) synthetic channel and cast them into a proper degrading channel for joint channels. This, however, is not our goal. Instead, we start with $W_{a,b}$ and seek an \emph{upgraded} $Q_{a,b}$ with smaller output alphabet that can be degraded to $W_{a,b}$ using a proper degrading channel. This is a very different problem than the degrading one, and its solution is not immediately apparent. Plain-vanilla attempts to use upgrading procedures for single channels fail to produce the desired results. Later, we develop proper upgrading procedures that upgrade one of the marginals without changing the other. We now show that the probability of error of the IMJP decoder does not decrease after degradation by proper degrading channels. Intuitively, this is because the decoder for the original channel can simulate the degrading channel. We denote by $\mathcal{E}^W_a$ the error event of channel $W_a$ under some decoder $\phi_a$, and similarly define $\mathcal{E}^Q_a$, $\mathcal{E}^W_b$, and $\mathcal{E}^Q_b$. Further, we denote by $\phi_{i}$ decoders for $W_i$ and by $\psi_i$ decoders for $Q_i$, $i=a,b$. \begin{lemma}\label{lem_conditions on degrading for conservation of pe} Let joint channel $W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$ have marginals $W_a(y_a|u_a)$ and $W_b(y_a,u_a,y_{r}|u_b)$. Assume that $Q_{a,b}(z_a,u_a,z_{r}|u_a,u_b) \overset{p}{\succcurlyeq} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$, then $\min_{\psi_a,\psi_b} \Prob{\mathcal{E}^Q_a\cup\mathcal{E}^Q_b} \leq \min_{\phi_a,\phi_b} \Prob{\mathcal{E}^W_a\cup\mathcal{E}^W_b}$. \end{lemma} \begin{IEEEproof} The proof follows by noting that for any decoder $\phi_i$, $i=a,b$ we can find a decoder $\psi_i$ with identical performance. First consider the decoder for channel $a$. Denote by $\arg P_a(y_a|z_a)$ the result of drawing $y_a$ with probability $P_a(\cdot|z_a)$. Then, the decoder $\psi_a$ for $Q_a$, defined as $\psi_a(z_a) = \phi_a(\arg P_a(y_a|z_a))$, has performance identical to $\phi_a$ for $W_a$. The decoder $\psi_a$ results from first degrading the a-channel output and only then decoding. Next, consider the decoder for the b-channel. Denote by $\arg P_b(y_{r}|z_a, u_a,z_{r},y_a)$ the result of drawing $y_{r}$ with probability $P_b(\cdot|z_a,u_a,z_{r},y_a)$. Then, similar to the a-channel case, the decoder $\psi_b$ for $Q_b$, defined as $\psi_b(z_a,u_a,z_{r}) = \phi_b(\arg P_a(y_a|z_a), u_a,\arg P_b(y_{r}|z_a, u_a,z_{r},y_a))$, has performance identical to $\phi_b$ for $W_b$. Hence, the best decoder pair $\psi_a,\psi_b$ cannot do worse than the best decoder pair $\phi_a,\phi_b$. \end{IEEEproof} Let $W$ be a BMS channel that undergoes $n$ polarization steps. The probability of error of a polar code with non-frozen set $\mathcal{A}$ under SC decoding is given by $P_e^{\textrm{\textup{SC}}}(W) = \Prob{\bigcup_{a \in \mathcal{A}} \mathcal{E}_a^{\textrm{\textup{ML}}}},$ where $\mathcal{E}_a^{\textrm{\textup{ML}}}$ is the error probability of synthetic channel $W_a$ under ML decoding. Obviously, for any $\mathcal{A}' \subseteq \mathcal{A}$, \begin{equation} P_e^{\textrm{\textup{SC}}}(W) \geq \Prob{\bigcup_{a \in \mathcal{A}'} \mathcal{E}_a^{\textrm{\textup{ML}}}}.\label{eq_lower bound on a union using a subset}\end{equation} We have already mentioned the simplest such lower bound, $P_e^{\textrm{\textup{SC}}}(W) \geq \max_{a \in \mathcal{A}} \Prob{\mathcal{E}_a^{\textrm{\textup{ML}}}}$. We now show that the IMJP decoder provides a tighter lower bound. To this end, recall that $ P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) = \min_{\phi_a, \phi_b} \Prob{\mathcal{E}_a \cup \mathcal{E}_b},$ where $\mathcal{E}_i$ is the probability of error of channel $i$ under decoder $\phi_i$, $i=a,b$. \begin{lemma} \label{lem_IMJP provides a tighter lower bound than max Pe} Let $W$ be a BMS channel that undergoes $n$ polarization steps, and let $\mathcal{A}$ be the non-frozen set. Then, \begin{equation} P_e^{\textrm{\textup{SC}}}(W) \geq \max_{a,b \in \mathcal{A}} P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) \geq \max_{a \in \mathcal{A}}\Prob{\mathcal{E}_a^{\textrm{\textup{ML}}}}. \label{eq_string of Pe inequalities}\end{equation} \end{lemma} \begin{IEEEproof} Using~\eqref{eq_lower bound on a union using a subset}, $P_e^{\textrm{\textup{SC}}}(W) \geq \max_{a,b\in\mathcal{A}} \Prob{\mathcal{E}_a^{\textrm{\textup{ML}}} \cup \mathcal{E}_b^{\textrm{\textup{ML}}}}$. By definition, the IMJP decoder seeks decoders $\phi_a$ and $\phi_b$ that minimize the joint probability of error of synthetic channels with indices $a$ and $b$. Therefore, for any two indices $a$ and $b$ we have $\Prob{\mathcal{E}_a^{\textrm{\textup{ML}}} \cup \mathcal{E}_b^{\textrm{\textup{ML}}}} \geq P_e^{\textrm{\textup{IMJP}}}(W_{a,b}).$ In particular, this holds for the indices $a,b$ that maximize the right-hand side. This establishes the leftmost inequality of~\eqref{eq_string of Pe inequalities}. To establish the rightmost inequality of~\eqref{eq_string of Pe inequalities}, we first show that for any $a,b$, \begin{equation} P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) \geq \max\{\Prob{\mathcal{E}_{a}^{\textrm{\textup{ML}}}},\Prob{\mathcal{E}_{b}^{\textrm{\textup{ML}}}}\}.\label{eq_IMJP better than marginals} \end{equation} To see this, first recall that the IMJP decoder performs ML decoding on the b-channel, yielding $ P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) \geq \Prob{\mathcal{E}_{b}^{\textrm{\textup{ML}}}}$. Next, we construct $W'_{a,b} \overset{p}{\succcurlyeq} W_{a,b}$ in which the b-channel is noiseless, by augmenting the $y_{r}$ portion of the output of $W_{a,b}$ with $u_b$, i.e., \iftoggle{twocol}{ \begin{multline*} W_{a,b}'(y_a,u_a, (y_{r}, v_b)|u_{a},u_b) \\= W_{a,b}(y_a,u_a,y_{r}| u_{a},u_b) \kindi{v_b = u_b}.\end{multline*}} {\[ W_{a,b}'(y_a,u_a, (y_{r}, v_b)|u_{a},u_b) = W_{a,b}(y_a,u_a,y_{r}| u_{a},u_b) \kindi{v_b = u_b}.\]} Channel $W'_{a,b}$ can be degraded to $W_{a,b}$ using a proper degrading channel by omitting $v_b$ from the $y_{r}$ portion of the output and leaving $y_a$ unchanged. Thus, $P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) \geq P_e^{\textrm{\textup{IMJP}}}(W'_{a,b}) = \Prob{\mathcal{E}_{a}^{\textrm{\textup{ML}}}}$. Finally, denote $a_0 = \argmax_{a \in \mathcal{A}} \Prob{\mathcal{E}_a^{\textrm{\textup{ML}}}}$. By~\eqref{eq_IMJP better than marginals}, for any $c>a_0>d$ we have $P_e^{\textrm{\textup{IMJP}}}(W_{a_0,c}) \geq \Prob{\mathcal{E}_{a_0}^{\textrm{\textup{ML}}}}$ and $P_e^{\textrm{\textup{IMJP}}}(W_{d,a_0}) \geq \Prob{\mathcal{E}_{a_0}^{\textrm{\textup{ML}}}}$. Since $\max_{a,b \in \mathcal{A}} P_e^{\textrm{\textup{IMJP}}}(W_{a,b}) \geq \max_{c,d}\{P_e^{\textrm{\textup{IMJP}}}(W_{a_0,c}),P_e^{\textrm{\textup{IMJP}}}(W_{d,a_0})\}$ we obtain the proof. \end{IEEEproof} \Cref{lem_conditions on degrading for conservation of pe,lem_IMJP provides a tighter lower bound than max Pe} are instrumental for our lower bound, which combines upgrading operations and the IMJP decoder. \section{Properties of Joint Synthetic Channels} \label{sec_properties of joint bit channels} In this section, we study the properties of joint synthetic channels. We begin by bringing the joint synthetic channel into an equivalent form where the b-channel's ML decision is immediately apparent. We then explain how to jointly polarize synthetic channels. Finally, we describe some consequences of symmetry on joint channels and on the IMJP decoder. \subsection{Representation of Joint Synthetic Channel Distribution using $D$-values} \label{subsec_d value representation} Two channels $W$ and $W'$ with the same input alphabet but possibly different output alphabets are called \emph{equivalent} if $W\succcurlyeq W'$ and $W'\succcurlyeq W$. We denote this by $W \equiv W'$. Channel equivalence can cast a channel in a more convenient form. For example, if $W$ is a BMS, one can transform it to an equivalent channel whose output is a sufficient statistic, such as a $D$-value (see Appendix~\ref{ap_Definition of D values}), in which case the ML decoder's decision is immediately apparent. Let $W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$ be a joint synthetic channel. Since the joint distribution is determined by the distribution of $W_b$, we can transform $W_{a,b}$ to an equivalent channel in which the b-channel $D$-value\footnote{By ``b-channel $D$-value'' we mean the $D$-value computed for channel $W_b$. Instead of $D$-values, other sufficient statistics of the b-channel could have been used. In fact, for practical implementation (see \Cref{sec_implementation}), we recommend to use likelihood ratios, which offer a superior dynamic range. Our use of $D$-values in the exposition was prompted by their bounded range: $[-1,1]$. This simplifies many of the expressions that follow.} of symbol $(y_a,u_a,y_{r})$ is immediately apparent. \begin{definition}[$D$-value representation] Joint channel $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$ is in $D$-value representation if the marginal $W_b$ satisfies \[ d_b = \frac{W_{b}(y_a,u_a,d_b|0) - W_{b}(y_a,u_a,d_b|1)}{W_{b}(y_a,u_a,d_b|0)+W_{b}(y_a,u_a,d_b|1)}.\] \end{definition} We use the same notation $W_{a,b}$ for both the regular and the $D$-value representations of the joint channel due to their equivalence. The discussion of the various representations of joint channels in \Cref{subsec_Polar Coding Setting} applies here as well. In particular, we will frequently use $W_b(y_a,u_a,d_b|u_b)$ to denote the joint synthetic channel distribution. The following lemma affords a more convenient description of the joint channel, in which, in line with the IMJP decoder, the b-channel's ML decision is immediately apparent. Moreover, this description greatly simplifies the expressions that follow. \begin{lemma} Channels $W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$ and $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$ are equivalent and the degrading channels from one to the other are proper. \label{lem_Representation of Joint Bit-Channel Distribution using $D$-values} \end{lemma} \begin{IEEEproof} To establish equivalence we show that each channel is degraded from the other using proper degrading channels. The only portion of interest in~\eqref{eq_proper form of P} is $P_b$, as in either direction $y_a$ and $u_a$ are unchanged by the degrading channel. Denote by $D_{y_a,u_a}^{d_b}$ the set of all symbols $y_{r}$ such that the b-channel $D$-value of $(y_a,u_a,y_{r})$ is $d_b$, for fixed $y_a,u_a$. Then, \iftoggle{twocol}{ \begin{align*} &W_{a,b}(y_a,u_a,d_b|u_a,u_b)\\ &\quad = \sum_{\mathclap{D_{y_a,u_a}^{d_b}}} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b) \\ &\quad = \sum_{y_{r}} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)\cdot P_b(d_b|y_{r},y_a,u_a), \end{align*}}{ \begin{align*} W_{a,b}(y_a,u_a,d_b|u_a,u_b) & = \sum_{\mathclap{D_{y_a,u_a}^{d_b}}} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b) \\ &= \sum_{y_{r}} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)\cdot P_b(d_b|y_{r},y_a,u_a), \end{align*}} where \[ P_b(d_b|y_{r},y_a,u_a) = \kindi{y_{r} \in D_{y_a,u_a}^{d_b}}. \] Clearly, the b-channel $D$-value of $(y_a,u_a,d_b)$ is $d_b$. On the other hand, by~\eqref{eq_Wab and its relationship to Wb} and since all symbols in $D_{y_a,u_a}^{d_b}$ share the same b-channel $D$-value, \iftoggle{twocol}{ \begin{multline*} W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)\\ = \sum_{d_b} W_{a,b}(y_a,u_a,d_b|u_a,u_b)\cdot P_b'(y_{r}|d_b,y_a,u_a), \end{multline*}}{ \[ W_{a,b}(y_a,u_a,y_{r}|u_a,u_b) = \sum_{d_b} W_{a,b}(y_a,u_a,d_b|u_a,u_b)\cdot P_b'(y_{r}|d_b,y_a,u_a),\]} where \[ P_b'(y_{r}|d_b,y_a,u_a) = \frac{W_b(y_a,u_a,y_{r})}{\displaystyle \sum_{\mathclap{D_{y_a,u_a}^{d_b}}}W_b(y_a,u_a,y_{r})} \kindi{y_{r} \in D_{y_a,u_a}^{d_b}},\] and $W_b(y_a,u_a,y_{r}) = \frac{1}{2}\sum_{u_b} W_b(y_a,u_a,y_{r}|u_b)$. \end{IEEEproof} \begin{remark} In \Cref{sec_polarization for joint bit channels} we will show how to jointly polarize a joint channel $W_{a,b}$. Even if $W_{a,b}$ is given in $D$-value representation, the jointly polarized version is not. However, this lemma enables us to convert the jointly polarized distribution to $D$-value representation. This is possible because \Cref{lem_Representation of Joint Bit-Channel Distribution using $D$-values} holds for any representation of $W_{a,b}(y_a,u_a,y_{r}|u_a,u_b)$ in which $u_a, y_a$ are the input and output, respectively, of the a-channel, $u_b$ is the input of the b-channel, and $(y_a,u_a,y_{r})$ is the output of the b-channel. In particular, $y_{r}$ need not consist of inputs to channels $W_{a+1}, \ldots, W_{b-1}$. \end{remark} \begin{remark} At this point the reader may wonder why we have stopped here and not converted the a-channel output to its $D$-value. The reason is that this constitutes a degrading operation, which is the opposite of what we need. Two a-channel symbols with the same a-channel $D$-value may have very different meanings for the IMJP decoder. Thus, we cannot combine them to a single symbol without incurring loss. \end{remark} When the joint channel is in $D$-value representation, proper degrading channels admit the form \begin{equation}\label{eq_proper form of degrading channels, d version} P(y_a,u_a,d_b|z_a,u_a,z_b) = P_a(y_a|z_a) P_b(d_b|z_a,y_a,u_a,z_b). \end{equation} It is obvious that all properties obtained from degrading channels of the form~\eqref{eq_proper form of P} are retained for degrading channels of the form~\eqref{eq_proper form of degrading channels, d version}. By \Cref{lem_Representation of Joint Bit-Channel Distribution using $D$-values}, we may assume that the degraded channel is also in $D$-value representation. \subsection{Polarization for Joint Synthetic Channels}\label{sec_polarization for joint bit channels} Let $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$ be some joint synthetic channel distribution in $D$-value representation. Recall that $a$ and $b$ are indices of synthetic channels. For $\alpha ,\beta \in\{-,+\}$, we denote by $a^{\alpha}$ and $b^{\beta}$ the indices of the synthetic channels that result from polar transforms of $W_a$ and $W_b$ according to $\alpha$ and $\beta$. That is, \[ a^{\alpha} = \begin{cases} 2a-1, & \alpha = - \\ 2a, & \alpha = + \end{cases}\] and a similar relationship holds for $b^{\beta}$. The resulting joint channel is, thus, $W_{a^{\alpha},b^{\beta}}$. Even though $W_{a,b}$ is in $D$-value representation, after a polarization transform this is no longer the case. Of course, one can always bring the polarized joint channel to an equivalent $D$-value representation as in \Cref{lem_Representation of Joint Bit-Channel Distribution using $D$-values}. The polar construction is shown in \Cref{fig_joint channel polarization_db version}. Here, two independent copies of the joint channel $W_{a,b}$ (in $D$-value representation) are combined. The inputs and outputs of the a-channel of each copy are denoted explicitly using thicker arrows with hollow tips (\tikz{\draw[-{Triangle[open]}, thick] (0,0) -- (0.5,0)}). For example, for the bottom copy of $W_{a,b}$, the a-input is $\nu_a$ and the a-output is $\eta_a$, whereas the b-input is $(\nu_b)$ and the b-output is $(\eta_a,\nu_a, \delta_b)$. \begin{figure}[t] \centering \begin{tikzpicture}[>=latex, channel/.style = {rectangle, minimum height = 1.5cm, minimum width = 2cm, draw}, sumnode/.style = {circle, inner sep = 0pt, minimum size = 5mm, draw}, fulldot/.style = {circle, fill, inner sep = 0pt, minimum size = 3pt}] \node[channel] (W1) {$W_{a,b}$}; \node[channel, below = 0.6cm of W1] (W2) {$W_{a,b}$}; \coordinate (W1top) at ($(W1.west)!0.5!(W1.north west)$); \coordinate (W1bot) at ($(W1.west)!0.5!(W1.south west)$); \coordinate (W2top) at ($(W2.west)!0.5!(W2.north west)$); \coordinate (W2bot) at ($(W2.west)!0.5!(W2.south west)$); \node[sumnode, left = 0.7 cm of W1top] (A1) {$+$}; \node[sumnode, left = 1.3 cm of W1bot] (A2) {$+$}; \coordinate (topdot) at (A1|-W2top); \coordinate (botdot) at (A2|-W2bot); \coordinate[left = of A2] (uat); \coordinate (A2r) at ($(uat)!0.7!(A2.west)$) ; \coordinate (A2l) at ($(uat)!0.3!(A2.west)$) ; \draw[-{Triangle[open]}, thick] (topdot) -- (A1); \draw[->] (botdot) -- (A2); \draw[white, line width = 2pt] ($(A2.east)+(0.1,0)$) -- (W1bot); \draw[-{Triangle[open]}, thick] (A1) -- (W1top); \draw[->] (A2) -- (W1bot); \draw[-{Triangle[open]}, thick] (uat|-A1)node[left]{$u_a$} -- (A1); \draw[->] (uat|-W2bot) node[left]{$\nu_b$} -- (W2bot); \draw[white, line width = 2pt] ($(A2r|-topdot)+(0.2,0)$) -- ($(topdot)+(-0.2,0)$); \draw[-{Triangle[open]}, thick] (uat) node[left]{$\nu_a$} -- (A2l) -- (A2r|-topdot) -- (W2top); \draw[white, line width = 2pt] (A2l|-W2top) -- (A2r); \draw[->] (uat|-W2top) node[left]{$u_b$} -- (A2l|-W2top) -- (A2r) -- (A2); \coordinate (W2r2) at ($(W2.south east)!0.14!(W2.north east)$); \coordinate (W2r4) at ($(W2.south east)!0.38!(W2.north east)$); \coordinate (W2r6) at ($(W2.south east)!0.62!(W2.north east)$); \coordinate (W2r8) at ($(W2.south east)!0.86!(W2.north east)$); \coordinate[right = 1.3cm of W2r2] (dout); \coordinate (W1r2) at ($(W1.south east)!0.2!(W1.north east)$); \coordinate (W1r6) at ($(W1.south east)!0.5!(W1.north east)$); \coordinate (W1r8) at ($(W1.south east)!0.8!(W1.north east)$); \path[name path = l1] (W1r2) -- ++(0.3,0) -- ++(-75:2.5cm); \path[name path = l2] (dout|-W2r4) -- ++(-1,0); \path[name intersections={of = l1 and l2}]; \coordinate (a) at (intersection-1); \draw[->] (W1r2) -- ++(0.3,0) -- (a) -- (dout|-W2r4) node[right]{$d_b$}; \path[name path = l1] (W1r6) -- ++(0.4,0) -- ++(-75:2.5cm); \path[name path = l2] (dout|-W2r8) -- ++(-1,0); \path[name intersections={of = l1 and l2}]; \coordinate (b) at (intersection-1); \draw[->] (W1r6) -- ++(0.4,0) -- (b) -- (dout|-W2r8) node[right]{$u_a\oplus \nu_a$}; \draw[white, line width = 2pt] ($(W2r8)+(0.3,0)$) -- (W1r2-|b); \draw[-{Triangle[open]}, thick] (W2r8) -- ++(0.3,0) -- (W1r2-|b) -- (dout|-W1r2) node[right]{$\eta_a$}; \draw[-{Triangle[open]}, thick] (W1r8) -- (dout|-W1r8) node[right]{$y_a$}; \draw[->] (W2r2) -- (dout) node[right]{$\delta_b$}; \draw[white, line width = 2pt] ($(W2r6)+(0.3,0)$) -- (dout|-W2r6); \draw[->] (W2r6) -- (dout|-W2r6) node[right]{$\nu_a$}; \node[fulldot] at (topdot) {}; \node[fulldot] at (botdot) {}; \end{tikzpicture} \caption{Two independent copies of joint channel $W_{a,b}$ combined using a $(u \oplus v, v)$ construction. The a-channel input and output for each copy are denoted using thicker arrows with hollow tips.} \label{fig_joint channel polarization_db version} \end{figure} The input $u_{a^{\alpha}}$ and output $y_{a^{\alpha}}$ of $W_{a^{\alpha}}$ are given by \begin{align*} u_{a^{\alpha}} &= \begin{cases} u_a, & \alpha = - \\ \nu_a, & \alpha = +, \end{cases} \\ y_{a^{\alpha}} &= \begin{cases} (y_a,\eta_a), & \alpha = - \\ (y_a,\eta_a,u_a), & \alpha = +. \end{cases} \end{align*} The input $u_{b^{\beta}}$ and output $y_{b^{\beta}}$ of $W_{b^{\beta}}$ are given by \begin{align*} u_{b^{\beta}} &= \begin{cases} u_b, & \beta = - \\ \nu_b, & \beta = +, \end{cases}\\y_{b^{\beta}} &= \begin{cases} (y_a, \eta_a, u_a, \nu_a, d_b,\delta_b), & \beta = - \\ (y_a, \eta_a, u_a, \nu_a, u_b,d_b,\delta_b), & \beta = +. \end{cases} \end{align*} Note that $y_{a^{\alpha}}$ and $u_{a^{\alpha}}$ are contained in $y_{b^{\beta}}$. That is, $ y_{b^{\beta}} = (y_{a^{\alpha}}, u_{a^{\alpha}}, y_r)$, where \[ y_r = \begin{cases} \nu_a, d_b, \delta_b, & \alpha = -, \beta = - \\ \nu_a, u_b, d_b, \delta_b, & \alpha = -, \beta = +\\ d_b, \delta_b, & \alpha = +, \beta = -\\ u_b, d_b, \delta_b, & \alpha = +, \beta = +. \end{cases}\] Thus, the joint output of both channels is $y_{b^{\beta}}$. The distribution of the jointly polarized channel is given by \iftoggle{twocol}{ \begin{equation} \begin{split} &W_{a^{\alpha},b^{\beta}}(y_{a^{\alpha}},y_{b^{\beta}}|u_{a^{\alpha}},u_{b^{\beta}})\\ &\quad= 2 W_{b^{\beta}}(y_{b^{\beta}}|u_{b^{\beta}}) \kindi{y_{b^{\beta}} = (y_{a^{\alpha}},u_{a^{\alpha}},y_r)}\\ & \quad= \sum_{B_{\beta}} \Big( W_b(y_a,u_a\oplus \nu_a, d_b|u_b \oplus \nu_b) W_{b}(\eta_a,\nu_a, \delta_b|\nu_b)\Big), \end{split}\label{eq_polarizing Wab, general db version} \end{equation}}{ \begin{equation} \begin{split} W_{a^{\alpha},b^{\beta}}(y_{a^{\alpha}},y_{b^{\beta}}|u_{a^{\alpha}},u_{b^{\beta}}) &= 2 W_{b^{\beta}}(y_{b^{\beta}}|u_{b^{\beta}}) \kindi{y_{b^{\beta}} = (y_{a^{\alpha}},u_{a^{\alpha}},y_r)} \\ &= \sum_{B_{\beta}} \Big( W_b(y_a,u_a\oplus \nu_a, d_b|u_b \oplus \nu_b) W_{b}(\eta_a,\nu_a, \delta_b|\nu_b)\Big), \end{split}\label{eq_polarizing Wab, general db version} \end{equation}} where \[\sum_{B_{\beta}} \equiv \begin{dcases} \sum_{\nu_b}, & \beta = - \\ \text{No sum}, & \beta = +. \end{dcases}\] We have shown how to generate $W_{a^{\alpha},b^{\beta}}$ from $W_{a,b}$. Another case of interest is generating $W_{a^-,a^+}$ from $W_a$. Denote the output of $W_{a^-}$ by $y_{a^-}$. The output of $W_{a^+}$ is $(y_{a^-},u_a)$. From~\eqref{eq_Wab and its relationship to Wb}, we need only compute $W_{a^+}$ to find $W_{a^-,a^+}$. This is accomplished by~\eqref{eq_plus transform}. If two channels are ordered by degradation, so are their polar transforms~\cite[Lemma 4.7]{korada}. That is, if $Q \succcurlyeq W$ then $Q^- \succcurlyeq W^-$ and $Q^+ \succcurlyeq W^+$. This is readily extended to joint channels. To this end, for BMS channel $W$ we denote the joint channel formed by its `$-$'- and `$+$'-transforms by $W_{-,+}$. \begin{lemma}\label{lem_degradation is preserved for joint distributions-+} Let BMS channel $Q \succcurlyeq W$. Then $Q_{-,+} \overset{p}{\succcurlyeq} W_{-,+}$. \end{lemma} \begin{IEEEproof} Using~\eqref{eq_definition of degradation} and the definition of $W_{-,+}$ we have \iftoggle{twocol}{ \begin{align*} & W_{-,+}((y_1,y_2),u_1|u_1,u_2) \\ &\quad = 2W_{+}((y_1,y_2),u_1|u_2) \\ &\quad =W(y_1|u_1\oplus u_2)W(y_2|u_2)\\ &\quad= \sum_{z_1,z_2} Q(z_1|u_1\oplus u_2)P(y_1|z_1) Q(z_2|u_2)P(y_2|z_2)\\ &\quad= \sum_{z_1,z_2} Q_{-,+}((z_1,z_2),u_1|u_1,u_2)P_a(y_1,y_2|z_1,z_2), \end{align*}}{ \begin{align*} W_{-,+}((y_1,y_2),u_1|u_1,u_2) & = \frac{1}{2}W(y_1|u_1\oplus u_2)W(y_2|u_2)\\ &= \sum_{z_1,z_2} \frac{1}{2}Q(z_1|u_1\oplus u_2)P(y_1|z_1) Q(z_2|u_2)P(y_2|z_2)\\ &= \sum_{z_1,z_2} Q_{-,+}((z_1,z_2),u_1|u_1,u_2)P_a(y_1,y_2|z_1,z_2), \end{align*}} where $P_a(y_1,y_2|z_1,z_2) = P(y_1|z_1)P(y_2|z_2)$ is a proper degrading channel. \end{IEEEproof} \begin{lemma} \label{lem_degradation is preserved for joint distributions} If $Q_{a,b}(z_a,z_b|u_a,u_b) \overset{p}{\succcurlyeq} W_{a,b}(y_a,y_b|u_a,u_b)$, then, for $\alpha,\beta \in \{-,+\}$, $ Q_{a^{\alpha},b^{\beta}} \overset{p}{\succcurlyeq} W_{a^{\alpha},b^{\beta}}$. \end{lemma} \begin{IEEEproof} The proof follows similar lines to the proof of \Cref{lem_degradation is preserved for joint distributions-+}. Expand $W_{a^{\alpha},b^{\beta}}$ using~\eqref{eq_polarizing Wab, general db version} and expand again using the definition of joint degradation with a proper degrading channel. Using the one-to-one mappings between the outputs of the polarized channels and the inputs and outputs of non-polarized channels, the desired results are obtained. The details are mostly technical, and are omitted. \end{IEEEproof} The operational meaning of \Cref{lem_degradation is preserved for joint distributions} is that to compute an upgraded approximation of $W_{a^{\alpha},b^{\beta}}$ we may start with $Q_{a,b}$, an upgraded approximation of $W_{a,b}$, and polarize it. The result $Q_{a^{\alpha},b^{\beta}}$ is an upgraded approximation of $W_{a^{\alpha},b^{\beta}}$. This enables us to iteratively compute upgraded approximations of joint synthetic channels. Whenever the joint synthetic channel exceeds an allotted size, we upgrade it to a joint channel with a smaller alphabet size and continue from there. We make sure to use proper upgrading procedures; this preserves the special structure of the joint channel and enables us to compute a lower bound on the probability of error. In \Cref{sec_upgrading procedures for joint bit channels} we derive such upgrading procedures. Since a sequence of polarization and proper upgrading steps is equivalent to proper upgrading of the overall polarized joint channel, using \Cref{lem_conditions on degrading for conservation of pe,lem_IMJP provides a tighter lower bound than max Pe} we obtain that the IMJP decoding error of a joint channel that has undergone multiple polarization and proper upgrading steps lower-bounds the SC decoding error of the joint channel that has undergone only the same polarization steps (without upgrading steps). \subsection{Double Symmetry for Joint Channels} A binary input channel $W(y|u)$ is called \emph{symmetric} if for every output $y$ there exists a conjugate output $\bar{y}$ such that $W(y|0) = W(\bar{y}|1)$. We now extend this to joint synthetic channels. \begin{definition}[Double symmetry] \label{def_double symmetry db version} Joint channel $W_{b}(y_a,u_a,d_b|u_b)$ exhibits double symmetry if for every $y_a$, $d_b$ there exist $\aconj{y}_a$, $\bconj{y}_a$, $\abconj{y}_a$ such that \begin{equation} \begin{split} W_b(y_a,u_a,d_b|u_b) &= W_b(\aconj{y}_a,\bar{u}_a,d_b|u_b)\\ &= W_b(\bconj{y}_a,u_a,-d_b|\bar{u}_b) \\&= W_b(\abconj{y}_a,\bar{u}_a,-d_b|\bar{u}_b). \end{split} \label{eq_definition of double symmetry for joint channels (Wb db version)} \end{equation} \end{definition} We call $\aconj{(\cdot)}$ the a-conjugate; $\bconj{(\cdot)}$ the b-conjugate; and $\abconj{(\cdot)}$ the ab-conjugate. We can also cast this definition using the regular (non-$D$-value) representation of joint channels in a straight-forward manner, which we omit here. \begin{example}\label{ex_conjugates for W-+} Let $W$ be a BMS channel and denote by $W_{-,+}$ the joint channel formed by its `$-$'- and `$+$'-transforms. What are the a-, b-, and ab-conjugates of the a-channel output $y_a$? Recall that the output of the a-channel $W^-$ consists of the outputs of two copies of $W$. Denote $y_a = (y_1,y_2)$, where $y_1$ and $y_2$ are two possible outputs of $W$ with conjugates $\bar{y}_1, \bar{y}_2$, respectively. We then have \begin{align*} W_{-,+}(y_a,u_a|u_a,u_b) &= 2W^+(y_a,u_a|u_b) \\ &= W(y_1|u_a\oplus u_b) W(y_2|u_b). \end{align*} By symmetry of $W$ we obtain $\aconj{y}_a = (\bar{y}_1,y_2)$, $\bconj{y}_a = (\bar{y}_1,\bar{y}_2)$, and $\abconj{y}_a = (y_1,\bar{y}_2)$. Indeed, \begin{align*} W^+(y_a,u_a|u_b) & = W^+(\aconj{y}_a,\bar{u}_a|u_b) \\ & = W^+(\bconj{y}_a,u_a|\bar{u}_b) \\ & = W^+(\abconj{y}_a,\bar{u}_a|\bar{u}_b). \end{align*} We leave it to the reader to show that~\eqref{eq_definition of double symmetry for joint channels (Wb db version)} holds for the $D$-value representation of the joint channel. \end{example} Pairs of polar synthetic channels exhibit double symmetry. One can see this directly from symmetry properties of polar synthetic channels, see~\cite[Proposition 13]{Arikan_2009}. Alternatively, one can use induction to show directly that the polar construction preserves double symmetry; we omit the details. This implies the following Proposition. \begin{proposition}\label{prop_double symmetry for Wab} Let $W_{a,b}$ be the joint distribution of two synthetic channels $W_a$ and $W_b$ that result from $n$ polarization steps of BMS channel $W$. Then, $W_{a,b}$ exhibits double symmetry. \end{proposition} The following is a direct consequence of double symmetry. \begin{lemma} \label{lem_double symmetry and d values} Let $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$ be a joint channel in $D$-value representation that exhibits double symmetry. Then \begin{enumerate} \item For the b-channel, $(y_a,u_a,d_b)$ and $(\aconj{y}_a,\bar{u}_a,d_b)$ have the same b-channel $D$-value $d_b$. \item For the a-channel, $y_a$ and $\bconj{y}_a$ have the same a-channel $D$-value $d_a$, and $\aconj{y}_a$ and $\abconj{y}_a$ have the same a-channel $D$-value $-d_a$. \end{enumerate} \end{lemma} \begin{IEEEproof} The first item is obvious from~\eqref{eq_definition of double symmetry for joint channels (Wb db version)}. For the second item, note that \begin{align*} W_a(y_a|u_a) &= \sum_{d_b}\sum_{u_b}W_b(y_a,u_a,d_b|u_b) \\ &\overset{\mathclap{(a)}}{=} \sum_{d_b}\sum_{u_b}W_b(\bconj{y}_a,u_a,-d_b|\bar{u}_b) \\ &= \sum_{-d_b}\sum_{\bar{u}_b}W_b(\bconj{y}_a,u_a,-d_b|\bar{u}_b)\\ &= W_a(\bconj{y}_a|u_a), \end{align*} where $(a)$ is by~\eqref{eq_definition of double symmetry for joint channels (Wb db version)}. In the same manner, $\aconj{y}_a$ and $\abconj{y}_a$ have the same a-channel $D$-value, $-d_a$. \end{IEEEproof} \Cref{lem_double symmetry and d values} implies that an SC decoder does not distinguish between $y_a$ and $\bconj{y}_a$ when making its decision for the a-channel. We now show that a similar conclusion holds for the IMJP decoder. \begin{lemma}\label{lem_symmetry of T} Let $y_a$ be some output of $W_a$. Then \[ T(y_a|u_a) = T(\bconj{y}_a|u_a) = T(\aconj{y}_a|\bar{u}_a) = T(\abconj{y}_a|\bar{u}_a). \] \end{lemma} \begin{IEEEproof} \Cref{thm_minimizing phi_a and phi_b for polar channel} holds for joint channels given in $D$-value representation, $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$. This is easily seen by following the proof with minor changes. Under the $D$-value representation,~\eqref{eq_expressions for T using yba} becomes \begin{equation} \begin{split} T(y_a|u_a) &= \frac{1}{2} \sum_{d_b} \max_{u_b} W_{a,b}(y_a,u_a,d_b|u_a,u_b)\\ &= \sum_{d_b}\max_{u_b} W_b(y_a,u_a,d_b|u_b). \end{split}\label{eq_expression for T using db} \end{equation} The remainder of the proof hinges on double symmetry and follows along similar lines to the proof of \Cref{lem_double symmetry and d values}, with $W_a$ replaced with $T$ and accordingly the sum over $u_b$ replaced with a maximum operation over $u_b$. \end{IEEEproof} \Cref{lem_symmetry of T} implies that the IMJP decoder does not distinguish between $y_a$ and $\bconj{y}_a$. \begin{corollary}\label{cor_IMJP decoder makes the same decision for ya and bconj ya} Let $\phi_a$ be the IMJP decoder for the a-channel. Then $ \phi_a(y_a) = \phi_a(\bconj{y}_a) = 1-\phi_a(\aconj{y}_a) = 1-\phi_a(\abconj{y}_a).$ \end{corollary} \section{Symmetrized Joint Synthetic Channels}\label{sec_Symmetrized Joint Bit-Channels} In this section we introduce the symmetrizing transform. The resultant channel is \emph{degraded} from the original joint channel yet has the same probability of error. Its main merit is to decouple the a-channel from the b-channel. This simpler structure is the key to upgrading the a-channel, as we shall see in \Cref{sec_upgrading procedures for joint bit channels}. \subsection{Symmetrized Joint Channel} The SC decoder observes marginal distributions and makes a decision based on the $D$-value of each synthetic channel's output. In particular, by \Cref{lem_double symmetry and d values}, the SC decoder makes the same decision for the a-channel whether its output was $y_a$ or $\bconj{y}_a$ and the b-channel decision is based on $d_b$ without regard to $y_a$. By \Cref{cor_IMJP decoder makes the same decision for ya and bconj ya}, the IMJP decoder acts similarly. That is, the IMJP decoder makes the same decision for the a-channel whether its output is $y_a$ or $\bconj{y}_a$, and the decision for the b-channel is based solely on $d_b$. We conclude that if the a-channel were told only whether its output was one of $\{y_a,\bconj{y}_a\}$, it would make the same decision had it been told its output was, say, $y_a$. This is true for either the SC or IMJP decoder. Consequently, either decoder's probability of error is unaffected by obscuring the a-channel output in this manner. This leads us to define a \emph{symmetrized} version of the joint synthetic channel distribution, $\symm{W}_{a,b}$, as follows. Let\footnote{The order of elements in $\symm{y}_a$ and $\bar{\symm{y}}_a$ does not matter. That is, $\{y_a,\bconj{y}_a\}$ is a \emph{set} containing both $y_a$ and $\bconj{y}_a$.} \begin{align*} \symm{y}_a &\triangleq \{y_a,\bconj{y}_a\}, \\ \bar{\symm{y}}_a &\triangleq \{\aconj{y}_a,\abconj{y}_a\} \end{align*} and define \begin{equation} \begin{split} \symm{W}_{a,b}(\symm{y}_a,u_a,d_b|u_a,u_b) ={}& W_{a,b}(y_a,u_a,d_b|u_a,u_b)\\ &+ W_{a,b}(\bconj{y}_a,u_a,d_b|u_a,u_b), \\ \symm{W}_{a,b}(\bar{\symm{y}}_a,u_a,d_b|u_a,u_b) ={}& W_{a,b}(\aconj{y}_a,u_a,d_b|u_a,u_b) \\ &+ W_{a,b}(\abconj{y}_a,u_a,d_b|u_a,u_b). \end{split} \label{eq_symmetrized channel definition} \end{equation} \begin{lemma} \label{lem_symmetrized and non symmetrized channels have the same pe} Let $W_{a,b}$ be a joint synthetic channel distribution, and let $\symm{W}_{a,b}$ be its symmetrized version. Then, the probability of error under SC (IMJP) decoding of either channel is identical. \end{lemma} \begin{IEEEproof} By \Cref{lem_double symmetry and d values} for the SC decoder or \Cref{cor_IMJP decoder makes the same decision for ya and bconj ya} for the IMJP decoder, if the decoder for the symmetrized channel makes an error for some symbol $\symm{y}_a$ then the decoder for the non-symmetrized channel makes an error for both $y_a$ and $\bconj{y}_a$, and vice-versa. Therefore, denoting by $\mathcal{E}$ the error indicator of the decoder, \begin{align*} P_e(\symm{W}_{a,b}) &= \frac{1}{4} \smashoperator[l]{\sum_{u_a,u_b \vphantom{\symm{y}_a}}}\smashoperator[r]{\sum_{\symm{y}_a,d_b}} \symm{W}_{a,b}(\symm{y}_a,u_a,d_b|u_a,u_b) \mathcal{E} \\ &\stackrel{\mathclap{(a)}}{=} \frac{1}{4} \smashoperator[l]{\sum_{u_a,u_b\vphantom{d_b}}} \smashoperator[r]{\sum_{y_a,d_b}} W_{a,b}(y_a,u_a,d_b|u_a,u_b) \mathcal{E}\\ &= P_e(W_{a,b}), \end{align*} where $(a)$ is by~\eqref{eq_symmetrized channel definition}. \end{IEEEproof} The marginal synthetic channels $\symm{W}_a$ and $\symm{W}_b$ are given by \begin{align*} \symm{W}_a(\symm{y}_a|u_a) &= \sum_{u_b,d_b}\symm{W}_{a,b}(\symm{y}_a,u_a,d_b|u_a,u_b),\\ \symm{W}_b(\symm{y}_a,u_a,d_b|u_b) &= \frac{1}{2}\symm{W}_{a,b}(\symm{y}_a,u_a,d_b|u_a,u_b). \end{align*} Note that by double symmetry \begin{equation} \begin{split} \symm{W}_a(\symm{y}_a|u_a) &= \symm{W}_a(\bar{\symm{y}}_a|\bar{u}_a), \\ \symm{W}_b(\symm{y}_a,u_a,d_b|u_b) &= \symm{W}_b(\bar{\symm{y}}_a,\bar{u}_a,d_b|u_b) \\ &= \symm{W}_b(\symm{y}_a,u_a,-d_b|\bar{u}_b) \\ &= \symm{W}_b(\bar{\symm{y}}_a,\bar{u}_a,-d_b|\bar{u}_b). \end{split} \label{eq_symmetrized channel properties} \end{equation} \begin{definition}[Symmetrized distribution] A joint channel whose marginals satisfy~\eqref{eq_symmetrized channel properties} is called \emph{symmetrized}. \end{definition} The name `symmetrized' stems from comparison of~\eqref{eq_symmetrized channel properties} and~\eqref{eq_definition of double symmetry for joint channels (Wb db version)}. We note that \Cref{thm_minimizing phi_a and phi_b for polar channel} holds for $\symm{W}_{a,b}$. A symmetrized joint channel remains symmetrized upon polarization. That is, if $\symm{W}_{a,b}$ is a symmetrized joint channel and $\symm{W}_{a^{\alpha},b^{\beta}}$, $\alpha,\beta \in \{-,+\}$ is the result of jointly polarizing it (without applying a further symmetrization operation), then the marginals $\symm{W}_{a^{\alpha}}$ and $\symm{W}_{b^{\beta}}$ satisfy~\eqref{eq_symmetrized channel properties}. This is easily seen from~\eqref{eq_polarizing Wab, general db version} and~\eqref{eq_symmetrized channel properties}. Clearly, $\symm{W}_{a,b}$ is \emph{degraded} with respect to $W_{a,b}$, exactly the opposite of our main thrust. Nevertheless, as established in \Cref{lem_symmetrized and non symmetrized channels have the same pe}, both channels have the same probability of error under SC (IMJP) decoding. Moreover, if we upgrade the symmetrized version of the channel, its probability of error under IMJP decoding lower-bounds the probability of error of the non-symmetrized channel under either SC or IMJP decoding. What is not immediately obvious, however, is what happens after polarization. That is, if we take a joint channel, symmetrize it, and then polarize it, how does its probability of error compare to the original joint channel that has just undergone polarization? Furthermore, what happens if the symmetrized version undergoes an upgrading transform? In the following proposition, we provide an answer. To this end, a \emph{joint polarization step} is a pair $(\alpha,\beta)\in \{-,+\}^2$ that denotes which transforms the a-channel and b-channel undergo. For example, the result of joint polarization step $(-,+)$ on joint channel $W_{a,b}$ is the joint channel $W_{a^-,b^+}$. A sequence $\mathsf{t}$ of such pairs is called a sequence of joint polarization steps. The joint polarization steps are applied in succession: the result of joint polarization of $W_{a,b}$ according to the sequence $\mathsf{t}=\{(\alpha_1,\beta_1),(\alpha_2,\beta_2),(\alpha_3,\beta_3),\ldots, (\alpha_k,\beta_k)\}$ is the same as the result of joint polarization of $W_{a^{\alpha_1},b^{\beta_1}}$ according to the sequence $\mathsf{t}'=\{(\alpha_2,\beta_2),(\alpha_3,\beta_3),\ldots,(\alpha_k,\beta_k)\}$. \begin{proposition}\label{prop_Symmetrizing the joint distribution yields a lower bound} Let $W_{a,b}$ be a joint distribution of two synthetic channels and let $W_{a,b}^{\mathsf{t}}$ denote this joint distribution after a sequence $\mathsf{t}$ of joint polarization steps. Then $P_e^{\textrm{\textup{IMJP}}}(W_{a,b}^{\mathsf{t}}) \geq P_e^{\textrm{\textup{IMJP}}}(\symm{Q}_{a,b}^{\mathsf{t}})$, where $\symm{Q}_{a,b}^{\mathsf{t}}$ is the distribution of $\symm{W}_{a,b}$ after the same sequence of polarization steps and any number of proper upgrading transforms along the way. \end{proposition} \begin{IEEEproof} Let $W_{a,b}$ be a joint channel with symmetrized version $\symm{W}_{a,b}$. For $\alpha, \beta \in \{-,+\}$, denote by $W_{a^{\alpha},b^{\beta}}$ and $\symm{W}_{a^{\alpha},b^{\beta}}$ the polarized versions of $W_{a,b}$ and $\symm{W}_{a,b}$, respectively. For the $b^{\beta}$-channel, the decoder makes the same decision for either $W_{a^{\alpha},b^{\beta}}$ or $\symm{W}_{a^{\alpha},b^{\beta}}$. This is because the decision is based on the b-channel $D$-value, which is unaffected by symmetrization [see~\eqref{eq_symmetrized channel definition}]. Next, for the $a^{\alpha}$ channel, using on~\eqref{eq_polarizing Wab, general db version} a derivation similar to the proof of \Cref{lem_symmetry of T}, $T(y_{a^{\alpha}}|u_{a^{\alpha}}) = T(y'_{a^{\alpha}}|u_{a^{\alpha}})$, where $y'_{a^{\alpha}}$ is any combination of an element of $\symm{y}_a$ and an element of $\symm{\eta}_a$. That is, $y'_{a^{\alpha}}$ is any one of $\{y_a,\eta_a\}$, $\{\bconj{y}_a,\eta_a\}$, $\{y_a,\bconj{\eta}_a\}$, and $\{\bconj{y}_a,\bconj{\eta}_a\}$. Thus, the IMJP decoder makes the same decision for the $a^{\alpha}$-channel for either $W_{a^{\alpha},b^{\beta}}$ or $\symm{W}_{a^{\alpha},b^{\beta}}$. We compare the channels obtained by the following two procedures. \begin{itemize} \item \emph{Procedure 1:} Joint channel $W_{a,b}$ goes through sequence $\mathsf{t}$ of polarization steps. \item \emph{Procedure 2:} Joint channel $W_{a,b}$ is symmetrized to form $\symm{W}_{a,b}$. It goes through sequence $\mathsf{t}$ of polarization steps (without any further symmetrization operations). \end{itemize} We iteratively apply the above reasoning and conclude in a similar manner to \Cref{lem_symmetrized and non symmetrized channels have the same pe} that both channels have the same performance under IMJP decoding. Next, we modify Procedure 2. \begin{itemize} \item \emph{Procedure 2a:} Joint channel $W_{a,b}$ is symmetrized to form $\symm{W}_{a,b}$. It goes through sequence $\mathsf{t}$ of polarization steps (without any further symmetrization operations), but at some point mid-sequence, it undergoes a proper upgrading procedure. \end{itemize} Since polarizing and proper upgrading is equivalent to proper upgrading and polarizing (see \Cref{lem_degradation is preserved for joint distributions}) we can assume that the upgrading happens after the entire sequence of polarization steps. Thus, under IMJP decoding, the probability of error of the channel that results from Procedure 2a lower-bounds the probability of error of the channels resulting from Procedures 1 and 2. Similarly, multiple upgrading transforms can also be thought of as occurring after all polarization steps. \end{IEEEproof} \begin{corollary}\label{cor_procedure leads to lower bound} Let $W$ be a BMS channel that undergoes $n$ polarization steps. Let $W_{a,b}$ be the joint channel of two of its polar descendants such that $a,b \in \mathcal{A}$, and let $\symm{Q}_{a,b} \overset{p}{\succcurlyeq} \symm{W}_{a,b}$. Then $P_e^{\textrm{\textup{SC}}}(W) \geq P_e^{\textrm{\textup{IMJP}}}(\symm{Q}_{a,b})$. \end{corollary} \begin{IEEEproof} A direct consequence of \Cref{lem_IMJP provides a tighter lower bound than max Pe,lem_conditions on degrading for conservation of pe} combined with \Cref{prop_Symmetrizing the joint distribution yields a lower bound}. \end{IEEEproof} We emphasize that, by \Cref{prop_Symmetrizing the joint distribution yields a lower bound}, it does not matter how we arrive at $\symm{Q}_{a,b}$. So long as $\symm{Q}_{a,b} \overset{p}{\succcurlyeq} \symm{W}_{a,b}$ and $a,b \in \mathcal{A}$, we can use $\symm{Q}_{a,b}$ to obtain a lower bound on $P_e^{\textrm{\textup{SC}}}(W)$. A practical way to obtain $\symm{Q}_{a,b}$ is via multiple proper upgrading operations that we perform after joint polarization operations. This is the route we take in \Cref{sec_lower bound procedures}. Due to \Cref{prop_Symmetrizing the joint distribution yields a lower bound}, we henceforth assume that joint channel $W_{a,b}$ is symmetrized, and no longer distinguish symmetrized channels or symbols by the $(\symm{\cdot})$ symbol. Replacing the joint channel with its symmetrized version need only be performed once, at the first instance the two channels go through different polarization transforms. \emph{Implementation:} Since symmetrization is performed only once, and since this invariably happens when converting a channel $W$ to $W_{-,+}$, we find the a-, b-, and ab-conjugates using the results of \Cref{ex_conjugates for W-+}. We then form the symmetrized channel using~\eqref{eq_symmetrized channel definition}. Note that it is sufficient to find just the b-conjugates and use the first equation of~\eqref{eq_symmetrized channel definition}. \subsection{Decomposition of Symmetrized Joint Channels} Let the joint channel be $W_b(y_a,u_a,d_b|u_b)$, which, as mentioned above, we assume to be symmetrized. We have % \begin{equation} \begin{split} W_b(y_a,u_a,d_b|u_b) &= \Prob{y_a,u_a|u_b}\Prob{d_b|u_b,y_a,u_a} \\ &= \Prob{u_a}\Prob{y_a|u_a,u_b}\Prob{d_b|u_b,y_a,u_a}\vphantom{\frac{1}{2}} \\ &= \frac{1}{2}W_1(y_a|u_a,u_b)\cdot W_2(d_b|u_b;y_a,u_a), \end{split} \label{eq_decomposition of Wb, db version} \end{equation} in which we used the independence and uniformity of the input bits $u_a$ and $u_b$. The distribution $W_1$ is given by $ W_1(y_a|u_a,u_b) = 2\sum_{d_b} W_b(y_a,u_a,d_b|u_b).$ Whenever $W_1(y_a|u_a,u_b)$ is nonzero, distribution $W_2(d_b|u_b;y_a,u_a)$ is obtained by dividing $W_b(y_a,u_a,d_b|u_b)$ by $W_1(y_a|u_a,u_b)/2$. Our notation $W_2(d_b|u_b;y_a,u_a)$ (with a semicolon, as opposed to $W_2(d_b|y_a,u_a,d_b)$) reminds us that for fixed $y_a,u_a$, channel $W_2$ is a binary-input channel with input $u_b$ and output $d_b$. If $W_1(y_{a0}|u_{a0},u_b) = 0$ for some $y_{a0}, u_{a0}$, we define $W_2(d_b|u_b;y_{a0},u_{a0})$ to be some arbitrary BMS channel, to ensure it is always a valid channel. Since the joint channel is symmetrized, by~\eqref{eq_symmetrized channel properties} we have $W_1(y_a|u_a,u_b) = W_1(y_a|u_a,\bar{u}_b)$. Hence, for any $u_b$, \begin{equation} W_a(y_a|u_a) = \sum_{u'_b} W_1(y_a|u_a,u'_b)\Prob{u'_b} = W_1(y_a|u_a,u_b). \label{eq_decoupling} \end{equation} That is, a consequence of symmetrization is that given $u_a$, output $y_a$ becomes \emph{independent} of $u_b$. This is not true in the general case where the joint channel is not symmetrized. The decomposition of~\eqref{eq_decomposition of Wb, db version} essentially decouples the symmetrized joint channel to a product of two distributions. \begin{lemma} \label{lem_decomposition of symmetrized distribution} Let $W_b(y_a,u_a,d_b|u_b)$ be a symmetrized joint channel. It admits the decomposition \begin{equation} W_b(y_a,u_a,d_b|u_b) = \frac{1}{2}W_a(y_a|u_a) W_2(d_b|u_b;y_a,u_a).\label{eq_decomposition of W_b to W1W2} \end{equation} For any $y_a,u_a$, channel $W_2$ is a BMS channel with input $u_b$ and output $d_b$, i.e., \begin{equation} \label{eq_W2 is a BMS} W_2(d_b|u_b;y_a,u_a) = W_2(-d_b|\bar{u}_b;y_a,u_a).\end{equation} Moreover, $W_2$ satisfies \begin{equation}\label{eq_symmetry for W2} W_2(d_b|u_b;y_a,u_a) = W_2(d_b|u_b;\bar{y}_a,\bar{u}_a). \end{equation} \end{lemma} \begin{IEEEproof} Using~\eqref{eq_decoupling} in~\eqref{eq_decomposition of Wb, db version} yields~\eqref{eq_decomposition of W_b to W1W2}. The remainder of this lemma is readily obtained by using~\eqref{eq_symmetrized channel properties} in~\eqref{eq_decomposition of W_b to W1W2}. \end{IEEEproof} \begin{definition}[Decoupling decomposition] \label{def_decoupling decomposition} A decomposition of the form~\eqref{eq_decomposition of W_b to W1W2} for a symmetrized joint channel is called a \emph{decoupling decomposition}. Channel $W_a$ is obtained by marginalization, i.e., \begin{align*} W_a(y_a|u_a) &= \smashoperator{\sum_{u_b,d_b}} W_b(y_a,u_a,d_b|u_b) \\ &= 2\sum_{d_b}W_b(y_a,u_a,d_b|u_b), \end{align*} where the latter equality, which is due to symmetry, holds for any $u_b$. Then, we compute channel $W_2(d_b|u_b;y_a,u_a)$ using~\eqref{eq_decomposition of W_b to W1W2}. The special case where $W_a(y_a|u_a)=0$ requires special attention. Such a case invariably happens for perfect symbols --- that is, symbols for which $W_a(y_a|u_a)>0$ but $W_a(y_a|\bar{u}_a) = 0$ for some $u_a \in \{0,1\}$. Specifically, we ensure that $W_2$ is a well-defined BMS channel even in this case, so we set it to an arbitrary BSC. Thus, \begin{equation} \label{eq_formula for W2} W_2(d_b|u_b; y_a, u_a) = \begin{cases} \dfrac{W_b(y_a,u_a,d_b|u_b)}{W_a(y_a|u_a)/2}, & W_a(y_a|u_a) >0 \\ \text{An arbitrary BSC}, & \text{otherwise.} \end{cases} \end{equation} When setting to an arbitrary BSC, we make sure not to add new b-channel $D$-values. One possible choice is to set to a BSC whose output has the highest b-channel $D$-value. \end{definition} We use decoupling decompositions of symmetrized joint channels in the sequel. We shall see in \Cref{subsec_Upgrading $W_a$} that $W_2$ plays a central role in the a-channel upgrading procedure. We conclude this section with an example that compares a joint channel and its symmetrized version. In particular, we demonstrate the decoupling decomposition for the symmetrized joint channel. \begin{example} Let $W$ be a BSC with crossover probability $0.2$ and consider $W_{-,+}$, the joint synthetic channel of the `$-$'- and `$+$'-transforms of $W$. In $D$-value representation, the a-channel has four possible outputs $y_a \in \{00,01,10,11\}$ and there are three values of $d_b$: $d_b \in \{-\frac{15}{17},0,\frac{15}{17}\}$ . \Cref{tab_W-+ ua0} contains the probability table of this joint synthetic channel for $u_a = 0$ and varying $y_a,u_b,d_b$. When $y_a = 00$ and $u_a = 0$, the b-channel input $u_b$ is more likely to be $1$ than $0$. Similarly, when $y_a = 11$ and $u_a = 0$, the b-channel input $u_b$ is more likely to be $0$ than $1$. Thus, the channel in \Cref{tab_W-+ ua0} does not satisfy~\eqref{eq_decomposition of W_b to W1W2}. After symmetrization, the a-channel output is either $\symm{0} = \{00,11\}$ or $\symm{1} = \{01,10\}$. The probability table for the symmetrized channel with $u_a = 0$ is shown in \Cref{tab_symm W-+ ua0}. Here, when $u_a = 0$ and $\symm{0}$ is received at the a-channel, $u_b = 0$ or $1$ are equally likely. Indeed, $W^{-}$ is a BSC with crossover probability $2p(1-p) = 0.32$, and the channel in \Cref{tab_symm W-+ ua0} satisfies~\eqref{eq_decomposition of W_b to W1W2}. \begin{table}[t] \centering \caption{Probability table of joint synthetic channel $W_{-,+}$ derived from a BSC with crossover probability $0.2$. Only the case where $u_a = 0$ is shown.} \label{tab_W-+ ua0} \begin{tabular}{c@{\hspace{4mm}}cccc@{\hspace{4mm}}ccc} \textcolor{gray}{($u_a = 0$)} & \multicolumn{3}{c}{$u_b=0$} && \multicolumn{3}{c}{$u_b=1$}\\ \toprule \multirow{2}[3]{*}{$y_a$} & \multicolumn{3}{c}{$d_b$} && \multicolumn{3}{c}{$d_b$}\\ \cmidrule(r){2-4} \cmidrule(r){6-8} & $-\frac{15}{17}$ & $0$ & $\frac{15}{17}$ && $-\frac{15}{17}$ & $0$ & $\frac{15}{17}$ \\ \midrule $00$ & $0.02$ & $0$ & $0$ && $0.32$ & $0$ & $0$ \\ $01$ & $0$ & $0.08$ & $0$ && $0$ & $0.08$ & $0$ \\ $10$ & $0$ & $0.08$ & $0$ && $0$ & $0.08$ & $0$ \\ $11$ & $0$ & $0$ & $0.32$ && $0$ & $0$ & $0.02$ \\ \bottomrule \end{tabular} \end{table} \begin{table}[t] \centering \caption{Probability table of the symmetrized version of the channel from \Cref{tab_W-+ ua0}. Only the case where $u_a = 0$ is shown.} \label{tab_symm W-+ ua0} \begin{tabular}{c@{\hspace{4mm}}cccc@{\hspace{4mm}}ccc} \textcolor{gray}{($u_a = 0$)}& \multicolumn{3}{c}{$u_b=0$} && \multicolumn{3}{c}{$u_b=1$}\\ \toprule \multirow{2}[3]{*}{$y_a$} & \multicolumn{3}{c}{$d_b$} && \multicolumn{3}{c}{$d_b$}\\ \cmidrule(r){2-4} \cmidrule(r){6-8} & $-\frac{15}{17}$ & $0$ & $\frac{15}{17}$ && $-\frac{15}{17}$ & $0$ & $\frac{15}{17}$ \\ \midrule $\symm{0}$ & $0.02$ & $0$ & $0.32$ && $0.32$ & $0$ & $0.02$ \\ $\symm{1}$ & $0$ & $0.16$ & $0$ && $0$ & $0.16$ & $0$ \\ \bottomrule \end{tabular} \end{table} \end{example} \section{Upgrading Procedures for Joint Synthetic Channels}\label{sec_upgrading procedures for joint bit channels} In this section, we introduce proper upgrading procedures for joint synthetic channels. The overall goal is to reduce the alphabet size of the joint channel. The upgrading procedures we develop enable us to reduce the alphabet size of each of the marginals without changing the distribution of the other; there is a different procedure for each marginal. As an intermediate step, we further couple the marginals by increasing the alphabet size of one of them. The joint channel $W_{a,b}$ is assumed to be symmetrized and in $D$-value representation. The upgrading procedures will maintain this. As discussed in \Cref{sec_Symmetrized Joint Bit-Channels}, we do not distinguish symmetrized channels with any special symbol. The upgrading procedure of \Cref{subsec_Upgrading $W_a$} hinges on symmetrization. The upgrading procedure of \Cref{subsec_upgrading $W_b$} does not require symmetrization and holds for non-symmetrized channels without change. However, we shall see that symmetrization simplifies the resulting expressions. \subsection{Upgrading Channel $W_a$}\label{subsec_Upgrading $W_a$} We now introduce a theorem that enables us to deduce an upgrading procedure that upgrades $W_a$ and reduces its output alphabet size. Let symmetrized joint channel $W_b(y_a,u_a,d_b|u_b)$ admit decoupling decomposition~\eqref{eq_decomposition of W_b to W1W2}. Let $Q_b(z_a,u_a,z_b|u_b)$ be another symmetrized joint channel, where $z_b$ represents the $D$-value of the b-channel output. It also admits a decoupling decomposition, \begin{equation} Q_b(z_a,u_a,z_b|u_b) = \frac{1}{2}Q_a(z_a|u_a)Q_2(z_b|u_b;z_a,u_a).\label{eq_decomposition of Q_b to Q1Q2}\end{equation} \begin{theorem}\label{thm_upgrading Wa} Let $W_b$ and $Q_b$ be symmetrized joint channels with decoupling decompositions~\eqref{eq_decomposition of W_b to W1W2} and~\eqref{eq_decomposition of Q_b to Q1Q2}, respectively. Then, $Q_b \overset{p}{\succcurlyeq} W_b$ if \begin{enumerate} \item $Q_a(z_a|u_a) \succcurlyeq W_a(y_a|u_a)$ with degrading channel $P_a(y_a|z_a)$. \item $Q_2(z_b|u_b;z_a,u_a) \succcurlyeq W_2(d_b|u_b;y_a,u_a)$ for all $u_a,y_a,z_a$ such that $P_a(y_a|z_a) > 0$. \end{enumerate} \end{theorem} Before going into the proof, some comments are in order. First, we do not claim that any $Q_b$ that is upgraded from $W_b$ must satisfy this theorem. Second, the meaning of the second item is that, for fixed $z_a,u_a$, BMS channel $Q_2(z_b|u_b;z_a,u_a)$ with binary input $u_b$ is upgraded from a set of BMS channels $\{W_2(d_b|u_b;y_a,u_a)\}_{y_a}$ with the same binary input. \begin{IEEEproof} Using decoupling decompositions~\eqref{eq_decomposition of W_b to W1W2} and~\eqref{eq_decomposition of Q_b to Q1Q2} and the structure of a proper degrading channel~\eqref{eq_proper form of degrading channels, d version}, $Q_b \overset{p}{\succcurlyeq} W_b$ if and only if there exist $P_a'$ and $P_b'$ such that \iftoggle{twocol}{ \begin{multline} \sum_{z_a} Q_a(z_a|u_a) P_a'(y_a|z_a) V(d_b|z_a,y_a,u_a,u_b) \\= W_a(y_a|u_a) W_2(d_b|u_b;y_a,u_a), \label{eq_degrading Q1Q2 to W1W2} \end{multline}}{ \begin{equation} \sum_{z_a} Q_a(z_a|u_a) P_a'(y_a|z_a) V(d_b|z_a,y_a,u_a,u_b) = W_a(y_a|u_a) W_2(d_b|u_b;y_a,u_a), \label{eq_degrading Q1Q2 to W1W2} \end{equation}} where \iftoggle{twocol}{ \begin{multline} V(d_b|z_a,y_a,u_a,u_b)\\ = \sum_{z_b}Q_2(z_b|u_b;z_a,u_a) P_b'(d_b|y_a,z_a,u_a,z_b). \label{eq_degrading Q2 to V} \end{multline}}{ \begin{equation} V(d_b|z_a,y_a,u_a,u_b) = \sum_{z_b}Q_2(z_b|u_b;z_a,u_a) P_b'(d_b|y_a,z_a,u_a,z_b). \label{eq_degrading Q2 to V} \end{equation}} We now find $P_a'$ and $P_b'$ from the conditions of the theorem. The first condition of the theorem implies that there exists a channel $P_a(y_a|z_a)$ such that \begin{equation} \sum_{z_a} Q_a(z_a|u_a)P_a(y_a|z_a) = W_a(y_a|u_a). \label{eq_relationship between Qa and Wa} \end{equation} The second condition of the theorem implies that for each $y_a,u_a,z_a$ there exists a channel $P_b(d_b|y_a,z_a,u_a,z_b)$ such that \iftoggle{twocol}{ \begin{multline} \sum_{z_b}Q_2(z_b|u_b;z_a,u_a)P_b(d_b|y_a,z_a,u_a,z_b) \\= W_2(d_b|u_b;y_a,u_a)\cdot \kindi{\Prob{y_a|z_a}>0}.\label{eq_Q2 is upgraded from many W2 channels}\end{multline}}{ \begin{equation} \sum_{z_b}Q_2(z_b|u_b;z_a,u_a)P_b(d_b|y_a,z_a,u_a,z_b) = W_2(d_b|u_b;y_a,u_a)\cdot \kindi{\Prob{y_a|z_a}>0}.\label{eq_Q2 is upgraded from many W2 channels}\end{equation}} We set \begin{align*} P_a'(y_a|z_a) &= P_a(y_a|z_a), \\ P_b'(d_b|y_a,z_a,u_a,z_b) &= P_b(d_b|y_a,z_a,u_a,z_b).\end{align*} Using~\eqref{eq_Q2 is upgraded from many W2 channels} in~\eqref{eq_degrading Q2 to V}, we have \[ V(d_b|z_a,y_a,u_a,u_b) = W_2(d_b|u_b;y_a,u_a) \cdot \kindi{P_a(y_a|z_a)>0 }.\] It is easily verified that~\eqref{eq_degrading Q1Q2 to W1W2} is satisfied by $P_a'=P_a$ and this $V$, completing the proof. \end{IEEEproof} \begin{remark} \label{rem_W2 doesn't matter} Recall from~\eqref{eq_formula for W2} that when $W_a(y_a|u_a) = 0$, we set $W_2$ to an arbitrary BSC. At this point, the reader may wonder what effect --- if any --- does this have on the resulting joint channel. We now show that there is no effect. To see this, observe from~\eqref{eq_relationship between Qa and Wa} that if $W_a(y_a|u_a) = 0$ and $P_a(y_a|z_a)>0$, then necessarily $Q_a(z_a|u_a) = 0$. Hence, by~\eqref{eq_decomposition of Q_b to Q1Q2}, $Q_b(z_a,u_a, z_b|u_b) = 0$. This latter equality is the same regardless of how we had set $W_2(d_b|u_b; y_a,u_a)$. \end{remark} How might one use \Cref{thm_upgrading Wa} to upgrade the a-channel? A naive way would be to first upgrade the marginal $W_a$ to $Q_a$ using some known method (e.g., the methods of~\cite{Tal_2013}, see Appendix~\ref{ap_BMS channel upgrades}). This yields degrading channel $P_a$ by which one can find channel $Q_2$ that satisfies~\eqref{eq_Q2 is upgraded from many W2 channels}. With $Q_a$ and $Q_2$ at hand, one forms the product~\eqref{eq_decomposition of Q_b to Q1Q2} to obtain $Q_b$. If the reader were to attempt to do this, she would find out that it often changes the b-channel. Moreover, this change may be radical: the resulting b-channel may be so upgraded to become almost noiseless, which boils down to an uninteresting bound, the trivial lower bound~\eqref{eq_trivial lower bound}. It \emph{is} possible to upgrade the a-channel without changing the b-channel; this requires an additional transform we now introduce. The \emph{upgrade-couple} transform enables upgrading the a-channel without changing the b-channel. The idea is to split each a-channel symbol to several classes, according to the possible b-channel outputs. Symbols within a class have the same $W_2$ channel, so that confining upgrade-merges to operate within a class inherently satisfies the second condition of \Cref{thm_upgrading Wa}. Thus, we circumvent changes to the b-channel. This results in only a modest increase to the number of output symbols of the overall joint channel. Let channel $W_b$ have $2B$ possible $D$-values, $\pm d_{b1}, \pm d_{b2},\ldots, \pm d_{bB}$. We assume that erasure symbols are duplicated,\footnote{That is, there is a ``positive'' and a ``negative'' erasure, see~\cite[Lemma 4]{Tal_2013}.} and $0 \leq d_{b1} \leq d_{b2} \leq \cdots \leq d_{bB} \leq 1$. For each a-channel symbol $y_a$ we define $B^2$ upgrade-couple symbols $y_a^{i,j}$, $i,j \in\{1,2,\ldots B\}$. The new symbols \emph{couple} the outputs of the a- and b-channels (whence the name of the upgrade-couple transform). Namely, if the a-channel output is $y_a^{i,j}$ and $u_a = 0$, the b-channel output can only be $\pm d_{bi}$; if the a-channel output is $y_a^{i,j}$ and $u_a = 1$, the b-channel output can only be $\pm d_{bj}$. The upgrade-couple channel $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ is defined by \begin{equation} \upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b) \triangleq W_b(y_a,u_a,d_b|u_b)\cdot S_{i,j}(y_a,u_a,d_b), \label{eq_upgrade split definition} \end{equation} where \begin{align*} S_{i,j}(y_a,u_a,d_b) &= \begin{dcases} \smashoperator[r]{\sum_{u_b}} W_2(d_{bj}|u_b;y_a, 1), & \begin{aligned} u_a&=0, \\[-0.1cm] d_b&=\pm d_{bi}\end{aligned} \\ \smashoperator[r]{\sum_{u_b}} W_2(d_{bi}|u_b;y_a, 0), & \begin{aligned} u_a&=1, \\[-0.1cm] d_b&=\pm d_{bj}\end{aligned}\\ 0, & \text{otherwise,} \end{dcases} \end{align*} and $W_2(d_b|u_b;y_a,u_a)$ is derived from the decoupling decomposition of $W_b$, see~\eqref{eq_formula for W2}. As intuition for the factor $S_{i,j}(y_a,u_a,d_b)$, observe that it ensures that $\upgradec{W}_b(y_a^{i,j},u_a=0,d_b|u_b)=0$ for $d_b \not\in \pm d_{bi}$ and that $\upgradec{W}_b(y_a^{i,j},u_a=1,d_b|u_b)=0$ for $d_b \not\in \pm d_{bj}$. Crucially, it \emph{does not} upgrade the marginal channels (see \Cref{cor_Wbstar and Wbhatstar are the same,cor_Wastar and Wahatstar are the same}). In particular, as shown in \Cref{lem_properties of upgrade-couple}, the factor $S_{i,j}(y_a,u_a,d_b)$ ensures that symbols $y_a$ of channel $W_a$ and $y_a^{i,j}$ of channel $\upgradec{W}_a$ share the same a-channel $D$-value. \begin{remark} For the original joint channel there may be a-channel symbols $y_a$ for which $W_a(y_a|0) > 0$ but $W_a(y_a|1) = 0$. For the upgrade-couple channel $\upgradec{W}_b$, the symbol $y_a^{i,j}$ determines the possible values for the b-channel output when $u_a = 0$ or when $u_a = 1$. The symbol $y_a$ never appears with positive probability if $u_a = 1$, yet, because it may appear with positive probability if $u_a = 0$, we still need to map it to some $y_a^{i,j}$. The upgrade-couple transform is well defined even in this case, thanks to our definition of $W_2$, see~\eqref{eq_formula for W2}. In particular, if $y_a$ never occurs with positive probability with $u_a = 1$, say, then $y_a^{i,j}$ for the upgrade-couple channel also never occurs with positive probability with $u_a =1$ (see~\Cref{lem_properties of upgrade-couple}, item 2). \end{remark} A parameter that is related to $S_{i,j}$ and will be useful in the sequel is \begin{equation} \label{eq_definition of alphaij} \alpha_{i,j}(y_a) = S_{i,j}(y_a,u_a=0,d_{bi})\cdot S_{i,j}(y_a,u_a=1,d_{bj}). \end{equation} For every $y_a,u_a,d_b$, there must exist some $i,j$ such that $S_{i,j}(y_a,u_a,d_b) > 0$. The following lemma makes this clear. \begin{lemma} For any $y_a,u_a,d_b$ we have \begin{align} \sum_{i,j} S_{i,j}(y_a,u_a,d_b) &= 1, \label{eq_sum Sij=1}\\ \sum_{i,j} \alpha_{i,j}(y_a) &= 1. \label{eq_sum alphaij=1} \end{align} \end{lemma} \begin{IEEEproof} Without loss of generality, we shall show~\eqref{eq_sum Sij=1} for $u_a = 0$ and $d_b = + d_{b1}$. Observe that $S_{i,j}(y_a,0,d_{b1}) = 0$ for all $i>1$. Thus, $\sum_{i,j}S_{i,j}(y_a,0,d_{b1}) = \sum_j S_{1,j}(y_a,0,d_{b1})$. Next, by~\eqref{eq_W2 is a BMS}, \begin{align*} \sum_{j} S_{1,j}(y_a,0,d_{b1}) &= \sum_j \sum_{u_b} W_2(+d_{bj}|u_b; y_a,1) \\ &= \sum_{d_b} W_2(d_b|0;y_a,1) \\ &=1, \end{align*} where the latter equality is because $W_2$ is a valid BMS channel. To see~\eqref{eq_sum alphaij=1}, observe that \begin{equation*} \alpha_{i,j}(y_a) = \left( \sum_{u_b} W_2(d_{bj}|u_b;y_a,1) \right)\cdot \left( \sum_{u_b'} W_2(d_{bi}|u_b';y_a,0) \right). \end{equation*} Summing over $i,j$ and using~\eqref{eq_W2 is a BMS} yields the result. \end{IEEEproof} As we now show, since $W_b$ is symmetrized, so is $\upgradec{W}_b$. \begin{lemma}\label{lem_upgrade couple channel is symmetrized} Let $W_b(y_a,u_a,d_b|u_b)$ be a symmetrized joint channel. Then, $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$, defined as in~\eqref{eq_upgrade split definition}, is also symmetrized. \end{lemma} \begin{IEEEproof} To establish the lemma, we need to show that~\eqref{eq_symmetrized channel properties} holds for the upgrade-couple channel. For the a-channel $W_a$, let symbols $y_a, \bar{y}_a$ be conjugates, i.e., $W_a(y_a|u_a) = W_a(\bar{y}_a|\bar{u}_a)$. Channel $W_b$ is symmetrized, so, by~\eqref{eq_symmetry for W2}, $S_{i,j}(y_a,u_a,d_b)= S_{j,i}(\bar{y}_a,\bar{u}_a,d_b)$. Furthermore, by definition, $S_{i,j}(y_a,u_a,d_b) = S_{i,j}(y_a,u_a,-d_b)$. Thus, \begin{align*} \upgradec{W}_b(y_a^{ i,j},u_a,d_b|u_b) &= \upgradec{W}_b(\bar{y}_a^{j,i},\bar{u}_a,d_b|u_b) \\ &= \upgradec{W}_b(y_a^{i,j},u_a, -d_b|\bar{u}_b) \\ &= \upgradec{W}_b(\bar{y}_a^{j,i},\bar{u}_a -d_b|\bar{u}_b). \end{align*} Next, recall that $\upgradec{W}_a(y_a^{i,j}|u_a) = \sum_{d_b,u_b} \upgradec{W}_b(y_a^{ i,j},u_a,d_b|u_b)$, so that $ \upgradec{W}_a(y_a^{i,j}|u_a) = \upgradec{W}_a(\bar{y}_a^{j,i}|\bar{u}_a)$. Thus,~\eqref{eq_symmetrized channel properties} holds as required. \end{IEEEproof} In the proof of \Cref{lem_upgrade couple channel is symmetrized} we have seen that the conjugate symbol of $y_a^{i,j}$ is $\bar{y}_a^{j,i}$ (with the order of $i$ and $j$ flipped). We summarize this in the following corollary. \begin{corollary}\label{cor_conjugate symbols of upgrade-couple channel} If $W_a(\bar{y}_a|\bar{u}_a) = W_a(y_a|u_a)$ then $\upgradec{W}_a(\bar{y}_a^{j,i}|\bar{u}_a) = \upgradec{W}_a(y_a^{i,j}|u_a)$. \end{corollary} Since $\upgradec{W}_b$ is symmetrized, it admits decoupling decomposition \begin{equation} \upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b) = \frac{1}{2}\upgradec{W}_a(y_a^{i,j}|u_a)\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a).\label{eq_decoupling decomposition of check Wb} \end{equation} Denote by $\text{BSC}(p)$ a binary symmetric channel with crossover probability $p$. In \Cref{lem_properties of upgrade-couple} we derive $\upgradec{W}_a$ [see~\eqref{eq_definition of Wahat}] and establish that for every $y_a$, \begin{equation} \upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a) = \begin{dcases} \text{BSC}\left(\frac{1-d_{bi}}{2}\right), & u_a = 0 \\[0.2cm] \text{BSC}\left(\frac{1-d_{bj}}{2}\right), & u_a = 1. \end{dcases}\label{eq_W2 for decoupling decomposition}\end{equation} That is, when $u_a=0$ we have $\upgradec{W}_2(\pm d_{bi}|u_b;y_a^{i,j},u_a) = (1\pm (-1)^{u_b}d_{bi})/2$, when $u_a = 1$ we have $\upgradec{W}_2(\pm d_{bj}|u_b;y_a^{i,j},u_a) = (1\pm (-1)^{u_b}d_{bj})/2$, and $\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)$ is zero for any other $d_b$. We emphasize that we define $\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)$ using~\eqref{eq_W2 for decoupling decomposition} even if $\upgradec{W}_a(y_a^{i,j}|u_a) = 0$. \begin{lemma}\label{lem_properties of upgrade-couple} Let $W_b(y_a,u_a,d_b|u_b)$ be a symmetrized joint channel and let $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ be defined as in~\eqref{eq_upgrade split definition}, with decoupling decomposition~\eqref{eq_decoupling decomposition of check Wb}. Then \begin{enumerate} \item Joint channel $\upgradec{W}_b$ is upgraded from joint channel $W_b$ with a proper degrading channel that deterministically maps $y_a^{i,j}$ to $y_a$. \item We have \begin{equation} \upgradec{W}_a(y_a^{i,j}|u_a) = W_a(y_a|u_a) \cdot \alpha_{i,j}(y_a).\label{eq_definition of Wahat} \end{equation} Moreover, symbols $y_a$ of channel $W_a$ and $y_a^{i,j}$ of channel $\upgradec{W}_a$ have the same a-channel $D$-value for every $i,j$ such that $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)>0$. \item For every $y_a$, BMS channel $\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)$ with input $u_b$ and output $d_b$ is $\text{BSC}((1-d_{bi})/2)$ if $u_a = 0$ and $\text{BSC}((1-d_{bj})/2)$ if $u_a = 1$. \end{enumerate} \end{lemma} \begin{IEEEproof} For the first item, we sum~\eqref{eq_upgrade split definition} over $i,j$ and obtain, using~\eqref{eq_sum Sij=1}, \[ W_b(y_a,u_a,d_b|u_b) = \sum_{i,j} \upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b).\] That is, joint channel $\upgradec{W}_b$ is upgraded from $W_b$ with degrading channel $P_a$ that deterministically maps $y_a^{i,j}$ to $y_a$. This is a proper degrading channel. For the second item, we marginalize $\upgradec{W}_b$ over $d_b$ and $u_b$. Using~\eqref{eq_decomposition of W_b to W1W2} in the right-hand-side of~\eqref{eq_upgrade split definition}, we obtain~\eqref{eq_definition of Wahat}, where $\alpha_{i,j}(y_a)$ is given in~\eqref{eq_definition of alphaij}. Whenever $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)>0$, we have, by~\eqref{eq_upgrade split definition}, $\alpha_{i,j}(y_a)>0$. Thus, \[ \frac{\upgradec{W}_a(y_a^{i,j}|0) - \upgradec{W}_a(y_a^{i,j}|1)}{\upgradec{W}_a(y_a^{i,j}|0) + \upgradec{W}_a(y_a^{i,j}|1)} = \frac{W_a(y_a|0) - W_a(y_a|1)}{W_a(y_a|0) + W_a(y_a|1)},\] implying that $y_a$ and $y_a^{i,j}$ have the same a-channel $D$-value for their respective channels. For the final item, if $\upgradec{W}_a(y_a^{i,j}|u_a) = 0$, we are free to set $\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)$ as we please, so we set it as per the item. Otherwise, there are only two values of $d_b$ for which $S_{i,j}(y_a,u_a,d_b)$ is nonzero. Hence, $\upgradec{W}_b$ can output only two b-channel $D$-values for fixed $y_a^{i,j}$ and $u_a$. Thus, $\upgradec{W}_2$ is a BMS channel with only two possible outputs, or, in other words, a BSC. A BSC that outputs $D$-values $\pm d$, $0 \leq d\leq 1$, has crossover probability $(1-d)/2$. This establishes the item. \end{IEEEproof} \begin{definition}[Canonical channel] The canonical channel $W^*(d|u)$ of channel $W(y|u)$ has a single entry for each $D$-value. That is, denoting by $D_{d}$ the set of symbols $y$ whose $D$-value is $d$, we have $W^*(d|u) = \sum_{D_{d}} W(y|u).$ It can be shown that a channel is equivalent to its canonical form, i.e., each form can be degraded from the other. \end{definition} \begin{corollary}\label{cor_Wbstar and Wbhatstar are the same} The canonical b-channels of $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ and $W_b(y_a,u_a,d_b|u_b)$ coincide. \end{corollary} \begin{IEEEproof} This is a direct consequence of the first item of \Cref{lem_properties of upgrade-couple}: \begin{equation*} \begin{IEEEeqnarraybox}{rCl} \upgradec{W}_b^*(d_b|u_b) &=& \sum_{y_a,u_a} \sum_{i,j} \upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)\\ &=& \sum_{y_a,u_a} W_b(y_a,u_a,d_b|u_b) \\ &=& W_b^*(d_b|u_b). \end{IEEEeqnarraybox} \IEEEQEDhereeqn \end{equation*} \end{IEEEproof} \begin{corollary} \label{cor_Wastar and Wahatstar are the same} The canonical a-channels of $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ and $W_b(y_a,u_a,d_b|u_b)$ coincide. \end{corollary} \begin{IEEEproof} This follows from the second item of \Cref{lem_properties of upgrade-couple}, \eqref{eq_sum alphaij=1}, and~\eqref{eq_definition of Wahat}. \end{IEEEproof} \begin{definition}[Class] The \emph{class} $C_{i,j}$ is the set of symbols $y_a^{i,j}$ with fixed $i,j$. \end{definition} There are $B^2$ classes. The size of each class is the number of symbols $y_a$. By~\eqref{eq_W2 for decoupling decomposition}, $\upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)$ is the \emph{same} BSC for all symbols of class $C_{i,j}$ and fixed $u_a$. Thus, the second item of \Cref{thm_upgrading Wa} becomes trivial and is immediately satisfied if we use an upgrading procedure that upgrade-merges several symbols of the same class $C_{i,j}$. To determine which upgrading procedures may be used, we turn to the degrading channel. So long as the degrading channel does not mix a symbol and its conjugate, the upgrading procedure can be confined to a single class. This is because conjugate symbols belong to different classes, as established in \Cref{cor_conjugate symbols of upgrade-couple channel}. Thus, of the upgrading procedures of~\cite{Tal_2013} (see Appendix~\ref{ap_BMS channel upgrades}) we can use either upgrade-merge-3 without restriction or upgrade-merge-2 provided that the two symbols to be merged have the same a-channel $D$-value. \begin{theorem}\label{thm_upgrade split} Let $W_b(y_a,u_a,d_b|u_b)$ be some joint channel with marginals $W_a(y_a|u_a), W_b^*(d_b|u_b)$ and upgrade-couple counterpart $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$. Let $Q_a(z_a|u_a) \succcurlyeq W_a(y_a|u_a)$ obtained by an upgrade-merge-3 procedure. Then there exists joint channel $\upgradec{Q}_b(z_a^{i,j},u_a,d_b|u_b) \overset{p}{\succcurlyeq} \upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ with canonical marginals $\upgradec{Q}_a^*(z_a|u_a), \upgradec{Q}_b^*(d_b|u_b)$ such that $\upgradec{Q}_a^* = Q_a^*$ and $\upgradec{Q}_b^* = W_b^*$. \end{theorem} \begin{IEEEproof} The idea is to confine the upgrading procedures to work within a class, utilizing \Cref{thm_upgrading Wa} over each class separately. Assume that the upgrading procedure from $W_a$ to $Q_a$ replaces symbols $y_{a1},y_{a2},y_{a3}$ with symbols $z_{a1},z_{a3}$. We obtain $\upgradec{Q}_b$ by using \Cref{thm_upgrading Wa} for each class $C_{i,j}$ of $\upgradec{W}_b$ separately. The a-channel upgrade procedure for class $C_{i,j}$ is upgrade-merge-3 from $\upgradec{W}_a$ to $\upgradec{Q}_a$ that replaces symbols $y_{a1}^{i,j},y_{a2}^{i,j},y_{a3}^{i,j}$ with symbols $z_{a1}^{i,j},z_{a3}^{i,j}$. As the upgrade is confined to symbols of the same class, the channel $\upgradec{W}_2$ --- given by~\eqref{eq_W2 for decoupling decomposition} --- is the same regardless of $y_a$, as established in \Cref{lem_properties of upgrade-couple}, item 3. Hence, the second item of \Cref{thm_upgrading Wa} is automatically satisfied within a class $C_{i,j}$, with \begin{equation} \upgradec{Q}_2(d_b|u_b;z_a^{i,j},u_a) = \upgradec{W}_2(d_b|u_b;y_a^{i,j},u_a)\label{eq_within a class Q2 is the same}\end{equation} for all $y_a,z_a$. Channel $\upgradec{Q}_b$ is then obtained by the product of $\upgradec{Q}_a$ and $\upgradec{Q}_2$ as per~\eqref{eq_decoupling decomposition of check Wb}: \begin{equation} \upgradec{Q}_b(z_a^{i,j},u_a,d_b|u_b) = \frac{1}{2} \upgradec{Q}_a(z_a^{i,j}|u_a)\upgradec{Q}_2(d_b|u_b;z_a^{i,j},u_a).\label{eq_decoupling decomposition of check Qb} \end{equation} By properties of upgrade-merge-3 (see~\eqref{eq_upgrade_merge_3} in Appendix~\ref{ap_upgrade merge 3}) we have $ \sum_{z_a} \upgradec{Q}_a (z_a^{i,j}|u_a) = \sum_{y_a} \upgradec{W}_a(y_a^{i,j}|u_a).$ Therefore, \begin{align*} \upgradec{Q}_b^*(d_b|u_b) &= \sum_{i,j,u_a}\sum_{z_a}\upgradec{Q}_b(z_a^{i,j},u_a,d_b|u_b) \\ &\overset{\mathclap{(a)}}{=} \sum_{i,j,u_a}\sum_{z_a}\frac{1}{2} \upgradec{Q}_2(d_b|u_b;z_a^{i,j},u_a) \upgradec{Q}_a(z_a^{i,j}|u_a) \\ &\overset{\mathclap{(b)}}{=} \sum_{i,j,u_a}\frac{1}{2} \upgradec{W}_2(d_b|u_b;y_{a1}^{i,j},u_a) \sum_{z_a}\upgradec{Q}_a(z_a^{i,j}|u_a) \\ &= \sum_{i,j,u_a}\frac{1}{2} \upgradec{W}_2(d_b|u_b;y_{a1}^{i,j},u_a) \sum_{y_a}\upgradec{W}_a(y_a^{i,j}|u_a) \\ &\overset{\mathclap{(c)}}{=} \sum_{i,j,u_a}\sum_{y_a}\frac{1}{2} \upgradec{W}_2(d_b|u_b;y_{a}^{i,j},u_a) \upgradec{W}_a(y_a^{i,j}|u_a) \\ &\overset{\mathclap{(d)}}{=} W_b^*(d_b|u_b), \end{align*} where in $(a)$ we used the decoupling decomposition~\eqref{eq_decoupling decomposition of check Qb}; $(b)$ and $(c)$ are by \Cref{lem_properties of upgrade-couple}, item 3 and by~\eqref{eq_within a class Q2 is the same}; finally, $(d)$ is due to \Cref{cor_Wbstar and Wbhatstar are the same}. To see that the canonical a-channel marginals coincide, note that by \Cref{lem_properties of upgrade-couple}, item 2, for any fixed $z_a$, the symbols $\{z_a^{i,j}\}_{i,j}$ all have the same a-channel $D$-value. Let $d_a$ be some a-channel $D$-value, and let $D_{d_a}$ be the set of a-channel outputs $z_a$ whose a-channel $D$-value is $d_a$. Then, \begin{align*} \upgradec{Q}_a^*(d_a|u_a) &= \sum_{z_a \in D_{d_a}} \sum_{i,j} \sum_{d_b,u_b}\upgradec{Q}_b(z_a^{i,j},u_a,d_b|u_b) \\ &= \sum_{z_a \in D_{d_a}} \sum_{i,j}\upgradec{Q}_a(z_a^{i,j}|u_a) \\ &\overset{\mathclap{(a)}}{=} \sum_{z_a \in D_{d_a}} Q_a(z_a|u_a)\\ &= Q_a^*(d_a|u_a), \end{align*} where $(a)$ is a direct consequence of the expressions for upgrade-merge-3 and our construction of upgrading each class separately. \end{IEEEproof} To use \Cref{thm_upgrade split}, one begins with a design parameter $A$ that controls the output alphabet size. Working one class at a time, one then applies upgrade operations in succession to reduce the class size to $2A$. The resulting channel, therefore, will have $2AB^2$ symbols overall. The canonical a-channel marginal that results from this operation will have at most $2A$ symbols. \begin{remark} The upgrade-merge-3 procedure replaces three conjugate symbol pairs with two conjugate symbol pairs. Recall from \Cref{cor_conjugate symbols of upgrade-couple channel} that after the upgrade-couple transform, conjugate symbols belong to different classes. In particular, if $y_a$ and $\bar{y}_a$ are a conjugate pair of the a-channel before the upgrade-couple transform, then $y_a^{i,j} \in C_{i,j}$ and $\bar{y}_a^{j,i} \in C_{j,i}$ are a conjugate pair of the a-channel after the upgrade-couple transform. Therefore, when one uses \Cref{thm_upgrade split} to replace the symbols \[\left\{y_{a1}^{i,j},y_{a2}^{i,j},y_{a3}^{i,j}\right\} \to \left\{z_{a1}^{i,j},z_{a3}^{i,j}\right\},\] one must also replace their conjugates\[\left\{\bar{y}_{a1}^{j,i},\bar{y}_{a2}^{j,i},\bar{y}_{a3}^{j,i}\right\} \to \left\{\bar{z}_{a1}^{j,i},\bar{z}_{a3}^{j,i}\right\}.\] We still always operate within a class as nowhere do we mix symbols from different classes. Alternatively, one may upgrade only classes $C_{i,j}$ with $i \geq j$ and then use channel symmetry to obtain the upgraded forms of classes $C_{j,i}$. \end{remark} There is one case where it is possible to use upgrade-merge-2, as stated in the following corollary. \begin{corollary}\label{cor_upgrade split} \Cref{thm_upgrade split} also holds if the a-channel upgrade procedure is upgrade-merge-2 applied to two symbols of the same a-channel $D$-value. \end{corollary} \begin{IEEEproof} While in general the upgrade-merge-2 procedure mixes a symbol and its conjugate, when the two symbols to be merged have the same a-channel $D$-value this is no longer the case (see Appendix~\ref{ap_upgrade merge 2}), and we can follow along the lines of the proof of \Cref{thm_upgrade split}. We omit the details. \end{IEEEproof} The reason that~\cite{Tal_2013} introduced both the upgrade-merge-2 and upgrade-merge-3 procedures despite the superiority of the latter stems from numerical issues. To implement upgrade-merge-3 we must divide by the difference of the extremal $D$-values to be merged. If these are very close this can lead to numerical errors. Upgrade-merge-2 is not susceptible to such errors. On the other hand, upgrade-merge-2 cannot be used in the manner stated above; it requires us to mix symbols from two classes $C_{i,j}$ and $C_{j,i}$ that may have wildly different $\upgradec{Q}_2$ channels. Thus, this will undesirably upgrade the b-channel. In practice, however, we may be confronted with a triplet of symbols with very close, but not identical, a-channel $D$-values. To avoid numerical issues, we utilize a fourth nearby symbol. Say that our triplet\footnote{To simplify notation, we omit the dependence on the class; it is clear that we do this for each class separately.} is $y_{a1},y_{a2},y_{a3}$ with a-channel $D$-values $d_{a1}\leq d_{a2}<d_{a3}$ such that $d_{a3}-d_{a1} < \epsilon$, for some ``closeness'' threshold $\epsilon$. Let $y_{a4}$ have a-channel $D$-value $d_{a4}$ such that $d_{a4}-d_{a1} > \epsilon$. Then, we apply upgrade-merge-3 twice: first for $y_{a1},y_{a2},y_{a4}$ obtaining $z_{a1}, z_{a4}$ with a-channel $D$-values $d_{a1},d_{a4}$ and then for $z_{a1},y_{a3},z_{a4}$, ending up with $z'_{a1},z'_{a4}$ with a-channel $D$-values $d_{a1},d_{a4}$. In this example we have chosen a fourth symbol with a greater a-channel $D$-value than $d_{a4}$, but we could have similarly chosen a fourth symbol with a smaller a-channel $D$-value than $d_{a1}$ instead. \subsection{Upgrading Channel $W_b$} \label{subsec_upgrading $W_b$} We now show how to upgrade $W_{a,b}(y_a,u_a,d_b|u_a,u_b)$ to channel $Q_{a,b}(y_a,u_a,z_b|u_a,u_b)$ such that $Q_b \succcurlyeq W_b$ and $Q_a = W_a$. The idea is to begin with $W_b^*$, a channel equivalent to $W_b$ in which $y_a$ and $u_a$ are not explicit in the output. The channel $W_b^*$ is given by $W_b^*(d_b|u_b) = \sum_{y_a,u_a} W_b(y_a,u_a,d_b|u_b)$. We upgrade $W_b^*$ to $Q_b^*$ using some known method, such that channel $P_b^*$ degrades $Q_b^*$ to $W_b^*$. To form upgraded channel $Q_b$, we ``split'' the outputs of $Q_b^*$ to include $y_a$ and $u_a$ and find a degrading channel that degrades $Q_b$ to $W_b$. We shall see that the upgraded channel $Q_b$ is given by \[ Q_b(y_a,u_a,z_b|u_b) = Q_b^*(z_b|u_b) \sum_{d_b} \frac{P_b^*(d_b|z_b)W_b(y_a,u_a,d_b)}{W_b^*(d_b)},\] where $W_b(y_a,u_a,d_b)$ and $W_b^*(d_b)$ are defined in~\eqref{eq_definition of Wbstar and and Wb}, below. Finally, we form the joint channel $Q_{a,b}$ using~\eqref{eq_Wab and its relationship to Wb}. We illustrate this in \Cref{fig_upgragding channel b}. \begin{theorem} \label{thm_Wb can be upgraded to Qb with ya and va intact} Let $W_b(y_a,u_a,d_b|u_b)$ be a joint channel where $d_b$ is the $D$-value of the b-channel's output. Let $W_b^*(d_b|u_b)$ be a channel equivalent to $W_b$, and let $Q_b^*(z_b|u_b) \succcurlyeq W_b^*(d_b|u_b)$ with degrading channel $P_b^*(d_b|z_b)$. Then there exists joint channel $Q_b(y_a,u_a,z_b|u_b)$ such that $Q_b(y_a,u_a,z_b|u_b) \overset{p}{\succcurlyeq} W_b(y_a,u_a,d_b|u_b)$ and $\sum_{y_a,u_a} Q_b(y_a,u_a,z_b|u_b) = Q_b^*(z_b|u_b)$. \end{theorem} \begin{IEEEproof} We shall explicitly find $Q_b$ and an appropriate degrading channel. The degrading channel will be of the form $P_b(d_b|y_a,u_a,z_b)$, i.e., $y_a$ and $u_a$ pass through the degrading channel unchanged. Such degrading channels are proper. Since $Q_b^* \succcurlyeq W_b^*$ we have, for any $d_b$ and $u_b$, \begin{equation} W_b^*(d_b|u_b) = \sum_{z_b} P_b^*(d_b|z_b) Q_b^*(z_b|u_b).\label{eq_Qb* is upgraded from Wb* using Pb*}\end{equation} Denote \begin{equation} \begin{split} W_b(y_a,u_a,d_b) &= \frac{1}{2}\sum_{u_b} W_b(y_a,u_a,d_b|u_b), \\ W_b^*(d_b) &= \frac{1}{2}\sum_{u_b} W_b^*(d_b|u_b). \end{split}\label{eq_definition of Wbstar and and Wb} \end{equation} We assume that $W_b^*(d_b) >0$, for otherwise output $d_b$ never appears with positive probability and may be ignored, and define \begin{align} \rho_{\omegaa}^{d_b} &\triangleq \frac{W_b(y_a,u_a,d_b)}{W_b^*(d_b)}. \nonumber \\ \intertext{We have $\rho_{\omegaa}^{d_b} \geq 0$, $\sum_{y_a,u_a}\rho_{\omegaa}^{d_b} = 1$ for any $d_b$, and, for any $u_b$,} W_b(y_a,u_a,d_b|u_b) &= \rho_{\omegaa}^{d_b} W_b^*(d_b|u_b).\label{eq_connection between Wb and Wbstar} \end{align} For each $z_b$, we will shortly define constants $\mu_{\omegaa}^{z_b}$ such that $\mu_{\omegaa}^{z_b} \geq 0 $ and $\sum_{y_a,u_a}\mu_{\omegaa}^{z_b} = 1$. Similar to~\eqref{eq_connection between Wb and Wbstar}, we use these constants to define channel $Q_b$ by \begin{equation} Q_b(y_a,u_a,z_b|u_b) = \mu_{\omegaa}^{z_b} Q_b^*(z_b|u_b).\label{eq_connection between Qb and Qbstar} \end{equation} Indeed, $\sum_{y_a,u_a} Q_b(y_a,u_a,z_b|u_b) = Q_b^*(z_b|u_b)$. We now find the constants $\mu_{\omegaa}^{z_b}$ and an appropriate degrading channel $P_b(d_b|y_a,u_a,z_b)$ such that \begin{equation} W_b(y_a,u_a,d_b|u_b) = \sum_{z_b} P_b(d_b|y_a,u_a,z_b) Q_b(y_a,u_a,z_b|u_b),\label{eq_Qb is upgraded from Wb using Pb}\end{equation} which will establish our goal. Let $y_a,u_a$, and $d_b$ be such that the left-hand side of~\eqref{eq_Qb is upgraded from Wb using Pb} is positive\footnote{Since $W_b^*(d_b)>0$, there will always be at least one selection of $y_a,u_a$ for which the left-hand side of~\eqref{eq_Qb is upgraded from Wb using Pb} is positive.}, so that $\rho_{\omegaa}^{d_b} >0$. We shall see that the resulting expressions hold for the zero case as well. Using~\eqref{eq_connection between Wb and Wbstar} and~\eqref{eq_connection between Qb and Qbstar}, we can rewrite~\eqref{eq_Qb is upgraded from Wb using Pb} as \[ W_b^*(d_b|u_b) = \sum_{z_b} \left(\frac{P_b(d_b|y_a,u_a,z_b)\mu_{\omegaa}^{z_b}}{\rho_{\omegaa}^{d_b}} \right) Q_b^*(z_b|u_b).\] Comparing this with~\eqref{eq_Qb* is upgraded from Wb* using Pb*}, we set \begin{align} P_b^*(d_b|z_b) &= \frac{P_b(d_b|y_a,u_a,z_b)\mu_{\omegaa}^{z_b}}{\rho_{\omegaa}^{d_b}}.\label{eq_Pb* and its relation to Pb mu and rho}\\ \intertext{Since $P_b$ is a probability distribution, by rearranging and summing over $d_b$ we obtain} \mu_{\omegaa}^{z_b} &= \sum_{d_b} P_b^*(d_b|z_b) \rho_{\omegaa}^{d_b}.\label{eq_formula for mu} \end{align} It is easily verified that $\mu_{\omegaa}^{z_b} \geq 0$ and $\sum_{y_a,u_a}\mu_{\omegaa}^{z_b} = 1$. Using the expression for $\mu_{\omegaa}^{z_b}$ in~\eqref{eq_Pb* and its relation to Pb mu and rho} yields \begin{equation} P_b(d_b|y_a,u_a,z_b) = \frac{P_b^*(d_b|z_b)\rho_{\omegaa}^{d_b}}{\sum_{d_b'} P_b^*(d_b'|z_b) \rho_{y_a,u_a}^{d_b'}}.\label{eq_formula for Pb in bchannel upgrade} \end{equation} This is a valid probability distribution. We remark that~\eqref{eq_Qb is upgraded from Wb using Pb} is satisfied by~\eqref{eq_formula for mu} and~\eqref{eq_formula for Pb in bchannel upgrade} even when $\rho_{\omegaa}^{d_b} = 0$. We have found $Q_b$ and a proper degrading channel $P_b$ as required. \end{IEEEproof} \begin{figure}[t] \centering \begin{tikzpicture}[>=latex] \node (Qb*) at (-2,3) {$Q_b^*(z_b|u_b)$}; \node (Wb*) at ( 3.5,3) {$W_b^*(d_b|u_b)$}; \node (Qb) at (-2,0) {$Q_b(y_a,u_a,z_b|u_b)$}; \node (Wb) at ( 3.5,0) {$W_b(y_a,u_a,d_b|u_b)$}; \node (rect1) at ($(Qb*)!0.5!(Wb*)$) [rectangle, draw, inner sep = 3pt, minimum width = 1.2cm] {$P_b^*$}; \node (rect2) at ( $(Qb)!0.5!(Wb)$ ) [rectangle, draw, inner sep = 3pt, minimum width = 1.2cm] {$P_b$}; \node[draw,circle, inner sep = 1pt] (A1) at ($(Qb*)!0.5!(Qb)$) {$\times$}; \node[draw,circle, inner sep = 1pt] (A2) at ($(Wb*)!0.5!(Wb)$) {$\times$}; \node[draw,circle, inner sep = 1pt] (A3) at ($(rect1)!0.5!(rect2)$) {$\times$}; \draw[<-] (A1) -- ++(-0.8,0) node[left] {$\mu_{\omegaa}^{z_b}$}; \draw[<-] (A2) -- ++(-0.8,0) node[left] {$\rho_{\omegaa}^{d_b}$}; \draw[<-] (A3) -- ++(-0.8,0) node[left] {$\displaystyle \frac{\rho_{\omegaa}^{d_b}}{\mu_{\omegaa}^{z_b}}$}; \draw[->] (Qb*) -- (rect1); \draw[->] (rect1) -- (Wb*); \draw[->] (Qb) -- (rect2); \draw[->] (rect2) -- (Wb); \draw[->] (Qb*) -- (A1); \draw[double equal sign distance, -implies] (A1) -- (Qb); \draw[->] (Wb*) -- (A2); \draw[double equal sign distance, -implies] (A2) -- (Wb); \draw[->] (rect1) -- (A3); \draw[double equal sign distance, -implies] (A3) -- (rect2); \end{tikzpicture} \caption{Illustration of how to transform an upgrading procedure from $W_b^*$ to $Q_b^*$ to an upgrading procedure from $W_b$ to $Q_b$. The double arrows represent splitting to multiple outputs.} \label{fig_upgragding channel b} \end{figure} \begin{corollary} In \Cref{thm_Wb can be upgraded to Qb with ya and va intact}, the marginal a-channels of $Q_b$ and $W_b$ coincide. \end{corollary} \begin{IEEEproof} By construction, the degrading channel from $Q_b$ to $W_b$ does not change the a-channel output, implying that the a-channel marginal remains the same. \end{IEEEproof} To use \Cref{thm_Wb can be upgraded to Qb with ya and va intact}, one begins with design parameter $B$ that controls the output alphabet size. The channel $Q_b^*$, with output alphabet of size $2B$, is obtained from $W_b^*$ using a sequence of upgrade operations. To obtain upgraded joint channel $Q_b$, one uses the Theorem to turn them into a sequence of upgrade operations to be performed on channel $W_b$. If one uses the techniques of~\cite{Tal_2013}, the upgrade operations will consist of upgrade-merge-2 and upgrade-merge-3 operations (see Appendix~\ref{ap_BMS channel upgrades}). In the following examples we apply \Cref{thm_Wb can be upgraded to Qb with ya and va intact} specifically to these upgrades. For brevity, we will use the following notation: \begin{equation} \begin{split} \bchanpi{y_a,u_a}{d_b} &\triangleq \sum_{u_b} W_b(y_a,u_a,d_b|u_b), \\ \bchanpi{}{d_b} &\triangleq \sum_{u_b} W_b^*(d_{b}|u_b). \end{split} \label{eq_definition of pidyaua} \end{equation} \begin{example}[Upgrading $W_b$ Based on Upgrade-Merge-2]\label{ex_Upgrading $W_b$ Based on Upgrade-Merge-2} The upgrade-merge-2 procedure of~\cite{Tal_2013} selects two conjugate symbols pairs and replaces them with a single conjugate symbol pair. The details of the transformation, in our notation, appear in Appendix~\ref{ap_upgrade merge 2}. Let joint channel $W_b(y_a,u_a,d_b|u_b)$ have b-channel marginal $W_b^*(d_b|u_b)$, in which all symbols with the same $D$-value are combined to a single symbol. We select symbols $d_{bj}, d_{bk}$ and their respective conjugates $\bar{d}_{bj} = -d_{bj}, \bar{d}_{bk}=-d_{bk}$, such that $d_{bk} \geq d_{bj} > 0$ and upgrade $W_b^*(d_b|u_b)$ to $Q_b^*(z_b|u_b)$ given by~\eqref{eq_Formula for simple upgrade merge 2} (Appendix~\ref{ap_upgrade merge 2}). We denote by $\mathcal{D}_b$ the output alphabet of $W_b^*$ and by $\mathcal{D}_{z_{bk}}$ the set \[ \mathcal{D}_{z_{bk}} \triangleq \{d_{bk},d_{bj},\bar{d}_{bj},\bar{d}_{bk}\}.\] The output alphabet of $Q_b^*$ is $\mathcal{Z} = (\mathcal{D}_b \setminus \mathcal{D}_{z_{bk}} )\cup (z_{bk},\bar{z}_{bk})$; outputs of $Q_b^*$ represent $D$-values. In particular, the $D$-values of $z_{bk}$ and $\bar{z}_{bk}$ are $d_{bk}$ and $-d_{bk}$, respectively. Using \Cref{thm_Wb can be upgraded to Qb with ya and va intact}, we form channel $Q_b(y_a,u_a,z_b|u_b)$ by \[ Q_b(y_a,u_a,z_b|u_b) = \begin{cases} \mu_{\omegaa}^{z_{bk}} Q_b^*(z_{bk}|u_b), & z_b = z_{bk} \\[0.1cm] \mu_{\omegaa}^{\bar{z}_{bk}} Q_b^*(\bar{z}_{bk}|u_b), & z_b = \bar{z}_{bk}\\[0.1cm] W_b(y_a,u_a,z_b|u_b), & \text{otherwise,} \end{cases}\] where by~\eqref{eq_formula for mu}, \begin{align*} \mu_{\omegaa}^{z_{bk}} &= \frac{\sum_{d \in \mathcal{D}_{z_{bk}}}\left(\bchanpi{y_a,u_a}{d}\cdot (d_{bk} + d)\right)}{2(\bchanpi{}{d_{bj}} + \bchanpi{}{d_{bk}})d_{bk}}, \\[0.1cm] \mu_{\omegaa}^{\bar{z}_{bk}} &= \frac{\sum_{d \in \mathcal{D}_{z_{bk}}}\left(\bchanpi{y_a,u_a}{d}\cdot( d_{bk} - d)\right)}{2(\bchanpi{}{d_{bj}} + \bchanpi{}{d_{bk}})d_{bk}}. \end{align*} We can simplify this when $W_b$ is a symmetrized channel. In this case, $\bchanpi{y_a,u_a}{d_{b}} = \bchanpi{y_a,u_a}{\bar{d}_{b}}$, yielding \[ \mu_{\omegaa}^{z_{bk}} = \mu_{\omegaa}^{\bar{z}_{bk}} = \frac{\bchanpi{y_a,u_a}{d_{bj}} + \bchanpi{y_a,u_a}{d_{bk}}}{\bchanpi{}{d_{bj}} + \bchanpi{}{d_{bk}}}.\] Therefore, the upgraded joint channel becomes \[ Q_b(y_a,u_a,z_b|u_b) = \begin{dcases} \bchanPi{y_a,u_a}{z_{bk}}\left(\frac{1+(-1)^{u_b}d_{bk}}{2} \right), & z_b = z_{bk} \\[0.1cm] \bchanPi{y_a,u_a}{z_{bk}} \left(\frac{1-(-1)^{u_b}d_{bk}}{2} \right), & z_b = \bar{z}_{bk} \\[0.1cm] W_b(y_a,u_a,z_b|u_b), & \text{otherwise,} \end{dcases}\] where \[ \bchanPi{y_a,u_a}{z_{bk}} = (\bchanpi{y_a,u_a}{d_{bj}} + \bchanpi{y_a,u_a}{d_{bk}}).\] \end{example} \begin{example}[Upgrading $W_b$ Based on Upgrade-Merge-3]\label{ex_Upgrading $W_b$ Based on Upgrade-Merge-3} The upgrade-merge-3 procedure replaces three conjugate symbols pairs with two conjugate symbol pairs. The details of the transformation, in our notation, appear in Appendix~\ref{ap_upgrade merge 3}. As above, let joint channel $W_b(y_a,u_a,d_b|u_b)$ have b-channel marginal $W_b^*(d_b|u_b)$. For the upgrade procedure we select symbols $d_{bi}, d_{bj},d_{bk}$ and their respective conjugates, such that $0 \leq d_{bi} < d_{bj} \leq d_{bk}$.\footnote{We could have also selected them such that $0 \leq d_{bi} \leq d_{bj} < d_{bk}$. At least one of the inequalities $d_{bi}\leq d_{bj}$ or $d_{bj}\leq d_{bk}$ must be strict.} We upgrade $W_b^*(d_b|u_b)$ to $Q_b^*(z_b|u_b)$ given by~\eqref{eq_formula for upgrade merge 3} (Appendix~\ref{ap_upgrade merge 3}). We denote by $\mathcal{D}_b$ the output alphabet of $W_b^*$ and by $\mathcal{D}_{z_{bk},z_{bi}}$ the set \[ \mathcal{D}_{z_{bk},z_{bi}} \triangleq \{d_{bk},d_{bj},d_{bi},\bar{d}_{bi},\bar{d}_{bj},\bar{d}_{bk}\}.\] The output alphabet of $Q_b^*$ is $\mathcal{Z} = (\mathcal{D}_b \setminus \mathcal{D}_{z_{bk},z_{bi}} )\cup (z_{bk},z_{bi},\bar{z}_{bi},\bar{z}_{bk})$; outputs of $Q_b^*$ represent $D$-values. In particular, the $D$-values of $z_{bk}$ and $z_{bi}$ are $d_{bk}$ and $d_{bi}$, respectively. Assuming that $W_b$ is symmetrized, we form channel $Q_b(y_a,u_a,z_b|u_b)$ using \Cref{thm_Wb can be upgraded to Qb with ya and va intact} as \[ Q_b(y_a,u_a,z_b|u_b) = \begin{cases} \mu_{\omegaa}^{z_{bk}} Q_b^*(z_{bk}|u_b), & z_b = z_{bk} \\[0.1cm] \mu_{\omegaa}^{z_{bi}} Q_b^*(z_{bi}|u_b), & z_b = z_{bi} \\[0.1cm] \mu_{\omegaa}^{\bar{z}_{bi}} Q_b^*(\bar{z}_{bi}|u_b), & z_b = \bar{z}_{bi} \\[0.1cm] \mu_{\omegaa}^{\bar{z}_{bk}} Q_b^*(\bar{z}_{bk}|u_b), & z_b = \bar{z}_{bk}\\[0.1cm] W_b(y_a,u_a,z_b|u_b), & \text{otherwise,} \end{cases}\] where by~\eqref{eq_formula for mu}, \begin{align*} \mu_{\omegaa}^{z_{bk}} &= \frac{\bchanpi{y_a,u_a}{d_{bk}} + \left(\frac{d_{bj}-d_{bi}}{d_{bk}-d_{bi}} \right)\bchanpi{y_a,u_a}{d_{bj}}}{\bchanpi{}{d_{bk}} + \left(\frac{d_{bj}-d_{bi}}{d_{bk}-d_{bi}} \right)\bchanpi{}{d_{bj}}}, \\[0.2cm] \mu_{\omegaa}^{z_{bi}} &= \frac{\bchanpi{y_a,u_a}{d_{bi}} + \left(\frac{d_{bk}-d_{bj}}{d_{bk}-d_{bi}} \right)\bchanpi{y_a,u_a}{d_{bj}}}{\bchanpi{}{d_{bi}} + \left(\frac{d_{bk}-d_{bj}}{d_{bk}-d_{bi}} \right)\bchanpi{}{d_{bj}}}, \end{align*} and $\mu_{\omegaa}^{\bar{z}_{bk}} = \mu_{\omegaa}^{z_{bk}}$, $\mu_{\omegaa}^{\bar{z}_{bi}} = \mu_{\omegaa}^{z_{bi}}$. The latter two equalities are due to our assumption that $W_b$ is symmetrized. Denoting \begin{align*} \bchanPi{y_a,u_a}{z_{bk}} &= \bchanpi{y_a,u_a}{d_{bk}} + \left(\frac{d_{bj}-d_{bi}}{d_{bk}-d_{bi}} \right)\bchanpi{y_a,u_a}{d_{bj}}\\ \bchanPi{y_a,u_a}{z_{bi}} &= \bchanpi{y_a,u_a}{d_{bi}} + \left(\frac{d_{bk}-d_{bj}}{d_{bk}-d_{bi}} \right)\bchanpi{y_a,u_a}{d_{bj}}\\ &= \bchanpi{y_a,u_a}{d_{bi}} + \left(1-\frac{d_{bj}-d_{bi}}{d_{bk}-d_{bi}} \right)\bchanpi{y_a,u_a}{d_{bj}}, \end{align*} the upgraded joint channel is given by \[ Q_b(y_a,u_a,z_b|u_b) = \begin{dcases} \bchanPi{y_a,u_a}{z_{bk}}\left(\frac{1+(-1)^{u_b}d_{bk}}{2} \right), & z_b = z_{bk} \\[0.1cm] \bchanPi{y_a,u_a}{z_{bi}}\left(\frac{1+(-1)^{u_b}d_{bi}}{2} \right) ,& z_b = z_{bi} \\[0.1cm] \bchanPi{y_a,u_a}{z_{bi}}\left(\frac{1-(-1)^{u_b}d_{bi}}{2} \right) ,& z_b = \bar{z}_{bi} \\[0.1cm] \bchanPi{y_a,u_a}{z_{bk}}\left(\frac{1-(-1)^{u_b}d_{bk}}{2} \right) ,& z_b = \bar{z}_{bk} \\[0.1cm] W_b(y_a,u_a,z_b|u_b), & \text{otherwise.} \end{dcases}\] \end{example} \begin{remark} We observe from these examples an interesting parallel between the a-channel and b-channel upgrading procedures. In the former case, we confine upgrade operations to a single class, in which the b-channel $D$-values are fixed. In light of the above examples, the latter case may be viewed as confining upgrade procedures to ``classes'' in which $y_a$ and $u_a$ are fixed. \end{remark} \section{Lower Bound Procedure} \label{sec_lower bound procedures} The previous sections have introduced several ingredients for building an overall procedure for obtaining a lower bound on the probability of error of polar codes under SC decoding. We now combine these ingredients and present the overall procedure. First, we lower-bound the probability of error of two synthetic channels. Then, we show how to use lower bounds on channel pairs to obtain better lower bounds on the union of many error events. \subsection{Lower Bound on the Joint Probability of Error of Two Synthetic Channels} We now present an upgrading procedure for $W_{a,b}$ that results in channel $Q_{a,b}$ with a smaller alphabet size. The procedure leverages the recursive nature of polar codes. The input to our procedure is BMS channel $W$, the number of polarization steps $n$, the indices $a$ and $b$ of the a-channel and b-channel, respectively, and parameters $A$ and $B$ that control the output alphabet sizes of the a- and b-channels, respectively. The binary expansions of $a-1$ and $b-1$ are $\bv{a} = \langle \alpha_1,\alpha_2,\ldots,\alpha_m\rangle$ and $\bv{b} = \langle \beta_1,\beta_2,\ldots,\beta_m\rangle$, respectively. These expansions specify the order of polarization transforms to be performed, where $0$ implies a `$-$'-transform and $1$ implies a `$+$'-transform. The algorithm consists of a sequence of polarization and upgrading steps. After each polarization step, we bring the channel to $D$-value representation, as described in \Cref{subsec_d value representation}. A side effect of polarization is increase in alphabet size. The upgrading steps prevents the alphabet size of the channels from growing beyond a predetermined size. After the final upgrading step we obtain joint channel $Q_{a,b}$, which is properly upgraded from $W_{a,b}$. We compute $P_e^{\textrm{\textup{IMJP}}}(Q_{a,b})$, which serves as a lower bound to $P_e^{\textrm{\textup{IML}}}(W_{a,b})$. We recall that $P_e^{\textrm{\textup{IML}}}(W_{a,b})$ is the probability of error under SC decoding of the joint synthetic channel $W_{a,b}$. This, in turn, lower-bounds $P_e^{\textrm{\textup{SC}}}(W)$ (see \Cref{cor_procedure leads to lower bound}). \Cref{alg_lowerbound} provides a high-level description of the procedure. We begin by determining the first index $m$ for which $\alpha_m$ and $\beta_m$ differ (i.e. $\alpha_{\ell} = \beta_{\ell}$ for $\ell<m$ and $\alpha_m\neq \beta_m$). The first $m-1$ polarization steps are of a single channel, as the a-channel and b-channel indices are the same. Since these are single channels, we utilize the upgrading procedures of~\cite{Tal_2013} to reduce the output alphabet size. At the $m$th polarization step, the a- and b-channels differ. We perform joint polarization described in \Cref{sec_polarization for joint bit channels} and symmetrize the joint channel using~\eqref{eq_symmetrized channel definition}. This symmetrization need only be performed once as subsequent polarizations maintain symmetrization (\Cref{prop_Symmetrizing the joint distribution yields a lower bound}). We then perform the b-channel upgrading procedure (\Cref{subsec_upgrading $W_b$}), which reduces the b-channel alphabet size to $2B$. Following that, we upgrade the a-channel. As discussed in \Cref{subsec_Upgrading $W_a$}, this consists of two steps. First, we upgrade-couple the channel, to generate $B^2$ classes. Second, for each class separately, we use the a-channel upgrade procedure until each class has at most $2A$ elements (see \Cref{thm_upgrade split} and \Cref{cor_upgrade split}). We confine the a-channel upgrade procedure to the class by utilizing only upgrade-merge-3 operations. We continue to polarize and upgrade the joint channel in this manner, until $\ell = n$. After the final polarization and upgrading operation, we compute the probability of error of the IMJP decoder for the resulting channel. \begin{algorithm} \SetKwFunction{algfirstdiff}{first\_difference} \SetKwFunction{algsinglepolarize}{single\_polarize} \SetKwFunction{algsingleupgrade}{single\_upgrade} \SetKwFunction{algjointpolarize}{jointly\_polarize} \SetKwFunction{algDValue}{D-Value\_representation} \SetKwFunction{algsymmetrize}{symmetrize} \SetKwFunction{algaupgrade}{a-channel\_upgrade} \SetKwFunction{algbupgrade}{b-channel\_upgrade} \SetKwFunction{algupgradecouple}{upgrade\_couple} \SetKwData{algclass}{class} \DontPrintSemicolon \caption{A lower bound on the probability of error under SC decoding of a joint synthetic channel} \label{alg_lowerbound} \KwIn{BMS channel $W$, number of polarization steps $n$, channel indices $a$,$b$, and alphabet-size control parameters $A$, $B$. The binary representations of $a-1$ and $b-1$ are $\bv{a} = \langle \alpha_1,\alpha_2,\ldots,\alpha_n\rangle$ and $\bv{b} = \langle \beta_1,\beta_2,\ldots,\beta_n\rangle$, respectively.} \KwOut{A lower bound on the probability of error $W_{a,b}$.} $ m \leftarrow \algfirstdiff(\bv{a},\bv{b})$\; $ Q \leftarrow \algsingleupgrade(W,\max\{A,B\})$\; \For{$\ell=1,2,\ldots,n$} { \eIf{$\ell<m$} { $Q \leftarrow \algsinglepolarize(Q,\alpha_{\ell})$\; $Q \leftarrow \algDValue(Q)$\; $Q \leftarrow \algsingleupgrade(Q,\max\{A,B\})$\; } { $Q \leftarrow \algjointpolarize(Q,\alpha_{\ell},\beta_{\ell})$\; $Q \leftarrow \algDValue(Q)$\; \If{$\ell=m$} { $Q \leftarrow \algsymmetrize(Q)$\; } \tcp*[r]{b-channel upgrade:} $Q \leftarrow \algbupgrade(Q,B)$\; \tcp*[r]{a-channel upgrade:} $Q \leftarrow \algupgradecouple(Q)$\; \ForEach{\algclass $\in Q$} { $Q \leftarrow \algaupgrade(Q,A,\algclass)$\; \tcc{Confine to class by using only upgrade-merge-3.} } } } \Return{$P_e^{\textrm{\textup{IMJP}}}(Q)$} \end{algorithm} The lower bound of this procedure compares favorably with the trivial lower bound, $\max\{\Prob{\mathcal{E}_a}, \Prob{\mathcal{E}_b}\}$. This is because our upgrading procedure only ever changes one marginal, keeping the other intact. Since it leverages upgrading transforms that can be used on single channels, the marginal channels obtained are the same as would be obtained on single channels using the same upgrading steps. Thus, by \Cref{lem_IMJP provides a tighter lower bound than max Pe} this lower bound is at least as good as $\max\{\Prob{\mathcal{E}_a}, \Prob{\mathcal{E}_b}\}$. \begin{remark} When the BMS $W$ is a BEC, we can recover the bounds of~\cite{Mori_Tanaka_2009} and \cite{Parizi_2013} using our upgrading procedure. Only a-channel upgrades are required, as the b-channel, in $D$-value representation, remains a BEC. For each a-channel symbol, the channel $W_2$ in \eqref{eq_decomposition of Wb, db version} is either a perfect channel or a pure-noise channel (see \Cref{lem_for BEC erasures are based on channel outputs only} in Appendix~\ref{ap_IMJP for BEC}). Thus, the upgrade-couple procedure splits the a-channel symbols to those that see a perfect channel regardless of $u_a$ and those that see a pure-noise channel regardless of $u_a$. Merging a-channel symbols of the same class is equivalent to merging a-channel symbols for which $\upgradec{W}_2$ is the same type of channel. We thus merge a-channel symbols of the same a-channel $D$-value that ``see'' the same type of b-channel. This corresponds to keeping track of the correlation between erasure events of the two channels. \end{remark} \begin{remark} An initial step of \Cref{alg_lowerbound} is to upgrade the channel $W$, even before any polarization operations. This step enables us to apply our algorithm on continuous-output channels, see~\cite[Section VI]{Tal_2013}. \end{remark} \subsection{Lower Bound for More than Two Synthetic channels}\label{subsec_lower bound for more than two channels} Recall that the probability of error of polar codes under SC decoding may be expressed as $\Prob{\bigcup_{a\in \mathcal{A}} \mathcal{E}_a}$. In the previous section, we developed a lower bound on $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$, $a<b$, which lower bounds $\Prob{\bigcup_{a\in \mathcal{A}} \mathcal{E}_a}$. This lower bound may be strengthened by considering several pairs of synthetic channels and using~\eqref{eq_inclusion exclusion lower bound}. We now show how this can be done. \begin{lemma}\label{lem_lower bound on union using unions of two events} The probability of error of a union of $M$ events, $\cup_{a=1}^M\mathcal{E}_a$ is lower bounded by \[ \Prob{\bigcup_{a=1}^{M} \mathcal{E}_a} \geq \sum_{a<b}\Prob{\mathcal{E}_a\cup\mathcal{E}_b} - (M-2)\sum_a \Prob{\mathcal{E}_a}.\] \end{lemma} \begin{IEEEproof} The proof hinges on using the identity $\Prob{\mathcal{E}_a\cap\mathcal{E}_b} =\Prob{\mathcal{E}_a}+\Prob{\mathcal{E}_b}- \Prob{\mathcal{E}_a\cup\mathcal{E}_b}$ in~\eqref{eq_inclusion exclusion lower bound}. Note that any set of $M$ numbers $\{p_1,p_2,\ldots,p_M\}$ satisfies \begin{align*} 2M\sum_a p_a &= \sum_{a,b} (p_a + p_b)\\ &= \sum_{a<b}(p_a+p_b) + \sum_{a=b}(p_a+p_b) + \sum_{a>b}(p_a+p_b)\\ &= 2\sum_{a<b}(p_a+p_b) + 2\sum_a p_a, \end{align*} so that \[ \sum_{a<b} (p_a + p_b) = (M-1)\sum_a p_a.\] Therefore, \begin{align*} \sum_{a<b}\Prob{\mathcal{E}_a\cap\mathcal{E}_b} &= \sum_{a<b}\left( \Prob{\mathcal{E}_a}+\Prob{\mathcal{E}_b}- \Prob{\mathcal{E}_a\cup\mathcal{E}_b} \right) \\ &= (M-1)\sum_a \Prob{\mathcal{E}_a} - \sum_{a<b} \Prob{\mathcal{E}_a\cup\mathcal{E}_b}. \end{align*} Using this in~\eqref{eq_inclusion exclusion lower bound} yields the desired bound. \end{IEEEproof} In practice, we combine the lower bound of \Cref{lem_lower bound on union using unions of two events} with~\eqref{eq_lower bound on a union using a subset}. That is, we compute lower bounds on $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$ for all pairs of channels in some subset $\mathcal{A}'$ of the non-frozen set, and use \Cref{lem_lower bound on union using unions of two events} over this subset. Such bounds are highly dependent on the selection of the subset $\mathcal{A}'$. One possible strategy is as follows. Let $\mathcal{B}$ be the set of $k$ worst synthetic channels in the non-frozen set for some $k$. For each channel pair in $\mathcal{B}$, compute a lower bound on the joint probability of error using \Cref{alg_lowerbound}. Then, form all possible subsets of $\mathcal{B}$ (there are $2^k$ such subsets) and use \Cref{lem_lower bound on union using unions of two events} for each subset. Choose the subset with the highest upper bound as $\mathcal{A}'$. The reason for going over all possible subsets is that bounds based on the inclusion-exclusion principle are not guaranteed to be higher than the highest pairwise probability, see~\cite{Schwager_1984}. \section{Implementation} \label{sec_implementation} Our implementation of \Cref{alg_lowerbound}, in C++, is available for download at \cite{STCode}. In this section we provide some details on the implementation. A naive implementation of \Cref{alg_lowerbound} is to perform all steps successively at each iteration. That is, first jointly polarize the joint channel, then bring the channel to $D$-value representation, followed by the b-channel upgrade procedure and the upgrade-couple procedure, and finally perform the a-channel upgrade procedure. One quickly finds out, however, a limitation posed by this approach: the memory required to store the outcomes of these stages becomes prohibitively large when the alphabet-size control parameters $A$ and $B$ grow. Observe, however, that the total required memory at the end of each iteration of \Cref{alg_lowerbound} is actually quite small. We need only store the values of $\upgradec{W}_a(y_a^{i,j}|0)$ for each value of $y_a,i,j$ (a total of $2A\cdot B^2$ combinations), a mapping between $y_a$ and its conjugate $\bar{y}_a$, and a list of size $B$ that stores the possible b-channel $D$-values. Then, we can compute $\upgradec{W}_b(y_a^{i,j},u_a,d_b|u_b)$ using~\eqref{eq_decoupling decomposition of check Wb},~\eqref{eq_W2 for decoupling decomposition}, and \Cref{cor_conjugate symbols of upgrade-couple channel}. Thus, our data structure for an upgrade-coupled joint channel utilizes a three-dimensional matrix of size $(2A)\times B\times B$ to store $\upgradec{W}_a(y_a^{i,j}|0)$ (specifically, we use the cube data structure provided by~\cite{armadillo}). As for the mapping between $y_a$ and its conjugate, if $\upgradec{W}_a(y_a^{i,j}|0)$ is stored in element \texttt{(y,i,j)} of the matrix, and \texttt{y} is even, then $\upgradec{W}_a(\bar{y}_a^{i,j}|0)$ is stored in element \texttt{(y+1,i,j)}. We store the absolute values of the b-channel $D$-values in a vector of length $B$. The second key observation is that each upgrading procedure only ever changes one marginal. That is, the a-channel upgrading procedure leaves the marginal b-channel unchanged, and the b-channel upgrading procedure does not affect the marginal a-channel. Thus, since our upgrading procedure leverage upgrading procedures for single channels, we can pre-compute the upgraded marginal channels. In essence, given a target upgraded marginal channel --- computed beforehand using the techniques of \cite{Tal_2013} --- our upgrading procedures ``split'' the probability of a output symbol among two absorbing symbols. The ``splitting'' factors are functions of the $D$-values of the three symbols (see appendix~\ref{ap_BMS channel upgrades}). Indeed, we compute beforehand the polarized and upgraded marginal channels. The joint polarization step maps each pair of symbols, $y_{a_1}^{i_1,j_1}$ and $y_{a_2}^{i_2,j_2}$ to up to four polarized counterparts (see \Cref{sec_polarization for joint bit channels}). Knowing beforehand what the upgraded marginal channels should be, we can directly split each polarized symbol into the relevant absorbing symbols. We incorporate the upgrade-couple operation into this by utilizing the factor $\alpha_{i,j}$ from~\eqref{eq_definition of alphaij}. Thus, in our implementation, rather than performing each step of an iteration in its entirety, we perform all steps in one fell swoop. This sidesteps the memory-intensive step of computing the upgrade-coupled jointly polarized channel. The interested reader is urged to look at our source code for further details. \begin{remark} The description here was given in terms of $D$-values, in line with the exposition in this paper. However, for numerical purposes we recommend --- and use --- likelihood ratios in practical implementation. Likelihood ratios have a greater dynamic range than that of $D$-values, and therefore offer better numerical precision.\footnote{As an example, two very different likelihood ratios: $\lambda_1 = 10^{20}$ and $\lambda_2 = 10^{30}$, cannot be differentiated in double precision upon conversion to $D$-values.} There is a one-to-one correspondence between $D$-values and likelihood ratios (see appendix~\ref{ap_Definition of D values}), and all $D$-value based formulas are easily translated to their likelihood ratio counterparts. \end{remark} \section{Numerical Results} \label{sec_numerical results} \Cref{fig_bounds,fig_bounds2} present numerical results of our bound for two cases. In both cases, we designed a polar code for a specific BSC, and then assessed its performance when used over different BSCs. Specifically: \begin{itemize} \item \emph{\Cref{fig_bounds}:} A code of length $N=2^{10}=1024$, rate $R=0.1$, designed for a BSC with crossover probability $0.2$. \item \emph{\Cref{fig_bounds2}:} A code of length $N=2^{11} = 2048$, rate $R=0.25$, designed for a BSC with crossover probability $0.18$. \end{itemize} The codes were designed using the techniques of~\cite{Tal_2013} with $128$ quantization levels. The non-frozen set $\mathcal{A}$ consisted of the $\lfloor NR\rfloor$ channels with smallest probability of error. This non-frozen set was fixed. For each code, we plot three bounds on the probability of error, when used over specific BSCs: an upper bound on the probability of error, the trivial lower bound on the probability of error, and the new lower bound on the probability of error presented in this paper. For the upper bound, we computed an upper bound on $\sum_{a\in \mathcal{A}} P_e^{\textrm{\textup{ML}}}(W_a)$, and for the trivial lower bound we computed a lower bound on $\max_{a\in\mathcal{A}}P_e^{\textrm{\textup{ML}}}(W_a)$; upper and lower bounds on the probability of error of single channels (i.e., on $P_e^{\textrm{\textup{ML}}}(W_a)$) were obtained using the techniques of~\cite{Tal_2013}. The new lower bound is based on the IMJP decoder, as described in this paper. We computed the IMJP decoding error, with $2A=2B=32$ for all possible pairs of the $20$ worst channels in the non-frozen set.\footnote{Note that there is a different set of $20$ worst channels for each crossover probability. For each crossover probability, we selected the $20$ channels in the (fixed) non-frozen set with the highest upper bound on decoding error when used over a BSC with \emph{that} crossover probability.} We then used \Cref{lem_lower bound on union using unions of two events}, computed for the subset of these $20$ channels that yielded the highest bound; this provides a significantly improved bound over the bound given by the worst-performing pair. The computation utilized \cite{parallel} for parallel computation of the IMJP decoding error over different channel pairs. As one may observe, our bounds improve upon the previously known lower bound~\eqref{eq_trivial lower bound}. In fact, they are quite close to the upper bound on the probability of error. This provides strong numerical evidence that error events of channel pairs dominate the error probability of polar codes under SC decoding. \begin{figure}[t] \centering \definecolor{mycolor1}{rgb}{1.00000,0.00000,1.00000}% \begin{tikzpicture} \begin{axis}[% width=7cm, height=7cm, at={(1.011111in,0.641667in)}, scale only axis, grid = major, xmin=0.08, xmax=0.18, ymode=log, ymin=1e-07, ymax=1 yminorticks=true, xlabel={Crossover probability}, ylabel={Probability of error}, legend style={at={(0.02,0.99)},anchor=north west,legend cell align=left,align=left,fill=white, draw=none} ] \addplot [color=cyan,solid,mark=x,mark options={solid}] table[row sep=crcr]{% 0.08 8.82250494144101e-07\\ 0.09 5.04844602362815e-06\\ 0.1 2.44972367069049e-05\\ 0.11 0.000107496599218954\\ 0.12 0.000449200020787486\\ 0.13 0.00184562015588825\\ 0.14 0.00749906609747055\\ 0.15 0.0293520647326518\\ 0.16 0.105616253923844\\ 0.17 0.335763903395806\\ 0.18 0.926414891054271\\ }; \addlegendentry{\small Upper Bound}; \addplot [color=blue,solid,mark=square,mark options={solid}] table[row sep=crcr]{% 0.08 2.639787e-07\\ 0.09 1.477638e-06\\ 0.1 6.751064e-06\\ 0.11 2.610095e-05\\ 0.12 8.792738e-05\\ 0.13 0.0002628447\\ 0.14 0.0007092876\\ 0.15 0.001747507\\ 0.16 0.003974171\\ 0.17 0.009449577\\ 0.18 0.02214191\\ };\addlegendentry{\small Trivial Lower Bound}; \addplot [color=red,solid,mark=o,mark options={solid}] table[row sep=crcr]{% 0.08 8.703783218479992e-07 \\ 0.09 4.892176750349999e-06 \\ 0.10 2.306111679089992e-05\\ 0.11 9.517960251400020e-05\\ 0.12 3.576489400799994e-04\\ 0.13 0.001232854885330 \\ 0.14 0.004042925069200\\ 0.15 0.012600137223100\\ 0.16 0.033952105686000\\ 0.17 0.086413934220000 \\ 0.18 0.181440178360001 \\ }; \addlegendentry{\small New Lower Bound}; \end{axis} \end{tikzpicture} \caption{Bounds on the probability of error of a rate $0.25$ polar code of length $2^{11} = 2048$ designed for a BSC with crossover probability $0.18$. The code was used over BSCs with a range of crossover probabilities. The upper bound is based on~\cite{Tal_2013}. The trivial lower bound is a lower bound on $\max_{a \in \mathcal{A}} P_e^{\textrm{\textup{ML}}}(W_a)$. The new lower bound was computed using the techniques of this paper.} \label{fig_bounds2} \end{figure} \section{Discussion and Outlook} \label{sec_discussion} This research was inspired by~\cite{Parizi_2013}, which showed that --- for the BEC --- the union bound on the probability of error of polar codes under SC decoding is asymptotically tight. The techniques of~\cite{Parizi_2013} hinged on the property that a polarized BEC is itself a BEC. Or, put another way, that the family of binary erasure channels is closed under the polar transform. This property enabled the authors to directly track the joint probability of erasure during the polarization process and bound its rate of decay. Unfortunately, this property is not shared by other channel families. Design of polar codes for channel coding is based on selecting a set of indices to be frozen. One design rule is to select the worst-performing indices as the frozen set. For example, for a code of length $N$ and rate $R$, choose the $N(1-R)$ indices with the highest probability of error (such channels can be identified using the techniques of~\cite{Tal_2013}). This design rule optimizes the union bound on the probability of error of polar codes,~\eqref{eq_union bound}. As Parizi and Telatar have shown in~\cite{Parizi_2013}, for the BEC such a design rule is essentially optimal. It is an open question whether a similar claim can be made for other BMS channel families. As our numerical results show, below a certain crossover probability the upper bound and our lower bound all but coincide, with a significant gap to the trivial lower bound. Thus, we conjecture that the ratio between the union bound and the actual probability of error approaches $1$ asymptotically for \emph{any} BMS channel. This will imply the essential optimality of the the union bound as a design rule. Moreover, we believe that the tools developed in this research are key to proving this conjecture. One possible approach is to track analytically the evolution of joint error probabilities during the polarization process. The symmetrization transformation and the resultant decoupling decomposition bring joint channels to a form more amenable to analysis. One may look at, for example, the Bhattacharyya parameter of the channel $W_2$ from~\eqref{eq_decomposition of W_b to W1W2}, when $u_a,y_a$ are fixed, \[Z_{b|y_a,u_a} = \sum_{d_b}\sqrt{W_2(d_b|0;y_a,u_a) W_2(d_b|1;y_a,u_a)}.\] This quantity, together with the Bhattacharyya parameters of the a-channel, may be used to bound $\Prob{\mathcal{E}_a \cap \mathcal{E}_b}$. Tracking the evolution of these parameters --- or bounds on them --- may enable the study of the decay of $\Prob{\mathcal{E}_a \cap \mathcal{E}_b}$ (if indeed there is such decay). In fact, it can be shown that applying the above suggestion to the BEC coincides with the approach of~\cite{Parizi_2013}. Interestingly, our bounds are tight despite the various manipulations they perform on the joint channel. The joint channels that result from our procedure are very different from the actual joint channel, yet have no effect on the marginal distributions. This curious outcome merits further research on the upgrade-couple transform and its effect on the joint channel. There are several additional avenues of further research. These include: \begin{itemize} \item Our results apply only to BMS channels. It would be interesting to extend them to richer settings, such as channels with non-binary input, or non-symmetric channels. \item This research has concentrated on SC decoding. Can it be expanded/applied to other decoding methods for polar codes (e.g., successive cancellation list (SCL) decoding~\cite{Tal_2015})? A logical first step in analyzing SCL decoding is to look at pairs of error events, as done here. \end{itemize} \section*{Acknowledgment} The assistance of Ina Talmon is gratefully acknowledged. \appendices \section{The IMJP decoder for a BEC}\label{ap_IMJP for BEC} In the special case where $W$ is a BEC and $W_a$ and $W_b$ are two of its polar descendants, we have the following. \begin{proposition} \label{thm_for BEC P(E1UE2) is identical to P(EML1UEML2)} Let $W_a(y_a|u_a)$ and $W_b(y_a,u_a,y_{r}|u_b)$ be two polar descendants of a BEC in the same tier. Then, the IMJP and the IML (SC) decoders coincide. \end{proposition} To prove this, we first show that for the BEC erasures are determined by the received channel symbols, $y_1^{2^n}$, and not previous bit decisions. This implies that for fixed $y_a$, regardless of $y_{r}$ and in particular $u_a$, either channel $W_b$ always experiences an erasure, or always experiences a non-erasure. If $W_b$ experiences an erasure, it doesn't matter what $\phi_a$ decides in terms of the IMJP decoder -- it may as well use an ML decoder; if $W_b$ does not experience an erasure, then the best bet of $W_a$ is to use an ML decoder. This suggests that the IML and IMJP decoders coincide. \begin{lemma}\label{lem_for BEC erasures are based on channel outputs only} Let $W_a(y_1^{2^n},u_1^{a-1}|u_a)$ be a polar descendant of a BEC, $W$. Then, there exists a set $E_n$, dependent only on $a$, such that $W_a$ has an erasure if and only if $y_1^{2^n} \in E_n$. \end{lemma} \begin{IEEEproof}Here, $y_1^{2^n}$ are the received channel symbols, and $u_1^{a-1}$ the previous bit decisions that are part of $W_a$'s output. Let $\langle \alpha_1,\alpha_2,\ldots, \alpha_n \rangle$ be the binary expansion of $a-1$, with $\alpha_1$ the MSB. Recall that channel $W_a$ is the result of $n$ polarization steps determined by $\alpha_1,\alpha_2,\ldots, \alpha_n$, where $\alpha_j = 0$ is a `$-$'-transform and $\alpha_j = 1$ is a `$+$'-transform. Consider first the case where $n=1$, i.e., $a-1 = \alpha_1$. If $\alpha_1 = 0$ then $W_a = W^-$ has an erasure if and only if at least one of $y_1,y_2$ is an erasure, i.e., if and only if $y_1^2 \in E_1$, $E_1 = \{y_1^2| y_1 = e \text{ or } y_2 = e\}$. If $\alpha_1 = 1$ then $W_a = W^+$ has an erasure if and only if both $y_1$ and $y_2$ are erasures, i.e., if and only if $y_1^2 \in E_1$, $E_1 = \{y_1^2 |y_1 = e \text{ and } y_2 = e\}$. Therefore, the claim is true for $n=1$. We proceed by induction. Let the claim be true for $n-1$: for $a'-1=\langle \alpha_1,\alpha_2,\ldots, \alpha_{n-1} \rangle$, there exists a set $E_{n-1}$ such that $W_{a'}$ has an erasure if and only if $y_1^{2^{n-1}} \in E_{n-1}$. If $\alpha_n = 0$, then $W_a$ is the result of a `$-$'-transform of two BEC channels $W_{a'}$, so it has an erasure if and only if at least one of them erases. In other words, $W_a$ has an erasure if and only if $y_1^{2^n} \in E_n$, $E_n = \{y_1^{2^n}| y_1^{2^{n-1}} \in E_{n-1} \text{ or } y_{2^{n-1}+1}^{2^{n}} \in E_{n-1}\}$. If, however, $\alpha_n = 1$, then $W_a$ is the result of a `$+$'-transform of two BEC channels $W_{a'}$, so it has an erasure if and only if both of them erase. In other words, $W_a$ has an erasure if and only if $y_1^{2^n} \in E_n$, $E_n = \{y_1^{2^n}| y_1^{2^{n-1}} \in E_{n-1} \text{ and } y_{2^{n-1}+1}^{2^{n}} \in E_{n-1}\}$. Thus, the claim is true for $n$ as well, completing the proof. \end{IEEEproof} \begin{IEEEproof}[Proof of \Cref{thm_for BEC P(E1UE2) is identical to P(EML1UEML2)}] By \Cref{lem_optimal phi2 is ML decoder}, a decoder $\phi_b$ that minimizes $\Prob{\mathcal{E}_a \cup \mathcal{E}_b}$ is an ML decoder. It remains to show that a minimizing $\phi_a$ is also an ML decoder. Marginalizing the joint channel~\eqref{eq_Wab and its relationship to Wb} yields $W_a$: \[ W_a(y_a | u_a) = \sum_{\substack{u_b,y_b}} W_b(y_b|u_b) \kindi{y_b = (y_a,u_a,y_{r})}.\] The ML decoder for channel $W_a$ maximizes $W_a(y_a|u_a)$ with respect to $u_a$; decoder $\phi_a$, on the other hand, maximizes $T(y_a|u_a)$, defined in~\eqref{eq_def of T(y_a|x_a)}. Using~\eqref{eq_Wab and its relationship to Wb} we recast the expression for $T$ in the same form as the expression for $W_a$, \iftoggle{twocol}{ \begin{align*} &T(y_a|u_a) \\&\quad = \sum_{u_b,y_b} W_b(y_b|u_b)\kindi{y_b = (y_a,u_a,y_{r})}\cdot\Prob{\phi_b(y_b) = u_b}.\end{align*}}{ \[ T(y_a|u_a) = \sum_{u_b,y_b} W_b(y_b|u_b)\kindi{y_b = (y_a,u_a,y_{r})}\cdot\Prob{\phi_b(y_b) = u_b}.\]} By \Cref{lem_for BEC erasures are based on channel outputs only}, whether $W_b$ has an erasure depends solely on the received channel symbols, which are wholly contained in $y_a$, and not on previous bit decisions. In particular, in computing $W_a$ or $T$, we either sum over only erasure symbols or over only non-erasure symbols. Since $\phi_b$ is an ML decoder for $W_b$, if $y_b$ is an erasure of $W_b$ then $W_a(y_a|u_a) = 2 T(y_a|u_a)$; if $y_b$ is not an erasure of $W_b$ then $W_a(y_a|u_a) = T(y_a|u_a)$. In either case, it is clear that the decision based on~\eqref{eq_phi1 as argmax} is identical to the ML decision. Therefore, $\phi_a$ is an ML decoder as well, implying that the IMJP decoder is an IML decoder. \end{IEEEproof} \section{Introduction to $D$-values}\label{ap_Definition of D values} The decision of an ML decoder for a memoryless binary-input channel $W_{Y|U}$ may be based on any sufficient statistic of the channel output. One well-known sufficient statistic is the log-likelihood ratio (LLR), $l(y) = \log \left( \frac{W_{Y|U}(y|0)}{W_{Y|U}(y|1)} \right)$. When $l(y)$ is positive, the decoder declares that $0$ was transmitted; when $l(y)$ is negative, the decoder declares that $1$ was transmitted; $l(y) = 0$ constitutes an erasure, at which the decoder makes some random choice. Another sufficient statistic is the $D$-value. The $D$-value of output $y$, $d(y)$, is given by \begin{equation}\label{eq_d} d(y) \triangleq W_{U|Y}(0|y)-W_{U|Y}(1|y). \end{equation} Clearly, $-1 \leq d(y) \leq 1$. A maximum likelihood decoder makes its decision based on the sign of the $D$-value. Assuming a symmetric channel input, $U=0,1$ with probability $1/2$, using Bayes' law on~\eqref{eq_d} yields \begin{equation} \label{eq_d_alt} d(y) = \frac{W_{Y|U}(y|0)-W_{Y|U}(y|1)}{W_{Y|U}(y|0)+W_{Y|U}(y|1)} \end{equation} The input is binary, hence $W_{U|Y}(0|y)+W_{U|Y}(1|y)=1$. Consequently~\eqref{eq_d_alt} yields \begin{align*} \frac{1+ d(y)}{2} &= \frac{W_{Y|U}(y|0)}{W_{Y|U}(y|0)+W_{Y|U}(y|1)} = W_{U|Y}(0|y),\\ \frac{1 - d(y)}{2} &= \frac{W_{Y|U}(y|1)}{W_{Y|U}(y|0)+W_{Y|U}(y|1)} = W_{U|Y}(1|y). \end{align*} There is a one-to-one correspondence between $d(y)$ and $l(y)$, $l(y) = \log \frac{1+d(y)}{1-d(y)},$ or, equivalently, $ d(y) = \tanh(l(y)/2).$ If channel $W_{Y|U}$ is symmetric, for each output $y$ there is a conjugate output $\bar{y}$; their LLRs and $D$-values are related: $l(\bar{y}) = \frac{1}{l(y)}, d(\bar{y}) = -d(y).$ Since the $D$-value is a sufficient statistic of a BMS channel, we may replace the channel output with its $D$-value. Thus, we may assume that the output $y$ of channel $W_{Y|U}$ is a $D$-value, i.e., $y = W_{U|Y}(0|y)-W_{U|Y}(1|y)$. In this case, we say that $W$ is in $D$-value representation. Recall that every BMS channel can be decomposed into BSCs~\cite[Theorem 2.1]{Land2006}. We can think of the output of a BMS as consisting of the ``reliability'' of the BSC and its output. The absolute value of the $D$-value corresponds to the BSC's reliability and its sign to the BSC output ($0$ or $1$). A comprehensive treatment of $D$-values and LLRs in relation to BMS channels appears in~\cite[Chapter 4]{mct}. \section{Upgrades of a BMS Channel}\label{ap_BMS channel upgrades} We state here in our notation the two upgrades of a BMS channel from~\cite{Tal_2013}. Let $W$ be a discrete BMS whose outputs are $D$-values $\pm d_1, \pm d_2, \ldots, \pm d_m$, and let the probability of symbol $d_{\ell}$ be $\achanpi{d_{\ell}} \triangleq W(d_{\ell}|u) + W(-d_{\ell}|u) = W(d_{\ell}|0) + W(d_{\ell}|1)$, $\ell = 1,\ldots,m$. Without loss of generality, $0\leq d_1 \leq d_2 \leq \cdots \leq d_m \leq 1$. Clearly, $\achanpi{d_{\ell}} \geq 0$ for all $\ell$, and $\sum_{\ell=1}^m \achanpi{d_{\ell}} = 1$. Moreover, $\achanpi{d_{\ell}} = \achanpi{-d_{\ell}}$. Namely, this is a BMS that decomposes to $m$ different BSCs, with crossover probabilities $(1-d_{\ell})/2$, $\ell=1,\ldots,m$. BSC channel $\ell$ is selected with probability $\achanpi{d_{\ell}}$. We have $W(d_{\ell}|u) = (\achanpi{d_{\ell}}/2) \cdot (1+(-1)^u d_{\ell})$ and $W(-d_{\ell}|u) = W(d_{\ell}|\bar{u})$. \subsection{The Upgrade-merge-2 Procedure}\label{ap_upgrade merge 2} The first upgrade-merge of~\cite{Tal_2013} takes two $D$-values $d_j \leq d_k$ and merges them by transferring the probability of $d_j$ to $d_k$. We call it \emph{upgrade-merge-2}. Channel $W:\mathcal{U} \to \mathcal{Y}$ is upgraded to channel $Q^{(2)}:\mathcal{U} \to \mathcal{Z}$; the output alphabet of $Q^{(2)}$ is $ \mathcal{Z} = (\mathcal{Y} \setminus \{d_j,d_k,-d_j,-d_k\}) \cup \{z_k, -z_k\},$ and \begin{equation} Q^{(2)}(z|u) = \begin{dcases} \achanpi{z_{k}}\left(\frac{1 + (-1)^u d_k}{2}\right), & z = z_k \\[0.1cm] \achanpi{z_{k}}\left(\frac{1 - (-1)^u d_k}{2}\right), & z = -z_k\\[0.1cm] W(z|u), & \text{otherwise,} \end{dcases}\label{eq_Formula for simple upgrade merge 2} \end{equation} where \[ \achanpi{z_{\ell}} = \begin{cases} 0, & {\ell} = j \\ \achanpi{d_j} + \achanpi{d_k}, & {\ell} = k \\ \achanpi{d_{\ell}}, & \text{otherwise.} \end{cases} \] The degrading channel from $Q^{(2)}$ to $W$ is shown in \Cref{fig_simple upgrading}. We show only the portion of interest, i.e., we do not show the symbols that this degrading channel does not change. The parameters of the degrading channel are \begin{align*} p_1 &= \frac{\achanpi{d_j}}{\achanpi{d_j}+\achanpi{d_k}}\left(\frac{d_k+d_j}{2d_k}\right), \\ p_2 &= \frac{\achanpi{d_k}}{\achanpi{d_j}+\achanpi{d_k}}, \\ p_3 &= \frac{\achanpi{d_j}}{\achanpi{d_j}+\achanpi{d_k}}\left(\frac{d_k-d_j}{2d_k}\right). \end{align*} Indeed, $p_1,p_2,p_3 \geq 0$ and $p_1+p_2+p_3 = 1$, so this constitutes a valid channel. Note that if $d_j = d_k$ then $p_3 = 0$. \tikzset{->-/.style={decoration={markings, mark=at position #1 with {\arrow{>}}},postaction={decorate}}} \begin{figure}[t] \centering \subfloat[Degrading channel from $Q^{(2)}$ to $W$ for upgrade-merge-2.]{ \begin{tikzpicture}[>=latex] \node at (-1.5,-0.5) {$Q^{(2)}(z|u)$}; \node at (4.5,-0.5) {$W(d|u)$}; \fill (0, 0) node (Z2){} circle (2pt) node[left=0.1] {$z_k$}; \fill (0,-1) node (Z2bar){} circle (2pt) node[left=0.1] {$-z_k$}; \fill (3, 0) node (Y1){} circle (2pt) node[right=0.3] {$\,d_j$}; \fill (3, 1) node (Y2){} circle (2pt) node[right=0.3] {$\,d_k$}; \fill (3,-1) node (Y1bar){} circle (2pt) node[right=0.1] {$-d_j$}; \fill (3,-2) node (Y2bar){} circle (2pt) node[right=0.1] {$-d_k$}; \draw[->-=0.5] (Z2) -- node[above= -2pt] {$p_1$} (Y1); \draw[->-=0.5] (Z2) -- node[above = -2pt] {$p_2$} (Y2); \draw[->-=0.3] (Z2) -- node[above = -3pt, near start] {$p_3$} (Y1bar); \draw[->-=0.5] (Z2bar) -- node[below= -1pt] {$p_1$} (Y1bar); \draw[->-=0.5] (Z2bar) -- node[below= -1pt] {$p_2$} (Y2bar); \draw[->-=0.3] (Z2bar) -- node[below= -3pt, near start] {$p_3$} (Y1); \end{tikzpicture} \label{fig_simple upgrading} }\quad \subfloat[Degrading channel from $Q^{(3)}$ to $W$ for upgrade-merge-3.]{ \begin{tikzpicture}[>=latex] \node at (-1.5,-1) {$Q^{(3)}(z|u)$}; \node at (4.5, -1) {$W(d|u)$}; \fill (0, 0) node (Z3){} circle (2pt) node[left=0.1] {$z_k$}; \fill (0,-0.5) node (Z1){} circle (2pt) node[left=0.1] {$z_i$}; \fill (0, -1.5) node (Z1b){} circle (2pt) node[left=0.1] {$-z_i$}; \fill (0, -2) node (Z3b){} circle (2pt) node[left=0.1] {$-z_k$}; \fill (3, 0.25) node (Y3){} circle (2pt) node[right=0.3] {$\,d_k$}; \fill (3, -0.25) node (Y2){} circle (2pt) node[right=0.3] {$\,d_j$}; \fill (3, -0.75) node (Y1){} circle (2pt) node[right=0.3] {$\,d_i$}; \fill (3, -1.25) node (Y1b){} circle (2pt) node[right =0.1] {$-d_i$}; \fill (3, -1.75) node (Y2b){} circle (2pt) node[right =0.1] {$-d_j$}; \fill (3, -2.25) node (Y3b){} circle (2pt) node[right =0.1] {$-d_k$}; \draw[->-=0.5] (Z3) -- node[above= -2pt] {\tiny $p_k$} (Y3); \draw[->-=0.5] (Z3) -- node[above = -2pt] {\tiny $q_k$} (Y2); \draw[->-=0.5] (Z1) -- node[below= -2pt] {\tiny $q_i$} (Y2); \draw[->-=0.5] (Z1) -- node[below = -2pt] {\tiny $p_i$} (Y1); \draw[->-=0.5] (Z3b) -- node[below= -2pt] {\tiny $p_k$} (Y3b); \draw[->-=0.5] (Z3b) -- node[below = -2pt] {\tiny $q_k$} (Y2b); \draw[->-=0.5] (Z1b) -- node[above= -2pt] {\tiny $q_i$} (Y2b); \draw[->-=0.5] (Z1b) -- node[above = -2pt] {\tiny $p_i$} (Y1b); \end{tikzpicture} \label{fig_complex upgrading} } \caption{Degrading channels for the upgrade-merge-2 and upgrade-merge-3 procedures.} \label{fig_degrading channels for upgrade merge} \end{figure} \subsection{The Upgrade-merge-3 Procedure}\label{ap_upgrade merge 3} The second upgrade-merge of~\cite{Tal_2013} removes a $D$-value $d_j$ by splitting its probability between a preceding $D$-value $d_i \leq d_j$ and a succeeding $D$-value $d_k \geq d_j$. We call it \emph{upgrade-merge-3}. Unlike upgrade-merge-2, at least one of these inequalities must be strict (i.e., either $d_i < d_j$ or $d_j < d_k$). Channel $W:\mathcal{U}\to\mathcal{Y}$ is upgraded to channel $Q^{(3)}:\mathcal{U}\to \mathcal{Z}$ with output alphabet $\mathcal{Z} = (\mathcal{Y}\setminus\{d_{i},d_j,d_{k},-d_{i},-d_j,-d_{k}\})\cup\{z_{i},z_{k},-z_{i},-z_{k}\}, $ and \begin{equation} Q^{(3)}(z|u) = \begin{dcases} \achanpi{z_k}\left(\frac{1+ (-1)^ud_{k}}{2}\right), & z = z_{k} \\[0.1cm] \achanpi{z_i}\left(\frac{1+ (-1)^ud_{i}}{2}\right), & z = z_{i} \\[0.1cm] \achanpi{z_i}\left(\frac{1- (-1)^ud_{i}}{2}\right), & z = \bar{z}_{i} \\[0.1cm] \achanpi{z_k}\left(\frac{1- (-1)^ud_{k}}{2}\right), & z = \bar{z}_{k} \\[0.1cm] W(z|u), & \text{otherwise,} \end{dcases} \label{eq_formula for upgrade merge 3} \end{equation} where \[ \achanpi{z_{\ell}} = \begin{dcases} \achanpi{d_i} + \achanpi{d_j}\left(\frac{d_{k}-d_j}{d_{k}-d_{i}} \right), & \ell = i \\[0.1cm] 0, & \ell = j \\[0.1cm] \achanpi{d_k} + \achanpi{d_j}\left(\frac{d_{j}-d_{i}}{d_{k}-d_{i}} \right), & \ell =k \\[0.1cm] \pi_{\ell}, & \text{otherwise.} \end{dcases} \] Note that \begin{equation}Q^{(3)}(z_k|u) + Q^{(3)}(z_i|u) = W(d_i|u)+W(d_j|u)+W(d_k|u).\label{eq_upgrade_merge_3}\end{equation} The degrading channel from $Q^{(3)}(z|u)$ to $W(y|u)$ is shown in \Cref{fig_complex upgrading}, showing only the interesting portion of the channel. The parameters of the channel are $p_{\ell} = \achanpi{d_{\ell}}/\achanpi{z_{\ell}}$, and $q_{\ell} = 1-p_{\ell}$, ${\ell}=i,k$. This is a valid channel as $\achanpi{z_{\ell}} \geq \achanpi{d_{\ell}}$. It can be shown~\cite[Lemma 12]{Tal_2013} that $Q^{(2)} \succcurlyeq Q^{(3)} \succcurlyeq W$. That is, upgrade-merge-3 yields a better (closer) upgraded approximation of $W$ than does upgrade-merge-2.
{'timestamp': '2018-03-06T02:12:10', 'yymm': '1701', 'arxiv_id': '1701.01628', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01628'}
arxiv
\section*{Abstract} Platooning allows vehicles to travel with small intervehicle distance in a coordinated fashion thanks to vehicle-to-vehicle connectivity. When applied at a larger scale, platooning will create significant opportunities for energy savings due to reduced aerodynamic drag, as well as increased road capacity and congestion reduction resulting from shorter vehicle headways. However, these potential savings are maximized if platooning-capable vehicles spend most of their travel time within platoons. Ad hoc platoon formation may not ensure a high rate of platoon driving. In this paper we consider the problem of central coordination of platooning-capable vehicles. By coordinating their routes and departure times, we can maximize the fuel savings afforded by platooning vehicles. The resulting problem is a combinatorial optimization problem that considers the platoon coordination and vehicle routing problems simultaneously. We demonstrate our methodology by evaluating the benefits of a coordinated solution and comparing it with the uncoordinated case when platoons form only in an ad hoc manner. We compare the coordinated and uncoordinated scenarios on a grid network with different assumptions about demand and the time vehicles are willing to wait. \newpage \section{Introduction} Platoons are composed of multiple vehicles communicating with each other and whose movements are automatically controlled. A vehicle in a platoon knows with good accuracy the gap with the preceding vehicle and with the leading vehicle thanks to sensors and radio communication. Each vehicle can thus adjust its speed with full awareness of the state of the preceding and lead vehicles, allowing it to safely maintain a shorter gap between vehicles~\cite{lu2011automated}. Further, researchers have shown~\cite{nowakowski2010cooperative} that drivers are comfortable with a following time-gap as low as 0.6 seconds. Platooning also provides the prospect of reducing the massive waste incurred by traffic congestion. A 2011 study shows urban road congestion annually costing \$121 billion dollars based on 5.5 billion man-hours and 2.9 billion gallons of wasted fuel~\cite{schrank2012tti}; and increasing urban population will likely exacerbate these effects. Platooning can help alleviate congestion by addressing the highly inefficient use of road space by human drivers: congestion occurs when vehicles occupy only 18\% of the road for a typical highway with 2,200 vehicles per hour capacity \cite{manual2000transportation}. Vehicles equipped with Cooperative Adaptive Cruise Control (CACC) (which allows for a simpler form of platooning) have been shown to improve traffic flow and more efficiently use road space~\cite{lu2011automated,nowakowski2010cooperative}. The impact of CACC vehicles at different market penetration rates on a regional scale have been studied via simulations in~\cite{vander2002effects,shladover2012impacts}, and their impact on throughput at intersections in an urban road system was simulated in~\cite{liorisdoubling}. The simulation studies show that CACC enables shorter following gaps and increases road capacity from the typical 2,200 vehicles per hour to almost 4,000 vehicles per hour at 100\% market penetration. Platooning vehicles also use less fuel because trailing vehicles experience a reduced aerodynamic drag. A study was conducted in \cite{tsugawa2013overview} involving three trucks driving 80 km/h with 10 m intervehicle gaps, where control algorithms for lateral movement relied on radar measurements and vehicle-to-vehicle communication. Analysis of their field data shows a 14\% decrease in fuel use. Under similar speeds (60 and 80 km/h) and headway conditions (0.3 to 0.45 seconds) a platoon of two trucks is studied in~\cite{bonnet2000fuel}. The trucks were connected through an electronic system comprising a vehicle-to-vehicle controller, a tow bar controller, and an image-processing unit. Overall, the reduction in fuel consumption ranged from 15\% to 21\% at 80 km/h and 10\% to 17\% at 60 km/h. In~\cite{browand2004fuel}, the authors studied fuel consumption of two trucks linked via an electronic control system and report 8--11\% fuel savings. In~\cite{alam2010experimental}, the authors tested speed control algorithms for following vehicles that use information about the road ahead sensed by the lead vehicle. They showed a 5--8\% improvement in fuel efficiency. Computational fluid dynamics simulations confirm field studies and show that an optimal headway distance that minimizes drag forces is 6--8 meters; this leads to fuel savings of 7--15\%~\cite{davila2013sartre}. Studies for light-duty vehicles show similar savings~\cite{shida2009development,shida2010short,eben2013economy,shladover2012impacts}. In this paper we focus on minimizing the collective fuel use of a group of vehicles by coordinating their departure time and routing, and we then measure the fraction of total miles traveled in a platoon for a given set of trips. An optimal routing is computed by jointly computing vehicle routes and departure times. Routing existing platoons in a network has been studied and solved by a number of authors using discretized optimal control~\cite{Baskar2009a:ifac:09, Baskar2013,Baskar2009:itsc:09}, dynamic programming~\cite{Garcia1995, Valdes2012}, and graph-based algorithms~\cite{Doremalen2014}. These methods are applied to relatively small networks: those with 3--10 nodes and 6--34 arcs. In contrast to our coordinated model, the platoons in these models are not allowed to merge with other vehicles and consequently save additional fuel; they consider only the optimal routing after the vehicles have been grouped into platoons. The goal of this paper is to analyze the potential improvements that can be achieved by strategic coordinated platooning. The coordination assumes that drivers are willing to delay their departures in order to be able to travel in a platoon. We analyze different levels of willingness to wait and how such waiting affects the optimal fuel savings. We present a coordinated platooning optimization model and evaluate the impact of optimal platoon routing by comparing it with an ad hoc platoon formation strategy. The optimization model attempts to minimize the collective fuel use by routing vehicles through the network while determining when platoons should form or dissolve. An explicit mixed-integer programming model in the GAMS modeling language~\cite{GamsSoftware2013} and example problem data are available at \begin{center} \url{http://www.mcs.anl.gov/~jlarson/Platooning}. \end{center} The paper is organized as follows. Section~\ref{polaris} describes the transportation system model used for opportunistic platooning simulations. Section~\ref{model} presents our coordinated platooning optimization model. Section~\ref{results} provides numerical results for a metropolitan road network and compares coordinated and uncoordinated platooning with different assumptions on travel demand and the willingness of drivers to delay their departures. We conclude with a discussion in Section~\ref{discussion}. \section{Opportunistic Platooning Simulations}\label{polaris} We use POLARIS\xspace, a transportation system simulator~\cite{polaris}, to simulate ad hoc (or opportunistic) platooning. POLARIS\xspace is a fully integrated, agent-based simulation of both vehicles and traffic operations. The simulation integrates travel demand, network simulation, and network operation models. At the center of POLARIS\xspace is a person-agent that represents travelers in the system and their activity and travel behavior. The agents plan and schedule their daily activities according to a variety of behavior rules and choice processes and then travel through the network to meet their individual objectives. When traveling from one location to another according to the behavioral objectives, the agents choose routes through the network that minimize a personal cost function. The agents then operate in an environment, represented by the transportation network model, that handles movements through the system governed by the route choice. The route can be replanned by the agent in response to network conditions, new information, and direct system control. The POLARIS\xspace simulator uses a variant of the Lighthill-Whitham-Richards (LWR)~\cite{Lighthill317,richards} traffic flow model, which is a combination of a conservation law defined via a partial differential equation and a flow-density relation called the fundamental diagram. The nonlinear first-order partial differential equation describes the aggregate behavior of drivers. The model explicitly represents the dynamics of the primary variable of interest, traffic density, which is a macroscopic characteristic of traffic flow and the key control variable in transportation system management strategies. Traffic density is defined as a number of vehicles per unit of length. The model is well studied and is used in many transportation applications~\cite{lebacque2005first,lebacque1996godunov,hoogendoorn2001state}. The partial differential equation underlying POLARIS\xspace is solved by using Newell's simplified kinematic waves traffic flow discretization scheme~\cite{Newell1993281}. This is a link-based solution method and has been recently recognized as an efficient and effective method for large-scale networks \cite{lu2013dynamic} and dynamic traffic assignment formulations \cite{zhang2013novel}. A notable implementation of this model is in an open-source dynamic traffic assignment tool DTALite~\cite{dtalite2014}. This tool is used as the traffic simulation model agent in the POLARIS\xspace framework. The traffic simulation model includes a set of traffic simulation agents for intersections, links, and traffic controls. Given a set of travelers with route decisions and the network's traffic operation and control strategies, the network model simulates traffic operations to provide capacities and driving rules on links as well as drivers' turn movements at intersections. With these capacity and driving rule constraints, link and intersection agents simulate the traffic flows using cumulative departures and arrivals as decision variables based on Newell's model. This model then determines the network performance for the route and demand models in the integrated framework. The traffic simulation model agents also produce a set of measures of effectiveness such as their average speed, density, and flow rate, as well as individual vehicle trajectories. The exact solution developed by Newell~\cite{newell} is given by \begin{equation*} \begin{split} T(x,n) = \max \left( T(x_u,n) + \frac{x - x_u}{u}, \right. \left. ~T\left(x_d,n - \rho_{jam}(x_d - x)\right) + \frac{x_d-x}{w} \right), \end{split} \end{equation*} where $T(x,n)$ is the time when vehicle $n$ crosses location $x$ on the link, $w$ is the shock wave propagation speed, $u$ is the free-flow speed, and $\rho_{jam}$ is the jam density of the road segment. Note that $w$, $u$, and $\rho_{jam}$ are the parameters of the fundamental diagram. An event-based simulation scheme is implemented by using POLARIS\xspace's discrete event engine, and the traffic flow simulator is integrated with other transportation simulation components. We modified the POLARIS\xspace traffic flow model to account for opportunistic platoon formation. In our study we did not simulate changes in travel demand as a result of automation and assumed a fixed demand specified in an input trip table. Each vehicle in the trip table is labeled as either a platoon-capable vehicle or a regular vehicle. When simulating mixed traffic with platooning and regular vehicles, vehicles of both type will propagate along a link according to the LWR model. However, the fundamental diagram of a road link is dynamically adjusted to account for the presence of automated vehicles. Since the LWR model preserves the first-in-first-out property of the traffic flow, we assume that two platoon-capable vehicles entering the same road segment one after another will platoon on this link. We dynamically adjust the capacity of the road segment as a function of the number of vehicles platooning on this road segment. The capacity adjustment factors used were derived in~\cite{vander2002effects,shladover2012impacts}. \section{Optimization Model}\label{model} The set of POLARIS\xspace-simulated trips is then sent to the external optimization model in order to find optimal wait times and routes for maximizing the time spent in a platoon. A complete description of the optimization model can be found in~\cite{Larson2016e}. We briefly describe the model variables and objective function from the optimization model. Given a collection of vehicles and a road network described by a set of nodes and edges, our model requires (1) the (fixed) cost to traverse any edge in the network, (2) the origin and destination nodes for each vehicle, (3) the time each vehicle arrives in the network, and (4) the time each vehicle must be at its destination. We assume that the times are feasible, that is, that each vehicle's destination time is at least their origin time plus the shortest path time from its origin to its destination. For our simulations, we assume vehicles are willing to wait a short period of time at their origin nodes provided they can save fuel by platooning, but we do not allow vehicles to wait at intermediate nodes. Given a problem instance defined by these parameters, the optimization model chooses routes and departure times for each vehicle so that the collective fuel use is minimized while ensuring that each vehicle reaches its destination on time. If $n$ vehicles travel on the same road segment at the same time, $n-1$ use 10\% less fuel than the remaining vehicle (which is assumed to be leading the platoon). Our objective is to minimize the overall fuel consumed. We use a simple assumption that the amount of fuel consumed by a vehicle while traversing an edge $(i,j)$ is constant, and we denote it by $C_{i,j}$. We denote the delay in departure time of vehicle $v$ at its origin by $t_v$, the fraction of fuel saved by platooning by $\eta$, and the cost of waiting by each vehicle by $\epsilon_v$. For our study, $C_{i,j} = 1$ for all edges in the grid and $\eta = 0.1$. If the decision variable $f_{v,i,j}=1$ when vehicle $v$ takes $(i,j)$ and $q_{v,w,i,j}=1$ if vehicle $v$ follows vehicle $w$ on $(i,j)$, then the objective function is \begin{equation}\label{eq:objective} \sum_{v,i,j} C_{i,j} \left( f_{v,i,j} - \eta \sum_{w} q_{v,w,i,j} \right) + \epsilon_v t_{v}. \end{equation} In our current study we focus on the maximal possible savings and set $\epsilon_v = 0$. For fleet managers coordinating the routes of many vehicles, $\epsilon_v$ should be the cost per unit time for a stationary vehicle: the drivers' wages plus any idling costs. Such a straightforward calculation is less obvious for private drivers. Also, individuals may need additional incentives in order to be willing to add even a short period of time to their commutes in order to reduce their fuel use by 10\%. Note that a naive implementation of the prescribed model will quickly become computationally intractable because of, for example, generating binary variables $q$ for all pairs of vehicles and all edges in the network. A more systematic approach, used in the available code and discussed in depth in~\cite{Larson2016e}, is to generate variables only when necessary. A vehicle will not travel more that $\frac{1}{1-\eta}$ times its shortest-path route between its origin and destination~\cite[Lemma 2.2]{Larson2016e}; therefore, most $f_{v,i,j}$ can be removed for most edges in a real-world network. Similarly, $q_{v,w,i,j}$ need exist only if vehicles $v$ and $w$ can possibly traverse edge $(i,j)$ simultaneously given their origin/destination times. Such considerations dramatically reduce the model size. Naturally, this model requires a collection of constraints. Any vehicle that enters a nondestination node must exit it. If vehicles are platooning on an edge, the times they enter the edge must be equal. A vehicle cannot enter another edge until it has traversed its current edge. For a thorough discussion of the model and constraints, see~\cite{Larson2016e}. \section{Case Study}\label{results} To test the effects of coordinated and uncoordinated platooning, we performed experiments on the $10\times 10$ grid shown in Figure~\ref{fig:networks}, in which each link has a length of 1 km. Even though the grid model network used in this study appears simple, finding the optimal solution on such grid network is more challenging than on a real highway network since many different routes of the same length exist between most pairs of origin/destination nodes. The number of shortest paths between $(0,0)$ and $(m,n)$ in a grid is ${m+n \choose n}$, whereas on a highway network there are usually a very small number of valid alternative routes between an origin and a destination (usually not more than two). In this case study we assume no congestion on the network, and the cost of traversing a road link is assumed to be proportional to free-flow travel time on this link. \begin{figure}[H] \centering \includegraphics[width=0.45\linewidth]{fig/grid100_thick} \caption{Network under consideration: a $10\times10$ grid \label{fig:networks}} \end{figure} Origins and destinations are randomly generated for 50 vehicles. The trip length distribution is shown in Figure~\ref{fig:vkt-density}; its mean is 7 km. We make the simplifying assumption that all 50 vehicles can be rerouted and controlled and that their coordination does not affect link travel times. This will not hold as more vehicles are routed, but it is a valid assumption when small percentages of vehicles are under control. \begin{figure}[H] \centering \includegraphics[width=0.7\linewidth]{fig/vkt-density} \caption{Distribution of trip length} \label{fig:vkt-density} \end{figure} The departure times $T^O_v$ for each vehicle $v$ are randomly drawn from a truncated normal distribution with support of $[0,100]$, mean 50, and 6 different standard deviations. The departure time distributions are shown in Figure~\ref{fig:to-density}. Each vehicle must arrive at its destination at time $T^D_v$, set to \begin{equation}\label{eq:dest_time} T^v_D = T^v_O + T_{O_{v},D_{v}} + p, \end{equation} where $T_{O_v,D_v}$ is the minimum time between the vehicle's origin and destination and $p$ is some pause time. We assume that trailing vehicles in a platoon use 10\% less fuel than do vehicles leading a platoon or traveling alone on a given edge. \begin{figure}[H] \begin{tabular}{ccc} \includegraphics[width=0.3\linewidth]{fig/to_sd_5} & \includegraphics[width=0.3\linewidth]{fig/to_sd_10} & \includegraphics[width=0.3\linewidth]{fig/to_sd_15} \\ \includegraphics[width=0.3\linewidth]{fig/to_sd_20}& \includegraphics[width=0.3\linewidth]{fig/to_sd_25} & \includegraphics[width=0.3\linewidth]{fig/to_sd_30} \\ \end{tabular} \caption{Six scenarios for departure time distribution} \label{fig:to-density} \end{figure} One of the most important parameters for maximizing driving in platoons is $p$, the upper bound on the amount of time vehicles are willing to wait. Naturally, the longer vehicles are willing to wait, the more platooning possibilities exist, and therefore platooning can occur. If the pause time $p$ in \eqref{eq:dest_time} is zero, then every vehicle must travel from its origin to its destination along its shortest path and can participate only in ad hoc platoons. This scenario corresponds to the uncoordinated platooning case. If $p > 0$, a vehicle can wait to lead/follow another vehicle, thereby decreasing the collective fuel use. In our experiments, increasing $p$ past a certain value provides no additional savings. We simulated our case study with five maximum possible wait times: $p \in \{0,10,20,30,40\}$. We ran Gurobi for five minutes on each GAMS model of each problem instance. For our case study we use wait time and the vehicle-miles-traveled (VMT) ratio to estimate the efficiency of the optimal routing when compared with opportunistic platooning. The VMT ratio is the ratio of miles driven in a platoon to the total miles driven by a vehicle. \[ \mathrm{VMT~ratio} = \dfrac{\mathrm{Platoon~VMT}}{\mathrm{Total~VMT}} \] \begin{figure}[H] \begin{tabular}{cc} \includegraphics[width=0.5\textwidth]{fig/wait_time_box}& \includegraphics[width=0.5\textwidth]{fig/vmt_box}\\ (a) Actual wait times & (b) Ratio of distance driven in platoon \end{tabular} \caption{Box plots comparing the impact of coordinated platooning for different assumptions on maximum allowed wait time. Panel (a) compares actual wait times experienced by drivers. Panel (b) compares the ratio of distance driven in a platoon.} \label{fig:box_plots} \end{figure} Figure~\ref{fig:box_plots} shows a summary of the simulated results for the case study. We compare results for different assumptions about the maximum wait time. This parameter controls the amount of time by which each driver is willing to delay his/her departure time, with zero corresponding to the opportunistic platooning scenario; that is, drivers depart at the originally intended time and platoon only in an ad hoc fashion. For each scenario we calculate two metrics: the ratio of distance driven in a platoon and the average wait time. Naturally, the average wait time is less than maximum wait time and is zero for opportunistic platooning scenario, so it is not shown on Figure~\ref{fig:box_plots}(a). The average platoon distance ratio for opportunistic platooning is 0.12. On the other hand, for coordinated platooning when we set the maximum wait time to 10, the average distance-in-platoon ratio is nearly tripled to 0.32. Note that the average wait time for this scenario is 5 minutes, which is well below the upper bound of 10 minutes. The largest gain in the platoon distance ratio is when we switch from the opportunistic platooning scenario (maximum wait time = 0) to the optimal platooning with a maximum wait time of 10 minutes. For a maximum wait time larger than 10 minutes we do not see significant improvement in the ratio. However, the benefits of platooning (i.e., energy savings) must be traded with the extra wait time required under strategic routing of automated vehicles scenario. Making assumptions about the mean fuel consumption (gallon/miles) and value of time (\$/hour), one can calculate savings associated with the strategic routing by \[ \mbox{Savings} = \mbox{VMT in Platoon}\times \eta \times \mbox{Fuel Consumption} \times \mbox{Fuel Cost}- \mbox{Wait}\times \mbox{Value of Time}. \] Here $\eta$ is the ratio of fuel saved while driving in a platoon. Assuming $\eta = 0.1$, $\mbox{Fuel Consumption} = 0.04$ gallons/miles, (equivalent to 25 mpg), $\mbox{Value of Time} = 30$ \$/hour, and $\mbox{Fuel Cost} = 3$ \$/gallon we calculate the distribution of the savings associated with the centralized routing strategy. Figure~\ref{fig:savings-density} shows the results for different assumptions about maximum wait time and departure time distributions. \begin{figure}[H] \begin{tabular}{ccc} \includegraphics[width=0.5\linewidth]{fig/wait-density_5} & \includegraphics[width=0.5\linewidth]{fig/vmt-savings_5} \\ (a) Wait Time Distribution & (b) Dollar Savings \end{tabular} \caption{Distribution of departure time delays calculated by optimization algorithm and economic savings for the system users} \label{fig:savings-density} \end{figure} We can see from Figure~\ref{fig:savings-density}(a) that the wait time distribution does not change for scenarios with wait times greater than 10, hence there exists some threshold beyond which an increase in the wait time does not bring benefits. On the other hand, when we contrast the wait time with the net economic benefit shown in Figure~\ref{fig:savings-density}(b), we see that under our assumptions, it is negative for all of the users. Thus, for such a system to be viable, additional benefits should be associated with centralized routing strategy. Examples of such benefits might include saved travel times as a result of reduced congestion or incentives for CACC drivers such as reduced tolls or access to dedicated lanes. Assessing the impact of centralized routing strategies on the systemwide congestion levels is the direction of our future research. As part of the analysis framework we developed a web-based animation of the optimization results for the grid network. Snapshots of the animated visualization are shown on Figure~\ref{fig:animation}. \begin{figure}[H] \centering \begin{tabular}{cc} \includegraphics[width=0.45\linewidth]{fig/grid_middle} & \includegraphics[width=0.45\linewidth]{fig/grid_final} \\ \end{tabular} \caption{Snapshot for optimal platoons} \label{fig:animation} \end{figure} Animation of the solutions on an instance of the optimization problem with 25 vehicles is available at \url{http://polaris.es.anl.gov/cav_map_notiles/}. \section{Discussion}\label{discussion} In this paper we demonstrated a method of coordinating platoon formation in which vehicles routes and departure times are strategically chosen by a centralized authority. We showed that at reasonable waiting times, one can substantially increase the distances vehicles travel in a platoon when a coordinated approach is used. To our knowledge this is one of the first papers that presents a relatively large-scale case study of coordinated platooning and compares such an approach with the uncoordinated case. We used Gurobi to solve GAMS models to find optimal routes and departure times. We used the transportation system modeling framework POLARIS\xspace to simulate the uncoordinated platooning case. POLARIS\xspace can simulate large-scale transportation systems with millions of trips in a matter of hours. Thus, it can be used to analyze the impacts of opportunistic platooning for large-scale models. However, the underlying optimization problem for coordinated platooning is the combinatorial optimization that currently scales poorly with the number of vehicles. Certain assumptions and modeling tricks have allowed us to solve problem instances with 50 vehicles for a fairly complicated network. Current research includes considering possible heuristic rules in order to improve the solution times of the optimization model on larger problems, with the goal of solving instances with thousands of vehicles. POLARIS\xspace is also being adjusted to model a mix of platooning and nonplatooning vehicles. Provided that vehicles are traveling at free-flow speeds, the simulation setup and optimization model are still accurate. The congested network case is considerably more difficult to address. We are exploring using the optimization model as an open-loop controller to feed into POLARIS\xspace. When the network is congested, care is being taken to ensure that the routes produced by the optimization model are feasible and converge to a stable routing. We are also working to relax the optimization model assumption that platooning vehicles travel at free-flow speeds in order to accurately analyze congested networks. Moreover, we are analyzing fuel savings using the high-fidelity vehicle energy model AUTONOMIE~\cite{aut,auld2016disaggregate} in order to better understand the impacts of coordinated platooning. Considering the impact of traffic lights on platoon formation and energy savings~\cite{liorisdoubling} is another direction for future research. \section*{Acknowledgements} We are grateful to comments from four anonymous reviewers that greatly improved an early version of this manuscript. This material is based upon work supported by Laboratory Directed Research and Development (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under contract DE-AC02-06CH11357. \bibliographystyle{trb}
{'timestamp': '2017-01-06T02:06:12', 'yymm': '1701', 'arxiv_id': '1701.01391', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01391'}
arxiv
\section{\@ifstar{\starsection}{\nostarsection}} \let\origsection\subsection \renewcommand\subsection{\@ifstar{\starsubsection}{\nostarsubsection}} \newcommand\nostarsubsection[1] {\subsectionprelude\origsection{#1}\subsectionpostlude} \newcommand\starsbsection[1] {\subsectionprelude\origsection*{#1}\subsectionpostlude} \newcommand\subsectionprelude{% \vspace{-0.5em} } \newcommand\subsectionpostlude{% \vspace{0em} } \makeatother \title{Membrane-Dependent Neuromorphic Learning Rule for Unsupervised Spike Pattern Detection} \author{ \IEEEauthorblockN{} \IEEEauthorblockA{ Sadique Sheik$^{1}$, Somnath Paul$^2$, Charles Augustine$^2$, Gert Cauwenberghs$^{1,3}$\\ $^{1}$BioCircuits Institute, UC San Diego, La Jolla, CA , USA\\ $^{2}$Circuit Research Lab, Intel Corporation, Hillsboro, OR, USA\\ $^{3}$Department of Bioengineering, UC San Diego, La Jolla, CA , USA\\ Email: [email protected]} } \maketitle \pagenumbering{gobble} \begin{abstract} Several learning rules for synaptic plasticity, that depend on either spike timing or internal state variables, have been proposed in the past imparting varying computational capabilities to \acp{SNN}. Due to design complications these learning rules are typically not implemented on neuromorphic devices leaving the devices to be only capable of inference. In this work we propose a unidirectional post-synaptic potential dependent learning rule that is only triggered by pre-synaptic spikes, and easy to implement on hardware. We demonstrate that such a learning rule is functionally capable of replicating computational capabilities of pairwise STDP. Further more, we demonstrate that this learning rule can be used to learn and classify spatio-temporal spike patterns in an unsupervised manner using individual neurons. We argue that this learning rule is computationally powerful and also ideal for hardware implementations due to its unidirectional memory access. \end{abstract} \IEEEpeerreviewmaketitle \section{Introduction} Neuromorphic devices aim to capitalize on event based temporal processing and unsupervised learning features of brain inspired spiking neural networks, for efficient, low-power and robust computation. Learning capability in neuromorphic devices is obtained through the use of plastic synapses. Several neuromorphic systems are being developed with the capability to learn synaptic weights of spiking neurons implemented on silicon~\cite{Mayr_etal16}. One of the major blocks constituting neuromorphic devices with plastic synapses is the memory required to store synaptic weights in addition to the circuitry required to implement the learning rule. While some neuromorphic devices have dedicated plastic synaptic circuits~\cite{Mitra_etal2006,Qiao_etal2015} or have a cross bar type synaptic memory~\cite{Seo_etal11}, in most neuromorphic devices, synaptic connectivity and weight memory is implemented on external or internal dedicated digital RAM. Implementation of dedicated plastic synapse circuit for every individual synapse dramatically increases the area requirement for neuromorphic chips, which is not desirable. A second factor that discourages implementation of plasticity on neuromorphic devices is the added complexity in the type of memory required to implement current spike based learning rules. Pairwise \ac{STDP}~\cite{Bi_Poo1998} is a widely used learning rule in computational models of spiking neural networks~\cite{Masquelier_etal2008,Nessler_etal2009,Neftci_etal14}. Event driven implementation of this learning rule triggers an update in the synaptic weight both at the arrival of a presynaptic spike and generation of a postsynaptic spike. This necessitates the accesses to memory associated with the corresponding synaptic weight location in a bidirectional manner i.e. both based on the identity both pre-synaptic and postsynaptic neurons. These factors hold true also for triplet-based \ac{STDP} rule~\cite{Pfister_Gerstner2006}. A physical implementation of such synaptic weight memory therefore has to meet these requirements in order to achieve efficient \ac{STDP}. Traditional RAM devices are not designed for such access in an efficient manner, especially for sparsely connected networks. Instead one requires design of custom memory architecture such as the bidirectional crossbar memory architecture~\cite{Seo_etal11}. While this is a viable solution for the implementation of \ac{STDP} based learning rules, it is very expensive in terms of total memory and silicon area. Alternate learning rules that rely on the presynaptic spike timing and neuronal state variables are being explored for neuromorphic implementations~\cite{Feldman_2012}. These learning rules also tend to be biophysically plausible compared to the pairwise \ac{STDP}. The authors of \cite{Brader_etal2007} present a model of spike-driven synaptic plasticity for bistable synapses where synapses are modified on the arrival of presynaptic spikes based on the post-synaptic potential and calcium concentration. They show that such a rule can enable a neuron to learn to classify complex stimuli in a semi-supervised fashion based on the input firing rates. A calcium voltage dependent plasticity model~\cite{Graupner_Brunel2012} has been shown to approximates \emph{several} \ac{STDP} curves experimentally observed in biology. Similarly, a \ac{MPDP} rule proposed recently~\cite{Albers_etal2016} has been shown to approximate anti-hebbian \ac{STDP} like learning rule which has been argued to be in agreement with \ac{STDP} of inhibitory synapses~\cite{Haas_etal2006}. The authors show that this model can be used to train a neuron in a supervised manner to spike at precise times. In this paper, we propose a simple post-synaptic membrane potential dependent event-driven learning rule that statistically emulates pairwise \ac{STDP} like behavior for excitatory synapses. This learning rule is extremely hardware efficient due to its dependence only on the presynaptic spike timing and not on the postsynaptic spike timing. In addition we demonstrate that such a learning rule enables a neuron to learn and identify complex temporal spike patterns embedded in a stream of spikes in an unsupervised manner. \section{Materials and Methods} A conductance based integrate and fire neuron model has been used to obtain results presented in this paper. The neuron dynamics are described by Eqns. \ref{eqn:lif} and \ref{eqn:lifg}. \begin{eqnarray} C_mdV/dt &=& (V_{rest}-V)g_l + (Es-V)g_e \label{eqn:lif} \\ \tau_{s}dg_e/dt &=& -g_e + \Sigma_i W_i S(t-t_i) \label{eqn:lifg} \end{eqnarray} where $V$ is the neuron's membrane potential, $C_m$ is the membrane capacitance, $V_{rest}$ is its resting potential, $E_s$ is the synaptic reversal potential, $g_l$ is the leakage conductance, $g_e$ is the excitatory synaptic conductance, $S$ are the presynaptic spike trains, $W$ is the synaptic weight and $\tau_s$ is the synaptic time constant. In addition to the neuronal dynamics, each neuron has a calcium concentration trace associated to it. Calcium dynamics is given by Eqn.~\ref{eqn:calcium} \begin{equation} \tau_{ca}dCa/dt = -Ca + S(t-t_{post}) \label{eqn:calcium} \end{equation} where $Ca$ is the calcium concentration, $\tau_{ca}$ is the decay time constant and $t_{post}$ is spike timing of post synaptic neuron. The calcium concentration effectively follows a low pass filtered version of neuron's spiking activity. \subsection{Learning rule} Each neuron receives inputs from several presynaptic neurons with random initial weights. Over the course of input spike presentation the synaptic weights get updated. The weight update rule consists of two components $\Delta W_v$ and $\Delta W_h$. \begin{equation} \Delta W = \Delta W_v + \Delta W_h \end{equation} The weight update component based on the post-synaptic potential $\Delta W_{v}$ is given by: \begin{multline} \Delta W_{v} = [ \delta(V_m(t+1) > V_{lth})\eta_+ \\ - \delta(V_m(t+1) < V_{lth})\eta_- ] S(t-t_{pre}) \end{multline} where $\delta(True) = 1$ and $\delta(False) = 0$. $\eta_+$ and $\eta_-$ are the magnitude of positive and negative weight updates. $V_{lth}$ is the membrane threshold voltage that determines whether the weight should be potentiated (LTP) or depressed (LTD). $S$ represents a pre-synaptic spike train. Homeostatic weight update component $\Delta W_h$ is given by: \begin{equation} \Delta W_{h} = \eta_h(Ca_t-Ca)S(t-t_{pre}) \end{equation} where $Ca_t$ is the target calcium concentration, $Ca$ is the current calcium concentration and $\eta_h$ is the magnitude of rate of homeostasis. \subsection{Stability conditions for the learning rule} In order to ensure that the weights learned are reflective of the statistics of the inputs and do not drift to maximum or minimum bounds together, the parameters of the learning rule need to be appropriately chosen. We postulate the following three criteria: \textit{i)} For a random spike train at a synapse, with no correlation to the input spike pattern, the weights should drift towards $0$. This is described by the Eqn.~\ref{eqn:weight_drift_negative}. \textit{ii)} The negative weight updates triggered by spikes uncorrelated with the target spike pattern (when the pattern is not being presented) should not be large enough to nullify the potentiation during the presentation of the pattern. This is described by the Eqn.~\ref{eqn:retention}. \textit{iii)} The homeostasis should be strong enough to drive the weights up when the firing rate is too low. This is ensured by Eqn.~\ref{eqn:homeostasis_cond}. \begin{eqnarray} t_p\eta_+ &\le& t_n\eta_- \label{eqn:weight_drift_negative} \\ \eta_+ &>& t_n f \eta_- \label{eqn:retention} \\ \eta_- &\le& Ca_t \eta_h \label{eqn:homeostasis_cond} \end{eqnarray} where $t_p$ is the total duration of the spike pattern, $t_n$ is the average duration of noise or uncorrelated spike patterns presented between patterns. \subsection{Hardware implementation} As previously discussed, synaptic memory constitutes a large fraction of neuromorphic device area, and therefore it is desirable to use techniques that allow compression of this synaptic memory. Compressed memory schemes such as index based or linked list based routing and weight storage schemes are ideal if the connectivity of the network is sparse. The key limitation of such storage schemes is that of unidirectional memory access ie. if we store connectivity based on source addresses, we can only determine all destinations from a given source (in O(1)) but not all sources given destination. This limits the implementation of learning rules that trigger a weight update by both pre- and post synaptic neurons. The learning rule we propose here can take advantage of such compressed memory schemes and still perform synaptic plasticity. Fig.~\ref{fig:hw_memory} shows a block diagram of the use of a unidirectional pointer based weight table with the proposed learning rule. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{vm_block.png} \caption{A block diagram of data flow in conjunction with neuromorphic hardware using an index/pointer based weight memory.} \label{fig:hw_memory} \end{figure} \section{Results} In order to evaluate the proposed learning rule we conduct a series of experiments described in the following section. Input and output sizes are arbitrarily chosen and verified to work with different sizes (not shown). \subsection{Equivalence to STDP} The first experiment consists of a statistical measure of the weight updates triggered by the arrival of a presynaptic spike with respect to postsynaptic spike time. A single post synaptic neuron was presented with random Poisson spike patterns across $225$ synapses. While freezing all the weights, the hypothetical weight updates governed by the learning rule were recorded over time. The recorded data was sorted w.r.t postsynaptic spike timing. The membrane potential w.r.t the spike timing of the postsynaptic neurons was also recorded. The top plot of Fig.~\ref{fig:vmem_stdp} shows the distribution of membrane potential approaching spiking threshold just before a postsynaptic spike, and is close to resting potential right after. The red curve on the bottom plot shows positive weight updates (LTP) when a presynaptic spike arrives just before the postsynaptic neuron fires and negative (LTD) when a presynaptic spike arrives just after the postsynaptic neuron fires. Beyond a certain time window, the mean weight update is zero, although individual updates have a large variance. \begin{figure}[!t] \centering \includegraphics[width=0.5\textwidth]{vmem_mean.png}\\ \includegraphics[width=0.5\textwidth]{vmem_stdp.png} \caption{(Top) The membrane potential distribution before and after a post-synaptic spike when activated using a stream of Poisson spike trains. The dotted horizontal line in red shows the learning threshold. (Bottom) The mean and standard deviation of weight update before and after a post-synaptic spike as a result of the $V_m$ based learning rule proposed in this paper in red. An empirically equivalent curve of exponential \ac{STDP} rule is plotted in blue.} \label{fig:vmem_stdp} \end{figure} As can be seen in Fig.~\ref{fig:vmem_stdp}, the membrane based learning rule proposed here empirically approximates the pairwise exponential \ac{STDP} rule. \subsection{Coincidence detection} \label{subsec:coincidence} A fundamental computational capability of \ac{STDP} empowered neurons is believed to be able to learn correlated activity in a form of Hebbian learning. To verify this ability with the proposed learning rule we setup the following experiment. $40$ neuron receives inputs from $225$ spike sources over plastic synapses. $20$ of the inputs are generated from a single Poisson process with mean firing frequency of $5\,Hz$ and consequently the spikes from these inputs are always synchronous. The remaining input are generated from independent Poisson processes with mean spiking frequency of $20\,Hz$ (See Fig.~\ref{fig:coincidence}), and therefore lack synchronicity. The weights of all $225$ synapses are initialized randomly from a uniform distribution. Over time the weight of synapses with synchronous inputs, \emph{ie.} coincident spiking activity drift to high weights. The input weights of synapses that lack synchrony are driven to low weights. As a result, the post synaptic neurons learn to fire only when there is coincident spiking activity from the first $20$ inputs. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{coincidence.png} \caption{Raster plot of spikes from $225$ inputs to $40$ neurons (in blue). The first $20$ of inputs are synchronous. The synaptic learning rule drives the weights of synchronously firing inputs to potentiate and other synaptic weights are depressed as can be seen in the grey scale image of the right sub-plot. As a result the post synaptic neurons only fire (in red) when there is coincidence of spikes. An example membrane potential of one of the $40$ neurons is shown in the lower sub plot.} \label{fig:coincidence} \end{figure} \subsection{Hidden pattern detection} In the above subsection we presented inputs where some of the input sources always firing synchronously. We saw that under these circumstances the learning rule is able to potentiate the corresponding synapses and depress all other synapses. We now explore a different scenario when a randomly generated fixed spike pattern `SP' is repeatedly presented, interspersed with random spike patterns of the same firing rate. Fig.~\ref{fig:embedded} shows the presentation of such a stream of spikes to $20$ different neurons over $225$ synapses each. The initial weights were randomly initialized from a uniform distribution. Over time the synaptic weights converge such that the postsynaptic neurons selectively spike only on presentation of SP. It should be noted that not all neurons spike at the exact same time but fire in the neighborhood of SP, as can also be explained from the different final weights. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{embedded.png} \caption{Neurons receive Possion spike trains from $225$ pre-synaptic neurons. A $40\,ms$ spike pattern (SP) is repeatedly presented with a mean frequency of $5\,Hz$ (onset marked by vertical dotted lines) interspersed with random Poisson spikes of varying lengths. Both the spike pattern (SP) and random spikes have a mean spiking frequency of $20\,Hz$. After training with this input, the output neurons' response synchronizes with the presentation of SP as can be seen in the lower subplot. The final weights are shown in the right sub-plot.} \label{fig:embedded} \end{figure} \subsection{Multiple pattern detection} The results above demonstrate that single patterns embedded in noise are detected and learned based on the learning rule. We now explore a more practical scenario where multiple patterns with statistical significance are presented to the neurons. More specifically, here we present two different patterns in random order interspersed with noise similar to the single pattern presentation experiment. In order to ensure each of the coincidence detectors are tuned to one of the patterns of interest, a competitive winner-take-all is imposed on the coincidence detector neurons~\cite{Masquelier_etal2009,Habenschuss_etal2012}. Two populations of $20$ neurons each with self-excitatory connections and mutual inhibitory connections constitute this winner-take-all network of coincidence detectors. As shown in Fig.~\ref{fig:multiple_wta} the two populations indeed self organize to detect one of the two spike patterns. The competition allows the populations to converge onto different spike patterns. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{embedded_multiple.png} \caption{Raster plot of input (blue) and output spike trains of two competing populations of neurons (red and green) learn to identify two different spike patterns (onsets marked with vertical dotted lines) embedded in noisy spike train.} \label{fig:multiple_wta} \end{figure} \section{Discussion and Conclusion} We propose a simple membrane based learning rule that enables individual neurons to learn and detect spatio-temporal spike patterns. In contrast to other works that shown that membrane based learning rules can be used to perform supervised learning, here we demonstrate that such a rule can imbue unsupervised temporal learning capabilities to neurons. We argue that, by only triggering weight updates from the pre-synaptic neuron, this learning rule is more amenable to hardware implementations where the weight is store using index based memory structures. This allows design of learning neuromorphic devices with minimal memory resources. While this paper considers a single threshold on the membrane for the learning rule, future work is geared towards complex learning kernels on the membrane potential to mimic other \ac{STDP} kernels~\cite{Feldman_2012} and optimize the learning process.
{'timestamp': '2017-01-09T02:01:54', 'yymm': '1701', 'arxiv_id': '1701.01495', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01495'}
arxiv
\section{Introduction} The starting point of this paper is a rather basic problem in information theory and communication complexity, known as the problem of \emph{non-interactive simulation of joint distributions}: Consider two non-communicating players Alice and Bob. Suppose that we give Alice and Bob the sequences $\{{\bf X}_1\}_{i=1}^\infty$ and $\{{\bf Y}_i\}_{i=1}^\infty$ respectively, where the pairs $({\bf X}_i, {\bf Y}_i)$ are independently drawn from some joint distribution ${\bf P}$. Without communicating with each other, which joint distributions ${\bf Q}$ can Alice and Bob jointly simulate? To state the problem more precisely, suppose that ${\bf P}$ is a distribution on $\mathcal{Z} \times \mathcal{Z}$ and that ${\bf Q}$ is a distribution on $\mathcal{W} \times \mathcal{W}$. A \emph{non-interactive strategy} for Alice and Bob simply denotes a triple $(n, f, g)$ such that $f, g: \mathcal{Z}^n \to \mathcal{W}$, and for which $(f({\bf X}^n), g({\bf Y}^n))$ has distribution ${\bf Q}$ whenever $({\bf X}_i, {\bf Y}_i)$ are drawn independently from ${\bf P}$ (here, ${\bf X}^n$ denotes ${\bf X}_1, \dots, {\bf X}_n$). The main question that we consider here is whether a non-interactive strategy exists for a given input distribution ${\bf P}$ and a given target distribution ${\bf Q}$. Note that not every pair of input and target distributions admits a non-interactive strategy. The most obvious example of this is the case where the two coordinates of ${\bf P}$ are independent; in this case, one can obviously only simulate distributions ${\bf Q}$ whose coordinates are also independent. Witsenhausen~\cite{witsenhausen} introduced the problem of non-interactive simulation, and he studied the case where ${\bf Q}$ is a Gaussian measure on $\mathbb{R}^2$. In this case, he showed that ${\bf Q}$ can be approximately simulated by ${\bf P}$ if and only if the absolute value of the correlation between the components of ${\bf Q}$ is at most the so-called ``maximal correlation coefficient'' (which we will define later) of ${\bf P}$. In this case, Witsenhausen showed that for any $\delta>0$, Alice and Bob can simulate ${\bf Q}$ up to error $\delta$ with $n = \mathrm{poly}(|\mathcal{Z}|, \log (1/\delta))$. Further, he gave an explicit algorithm to compute $f$ and $g$ in time $\mathsf{poly}(n)$. Various other questions of this flavor have been explored in information theory. We discuss two examples here. Let us use $\mathsf{Eq}$ to denote the distribution supported on $\{0,1\} \times \{0,1\}$ where (i) both marginals are unbiased Bernoullis and (ii) both marginals are identical with probability $1$. \begin{enumerate} \item In their seminal paper, G{\'a}cs and K{\"o}rner~\cite{gacs1973common} studied non-interactive simulation in the case ${\bf Q} = \mathsf{Eq}$. In this case, they obtained a simple and complete characterization of all ${\bf P}$ such that it is possible to non-interactively simulate ${\bf Q}$ from ${\bf P}$. They also studied the \emph{simulation capacity}: roughly, how many samples from ${\bf P}$ are needed to produce each sample from ${\bf Q}$? They showed that the simulation capacity is equal to another quantity, which is now known as the \emph{G{\'a}cs-K{\"o}rner common information of ${\bf P}$}. \item Around the same time, Wyner~\cite{wyner1975} considered the complementary problem where ${\bf P} = \mathsf{Eq}$ and ${\bf Q}$ is arbitrary. In other words, Alice and Bob have access to shared random bits and they want to simulate ${\bf Q}$. In this case it is always possible to approximately simulate ${\bf Q}$; Wyner studied the simulation capacity, and showed that it is equal to what is now known as the \emph{Wyner common information of ${\bf Q}$}. \end{enumerate} When the target distribution ${\bf Q}$ is not Gaussian or $\mathsf{Eq}$, and the input distribution ${\bf P}$ is not $\mathsf{Eq}$, the problem becomes much more complicated (see, for example, \cite{KA15} and the references therein). Nevertheless, the preceding examples suggest that the answer should depend on how much common information there is between the coordinates of ${\bf P}$ and between the coordinates of ${\bf Q}$. To explore this notion more closely, let $\mathbf{G}_{\rho,2}$ be the centered Gaussian measure on $\mathbb{R}^2$, where each coordinate has unit variance and the correlation between the coordinates is $\rho>0$. Consider the setting where ${\bf P} = \mathbf{G}_{\rho,2}$. If Alice and Bob want to produce unbiased bits with maximal correlation, Borell's noise stability inequality~\cite{Borell:85} can be interpreted as saying that the best they can do is to output the sign of their first input. In other words, a pair of unbiased, positively correlated bits can be simulated from ${\bf P}$ if and only if their correlation is at most $\frac{2}{\pi} \sin^{-1}(\rho)$. The problem becomes much more difficult if Alice and Bob want to produce random variables with three equally likely outcomes each. To begin with, the analogue of Borell's result is not known: we don't know what Alice and Bob should to in order to maximize the probability that they agree. This issue was partially addressed in a recent work of the authors~\cite{DMN16a}: while \cite{DMN16a} does not solve the simulation problem, \cite{DMN16a} shows that they can approximately compute a strategy that maximizes the agreement probability, to an arbitrarily small error. Note that this still does not settle the simulation problem, since joint distributions with three outcomes each are (unlike the case of two outcomes) not determined by the marginal probabilities and the agreement probability. In this work, we extend to framework of~\cite{DMN16a} to answer the non-interactive simulation problem. Specifically, we show that if ${\bf Q}$ can be non-interactively simulated from ${\bf P}$ then one can compute, for every $\delta > 0$, a $\delta$-approximate simulation protocol. Here is an equivalent formulation, in which $|{\bf P}|$ denotes the size of some standard encoding of ${\bf P}$: \begin{theorem}~\label{thm:main} Let $(\mathcal{Z} \times \mathcal{Z}, {\bf P})$ and $([k] \times [k], {\bf Q})$ be probability spaces, and let ${\bf X}^n = ({\bf X}_1, \dots, {\bf X}_n)$ and ${\bf Y}^n = ({\bf Y}_1, \dots, {\bf Y}_n)$, where $({\bf X}_i, {\bf Y}_i)$ are independently drawn from ${\bf P}$. For every $\delta > 0$, there is an algorithm running in time $O_{|{\bf P}|, \delta}(1)$ which distinguishes between the following two cases: \begin{enumerate} \item There exist $n \in \mathbb{N}$ and $f,g: \mathcal{Z}^n \rightarrow [k]$ such that ${\bf Q}$ and the distribution of $(f({\bf X}^n), g({\bf Y}^n))$ are $\delta$-close in total variation distance. In this case, there is an explicit $n_0 = n_0(|{\bf P}|, \delta)$ such that we may choose $n \le n_0$. Further, the functions $f$ and $g$ can be explicitly computed. \item For any $n \in \mathbb{N}$ and $f,g: \mathcal{Z}^n \rightarrow [k]$, ${\bf Q}$ and the distribution of $(f({\bf X}^n), g({\bf Y}^n))$ are $8\delta$-far in total variation distance. \end{enumerate} \end{theorem} We remark here that the bound $n_0$, while computable, is not primitive recursive and has an Ackermann type growth, which is introduced by our application of a regularity lemma from~\cite{DS14}. It is easy to see that to prove Theorem~\ref{thm:main}, it suffices to prove the following theorem. \begin{theorem}~\label{thm:junta} With the notation of Theorem~\ref{thm:main}, suppose there exist $f, g: \mathcal{Z}^n \to [k]$ such that $(f({\bf X}^n), g({\bf Y}^n)) \sim {\bf Q}$. Then, there exist $n_0 = n_0 (|\mathbf{P}|, \delta)$ and $f_{\delta}, g_\delta : \mathcal{Z}^{n_0} \rightarrow [k]$ such that ${\bf Q}$ and the distribution of $(f_{\delta}({\bf X}^{n_0}), g_{\delta}({\bf Y}^{n_0}))$ are $\delta$-close in total variation distance. Moreover, $n_0$ is computable. Further, the functions $f_\delta$ and $g_\delta$ can be explicitly computed. \end{theorem} The gist of the above theorem is that if a distribution can be simulated then it can be approximately simulated with a bounded number of samples. (The crucial point in the previous sentence is that the bound is explicit, and that it depends only on ${\bf P}$ and the desired accuracy.) \subsection{Recent work, and the difficulty of going from two to three} In a recent paper, Ghazi, Kamath, and Sudan~\cite{GKS16} proved Theorems~\ref{thm:main} and~\ref{thm:junta} in the case $k=2$. Moreover, they gave an explicit doubly exponential bound on $n_0$ and the running time of the algorithm. Borell's noise stability theorem (which is not available for $k > 2$) played an important role in their analysis. To explain the bottleneck in extending their result for any $k$, we will elaborate on the case where $\mathcal{Z} = \mathbb{R}$ and ${\bf P} = \mathbf{G}_{\rho,2}$. We begin by recalling Borell's inequality~\cite{Borell:85} on Gaussian noise stability. \begin{theorem}\label{thm:Borell} \cite{Borell:85} Let ${\bf P} = \mathbf{G}_{\rho,2}$. For any $\mu_1, \mu_2 \in [0,1]$, let $f, g : \mathbb{R}^n \rightarrow \{0,1\}$ such that $\mathbf{E}[f] = \mu_1$ and $\mathbf{E}[g] = \mu_2$. Let us choose $\kappa_1, \kappa_2$ such that for $f_{\mathsf{LTF}}, g_{\mathsf{LTF}} : \mathbb{R} \rightarrow \{0,1\}$ defined as $f_{\mathsf{LTF}}(x) = \mathsf{sign}(x- \kappa_1)$ and $g_{\mathsf{LTF}}(x) = \mathsf{sign}(x- \kappa_2)$, we have $\mathbf{E}[f_{\mathsf{LTF}}] = \mu_1$ and $\mathbf{E}[g_{\mathsf{LTF}}] = \mu_2$. Then, $$\Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f_{\mathsf{LTF}}({\bf X}) = g_{\mathsf{LTF}}({\bf Y})] \geq \Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f({\bf X}) = g({\bf Y})]. $$ Likewise, if we define $h_{\mathsf{LTF}} = \mathsf{sign} (-x - \kappa_2)$, then $\mathbf{E}[h_{\mathsf{LTF}}] = \mu_2$ and $$\Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f_{\mathsf{LTF}}({\bf X}) = h_{\mathsf{LTF}}({\bf Y})] \leq \Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f({\bf X}) = g({\bf Y})]. $$ \end{theorem} To explain the intuitive meaning of these theorems, let us define $\mathsf{Corr}_{\max}(\rho, \mu_1, \mu_2)$ and $\mathsf{Corr}_{\min}(\rho, \mu_1, \mu_2)$ as \[ \mathsf{Corr}_{\max}(\rho, \mu_1, \mu_2)= \Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f_{\mathsf{LTF}}({\bf X}) = g_{\mathsf{LTF}}({\bf Y})], \] \[ \mathsf{Corr}_{\min}(\rho, \mu_1, \mu_2)= \Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f_{\mathsf{LTF}}({\bf X}) = h_{\mathsf{LTF}}({\bf Y})] \] where $f_{\mathsf{LTF}}$, $g_{\mathsf{LTF}}$ and $h_{\mathsf{LTF}}$ are halfspaces defined in Theorem~\ref{thm:Borell}. Then, Borell's result implies that for any given measures $\mu_1, \mu_2$ and functions $f, g$ with these measures, the probability that $f({\bf X})$ and $g({\bf Y})$ are identical lies between $\mathsf{Corr}_{\max}(\rho, \mu_1, \mu_2)$ and $\mathsf{Corr}_{\min}(\rho, \mu_1, \mu_2)$. Further, now, it easily follows that for any $\eta$ such that $\mathsf{Corr}_{\min }(\rho, \mu_1, \mu_2) \le \eta \le \mathsf{Corr}_{\max}(\rho, \mu_1, \mu_2)$, there is a function $g_{\eta}: \mathbb{R} \rightarrow \{0,1\}$ such that $\mathbf{E}[g_{\eta}] = \mu_2$ and $ \eta = \Pr_{({\bf X}, {\bf Y}) \sim P} [f({\bf X}) = g_{\eta}({\bf Y})]$. In fact, it is also easy to see that $g_\eta$ can be assumed to be the indicator function of an interval. Now, consider any distribution ${\bf Q}$ on $\{0,1\} \times \{0,1\}$, and take $({\bf U}, {\bf V}) \sim {\bf Q}$. Assume that there exist $f, g: \mathbb{R}^n \rightarrow \{0,1\}$ such that $(f({\bf X}^n) , g({\bf Y}^n)) \sim {\bf Q}$. Defining $\mu_{1, {\bf Q}} = \mathbf{E}[{\bf U}]$, $\mu_{2, {\bf Q}} = \mathbf{E}[{\bf V}]$ and $\eta_{{\bf Q}} = \Pr[{\bf U} = {\bf V}]$ and applying Theorem~\ref{thm:Borell}, we obtain that there are functions $f_{\bf Q},g_{\bf Q} : \mathbb{R} \rightarrow \{0,1\}$ which satisfy \[ \mathbf{E}[f_{\bf Q} ({\bf X}) ] = \mu_{1, {\bf Q}}, \quad \mathbf{E}[g_{\bf Q} ({\bf Y}) ] = \mu_{2, {\bf Q}}, \] and \[ \Pr_{({\bf X}, {\bf Y}) \sim {\bf P}} [f_{\bf Q}({\bf X}) = g_{{\bf Q}}({\bf Y})] = \eta_{\bf Q}. \] Further, the functions $f_{{\bf Q}}$ and $g_{{\bf Q}}$ are in fact indicators of intervals and given $\mu_{1, {\bf Q}}$, $\mu_{2, {\bf Q}}$ and $\eta_{{\bf Q}}$, the functions $f_{{\bf Q}}$ and $g_{{\bf Q}}$ can be explicitly computed. Observe that any distribution ${\bf Q}$ over $\{0,1\} \times \{0,1\}$ is characterized by the quantities $\mu_{1, {\bf Q}}$, $\mu_{2, {\bf Q}}$ and $\eta_{{\bf Q}}$. Thus, it implies that $(f_{\bf Q}({\bf X}), g_{{\bf Q}}({\bf Y})) \sim {\bf Q}$. This completely settles the non-interactive simulation problem in the case $k=2$, when ${\bf P}$ is the Gaussian measure $\mathbf{G}_{\rho,2}$ on $\mathbb{R}^2$. In particular, we see that when ${\bf P}$ is Gaussian, the result of~\cite{GKS16} is a straightforward consequence of Theorem~\ref{thm:Borell}. Indeed, their main contribution was to show that the general case reduces to the Gaussian case. Moreover, that part of their argument turns out to generalize to $k > 2$ (as we will discuss later). Therefore, let us continue examining the case where ${\bf P}$ is Gaussian, and see why $k > 2$ causes trouble. There are two problems: \begin{enumerate} \item The analogue of Borell's result for $k>2$ is not known. In particular, the following simple question is still open: let $\boldsymbol{\mu} \in \Delta_k$ where $\Delta_k$ is the convex hull of the standard unit vectors $\{ \mathbf{e}_1, \ldots, \mathbf{e}_k\}$. Let $A_{\boldsymbol{\mu}} = \{f : \mathbb{R}^n \rightarrow [k] : \mathbf{E}[f] =\boldsymbol{\mu} \}$. Among all $f \in A_{\boldsymbol{\mu}}$, what $f$ maximizes the probability $\Pr_{({\bf X},{\bf Y}) \sim {\bf P}} [f({\bf X}) = f({\bf Y})]$? If $k=2$, then Theorem~\ref{thm:Borell} asserts that $f$ is the indicator of some halfspace; for $k > 3$, the answer is almost completely unknown. Of particular relevance to us, it is not even known whether the optimal value can be achieved in any finite dimension (whereas in the case $k=2$, it is achieved in one dimension). \item For $k=2$, any distribution ${\bf R} = ({\bf R}_1, {\bf R}_2)$ supported on $[k] \times [k]$ is completely defined by $\mathbf{E}[{\bf R}_1]$, $\mathbf{E}[{\bf R}_2]$ and $\Pr[{\bf R}_1 = {\bf R}_2]$. However, this is no longer true when $k>2$. \end{enumerate} In \cite{DMN16a}, the authors partially circumvented the first issue. To explain the result of \cite{DMN16a}, we will need to introduce two notions. The first is that of the (standard) Ornstein-Uhlenbeck noise operator. Namely, for any $t \ge 0$ and $f: \mathbb{R}^n \rightarrow \mathbb{R}$, we define $P_t f : \mathbb{R}^n \rightarrow \mathbb{R}$ as \begin{equation}\label{eq:noise-operator-def} P_tf(x) = \mathop{\mathbf{E}}_{y \sim \gamma_n} [f(e^{-t} x +\sqrt{1-e^{-2t}} y)]. \end{equation} To see the connection between $P_t$ and our $\rho$-correlated Gaussian distribution $\mathbf{P}=\mathbf{G}_{\rho,2}$, choose $t$ so that $e^{-t} = \rho$. Then \[ \mathbf{E}_{({\bf X}, {\bf Y})^n \sim {\bf P}^n} [f({\bf X}^n) \cdot f({\bf Y}^n)] = \mathbf{E}_{{\bf X}^n \sim \gamma_n} [f({\bf X}^n) \cdot P_t f ({\bf X}^n)]. \] The above quantity is often referred to as the noise stability of $f$ at noise rate $t>0$. Note that the operator $P_t$ is a linear operator on the space of functions mapping $\mathbb{R}^n$ to $\mathbb{R}$. In fact, the noise operator can be syntactically extended to functions $f: \mathbb{R}^n \rightarrow \mathbb{R}^k$ with the same definition as in (\ref{eq:noise-operator-def}). Embedding $\Delta_k$ in $\mathbb{R}^k$ and identifying $[k]$ with the vertices of $\Delta_k$, we obtain that \[ \mathbf{E}_{({\bf X}, {\bf Y})^n \sim {\bf P}^n} [\langle f({\bf X}^n) , f({\bf Y}^n) \rangle] = \mathbf{E}_{{\bf X}^n \sim \gamma_n} [\langle f({\bf X}^n) , P_t f ({\bf X}^n) \rangle]. \] Let us now recall the notion of a multivariate polynomial threshold function (PTF) from \cite{DMN16a}. Given polynomials, $p_1, \ldots, p_k: \mathbb{R}^n \rightarrow \mathbb{R}$, define $f= \mathsf{PTF}(p_1, \ldots, p_k)$ as \[ f(x) = \begin{cases} j &\textrm{if }p_j(x)>0\textrm{ and }p_i(x) \le 0 \textrm{ for all }j\not =i, \\ 1 &\textrm{ otherwise}. \\ \end{cases} \] In \cite{DMN16a}, the authors proved the following theorem. A notation we will adopt for the rest of the paper is that unless explicitly mentioned otherwise, the expectation is always w.~r.~t.~the variable being a standard Gaussian where the ambient dimension will be clear from the context. \begin{theorem}~\label{thm:DMN1} Let $f: \mathbb{R}^n \rightarrow [k]$ such that $\mathbf{E}[f] = \boldsymbol{\mu} \in \mathbb{R}^k$. Then, given any $t>0, \epsilon>0$, there exists an explicitly computable $n_0 = n_0(t, k, \epsilon)$ and $d= d(t, k, \epsilon)$ such that there is a degree-$d$ PTF $g: \mathbb{R}^{n_0} \rightarrow [k]$ with \begin{enumerate} \item $\Vert \mathbf{E}[g] - \boldsymbol{\mu} \Vert_1 \le \epsilon$. \item $\mathbf{E}[\langle g, P_t g \rangle] \ge \mathbf{E}[\langle f, P_t f \rangle] - \epsilon$. \end{enumerate} \end{theorem} In other words, Theorem~\ref{thm:DMN1} shows that for any given $\boldsymbol{\mu}$ and error parameter $\epsilon>0$, there is a low-degree, low-dimensional PTF $g$ which approximately maximizes the noise stability and whose expectation is close to $\boldsymbol{\mu}$. {\red{We remark here that the issue of matching the expectation exactly versus approximately is insignificant since expectations can always be made to match exactly by suffering a tiny change in the correlation.}} The proof of Theorem~\ref{thm:DMN1} has two separate steps: \begin{enumerate} \item (\textbf{Smooth}) The first step is to show that given any $f: \mathbb{R}^n \rightarrow [k]$ with $\mathbf{E}[f] = \boldsymbol{\mu}$, there is a degree $d = d(t, k, \epsilon)$ PTF $h$ on $n$ variables such that $\Vert \mathbf{E}[h] -\boldsymbol{\mu}\Vert_1 \le \epsilon$ and $\mathbf{E}[\langle h, P_t h \rangle] \ge \mathbf{E}[\langle f, P_tf \rangle]-\epsilon$. In other words, reduce the degree but not the dimension. The main idea here is to modify the function $f$ by first smoothing it and then rounding it back to the discrete set $[k]$. It is fairly easy to show that this procedure doesn't decrease the noise stability of $f$ (as long as the amount of smoothing is chosen to match the noise parameter $t$). The more difficult part is to show that the result of this procedure is close to a low-degree PTF. This is done using a randomized rounding argument: we show that by rounding the smoothed function at a random threshold, the expected Gaussian surface area of the resulting partition is bounded; in particular, there exists a good way to round. A well-known link between Gaussian surface area and Hermite expansions then implies that the rounded, smoothed function is almost a low-degree PTF. {\red{This argument uses the co-area formula, gradient bounds and is inspired by ideas from \cite{KNOW14, Neeman14}.}} \item (\textbf{Reduce}) The second step is to show that given a multivariate PTF $h$, there is a multivariate PTF $g$ on $n_0 = n_0(t,k, \epsilon)$ variables such that the noise stability of $g$ is the same as that of the noise stability of $h$ up to an additive error $\epsilon$. This step uses several ideas and results from \cite{DS14}. To give a brief overview of this part, we start with the notion of an \emph{eigenregular} polynomial which was introduced in \cite{DS14}. A polynomial is said to be $\delta$-eigenregular if for the canonical tensor $\mathcal{A}_p$ associated with the polynomial, the ratio of the maximum singular value to its Frobenius norm is at most $\delta$. Let us assume that $h = \mathsf{PTF}(p_1, \ldots, p_k)$. The \emph{regularity lemma} from \cite{DS14}, roughly speaking, shows that each of the polynomials $p_1, \ldots, p_k$ can be written as a low-degree ``outer'' polynomial composed with a bounded number of $\delta$-eigenregular, low-degree ``inner'' polynomials. Using the central limit theorem from~\cite{DS14} and several other new technical ingredients, one can replace the whole collection of inner polynomials by a new collection of inner polynomials on a bounded number of variables. Moreover, one can do this replacement while hardly affecting the distribution of the outer polynomial. In particular, this whole procedure constructs a new PTF on a bounded number of inputs, and with approximately the same noise stability as the original PTF. \end{enumerate} \textbf{How to prove Theorem~\ref{thm:junta}:} We will first outline the proof of Theorem~\ref{thm:junta} in the case that ${\bf P} = \mathbf{G}_{\rho,2}$ (the $\rho$-correlated Gaussian measure on $\mathbb{R}^2$). As we observed earlier, any function with codomain $[k]$ naturally maps to $\mathbb{R}^k$ by identifying $i \in [k]$ with the standard unit vector $\mathbf{e}_i \in \mathbb{R}^k$. Also, for any function $f: \mathbb{R}^n \rightarrow \mathbb{R}^k$ and $1 \le j \le k$, we let $f_j: \mathbb{R}^n \rightarrow \mathbb{R}$ denote the $j^{th}$ coordinate of $f$. Then, observe that for all $1 \le i, j \le k$, \[ \Pr_{({\bf X}^n, {\bf Y}^n) \sim {\bf P}^n} [f({\bf X}^n) = i \wedge g({\bf Y}^n) = j ] = \mathbf{E}[f_{i} P_t g_{j}]. \] In particular, to prove Theorem~\ref{thm:junta} in the case ${\bf P} = \mathbf{G}_{\rho,2}$ it suffices to prove an improvement of Theorem~\ref{thm:DMN1}, where the inequality $\mathbf{E}[\langle g, P_t g \rangle] \ge \mathbf{E}[\langle f, P_t f \rangle] - \epsilon$ is replaced by an almost-equality: $|\mathbf{E} [g_i P_t g_j] - \mathbf{E} [f_i P_t f_j]| \le \epsilon$ for all $i, j$. In fact, we will prove something slightly stronger, by starting with two functions instead of one. The proof of Theorem~\ref{thm:junta} will follow the same smooth/reduce outline as the proof of Theorem~\ref{thm:DMN1}. Moreover, the ``reduce'' step will be essentially the same as the one in~\cite{DMN16a}. Therefore, we will outline only the ``smooth'' step. Define the set $\Delta_{k,\epsilon}$ as \[ \Delta_{k,\epsilon} = \{x \in \mathbb{R}^k : \exists y \in \Delta_k, \ \ \Vert x - y \Vert_1 \le \epsilon\}. \] Thus, if $\epsilon = 0$, then $\Delta_{k,\epsilon} = \Delta_k$. In the ``smooth'' step for the proof of Theorem~\ref{thm:junta}, we will show that for any pair $f$, $g$ of functions ${\bf R}^n \to [k]$, there exist functions $\tilde f, \tilde g: {\bf R}^n \to {\bf R}^k$ such that For every $\epsilon>0$, we will show that there are functions $f_1, g_1: \mathbb{R}^n \rightarrow \mathbb{R}^k$ satisfying the following conditions: \begin{itemize} \item[(i)] $ \Vert \mathbf{E}[f] - \mathbf{E}[\tilde f] \Vert_1 \le \epsilon$, $ \Vert \mathbf{E}[g] - \mathbf{E}[\tilde g] \Vert_1 \le \epsilon$; \item[(ii)] the functions $f_1, g_1$ are linear combinations of $O_{k,t,\epsilon}(1)$ low-degree PTFs (with some special structure that we will describe later); \item[(iii)] $\Pr[\tilde f({\bf X}^n) \in \Delta_{k,\epsilon}] \ge 1 - \epsilon$ and $\Pr[\tilde g({\bf Y}^n) \in \Delta_{k,\epsilon}] \ge 1-\epsilon$; and \item[ (iv)] for any $1 \le i, j \le k$, $\big| \mathbf{E}[\langle f_{i} P_t g_{j} \rangle] - \mathbf{E}[\langle \tilde f_{i} P_t \tilde g_{j} \rangle ] \big| \le \epsilon$. \end{itemize} The precise statement corresponding to this step is given in Lemma~\ref{lem:smoothing}, which contains most of the technically new ideas in the paper. In particular, we employ a new ``boosting'' based idea to obtain the functions $\tilde f$ and $\tilde g$. The proof of Lemma~\ref{lem:smoothing} comes in two main steps. We start with arbitrary functions $f$ and $g$. First, we show that there are projections of polynomial threshold functions $f_{\mathsf{sm}}$ and $g_{\mathsf{sm}}$ which have the same low-level Hermite spectrum as $f$ and $g$. This is carried out in an iterative argument using a potential function, and is inspired by similar iterative algorithms appearing in boosting~\cite{Schapire:90, Fre95} from learning theory, the hardcore lemma in complexity theory~\cite{Imp95} and dense model theorems in graph theory~\cite{Frieze1999} and additive combinatorics~\cite{Tao:07, TTV09:conf}. While these iterative algorithms have recently been used to prove structural results in complexity theory~\cite{DDFS14, LRS15, TTV09:conf}, since our algorithm is in the multidimensional setting, it is somewhat more delicate than these applications. The main argument here is carried out in Lemma~\ref{lem:Boosting}, and we bound the degree of the resulting polynomials in Corollary~\ref{corr:fsm}. The next step is to show that we can replace the projected polynomial threshold functions by polynomials that with high probability take values very close to the simplex (call them $f_{\mathsf{sm}}'$ and $g_{\mathsf{sm}}'$). This is carried out in Lemma~\ref{lem:smoothing-1}, using Bernstein approximations for Lipschitz functions. Finally, we use some probabilistic tricks to replace $f_{\mathsf{sm}}'$ and $g_{\mathsf{sm}}'$ by functions $\tilde f$ and $\tilde g$ which are linear combinations of low-degree PTFs. This finishes the proof of Lemma~\ref{lem:smoothing}. \subsection{What happens when ${\bf P}$ is not Gaussian?}~\label{sec:non-gauss} {{So far, the discussion has pertained to the case when ${\bf P} = \mathbf{G}_{\rho,2}$. What happens if ${\bf P}$ is a different probability distribution? As we have remarked earlier, the main result of~\cite{GKS16} is that the $k=2$ case of Theorem~\ref{thm:junta} essentially reduces to the special case ${\bf P} = \mathbf{G}_{\rho,2}$. Their argument uses quite general tools from Boolean function analysis such as the invariance principle~\cite{MOO10, Mossel2010} and regularity lemmas for low-degree polynomials~\cite{DSTW:10, DDS14}. A similar argument can be used to prove Theorem~\ref{thm:junta} by reducing to the Gaussian case; however, we will actually need a slightly stronger Gaussian version of Theorem~\ref{thm:junta}: \begin{theorem}\label{thm:junta-strong} Let ${\bf P} = \mathbf{G}_{\rho,2}$ and let $f^{(1)}, \ldots, f^{(\ell)}: \mathbb{R}^n \rightarrow [k]$ and $g^{(1)}, \ldots, g^{(\ell)}: \mathbb{R}^n \rightarrow [k]$ where we define ${\bf Q}_{i,j}$ as ${\bf Q}_{i,j} = (f^{(i)}({\bf X}^n), g^{(j)}({\bf Y}^n))$. Then, for every $\delta>0$, there is an explicitly defined constant $n_0 = n_0(\ell, k, \delta)$ and explicitly defined functions $f^{(1)}_{\mathsf{junta}}, \ldots, f^{(\ell)}_{\mathsf{junta}}: \mathbb{R}^{n_0} \rightarrow [k]$ and $g^{(1)}_{\mathsf{junta}}, \ldots, g^{(\ell)}_{\mathsf{junta}}: \mathbb{R}^{n_0} \rightarrow [k]$ such that for every $1 \le i, j \le \ell$, $d_{\mathrm TV}((f^{(i)}_{\mathsf{junta}}({\bf X}^{n_0}), g^{(j)}_{\mathsf{junta}}({\bf Y}^{n_0})), {\bf Q}_{i,j}) \le \delta$. \end{theorem} Note that the $\ell=1$ case of Theorem~\ref{thm:junta-strong} is exactly the ${\bf P} = \mathbf{G}_{\rho,2}$ case of Theorem~\ref{thm:junta}, the proof of which we outlined above. Then $\ell > 1$ case has essentially the same proof, but with more notation. In order to prove Theorem~\ref{thm:junta} from Theorem~\ref{thm:junta-strong}, Alice and Bob both execute a ``decision tree.'' By standard arguments from Boolean function analysis (see~\cite{ODonnell:book} for definitions of the terminology that follows), Alice and Bob can represent $f$ and $g$ by small decision trees, such that most of the ``leaf'' functions (call them $\{f^{(i)}\}_{1 \le i \le \ell}$ and $\{g^{(i)}\}_{1 \le i \le \ell}$) are \emph{low-influence} functions. The invariance principle of Mossel \emph{et~al.}~\cite{MOO10, Mossel2010} allows us to replace $\{f^{(i)}\}_{1 \le i \le \ell}$ and $\{g^{(i)}\}_{1 \le i \le \ell}$ by functions of Gaussian variables; essentially, we can pretend that Alice and Bob have access to independent copies of $\mathbf{G}_{\rho,2}$ where $\rho$ is the so-called maximal correlation coefficient of $({\bf X}, {\bf Y})$. Finally, we apply Theorem~\ref{thm:junta-strong} to this collection of Gaussian ``leaf'' functions. In the end, we have replaced Alice and Bob's initial functions by a pair of decision trees of bounded size, where every leaf function is a function of a bounded number of Gaussian variables. We give a more detailed overview of this reduction in Section~\ref{section:GKS}. \subsection{Acknowledgements} We thank Pritish Kamath, Badih Ghazi and Madhu Sudan for pointing out that the $\ell=1$ case of Theorem~\ref{thm:junta-strong} is not sufficient to derive Theorem~\ref{thm:junta}. (An earlier version of this paper incorrectly claimed that it was.) We also thank the anonymous reviewers who pointed out the same gap. }} \section{Technical preliminaries} We will start by defining some technical preliminaries which will be useful for the rest of the paper. \begin{definition} For $k \in \mathbb{N}$ and $1\le i \le k$, let $\mathbf{e}_i$ be the unit vector along coordinate $i$ and let $\Delta_k$ be the convex hull formed by $\{ \mathbf{e}_i \}_{1\le i \le k}$. \end{definition} In this paper, we will be working on the space of functions $f: \mathbb{R}^n \rightarrow \mathbb{R}$ where the domain is equipped with the standard $n$ dimensional normal measure (denoted by $\gamma_n(\cdot)$). Unless explicitly mentioned otherwise, all the functions considered in this paper will be in $L^2(\gamma_n)$. A key property of such functions is that they admit the so-called Hermite expansion. Let us define a family of polynomials $H_q: \mathbb{R} \rightarrow \mathbb{R}$ (for $q \ge 0$) as $$ H_0(x) = 1 ; \ H_1(x) = x ; \ H_q(x) = \frac{(-1)^q}{\sqrt{q!}} \cdot e^{x^2/2} \cdot \frac{d^q}{dx^q} e^{-x^2/2}. $$ Let $\mathbb{Z}^{\ast}$ denote the subset of non-negative integers and $S \in \mathbb{Z}^{\ast n}$. Define $H_S: \mathbb{R}^n \rightarrow \mathbb{R}$ as $$ H_S(z) = \prod_{i=1}^n H_{S_i}(z_i). $$ It is well known that the set $\{H_S\}_{S \in \mathbb{Z}^{\ast n}}$ forms an orthonormal basis for $L^2(\gamma_n)$. In other words, every $f \in L^2(\gamma_n)$ may be written as $$ f = \sum_{S \in \mathbb{Z}^{\ast n}} \widehat{f}(S) \cdot H_S, $$ where $\widehat{f}(S)$ are typically referred to as the \emph{Hermite coefficients} and expansion is referred to as the \emph{Hermite expansion}. The notion of Hermite expansion can be easily extended to $f: R^n \rightarrow \mathbb{R}^k$ as follows: Let $f = (f_1, \ldots, f_k)$ and let $$ f_i = \sum_{S \in \mathbb{Z}^{\ast n}} \widehat{f_i}(S) \cdot H_S. $$ Then, the Hermite expansion of $f$ is given by $\sum_{S \in \mathbb{Z}^{\ast n}} \widehat{f}(S) \cdot H_S$ where $\widehat{f}(S) = (\widehat{f_1}(S), \ldots, \widehat{f_k}(S))$. In this setting, we also have Parseval's identity: \begin{equation}\label{eq:parseval} \int \Vert f (x) \Vert_2^2 \ \gamma_n(x) dx = \sum_{S \in \mathbb{Z}^{\ast n}} \Vert \widehat{f}(S) \Vert_2^2 \end{equation} For $f: \mathbb{R}^n \rightarrow \mathbb{R}^k$ and $d \in \mathbb{N}$, define $f_{\le d} : \mathbb{R}^n \rightarrow \mathbb{R}^k$ by $$ f_{\le d} (x) = \sum_{S: |S| \le d} \widehat{f}(S) \cdot H_S(x). $$ Here $|S|$ denotes the $\ell_1$ norm of the vector $S$. We will define $\mathsf{W}^{\le d} [f] = \Vert f_{\le d} \Vert_2^2$ and $\mathsf{W}^{> d} [f] = \sum_{|S|>d} \Vert \widehat{f}(S) \Vert_2^2$. \subsubsection*{Ornstein-Uhlenbeck operator} \begin{definition} The Ornstein-Uhlenbeck operator $P_t$ is defined for $t \in [0, \infty)$ such that for any $f: \mathbb{R}^n \rightarrow \mathbb{R}^k$, $$ (P_t f)(x) = \int_{y \in \mathbb{R}^n} f(e^{-t} \cdot x + \sqrt{1- e^{-2t}} \cdot y) d \gamma_n(y). $$ \end{definition} Note that if $f : \mathbb{R}^n \rightarrow \Delta_k$, then so is $P_t f$ for every $t>0$. A basic fact about the Ornstein-Uhlenbeck operator is that the functions $\{H_S\}$ are eigenfunctions of this operator. We leave the proof of the next proposition to the reader. \begin{proposition} For $S \in \mathbb{Z}^{\ast n}$, $P_t H_S = e^{-t \cdot |S|} \cdot H_S$. \end{proposition} \subsubsection{Probabilistic inequalities} \begin{theorem}\label{thm:hyper} Let $p: \mathbb{R}^n \rightarrow \mathbb{R}$ be a degree-$d$ polynomial. Then, for any $t>0$, $$ \Pr_{x} \big[|p(x) - \mathbf{E}[p(x)]| \ge t \cdot \sqrt{\mathsf{Var}[p]}\big] \leq d \cdot e^{-t^{2/d}}. $$ \end{theorem} \begin{theorem}\label{thm:combine-hyper} Let $a, b: \mathbb{R}^n \rightarrow \mathbb{R}$ be degree $d$ polynomials satisfying $\mathbf{E}_x [a(x) - b(x)]=0$ and $\mathsf{Var}[a-b] \le (\tau/d)^{3d} \cdot \mathsf{Var}[a]$. Then, $\Pr_{x}[\mathsf{sign}(a(x)) \not = \mathsf{sign}(b(x))] = O(\tau)$. \end{theorem} \subsubsection{Producing non-integral functions} Instead of producing functions $\{f^{(j)}_{\mathsf{junta}}\}_{1 \le i \le \ell}$ and $\{g^{(j)}_{\mathsf{junta}}\}_{1 \le i \le \ell}$ (in Theorem~\ref{thm:junta-strong}) with range $[k]$, we will actually produce functions $\{\tilde{f}^{(j)}_{\mathsf{junta}}\}_{1 \le i \le \ell}$ and $\{\tilde{g}^{(j)}_{\mathsf{junta}}\}_{1 \le i \le \ell}$ whose range will be close to $\Delta_{k,\epsilon}$. The next two lemmas show that functions with range $\Delta_{k,\epsilon}$ can be converted to non-interactive simulation strategies with range $[k]$ with nearly the same guarantee. More precisely, we show that given $f', g' : \mathbb{R}^n \rightarrow \Delta_{k,\epsilon}$, there are functions $f,g: \mathbb{R}^n \rightarrow [k]$ such that $\mathbf{E}[f] \approx \mathbf{E}[f']$, $\mathbf{E}[g] \approx \mathbf{E}[g']$ and for any $1 \le j_1, j_2 \le k$, $\mathbf{E}[f_{j_1} P_t g_{j_2}] \approx \mathbf{E}[f'_{j_1} P_t g'_{j_2}]$. To define this, let us adopt the notation that given a point $x \in \mathbb{R}^k$, $\mathsf{Proj}(x)$ denotes the closest point to $x$ in $\Delta_k$ in Euclidean distance. \begin{lemma}~\label{lem:round2} Let $f : \mathbb{R}^n \rightarrow \mathbb{R}^k$ which satisfies the following two conditions: \begin{enumerate} \item $\Pr_{x} [f(x) \not \in \Delta_{k,\delta}] \le \delta$. \item For all $x$, $\Vert f(x) \Vert_\infty \le k$. \end{enumerate} Then, there is a function $f_1: \mathbb{R}^n \rightarrow \Delta_k$ such that $\Vert f-f_1 \Vert_1 = O(k \cdot \delta)$. \end{lemma} \begin{proof} Define $f_1 = \mathsf{Proj}(f)$. Note that if $x$ is such that $f(x) \in \Delta_{k,\delta}$, then by definition, $\Vert f_1(x) -f(x) \Vert_1 \le \delta$. On the other hand, for any $x$, $\Vert f(x) -f_1(x) \Vert_1 \le k$. This proves the claim. \end{proof} \begin{lemma}~\label{lem:round3} Let $f_1, g_1 : \mathbb{R}^n \rightarrow \Delta_k$. Then, there exist (explicitly defined) $f_2, g_2: \mathbb{R}^{n+2} \rightarrow [k]$ such that \begin{enumerate} \item $\mathbf{E}[f_2 ] = \mathbf{E}[f_1]$ and $\mathbf{E}[g_2 ] = \mathbf{E}[g_1]$. \item For any $1 \le j, \ell \le k$, $$ \mathbf{E}[ f_{1,j} P_t g_{1,\ell} ]=\mathbf{E}[ f_{2,j} P_t g_{2,\ell}]. $$ \end{enumerate} {Further, the function $f_2$ (resp. $g_2$) is dependent only on $f_1$ (resp. $g_1$).} \end{lemma} \begin{proof} Let $z = (x, z_1, z_2)$ where $x \in \mathbb{R}^n$ and $z_1, z_2 \in \mathbb{R}$. For any $y \in \Delta_k$, let us divide $\mathbb{R}$ into $k$ intervals $S_1, \ldots, S_k$ such that for $z \sim \gamma$, $\Pr[z \in S_i] = y_i$. For $y \in \Delta_k$ and $z' \in \mathbb{R}$, $\mathsf{Part}(y,z) = i$ if $z' \in S_i$. Define $f_2: \mathbb{R}^{n+2} \rightarrow [k]$ as \[ f_2(z) =f_2(x,z_1,z_2) = \mathsf{Part}(f_1(x), z_1). \] \[ g_2(z) =g_2(x,z_1,z_2) = \mathsf{Part}(g_1(x), z_2). \] We will now verify the claimed properties. First of all, observe that the codomain of $f_2$ and $g_2$ is indeed $k$. Second, by definition, it is easy to follow that $\mathbf{E}[f_1]= \mathbf{E}[f_2]$ and $\mathbf{E}[g_1]= \mathbf{E}[g_2]$. Finally, note that $$ \mathbf{E}[ f_{1,j} P_t g_{1,\ell} ]= \mathbf{E}_{({\bf X}^n, {\bf Y}^n) \sim {\bf P}^n}[ f_{1,j}({\bf X}^n) g_{1,\ell}({\bf Y}^n) ]. $$ On the other hand, suppose $z_1, z_2 \sim \gamma$. Then, $$ \Pr_{z_1, z_2 \sim \gamma} [f_2(x,z_1, z_2) = j \ \wedge \ g_2(y,z_1, z_2) = \ell] = f_{1,j}(x) g_{1,\ell}(y). $$ Thus, we obtain that $$ \mathbf{E}[ f_{2,j} P_t g_{2,\ell} ] = \mathbf{E}_{({\bf X}^n, {\bf Y}^n) \sim {\bf P}^n} [f_{1,j}({\bf X}^n) g_{1,\ell} ({\bf Y}^n)] = \mathbf{E}[ f_{1,j} P_t g_{1,\ell} ]. $$ \end{proof} \subsection{Proof strategy for the main theorem} To describe the proof strategy for the main section, we first define a class of $k$-ary functions called \emph{polynomial plurality functions} (PPFs) which are closely related to the multivariate PTFs defined in the introduction but are somewhat different. For this, let us first define the function $\arg \max$ as follows \begin{definition} $\arg \max : \mathbb{R}^k \rightarrow \mathbb{R}^k$ is defined as \begin{equation*} \arg \max (x_1, \ldots, x_k) = \begin{cases} \mathbf{e}_i \ \ &\text{if } x_i > x_j \ \textrm{ for all } j\not =i \\ 0 &\textrm{otherwise} \\ \end{cases}\end{equation*} \end{definition} \begin{definition} A function $f: \mathbb{R}^n \rightarrow \mathbb{R}^k$ is said to be a PPF of degree-$d$ if there exists a polynomial $p: \mathbb{R}^n \rightarrow \mathbb{R}$ of degree $d$ and an index $1 \le j \le x$ such that $f= \arg \max(z)$ where $z_i = \delta_{i=j} \cdot p(x)$. Given polynomial $p: \mathbb{R}^n \rightarrow \mathbb{R}$ and $ 1 \le j \le k$, we define the function $\mathsf{PPF}_{p, j}$ as \[ \mathsf{PPF}_{p, j}(x) = \arg \max \big(\underbrace{0, \ldots, 0}_{(j-1) \textrm{ times}}, p(x) , \underbrace{0, \ldots, 0}_{(n-j) \textrm{ times}} \big). \] \end{definition} ~\\The following is a basic fact about PPFs. \begin{fact}~\label{fact:balanced} For any PPF $f$ of degree $d$, if $f=\mathsf{PPF}_{p, j}$, we can assume without loss of generality that $\mathsf{Var}(p)=1$. Further, by changing $f$ in at most $\delta$ fraction of places, we can assume that $|\mathbf{E}[p(x) ]| \le d \cdot \log^{d/2}(1/\delta)$. Such a PPF is said to be a $(d,\delta)$-balanced PPF. \end{fact} \begin{proof} The fact about variance follows simply by scaling. To bound $|\mathbf{E}[p(x) ]|$, note that if $|\mathbf{E}[p(x)]| > d \cdot \log^{d/2}(1/\delta)$, then $\Pr_x [\mathsf{sign}(p(x)) = \mathsf{sign}(\mathbf{E}[p(x)])] \ge 1-\delta$ (using Theorem~\ref{thm:combine-hyper}). Thus, if we set $q(x) = p(x) - \mathbf{E}[p(x)] + d \cdot \log^{d/2}(1/\delta) \cdot \mathsf{sign}(\mathbf{E}[p(x)])$, then $\Pr_x [p(x) \not = q(x)] \le \delta$. The PPF defined as $\mathsf{PPF}_{q,j}$ satisfies all the desired properties. \end{proof} To prove our main theorem (Theorem~\ref{thm:junta-strong}), we will prove the following two intermediate results. \begin{lemma}~\label{lem:smoothing} For $1 \le i \le \ell$, let $f^{(i)}, g^{(i)}: \mathbb{R}^n \rightarrow [k]$ such that $\mathbf{E}[f^{(i)}] = \boldsymbol{\mu}^{(i)}_f$ and $\mathbf{E}[g^{(i)}]= \boldsymbol{\mu}^{(i)}_g$. Then, for any $t>0$, $\delta>0$, $d_0 = d_0(t,k,\delta) = (2/t) \cdot \log( k^2/\delta)$ and $1\le i \le \ell$, there are functions $f^{(i)}_1, g^{(i)}_1: \mathbb{R}^n \rightarrow \mathbb{R}^k$ which satisfy the following conditions: \begin{enumerate} \item For any $x \in \mathbb{R}^n$ and $1 \le i \le \ell$, $f^{(i)}_1(x), g^{(i)}_1(x)$ always lies in the positive orthant. \item For any $x \in \mathbb{R}^n$ and $1 \le i \le \ell$, $\Vert f^{(i)}_1(x) \Vert_\infty , \Vert g^{(i)}_1(x) \Vert_\infty\le 1$. \item For $ 1 \le i \le \ell$, $\Pr_{x} [f^{(i)}_1(x) \not \in \Delta_{k,k\delta/2}]\le\delta/2$ and $\Pr_{x} [g^{(i)}_1(x) \not \in \Delta_{k,k\delta/2}] \le \delta/2$. \item For $ 1 \le i \le \ell$, $|\mathbf{E}[f^{(i)}_1] - \boldsymbol{\mu}^{(i)}_f|,\ |\mathbf{E}[g^{(i)}_1] - \boldsymbol{\mu}^{(i)}_g| =O(k \delta)$. \item For $ 1 \le i,j \le \ell$ and for any $1 \le s_1, s_2 \le k$, $|\mathbf{E}[ f^{(i)}_{1,s_1} P_t g^{(j)}_{1,s_2} ] -\mathbf{E}[ f^{(i)}_{s_1} P_t g^{(j)}_{s_2} ]| =O(k \cdot \delta)$. \item For $1 \le i \le \ell$, $f^{(i)}_1$ and $g^{(i)}_1$ are of the following form. There are degree-$d_0$ polynomials $\{p^{(i)}_{s,j,1}\}_{1\le i \le \ell, 1\le s \le k, 1 \le j \le m}$ and $\{p^{(i)}_{s,j,2}\}_{1\le i \le \ell, 1\le s \le k, 1 \le j \le m}$ \[ f^{(i)}_1 = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{p^{(i)}_{s,j,1},j}(x) \ , \ g^{(i)}_1 = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{p^{(i)}_{s,j,2},j}(x), \] such that the resulting PPFs $\mathsf{PPF}_{p^{(i)}_{s,j,1},j}(x)$ and $\mathsf{PPF}_{p^{(i)}_{s,j,2},j}(x)$ are $(d_0,\delta)$-balanced PPFs. Here $m= O(1/\delta)$. \end{enumerate} {\red{Further, the function $f^{(i)}_1$ (resp. $g^{(i)}_1$) is dependent only on $f^{(i)}$ (resp. $g^{(i)}$), $t$, $k$ and $\delta$. }} \end{lemma} \begin{lemma}~\label{lem:junta-construction} Let $\{p^{(i)}_{s,j,1}\}_{1 \le i \le \ell, 1\le s \le k, 1 \le j \le m}$ and $\{p^{(i)}_{s,j,2}\}_{1 \le i \le \ell,1\le s \le k, 1 \le j \le m}$ be degree-$d_0$ polynomials. For $1 \le i \le \ell$, let $f^{(i)}_1, g^{(i)}_1: \mathbb{R}^n \rightarrow \mathbb{R}^k$ be defined as in Lemma~\ref{lem:smoothing} and satisfy the following two conditions: \begin{enumerate} \item For $1\le i \le \ell$, $1 \le s \le k$ and $1 \le j \le m$, all the PPFs $\mathsf{PPF}_{p^{(i)}_{s,j,1},j}$ and $\mathsf{PPF}_{p^{(i)}_{s,j,2},j}$ are $(d_0,\delta)$-balanced PPFs. \item For $1\le i \le \ell$, $\Pr_{x} [f^{(i)}_1(x) \not \in \Delta_{k,\delta}] \le \delta$ and $\Pr_{x} [g^{(i)}_1(x) \not \in \Delta_{k,\delta}] \le \delta$. \end{enumerate} Then, there exists an explicit constant $n_0 = n_0 (d_0,k,\delta,\ell)$ such that there are polynomials $\{r_{s,j,1}^{(i)}\}_{1 \le i \le \ell, 1 \le s \le k, 1 \le j \le m}$ and $\{r_{s,j,2}^{(i)}\}_{1 \le i \le \ell,1 \le s \le k, 1 \le j \le m}$ satisfying the following conditions: For $1 \le i \le \ell$, let us define the functions $f^{(i)}_{\mathsf{junta}}, g^{(i)}_{\mathsf{junta}}: \mathbb{R}^{n_0} \rightarrow \mathbb{R}^k$ defined as \[ f^{(i)}_{\mathsf{junta}} = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{r^{(i)}_{s,j,1},s}(x) \ , \ g^{(i)}_{\mathsf{junta}} = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{r^{(i)}_{s,j,2},s}(x), \] Then, they satisfy the following three conditions: For all $1 \le i \le \ell$, \begin{enumerate} \item $ \Vert \mathbf{E}[f^{(i)}_{\mathsf{junta}}] - \mathbf{E}[f^{(i)}_1] \Vert_1 \le \delta$ and $ \Vert \mathbf{E}[g^{(i)}_{\mathsf{junta}}] - \mathbf{E}[g^{(i)}_1] \Vert_1 \le \delta$. \item $\Pr_{x} [f^{(i)}_{\mathsf{junta}}(x) \not \in \Delta_{k,\sqrt{\delta}}] \le \sqrt{\delta}$ and $\Pr_{x} [g^{(i)}_{\mathsf{junta}}(x) \not \in \Delta_{k,\sqrt{\delta}}] \le \sqrt{\delta}$. \item For any $1 \le i, j \le \ell$, $1 \le s_1, s_2 \le k$, $|\mathbf{E}[ f^{(i)}_{1,s_1} P_t g^{(j)}_{1,s_2} ] -\mathbf{E}[ f^{(i)}_{\mathsf{junta},s_1} P_t g^{(j)}_{\mathsf{junta},s_2} ]| \le \delta$. \end{enumerate} \end{lemma} {\red{\textbf{Proof of Theorem~\ref{thm:junta-strong}:}The proof of Theorem~\ref{thm:junta-strong} follows by applying Lemma~\ref{lem:smoothing} on the set $\{f^{(i)} \cup g^{(i)}\}_{1 \le i \le \ell}$ and subsequently applying Lemma~\ref{lem:junta-construction}. While the range of functions produced by $\{f_{\mathsf{junta}}^{(i)} \cup g_{\mathsf{junta}}^{(i)}\}_{1 \le i \le \ell}$ is not $\Delta_k$, by applying Lemma~\ref{lem:round2} and Lemma~\ref{lem:round3}, we can rectify this issue. We note here that the functions obtained in this process, namely $\{f_{\mathsf{junta}}^{(i)} \cup g_{\mathsf{junta}}^{(i)}\}_{1 \le i \le \ell}$ are explicit. Namely, the functions obtained before applying Lemma~\ref{lem:round2} and Lemma~\ref{lem:round3} are low-degree PPFs. Lemma~\ref{lem:round2} applies a projection on to the standard simplex $\Delta_k$. Likewise, Lemma~\ref{lem:round3} also produces an explicit function as its output. We now explain why $\{f_{\mathsf{junta}}^{(i)} \cup g_{\mathsf{junta}}^{(i)}\}_{1 \le i \le \ell}$ satisfy the stated guarantees. In particular, overloading notation, let us denote the functions obtained by application of Lemma~\ref{lem:round2} and Lemma~\ref{lem:round3} as $f_{\mathsf{junta}}^{(i)}$ and $ g_{\mathsf{junta}}^{(i)}$. Then, we see that \begin{equation}\Vert \mathbf{E}[f^{(i)}_{\mathsf{junta}}] - \mathbf{E}[f^{(i)}_1] \Vert_1 \le O (k \cdot \sqrt{\delta}), \ \Vert \mathbf{E}[g^{(i)}_{\mathsf{junta}}] - \mathbf{E}[g^{(i)}_1] \Vert_1 \le O(k \cdot \sqrt{\delta}), \end{equation} \begin{equation}~\label{eq:tv-dist} \textrm{For any }1 \le i, j \le \ell, \ 1 \le s_1, s_2 \le k, \ |\mathbf{E}[ f^{(i)}_{1,s_1} P_t g^{(j)}_{1,s_2} ] -\mathbf{E}[ f^{(i)}_{\mathsf{junta},s_1} P_t g^{(j)}_{\mathsf{junta},s_2} ]| \le \delta \end{equation} Note that the functions $\{f^{(i)} \cup g^{(i)}\}_{1 \le i \le \ell}$ have arity $n_0$. Further, observe that for $1 \le s_1, s_2 \le k$ and $1 \le i, j \le \ell$, \begin{eqnarray*} \Pr [f_{\mathsf{junta}}^{(i)}({\bf X}^{n_0}) = s_1 \ \wedge \ g_{\mathsf{junta}}^{(j)}({\bf Y}^{n_0}) = s_2] &=& \mathbf{E}[f^{(i)}_{\mathsf{junta},s_1} P_t g^{(j)}_{\mathsf{junta},s_2} ] \ \textrm{and} \\ \Pr [f^{(i)}({\bf X}^{n}) = s_1 \ \wedge \ g^{(j)}({\bf Y}^{n}) = s_2] &=& \mathbf{E}[f^{(i)}_{s_1} P_t g^{(j)}_{s_2} ]. \end{eqnarray*} Thus, for $1\le s_1, s_2 \le k$, $$ \big| \Pr [f_{\mathsf{junta}}^{(i)}({\bf X}^{n_0}) = s_1 \ \wedge \ g_{\mathsf{junta}}^{(j)}({\bf Y}^{n_0}) = s_2]- \Pr [f^{(i)}({\bf X}^{n}) = s_1 \ \wedge \ g^{(j)}({\bf Y}^{n}) = s_2]\big| \le \delta. $$ This immediately implies that $$d_{\mathrm TV}\big(\big(f_{\mathsf{junta}}^{(i)}({\bf X}^{n_0}) , g_{\mathsf{junta}}^{(j)}({\bf Y}^{n_0})\big),\big(f_{}^{(i)}({\bf X}) , g_{}^{(j)}({\bf Y})\big)\big) = O(k^2 \delta),$$ which finishes the proof. }} \section{Proof of Lemma~\ref{lem:smoothing}} The proof of Lemma~\ref{lem:smoothing} shall proceed in several steps. Note that Lemma~\ref{lem:smoothing} claims existence of $\{f_1^{(i)}\}$ and $\{g_1^{(i)}\}$ which satisfies six different properties. The functions $\{f^{(i)}\}$ and $\{g^{(i)}\}$ themselves satisfy the first five properties and thus, the only non-trivial task that remains is to achieve the sixth property. The sixth property will be achieved by gradual modification of $\{f^{(i)}\}$ and $\{g^{(i)}\}$ in a sequence of steps which are explained below. \begin{enumerate} \item Corollary~\ref{corr:Boosting} allows us to replace $f^{(i)}$ (resp. $g^{(i)}$) with $f_{\mathsf{sm}}^{(i)}$ (resp. $g_{\mathsf{sm}}^{(i)}$), which is the projection onto $\Delta_k$ of a polynomial, and which shares the same low-degree Hermite expansion as $f^{(i)}$ (resp. $g^{(i)}$). Coupled with Claim~\ref{clm:noise-degree}, this shows that if $f^{(i)}$ is replaced by $f_{\mathsf{sm}}^{(i)}$ and $g^{(i)}$ is replaced by $g_{\mathsf{sm}}^{(i)}$, then the first five properties in Lemma~\ref{lem:smoothing} hold. On the other hand, note that while $f_{\mathsf{sm}}^{(i)}$ and $g_{\mathsf{sm}}^{(i)}$ do not have the full structure claim in Property~6, they do have some resemblance to PPFs. Corollary~\ref{corr:Boosting} is the technically most innovative part of the proof and in turn relies on Lemma~\ref{lem:Boosting}. {\red{A crucial point for the application to non-interactive simulation is that the construction of $f_{\mathsf{sm}}^{(i)}$ (resp. $g_{\mathsf{sm}}^{(i)}$) is dependent only on $f^{(i)}$ (resp. $g^{(i)}$) and the error parameters. }} \item Applying Bernstein-type approximations for Lipschitz functions in terms of low-degree polynomials, Lemma~\ref{lem:smoothing-1} shows that $f_{\mathsf{sm}}^{(i)}$ and $g_{\mathsf{sm}}^{(i)}$ can be replaced by $f_{\mathsf{sm}}^{'(i)}$ and $g_{\mathsf{sm}}^{'(i)}$ where each coordinate of $f_{\mathsf{sm}}^{'(i)}$ and $g_{\mathsf{sm}}^{'(i)}$ is a low-degree multivariate polynomial. {\red{Again, crucially for the application to non-interactive simulation, the function $f_{\mathsf{sm}}^{'(i)}$ (resp. $g_{\mathsf{sm}}^{'(i)}$) is dependent only on $f_{\mathsf{sm}}^{(i)}$ (resp. $g_{\mathsf{sm}}^{(i)}$) and the error parameters.}} \item Finally, the functions $f_{\mathsf{sm}}^{'(i)}$ and $g_{\mathsf{sm}}^{'(i)}$ are changed to $f_1^{(i)}$ and $g_1^{(i)}$ which are linear combinations of PPFs (as promised in Lemma~\ref{lem:smoothing}) using some simple probabilistic observations. {\red{Again, the conversion of $f_{\mathsf{sm}}^{'(i)}$ to $f_1^{(i)}$ is only dependent on $f_{\mathsf{sm}}^{'(i)}$ and desired error parameters. }} \end{enumerate} \subsection{Projections of polynomials} We begin with the first step described above. The first lemma relates the (by now, well-known) connection between the low-degree Hermite expansion of a function and its noise stability. In particular, it shows that if a pair of functions $(f^{(1)}, g^{(1)})$ (whose range is $\Delta_k$) is replaced by another pair $(\underline{f}^{(1)}, \underline{g}^{(1)})$ such that low-degree Hermite spectrum of $f^{(1)}$ (resp. $g^{(1)}$) is close to that of $\underline{f}^{(1)}$ (resp. $\underline{g}^{(1)}$) are close to each other, then for any $1 \le s_1, s_2 \le k$, $\mathbf{E}[f^{(1)}_{s_1} P_t g^{(1)}_{s_2}] \approx \mathbf{E}[\underline{f}^{(1)}_{s_1} P_t \underline{g}^{(1)}_{s_2}]$. \begin{claim}\label{clm:noise-degree} Let $f^{(1)}, g^{(1)} , \underline{f}^{(1)}, \underline{g}^{(1)} : \mathbb{R}^n \rightarrow \Delta_k$ such that for $d_1= d_1(\delta, t) = \frac{1}{t} \log (k^2/\delta)$ we have $$\mathsf{W}^{\le d_1} [ (f^{(1)}-\underline{f}^{(1)}) ] , \ \mathsf{W}^{\le d_1} [g^{(1)}-\underline{g}^{(1)}]\le \delta^2/k^4.$$ Then, $\sum_{1 \le s_1, s_2 \le k} | \mathbf{E}[ f^{(1)}_{s_1} P_{t} g^{(1)}_{s_2} ] - \mathbf{E}[ \underline{f}^{(1)}_{s_1} P_t \underline{g}^{(1)}_{s_2} ] | \le \delta$. \end{claim} \begin{proof} For any $1 \le s_1, s_2 \le k$, \begin{eqnarray*} \big| \mathbf{E}[f^{(1)}_{s_1} P_t g^{(1)}_{s_2}]-\mathbf{E}[\underline{f}^{(1)}_{s_1} P_t \underline{g}^{(1)}_{s_2}] \big| &\le& \big| \mathbf{E}[ (f^{(1)}_{s_1} - \underline{f}^{(1)}_{s_1}) P_t g^{(1)}_{s_2} ] \big| + \big| \mathbf{E}[ \underline{f}^{(1)}_{s_1} P_t (g^{(1)}_{s_2} - \underline{g}^{(1)}_{s_2}) ] \big| \end{eqnarray*} By using the self-adjointness of the noise operator and applying the Jensen's inequality, the first term can be bounded as \[ \big| \mathbf{E}[ (f^{(1)}_{s_1} - \underline{f}^{(1)}_{s_1}) P_t g^{(1)}_{s_2} ] \big| \le \sqrt{\mathbf{E}[P_t(f^{(1)} - \underline{f}^{(1)})_{s_1}^2]}\sqrt{\mathbf{E}[(g^{(1)})_{s_2}^2]} \le \sqrt{\mathbf{E}[P_t(f^{(1)}- \underline{f}^{(1)})_{s_1}^2]}. \] Similarly bounding $ \big| \mathbf{E}[ \underline{f}^{(1)}_{s_1} P_t (g^{(1)}_{s_2} - \underline{g}^{(1)}_{s_2}) ] \big| $, we obtain \[ \big| \mathbf{E}[ (f^{(1)}_{s_1} - \underline{f}^{(1)}_{s_1}) P_t g^{(1)}_{s_2} ] \big| + \big| \mathbf{E}[ \underline{f}^{(1)}_{s_1} P_t (g^{(1)}_{s_2} - \tilde{g}^{(1)}_{s_2}) ] \big| \le \sqrt{\mathbf{E}[P_t(f^{(1)}_{s_1} - \underline{f}^{(1)}_{s_1})^2]} + \sqrt{\mathbf{E}[P_t(g^{(1)}_{s_2} - \underline{g}^{(1)}_{s_2})^2]}. \] Now, applying the condition that $\mathsf{W}^{\le d_1} [ (f^{(1)}-f^{(2)}) ] \le \delta^2/k^4$, we get that $$ \mathbf{E}[\Vert P_t(f^{(1)} - \underline{f}^{(1)}) \Vert_2^2] \le \frac{\delta^2}{k^4} + e^{-2td_1} \cdot \mathbf{E}[\Vert (f^{(1)} - \underline{f}^{(1)}) \Vert_2^2] \le \frac{2 \delta^2}{k^4}.$$ The last inequality uses the fact that for all $x$, $\Vert f^{(1)}(x) - \underline{f}^{(1)}(x) \Vert_1 \le 1$. Likewise, we also get $\mathbf{E}[\Vert P_t(g^{(1)} - \underline{g}^{(1)}) \Vert_2^2 \leq 2 \delta^2/k^4$. Combining this, we obtain that for all $1 \le s_1, s_2 \le k$, \[ \big| \mathbf{E}[ f^{(1)}_{s_1} P_{t} g^{(1)}_{s_2} ] - \mathbf{E}[ \underline{f}^{(1)}_{s_1} P_t \underline{g}^{(1)}_{s_2} ] \big| \le \frac{2 \delta}{k^2}. \] Summing over all $1 \le s_1, s_2 \le k$, we get the stated bound. \end{proof} Next, we state the main technical lemma of this section. To state the lemma, we define the function $\mathsf{Proj}: \mathbb{R}^k \rightarrow \Delta_k$ such that $\mathsf{Proj}(x) = y$ if $y$ is the closest point (in Euclidean distance) to $x$ in $\Delta_k$. While the authors are aware that technically, we require $\mathsf{Proj}$ to be quantified by the parameter $k$, the relevant $k$ shall always be clear from the context. \begin{lemma}~\label{lem:Boosting} Let $F: \mathbb{R}^n \rightarrow \Delta_k$ and let $g_1, \ldots, g_m : \mathbb{R}^n \rightarrow \mathbb{R}^k$ be an orthonormal sequence of functions under the standard $n$-dimensional Gaussian measure $\gamma_n$. Here the function $g_1 : x \mapsto (1,\ldots, 1)$. Then, for any $\delta>0$, there exists a function $F_{\mathsf{proj}} : \mathbb{R}^n \rightarrow \Delta_k$ of the form $F_{\mathsf{proj}} = \mathsf{Proj} (\sum_{i=1}^m \kappa_i g_i)$ satisfying \[ \sum_{i=1}^m ({\bf E}[g_i F] - {\bf E}[g_i F_{\mathsf{proj}}])^2 \le \delta. \] Further, $\sum_{i=1}^m \Vert \kappa_i \Vert_2^2 \le \delta^{-2}$. \end{lemma} Before proving Lemma~\ref{lem:Boosting}, we first see why this lemma is useful. In particular, we have the following corollary. Essentially, the corollary says that given $f, g: \mathbb{R}^n \rightarrow \Delta_k$, there are functions $f_{\mathsf{sm}}$ and $g_{\mathsf{sm}}$ such that (i) the low-level Hermite spectrum of $f$ (resp. $g$) is close to $f_{\mathsf{sm}}$ (resp. $g_{\mathsf{sm}}$) (ii) Both $f_{\mathsf{sm}}$ and $g_{\mathsf{sm}}$ are obtained by applying the function $\mathsf{Proj}$ on a low-degree polynomial. In essence, we are obtaining \emph{simple} functions $f_{\mathsf{sm}}$ and $g_{\mathsf{sm}}$ which simultaneously (i) have the same low-level Hermite spectrum as $f$ and $g$ (ii) and have range $\Delta_k$. \begin{corollary}\label{corr:Boosting} Given function $f: \mathbb{R}^n \rightarrow [k]$, $d \in \mathbb{N}$ and error parameter $\delta>0$, there is a function $f_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$ which has the following properties: \begin{enumerate} \item The function $f_{\mathsf{sm}}$ has the following form: $$f_{\mathsf{sm}}(x) = \mathsf{Proj}\bigg(\sum_{|S| \le d} \alpha_{f,s} H_S(x)\bigg) ,$$ where $H_S(x)$ is the Hermite polynomial corresponding to the multiset $S$. \item $\sum_{|S| \le d} \Vert \alpha_{f,S} \Vert_2^2 \le \delta^{-2}$. \item Define $\beta_{f,S} = \mathbf{E}[f_{\mathsf{sm}} (x) \cdot H_S(x)]$. Then, $\sum_{|S| \le d} \Vert \beta_{f,S} - \alpha_{f,S} \Vert_2^2 \le \delta$. \end{enumerate} We note that for a scalar-valued function $H_S$ and a vector-valued function $f_{\mathsf{sm}}$, we compute $\mathbf{E}[f_{\mathsf{sm}} \cdot H_S]$ pointwise for each coordinate of the vector valued function $f_{\mathsf{sm}}$. \end{corollary} The proof of this corollary follows straightaway by instantiating Lemma~\ref{lem:Boosting} with $\{g_1, \ldots, g_m\} = \{H_{S}\}_{|S| \le d}$ with $F=f$ and $F=g$. \begin{proofof}{Lemma~\ref{lem:Boosting}} We will prove this lemma via an iterative argument. We will define a sequence of functions $\{F_t\}_{t \ge 0}$ iteratively such that for all $t \ge 0$, $F_t : \mathbb{R}^n \rightarrow \Delta_k$. Define the vector $\beta \in \mathbb{R}^m$ by $\beta_j = \langle F, g_j \rangle$. Also, for every $t \ge 0$, we will define $\beta_t\in \mathbb{R}^m$ by $\beta_{t,j} = \langle F_t, g_j \rangle$. The iterative process has the following property: If for any $t$, $\Vert \beta_t - \beta \Vert_2^2 \le \delta$, then we terminate the process. Else, we modify $F_t$ to obtain the function $F_{t+1}$. We now define the initial function $F_0$ as well as the modification to obtain $F_{t+1}$ from $F_t$ (when $t \ge 0$). The function $F_0 : \mathbb{R}^n \rightarrow \Delta_k$ is defined as $F_0 : x \rightarrow (1/k, \ldots, 1/k)$. Next, given $F_t$, we define $F_{t+1}$. To do this, we will also need to define an auxiliary sequence of functions $\{G_t \}_{t \ge 0}$ where $G_0 = F_0$. The iterative process is defined in Figure~\ref{fig:DS}. \begin{figure}[htb] \hrule \vline \begin{minipage}[t]{0.98\linewidth} \vspace{10 pt} \begin{center} \begin{minipage}[h]{0.95\linewidth} \vspace{3 pt} \underline{\textsf{Description of iterative process }} \begin{enumerate} \item Define $\rho_t = \Vert \beta_t - \beta \Vert_2$. \item If $\rho_t^2 \le \delta$, then stop the process. Else, we define $J_t = \sum_{j=1}^m (\beta -\beta_t)_j \cdot g_j$. \item Define $G_{t+1} = G_t+ J_t/2$. Define $F_{t+1} = \mathsf{Proj}(G_{t+1})$ and $t \leftarrow t+1$. Go to Step 1. \end{enumerate} \vspace{5 pt} \end{minipage} \end{center} \end{minipage} \hfill \vline \hrule \caption{Iterative process describing the sequence $\{F_t\}$} \label{fig:DS} \end{figure} ~\\ It is clear that if this process terminates at step $t=t_0$, then the function $F_{\mathsf{proj}}= F_{t_0}$ satisfies the required properties. Thus, we now need to bound the convergence rate of the process. To do this, we introduce a potential function $\Psi(t)$ defined as follows: \[ \Psi(t) = \mathbf{E}[ \langle F - F_t , F - 2 G_t + F_t \rangle]. \] The basic observation here is that $\Psi(0) = O(1)$. We will prove two main lemmas. The first will prove that in every iteration of the process in Figure~\ref{fig:DS}, $\Psi(t)$ decreases by a fixed amount. The second is that $\Psi(t)$ is always non-negative. These two facts, in conjunction, automatically imply an upper bound on the maximum number of steps in the algorithm. \begin{claim}~\label{clm:potential-decrease} $$ \mathbf{E}[\langle F - F_t, J_t \rangle] = \rho_t^2. $$ \end{claim} \begin{proof} By orthogonality of the functions $\{g_j \}_{j=1}^m$, $$ \mathbf{E}[\langle F - F_t, J_t \rangle] = \sum_{j=1}^m (\beta -\beta_t)_j \mathbf{E}[\langle g_j , F- F_t \rangle] = \sum_{j=1}^m (\beta -\beta_t)_j \cdot (\beta-\beta_t)_j = \Vert \beta - \beta_t \Vert_2^2. $$ \end{proof} We now recall a basic fact about projective maps (see, e.g.~\cite[Theorem 3]{CheneyGoldstein:59}). \begin{fact}~\label{fact:convex} Let $C$ be a closed, convex set and let $\mathsf{Proj}_C : \mathbb{R}^n \rightarrow C$ be defined as $x \mapsto \arg \min_{y \in C} \Vert x - y \Vert_2$. Then the map $\mathsf{Proj}_C$ is uniquely defined, and always contractive i.e. for any $z, z' \in \mathbb{R}^n$, $\Vert \mathsf{Proj}_C (z) - \mathsf{Proj}_{C}(z') \Vert_2 \le \Vert z- z' \Vert_2$. Moreover, for any $x \in C$ and any $z \in {\bf R}^n$, $\langle z - \mathsf{Proj}_C(z), x - \mathsf{Proj}_C(z)\rangle \le 0$. \end{fact} \begin{claim}~\label{clm:non-negative} For all $t$, $\Psi(t) \geq 0$. \end{claim} \begin{proof} \begin{eqnarray*} \Psi(t) &=& \mathbf{E}[ \langle F - F_t , F - 2 G_t + F_t \rangle] \\ &=& \mathbf{E}[ \langle F - F_t , F - F_t \rangle] + 2 \cdot \mathbf{E}[ \langle F - F_t , F_t - G_t \rangle] . \end{eqnarray*} The first term is clearly non-negative. The second is non-negative by Fact~\ref{fact:convex}, taking $z = G_t$ and $x = F$. \end{proof} The next lemma shows that the potential function always decreases by a fixed quantity. \begin{lemma}~\label{lem:descent} $$ \Psi(t+1) - \Psi(t) \le -\frac{\rho_t^2}{4}. $$ \end{lemma} \begin{proof} \begin{eqnarray*} \Psi(t+1) - \Psi(t) &=& \mathbf{E}[ \langle F - F_{t+1} , F - 2 G_{t+1} + F_{t+1} \rangle]- \mathbf{E}[ \langle F - F_t , F - 2 G_t + F_t \rangle] \\ &=& \mathbf{E}[\langle F - F_t, 2 (G_t - G_{t+1}) \rangle] + \mathbf{E}[\langle F_{t+1} - F_t , 2 G_{t+1} - F_t - F_{t+1} \rangle] \\ &=& \mathbf{E}[\langle F - F_t, - J_t \rangle] + \mathbf{E}[\langle F_{t+1} - F_t, 2 G_{t+1} - F_t - F_{t+1} \rangle] \\ &=& - \rho_t^2 + \mathbf{E}[\langle F_{t+1} - F_t , 2 G_{t+1} - F_t - F_{t+1} \rangle] ~\textrm{(applying Claim~\ref{clm:potential-decrease})} \\ &=& -\rho_t^2 + 2 \cdot \mathbf{E}[\langle F_{t+1} - F_t , G_{t+1} - F_{t+1} \rangle] + \mathbf{E}[\langle F_{t+1} - F_t , F_{t+1} - F_{t} \rangle] \\ &=& -\rho_t^2 + \mathbf{E}[\Vert F_{t+1} - F_{t} \Vert_2^2] + 2 \cdot \mathbf{E}[\langle F_{t+1} - F_t , G_{t+1} - F_{t+1} \rangle] \\ &\le& -\rho_t^2 + \mathbf{E}[ \Vert G_{t+1} - G_{t} \Vert_2^2 ] + 2 \cdot \mathbf{E}[\langle F_{t+1} - F_t , G_{t+1} - F_{t+1} \rangle]~ \textrm{(applying Fact~\ref{fact:convex})} \\ &=& - \frac{3 \rho_t^2}{4} + 2 \cdot \mathbf{E}[\langle F_{t+1} - F_t , G_{t+1} - F_{t+1} \rangle] \end{eqnarray*} It remains to show that $\mathbf{E}[\langle F_{t+1} - F_t , G_{t+1} - F_{t+1} \rangle] \le \frac{\rho_t^2}{4}$. Indeed, the Cauchy-Schwarz inequality yields \begin{align*} \|F_{t+1} - F_t\|_2 \|G_{t+1} - G_t\|_2 &\ge \langle G_{t+1} - G_t, F_{t+1} - F_t \rangle \\ &= \langle G_{t+1} - F_{t+1}, F_{t+1} - F_t \rangle + \langle F_{t+1} - F_t, F_{t+1} - F_t\rangle + \langle F_t - G_t, F_{t+1} - F_t\rangle \end{align*} In the last line above, the second term is obviously non-negative. Moreover, the third term is non-negative by Fact~\ref{fact:convex} (take $z = G_t$ and $x = F_{t+1}$). Hence, \[ \langle G_{t+1} - F_{t+1}, F_{t+1} - F_t \rangle \le \|F_{t+1} - F_t\|_2 \|G_{t+1} - G_t\|_2 \le \|G_{t+1} - G_t\|_2^2 = \frac{\rho_t^2}{4}, \] where the second inequality follows from Fact~\ref{fact:convex}. \end{proof} Combining Claim~\ref{clm:non-negative} and Lemma~\ref{lem:descent}, we obtain that the iterative process described in Figure~\ref{fig:DS} stops in at most $4/\delta$ steps. If the above iteration stops after $t=t_0$ steps, we let $F_{\mathsf{proj}}= F_{t_0}$. Note that $ F_{\mathsf{proj}} = \mathsf{Proj}(\sum_{0 \le t < t_0} J_t/2)$. Thus, it is clear that $F_{\mathsf{proj}} = \mathsf{Proj}(\sum_{i=1}^m \kappa_i g_i)$. To bound $\sum_{i=1}^m \Vert \kappa_i \Vert_2^2$, note that $$\sum_{i=1}^m \Vert \kappa_i \Vert_2^2 = \Vert \sum_{0 \le t < t_0} J_t/2 \Vert_2^2 \le t_0 \cdot \sum_{0 \le t < t_0} \Vert J_t/2\Vert_2^2 \le t_0^2 \cdot \max_t \Vert J_t/2 \Vert_2^2 \le t_0^2.$$ The very last inequality uses the fact that $\Vert J_t \Vert_2 \le \Vert (F_t - F) \Vert_2 \le 1$. Plugging the upper bound of $O(1/\delta^2)$ on $t_0^2$, we obtain that $\sum_{i=1}^m \Vert \kappa_i \Vert_2^2 \le O(1/\delta^2)$. This concludes the proof. \end{proofof} \begin{corollary}~\label{corr:fsm} For $t>0$, error parameter $\delta>0$ and any function $f: \mathbb{R}^n \rightarrow [k]$, there is a function $f_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$ such that for $d =(2/t) \cdot \log(k^2/\delta)$, we have the following: \begin{enumerate} \item $\Vert \mathbf{E}[f_{\mathsf{sm}}] -\mathbf{E}[f] \Vert_1 \le \delta$. \item The function $f_{\mathsf{sm}}=\mathsf{Proj}(p_{f,1}(x), \ldots, p_{f,k}(x))$ where for all $1 \le s \le k$, $p_{f,s} : \mathbb{R}^n \rightarrow \mathbb{R}$ are polynomials of degree $d$ and $\mathsf{Var}(p_{f,s}) \le k^8/\delta^4$. \item For any $g: \mathbb{R}^n \rightarrow [k]$ and the corresponding function $g_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$, we have $\sum_{1 \le s_1, s_2 \le k} |\mathbf{E}[f_{\mathsf{sm},s_1} P_t g_{\mathsf{sm},s_2}]-\mathbf{E}[f_{s_1} P_t g_{s_2}]| \leq \delta$. \end{enumerate} \end{corollary} \begin{proof} Given the function $f: \mathbb{R}^n \rightarrow [k]$, we apply Corollary~\ref{corr:Boosting} to obtainthe function $f_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$ where \[ f_{\mathsf{sm}}=\mathsf{Proj}(p_{f,1}(x), \ldots, p_{f,k}(x)), \] where for all $1 \le s \le k$, $p_{f,s}: \mathbb{R}^n \rightarrow \mathbb{R}$ are polynomials of degree $d = (1/t) \cdot \log(k^2/\delta)$ such that $\mathsf{W}^{\le d} [(f_{\mathsf{sm}} - f)] \le \delta^2/k^4$. Further, for each $1 \le s \le k$, $\mathsf{Var}(p_{f,s}) \le (k^8/\delta^4)$. This immediately implies both items 1 and 2. To prove Item 3, note that we also have $\mathsf{W}^{\le d} [(g_{\mathsf{sm}} - g)] \le \delta^2/k^4$. Applying Claim~\ref{clm:noise-degree}, we obtain that $\sum_{1 \le s_1, s_2 \le k} |\mathbf{E}[f_{\mathsf{sm},s_1} P_t g_{\mathsf{sm},s_2}]-\mathbf{E}[f_{s_1} P_t g_{s_2}]| \leq \delta$. This proves Item 3. \end{proof} This completes the first step in the outline of Lemma 5: we have replaced arbitrary functions by projections of polynomials. \subsection{Bernstein approximation} The next step in the proof of Lemma 5 is the removal of the projection. The basic idea is just to approximate the projection map by a polynomial. Then, the projection of a polynomial becomes the composition of two polynomials, which is still a polynomial. \begin{definition} For $0 \le k \le d$, efine $p_{k,d}(x) = \binom{d}{k} x^k (1-x)^{d-k}$. For a function $f: [0, 1]^\ell \to \mathbb{R}$, define the polynomial $\mathsf{BP}_{f, d_1, \dots, d_\ell}$ by \[ \mathsf{BP}_{f, d_1, \dots, d_\ell}(x) = \sum_{k_1, \dots, k_\ell} f\left(\frac{k_1}{d_1}, \dots, \frac{k_\ell}{d_\ell}\right) p_{k_1,d_1}(x_1) \cdots p_{k_\ell,d_\ell}(x_\ell). \] We call $\mathsf{BP}_{f,d_1, \dots, d_\ell}$ the multivariate Bernstein approximation for $f$ with degrees $(d_1, \dots, d_\ell)$. \end{definition} \begin{theorem}\label{thm:Bernstein}\textbf{Multivariate Bernstein approximations} Let $f: [0,1]^\ell \rightarrow \mathbb{R}$ be a $L$-Lipschitz function in $[0,1]^{\ell}$. In other words, $\Vert f(x) - f(y) \Vert_2 \le L \cdot \Vert x - y \Vert_2$. Then $\mathsf{BP}_{f, d_1, \ldots, d_\ell}$ satisfies the inequality \[ \sup_{z \in [0,1]^{\ell}} \big| f(z) - \mathsf{BP}_{f, d_1, \ldots, d_\ell}(z) \big| \le \frac{L}{2} \cdot \bigg( \sum_{j=1}^\ell \frac{1}{d_j}\bigg)^{1/2} \] \end{theorem} The proof of Theorem~\ref{thm:Bernstein} is folklore; we provide one for completeness. \begin{proof} Fix $z \in [0, 1]^\ell$. Note that each $p_{k_i,d_i}(z_i)$ is non-negative, and that $\sum_{k_i=0}^{d_i} p_{k_i,d_i}(z_i) = 1$. Hence, \begin{align*} f(z) - \mathsf{BP}_{f,d_1, \dots, d_\ell}(z) & = \sum_{k_1, \dots, k_\ell} \left[f(z) - f\left(\frac{k_1}{d_1}, \dots, \frac{k_\ell}{d_\ell}\right)\right] p_{k_1,d_1}(z_1) \cdots p_{k_\ell,d_\ell}(z_\ell) \\ & \le L \sum_{k_1, \dots, k_\ell} \left\|z - \left(\frac{k_1}{d_1}, \dots, \frac{k_\ell}{d_\ell}\right)\right\|_2 p_{k_1,d_1}(z_1) \cdots p_{k_\ell,d_\ell}(z_\ell) \\ & \le L \left[\sum_{k_1, \dots, k_\ell} \left\|z - \left(\frac{k_1}{d_1}, \dots, \frac{k_\ell}{d_\ell}\right)\right\|_2^2 p_{k_1,d_1}(z_1) \cdots p_{k_\ell,d_\ell}(z_\ell)\right]^{1/2} \\ & = L \left[\sum_{i=1}^\ell \sum_{k_i=0}^{d_i} \Big(z_i - \frac{k_i}{d_i}\Big)^2 p_{k_i,d_i}(z_i)\right]^{1/2}. \end{align*} Finally, note that $\sum_{k=0}^d (x - k/d)^2 p_{k,d}(x)$ is just the variance of a binomial random variable with $d$ trials and success probability $x$. This is bounded by $\frac{1}{4d}$. Plugging in this bound for each $i$ separately completes the proof. \end{proof} Rescaling the function, we have the following corollary. To state this corollary, we let $B(x, r) = \{z : \Vert z - x \Vert_2 \le r\}$ i.e. the $\ell_2$ of radius $r$ at $x$. \begin{corollary}\label{corr:Bernstein} Let $f: B(x,r) \rightarrow \mathbb{R}$ be a $1$-Lipschitz function (where $B(x,r) \subseteq \mathbb{R}^\ell$). Then, given any error parameter $\eta>0$, there is a polynomial $p_{f, r, \eta}$ whose degree in every variable is at most $d_{B}(\eta, r,\ell) = \ell \cdot 4r^2 \cdot (1/\eta^2) $ such that \[ \sup_{z \in B(x,r)} \big|p_{f, r, \eta}(z) - f(z) \big| \le \eta. \] \end{corollary} \begin{proof} To prove this, we will rely on Theorem~\ref{thm:Bernstein}. First, define $B_{\infty}(x,r) =\{z: \Vert z-x\Vert_\infty \le r\}$. We extend $f$ to $B_{\infty}(x,r)$ as follows: $ f(z) = f(\mathsf{Proj}_{B(x,r)}(z)). $ Note that the extension is $1$-Lipschitz (using Fact~\ref{fact:convex}). Define the function $g: [0,1]^\ell \rightarrow \mathbb{R}$ as \[ g(z) = f\bigg(x + \bigg(z-\mathbf{\frac{1}{2}}\bigg) \cdot 2r \bigg). \] Here $\mathbf{\frac{1}{2}}$ is the point in $\mathbb{R}^{\ell}$ which is $1/2$ in every coordinate. It is easy to see that the function $g$ is $2r$-Lipschitz. Thus, if we choose the function $\mathsf{BP}_{g,d_1, \ldots, d_{\ell}}$, then we have \[ \sup_{z \in [0,1]^{\ell}} \big|\mathsf{BP}_{g,d_1, \ldots, d_{\ell}} - g(z) \big| \le 2r \cdot \bigg(\sum_{j=1}^{\ell} \frac{1}{d_j} \bigg)^{1/2}. \] In particular, we set all the degrees $d_1 = \ldots =d_{\ell} = \ell \cdot 4r^2 \cdot (1/\eta^2)$, then $\sup_{z \in [0,1]^{\ell}} \big|\mathsf{BP}_{g,d_1, \ldots, d_{\ell}} - g(z) \big| \le \eta$. Thus, if we set $p_{f,r,\eta}(z)$ as \[ p_{f,r,\eta}(z) = \mathsf{BP}_{g,d_1, \ldots, d_{\ell}} \bigg( \frac{z-x}{2r} + \mathbf{\frac{1}{2}}\bigg). \] It is clear that the polynomial $p_{f,r,z}$ satisfies $\sup_{z \in B(x,r)} \big|p_{f, r, \eta}(z) - f(z) \big| \le \eta$. \end{proof} We next modify the function $f_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$ obtained in Corollary~\ref{corr:fsm} to obtain the function $f_{\mathsf{sm}}' : \mathbb{R}^n \rightarrow \mathbb{R}^k$ which is a (i) low-degree polynomial and (ii) $f_{\mathsf{sm}}$ is close to $f_{\mathsf{sm}}'$ with high probability on the Gaussian measure $\gamma_n$. \begin{lemma}\label{lem:smoothing-1} Given the function $f_{\mathsf{sm}}: \mathbb{R}^n \rightarrow \Delta_k$ from Corollary~\ref{corr:fsm}, there is a function $f_{\mathsf{sm}}': \mathbb{R}^n \rightarrow \mathbb{R}^k$ such that $f_{\mathsf{sm}}' = (p'_{f,1}(x), \ldots, p'_{f,k}(x))$ where for all $1 \le s \le k$, $p'_{f,s}: \mathbb{R}^n \rightarrow \mathbb{R}$ are polynomials satisfying the following conditions: \begin{enumerate} \item For $1 \le s \le k$, the polynomials $\{p'_{f,s}\}$ have degree $d' = \log^{d}(dk/\delta) \cdot \mathsf{poly}(k/\delta) \cdot d$ where $d$ is the degree appearing in Corollary~\ref{corr:fsm}. \item $\Pr_{x \sim \gamma_n} [\Vert f_{\mathsf{sm}}(x) - f_{\mathsf{sm}}'(x) \Vert_\infty \le \delta/4] \le \delta/2$. \end{enumerate} \end{lemma} \begin{proof} Let the function $f_{\mathsf{sm}}(x) = \mathsf{Proj}(p_{f,1}(x), \ldots, p_{f,k}(x))$. Since all the polynomials are degree $d$ and have variance at most $\sigma_{\mathsf{sm}}^2 = k^{8}/\delta^4$, using Theorem~\ref{thm:hyper}, we obtain the following: \begin{equation}\label{eq:inf-ball-1} \Pr_{x \sim \gamma_n} \sup_{1 \le s \le k} [|p_{f,s} - \mathbf{E}[p_{f,s}]| \le \log^{d/2} (2dk/\delta) \cdot \sigma_{\mathsf{sm}}] \le \frac{\delta}{2}. \end{equation} Define the point $\boldsymbol{\mu}_{sm,f} = (\mathbf{E}[p_{f,1}], \ldots, \mathbf{E}[p_{f,s}])$. Also, let $r_{sm} = \log^{d/2} (2dk/\delta) \cdot \sigma_{\mathsf{sm}}$. Since the projection from ${\bf R}^k$ to $\Delta_k$ is Lipschitz, Corollary~\ref{corr:Bernstein} implies that there exist polynomials $p_{\mathsf{sm},s}: \mathbb{R}^{k} \rightarrow \mathbb{R}$ (for $1 \le s\le k$) whose degree in every variable is at most $k \cdot 4 r_{sm}^2 \cdot 16/\delta^2 = \log^d(dk/\delta) \cdot \mathsf{poly}(k/\delta)$, and which satisfy \begin{equation}~\label{eq:inf-ball} \textrm{for all } z \in B(\boldsymbol{\mu}_{sm,f}, r_{sm}) \textrm{, we have } \ |p_{\mathsf{sm},s}(z) - \mathsf{Proj}_s(z)| \le \frac{\delta}{4} \end{equation} Let $p_{\mathsf{sm}}: \mathbb{R}^k \rightarrow \mathbb{R}^k$ be defined as the map $p_{\mathsf{sm}}(x) = (p_{\mathsf{sm},1}(x), \ldots, p_{\mathsf{sm},k}(x))$. Recall that $f_{\mathsf{sm}} = \mathsf{Proj} (p_{f,1}(x), \ldots, p_{f,k}(x))$. We define $p'_f= p_{\mathsf{sm}} \circ (p_{f,1}, \ldots, p_{f,k})$. We now define $f_{\mathsf{sm}}' = (p'_{f,1}(x), \ldots, p'_{f,k}(x))$. It is clear that for $1 \le s \le k$, $p'_{f,s}$ is a polynomials of degree $\log^{d}(dk/\delta) \cdot \mathsf{poly}(k/\delta) \cdot d$. Likewise, combining (\ref{eq:inf-ball}) and (\ref{eq:inf-ball-1}), we obtain that $\Pr_{x \sim \gamma_n} [\Vert f_{\mathsf{sm}}(x) - f_{\mathsf{sm}}'(x) \Vert_\infty \le \delta/2] \le \delta/2$. \end{proof} \subsection{Converting to PPFs} Before we finish the proof of Lemma~\ref{lem:smoothing}, we will need to make a couple of elementary observations. First of all, observe that if $\alpha$ is uniformly random in $[0,1]$, then for any $x \in [0,1]$, $\mathbf{E}[\mathbf{1}_{x - \alpha \ge 0}] = x$. Here $\mathbf{1}_{x-\alpha \ge 0}$ denotes the function which is $1$ if $x-\alpha \ge 0$ and $0$ otherwise. Now, for any parameter $\eta>0$, define the distribution $\mathsf{Int}_\eta$ to be uniformly random over the set $\{i \cdot \eta\}_{i \ge 0} \cap [0,1]$. Then, we have the following simple claim. \begin{claim}~\label{clm:expectation-delta} Let $\zeta>0$ and $y \in \Delta_{k,\zeta}$. Then, \[ \bigg\Vert \mathop{\mathbf{E}}_{(\alpha_1,\ldots, \alpha_k) \sim \mathsf{Int}_\eta^k} \bigg[\sum_{s=1}^k \arg \max (\underbrace{0, \ldots, 0}_{s-1 \textrm{ times}}, y_s-\alpha_s,\underbrace{0, \ldots, 0}_{k-s \textrm{ times}} )\bigg] - y \bigg\Vert_1 \le 2( \zeta + k \cdot \eta). \] \end{claim} \begin{proof} Let the point closest to $y$ in $\Delta_k$ be $x$. Then, we have $\Vert x-y \Vert_1=\zeta$. We have the following: \[ \bigg\Vert \mathop{\mathbf{E}}_{(\alpha_1,\ldots, \alpha_k) \sim \mathsf{Int}_\eta^k} \bigg[\sum_{s=1}^k \arg \max (\underbrace{0, \ldots, 0}_{s-1 \textrm{ times}}, x_s-\alpha_s,\underbrace{0, \ldots, 0}_{k-s \textrm{ times}} )\bigg] - x \bigg\Vert_1 \le k \cdot \eta. \] Combining this with $\Vert x-y \Vert_1\le \zeta$, we obtain \begin{equation}~\label{eq:inter} \bigg\Vert \mathop{\mathbf{E}}_{(\alpha_1,\ldots, \alpha_k) \sim \mathsf{Int}_\eta^k} \bigg[\sum_{s=1}^k \arg \max (\underbrace{0, \ldots, 0}_{s-1 \textrm{ times}}, x_s-\alpha_s,\underbrace{0, \ldots, 0}_{k-s \textrm{ times}} )\bigg] - y \bigg\Vert_1 \le k \cdot \eta +\zeta. \end{equation} Next, for any $1 \le s\le k$, $$ \Vert \mathop{\mathbf{E}}_{(\alpha_1,\ldots, \alpha_k) \sim \mathsf{Int}_\eta^k} \arg \max (\underbrace{0, \ldots, 0}_{s-1 \textrm{ times}}, x_s-\alpha_s,\underbrace{0, \ldots, 0}_{k-s \textrm{ times}} ) - \arg \max (\underbrace{0, \ldots, 0}_{s-1 \textrm{ times}}, y_s-\alpha_s,\underbrace{0, \ldots, 0}_{k-s \textrm{ times}} ) \Vert_1 \le |x_s-y_s| + \eta. $$ Summing over all $1 \le s \le k$ and combining with (\ref{eq:inter}), we obtain the claim. \end{proof} \begin{proofof}{Lemma~\ref{lem:smoothing}} For $1 \le i \le \ell$, let $\{f_{\mathsf{sm}}^{'(i)}\}$ and $\{g_{\mathsf{sm}}^{'(i)}\}$ be the functions obtained by applying Corollary~\ref{corr:fsm} and Lemma~\ref{lem:smoothing-1} to the family of functions $\{f^{(i)}\}$ and $\{g^{(i)}\}$. In particular, let $f_{\mathsf{sm}}^{'(i)} = (p^{'(i)}_{f,1}, \ldots, p^{'(i)}_{f,k})$ and $g_{\mathsf{sm}}^{'(i)} = (p^{'(i)}_{g,1}, \ldots, p^{'(i)}_{g,k})$. For $ \eta>0$ (to be fixed later), let us define $f^{(i)}_1$ and $g^{(i)}_1$ as follows: \[ f^{(i)}_1 = \sum_{s=1}^k \mathop{\mathbf{E}}_{(\alpha_1, \ldots, \alpha_k) \in \mathsf{Int}_{\eta}^k} \arg \max \big(\underbrace{0, \ldots, 0}_{s-1 \ \textrm{times}} , p^{'(i)}_{f,s} - \alpha_s, \underbrace{0, \ldots, 0}_{k-s \ \textrm{times}} \big) \] \[ g^{(i)}_1 = \sum_{s=1}^k \mathop{\mathbf{E}}_{(\alpha_1, \ldots, \alpha_k) \in \mathsf{Int}_{\eta}^k} \arg \max \big(\underbrace{0, \ldots, 0}_{s-1 \ \textrm{times}} , p^{'(i)}_{g,s} - \alpha_s, \underbrace{0, \ldots, 0}_{k-s \ \textrm{times}} \big) \] We will now verify the properties of the construction. ~\\ \textbf{Proof of Items 1 and 2:} Both these items are straight forward from the construction.~\\ \textbf{Proof of Item 3: } By the second item of Lemma~\ref{lem:smoothing-1}, we have $\Pr_{x \sim \gamma_n} [f_{\mathsf{sm}}^{'(i)}(x) \in \Delta_{k,k\delta/4}] \ge 1-\delta/2$. By applying Claim~\ref{clm:expectation-delta}, we obtain that whenever $f_{\mathsf{sm}}^{'(i)}(x) \in \Delta_{k,k\delta/4}$, $f^{(i)}_1(x) \in \Delta_{k, O(k \delta + k \eta)}$. Thus, as long as $\eta \le \delta/k$, this proves Item 3 for $f^{(i)}_1$. The proof for $g^{(i)}_1$ is similar. ~\\ \textbf{Proof of Items 4 and 5:} We first observe that $\Pr_{x \sim \gamma_n}[\Vert f_{\mathsf{sm}}^{'(i)}(x) - f_{\mathsf{sm}}^{(i)}(x) \Vert_1 \le k \cdot \delta/4 ] \ge 1- \delta/2$. By applying Claim~\ref{clm:expectation-delta}, we obtain that $\Pr_{x \sim \gamma_n} [\Vert f^{(i)}_1(x) - f_{\mathsf{sm}}^{(i)}(x) \Vert_1 \le O(k \delta + k \eta)] \ge 1- \delta/2$. However, note that by definition, $\Vert f^{(i)}_1(x) - f_{\mathsf{sm}}^{(i)}(x) \Vert_\infty \le k$. This implies that $\mathbf{E}[\Vert f_{\mathsf{sm}}^{'(i)} (x) - f^{(i)}_1(x) \Vert_1] = O(k\delta + k \eta)$. As long as $\eta \le \delta/k$, we have $\mathbf{E}[\Vert f_{\mathsf{sm}}^{(i)} (x) - f^{(i)}_1(x) \Vert_1] = O(k\delta)$. Combining with the guarantees of Corollary~\ref{corr:Boosting} yields Items 4 and 5. ~\\ \textbf{Proof of Item 6: } To prove Item 6, note that for any $1 \le s \le k$ and $\alpha_s \in [0,1]$, $$\arg \max \big(\underbrace{0, \ldots, 0}_{s-1 \ \textrm{times}} , p^{'(i)}_{f,s} - \alpha_s, \underbrace{0, \ldots, 0}_{k-s \ \textrm{times}} \big) = \mathsf{PPF}_{p^{'(i)}_{f,s} - \alpha_s,s}.$$ Thus, if we define $p^{(i)}_{s,j,1} = p^{'(i)}_{f,s}- \eta \cdot j$ and $p^{(i)}_{s,j,2} = p^{'(i)}_{g,s} - \eta \cdot j$, then \[ f_1^{(i)} = \sum_{s=1}^k \sum_{j=0}^{m} \frac{1}{m} \mathsf{PPF}_{p^{(i)}_{s,j,1} , s} \ \textrm{and} \ g_1^{(i)} = \sum_{s=1}^k \sum_{j=0}^{m} \frac{1}{m} \mathsf{PPF}_{p^{(i)}_{s,j,2} , s}, \] where $m = \lceil 1/\eta \rceil$. As $\eta \leq \delta /k$, $m = O(k/\delta)$. By Lemma~\ref{lem:smoothing-1}, $\mathsf{deg}(p^{'(i)}_{f,s})$ and $\mathsf{deg}(p^{'(i)}_{g,s})$ is at most $d' = d \cdot \mathsf{poly}(k/\delta) \cdot \log^{d} (d k /\delta)$ where $d =2/t \cdot \log(dk/\delta)$ (coming from Corollary~\ref{corr:Boosting}). If we set $d_0(t,k,\delta) = d'$, then $\mathsf{deg}(p^{'(i)}_{f,s})$ and $\mathsf{deg}(p^{'(i)}_{g,s})$ is at most $d_0(t,k,\delta)$. As $\mathsf{deg}(p^{(i)}_{s,j,1}) = \mathsf{deg}(p^{'(i)}_{f,s})$ and $\mathsf{deg}(p^{(i)}_{s,j,2}) = \mathsf{deg}(p^{'(i)}_{g,s})$, this proves Item 6. (We can make the PPFs balanced by applying Fact~\ref{fact:balanced}). \end{proofof} \section{Construction of junta polynomials} This section is dedicated to the proof of Lemma~\ref{lem:junta-construction}. To prove this lemma, we will first recall the following important result from \cite{DMN16a} (Theorem~41 in that paper). \begin{theorem}~\label{thm:junta-construct} Let $p_1, \ldots, p_{\ell}: \mathbb{R}^n \rightarrow \mathbb{R}$ be degree-$d$ polynomials and for $\delta>0$, the following two conditions: (i) For all $1 \le s \le \ell$, $\mathsf{Var}(p_s)=1$ and (ii) For all $1 \le s \le \ell $, $|\mathbf{E}[p_s]| \le \log^{d/2} (k \cdot d /\delta)$. For $1 \le s \le \ell$ and $t>0$, define $u_s: \mathbb{R}^{2n} \rightarrow \mathbb{R}$ as follows: $u_s(x,y) = p_s(e^{-t} x + \sqrt{1-e^{-2t}} y)$. Then, there is an explicitly computable $n_0 = n_0(\ell, d, \xi)$ and polynomials $r_1, \ldots, r_{\ell}: \mathbb{R}^{n_0} \rightarrow \mathbb{R}$ with the following properties: For $1 \le s \leq \ell$, define $v_s: \mathbb{R}^{2n_0} \rightarrow \mathbb{R}$ as $v_s(x,y) = r_s(e^{-t} x + \sqrt{1-e^{-2t}} y)$. Then, for $ 1 \le s, s' \le \ell$, \begin{enumerate} \item $\big|\Pr_{x \sim \gamma_n} [{p}_s \ge 0] - \Pr_{x \sim \gamma_n} [{r}_s \ge 0] \big|\le \xi$. \item $\big|\Pr_{x,y \sim \gamma_{n}} [{u}_s \ge 0] - \Pr_{x,y \sim \gamma_{n_0}} [{v}_s \ge 0] \big|\le \xi$. \item $\big|\Pr_{x \sim \gamma_n} [{p}_s \cdot {p}_{s'} \ge 0] - \Pr_{x \sim \gamma_{n_0}} [{r}_s \cdot {r}_{s'} \ge 0] \big|\le \xi$. \item $\big|\Pr_{x,y \sim \gamma_n} [{u}_s\cdot {u}_{s'} \ge 0] - \Pr_{x,y \sim \gamma_{n_0}} [{v}_s \cdot {v}_{s'} \ge 0] \big|\le \xi$. \item $\big|\Pr_{x,y \sim \gamma_n} [{p}_s\cdot {u}_{s'} \ge 0] - \Pr_{x,y \sim \gamma_{n_0}} [{v}_s \cdot {v}_{s'} \ge 0] \big|\le \xi$. \end{enumerate} \end{theorem} We now derive an additional property of the polynomials $\{p_s\}_{1 \le s \le \ell}$ and $\{r_s \}_{1 \le s \le \ell}$ defined in Theorem~\ref{thm:junta-construct} which will be useful later. \begin{corollary}~\label{corr:const-and-1} Let $p_1, \ldots, p_{\ell}: \mathbb{R}^n \rightarrow \mathbb{R}$ and $u_1, \ldots, u_{\ell}: \mathbb{R}^n \rightarrow \mathbb{R}$ be as defined in Theorem~\ref{thm:junta-construct}. Then, for any $1 \le s, s' \le k$, \[ \big|\Pr_{x \sim \gamma_n} [({p}_s (x) \ge 0 ) \wedge ( {p}_{s'}(x) \ge 0)] - \Pr_{x \sim \gamma_{n_0}} [({r}_s (x) \ge 0 ) \wedge ( {r}_{s'}(x) \ge 0)] \big| \le 2\xi. \] \end{corollary} \begin{proof} The main observation here is that if $A , B \not =0$, then $$ \mathbf{1}[A \ge 0 ] \cdot \mathbf{1}[ B \ge 0] = \frac{1}{2} \big(\mathbf{1}[A \cdot B \ge 0] +\mathbf{1}[A \ge 0]+\mathbf{1}[ B \ge 0]-1\big) . $$ Now, note that because $p_s$, $p_{s'}$, $r_{s}$ and $r_{s'}$ are degree-$d$ polynomials, any of these functions vanish over the Gaussian measure with probability $0$. Thus, \begin{eqnarray} \Pr_{x \sim \gamma_n} [({p}_s (x) \ge 0 ) \wedge ( {p}_{s'}(x) \ge 0)] &=& \frac{1}{2} \big(\Pr_{x \sim \gamma_n} [{p}_s (x) \ge 0 ] + \Pr_{x \sim \gamma_n} [ {p}_{s'}(x) \ge 0] + \Pr_{x \sim \gamma_n} [ p_{s} \cdot {p}_{s'}(x) \ge 0]-1\big) \nonumber \\ \Pr_{x \sim \gamma_{n_0}} [({r}_s (x) \ge 0 ) \wedge ( {r}_{s'}(x) \ge 0)] &=& \frac{1}{2} \big(\Pr_{x \sim \gamma_{n_0}} [{r}_s (x) \ge 0 ] + \Pr_{x \sim \gamma_{n_0}} [ {r}_{s'}(x) \ge 0] + \Pr_{x \sim \gamma_{n_0}} [ r_{s} \cdot {r}_{s'}(x) \ge 0]-1\big) \nonumber \end{eqnarray} Combining the above equations with items 1 and 3 in Theorem~\ref{thm:junta-construct} yields the corollary. \end{proof} ~\\ We now describe the proof of Lemma~\ref{lem:junta-construction}. \begin{proofof}{Lemma~\ref{lem:junta-construction}} Let us consider the collection of degree-$d_0$ polynomials $\{p_{s,j,1}^{(i)}\}_{1 \le i \le \ell, 1 \le s \le k, 1 \le j \le m} \cup \{p_{s,j,2}^{(i)}\}_{1 \le i \le \ell,1 \le s \le k, 1 \le j \le m}$. We now apply Theorem~\ref{thm:junta-construct} to obtain polynomials $\{r_{s,j,1}^{(i)}\}_{1 \le i \le \ell,1 \le s \le k, 1 \le j \le m} \cup \{r_{s,j,2}^{(i)}\}_{1 \le i \le \ell,1 \le s \le k, 1 \le j \le m}$ with $\xi= \delta/(40 k^2)$. We now define \[ f^{(i)}_{\mathsf{junta}} = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{r_{s,j,1}^{(i)},s}(x) \ , \ g^{(i)}_{\mathsf{junta}} = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathsf{PPF}_{r_{s,j,2}^{(i)},s}(x) \] We now verify the properties of the construction. ~\\ \textbf{Proof of Item 1: } Observe that for $1 \le s\le k$, we have the following \[ \mathbf{E}[(f_{1}^{(i)}(x))_s] = \sum_{j=1}^m \frac{1}{m} \cdot \mathbf{E}_{x} [\mathsf{PPF}_{p_{s,j,1}^{(i)},s}(x)] = \sum_{j=1}^m \frac{1}{m} \cdot \Pr_{x} [p_{s,j,1}^{(i)}(x) \ge 0] \] \[ \mathbf{E}[(f_{\mathsf{junta}}^{(i)}(x))_s] = \sum_{j=1}^m \frac{1}{m} \cdot \mathbf{E}_{x} [\mathsf{PPF}_{r_{s,j,1}^{(i)},s}(x)] = \sum_{j=1}^m \frac{1}{m} \cdot \Pr_{x} [r_{s,j,1}^{(i)}(x) \ge 0] \] Thus, we obtain $$ \big| \mathbf{E}[(f^{(i)}_{1}(x))_s] - \mathbf{E}[(f^{(i)}_{\mathsf{junta}}(x))_s] \big| \le \sup_{1 \le j \le m} \big| \Pr_{x} [p_{s,j,1}^{(i)}(x) \ge 0]-\Pr_{x} [r_{s,j,1}^{(i)}(x) \ge 0] \big| \le \xi . $$ The penultimate inequality follows by applying Theorem~\ref{thm:junta-construct} to $p^{(i)}_{s,j,1}$ and $r^{(i)}_{s,j,1}$. This immediately implies that $\Vert \mathbf{E}[f^{(i)}_{1}(x)] - \mathbf{E}[f^{(i)}_{\mathsf{junta}}(x)] \Vert_1 \le k \cdot \xi \le \delta$. The proof for $ \big| \mathbf{E}[(g^{(i)}_{1}(x))_s] - \mathbf{E}[(g^{(i)}_{\mathsf{junta}}(x))_s] \big| \le \delta. $ is exactly identical. ~\\ \textbf{Proof of Item 2:} Like Item 1, we will only prove that $\Pr_{x} [f^{(i)}_{\mathsf{junta}}(x) \in \Delta_{k,\sqrt{\delta}}] \le \sqrt{\delta}$. The proof for $\Pr_{x} [g^{(i)}_{\mathsf{junta}}(x) \in \Delta_{k,\sqrt{\delta}}] \le \sqrt{\delta}$. To prove this, we first observe that for all $x$ both $f^{(i)}_1(x)$ and $f^{(i)}_{\mathsf{junta}}(x)$ always lie in the positive orthant and secondly, $\Vert f^{(i)}_1(x) \Vert_\infty, \Vert f^{(i)}_{\mathsf{junta}}(x) \Vert_\infty \le 1$. Next, \begin{eqnarray} \mathbf{E}[(\Vert f^{(i)}_1(x) \Vert_1 - 1)^2 ] &\le& \Pr_{x} [f^{(i)}_1(x) \in \Delta_{k,\delta}] \cdot \delta^2 + \Pr_{x} [f^{(i)}_1(x) \not \in \Delta_{k,\delta}] \cdot k^2 \nonumber \\ &\le& \delta^2 + k^2 \cdot \delta. \label{eq:square-diff} \end{eqnarray} The first inequality uses $\sup_x \Vert f^{(i)}_1(x) \Vert_1 \le k$ and the second inequality uses $\Pr_{x} [f^{(i)}_1(x) \not \in \Delta_{k,\delta}] \le \delta$. Next, observe that \[ \Vert f^{(i)}_1(x) \Vert_1 = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathbf{1}[p^{(i)}_{s,j,1}(x) \ge 0] \ \ , \ \ \Vert f^{(i)}_{\mathsf{junta}}(x) \Vert_1 = \sum_{s=1}^k \sum_{j=1}^m \frac{1}{m} \cdot \mathbf{1}[r^{(1)}_{s,j,1}(x) \ge 0] \] This implies \begin{eqnarray} ( \Vert f^{(i)}_1(x) \Vert_1 - 1)^2 = \sum_{s=1}^k \sum_{s'=1}^k \sum_{j=1}^m \sum_{j'=1}^m \frac{1}{m^2} \mathbf{1}[p^{(i)}_{s,j,1}(x) \ge 0] \cdot \mathbf{1}[p^{(i)}_{s',j',1}(x) \ge 0] + 1 - \frac{2}{m}\sum_{s=1}^k \sum_{j=1}^m \mathbf{1}[p^{(i)}_{s,j,1}(x) \ge 0] .\label{eq:f-1} \end{eqnarray} \begin{eqnarray} (\Vert f^{(i)}_{\mathsf{junta}}(x) \Vert_1 - 1)^2 = \sum_{s=1}^k \sum_{s'=1}^k \sum_{j=1}^m \sum_{j'=1}^m \frac{1}{m^2} \mathbf{1}[r^{(i)}_{s,j,1}(x) \ge 0] \cdot \mathbf{1}[r^{(i)}_{s',j',1}(x) \ge 0] + 1 - \frac{2}{m}\sum_{s=1}^k \sum_{j=1}^m \mathbf{1}[r^{(i)}_{s,j,1}(x) \ge 0] .\label{eq:f-junta-1} \end{eqnarray} Recall that by construction, we have \begin{equation} \sup_{1 \le s \le k, \ 1 \le j \le m} \big| \Pr_{x} [p_{s,j,1}^{(i)}(x) \ge 0]-\Pr_{x} [r_{s,j,1}^{(i)}(x) \ge 0] \big| \le \xi \label{eq:diff-p-r} \end{equation} Applying Corollary~\ref{corr:const-and-1}, we also obtain \begin{equation} \sup_{1 \le s,s' \le k, \ 1 \le j,j' \le m} \big| \Pr_{x} [(p_{s,j,1}^{(i)}(x) \ge 0) \wedge (p_{s',j',1}^{(i)}(x) \ge 0)]-\Pr_{x} [(r_{s,j,1}^{(i)}(x) \ge 0) \wedge (r_{s',j',1}^{(i)}(x) \ge 0)] \big| \le 2\xi. \label{eq:diff-int-p-r} \end{equation} Applying (\ref{eq:diff-p-r}) and (\ref{eq:diff-int-p-r}) to (\ref{eq:f-1}) and (\ref{eq:f-junta-1}), we obtain \[ \big| \mathbf{E}[(\Vert f_{\mathsf{junta}}^{(i)}(x) \Vert_1 - 1)^2 ]- \mathbf{E}[(\Vert f^{(i)}_1(x) \Vert_1 - 1)^2 ]\big| \le 2 k^2 \cdot \xi + 2 k \cdot \xi \le \delta. \] Combining this with (\ref{eq:square-diff}), we obtain $ \mathbf{E}[(\Vert f^{(i)}_{\mathsf{junta}}(x) \Vert_1 - 1)^2 ] \le 2k^2 \cdot \delta. $ Applying Markov's inequality, we obtain that $\Pr[| \ \Vert f^{(i)}_{\mathsf{junta}}(x) \Vert_1 - 1| > k\sqrt{\delta}] \le 2 k \sqrt{\delta}$. Since $f^{(i)}_{\mathsf{junta}}(x)$ lies in the positive orthant for any $x$, this proves Item 2.~\\ \textbf{Proof of Item 3: } To prove Item 3, we observe that for any $1 \le s_1, s_2 \le k$, \begin{eqnarray} \mathbf{E}[f_{1,s_1} P_t g_{1,s_2}] &=& \frac{1}{m^2}\sum_{j=1}^m \sum_{j'=1}^m \mathbf{E}\big[\mathsf{PPF}_{p^{(1)}_{s_1,j_1}}(x) P_t \ \mathsf{PPF}_{p^{(2)}_{s_2,j_2}}(x)\big] \nonumber \\ &=& \frac{1}{m^2}\sum_{j=1}^m \sum_{j'=1}^m \mathbf{E}_{x,y}\big[\mathsf{PPF}_{p^{(1)}_{s_1,j_1}}(x) \mathsf{PPF}_{p^{(2)}_{s_2,j_2}} (e^{-t} x + \sqrt{1-e^{-2t}} y)\big] \nonumber\\ &=&\frac{1}{m^2}\sum_{j=1}^m \sum_{j'=1}^m \Pr_{x, y} [ (p^{(1)}_{s_1,j_1}(x) \ge 0) \wedge (p^{(2)}_{s_2,j_2}(e^{-t} x + \sqrt{1-e^{-2t}} y) \ge 0)] \nonumber \\ &=& \frac{1}{m^2}\sum_{j=1}^m \sum_{j'=1}^m \Pr_{x, y} [ (p^{(1)}_{s_1,j_1}(x) \ge 0) \wedge (u^{(2)}_{s_2,j_2}(e^{-t} x + \sqrt{1-e^{-2t}} y) \ge 0)] \label{eq:fpg-1}. \end{eqnarray} Likewise, we can obtain \begin{equation}\label{eq:fpg-2} \mathbf{E}[f_{\mathsf{junta},s_1} P_t g_{\mathsf{junta},s_2}] = \frac{1}{m^2} \sum_{j=1}^m \sum_{j'=1}^m \Pr_{x, y} [ (r^{(1)}_{s_1,j_1}(x) \ge 0) \wedge (v^{(2)}_{s_2,j_2}(e^{-t} x + \sqrt{1-e^{-2t}} y) \ge 0)]. \end{equation} Combining (\ref{eq:fpg-1}) and (\ref{eq:fpg-2}) with Item 5 in Theorem~\ref{thm:junta-construct} yields \[ \big| \mathbf{E}[f_{1,s_1} P_t g_{1,s_2}] -\mathbf{E}[f_{\mathsf{junta},s_1} P_t g_{\mathsf{junta},s_2}] \big | \le \xi. \] This finishes the proof. \end{proofof} \subsection*{Acknowledgments} We thank Pritish Kamath, Badih Ghazi and Madhu Sudan for pointing out that the $\ell=1$ case of Theorem~\ref{thm:junta-strong} is not sufficient to derive Theorem~\ref{thm:junta}. (An earlier version of this paper incorrectly claimed that it was.) We also thank the anonymous reviewers who pointed out the same gap.
{'timestamp': '2017-02-17T02:00:41', 'yymm': '1701', 'arxiv_id': '1701.01485', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01485'}
arxiv
\subsection*{Acknowledgment} \sloppy This work was supported by JSPS KAKENHI Grant Numbers 15H05711 and 16K16011, and by JST, ERATO, Kawarabayashi Large Graph Project. \section{Algorithm} \label{sec:algorithm} In this section, we propose an algorithm to compute influence spread exactly. Let $S \subseteq V$ be a seed set and $t \in V$ be a vertex. We consider the set of $S$-$t$ connecting subgraphs \begin{align} \mathcal{R}(S, t) = \{ F \subseteq E : t \text{ is reachable from } S \text{ on } G[F]\}, \end{align} which represents all realizations in which $t$ is activated from seed set $S$. Using this set, influence spread is expressed as \begin{align} \label{eq:RIS} \sigma(S) = \sum_{t \in V} \sigma(S, t), \end{align} where $\sigma(S,t)$ is the influence probability from $S$ to $t$, i.e., \begin{align} \sigma(S, t) = p(\mathcal{R}(S,t)) = \sum_{F \in \mathcal{R}(S, t)} p(F). \end{align} Our algorithm computes influence spread based on the above formulas. The algorithm first constructs the BDD for $\mathcal{R}(S, t)$. Then it computes $\sigma(S, t)$ by dynamic programming on the BDD. Finally, by summing over $t \in V$, we obtain the influence spread $\sigma(S)$. \subsection{Influence Spread Computation} \label{sec:DP} Once BDD $\mathcal{D}(S, t)$ for $\mathcal{R}(S, t)$ is obtained, $\sigma(S, t)$ is efficiently obtained by bottom-up dynamic programming as follows. Each node $\alpha \in \mathcal{N}$ stores value $\mathcal{B}(\alpha)$, which is the sum of the probabilities of all subsets represented by the descendants of $\alpha$, called the \emph{backward probability}. The backward probabilities of $0$-terminal and $1$-terminal are initialized to $\mathcal{B}(0) = 0$ and $\mathcal{B}(1) = 1$. We process the nodes in reverse topological order (i.e., the terminals to the root). For each non-terminal node $\alpha \in \mathcal{N} \setminus \{0, 1\}$ associated with edge $e(\alpha) \in E$, $\mathcal{B}(\alpha)$ is computed as follows: \begin{align} \mathcal{B}(\alpha) = (1 - p(e(\alpha))) \mathcal{B}(\alpha_0) + p(e(\alpha)) \mathcal{B}(\alpha_1). \end{align} This gives a dynamic programming algorithm (Algorithm~\ref{alg:DP}). The backward probability of the root node is $\sigma(S, t)$. \begin{algorithm}[tb] \caption{Influence spread computation} \label{alg:DP} \begin{algorithmic}[1] \STATE{Create BDD $\mathcal{D} = (\mathcal{N}, \mathcal{A})$ for $\mathcal{R}(S, t)$} \STATE{Set $\mathcal{B}(0) = 0$, $\mathcal{B}(1) = 1$} \FOR{$\alpha \in \mathcal{N} \setminus \{0,1\}$ in the reverse topological order} \STATE{$\mathcal{B}(\alpha) = (1 - p(e(\alpha))) \mathcal{B}(\alpha_0) + p(e(\alpha)) \mathcal{B}(\alpha_1)$} \ENDFOR \RETURN{$\mathcal{B}(\text{root})$} \end{algorithmic} \end{algorithm} Here, we provide an example to illustrate the procedure. Consider the graph shown in Figure~\ref{fig:example}, which has three edges ($a$, $b$, and $c$). These activation probabilities are $p$. Then, the $\{s\}$-$t$ connecting subgraphs are as follows: \begin{align} \mathcal{R}(\{s\},t) = \{\{c\},\{a,b\},\{a,c\},\{b,c\},\{a,b,c\}\}. \end{align} The BDD for this set family is presented in Figure~\ref{fig:bddexample}. We perform dynamic programming on this BDD as follows: \begin{align*} \mathcal{B}(1) &= 1, \quad \mathcal{B}(c) = p, \quad \mathcal{B}(b) = p + (1-p) p, \\ \mathcal{B}(a) &= p^2 + (1-p) p^2 + (1-p) p = p + p^2 - p^3 X. \end{align*} Therefore the influence probability from $\{s\}$ to $t$ is $p + p^2 - p^3$. \begin{figure}[tb] \caption{A graph for example. The BDD for $\mathcal{R}(\{s\}, t)$ is shown in Figure~\ref{fig:bddexample}.} \label{fig:example} \centering \begin{tikzpicture} \node[circle, draw] (s) {}; \node[left=0em of s] {s}; \node[circle, draw, above right=of s] (u) {}; \node[circle, draw, below right=of u] (t) {}; \node[right=0em of t] {t}; \draw[-latex] (s) -- node[below] {c} ++ (t); \draw[-latex] (s) -- node[above] {a} ++ (u); \draw[-latex] (u) -- node[above] {b} ++ (t); \end{tikzpicture} \end{figure} \subsection{BDD Construction} \label{sec:frontier} Here, we present an algorithm to construct the BDD $\mathcal{D}(S, t)$ for $\mathcal{R}(S, t)$. This is the main technical contribution of this study. We first consider the single seed case (i.e., $S = \{s\}$) in Section~\ref{sec:single}. Then, we consider a general case in Section~\ref{sec:multiple}. For simplicity, we write $\mathcal{R}(s, t)$ and $\mathcal{D}(s, t)$ for $\mathcal{R}(\{s\}, t)$ and $\mathcal{D}(\{s\}, t)$, respectively. \subsubsection{BDD for a single seed} \label{sec:single} Our algorithm is a type of \emph{frontier-based search}, which is a general procedure for enumerating all constrained subgraphs~\cite{kawahara2014frontier}.% \footnote{Frontier-based search is often applied to construct a \emph{zero-suppressed BDD}, which is a special kind of BDD. However, in our problem, the set has many ``don't care'' edges; therefore BDD is more suitable than ZDD.} In the following, we first describe the general framework of the frontier-based search. Then, to adapt it to our problem, we describe four main components: \emph{configuration}, \emph{\texttt{isZeroTerminal} function}, \emph{\texttt{isOneTerminal} function}, and \emph{\texttt{createNode} function}. Finally we describe two techniques to improve performance: \emph{edge ordering} and \emph{preprocessing}. \paragraph{Frontier-based search} Let us enumerate all constrained subgraphs $\mathcal{R} \subseteq 2^E$. We fix an ordering of edges $(e_1, \ldots, e_m)$ and process the edges one by one, as the exhaustive search. The processed edges and the unprocessed edges at the end of $i$-th step are denoted by $E^{\le i} := \{ e_1, \ldots, e_i \}$ and $E^{> i} := \{ e_{i+1}, \ldots, e_{m} \}$, respectively. The set of vertices that has both processed and unprocessed edges is called the \emph{frontier} (at the $i$-th step) and denoted by $W_{i}$. The set of nodes $\mathcal{N}_i$ represents all subsets of $E^{\le i}$ that can possibly belongs to $\mathcal{R}$. Each $\alpha \in \mathcal{N}_i$ represents possibly many subsets $R(\alpha) \subseteq 2^{E^{\le i}}$ by paths from the root to $\alpha$, where a path from the root to $\alpha$ represents a subset in which $e$ is present in the set if the path descends the $1$-arc of node $\beta$ associated with $e$. We say that two edge sets $F$ and $F'$ are \emph{equivalent} if for any subsets $H \subseteq E^{> i}$, both $F \cup H$ and $F' \cup H$ belong to $\mathcal{R}$ or neither belong to $\mathcal{R}$. The algorithm maintains that all sets in $R(\alpha)$ are equivalent. At the $i$-th iteration, the algorithm constructs $\mathcal{N}_{i}$ from $\mathcal{N}_{i-1}$. For each node $\alpha \in \mathcal{N}_{i-1}$, the algorithm generates two children for which $e_i$ is excluded or included in the sets in $R(\alpha)$. Here, the important feature is \emph{node merging}. Let $\beta$ and $\beta'$ be nodes generated at the $i$-th step. If all $F \in R(\beta)$ and $F' \in R(\beta')$ are equivalent, we can merge them to reduce the number of nodes. To verify this equivalence efficiently, each node $\beta$ maintains a data $\phi(\beta)$, referred to as \emph{configuration}, which satisfies the condition that: if $\phi(\beta) = \phi(\beta')$ then the all corresponding sets are equivalent. Note that the inverse is not required, which causes redundant node expansions. After the process, the constructed BDD is not necessarily reduced. Thus, we repeatedly apply the reduction rules \eqref{eq:share}. This reduction is performed in time proportional to the size of the BDD~\cite{bryant1986graph}. The general framework of the frontier-based search is shown in Algorithm~\ref{alg:frontier}, which contains three auxiliary functions. $\texttt{isZeroTerminal}(\alpha, e_i, x)$ ($\texttt{isOneTerminal}(\alpha, e_i, x)$) determines whether the node for the sets excluding (including) $e_i$ from $R(\alpha)$ is the $0$-terminal ($1$-terminal). More precisely, these are defined as follows: \begin{align} &\texttt{isZeroTerminal}(\alpha, e_i, x) \notag \\ & = \begin{cases} \texttt{True} & \text{all } x\text{-descendants are excluded from } \mathcal{R}, \\ \texttt{False} & \text{otherwise}, \end{cases}\\ &\texttt{isOneTerminal}(\alpha, e_i, x) \notag \\ &= \begin{cases} \texttt{True} & \text{all } x\text{-descendants are included to } \mathcal{R}, \\ \texttt{False} & \text{otherwise}. \end{cases} \end{align} $\texttt{createNode}(\alpha, e_i, x)$ creates an $x$-child of $\alpha$. To adapt the general framework to our $s$-$t$ connecting subgraph enumeration problem, we only have to design the configuration and these functions. \begin{algorithm}[tb] \caption{Frontier-based search} \label{alg:frontier} \begin{algorithmic}[1] \STATE{$\mathcal{N}_0 \leftarrow \{\text{root}\}$, $\mathcal{N}_i \leftarrow \emptyset$ for $i = 1, 2, \ldots, |E|$} \FOR{$i = 1, 2, \ldots, |E|$} \FOR{$\alpha \in \mathcal{N}_{i-1}$} \FOR{$x \in \{0,1\}$} \IF{$\texttt{isZeroTerminal}(\alpha, e_i, x)$} \STATE{$\alpha_x \leftarrow 0$} \ELSIF{$\texttt{isOneTerminal}(\alpha, e_i, x)$} \STATE{$\alpha_x \leftarrow 1$} \ELSE \STATE{$\beta \leftarrow \texttt{createNode}(\alpha, e_i, x)$} \IF{$\phi(\beta) = \phi(\beta')$ for some $\beta' \in \mathcal{N}_{i}$} \STATE{$\beta \leftarrow \beta'$} \ELSE \STATE{$\mathcal{N}_{i} \leftarrow \mathcal{N}_{i} \cup \{\beta\}$} \ENDIF \STATE{$\alpha_x \leftarrow \beta$} \ENDIF \ENDFOR \ENDFOR \ENDFOR \STATE{Reduce the constructed BDD by the reduction rules \eqref{eq:share}} \end{algorithmic} \end{algorithm} \paragraph{Configuration} For two nodes $\beta, \beta' \in \mathcal{N}_{i}$, we want to merge these nodes if these are equivalent, i.e., the $s$-$t$ reachabilities on $G[F \cup H]$ and $G[F' \cup H]$ are the same for all $F \in R(\beta)$, $F' \in R(\beta')$, and $H \subseteq E^{>i}$. Thus the configuration must satisfy that $\phi(\beta) = \phi(\beta')$ implies the above condition. Here, we propose to use the reachability information on the frontier vertices as the configuration as follows. Let $W_{i}^{s+}, W_{i}^{+t} \subseteq W_i$ be the set of frontier vertices that are reachable from $s$ and reachable to $t$, respectively, on $G[F]$ where $F \in R(\beta)$. Note that these are well-defined, i.e., they are independent of the choice of $F$, as mentioned below. Let $W_{i}^{s-} = W_{i} \setminus W_{i}^{s+}, W_{i}^{-t} = W_{i} \setminus W_{i}^{+t}$. We define the configuration $\phi(\beta)$ as a matrix indexed by $(W_{i}^{s-} \cup \{s\}) \times (W_{i}^{-t} \cup \{t\})$ whose entries denote reachability on $G[F]$: \begin{align} \phi(\beta)_{uv} = \begin{cases} 1 & v \text{ is reachable from } u \text{ on } G[F], \\ 0 & \text{otherwise}. \end{cases} \end{align} If $F \cup H$ admits (does not admit) an $s$-$t$ path, any $F' \in R(\beta')$ with $\phi(\beta) = \phi(\beta')$ also admits (does not admit) an $s$-$t$ path because we can transform the $s$-$t$ path on $G[F]$ to that on $G[F']$ by reconnecting the path on the frontier. This shows that $\phi$ satisfies the configuration requirement described above. This also proves, by induction, that this definition is well-defined, i.e., $\phi(\beta)$ is independent of the choice of $F$. \paragraph{``isZeroTerminal'' and ''isOneTerminal'' functions} If $x = 1$, i.e., we include edge $e_i = (u, v)$ in the sets in $R(\alpha)$, we have a chance to obtain $\texttt{isOneTerminal}(\alpha, e_i, x) = \texttt{True}$, which is the case that the included edges contain a path from $s$ to $t$. Using our configuration, this is easily implemented as follows: \begin{align} &\texttt{isOneTerminal}(\alpha, e_i, 1) \notag \\ & \qquad = \begin{cases} \texttt{True} & \phi(\alpha)_{su} = 1 \text{ and } \phi(\alpha)_{vt} = 1, \\ \texttt{False} & \text{otherwise}. \end{cases} \end{align} Similarly, if $x = 0$, i.e., we exclude edge $e_i$ from the sets in $R(\alpha)$, we have a chance to obtain $\texttt{isZeroTerminal}(\alpha, e_i, x) = \texttt{True}$, which is the case that the excluded edges form a cutset from $s$ to $t$. This is implemented as follows. \begin{align} &\texttt{isZeroTerminal}(\alpha, e_i, 0) \notag \\ & = \begin{cases} \texttt{True} & t \text{ is unreachable from } s \text{ on } G[F \cup E^{>i}], \\ \texttt{False} & \text{otherwise} \end{cases} \end{align} where $F \in R(\alpha)$. Note that this is well-defined for the same reason described above. To check the reachability on $G[F \cup E^{>i}]$ efficiently, we precompute the transitive closures of $G[E^{>j}]$ for all $j = 0, 1, \ldots, |E|$.% \footnote{Because we compute the BDDs for all pairs of $s, t \in V$, storing all transitive closures accelerates computation. The size of all transitive closures are typically much smaller than the size of the BDDs.} Then the reachability from $s$ to $t$ is checked in $O(|W_i|^2)$ time by the DFS/BFS with the configuration and the precomputed reachability. \paragraph{``createNode'' function} The most important role of $\texttt{createNode}(\alpha, e_i, x)$ is computing the configuration of the new node. The function first creates new node $\beta$ and copies configuration $\phi(\alpha)$ to $\phi(\beta)$. If a vertex is included in the frontier (i.e., some incident edge is processed first) or excluded from the frontier (i.e., all incident edges have been processed), we insert or remove the corresponding row and column from the configuration $\phi(\beta)$. If $x = 0$, we require no further updates. Otherwise, adding a new edge changes reachability; thus we update $\phi(\beta)$ to be the transitive closure of the frontier. This is performed in $O(|W_i|^2)$ time by the DFS/BFS on the frontier. \paragraph{Edge ordering} The complexity of the frontier-based search depends on the frontier size. $\mathcal{N}_{i}$ has at most $O(2^{|W_{i}|^2})$ nodes because it contains no nodes with the same configurations. It is known that the frontier size is closely related to the \emph{pathwidth} graph parameter~\cite{kinnersley1992vertex}. Note that optimizing edge ordering is important to reduce the frontier size (i.e., the pathwidth). For our problem, there is an additional requirement, i.e., the same edge ordering is used for all BDDs $\mathcal{R}(s, t)$ for $s, t \in V$ because we perform several set manipulations between the BDDs. In this study, we use the \emph{path-decomposition based ordering} proposed by Inoue and Minato~\cite{inoue2016acceleration}. The algorithm first computes a path decomposition with a small pathwidth using beam search-based heuristics. Then it computes an edge ordering using the path decomposition information. \paragraph{Preprocessing} If $e \in E$ is not contained in any $s$-$t$ simple path, $e$ does not appear in the BDD because the existence of $e$ does not affect $s$-$t$ reachability. Therefore, removing all such edges as a preprocessing improves the performance of the algorithm. Determining whether there is an $s$-$t$ simple path containing $e$ is NP-hard because it reduces to the NP-hard two-commodity flow problem~\cite{even1975complexity}. However, because we are interested in small networks, we can enumerate all $s$-$t$ simple paths using Knuth's Simpath algorithm~\cite{knuth2009art}, which is a frontier-based search algorithm that runs faster than the proposed algorithm because it uses a smaller configuration. Thus, we can use the Simpath algorithm in preprocessing. \subsubsection{BDD for multiple seeds} \label{sec:multiple} The frontier-based search described in the previous subsection can be easily adopted to the multiple seeds case. However, there is a more efficient way to construct the BDD for multiple seeds. The method is based on the following formula, which is immediately obtained from the definition of $\mathcal{R}(S, t)$: \begin{align} \mathcal{R}(S, t) = \bigcup_{s \in S} \mathcal{R}(s, t). \end{align} Because the BDD of the union of two set families represented by BDDs $\mathcal{D}_1$ and $\mathcal{D}_2$ is obtained in $O(|\mathcal{D}_1| |\mathcal{D}_2|)$ time, and, practically, the size of the BDDs is small (Section~\ref{sec:experiments}), this approach is more efficient than the frontier-based practice. \subsubsection{Node sharing among BDDs} To compute influence spread, we construct BDDs for all pairs of $s, t \in V$. Here, intuitively, if two source-target pairs $(s,t)$ and $(s',t')$ are close, the BDDs $\mathcal{D}(s,t)$ and $\mathcal{D}(s',t')$ may share many subgraphs. Thus, by sharing the nodes corresponding to the subgraphs, we can reduce the total size of the BDDs~\cite{minato1990shared}. This also reduces the total complexity of computing influence spreads for all source-target pairs $(s,t)$, which is proportional to the total size of the shared BDDs. \section{Other Applications} \label{sec:application} In the previous section, we established an algorithm to construct the BDD for all $S$-$t$ connecting subgraphs $\mathcal{R}(S, t)$. This data structure allows us to solve influence spread-related problems efficiently. \subsection{Random Sampling without Rejection} \label{sec:sampling} Sometimes we want to know how the influence is propagated from $S$ to $t$. The random sampling from $\mathcal{R}(S, t)$ will help us to understand this; however, the naive method that performs Monte-Carlo simulation and rejects if $S$ does not connect to $t$ usually requires impractically many simulations due to the small influence probability. Here we show that this random sampling can be performed \emph{without rejection} using BDD $\mathcal{D}(S, t) = (\mathcal{N}, \mathcal{A})$~\cite{ishihata2011bayesian}. As a preprocess, we perform the dynamic programming described in Section~\ref{sec:DP} to compute the backward probability $\mathcal{B}(\alpha)$ for each node $\alpha \in \mathcal{N}$. Then, we perform the following random walk, which starts from the root node and ends at the $1$-terminal: When we are on non-terminal node $\alpha \in \mathcal{N} \setminus \{0, 1\}$ associated with $e \in E$, we randomly move $\alpha_0$ or $\alpha_1$ with probability proportional to $(1 - p(e)) \mathcal{B}(\alpha_0)$ and $p(e) \mathcal{B}(\alpha_1)$. Here, if we moved to $\alpha_0$, we exclude $e$ from $F$; otherwise we include $e$ in $F$. We repeat this procedure until we reach the $1$-terminal. Finally, for all undetermined edges, we randomly and independently exclude or include the edge with its probability. This yields a random sampling from $\mathcal{R}$. The complexity is proportional to the height of the BDD. \subsection{Conditional Influence Spread} After conducting a viral promotion, we must measure the effect of the promotion. For this purpose, we observe the status of influence (i.e., influenced or not) on some small vertices and estimate the total size of influence spread. This value, referred to as the \emph{conditional influence spread}, can be obtained using the constructed BDDs. For example, suppose that we have observed that ``vertices $u, v$ are influenced and $w$ is not influenced.'' Then, the realizations that satisfy this condition is given by \begin{align} \mathcal{R} = \mathcal{R}(S, u) \cap \mathcal{R}(S, v) \cap \mathcal{R}(S, w)^c, \end{align} where $\mathcal{R}(S, w)^c = 2^E \setminus \mathcal{R}(S, w)$. Then the conditional influence probability from $S$ to $t$ under $\mathcal{R}$ is given by \begin{align} \label{eq:conditional} \sigma(S, t | \mathcal{R}) = \frac{ p(\mathcal{R}(S, t) \cap \mathcal{R}) }{ p(\mathcal{R}) }, \end{align} and the summation over $t$ gives the conditional influence spread. The BDDs for $\mathcal{R}(S,t) \cap \mathcal{R}$ and $\mathcal{R}$ in \eqref{eq:conditional} can be efficiently obtained because Boolean operations on set families are performed efficiently on BDD representations. Moreover, these probabilities can be computed by the the dynamic programming described in Section~\ref{sec:DP}. This is the method for computing the exact conditional influence spread. Note that, by combining random sampling technique described in Section~\ref{sec:sampling}, we can sample conditional realizations without rejection. \subsection{Activation Probability Modification} Activation probabilities are frequently changed in real-world networks~\cite{ohsaka2016dynamic}. In such a case, we can recompute the influence spread easily by reusing the constructed BDDs. The complexity is proportional to the size of the BDDs. \subsection{Activation Probability Optimization} Sometimes we want to solve an optimization problem with respect to the activation probabilities of edges. One example is a time-dependent influence problem, i.e., when the activation probabilities are the function on time, we want to seek the time that maximizes influence spread. Another example is a network design problem where we want to maximize the influence spread by modifying activation probabilities under some (e.g., budget) constraint. Because these problems are non-convex optimization problems (even if the activation probabilities are simple functions), it is difficult to compute the optimal solution. However, a local optimal solution would be obtained by a gradient-based method. To implement a gradient-based method, we require derivatives of the influence spread with respect to the activation probabilities. Here we show that if we have the BDD for $\mathcal{R}(S, t)$, we can obtain $\partial \sigma(S,t) / \partial p(e)$ for all $e \in E$ in time proportional to the size of the BDD. First, we compute the backward probability $\mathcal{B}(\alpha)$ for all nodes $\alpha \in \mathcal{N}$ by the dynamic programming described in Section~\ref{sec:DP}. Then, we perform top-down dynamic programming as follows. Each node $\alpha \in \mathbb{N}$ has a value $\mathcal{F}$, called the \emph{forward probability}. The forward probability of the root node is initialized as $\mathcal{F}(\text{root}) = 1$. We process the nodes in topological order (i.e., the root to the terminals). When we are on non-root node $\alpha \in \mathcal{N} \setminus \{\text{root}\}$, its forward probability is determined as follows: \begin{align} \mathcal{F}(\alpha) = \sum_{\beta: \beta_0 = \alpha} (1 - p(e(\beta))) \mathcal{F}(\beta) + \sum_{\gamma: \gamma_1 = \alpha} p(e(\gamma)) \mathcal{F}(\gamma). \end{align} Then, the derivative is obtained as follows: \begin{align} \frac{\partial \sigma(S,t)}{\partial p(e)} = \sum_{\alpha: e(\alpha) = e} \mathcal{F}(\alpha) \mathcal{B}(\alpha_1). \end{align} Because Monte-Carlo simulation cannot be used to compute the derivative, this is an advantage of our method. Note that this technique is used in probabilistic logic learning~\cite{ishihata2008propositionalizing,inoue2009evaluating}. \section{Conclusion} \label{sec:conclusion} In this study, we have proposed an algorithm to compute influence spread exactly. The proposed algorithm first constructs the BDDs to represent all $s$-$t$ connecting subgraphs. Then it computes influence spread by dynamic programming on the constructed BDDs. The BDDs can also be used to solve some other influence-spread related problems efficiently. The results of our computational experiments show that the proposed algorithm scales up to networks with a hundred edges, even though they have an enormous number (i.e., $\sim 2 \times 10^{97}$) of possible realizations. A similar approach will be adopted for the \emph{linear threshold model}~\cite{kempe2003maximizing}, which is another widely used stochastic cascade model: Goyal, Lu, and Lakshmanan~\cite{goyal2011simpath} showed that the influence spread in this model is computed by enumerating all $s$-$t$ paths, and they proposed an algorithm, named ``Simpath,'' based on an exhaustive search with pruning. By constructing the BDDs for all $s$-$t$ paths, rather than for all $s$-$t$ connected subgraphs as in this study, similar results will be obtained. Note that there is an efficient algorithm to construct the BDD for all $s$-$t$ paths~\cite{knuth2009art}, which is also named ``Simpath.'' This algorithm is used in this study to prune the redundant edges in preprocessing. The most important future work is computing exact (or highly accurate) influence spread in networks with a few hundred edges or a thousand edges. This may require new technique such as parallel construction of BDDs, approximation of BDDs, or exploiting network structures. \section{Experiments} \label{sec:experiments} We conducted computational experiments to evaluate the proposed algorithm. All code was implemented in C++ (g++5.4.0 with the -O3 option) using the \texttt{TdZdd} library\footnote{https://github.com/kunisura/TdZdd}, which is a highly optimized implementation for BDDs. All experiments were conducted on 64-bit Ubuntu 16.04 LTS with an Intel Core i7-3930K 3.2~GHz CPU and 64~GB RAM. The real-world networks were taken from the Koblenz Network Collection.\footnote{http://konect.uni-koblenz.de/} All self-loops and multiple edges were removed, and undirected edges were replaced with two directed edges in both directions. The number of vertices and edges are described in Table~\ref{tbl:exp1} \subsection{Scalability on Real-World Networks} First, to evaluate the performance of the proposed algorithm in the real-world networks, we conducted experiments on the collected networks. For each network, we constructed the BDDs for all distinct $s, t \in V$ and observed the computational time, the size of each BDD, the total shared size of the BDDs, and the number of realizations that are represented by the BDDs (i.e., cardinality of the set). The results are shown in Table~\ref{tbl:exp1}. The algorithm successfully computed the BDDs for networks with a hundred edges, but failed on some larger networks. When it succeeded, it is very efficient in both time and space, i.e., it ran in a few milliseconds and the size was at most a few millions for a network with a few hundred edges. The shared size was about the half of the sum of all sizes of BDDs, which means that the BDDs shared many nodes. By comparing Contiguous-USA network and the three failed networks, the computational cost depended on the network structure. It should be emphasized that the naive exhaustive search is quite impractical for these networks because, as shown in Cardinality column, there are enormous number of connecting realizations. In particular, at the extreme case, a BDD $\mathcal{D}(s,t)$ for American-Revolution network with some source-target pair $(s,t)$ consisted of only 85 nodes, but represented \begin{align} \begin{tabular}{r} 2,058,334,714,926,419,025,286,040,286,320,\\ 632,494,993,236,943,086,975,345,403,704,463,\\ 133,047,043,046,026,363,318,022,843,662,336\phantom{,} \end{tabular} \end{align} realizations (approximately $2 \times 10^{97}$), which exceeds the number of atoms in the universe (approximately $10^{80}$). This shows the effectiveness of the BDD representation of the connecting realizations. \begin{table*}[tb] \caption{Computational results on real-world networks. Time denotes the average time to construct the BDDs, BDD Size denotes the average number of nodes in the BDDs, Shared Size denotes the total number of distinct nodes in the shared BDDs, and Cardinality denotes the average number of subgraphs represented by the BDDs. Here, average is taken of all distinct $s, t \in V$. For the last three networks, the algorithm failed to compute due to the memory limit.} \label{tbl:exp1} \centering \begin{tabular}{|rrrrrrr|} \hline \multicolumn{1}{|c}{Network} & \multicolumn{1}{c}{Vertices} & \multicolumn{1}{c}{Edges} & \multicolumn{1}{c}{Time [ms]} & \multicolumn{1}{c}{BDD Size} & \multicolumn{1}{c}{Shared Size} & \multicolumn{1}{c|}{Cardinality} \\ \hline South-African-Companies & 11 & 26 & 0.1 & 12.1 & 472 & 2.2e+07 \\ Southern-women-2 & 20 & 28 & 0.3 & 54.7 & 2,266 & 1.3e+08 \\ Taro-exchange & 22 & 78 & 4.1 & 1,119.2 & 277,756 & 1.6e+23 \\ Zachary-karate-club & 34 & 156 & 24.9 & 7,321.8 & 4,988,148 & 6.4e+46 \\ Contiguous-USA & 49 & 214 & 117.9 & 30,599.8 & 41,261,047 & 1.6e+64 \\ American-Revolution & 141 & 320 & 2.2 & 120.0 & 1,530,677 & 5.7e+95 \\ \hline Southern-women-1 & 50 & 178 & --- & --- & --- & --- \\ Club-membership & 65 & 190 & --- & --- & --- & --- \\ Corporate-Leadership & 64 & 198 & --- & --- & --- & --- \\ \hline \end{tabular} \end{table*} \subsection{Scalability on Synthetic Networks} Next, to observe the performance of the algorithm precisely, we conducted experiment on two classes of synthetic networks. The first class was $5 \times w$ grid graph, which has $n = 5 w$ vertices and $9w - 5$ undirected edges, which has a pathwidth of $5$. The second class was the random graph that has the same number of vertices and edges as the grid graph, which has a pathwidth of $\Theta(n)$. We computed influence probability $\sigma(s,t)$ from the north-west corner $s$ to the south-east corner $t$ on the grid graph and the corresponding vertices on the random graph. The results are shown in Figure~\ref{fig:synthetic}. For the grid graphs, BDD size and construction time increased slowly; thus the computation on $n = 100$ was tractable. On the other hand, for the random graphs, BDD size and construction time increased rapidly; thus we could not compute a BDD for $n \ge 45$. These results are consistent with the pathwidths of these networks. For both networks, the influence probabilities decayed exponentially. It decayed faster in grid network since basically the influence probability depends on the network distance. \begin{figure*}[tb] \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{semilogyaxis} [ scale=1.0, xlabel={Number of vertices $n$}, ylabel={Influence probability}, title={(a) Influence Probability}, ylabel near ticks, legend pos=south west, width=\textwidth ] \addplot table [x=n, y=inf] {results/exp2g.txt}; \addlegendentry{Grid} \addplot table [x=n, y=inf] {results/exp2r.txt}; \addlegendentry{Random} \end{semilogyaxis} \end{tikzpicture} \end{minipage} \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{semilogyaxis} [ scale=1.0, xlabel={Number of vertices $n$}, ylabel={BDD Size}, title={(b) BDD Size}, ymin=1, ylabel near ticks, legend pos=south east, width=\textwidth ] \addplot table [x=n, y=size] {results/exp2g.txt}; \addlegendentry{Grid} \addplot table [x=n, y=size] {results/exp2r.txt}; \addlegendentry{Random} \end{semilogyaxis} \end{tikzpicture} \end{minipage} \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{semilogyaxis} [ scale=1.0, xlabel={Number of vertices $n$}, ylabel={Time}, title={(c) Time [s]}, ymin=0.0001, ylabel near ticks, legend pos=south east, width=\textwidth ] \addplot table [x=n, y=time] {results/exp2g.txt}; \addlegendentry{Grid} \addplot table [x=n, y=time] {results/exp2r.txt}; \addlegendentry{Random} \end{semilogyaxis} \end{tikzpicture} \end{minipage} \caption{Computational results on $5 \times w$ grid graphs and random graphs. The algorithm failed to compute the influence spread on the random network with $n \ge 45$ vertices due to the memory limit.} \label{fig:synthetic} \end{figure*} \subsection{Influence Maximization Problem} \label{sec:expinfmax} Here, we consider the influence maximization problem, which seeks $k$ seeds to maximize the influence spread~\cite{kempe2003maximizing}. The greedy algorithm is commonly used to solve this problem, which begins from the empty set $S = \emptyset$ and repeatedly adds the vertex $u$ that has the maximum marginal influence $\sigma(S \cup \{u\}) - \sigma(S)$ into $S$ until $k$ vertices are added. We implemented the greedy algorithm with the exact influence spread to observe the performance of the proposed algorithm in the greedy algorithm. We used the Contiguous USA network and Zachary Karate club networks. The results are shown in Figure~\ref{fig:exp3}. Figure~\ref{fig:exp3}(b) shows that the shared size of BDD did not increase while the algorithm process. The shared size at the $10$-th step of the greedy algorithm was two times larger than the $1$-st step for both networks, and the computational times were proportional to the number of steps, as shown in Figure~\ref{fig:exp3}(c). \begin{figure*}[tb] \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{axis} [ scale=1.0, ylabel={Influence spread}, xlabel={Number of steps}, title={(a) Influence spread}, ylabel near ticks, ymin=0, legend pos=south east, width=\textwidth ] \addplot table [x=step, y=total_influence, col sep=comma] {results/exp3usa.txt}; \addlegendentry{ContUSA} \addplot table [x=step, y=total_influence, col sep=comma] {results/exp3zac.txt}; \addlegendentry{Zachary} \end{axis} \end{tikzpicture} \end{minipage} \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{semilogyaxis} [ scale=1.0, ylabel={Shared Size}, xlabel={Number of steps}, title={(b) Shared Size}, ylabel near ticks, ymin=100000, legend pos = south east, width=\textwidth ] \addplot table [x=step, y=shared_bdd_size, col sep=comma] {results/exp3usa.txt}; \addlegendentry{ContUSA} \addplot table [x=step, y=shared_bdd_size, col sep=comma] {results/exp3zac.txt}; \addlegendentry{Zachary} \end{semilogyaxis} \end{tikzpicture} \end{minipage} \begin{minipage}{.33\textwidth} \begin{tikzpicture} \begin{semilogyaxis} [ scale=1.0, ylabel={Time [s]}, xlabel={Number of steps}, title={(c) Time [s]}, ymin=0.1, legend pos=south east, width=\textwidth ] \addplot table [x=step, y=total_time, col sep=comma] {results/exp3usa.txt}; \addlegendentry{ContUSA} \addplot table [x=step, y=total_time, col sep=comma] {results/exp3zac.txt}; \addlegendentry{Zachary} \end{semilogyaxis} \end{tikzpicture} \end{minipage} \caption{Computational results on the influence maximization problem with exact influence spread.} \label{fig:exp3} \end{figure*} \subsection{Comparison with Monte-Carlo simulation} Finally, for an application of exact influence spread computation, we compared the exact influence spread with the Monte-Carlo simulation. We used the Contiguous USA network, which was also used in the above experiment. In addition, we used a seed set of size $10$ computed by the greedy algorithm with the exact influence spread, and we compared the quality of the approximated spread. The results are shown in Figure~\ref{fig:exp4}. Even for such small size network ($m = 107$ edges) and the large number of Monte-Carlo samples ($N = 10^7$), the estimated influence spread by Monte-Carlo simulation has error in the order of $10^{-3}$, which is consistent with the theory~\cite{ohsaka2014fast}. \begin{figure}[tb] \begin{tikzpicture} \begin{axis} [ scale=0.8, ylabel={Error of the estimated influence}, xlabel={Number of samples}, ymin=-0.002, ymax=+0.0015, xmin=0, ylabel near ticks, yticklabel style={ /pgf/number format/sci, }, ] \addplot table [mark=none,x=samples, y expr={\thisrowno{1} - 16.4145792376}] {results/exp4.txt}; \addplot[domain=0:10000000, samples=100]{0}; \end{axis} \end{tikzpicture} \caption{Accuracy of Monte-Carlo simulation.} \label{fig:exp4} \end{figure} \section{Introduction} \label{sec:introduction} \subsection{Background and Motivation} \emph{Viral marketing} is a strategy to promote products by giving free (or discounted) items to a selected group of highly influential individuals (\emph{seeds}), in the hope that through \emph{word-of-mouth} effects, a significant product adoption will occur~\cite{domingos2001mining,richardson2002mining}. To maximize the number of adoptions, Kempe, Kleinberg, and Tardos~\cite{kempe2003maximizing} mathematically formalized the dynamics of information propagation, and proposed the optimization problem, referred to as the \emph{influence maximization problem}. Several cascade models have been proposed, and the most commonly used one is the \emph{independent cascade model}, proposed by Goldberg, Libai, and Muller~\cite{goldenberg2001talk,goldenberg2001using}. In this model, the individuals are affected by information that is stochastically and independently propagated along edges in the network from the seed (Section~\ref{sec:ICmodel}). To date, significant efforts have been devoted to the development of efficient algorithms for the influence maximization problem~\cite{ohsaka2014fast,cohen2014sketch,borgs2014maximizing,tang2014influence,ohsaka2016dynamic,chen2009efficient,chen2010scalable,cheng2013staticgreedy}. Here we consider the computational complexity of the influence maximization problem. Under the independent cascade model, the expected size of influence spread is a non-negative submodular function~\cite{kempe2003maximizing}; thus, a $(1-1/e)$ approximate solution can be obtained by using a greedy algorithm~\cite{nemhauser1978analysis}. However, the evaluation of influence spread is \#P-hard~\cite{chen2010scalable} because it contains the problem of counting $s$-$t$ connected subgraphs~\cite{valiant1979complexity}. Thus all existing studies avoided the exact computation and employed the Monte-Carlo simulation-based approximation, which simulates the dynamics of information propagation sufficiently many times (e.g., $\Omega(1/\epsilon^2)$) to obtain an accurate (e.g., $1 \pm \epsilon$) approximation of influence spread~\cite{ohsaka2014fast} (Section~\ref{sec:relatedwork}). In this study, we first tackle the problem of \emph{computing influence spread exactly under the independent cascade model.} As the problem is \#P-hard, we are interested in an algorithm that runs on small real-world networks (i.e., having a few hundred edges) in a reasonable time. The motivations for this studies are as follows. \begin{itemize} \item Influence spread over small networks is practically important. Because real social networks often consist of many small communities, it is reasonable to consider each community separately or consider only the inter-community network. \item When we wish to rank vertices according to their influence spread, we need to compute the values accurately. Monte-Carlo simulation cannot be used for this purpose because it requires $\Omega(1 / \epsilon^2)$ samples for $1 \pm \epsilon$ approximation; thus $\epsilon < 10^{-5}$ is impossible. On the other hand, an exact method can be used because its complexity does not depend on the desired accuracy. \item Exact influence spread helps to analyze the quality of Monte-Carlo simulation. Although many experiments using Monte-Carlo simulation have been conducted, none have been compared with the exact value because there is no algorithm that can compute this value. \item Establishing a practical algorithm for the fundamental \#P-hard problem is interesting and important task in computer science. \end{itemize} \subsection{Contributions} In this study, we provide the following contributions. \begin{itemize} \item We propose an algorithm to compute influence spread exactly under the independent cascade model. Note that this is the first attempt to compute this value exactly (Section~\ref{sec:algorithm}). \item The proposed algorithm enumerates all spread patterns using \emph{binary decision diagrams} (BDDs). Then, it computes influence spread by dynamic programming on the BDDs. Here, we have designed a new \emph{frontier-based search} method, which constructs the BDD for $s$-$t$ connected subgraphs efficiently (Section~\ref{sec:frontier}). This is the main technical contribution of this study. \item We conducted computational experiments to evaluate the proposed algorithm (Section~\ref{sec:experiments}). We obtained the exact influence on real-world and synthetic networks with a hundred edges in reasonable times. We also compared the obtained exact influence with the one obtained using the Monte-Carlo simulation. \end{itemize} In addition, using the constructed BDDs, we can also solve the following influence-spread related problems (Section~\ref{sec:application}). \begin{itemize} \item Random sampling from the set of realizations that successfully propagates information helps to understand the route of influence spread. We can perform this \emph{without rejection} by using the BDD. \item The conditional expectation of the influence spread under the influenced (and non-influenced) conditions on some vertices can be used to measure the effect of conducted viral promotion from a small observations. This value is efficiently computed by the BDDs. \item When the activation probability changes, we can efficiently update the influence spread. \item The derivatives of the influence spread with respect to the activation probabilities can be computed. This is used to implement a gradient method for the influence spread optimization problem. \end{itemize} \section{Preliminaries} \label{sec:preliminaries} \subsection{Independent Cascade Model for Influence Spread} \label{sec:ICmodel} The independent cascade model~\cite{goldenberg2001talk,goldenberg2001using} is the most commonly used stochastic cascade model used for social network analysis. The dynamics of this model is given as follows. Let $G = (V, E)$ be a directed graph with vertices $V$ and edges $E$. Each edge $e \in E$ has \emph{activation probability} $p(e)$. Each vertex is \emph{either} active or \emph{inactive}. Note that inactive vertices may become active, but not vice versa. Here, an active vertex is considered ``influenced.'' Suppose that information is propagated from $S \subseteq V$, which is called \emph{seeds}. Initially, all vertices are inactive. Then, propagation over the network is performed as follows. First, each seed $u \in S$ is activated. When $u$ first becomes active, it is given a single chance to activate each currently inactive neighbor $v$ with probability $p((u,v))$. This process is repeated until no further activations are possible. The expected number of activated vertices after the end of the process is called \emph{influence spread}, which is denoted as $\sigma(S)$. There is a useful interpretation of influence spread with this model. We select each edge $e \in E$ with probability $p(e)$. Then, we obtain edge set $F$. We then consider the induced subgraph $G[F] = (V, F)$, which is a network consisting of only the selected edges. Here, let $\sigma(S; F)$ be the number of vertices reachable from some $u \in S$ on $G[F]$. Then, we obtain the following: \begin{align} \label{eq:sigma} \sigma(S) = \mathbf{E}[ \sigma(S; F) ] = \sum_{F \subseteq E} \sigma(S; F) p(F) \end{align} where \begin{align} p(F) = \prod_{e \in F} p(e) \prod_{e' \in E \setminus F} (1 - p(e')). \end{align} We use this formula to compute the influence spread. \subsection{Binary decision diagram} \label{sec:BDD} As discussed in Section~\ref{sec:algorithm}, the exact evaluation of \eqref{eq:sigma} involves enumerating $S$-$t$ connecting subgraphs, which is the graph having a path from $S$ to $t$. To maintain exponentially many such subgraphs, we use the \emph{binary decision diagram} (BDD), which is a data structure to represent a Boolean function compactly based on Shannon decomposition. Note that a Boolean function can be used to represents set family as the indicator function. A BDD is a directed acyclic graph $D = (\mathcal{N}, \mathcal{A})$ with node set $\mathcal{N}$ and arc set $\mathcal{A}$.% \footnote{To avoid confusion, we use the terms ``vertex'' and ''edge'' to refer to a vertex and edge in the original graph $G$, and ``node'' and ``arc'' to refer to a vertex and edge in the BDD $\mathcal{D}$. Vertices are denoted using Roman letters ($u, v, \ldots$) and nodes are denoted using Greek letters ($\alpha, \beta, \ldots$).} It has two terminals $0$ and $1$. Each non-terminal node $\alpha \in \mathcal{N}$ is associated with variable $e \in E$, and has two arcs called $0$-arc and $1$-arc. The nodes pointed by $0$-arc and $1$-arc are referred to as $0$-child and $1$-child (denoted by $\alpha_0$ and $\alpha_1$), respectively. A BDD represents a Boolean function as follows: A path from the root node to the $1$-terminal represents a (possibly partial) variable assignment for which the represented Boolean function is $\texttt{True}$. As the path descends to a $0$-arc ($1$-arc) from a node, the node's variable is assigned to $\texttt{False}$ ($\texttt{True}$). A special type of BDD, i.e., \emph{reduced ordered binary decision diagram} (ROBDD)~\cite{bryant1986graph}, is frequently used in practice. A BDD is ordered if different variables appear in the same order on all paths from the root. A BDD is reduced if the following two rules are applied as long as possible: \begin{align} \label{eq:share} \begin{tabular}{ll} 1. & Share any isomorphic subgraphs. \\ 2. & Eliminate all nodes whose two arcs point to \\ & the same node. \end{tabular} \end{align} These rules eliminate redundant nodes in the BDD. Moreover, when ordering is specified, the ROBDD is determined uniquely~\cite{bryant1986graph}. In terms of Boolean functions, the function represented by the subgraph rooted by $\alpha$ corresponds to a Shannon co-factor. The above two rules correspond to sharing nodes with the same Shannon co-factor. In this paper, we use the term BDD to refer to ROBDD. Figure~\ref{fig:bddexample} shows an example of BDD, whihch represents set family $\{\{c\},\{a,b\},\{a,c\},\{b,c\},\{a,b,c\}\}$. The indicator function is $\phi(a,b,c) = a (b + \bar b c) + \bar a c$, which corresponds to the diagram. \begin{figure}[tb] \caption{BDD for $\{ \{c\}, \{a,b\}, \{a,c\}, \{b,c\}, \{a,b,c\} \}$. the $0$-arc is denoted by the dotted line and the $1$-arcs are denoted by the solid lines. The arcs to $0$-terminal are omitted.} \label{fig:bddexample} \centering \begin{tikzpicture} \node[circle, draw] (a) {a}; \node[circle, draw, below left=0.3 and 1 of a] (b) {b}; \node[circle, draw, below right=1.2 and 1 of a] (c) {c}; \node[rectangle, draw, below left =0.3 and 1 of c] (1) {1}; \foreach \u / \v in {a/b, b/1, c/1} \draw[-latex] (\u) -- (\v); \foreach \u / \v in {a/c,b/c} \draw[dashed,-latex] (\u) -- (\v); \end{tikzpicture} \end{figure} One important feature of BDD is that it allows efficient manipulation of set families. In particular, when two set families are represented by BDDs $\mathcal{D}_1$ and $\mathcal{D}_2$ with the same variable ordering, the union and intersection of these BDDs are performed in $O(|\mathcal{D}_1||\mathcal{D}_2|)$ time. The complement of a set family represented by BDD $\mathcal{D}$ is performed in $O(|\mathcal{D}|)$ time~\cite{bryant1986graph,sieling1993reduction}. This property is utilized in this study. For details about BDDs, see the latest volume of ``The Art of Computer Programming''~\cite{knuth2009art} by Knuth. \section{Related Work} \label{sec:relatedwork} \paragraph{Influence spread computation} After the seminal work by Kempe, Kleinberg, and Tardos~\cite{kempe2003maximizing}, influence spread over networks has become an important topic in social network analysis. However, to the best of our knowledge, no efforts have been devoted to the exact computation of influence spread since it is proved to be \#P-hard by Chen et al.~\cite{chen2010scalable}. To compute influence spread, all existing studies used Monte-Carlo simulation-based approximation, which repeats simulation until a reliable estimation is obtained. This approach is originally proposed in \cite{kempe2003maximizing}. To enhance the scalability, many techniques, such as pruning~\cite{leskovec2007cost} and sample average approximation~\cite{chen2010scalable,cheng2013staticgreedy,ohsaka2014fast} have been investigated. The recent approximation methods are based on the Borgs et al.'s \emph{reverse influence sampling} (RIS) technique~\cite{borgs2014maximizing}, which randomly selects a vertex and then performs reverse BFS to compute the set of vertices reachable to the selected vertex on a random graph. It is important that this procedure is implemented in time proportional to the size of the sample. Therefore it successfully bounds the complexity of influence spread approximation. Tang, Shi, and Xiao~\cite{tang2014influence,tang2015influence} proposed the methods to reduce the number of samples. Note that our formulation~\eqref{eq:RIS} is related with the RIS technique: RIS randomly selects vertices whereas we select all vertices, and RIS samples single reverse influence patterns whereas ours enumerates all reverse influence patterns. \paragraph{Subgraph enumeration} In this study, we virtually solved the enumeration problem of $s$-$t$ connecting subgraphs for the influence spread computation. This problem is known to be \#P-hard~\cite{valiant1979complexity}. If the underlying network is undirected, this problem coincides with the \emph{two-terminal network reliability problem}~\cite{valiant1979complexity,brecht1988lower}, and several algorithms have been proposed to construct a BDD for the problem~\cite{hardy2005computing,yan2015novel}. However, none have been naturally generalized to our directed problem because they essentially exploit the undirected nature of the graph. BDD is used to enumerate several kinds of subgraphs (substructures), such as paths~\cite{knuth2009art}, spanning trees~\cite{sekine1995computing}, and the solutions of logic puzzles~\cite{yoshinaka2012finding}. By comparing these methods, the proposed method involves relatively expensive operations (reachability computation) in the auxiliary functions used in the frontier-based search. Such operations usually make the algorithm non-scalable; thus these are not used in literature. However, in our case, these are necessary to scale up the algorithm by pruning many nodes in each step.
{'timestamp': '2017-01-09T02:02:55', 'yymm': '1701', 'arxiv_id': '1701.01540', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01540'}
arxiv
\section*{Acknowledgment} The work was funded by the Center for Nonlinear Studies at LANL, the Defense Threat Reduction Agency project \textit{Advancing Knowledge of Networks for Understanding Robustness}, and the LANL laboratory directed research and development project \textit{Impacts of Extreme Space Weather Events on Power Grid Infrastructure: Physics-Based Modeling of Geomagnetically Induced Currents (GICs) During Carrington-Class Geomagnetic Storms}. It was carried out under the auspices of the NNSA of the U.S. DOE at LANL under Contract No. DE-AC52-06NA25396. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEtran} \section{Introduction} \label{Sec:intro} \IEEEPARstart{S}{olar} flares and coronal mass ejections drive geomagnetic disturbances (GMD) that lead to changes in the Earth's magnetic field, which then create geo-electric fields. These low-frequency geo-electric fields induce quasi-DC currents, also known as Geomagnetically-Induced Currents (GICs), in grounded sections of power system networks \cite{albertson1973solar,albertso1974effects, albertson1993geomagnetic}. The GIC are superimposed on the usual alternating currents (AC) and bias the AC such that the maximum currents are increased. In many power system components, this bias is not a major concern, however, in transformers, this bias can lead to half-cycle saturation of transformers and the loss of magnetic flux to regions outside of the transformer core. The energy stored in the stray flux increases the reactive power consumption of the transformer, which can affect system voltages. The stray flux also drives eddy currents that can cause excessive transformer heating leading to reduced transformer life or, potentially, immediate damage \cite{GICeffects2012}. The potential impacts of GMD to transformers in the bulk electric power system have led the United States government to increase the understanding of and mitigate the impacts of such events\cite{exec2016}, \cite{FEDERALENERGYREGULATORYCOMMISSION2016}. To mitigate the potential risks introduced by GIC to power systems, the electric power industry has actively improved GIC modeling and GIC monitoring \cite{erinmez2002management,cannon2013extreme,qiu2015geomagnetic,overbye2013power, horton2012test, GIC2013flow}. These models have been used to conduct risk analysis \cite{overbye2013power,overbye2012integration} that investigate the sensitivity of transformer reactive power losses due to GIC and concluded that risk and risk mitigation warrants further study. One focus in the recent literature has been on mitigating the effect of GIC on transformer reactive power consumption and subsequent drops in system voltages and potential voltage collapse. One approach to mitigation is the installation of DC-current blocking devices to keep the GIC from entering through transformer neutrals \cite{bolduc2005development}, however, these devices are expensive, with costs for a single unit close to \$500K \cite{liang2015optimal,zhu2015blocking,kovan2015mitigation}. In an attempt to minimize the projected cost of mitigation, optimization-based methods have been developed to guide the siting of these blocking devices. Instead of performing a full power systems analysis that includes the AC, GIC and full AC power flow equations, these papers have primarily focused on minimizing induced reactive losses independent of the normal AC currents. The intuition of these surrogate models is that small amounts of reactive losses imply small voltage impacts and, presumably, a secure power system. Beyond voltage effects, the literature on risk mitigation associated with transformer heating is relatively sparse. Existing studies focus on assessing transformer susceptibility to GIC effects \cite{girgis2014process} and formulating the thermal response of transformer cores to different levels of GMDs \cite{marti2013simulation}. However, this approach was strictly a screening study and did not recommend methods for mitigation. The work discussed above is a very important start, but it leaves a number of open questions, which we address in this manuscript. First, the installation of blocking devices is very expensive and cost may pose a barrier to adoption. Instead, we focus on developing a GIC-aware optimal power flow (OPF) model that uses existing controls such as generator dispatch, load shedding, and line switching to mitigate the risks of GIC impacts. Second, we incorporate the AC physics of power flow into the GIC-aware OPF because these physics play an important role in the impacts associated with GIC. For example, while minimizing reactive losses may imply small voltage problems across the whole system, these models focus on total losses and can miss relatively large voltage problems in a small part of a system. More importantly, models of hotspot thermal heating inherently depend on both GIC and AC. The setting considered in this manuscript is very challenging. It combines transformer reactive losses, transformer heating, and full AC power flow into an optimization-based operational mitigation setting with line switching. By itself, optimal transmission line switching (OTS) with AC power flow physics is a mathematically challenging problem that includes nonlinearities, nonconvexities and discrete variables. Existing solution methodologies designed for OTS heavily rely on tight convex relaxations and advanced discrete optimization techniques. In recent literature, various convex relaxations and disjunctive representations have been developed. These include second-order-conic (SOC) relaxations \cite{kocuk2017new}, quadratically constrained (QC) relaxations \cite{hijazi2013convex} and Semi-definite programming relaxations \cite{bai2008semidefinite}. In the context of transmission expansion planning applications, the QC relaxations have been effective \cite{nagarajan2017resilient,nagarajan2016optimal} and we use this model here. Despite these recent advances in optimization methods for OTS, global methods still cannot scale to systems with 500 nodes. The main contributions of this paper are the formulation and initial algorithmic solution approaches to an operational decision support tool that incorporates: \begin{enumerate} \item A model of transformer heating as a response to AC and GIC-induced DC, \item A realistic, coupled model of convex, relaxed AC power flows with GIC effects and an algorithm to recover good feasible solutions quickly, and \item An optimization problem that protects the system from reactive losses and thermal heating induced by GIC. \end{enumerate} \section{GIC modeling and ACOTS formulation}\label{Sec:ACOTS and GIC model} \nomenclature[A,01]{\color{black}$N^{a}, N^{d}, N^{o} $}{\color{black}set of nodes in the AC and DC circuit, respectively, where $N^o = N^a \cap N^d$} \nomenclature[A,03]{\color{black}$N^{g} \subseteq N^a$}{set of nodes with exactly one generator} \nomenclature[A,04]{\color{black}$\mathcal{I} \subseteq N^d$}{\color{black}set of substation neutrals} \nomenclature[A,07]{\color{black}$\mathcal{E}^a, \mathcal{E}^d, \mathcal{E}$}{\color{black}set of edges in the AC and DC circuit, respectively, where $\mathcal{E} = \mathcal{E}^a \cup \mathcal{E}^d$} \nomenclature[A,08]{$\mathcal{E}^o \subseteq {\color{black}\mathcal{E}^a}$}{set of transmission lines} \nomenclature[A,10]{\color{black}$\mathcal{E}^g \subseteq \mathcal{E}^a$}{\color{black}set of edges $e_{ij}$ such that either $i$ or $j$ $\in N^g$} \nomenclature[A,11]{\color{black}$\mathcal{E}^\tau \subseteq \mathcal{E}^d$}{\color{black}set of transformer edges used to model the high voltage primary windings of GSU transformers and the common windings of autotransformers in the DC circuit.} \nomenclature[A,12]{\color{black}$\mathcal{E}_i^+\subseteq\mathcal{E}$}{\color{black}set of outgoing edges connected to AC/DC node $i$} \nomenclature[A,13]{\color{black}$\mathcal{E}_i^-\subseteq\mathcal{E}$}{\color{black}set of incoming edges connected to AC/DC node $i$} \nomenclature[A,14]{\color{black}$\mathcal{E}_i$}{\color{black}set of all edges connected to AC/DC node $i$, where $\mathcal{E}_i = \mathcal{E}_i^+ \cup \mathcal{E}_i^-$} \nomenclature[A,15]{\color{black}$\mathcal{E}_i^\tau \subseteq \mathcal{E}^\tau$}{\color{black}set of DC edges used to compute $Q_i^{loss}$ (as described later) for node $i$} \nomenclature[B,01]{$c_{i}^0,c_{i}^1,c_{i}^2$}{generation cost coefficients of generator $i \in N^g$} \nomenclature[B,02]{\color{black}$\eta_{e}^0, \eta_{e}^1,\eta_{e}^2$}{coefficients of the thermal limit curve of transformer line ${\color{black}e } \in \mathcal{E}^{\tau}$} \nomenclature[B,04]{$\mu$}{cost of load shedding} \nomenclature[B,05]{\color{black}$a_{m}$}{admittance of the grounding line at bus ${\color{black}m} \in \mathcal{I}$, 0 if bus ${\color{black}m} \not \in \mathcal{I}$} \nomenclature[B,06]{\color{black}$a_{e}$}{DC admittance of edge ${\color{black} e }\in {\color{black}\mathcal{E}^d} $} \nomenclature[B,07]{$J_{e}$}{induced current by GMD on line $ e \in {\color{black}\mathcal{E}^d} $} \nomenclature[B,08]{$ r_{e}$, $ x_{e} $}{resistance and reactance of line $e \in {\color{black}\mathcal{E}^a} $} \nomenclature[B,09]{$ g_{e}$, $ b_{e} $}{conductance and susceptance of line $e \in {\color{black}\mathcal{E}^a} $} \nomenclature[B,10]{$ g_{i}$, $ b_{i} $}{shunt conductance and susceptance at bus $ i \in {\color{black}N^a} $} \nomenclature[B,11]{$ d_i^p $, $ d_i^q$}{real and reactive power demand at bus $i \in {\color{black}N^a}$} \nomenclature[B,12]{$ b_{e}^c $}{line charging susceptance of line $e \in {\color{black}\mathcal{E}^a} $} \nomenclature[B,13]{$ s_{e} $}{apparent power limit on line $e \in {\color{black}\mathcal{E}^a} $} \nomenclature[B,14]{$ \overline{\theta}$}{phase angle difference limit} \nomenclature[B,15]{$ \theta^M$}{Big-M parameter given by $\lvert{\color{black}\mathcal{E}^a}\rvert\overline{\theta}$} \nomenclature[B,16]{$\overline{I}_{e}^a $}{ AC current flow limit on line $ e \in {\color{black}\mathcal{E}^a} $} \nomenclature[B,17]{\color{black}$ k_{e} $}{loss factor of transformer line ${\color{black}e} \in \mathcal{E}^{\tau}$} \nomenclature[B,18]{$ \underline{V}_i$, $\overline{V}_i$ }{AC voltage limits at bus $i \in {\color{black}N^a}$ } \nomenclature[B,19]{$ \underline{gp}_{i} $, $\overline{gp}_{i} $}{real power generation limits at generator $i \in G$} \nomenclature[B,20]{$ \underline{gq}_{i} $, $\overline{gq}_{i} $}{reactive power generation limits at generator $i \in G$} \nomenclature[B,21]{$\phi$}{the angle of the geo-electric field relative to east} \nomenclature[B,22]{$\mathcal{V}^d$}{GMD induced voltage source} \nomenclature[B,23]{$L_N$,$L_E$}{the north and east components of the displacement of each transmission line, respectively} \nomenclature[B,24]{$E_N$,$E_E$}{strength of the north and east geo-electric field, respectively} \nomenclature[C,01]{$ z_{e} $}{1 if line {\color{black} $e \in \mathcal{E}^a$} is switched on; 0 otherwise} \nomenclature[D,01]{$\theta_i$}{phase angle at bus $i \in{\color{black} N^a }$} \nomenclature[D,04]{$ V_i$}{voltage magnitude at bus $i \in {\color{black}N^a }$} \nomenclature[D,05]{$V_i^d$}{induced DC voltage magnitude at bus $i \in {\color{black}N^d}$} \nomenclature[D,06]{$ l_{e}$}{AC magnitude squared on line $e \in {\color{black}\mathcal{E}^a}$} \nomenclature[D,08]{\color{black}$ I_{e}^d$}{GIC flow on transformer line ${\color{black}e} \in \mathcal{E}^{\tau} $} \nomenclature[D,09]{$\widetilde{I}_{e}^a$}{AC magnitude on line $e \in {\color{black}\mathcal{E}^a} $} \nomenclature[D,10]{\color{black}$ \widetilde{I}_{e}^d$}{ the effective GIC on transformer line ${\color{black}e }\in \mathcal{E}^{\tau} $} \nomenclature[D,11]{$ Q_{i}^{loss}$}{GIC-induced reactive power loss at bus $i \in {\color{black}N^a} $} \nomenclature[D,12]{$ p_{ij}$, $q_{ij}$}{real and reactive power flow on line $ e_{ij} \in {\color{black}\mathcal{E}^a}$, as measured at node $i$} \nomenclature[D,13]{$ f_i^p$, $f_i^q$}{real and reactive power generated at bus $i \in {\color{black}N^a}$} \nomenclature[D,14]{$ l_i^p$, $l_i^q$}{real and reactive power shed at bus $i \in {\color{black}N^a}$} \printnomenclature[0.6in] {\color{black} Each edge, $e_{ij} \in \mathcal{E}$, is given an arbitrary orientation from bus $i$ to bus $j$. We omit the $ij$ subscript when the orientation is not relevant. For $e \in \mathcal{E}^d$, we use notation $\overrightarrow{e} $ to denote the associated AC edge of $e$. This is a one-to-one mapping for transmission lines and a many-to-one mapping for transformers (discussed later). } \subsection{GIC Modeling} \noindent\textbf{$\bm{J_{e}}$ calculation} The computation of transformer hot spot heating and GIC-induced reactive power losses depends on the induced current sources ($J_{e}$) on each power line {\color{black} $e \in \mathcal{E}^d$} in the network, which itself depends on the strength and direction of the geo-electric field associated with the GMD. These relationships are modeled in Eq.(\ref{eq:dc_source}) \begin{equation}\label{eq:dc_source} J_e=a_e\mathcal{V}^d=a_e\oint \vec{E}\cdot d\vec{l}, \end{equation} where, $\vec{E}$ is the geo-electric field at the location of the transmission line, and $d\vec{l}$ is the incremental line segment length, including direction \cite{GIC2013flow}. In practice, the actual geo-electric field varies with time and geographical locations. Using a common assumption that the north and east components of the geo-electric field are constant in the geographical area of the transmission line \cite{horton2012test,zhu2015blocking,GIC2013flow}\footnote{Our model does not depend on this assumption. It only depends on $J_{e}$ as an input parameter.}, $J_{e}$ is calculated as (super- and sub-scripts indicating edges are omitted): \begin{equation}\label{eq:voltage source} \footnotesize J = a\mathcal{V}^d=a(E_NL_N + E_EL_E) = a|E|(\sin(\phi)L_N + \cos(\phi) L_E), \end{equation} where $L_N, L_E, E_N, E_E$ and $\phi$ are as described in the nomenclature (see Appendix I of \cite{GIC2013flow}). {\color{black} Given their short length, generally $J_e = 0$ for transformers, i.e. $e \in \mathcal{E}^\tau$}. \noindent\textbf{Transformer modeling} The two most common transformers in electrical transmission systems subject to GIC are network transformers and generator step-up (GSU) transformers. Network transformers are generally located relatively far from generators and transform voltage between different sections of the transmission system. In contrast, GSUs connect the output terminals of generators to the transmission network. Many IEEE transmission reliability test networks explicitly model network transformers, but generally do not model GSUs. However, GSUs and the neutral leg ground points they provide are critical when modeling GICs and methods to mitigate the impact of GICs. In this manuscript, we modify the IEEE RTS test network by adding a GSU transformer between each generator and its injection bus (see Fig. \ref{fig:4_bus}). Consistent with common engineering practice, we assume that each GSU is grounded on its high voltage side that connects to the transmission network. We also model the switching of the circuit breaker between the high side of the GSU and the transmission network using a binary variable that allows the GSU to be isolated from the network and the quasi-DC GIC to protect the GSU. This switching is performed if the generator output is zero. Although the IEEE test networks include network transformers, transformer type and grounding data are typically not provided. In this manuscript, we assume that all network transformers are auto-transformers and each transformer has a single neutral ground on the low voltage side. Figure \ref{Fig:4_bus_example} includes examples of both GSU and network auto transformer modeling. Figure \ref{fig:4_bus} shows a {\color{black}four-bus} section of the transmission system with a single network transformer ($\mathcal{T}_{jk}$) and two GSU transformers ($\mathcal{T}_i^a,\mathcal{T}_i^b$) independently connecting two generators ($G^a_i,G^b_i$) to the same injection bus $i$. In the simplified AC network of Fig.~\ref{fig:4_bus_ac}, bus $i^a$ and $i^b$ model output terminals of generator $G^a_i$ and $G^b_i$, respectively. Each GSU transformer $\mathcal{T}^a_{i}$ ($\mathcal{T}^a_{j}$) is reduced to a {\color{black} (single)} series impedance $ii^a$ ($ii^b$) with a circuit breaker. The network transformer $\mathcal{T}_{jk}$ is reduced to a {\color{black} (single)} series impedance ($jk$) with a circuit breaker. Under this transformation, the number of buses and lines of {\color{black} the AC network} grow to $|N^o|+|N^g|$ and $|\mathcal{E}^o|+|N^g|$, respectively, where $|N^o|$ and $|\mathcal{E}^o|$ model the original set of buses and edges in the network. Fig.~\ref{fig:4_bus_dc} shows an equivalent single-phase DC circuit of the example system in nodal form. In this figure, {\color{black}$m$ and $n$} model the neutral point of substation $A$ and $B$, respectively. $R_{\mathcal{T}^a_i}$ and $R_{\mathcal{T}^a_i}$ denote the resistance of the primary HV winding of $\mathcal{T}^a_i$ and $\mathcal{T}^b_i$, respectively.\footnote{\color{black} R corresponds to the inverse DC admittance, i.e. $a=\frac{1}{R}$,} $RC_{\mathcal{T}_{jk}}$ and $RS_{\mathcal{T}_{jk}}$ represent the resistance of the common and series windings of $\mathcal{T}_{jk}$, respectively. For grounded GSU transformers, the effective GIC flows through the primary HV winding. {\color{black} For example, in Fig. \ref{fig:4_bus_dc}, the effective GIC of GSU transformer $\mathcal{T}_i^b$ is $\widetilde{I}^d_{\mathcal{T}_i^b}$ which is the GIC flow from bus $i$ to $m$ on $\mathcal{T}_i^b$} \cite{zheng2014effects,overbye2012integration}. For an auto-transformer, the effective GIC is derived from the GIC flows through both the series and common windings {\color{black} as shown in Fig. \ref{Fig:4_bus_example}(c), i.e., \[\widetilde{I}^d = \left|\frac{\alpha I_H + I_L}{\alpha}\right| = \left|\frac{\alpha_AI_S + I_C}{\alpha_A + 1}\right|\] \noindent where $\alpha$ is the turns ratio and $\alpha_A = \alpha_S/\alpha_C = \alpha-1$ (Eq.(14) and Eq.(15) in \cite{zheng2014effects}). }In this manuscript, we assume the turn ratios of all auto-transformers are one. {\color{black} As a result, $\widetilde{I}^d = |I_H + I_L| = |I_C|$, i.e., the effective GIC is the GIC flow through the common winding.\footnote{The model remains convex for any constant turns ratio by substituting $\left|\frac{\alpha I_H + I_L}{\alpha}\right|$ for $|I_C|$.} Thus, in the four-bus network, the effective GIC of autotransformer $\mathcal{T}_{jk}$ is the GIC flow on line $(k,n)$ of Fig. \ref{fig:4_bus_dc}, i.e., $\widetilde{I}^d_{kn}$. } \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \subfigure[4-bus system]{ \includegraphics[scale=0.705]{Figures/4_bus_system} \label{fig:4_bus} } \subfigure[Equivalent AC network]{ \includegraphics[scale=0.72]{Figures/4_bus_ac} \label{fig:4_bus_ac} } \subfigure[Equivalent DC network]{ \includegraphics[scale=1]{Figures/4_bus_dc} \label{fig:4_bus_dc} } \caption{Schematic of the GSU and network transformer modeling used here. \color{black} Picture (c) illustrates the effective GIC calculations. For the autotransformer, $\mathcal{T}_{jk}$, $j$ is the high voltage (HV) bus and $k$ is the low voltage (LV) bus. $R_g$ denotes the substation grounding resistance. $I_H (I_L)$ and $I_S (I_C)$ are the GIC flows through HV (LV) winding and series (common) winding, respectively.} \label{Fig:4_bus_example} \end{figure} \noindent \textbf{GIC-Effects} During GMDs, the quasi-DC GICs may flow through transformers with grounded neutral legs. This quasi-DC current combines with the normal operating AC current creating half-cycle saturation and loss of magnetic flux from the transformer core and leads to several undesirable effects. The two effects that we consider are eddy current-driven transformer heating and excess reactive power consumption from the excess magnetic energy stored in the stray magnetic flux. Both of these effects are challenging to model from first principles, and even if such models existed, they would be too complex to include in the OTS formulation considered here. Instead, we use a combination of manufacturer test and specification data and simplified models. For eddy current-driven transformer heating, we use GIC capability curves (e.g. see Fig.~\ref{fig:thermalcurve}) that may be based on either manufacturer acceptance test data or on electromagnetic and thermal modeling of the transformer design. These curves provide an upper bound on a feasible operating range in the space of AC loading and GIC. The upper bound is also a function of the duration of the combined AC and GIC loading (typically given for 30 minute and 2 minute durations). The sampled points (blue) in Fig.~\ref{fig:thermalcurve} are sampled from a transformer manufacturer's 2-minute duration curve \cite{GICcapacity}. Over a reasonable operating range, these points are well represented by the best-fit quadratic (red) curve with the feasible operating region lying below and to the left of the curve. \begin{figure} \captionsetup{font=footnotesize} \centering \includegraphics[scale=0.3]{Figures/Curvefit_ipe} \caption{Fitted curve for thermal GIC capability of a transformer. Here, we used 180$\degree$ as the maximum allowed temperature of transformers for short-term (2 minutes) peak GIC pulses and assumed that a transformer cannot be loaded to greater than $100\%$ of its MVA limit. The figure shows the coefficients of the constructed quadratic function (curve), $\eta^0_{e}$, $\eta^1_{e}$ and $\eta^2_{e}$, fitted to the collected 11 (blue) points of the GIC thermal capacity measurements. The feasible region of the transformer load current is the area under the curve and is expressed as constraint (\ref{thermal}).}\label{fig:thermalcurve} \vspace{-.7cm} \end{figure} Excess reactive power losses due to GIC has been studied in the literature \cite{overbye2012integration,overbye2013power,zhu2015blocking,liang2015optimal}. We adopt the simplified model in \cite{overbye2012integration} which is shown in Eq.(5). These reactive losses create voltage sags that can adversely impact system operation. The previous work has focused on minimizing these losses to improve system safety. In this manuscript, we explicitly model the AC power equations (voltage magnitudes) so that we can enforce voltage limits directly. \subsection{ACOTS with GIC constraints} \label{subsect:NLmodel} A complete ACOTS model with topology reconfiguration that accounts for GIC-induced transformer thermal heating and transformer reactive power heating is formulated below. \begin{subequations} \label{eq:ACGMD} \allowdisplaybreaks \small \begin{align} &\label{obj} \min \smashoperator{\sum_{i \in G, e \in \mathcal{E}_i}} c_{i}^2(f^p_i)^2 + c_{i}^1f^p_i + z_{e}(c_{i}^0) + \sum_{i \in N} \mu(l^p_i+l^q_i)\\ & \mathrm{\textbf{AC \ power \ flow \ equations}} \nonumber \\ & \label{pbalance} \smashoperator{\sum_{e_{ij} \in {\color{black}\mathcal{E}_i^+}} } p_{ij} + \smashoperator{\sum_{e_{ji} \in {\color{black}\mathcal{E}_i^-}} } p_{ij} =f^p_{i}+l^p_{i}-d^p_{i} - V_i^2g_i \hspace{10pt}\forall i\in {\color{black}N^a}\\ &\label{qbalance}\smashoperator{\sum_{e_{ij}\in {\color{black}\mathcal{E}^+_i}}} q_{ij} + \smashoperator{\sum_{e_{ji}\in {\color{black}\mathcal{E}^-_i}}} q_{ij} =f^q_{i}+l^q_{i}-d^q_{i}+V_i^2b_i - Q_i^{loss} \hspace{10pt} \forall i \in {\color{black}N^a}\\ & \label{pij} p_{ij}=z_{e}(g_{e}V_i^2-V_iV_jg_{e} \cos(\theta_i-\theta_j) \nonumber \\ & \hspace{25pt} -V_iV_jb_{e} \sin(\theta_i-\theta_j)) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{qij} q_{ij}=z_{e}(-(b_{e}+\frac{b_{e}^c}{2})V_i^2 + V_iV_jb_{e} \cos(\theta_i-\theta_j) \nonumber \\ & \hspace{25pt} - V_iV_jg_{e} \sin(\theta_i-\theta_j)) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{pji} p_{ji}=z_{e}(g_{e}V_j^2-V_iV_jg_{e} \cos(\theta_j-\theta_i) \nonumber \\ & \hspace{25pt} -V_iV_jb_{e} \sin(\theta_j-\theta_i)) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{qji} q_{ji}=z_{e}(-(b_{e}+\frac{b_{e}^c}{2})V_j^2 + V_iV_jb_{e} \cos(\theta_j-\theta_i) \nonumber \\ & \hspace{25pt} - V_iV_jg_{e} \sin(\theta_j-\theta_i)) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{ploss} p_{ij}+p_{ji}=z_{e}r_{e}(l_{e}+b_{e}^c q_{ij}+(\frac{b_{e}^c}{2})^2 V_i^2) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{qloss} q_{ij}+q_{ji}=z_{e}(x_{e}(l_{e}+b_{e}^c q_{ij}+(\frac{b_{e}^c}{2})^2 V_i^2) \nonumber \\& \hspace{45pt} -\frac{b_{e}^c}{2}(V_i^2+V_j^2)) \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & \label{dummyloss} p_{ij}+p_{ji}= 0, \ q_{ij}+q_{ji}= 0 \hspace{10pt} \forall e_{ij} \in \mathcal{E}^g\\ & \label{sij} p_{ij}^2 + q_{ij}^2 = l_{e} V_i^2 \hspace{10pt} \forall e_{ij} \in {\color{black}\mathcal{E}^a}\\ & \label{lij} l_{e}=(\widetilde{I}_{e}^a)^2 \hspace{10pt} \forall e \in {\color{black}\mathcal{E}^a} \\ & \mathrm{\textbf{Operational \ limit \ constraints}}\nonumber \\ & \label{capacity} p_{ij}^2+q_{ij}^2 \leq z_{e}s^2_{e}, \;\;\;p_{ji}^2+q_{ji}^2 \leq z_{e}s^2_{e} \hspace{10pt} \forall e_{ij} \in {\color{black}\mathcal{E}^a}\\ & \label{Ia} 0 \leq \widetilde{I}_{e}^a \leq z_{e}\overline{I}_{e}^a \hspace{10pt} \forall e \in {\color{black}\mathcal{E}^a} \\ & \label{vi}\underline{V}_i \leq V_i \leq \overline{V}_i \hspace{10pt} \forall i \in {\color{black}N^a}\\ & \label{thetaij_ub} |\theta_i-\theta_j| \leq z_{e}\overline{\theta} + (1-z_{e})\theta^M \hspace{10pt} \forall e_{ij} \in {\color{black}\mathcal{E}^a \setminus \mathcal{E}^g} \\ & \label{gp} z_{e}\underline{gp}_i \leq f_i^p \leq z_{e}\overline{gp}_i \hspace{10pt} \forall i \in G,\hspace{3pt} e \in \mathcal{E}_i\\ & \label{gq} z_{e}\underline{gq}_i \leq f_i^q \leq z_{e}\overline{gq}_i \hspace{10pt} \forall i \in G, \hspace{3pt} e \in \mathcal{E}_i \\ & \mathrm{\textbf{GIC \ effects \ on \ transformers}} \nonumber \\ &\nonumber\smashoperator{ \sum_{e \in \mathcal{E}^+_m} }z_{\overrightarrow{e}}J_{e} - \color{black} \smashoperator{\sum_{e \in \mathcal{E}^-_m}} z_{\overrightarrow{e}}J_{e} = -a_{m}V_m^d \\&\label{GIC}-\smashoperator{\sum_{e_{mn} \in \mathcal{E}_m^+}} z_{e}a_{e}(V_m^d - V_n^d) + \ \smashoperator{\sum_{e_{nm} \in \mathcal{E}_m^-}} z_{e}a_{e}(V_n^d - V_m^d) \;\;\forall m \in N^d \hspace{-0pt}\\ & \color{black}\label{Id} I_{e}^d=z_{\overrightarrow{e}}a_{e}(V_m^d-V_n^d) \hspace{10pt} \forall e_{mn} \in \mathcal{E}^{\tau} \\ & \color{black}\label{Idmag} \widetilde{I}_{e}^d \geq I_{e}^d, \hspace{10pt} \widetilde{I}_{e}^d \geq - I_{e}^d \hspace{10pt} \hspace{10pt} \forall e \in \mathcal{E}^{\tau} \\ & \label{Idub} 0 \leq {\color{black}\widetilde{I}_{e}^d }\leq \max_{\forall \hat{e} \in {\color{black}\mathcal{E}^a}} 2\overline{I}_{\hat{e}}^a \hspace{10pt} {\color{black}\forall e \in \mathcal{E}^{\tau} }\\ & \label{thermal} \widetilde{I}_{\overrightarrow{e}}^a \leq {\color{black}\eta^0_{e}+\eta^1_{e}\widetilde{I}_{e}^d + \eta^2_{e}(\widetilde{I}_{e}^d)^2 \hspace{10pt} \forall e \in \mathcal{E}^\tau }\\ & \color{black}\label{Qloss} Q_i^{loss}=\smashoperator{ \sum_{e \in \mathcal{E}_i^{\tau}}}k_{e}V_i\widetilde{I}^d_{e} \hspace{10pt}\forall i \in N^a \\ & \label{binary} z_{e} \in \{0, 1 \} \hspace{10pt} \forall e \in {\color{black}\mathcal{E}^a} \end{align} \end{subequations} \vspace{-.2cm} The objective function (\ref{obj}) minimizes total generator dispatch costs and load shedding costs.{ \color{black} Constraints (\ref{pbalance}) -- (\ref{gq}) describe system constraints for the buses and branches in the AC circuit.} Constraints (\ref{pbalance}) and (\ref{qbalance}) represent the nodal real and reactive power balance, including the increased reactive power losses (demand) due to GICs. Constraints (\ref{pij}) through (\ref{qji}) model the AC power flow on each transmission line with on-off variables {\color{black}$z_{e}$}. The flow on any line is forced to zero if the line is switched off. Constraints (\ref{ploss}) through (\ref{dummyloss}) model power loss equations associated with AC power flow. In constraint \eqref{dummyloss}, \textit{fictitious} lines between output terminals of generators and their injection buses are modeled as transportation edges (i.e., $|p_{ij}|=|-p_{ji}|= f^p_i, |q_{ij}|=|-q_{ji}|= f^q_i \hspace{6pt} \forall e_{ij} \in \mathcal{E}^g $). Nonconvex constraint (\ref{sij}) evaluates current magnitude $l_{ij}$, an auxiliary variable introduced to bound the squared AC current flow magnitude in constraint (\ref{lij}). Constraints (\ref{capacity}) through (\ref{gq}) describe the operational limits of the grid; constraint (\ref{capacity}) models operational thermal limits of lines in both directions. Constraint (\ref{vi}) limits the voltage magnitude at buses. Constraint (\ref{thetaij_ub}) applies appropriate bounds on phase angle difference between two buses when the line exists. Constraints (\ref{gp}) and (\ref{gq}) model the availability and capacity of power generation. A generator is offline if its line is switched off. {\color{black}The DC circuit and the effects associated with the GMD are formulated in constraints (\ref{GIC})-(\ref{thermal}). Recall that we link an edge, $e \in \mathcal{E}^d$ in the DC circuit to an edge in the AC circuit with $\overrightarrow{e}$. Also recall that the HV primary winding of GSU transformer $e_{ij} \in \mathcal{E}^a$ is modeled by introducing a node and edge in the DC circuit (node $m$ in Fig. \ref{Fig:4_bus_example}(c)). Similarly, the common winding of autotransformer $e_{ij} \in \mathcal{E}^a$ is modeled in the DC circuit by introducing additional nodes and edges (see Fig. \ref{Fig:4_bus_example}(c)). By using these notations,} constraints (\ref{GIC}) and (\ref{Id}) calculate the GIC {\color{black}flow on each DC} line by applying Kirchhoff's current law. The GIC on a line is determined by the induced current source and the quasi-dc voltage difference between two buses \cite{GIC2013flow}. GIC flow is forced to 0 by $z_{e}$ when $e$ is switched off. Since the value of {\color{black}$I_{e}^d$} can be negative, decision variables {\color{black}$\widetilde{I}_{e}^d$} are introduced to model the magnitude (absolute value) of {\color{black}GIC flows (i.e., $\widetilde{I}_{e}^d = |I_{e}^d|$)}. Instead of introducing additional discrete variables, constraint (\ref{Idmag}) is used to model and relax the magnitude of {\color{black}$I_{e}^d$}. Constraint (\ref{Idub}) denotes the maximum allowed value of GIC flowing through transformers. We assume this limit is twice the upper bound of AC flows in the network. Constraint (\ref{thermal}) guarantees that the hot spot temperature of transformers due to the combination of AC and GICs is below the thermal limits for peak GIC. Constraint (\ref{Qloss}) computes the reactive power load due to GIC transformer saturation \cite{albertson1973solar,overbye2013power, zheng2014effects, zhu2015blocking} {\color{black} by using the effective GIC on the primary winding in GSU transformers and the common winding in autotransformers ($\mathcal{E}^\tau_i$)}. The couplings between AC power flows and GIC occur in constraints (\ref{qbalance}), (\ref{thermal}), and (\ref{Qloss}). \vspace{-0.3cm} \subsection{Convex Relaxations} \label{subsec:ConvexRelaxation} The ACOTS with GIC constraints is a mixed-integer, non-convex optimization problem that is generally computationally very difficult to solve. We adopt the convex relaxations developed by \cite{hijazi2013convex} and later show that the results obtained with the relaxation is (empirically) tight. We now discuss the key features of the relaxations extended to the problem with GIC. \noindent \textbf{Handling bilinear terms} Given any two variables $x_i$, $x_j \in \mathbb{R}$, the McCormick relaxation is used to linearize the bilinear product $x_ix_j$ by introducing a new variable $\widehat{x_{ij}} \in {\langle x_i, x_j \rangle}^{MC}$. The feasible region of $\widehat{x_{ij}}$ is defined by inequalities (\ref{eq:SMC}). Note that the MC relaxation is exact if one variable is binary. \vspace{-0.5cm} \begin{subequations} \label{eq:SMC} \small \allowdisplaybreaks \begin{align} & \label{McCormick}\widehat{x_{ij}} \geq \underline{x}_ix_j+\underline{x}_jx_i -\underline{x}_i \hspace{2pt} \underline{x}_j \\ &\widehat{x_{ij}} \geq \overline{x}_ix_j+\overline{x}_jx_i - \overline{x}_i \hspace{2pt} \overline{x}_j \\ &\widehat{x_{ij}} \leq \underline{x}_ix_j+\overline{x}_jx_i-\underline{x}_i \hspace{2pt} \overline{x}_j \\ &\widehat{x_{ij}} \leq \overline{x}_ix_j+\underline{x}_jx_i-\overline{x}_i \hspace{2pt} \underline{x}_j \\ & \underline{x}_i \leq x_i \leq \overline{x}_i, \ \underline{x}_j \leq x_j \leq \overline{x}_j \end{align} \end{subequations}% \noindent \textbf{Quadratic terms} Given a variable $x_i \in \mathbb{R}$, a second-order conic relaxation can be applied to convexify the quadratic term $x_i^2$ by introducing a new variable $\widehat{x_{i}} \in {\langle x_i\rangle}^{MC-q}$, as defined in equation (\ref{eq:MC-q}). \vspace{-.25cm} \begin{subequations} \label{eq:MC-q} \small \allowdisplaybreaks \begin{align} & \label{McC-q}\widehat{x_{i}} \geq x_i^2\\ &\widehat{x_{i}} \leq (\overline{x}_i+\underline{x}_i)x_i - \overline{x}_i\underline{x}_i\\ & \underline{x}_i \leq x_i \leq \overline{x}_i \end{align} \end{subequations}% \noindent \textbf{On/off trigonometric terms} In constraints \eqref{pij}, \eqref{qij}, \eqref{pji} and \eqref{qji}, if the line $e_{ij}$ is switched off, \cite{hijazi2013convex} suggests the following procedure to deactivate the associated trigonometric terms: Given the phase angle difference variable $\theta_{ij} = \theta_i - \theta_j$ and on/off variable $z_{e} \in \{0, 1\}$, a disjunctive quadratic relaxation is used to convexify the nonlinear function $z_{e} \cos(\theta_{ij})$ by introducing a new variable $\widehat{cs}_{ij} \in {\langle z_{e} cos(\theta_{ij})\rangle}^{R}$, as formulated in (\ref{eq:cos}). \begin{subequations} \label{eq:cos} \small \allowdisplaybreaks \begin{align} &\widehat{cs}_{ij} \leq z_{e} - \frac{1- \cos(\overline{\theta})}{(\overline{\theta})^2}(\theta_{ij}^2+(z_{e}-1)(\theta^{u})^2) \\ &z_{e}\cos(\overline{\theta}) \leq \widehat{cs}_{ij} \leq z_{e} \end{align} \end{subequations}% Similarly, for $z_{e}sin(\theta_{ij})$, a disjunctive polyhedral relaxation is applied by introducing a new variable $\widehat{s}_{ij} \in {\langle z_{e} sin(\theta_{ij})\rangle}^{R}$, as described in equation (\ref{eq:sin}). \begin{subequations} \label{eq:sin} \small \allowdisplaybreaks \begin{align} & \widehat{s}_{ij} \leq \cos(\bar{\theta}/2)\theta_{ij}+z_{e}(\sin(\bar{\theta}/2)-\bar{\theta}/2\cos(\bar{\theta}/2)) \\ & \nonumber \hspace{20pt}+ (1-z_{e})(\cos(\bar{\theta}/2)\theta^{M} +1)\\ &\widehat{s}_{ij} \geq \cos(\bar{\theta}/2)\theta_{ij}-z_{e}(\sin(\bar{\theta}/2)-\bar{\theta}/2\cos(\bar{\theta}/2)) \\ & \nonumber \hspace{20pt}- (1-z_{e})(\cos(\bar{\theta}/2)\theta^{M} +1)\\ &z_{e}\sin(-\overline{\theta}) \leq \widehat{s}_{ij} \leq z_{e}\sin(\overline{\theta}) \end{align} \end{subequations}% Based on the above relaxations, we replace the non-convex constraints in \eqref{pij}, \eqref{qij}, \eqref{pji} and \eqref{qji} with equations (\ref{Quad}): \begin{subequations} \label{Quad} \small \begin{align} & p_{ij}=g_{e} \widehat{zv}_{ij}-g_{e} \widehat{wc}_{ij} - b_{e} \widehat{ws}_{ij} \hspace{10pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g\\ & q_{ij}=-(b_{e}+\frac{b_{e}^c}{2}) \widehat{zv}_{ij} + b_{e}\widehat{wc}_{ij} - g_{ij} \widehat{ws}_{ij} \hspace{4pt} \forall e_{ij} \in \mathcal{E}^a \setminus \mathcal{E}^g \end{align} \end{subequations} where, the new variables $\widehat{zv_{ij}}$, $\widehat{wc}_{ij}$ and $\widehat{ws}_{ij}$, admit feasible regions as given in equations (\ref{PFRelax}): \begin{subequations} \label{PFRelax} \small \begin{align} & \widehat{cs}_{ij} \in {\langle z_{e}cos(\theta_{ij})\rangle}^{R}, \ \ \widehat{s}_{ij} \in {\langle z_{e}sin(\theta_{ij})\rangle}^{R}\\ & \widehat{v_i} \in {\langle V_i\rangle}^{MC-q}, \ \ \widehat{zv}_{ij} \in {\langle z_{ij}, \widehat{v}_i \rangle}^{MC}, \\ &\widehat{w}_{ij}\in {\langle V_i, V_j \rangle}^{MC},\\ & \widehat{wc}_{ij} \in {\langle \widehat{w}_{ij}, \widehat{cs}_{ij}\rangle}^{MC}, \ \ \widehat{ws}_{ij} \in {\langle \widehat{w}_{ij}, \widehat{s}_{ij} \rangle}^{MC} \end{align} \end{subequations} \noindent \textbf{Other nonconvex constraints} Further, non-convex constraints \eqref{sij} and \eqref{lij} are relaxed to a convex, rotated second-order conic constraint by using the introduced lifted variable $\widehat{v_i}$ (for \eqref{sij}) as follows: \begin{subequations} \begin{align} &p_{ij}^2 + q_{ij}^2 \leq l_{e}\widehat{v_i} \ \ \forall e_{ij} \in {\color{black}\mathcal{E}^a}, \\ & l_{e}\geq (\widetilde{I}_{e}^a)^2 , \ l_{e}\leq (\overline{I}_{e}^a)\widetilde{I}_{e}^a\ \ \forall e \in {\color{black}\mathcal{E}^a} \end{align} \end{subequations} Convex relaxations of the reformulated thermal heating limit constraint (\ref{thermal}) and excess reactive power losses equation (\ref{Qloss}) are stated here in equations (\ref{eq:thermal&qloss}): \begin{subequations} \label{eq:thermal&qloss} \small \begin{align} & \widetilde{I}_{\overrightarrow{e}}^a \leq {\color{black}\eta^0_{e}+\eta^1_{e}\widetilde{I}_{e}^d + \eta^2_{e}\widehat{I}_{e}^d \hspace{10pt} \forall e \in \mathcal{E}^\tau }\\ & Q_i^{loss}={\color{black}\smashoperator{ \sum_{ e \in \mathcal{E}_i^{\tau}}}k_{e}\widehat{VI}^d_{e} \hspace{10pt}\forall i \in N^a }\\ &\color{black} \widehat{I}_{e}^d \in {\langle \widetilde{I}_{e}^d \rangle}^{MC-q} \hspace{10pt} \forall e \in \mathcal{E}^\tau \\ &\color{black}\widehat{VI}_{e}^d \in {\langle {V}_{i}, \widetilde{I}_{e}^d \rangle}^{MC} \hspace{10pt} \forall i \in \mathcal{E}^a, \ \ \forall e \in \mathcal{E}^\tau_i \end{align} \end{subequations}% {\color{black} Convex relaxations of the GIC injection constraints (\ref{GIC}) and (\ref{Id}) are described in equation (\ref{eq:gic_mc}). \begin{subequations} \label{eq:gic_mc} \small \begin{align} &\nonumber \smashoperator{\sum_{e \in \mathcal{E}^+_m}}z_{\overrightarrow{e}}J_{{e}} -\smashoperator{\sum_{e \in \mathcal{E}^-_m}}z_{\overrightarrow{e}}J_{{e}} = -a_{m}V_m^d \\ &-\smashoperator{\sum_{e \in \mathcal{E}^+_m}}a_{e}\widehat{zv}_{e}^d +\smashoperator{\sum_{e \in \mathcal{E}^-_m}}a_{e}\widehat{zv}_{e}^d \hspace{8pt} \forall m \in N^d \\ & I_{e}^d=a_{e}\widehat{zv}_{e}^d \hspace{10pt} \forall e \in \mathcal{E}^{\tau} \\ & \widehat{zv}_{e}^d \in {\langle {z}_{\overrightarrow{e}}, (V^d_m - V^d_n) \rangle}^{MC} \hspace{10pt}\forall e_{mn} \in \mathcal{E}^d \end{align} \end{subequations}% } \section{Case Study} \label{Sec:case study} In this section, we analyze the performance and sensitivity of a power system when exposed to varying strengths of geo-electric fields induced by GMDs. We use a modified version of single area IEEE RTS-96 system \cite{wong1999ieee}. Its size is comparable to previous work \cite{zhu2015blocking} that considered minimization of the quasi-static GICs and not a full AC-OPF with topology control. The derived and modified parameters of IEEE RTS-96 are presented in Table \ref{tb:para_1}--\ref{tb:para_2}. We arbitrarily placed the system in western Pennsylvania to give the model a geographic orientation. We assume the cost of shedding load is twice the cost of the most expensive generator. We performed all computations using the high performance computing resources at Los Alamos National Laboratory with Intel(R) Xeon(R) CPU E5-2660 v3 @2.60GHz processor and 120 GB memory installed. All cases were solved using CPLEX 12.7.0 (default options). Knitro 10.2.1 (default options) was used as the local solver. JuMP was used as an algebraic modeling language \cite{dunning2015jump}. For reference, the peak geo-electric field during the HydroQuebec event of 1989 was 2 V/km ($\approx$3.2 V/mile) \cite{walling1991characteristics, boteler1994geomagnetically}. References \cite{pulkkinen2012generation} and \cite{backhaus} suggests that 100-year GMDs could cause 5 V/km ($\approx$9 V/mile) and 13 V/km ($\approx$21 V/mile), respectively, at some high-latitude locations. In our case studies, we consider middle ground, but still extreme, geo-electric fields of 12 V/mile and 14 V/mile. We also study the directionality of the event by considering field directions between $0\degree$ and $360\degree$ spaced by $10\degree$. To analyze the benefits for GIC mitigation of generator dispatch and load shedding and the combined effects of those two controls plus topology control, we studied three cases. To describe these cases, we define $\mathbf{z}^*_x$ and $c^*_x$ to be the optimal topology (line on/off) decisions and objective (minimum total costs), respectively, for case $x$. The models are defined below as ($M_x$). The solutions of $\mathbf{z}_x^*$ and $c_x^*$ are obtained from the convex relaxations of $M_x$ described in Section \ref{subsec:ConvexRelaxation}. The cases we consider are: \begin{enumerate} \item C1: The ACOTS model neglecting GIC effects ($c^*_{o}$, $\mathbf{z}^*_{o}$): \\ $M_o := $ Min\{(\ref{obj}): (\ref{pbalance})-(\ref{gq}); (\ref{binary}); $\mathbf{Q}^{loss} = \mathbf{0}$\} \label{case1} \item C2: The ACOTS with GIC effects ( $c^*_{gmd}$, $\mathbf{z}^*_{gmd}$):\\ $M_{gmd} := $ Min\{(\ref{obj}): (\ref{pbalance})-(\ref{binary})\} \label{case2} \item C3: The ACOPF (fixed $\mathbf{z}=\mathbf{z}^*_{o}$) with GIC effects ($c^*_{f}$, $\mathbf{z}^*_{o}$):\\ $M_{f} := $ Min\{(\ref{obj}): (\ref{pbalance})-(\ref{binary}); $\mathbf{z}=\mathbf{z}^*_{o}$\} \label{case3} \item C4: The ACOPF (fixed $\mathbf{z}=1$) with GIC effects ($c^*_{\mathbf{1}}$, $\mathbf{1}$):\\ $M_{\mathbf{1}} := $ Min\{(\ref{obj}): (\ref{pbalance})-(\ref{binary}); $\mathbf{z}=1$\} \label{case4} \end{enumerate}% Case C1 defines the topology $\mathbf{z}^*_o$ and evaluates the objective $c^*_o$ that results from neglecting the effects of GICs. Case C3 evaluates the new cost $c^*_f$ that results from mitigating GIC with generation dispatch on the topology of C1. Case C4 is similar to case C3, but all lines are closed. Case C2 considers the effects of both generation dispatch and topology control. {\color{black} All results in this section are based on the convex relaxation (except for Section \ref{sec:recover} which evaluates the quality of the relaxation by recovering feasible solutions to the original non-convex formulation).} \begin{table} \captionsetup{font=footnotesize} \centering \scriptsize \caption{Transformer data. In this manuscript, all network transformers are auto-transformers. The transformer winding resistance and $k$ are estimated based on the test cases provided in \cite{GIC2013flow, horton2012test}. } \setlength{\tabcolsep}{0.85em} \allowbreak \begin{tabular}{lccccccc} \toprule &&Resistance&&Resistance&&&\\ Name&Type&W1&Bus&W2&Bus&Line&k\\ &&(Ohm)&No.&(Ohm)&No.&No.&(p.u.)\\ \midrule A 1&Auto&0.12&3&0.18&24&7&1.8\\ A 2&Auto&0.12&9&0.18&11&14&1.8\\ A 3&Auto&0.12&9&0.18&12&15&1.8\\ A 4&Auto&0.12&10&0.18&11&16&1.8\\ A 5&Auto&0.12&10&0.18&12&17&1.8\\ G 1&GSU&0.3&1& N/A &25&44&1.8\\ G 2&GSU&0.3&1& N/A &26&45&1.8\\ G 3&GSU&0.3&1& N/A &27&46&1.8\\ G 4&GSU&0.3&1& N/A &28&47&1.8\\ G 5&GSU&0.3&2& N/A &29&48&1.8\\ G 6&GSU&0.3&2& N/A &30&49&1.8\\ G 7&GSU&0.3&2& N/A &31&50&1.8\\ G 8&GSU&0.3&2& N/A &32&51&1.8\\ G 9&GSU&0.3&7& N/A &33&52&1.8\\ G 10&GSU&0.3&7& N/A &34&53&1.8\\ G 11&GSU&0.3&7& N/A &35&54&1.8\\ G 12&GSU&0.3&13& N/A &36&55&1.8\\ G 13&GSU&0.3&13& N/A &37&56&1.8\\ G 14&GSU&0.3&13& N/A &38&57&1.8\\ G 15&GSU&0.3&14& N/A &39&58&1.8\\ G 16&GSU&0.3&15& N/A &40&59&1.8\\ G 17&GSU&0.3&15& N/A &41&60&1.8\\ G 18&GSU&0.3&15& N/A &42&61&1.8\\ G 19&GSU&0.3&15& N/A &43&62&1.8\\ G 20&GSU&0.3&15& N/A &44&63&1.8\\ G 21&GSU&0.3&15& N/A &45&64&1.8\\ G 22&GSU&0.3&16& N/A &46&65&1.8\\ G 23&GSU&0.3&18& N/A &47&66&1.8\\ G 24&GSU&0.3&21& N/A &48&67&1.8\\ G 25&GSU&0.3&22& N/A &49&68&1.8\\ G 26&GSU&0.3&22& N/A &50&69&1.8\\ G 27&GSU&0.3&22& N/A &51&70&1.8\\ G 28&GSU&0.3&22& N/A &52&71&1.8\\ G 29&GSU&0.3&22& N/A &53&72&1.8\\ G 30&GSU&0.3&22& N/A &54&73&1.8\\ G 31&GSU&0.3&23& N/A &55&74&1.8\\ G 32&GSU&0.3&23& N/A &56&75&1.8\\ G 33&GSU&0.3&23& N/A &57&76&1.8\\ \bottomrule \end{tabular} \label{tb:para_1} \end{table} \begin{table} \captionsetup{font=footnotesize} \caption{Power system model parameters. The nominal line length parameters of a single area of RTS-96 \cite{wong1999ieee} are used to perform an approximate geospatial layout of the power system nodes. (b) The substation grounding resistance $GR$ is estimated from typical values of grounding resistance of substations provided in \cite{morstad2012grounding}. (c) The original line parameters $r_{e}^o$ and $x_{e}^o$ are scaled by the ratio $kl_{e}$ of the new to original line lengths.} \centering \scriptsize \subtable[Transmission line data]{ \setlength{\tabcolsep}{0.6em} \begin{tabular}{lcccc} \toprule Line & From & To & Length \\ & Bus & Bus & (miles) \\ \midrule 1 & 1 & 2 & 3.98 \\ 2 & 1 & 3 & 53.15 \\ 3 & 1 & 5 & 22.78 \\ 4 & 2 & 4 & 33.16 \\ 5 & 2 & 6 & 44.49 \\ 6 & 3 & 9 & 33.56 \\ 7 & 3 & 24 & 0.00 \\ 8 & 4 & 9 & 26.89 \\ 9 & 5 & 10 & 23.38 \\ 10 & 6 & 10 & 19.96 \\ 11 & 7 & 8 & 16.04 \\ 12 & 8 & 9 & 43.51 \\ 13 & 8 & 10 & 43.51 \\ 14 & 9 & 11 & 0.00 \\ 15 & 9 & 12 & 0.00 \\ 16 & 10 & 11 & 0.00 \\ 17 & 10 & 12 & 0.00 \\ 18 & 11 & 13 & 35.95 \\ 19 & 11 & 14 & 33.98 \\ 20 & 12 & 13 & 35.95 \\ 21 & 12 & 23 & 70.48 \\ 22 & 13 & 23 & 57.39 \\ 23 & 14 & 16 & 27.36 \\ 24 & 15 & 16 & 12.18 \\ 25 & 15 & 21 & 35.44 \\ 26 & 15 & 21 & 35.44 \\ 27 & 15 & 24 & 38.43 \\ 28 & 16 & 17 & 18.77 \\ 29 & 16 & 19 & 18.57 \\ 30 & 17 & 18 & 10.75 \\ 31 & 17 & 22 & 72.84 \\ 32 & 18 & 21 & 17.96 \\ 33 & 18 & 21 & 17.96 \\ 34 & 19 & 20 & 29.97 \\ 35 & 19 & 20 & 29.97 \\ 36 & 20 & 23 & 15.59 \\ 37 & 20 & 23 & 15.59 \\ 38 & 21 & 22 & 51.83 \\ \bottomrule \end{tabular} } \subtable[Substation data]{ \setlength{\tabcolsep}{0.4em} \begin{tabular}{lcccc} \toprule &&&GR\\ Name&Latitude&Longitude&(Ohm)\\ \midrule SUB 1&40.44&-78.80&0.1 \\ SUB 2&40.44&-78.73&0.1 \\ SUB 3&40.90&-79.61&0.1 \\ SUB 4&40.70&-79.26&0.1 \\ SUB 5&40.70&-79.07&0.1 \\ SUB 6&41.08&-78.61&0.1 \\ SUB 7&40.50&-78.20&0.1 \\ SUB 8&40.53&-78.50&0.1 \\ SUB 9&41.03&-78.99&0.1 \\ SUB 10&41.22&-78.35&0.1 \\ SUB 11&41.48&-79.26&0.1 \\ SUB 12&41.45&-79.71&0.1 \\ SUB 13&41.63&-79.75&0.1 \\ SUB 14&41.86&-79.94&0.1 \\ SUB 15&42.01&-79.86&0.1 \\ SUB 16&41.77&-79.45&0.1 \\ SUB 17&42.01&-78.95&0.1 \\ SUB 18&41.95&-79.52&0.1 \\ SUB 19&42.41&-78.73&0.1 \\ SUB 20&42.02&-78.65&0.1 \\ \bottomrule & \\ & \\ \multicolumn{4}{c}{{\footnotesize(c) Other parameters}}\\[0.6ex] \toprule $\mu$ & \multicolumn{2}{|c}{\$ 1000 /MW (or MVar)} \\[0.6ex] $\overline{I}^a_{e}$ & \multicolumn{2}{|c}{$T_{e}/\min\{\underline{V}_i, \underline{V}_j\}$} \\[0.6ex] $r_{e}$ & \multicolumn{2}{|c}{$(\beta_{e}) r^{o}_{e}$} \\[0.6ex] $x_{e}$ & \multicolumn{2}{|c}{$(\beta_{e}) x^{o}_{e}$} \\[0.6ex] $\overline{\theta}$ &\multicolumn{2}{|c}{30\degree}\\ \bottomrule \end{tabular} } \label{tb:para_2} \end{table} \vspace{-0.3cm} \subsection{GIC Modeling Validation} \begin{table}[htp!] \centering \footnotesize \caption{The test case in \cite{GIC2013flow}, Appendix II} \begin{tabular}{ccc} \toprule Variable Name&Transformer&GIC flow (amps)\\ \midrule $I_{12}$&-&-627.02 \\ $I_{s}$&T2 series&-763.26 \\ $I_{34}$&-&-763.26 \\ $I_{T1}$&T1& 627.02\\ $I_{c}$&T2 common& 136.24 \\ $I_{T3}$&T3& -763.26\\ \bottomrule \end{tabular} \label{tab:my_label} \end{table}% To validate the GIC modeling in Eq.(\ref{GIC})--(\ref{Idub}), we tested our model on the 6-bus system given in Appendix II of \cite{GIC2013flow} and compared our solution with the results provided in this reference. Table \ref{tab:my_label} displays the GIC flows obtained by solving Eq.(\ref{GIC})--(\ref{Idub}) with fixed $z_{e} = 1$ (in \cite{GIC2013flow} the GIC flows are calculated without line switching options). This solution matches the results found in the reference (see Eq.(B.5)--Eq.(B.10)). \subsection{Case C1: Potential Damage by GICs} Under normal circumstances without GMDs, line switching decisions are determined by economic dispatch. More specifically, the optimal system topology is obtained by solving an ACOTS model without the GIC-effects constraints (Case C1). Figure \ref{fig:normal} shows the optimal normal topology, $\mathbf{z}_o^*$, where some generators are not injecting real or reactive power. For example, generators 16 through 20 are shut down at node 15, and their GSU transformers are disconnected from the network using the circuit breakers. Referring to Fig.~\ref{Fig:4_bus_example}, we note that this action does not significantly affect the topology of the AC network, which is only affected by switching transmission lines. This action removes GSU transformer ground points from the DC network topology over which the GICs flow. Case C1 assumes that generation and system topology are optimized for cost while neglecting the impact of GICs. This impact is calculated using Eqs. (\ref{GIC}) through (\ref{Idmag}) to evaluate the feasibility of thermal limit constraint (\ref{Idub}). Figure \ref{fig:damagedtrans} shows how many GSU and network transformers would be overheated under C1 depending on the direction and strength of the GMD. Figure~\ref{fig:damagedtrans}, presents results for $c^*_{gmd}$ from 0 to 180$^\circ$ because the strength of the geo-electric field is uniform, and the effects do not depend on field direction. For example, when the electric field is 12 V/mile, the GSU transformer 23 (at node 18) is overheated when the event is oriented between 100$\degree$ and 170$\degree$. When the strength is increased to 14 V/mile, one or more transformers are overheated at almost all orientations of the GMD. For example, when the event is oriented at 10$\degree$, GSU transformers 21, 22 and 23 are overheated. As the event is shifted to 80\degree, then network transformer 1 is the transformer at risk. These results provide a baseline to evaluate alternative operating paradigms that ensure system security. \begin{figure}[!h] \captionsetup{font=footnotesize} \centering \subfigure[Optimal topology $\mathbf{z}^*_o$ in case C1]{ \includegraphics[scale=0.29]{Figures/geomap_case24_new.pdf} \label{fig:normal} } % \subfigure[Potential damage of transformers by GICs { \includegraphics[scale=0.355]{Figures/damaged_transformers_new_ipe.pdf} \label{fig:damagedtrans} }% \caption{Evaluation of the power system in Table~\ref{tb:para_1}--\ref{tb:para_2} for case C1. (a) The grey nodes are loads. The blue lines indicate network transformers. The green and magenta nodes indicate GSU transformers. Transformer IDs are listed next to the node. The solution to case C1 does not allow reconfiguration of the topology via the network transformers, however, if a generator is not injecting real or reactive power into the network, its GSU is disconnected using the circuit breakers in Fig.~\ref{Fig:4_bus_example}. Generation nodes with disconnected GSU transformers are magenta and their (network or GSU) transformer IDs are marked as magenta as well. (b) The case C1 solution is tested by applying geo-electric fields of strength 12 V/mile and 14 V/mile for all directions. The label above each bar indicates IDs of overheated transformers. Red and green are used to label network transformers and GSU transformers, respectively. } \label{Fig:case1} \end{figure}% \subsection{Case C2: GIC Mitigation via ACOTS} Using case C2, the cost benefits of simultaneous controlling generation dispatch and network topology to mitigate GIC effects are evaluated. \subsubsection{Cost Analysis} For geo-electric field strengths of 12 V/mile and 14 V/mile, case C2 is solved for orientations of the field from 0 to 360$^\circ$, which results in a total cost $c^*_{gmd}$ (see Fig.~\ref{fig:obj_all}) and topology $y^*_{gmd}$ (discussed later). Figure~\ref{fig:obj_all} only presents results for $c^*_{gmd}$ from 0 to 180$^\circ$ because of the symmetry discussed above. The results in Fig.~\ref{fig:obj_all} show that the directions of the geo-electric field are not all equivalent because the cost of mitigation $c^*_{gmd}$ varies with direction. The most costly GMDs occur when the event is oriented between 20$\degree$ and 140$\degree$. The increase in cost between 12 V/mile and 14 V/mile is primarily due to changes in generator dispatch and is not significant. For example, the difference in cost between the 12V and 14V per mile case is 1.40\% when the GMD is oriented at 60$\degree$. {\color{black} Moreover, the dispatch cost is smaller when GIC effects are neglected (Case C1). However, the transformer thermal limit constraints are violated when GIC effects are applied to the network (as seen in Fig. \ref{fig:damagedtrans}). Thus, there is an implicit higher cost associated with replacing the damaged equipment and unexpected load shed when the transformer fails.} \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \includegraphics[scale=1.0]{Figures/ots_gic_obj_ipe.pdf} \caption{The total cost $c^*_{gmd}$ for case C2 for different geo-electric field orientations and strengths.} \label{fig:obj_all} \end{figure}% \subsubsection{Topology Control Analysis} In Fig.~\ref{fig:obj_all}, the topology of the network varies with the strength and direction of the GMD. In the remainder of this section, we focus on GMD events oriented between 80$\degree$ and 110$\degree$ because these directions are most sensitive to GMD. Figures \ref{fig:5_sens_sunplot} and \ref{fig:7_sens_sunplot} display the network topology for geo-electric field strengths of 12 V/mile and 14 V/mile, respectively.\footnote{We note that there are multiple generators located at buses 1, 2 and 15. Generators 1 and 2 (at bus 1) have the same cost and capacity, as do generators 5 and 6 at bus 2 and generators 16 through 20 at bus 15. Thus, there are equivalent dispatch solutions.} In Fig.~\ref{fig:5_sens_sunplot}, in the 80$\degree$ geo-electric field case, only one transmission line is switched off (1,5). In the 90$\degree$ geo-electric field case, three transmission lines are switched off. Two are intuitively long lines oriented along the geo-electric field and incur larger GICs. Switching these lines off removes a significant vulnerability. The third line is nearly perpendicular to the geo-electric field and is also switched off. This counter-intuitive topology control is being used to reroute power flow away from other, more susceptible transmission lines. In the 100$\degree$ orientation case, some of the lines in the 90$\degree$ case remain in the solution and some disappear. All transmission lines are switched on when the event orientation is at 110$\degree$. Thus, the sensitivity of the topology solution to the details of the orientation and the difficulty in making accurate predictions of geo-electric field direction suggest that the ACOTS formulation should be extended to a stochastic formulation over the field direction in future work. The results displayed in Fig.~\ref{fig:7_sens_sunplot} for different geo-electric field orientations suggests similar conclusions. At a fixed 14 V/mile in Fig.~\ref{fig:7_sens_sunplot}, the optimal topology solutions switch off several long transmission lines oriented along the geo-electric field, but some transmission lines still display significant sensitivity to orientation. Comparing Fig.~\ref{fig:7_sens_sunplot} (14 V/mile) with Fig.~\ref{fig:5_sens_sunplot} (12 V/mile) shows that some topology solutions at low field strength persist to higher field strength, however significantly more transmission lines are switched off to avoid large GIC in the network and in GSU and network transformers. The properties of the topology solutions for different geo-electric field strengths again suggests that the ACOTS solution should be extended to a stochastic or robust formulation over field strength. Finally, we note that while the solution adjusts the topology, it does not create islands---a mitigation strategy that is sometimes suggested. However, islands could form in larger, more complex networks. \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \subfigure[12 V/mile, 80\degree]{ \includegraphics[scale=0.182]{Figures/switching_12_8.pdf} \label{fig:5_40_sunplot} } % \subfigure[12 V/mile, 90\degree]{ \includegraphics[scale=0.182]{Figures/switching_12_9.pdf} \label{fig:5_50_sunplot} } % \subfigure[12 V/mile, 100\degree]{ \includegraphics[scale=0.182]{Figures/switching_12_10.pdf} \label{fig:5_60_sunplot} } % \subfigure[12 V/mile, 110\degree]{ \includegraphics[scale=0.182]{Figures/switching_12_11.pdf} \label{fig:5_70_sunplot} } % \caption{Topology solutions for case C2 at 12 V/mile strength and orientations from 80$\degree$--110$\degree$. Switched off lines are colored magenta and the IDs of unused generators are labeled beside their connected substations. } \label{fig:5_sens_sunplot} \vspace{-0.45cm} \end{figure}% \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \subfigure[14 V/mile, 80\degree]{ \includegraphics[scale=0.182]{Figures/switching_14_8.pdf} \label{fig:7_40_sunplot} } % \subfigure[14 V/mile, 90\degree]{ \includegraphics[scale=0.182]{Figures/switching_14_9.pdf} \label{fig:7_50_sunplot} } % \subfigure[14 V/mile, 100\degree]{ \includegraphics[scale=0.182]{Figures/switching_14_10.pdf} \label{fig:7_60_sunplot} } % \subfigure[14 V/mile, 110\degree]{ \includegraphics[scale=0.182]{Figures/switching_14_11.pdf} \label{fig:7_70_sunplot} } % \caption{Same as Fig~\ref{fig:5_sens_sunplot} but for a geo-electric field strength of 14 V/mile. } \label{fig:7_sens_sunplot} \end{figure} \vspace{-0.1cm} \subsection{Case C2 versus Case C3: Cost Benefits of Topology Optimization} The inclusion of topology control into the ACOTS formulation increases the complexity of the problem, but it also provides significant cost savings over a less complex ACOPF. The cost savings is evaluated by comparing case C2 (where topology control is allowed) with case C3 (where the topology is fixed to that found in case C1). Figure \ref{fig:3d} displays the percentage cost savings of C2 (ACOTS) over C3 (ACOPF) for field strengths between 12 and 14 V/mile and field directions between 0$\degree$--180$\degree$. Under the most severe GMD conditions explored, the benefit of topology control is as much as 54\%. Table \ref{table:perc_cost} further breaks down the cost savings of case C2 over case C3 into generator dispatch costs and load shedding costs. For the 14 V/mile field strength case, the topology control in case C2 enables nearly all of the load to be served. In contrast, the fixed topology in C3 results in load shedding costs of 13.9\% on average and 33.54\% in the worst case. \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \includegraphics[scale=0.35]{Figures/cropped_3D_profit_ipe.pdf} \caption{Combined savings from generator dispatch and load shedding costs enabled by the optimal topology $\mathbf{z}^*_{gmd}$ found by ACOTS relative to the dispatch and load shedding cost incurred by the ACOPF of case C3 with the topology fixed to $\mathbf{z}^*_{0}$.} \label{fig:3d} \vspace{-0.3cm} \end{figure}% \begin{table}[htp] \captionsetup{font=footnotesize} \captionof{table}{Percentage of the total cost in cases C2 and C3 due to generator dispatch and load shedding. For 12 V/mile and 14 V/mile strengths, the average, minimum and maximum percentage of total cost is computed over the geo-electric field orientation from 0$\degree$--180$\degree$.} \label{tab:title} \begin{tabular}{lrrrrrrr} \toprule &&\multicolumn{3}{r}{Dispatch Cost(\%)}&\multicolumn{3}{r}{Load shedding Cost(\%)}\\ \cmidrule(lr){3-5} \cmidrule(lr){6-8} Strength&Case&Avg.&Min.&Max.&Avg.&Min.&Max.\\ \midrule \multirow{ 2}{*}{12 V/mile} &C2&100.0&100.0&100.0&0.0&0.0&0.0 \\ &C3&97.8&90.8&100.0&2.1&0.0&9.2 \\ \midrule \multirow{ 2}{*}{14 V/mile} &C2&100.0&100.0&100.0&0.0&0.0&0.0 \\ &C3&86.1&66.46&100.0&13.9&0.0&33.5 \\ \bottomrule \end{tabular}\par \label{table:perc_cost} \end{table}% \subsection{Case C3 versus Case C4: Performance of Network Reconfiguration} \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \subfigure[The total cost $c^*_{f}$ in Case C3.] { \includegraphics[scale=0.145]{Figures/acopf_gic_obj.pdf} \label{fig:c3} } % \subfigure[The total cost $c^*_{\mathbf{1}}$ in Case C4.] { \includegraphics[scale=0.145]{Figures/fixed_gic_obj.pdf} \label{fig:c4} }% \caption{Cost comparison of Case C3 and C4 for different geo-electric field orientations and strengths. } \label{Fig:c3_vs_c4} \vspace{-0.2cm} \end{figure}% The results displayed in Figure \ref{Fig:c3_vs_c4} compare the topology of case C3 (where topology is fixed to case C1) with case C4 (where all lines and generators). {\color{black} Similar to the results in Fig. \ref{fig:c3}, the total cost, $c^*_{\mathbf{1}}$, varies with event direction. Ignoring GIC effects also induces a lower operating cost (Fig. \ref{fig:c4}). However, like the results of Fig. \ref{fig:damagedtrans}, we also observed that the transformer thermal limit constraints (\ref{thermal}) are violated when GIC effects are neglected. For example, if the field strength is 14 V/mile and has an orientation of $20\degree$, GSU transformers 22 and 23 overheat.} Comparing Fig. \ref{fig:c3} (C3) with Fig. \ref{fig:c4} (C4) shows that the optimal topology control found in case C1 induces a higher cost than case C4 for orientations through 40$\degree$ to 130$\degree$ under the field of 14 V/mile. This is due to forced disconnect of generators in Case C1 (e.g., generator 14 at bus 13) which could be dispatched more effectively, when no line can be switched off, to mitigate GIC effects. \subsection{Computational Analysis} \subsubsection{Computational Speed} Table~\ref{table:walltime} summarizes the computational time properties of ACOTS with GIC subject to convex relaxations (from section \ref{subsec:ConvexRelaxation}) by solving them to optimality. We observed that the times are higher at larger geo-electric field strength, likely because of the increased complexity due to larger number of possible topology changes. Though the computations are time-intensive (in Table~\ref{table:walltime}), we observed that by terminating the solver at larger optimality gaps (say 5\%), a solution was obtained within 320 seconds, which was 2-3 orders of magnitude quicker than solving to optimality. \begin{table}[htp] \captionsetup{font=footnotesize} \centering \caption{Computational time for geo-electric field strengths of 12 V/mile and 14 V/mile {\color{black} on the RTS system}. The average, minimum, maximum and standard deviation of solving time are presented over the geo-electric field orientation from 0$\degree$--360$\degree$. {\color{black}Results without parentheses present elapsed time for solving to optimality. Solutions displayed in parentheses denote solving time when the optimization is terminated with a 5\% optimality gap.} } \begin{tabular}{crrrr} \toprule &\multicolumn{4}{c}{Wall Time (sec)}\\ \cmidrule{2-5} Strength(V/mile)&Avg.&Min.&Max.&Std. dev.\\ \midrule \multirow{2}{*}{12}&167.1 &31.5 &1066.9 &264.1 \\ &\color{black}(10.6) & \color{black}(10.2) & \color{black}(11.0) & \color{black}(0.3)\\ \multirow{2}{*}{14}&1249.9&32.6&6676.3&1880.9 \\ &\color{black}(56.0) & \color{black}(10.3) & \color{black}(314.1) & \color{black}(85.8)\\ \bottomrule \end{tabular} \smallskip \label{table:walltime} \vspace{-0.3cm} \end{table}% \subsubsection{Scalability to Larger Network} The computational time required to solve small test cases implies that a key limitation for practical deployment of this model is scalability. This is not surprising as solution methods for OTS suffer similar limitations. However, in the case of GMD mitigation, high-quality solutions that are close to optimality are often sufficient. {\color{black} On \textit{UIUC 150-bus system}, figure \ref{fig:obj_150} shows the feasible solution costs when the optimization is terminated with a 5$\%$ optimality gap. Like are other results, the cost of dispatch varies with direction and is higher than the dispatch cost when GIC is ignored. In Table \ref{tb:uiuc_150}, we provide the computational times required to obtain results displayed in Fig. \ref{fig:obj_150}}. These results suggest that it is practical to use heuristic methods in conjunction with \textit{state-of-the-art} convex relaxations to find high-quality solutions to larger scale systems on the time scales required for GMD mitigation efforts. \begin{figure}[htp] \captionsetup{font=footnotesize} \centering \includegraphics[scale=0.39]{Figures/ots_gic_obj_uiuc150_12_ipe.pdf} \caption{\color{black} Feasible solution costs of UIUC 150-bus system for geo-electric field strength of 12 V/mile in Case \ref{case2}.} \label{fig:obj_150} \vspace{-0.4cm} \end{figure}% \begin{table}[htp] \captionsetup{font=footnotesize} \centering \caption{Computational time of the UIUC 150-bus system. The average, minimum, maximum and standard deviation of solving time are presented over the geo-electric field orientation from 0$\degree$--360$\degree$.} \begin{tabular}{crrrr} \toprule &\multicolumn{4}{c}{Wall Time (sec)}\\ \cmidrule{2-5} Strength(V/mile)&Avg.&Min.&Max.&Std. dev.\\ \midrule 12&996.3&648.9&1586.6&290.4 \\ 14&1162.3&508.1&2896.1&750.2 \\ \bottomrule \end{tabular} \smallskip \label{tb:uiuc_150} \vspace{-0.25cm} \end{table}% \subsection{Recovering AC Feasible Solutions}\label{sec:recover} The ACOTS with GMD constraints formulated in this manuscript is solved applying several hierarchical convex relaxations of the AC power flow physics. Since the solutions obtained may not necessarily lie in the original nonconvex feasible region, we present a simple methodology to test the quality of the relaxed solutions and obtain AC feasible solutions. In \cite{hijazi2013convex}, for OPF-based problems, it is empirically shown that the lower bounds obtained from convex quadratic relaxations are mostly close to globally optimal objective values. Thus, we exploit this fact and apply an objective-cost-based constraint to the problem of ACOTS with GMD. Let the optimal value of formulation \eqref{eq:ACGMD} with convex relaxations be $\mathcal{O}^*_{lb}$ and let $z^*_e \ \forall e \in \mathcal{E}^a$ be the respective optimal topology. For the fixed topology $z^*_{e}$, we solve the following original nonlinear, nonconvex program (without integer variables): \vspace{-0.4cm} \begin{subequations} \label{eq:AC_feas} \allowdisplaybreaks \begin{align} \mathcal{O}^*_{feas} := & \min \ \mathcal{O}(f_i^p, l_i^p, l_i^q) \\ \textbf{s.t.} \ & \label{eq:obj_cons}\mathcal{O}(f_i^p, l_i^p, l_i^q) \leq \mathcal{O}^*_{lb}(1+\delta), \\ & \mathrm{Constraints \ \eqref{pbalance}-\eqref{Qloss}}, \\ & z_{e} = z^*_{e} \ \forall e \in \mathcal{E}^a. \end{align} \end{subequations}% where ${\small\mathcal{O}(f_i^p, l_i^p, l_i^q)}$ represents the objective function \eqref{obj}. Constraint \eqref{eq:obj_cons} specifies that the objective function cost must be within a small percentage $\delta$ of the lower bound $\mathcal{O}^*_{lb}$, where $\delta$ is a specified parameter (3\% for testing). Thus, formulation \eqref{eq:AC_feas} guarantees a feasible solution (close to global optimum) if there exists one for the specified $\delta$. A similar approach has been shown to be effective for OPF-based problems in \cite{molzahn2017laplacian}. The properties of the optimality gap of {\color{black}the test case (single area IEEE RTS-96 system)} from these studies, summarized in Table~\ref{tb:nlgap}, suggest that the relaxed solution is always within 3\% of the optimal solution, indicating that the relaxation is empirically tight to the original MINLP. It is also noteworthy to mention that the convergence time and quality of the local solver (Knitro 10.2.1) solutions were tremendously improved by solving the formulation \eqref{eq:AC_feas}. For instance, we observed gaps up to 70\% (instead of 3\%) by solving formulation \eqref{eq:AC_feas} without the objective-cost constraint in \eqref{eq:obj_cons}. \begin{table}[!htp] \captionsetup{font=footnotesize} \centering \captionof{table}{Optimality gaps for { \color{black}the RTS-96 system} between the lower bound ($\mathcal{O}^*_{lb}$) and the feasible solution ($\mathcal{O}^*_{feas}$) recovered for the original nonconvex model. Values shown are evaluated over various geo-electric field orientations.} \begin{tabular}{ccccc} \toprule &\multicolumn{4}{c}{Optimality Gap (\%)}\\ \cmidrule(lr){2-5} Strength (V/mile)&Avg.&Min.&Max.&Std. Dev.\\ \midrule 12&0.9&0.01&2.99&1.4\\ 14&1.8&0.01&3.00&1.5\\ \bottomrule \end{tabular} \label{tb:nlgap} \vspace{-0.2cm} \end{table}% {\color{black} Given the optimality gaps observed here, it is worth noting that the smaller cost fluctuations (up to 3\% in Figure \ref{fig:obj_all}) could be due to the relaxations. } \section{Conclusions} \label{Sec:conc} We formulated a detailed topology control optimization model to mitigate the impacts of GMD on electrical transmission systems. The mathematical formulation minimizes the total generation dispatch and load shedding subject to nonconvex AC power flow physics, effects of geomagnetically-induced currents on transformer heating and transformer reactive power consumption. Further, we leveraged recently developed convex relaxation approaches to handle the nonlinearites due to AC transmission switching and GIC constraints, which we subsequently observed to provide near global optimum solutions. While this paper has made contributions in showing that switching can mitigate the impacts of GMD events, there remain a number of important future directions. For example, new algorithms are needed to solve larger problems. Here, the ACOTS with GMD is naturally posed as a 2-stage program with topology decisions in the master problem. Thus decomposition algorithms, like Benders', are a natural direction to consider. Second, based on our empirical observations, convex relaxation solutions are often tight, thus local search techniques, like meta-heuristics and state-of-the-art global search methods, could yield high quality solutions quickly \cite{nagarajan2016dtmc,nagarajan2017adaptive}. In addition, there are a number of modeling enhancements that need to be considered. For example, integration of N-1 security (contingency) constraints are important to increase the resiliency of transmission systems under GMD extreme events. Moreover, capturing other effects of GMD on transformers, the modeling of time-extended variations in geo-electric field strengths will be important. Further, there is often uncertainty in predictions of direction and strength of the GMD event, thus it will be important to development methods that produce solutions that are robust to errors in predictions. Finally, this paper modeled GSU and auto transformers, but there are other types of transformers like GWye-GWye Auto and Delta-wye that will need to be modeled.
{'timestamp': '2017-10-06T02:04:22', 'yymm': '1701', 'arxiv_id': '1701.01469', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01469'}
arxiv
\section{Introduction} \label{sec:introduction} Changepoint detection and modelling is currently one of the most active research areas in statistics due to its importance across a wide range of applications, including: finance \cite[]{Fryzlewicz2012}; bioinformatics \cite[]{Futschik:2014,Hocking2014}; environmental science \cite[]{Killick2010}; target tracking \cite[]{Nemeth2014}; fMRI \cite[]{Aston2012}; and biochemistry \cite[]{Hotz2013} amongst many others. It appears to be increasingly important for the analysis of large scale data streams, as it is a flexible way of modelling non-stationarity or heterogeniety in these streams. Changepoint detection has been identified as one of the major challenges for modern, big data applications \cite[]{Frontiers2013}. This paper focusses on the problem of detecting changes in slope. That is, we consider data whose mean varies over time, and where we model this mean as a continuous piecewise-linear function of time. \begin{figure} \begin{center} \includegraphics[scale=0.45]{Sowa_intro.pdf} \end{center} \caption{\label{Fig:Sowa1} Part of a time-series of angular position of a bacterium, taken from \cite{sowa}; best fitting piecewise constant mean (a) and continuous piecewise-linear mean (b).} \end{figure} To motivate this work consider the challenge of analysing data of the angular position and velocity of a bacterium, see Figure \ref{Fig:Sowa1}. The interest is in understanding the movement of the bacterium. The movement is driven by the bacterial flagella, a slender thread-like structure that enables the bacteria to swim. The movement is circular, and thus the position of a bacterium at any time point can be summarised by its angular position. The data we show comes from \cite{sowa} and was obtained by first taking images of the bacterium at high-frequency. From these images the angular position is calculated at each time-point. The motion is then summarised by a time-series of the amount of rotation that the bacterium has done from its initial position. The interest from such data is in deriving understanding about the bacterial flagella motor. In particular the angular motion is characterised by stationary periods interspersed by periods of roughly constant angular velocity. The movement tends to be, though is not exclusively, in one direction. \cite{sowa} analyse this data using a changepoint model, where the mean is piecewise constant. An example fit from such a model is shown in \ref{Fig:Sowa1}(a). This model is not a natural model given the underlying physics of the application, and this can be seen in how it tries to fit periods of rotation by a number of short stationary regimes. A more natural model is one whereby we segment the data into periods of constant angular velocity. Such a model is equivalent to fitting a continuous piecewise-linear mean function to the data, with the slope of this function in each segment corresponding to the angular velocity in the segment. Such a fit is shown in \ref{Fig:Sowa1}(b). Whilst detecting changes in slope seems to be a similar statistical problem to detecting changes in mean, it is fundamentally more challenging. For example, binary segmentation approaches \cite[]{Scott1974,Fryzlewicz2012}, which are the most popular generic approach to detecting multiple changepoints, do not work for detecting changes in slope \cite[as shown by][]{Baranowski:2016}. Binary segmentation iteratively applies a method for detecting a single changepoint. For change in slope problems one can show that for some underlying signals, initial estimates of changepoint locations will tend to be midway between actual changepoint locations; binary segmentation is unable to then recover from such incorrect initial estimates. The standard approach to detecting changes in mean is to attempt to find the ``best'' piecewise-constant mean function, where best is defined based on its fit to the data penalised by a measure of complexity of the mean function \cite[]{Yao1988,Lavielle2000}. The most common measure of fit is through the residual sum of squares, and the most natural measure of complexity is the number of changepoints. The latter corresponds to an $L_0$ penalty on the change in the slope of the mean. Dynamic programming can be used to efficiently find the best segmentation of the data under such a criterion for the change in mean problem \cite[]{Jackson2005,Killick2012a,Maidstone2014}. Our statistical approach is to use the same framework to detect changes in slope. We aim to find the best continuous piecewise-linear mean function, where best is defined in terms of the residual sum of squares plus a penalty that depends on the number of changepoints. However standard dynamic programming algorithms cannot be directly applied to such a problem. The assumption of continuity introduces dependencies in the parameters associated with each segment, and these in turn violate the conditional independence structure that existing dynamic programming algorithms use. Detecting changes in slope under this criterion lies within a class of NP-hard problems \cite[]{weinmannandreas}. It is not clear to us whether our specific problem is NP-hard, but, as far as we are aware, no polynomial-time algorithm has yet been found. Despite this, we present a dynamic programming algorithm that does find the best segmentation under this criterion, and has practicable computational cost -- of the order of minutes when analysing $10,000$ data points with of the order of 100 changepoints. There has been earlier work on detecting changes in slope using the same or similar statistical criteria. These include \cite{Tome2004} who use an exhaustive search to find the best segmentation -- an approach that is only feasible for very small data sets, with perhaps at most 100 to 200 data points. Alternatively, approximate solutions to the true optimal segmentation are found, for example by discretising the locations in time and space where changes can occur \cite[]{Goldberg2014} or by using a genetic algorithm to approximately solve the optimisation problem \cite[]{Horner1996}. As we show, our novel dynamic programming approach is guaranteed to find the best segmentation under our criterion, and is still computationally feasible for large data sets. Empirical results suggest the expected computational cost of our algorithm is slightly worse than quadratic in the number of data points, and can be close to linear in situations where the number of changepoints increases linearly with the number of data points. The outline of the paper is as follows. The next section defines the statistical criterion that we use for detecting changes in slope, and defines the optimisation problem we wish to solve in order to find the best segmentation of the data. We present our dynamic programming algorithm, which we call CPOP, in Section \ref{sec:methodname}. We then empirically evaluate the computational and statistical performance of CPOP. For the latter we compare with trend-filtering \cite[]{Tibshirani2014} and the narrowest-over-threshold (NOT) approach \cite[]{Baranowski:2016}. The former involves replacing the $L_0$ penalty on changes in slope with an $L_1$ penalty, so that we penalise mean functions based on how much, rather than the number of times, their slope changes. This makes the resulting optimisation problem convex, and hence easy to solve. However we show that whilst trend-filtering can estimate the underlying mean function well, it never performs well at accurately detecting where the changes occur. The NOT approach is a novel version of binary segmentation that can be shown to give consistent estimation of changepoint locations for our change in slope model. Our results show it performs well at detecting and estimating the location of the changepoints, but is less accurate than CPOP at estimating the underlying mean. In Section \ref{sec:bacteria} we analyse the data from Figure \ref{Fig:Sowa1}. We give statistical evidence that a change in slope model is better than fitting either a piecewise-constant or a discontinuous piecewise-linear mean function to the data. We also show that CPOP is able to find much better fitting estimates of the mean with substantially fewer changepoints than either trend-filtering or NOT. Finally, the dynamic programming approach we present in this paper can be applied to a larger range of changepoint problems than the change in slope problem we consider. These possible extensions are discussed in Section \ref{sec:discussion}. \section{Model Definition} \label{sec:normal-data} We assume that we have data ordered by time and denote this by $\mathbf{y}=(y_1,\hdots,y_n)$. We will also use the notation that for $t\geq s$ the set of observations from time $s$ to time $t$ is $\mathbf{y}_{s:t}=(y_s,\hdots,y_t)$. If we assume that there are $m$ changepoints in the data, this will correspond to the data being split into $m+1$ distinct segments. We let the location of the $j$th changepoint be $\tau_j$ for $j=1,\hdots,m$, and set $\tau_0=0$ and $\tau_{m+1}=n$. The $j$th segment will consist of data points $y_{\tau_{j-1}+1},\ldots,y_{\tau_j}$. We let $\boldsymbol{\tau}=(\tau_0,\ldots,\tau_{m+1})$ be the set of ordered changepoints. We consider the case of fitting a continuous piecewise linear function to the data. An example of such a fit is given in the right-hand plot of Figure~\ref{Fig:Sowa1}. For such a problem, changepoints will correspond to points in time where the slope of the function changes. There are a variety of ways of parameterising the linear function within each segment. Due to the continuity constraint that we wish to enforce it is helpful to parameterise this linear function by its value at the start and its value at the end of the segment. Our continuity constraint then requires this value for the end of one segment to be equal to the value at the start of the next segment. For the changepoint $\tau_i$ we will denote this common value as $\phi_{\tau_i}$. A continuous piecewise linear function is then defined by the set of changepoints, and these values of the linear function at the changes, $\phi_{\tau_i}$ for $i=0,\ldots,m+1$. As for the changepoints, we will simplify notation slightly by letting $\boldsymbol{\phi}=(\phi_{\tau_0},\ldots,\phi_{\tau_{m+1}})$. In situations where we refer to a subset of this vector we will use the notation $\boldsymbol{\phi}_{j:k}=(\phi_{\tau_j},\ldots,\phi_{\tau_{k}})$ for $0\leq j \leq k \leq m+1$. Under this parameterisation, we model the data as, for $i=0,\ldots,m$, \begin{align} \begin{array}{clc} & Y_t= \phi_{\tau_i}+\frac{\phi_{\tau_{i+1}}-\phi_{\tau_i}}{\tau_{i+1}-\tau_{i}}(t-\tau_i)+Z_t, &\mbox{for }t=\tau_i+1,\hdots,\tau_{i+1},\label{endpointsform}\\ \end{array} \end{align} where $Z_t$, for $t=1,\ldots,n$, are independent, zero-mean, random variables with common variance $\sigma^2$. Our aim is to infer the set of changepoints, and the underlying piecewise linear function, from the data. Our approach to doing this is based on a penalised cost approach, using a squared-error loss function to measure fit to the data. That is, we wish to minimise over $m$, $\boldsymbol{\tau}$, and $\boldsymbol{\phi}$, \begin{equation} \label{eq:cost} \sum_{i=0}^{m} \left[\frac{1}{\sigma^2}\sum_{t=\tau_i+1}^{\tau_{i+1}} \left(y_t - -\phi_{\tau_i}-\frac{\phi_{\tau_{i+1}}-\phi_{\tau_i}}{\tau_{i+1}-\tau_{i}}(t-\tau_i) \right)^2 + h(\tau_{i+1}-\tau_{i}) \right] + \beta m, \end{equation} for some suitable choice of penalty constant $\beta>0$ and segment-length penalty function $h(\cdot)$. These penalties are needed to avoid over-fitting of the data. Perhaps the most common choice of penalty is BIC \cite[]{Schwarz:1978}, where $\beta=2\log(n)$ and $h(s)=0$ for all segment lengths $s$. However, it has been shown that allowing the penalty to depend on segment length can improve the accuracy of penalised cost approaches, and such penalties have been suggested through a modified BIC penalty \cite[]{Zhang2007} and within the minimum description length approach \cite[]{Davis2006}. The above cost function assumes knowledge of the noise variance, $\sigma^2$. In practice this is not known and needs to be estimated, for example using the Median Absolute Deviation estimator \citep{hampel1974influence}; see for example \cite{Fryzlewicz2012}. We can simplify (\ref{eq:cost}) through introducing segment costs. Define the segment cost for fitting the mean of the data $\mathbf{y}_{s+1:t}$ with a linear function that starts at $\phi$ at time $s$ and ends at $\psi$ at time $t$ as \begin{align} \mathcal{C}(\mathbf{y}_{s+1:t},\phi,\psi)=\frac{1}{\sigma^2}\sum_{j=s+1}^{t}\left(y_j-\phi-\frac{\psi-\phi}{t-s}(j-s)\right)^2.\label{costtrend} \end{align} Then we wish to estimate the number and location of the changepoints, and the underlying continuous piecewise-linear function through solving the following minimisation problem: \begin{align} \begin{array}{lll} \displaystyle\min_{\boldsymbol{\tau},m,\boldsymbol{\phi}} & \displaystyle\left\{\sum_{i=0}^m\left[\mathcal{C}(\mathbf{y}_{\tau_i+1:\tau_{i+1}},\phi_{\tau_i},\phi_{\tau_{i+1}})+h(\tau_{i+1}-\tau_i)\right]+\beta(m+1)\right\}.& \end{array} \label{linpro} \end{align} \section{Minimising the Penalised Cost} \label{sec:methodname} Solving the minimisation problem in \eqref{linpro} by complete enumeration takes $\mathcal{O}(2^n)$ time and therefore is infeasible for large values of $n$. Below we propose a pruned dynamic programming approach to calculate the exact solution to \eqref{linpro} efficiently. This dynamic programming approach is much more complicated than other dynamic programming algorithms used in changepoint detection as neighbouring segments share a common parameter: the end-point of the piecewise linear function for one segment is the start-point of this function for the next segment. Dynamic programming requires a conditional separability property. We need to be able to choose some information at time $s$ such that, conditional on this information, we can separately minimise the cost related to the data before and after $s$. For simpler changepoint problems, this information is just the presence of a changepoint at $s$: as conditional on this, we can separately find the best segmentation of the data before $s$ and the best segmentation of the data after $s$. For our changepoint problem, the fact that neighbouring segments share a parameter means that conditioning just on the presence of a changepoint at $s$ will no longer give us the required separability. Instead, we will introduce a continuous-state dynamic programming algorithm which conditions on both the location of a changepoint at $s$ and the value of the function at $s$. The idea is that given both these pieces of information we can separately find the best segmentation of the data before $s$ and the best segmentation of the data after $s$. \subsection{Dynamic Programming Approach} \label{sec:general-formulation} Consider segmenting the data up to time $t$, $\mathbf{y}_{1:t}$, for $t=1,\hdots,n$. When segmenting $\mathbf{y}_{1:t}$ with $k$ changepoints, $\tau_1,\hdots,\tau_k$, we use the notation $\tau_0=0$ and $\tau_{k+1}=t$. We define the function $f^t(\phi)$ to be the minimum penalised cost for segmenting $\mathbf{y}_{1:t}$ conditional on $\phi_t=\phi$, that is the fitted value at time $t$ is $\phi$. Formally this is defined as \begin{eqnarray} f^t(\phi)&=\displaystyle\min_{\boldsymbol{\tau},k,\boldsymbol{\phi}_{0:k}} \displaystyle\left\{\sum_{i=0}^{k-1}\left[\mathcal{C}(\mathbf{y}_{\tau_i+1:\tau_{i+1}},\phi_{\tau_i},\phi_{\tau_{i+1}})+h(\tau_{i+1}-\tau_i)\right] \right. \nonumber \\ & + \left[ \mathcal{C}(\mathbf{y}_{\tau_k+1:t},\phi_{\tau_k},\phi) + h(t-\tau_k)\right] +\beta(k+1)\Bigg\}. \label{eq:ft} \end{eqnarray} By manipulating (\ref{eq:ft}), and using the initial condition that $f^0(\phi)=0$, we can construct a dynamic programming recursion for $f^t(\phi)$ \begin{align*} f^t(\phi) &=\displaystyle\min_{\boldsymbol{\tau},k,\boldsymbol{\phi}_{0:k}} \displaystyle \left\{\sum_{i=0}^{k-1}\left[\mathcal{C}(\mathbf{y}_{\tau_i+1:\tau_{i+1}},\phi_{\tau_i},\phi_{\tau_{i+1}})+h(\tau_{i+1}-\tau_i)\right]+\beta k\right.\\ &+\mathcal{C}(\mathbf{y}_{\tau_k+1:t},\phi_{\tau_k},\phi_t)+h(t-\tau_k)+ \beta\Bigg\},\\ &=\min_{\phi',s}\left\{\displaystyle\min_{\boldsymbol{\tau}_{0:k-1},k,\boldsymbol{\phi}_{0:k-1}} \displaystyle \left\{\sum_{i=0}^{k-2}\left[\mathcal{C}(\mathbf{y}_{\tau_i+1:\tau_{i+1}},\phi_{\tau_i},\phi_{\tau_{i+1}})+h(\tau_{i+1}-\tau_i)\right]+ \right.\right.\\ &+\mathcal{C}(\mathbf{y}_{\tau_{k-1}+1:s},\phi_{\tau_{k-1}},\phi')+h(s-\tau_{k-1})+\beta k\Bigg\}+\mathcal{C}(\mathbf{y}_{s+1:t},\phi',\phi)+h(t-s)+\beta\Bigg\},\\ &=\min_{\phi',s}\left\{f^{s}(\phi')+\mathcal{C}(y_{s+1:t},\phi',\phi)+h(t-s)+\beta\right\}. \end{align*} The idea is that we split the minimisation into first minimising over the time of the most recent changepoint and the fitted value at that changepoint, and then minimising over the earlier changepoints and fitted values. On the third line we let $s$ denote the time of the most recent changepoint, and $\phi'$ the fitted value at $s$. The inner minimisation is over the number of changepoints, the locations of those changepoints prior to $s$, and the fitted values at the changepoints prior to $s$. This inner minimisation gives the minimum penalised cost for segmenting $\mathbf{y}_{1:s}$ conditional on $\phi_s = \phi'$, which is $f^s(\phi')$. This recursion is similar to that derived for Optimal Partitioning. However for Optimal Partitioning we just needed to store a scalar value for each $t = 1,\hdots n$. Here we need to store functions of the continuous parameter $\phi$ for each value of $t$. To store $f^t(\phi)$ we will write it as the point-wise minimum of a set of cost functions of $\phi$, each of which corresponds to a different vector of changepoints, $\boldsymbol{\tau}$. We define each of these functions $f_{\boldsymbol{\tau}}^t(\phi)$ as the minimum cost of segmenting $\mathbf{y}_{1:t}$ with changepoints at $\boldsymbol{\tau}=\tau_1,\hdots,\tau_k$ and fitted value at time $t$ being $\phi$: \begin{eqnarray} f_{\boldsymbol{\tau}}^t(\phi)&= \displaystyle\min_{\boldsymbol{\phi}_{0:k}} \displaystyle\left\{\sum_{i=0}^{k-1}\left[\mathcal{C}(\mathbf{y}_{\tau_i+1:\tau_{i+1}},\phi_{\tau_i},\phi_{\tau_{i+1}})+h(\tau_{i+1}-\tau_i)\right]\right. \nonumber \\ &+\mathcal{C}(\mathbf{y}_{\tau_k+1:t},\phi_{\tau_k},\phi)+h(t-\tau_k) +\beta(k+1)\Bigg\}. \label{eq:1} \end{eqnarray} Then $f^t(\phi)$ is the point-wise minimum of these functions, \begin{align} \label{eq:4} f^t(\phi)=\min_{\boldsymbol{\tau}\in \mathcal{T}_t}f_{\boldsymbol{\tau}}^t(\phi), \end{align} where we define $\mathcal{T}_t$ to be the set of all possible changepoint vectors at time $t$. Each of the above functions, $f_{\boldsymbol{\tau}}^t(\phi)$, is a quadratic in $\phi$ and thus can be represented by a vector of length 3, with the terms in this vector denoting the co-efficients of the quadratic. We can calculate the co-efficients recursively using \begin{align} \label{eq:3} f_{\boldsymbol{\tau}}^t(\phi)=\min_{\phi'}\left\{f_{\tau_1,\hdots,\tau_{k-1}}^{\tau_k}(\phi')+\mathcal{C}(y_{\tau_k+1:t},\phi',\phi)+h(t-\tau_{k})+\beta\right\}. \end{align} Further details are given in Appendix \ref{sec:coupdate}. Therefore we can iteratively compute these functions and thus calculate $f^n(\phi)$. We then calculate the optimal segmentation of $\mathbf{y}_{1:n}$ by minimising $f^n(\phi)$ over $\phi$. The value of $\boldsymbol{\tau}$ that achieves the minimum value will be the optimal segmentation. This approach, however, is computationally expensive; both in time, $\mathcal{O}(n2^n)$, and space needed to store the functions, $\mathcal{O}(2^n)$. To obtain a practicable algorithm we have to use pruning ideas to reduce the number of changepoint vectors, and corresponding functions $f_{\boldsymbol{\tau}}^t(\phi)$, that we need to store. There are two ways in which this can be achieved: functional pruning and inequality based pruning. In both cases they are able to remove changepoint vectors whilst still maintaining the guarantee that the resulting algorithm will find the true minimum of the optimisation problem (\ref{eq:cost}). \subsection{Functional Pruning} \label{sec:functional-pruning} One way we can prune these candidate changepoint vectors from the minimisation problem is when they can be shown to be dominated by other vectors for any given value of $\phi$. Similar approaches are found in \cite{Rigaill2010} and \cite{Maidstone2014} for independent segment models and is known as \emph{functional pruning}. In Theorem~\ref{thr:fp} we show how if a candidate changepoint vector, $\boldsymbol{\tau}$ is not optimal at time $s$ for any value of $\phi$, then the related candidate changepoint vector $(\boldsymbol{\tau},s)$ (the concatenation of $\boldsymbol{\tau}$ and $s$) is not optimal for any value of $\phi$ at time $t$ where $t>s$. If this is the case, the vector $(\boldsymbol{\tau},s)$ can be pruned from the candidate changepoint set. First we define the set $\overset{*}{\mathcal{T}}_t$ as the set of changepoint vectors that are optimal for some $\phi$ at time $t$ \begin{align} \overset{*}{\mathcal{T}}_t=\left\{\boldsymbol{\tau}\in\mathcal{T}_t:f^t(\phi)=f_{\boldsymbol{\tau}}^t(\phi), \mbox{ for some }\phi\in(-\infty,\infty)\right\},\label{eq:tstardef} \end{align} where $\mathcal{T}_t$ is the set of all possible changepoint vectors at time $t$. If a candidate vector $\boldsymbol{\tau}$ is not in this set at time $s$ then the related candidate vector $(\boldsymbol{\tau},s)$ is not in the set at time $t$. This means that at time $t$ we will need to store only the functions $f_{\boldsymbol{\tau}}^t(\phi)$ corresponding to segmentations that are in $\overset{*}{\mathcal{T}}_t$. \begin{theorem} If $\boldsymbol{\tau}\notin\overset{*}{\mathcal{T}}_s$ then $(\boldsymbol{\tau},s)\notin\overset{*}{\mathcal{T}}_t$ for all $t>s$.\label{thr:fp} \end{theorem} {\bf Proof:} See Appendix \ref{App:Proof}. The key to an efficient algorithm will be a way of efficiently calculating $\overset{*}{\mathcal{T}}_t$. We can use the above theorem to help us do this. From Theorem \ref{thr:fp} we can define a set \begin{align} \hat{\mathcal{T}}_t= \left\{(\boldsymbol{\tau},s): s\in\{0,\hdots,t-1\}, \boldsymbol{\tau}\in\overset{*}{\mathcal{T}}_s\right\},\label{supsets} \end{align} and we will have that $\hat{\mathcal{T}}_t\supseteq\overset{*}{\mathcal{T}}_t$. So assume that we have calculated the sets $\overset{*}{\mathcal{T}}_s$ for $s=0,\hdots,t-1$. We can calculate $f_{\boldsymbol{\tau}}^t(\phi)$ only for $\boldsymbol{\tau}\in\hat{\mathcal{T}}$. When calculating $f^t(\phi)$, as defined by (\ref{eq:4}), we can just minimise over the set of changepoint vectors in $\hat{\mathcal{T}}_t$ rather than the full set. Furthermore we can calculate which of the sets of changepoints in $\hat{\mathcal{T}}_t$ contribute to this minimum and remove those that do not contribute. The remaining sets of changepoints define $\overset{*}{\mathcal{T}}_t$. To find out which sets of changepoints, $\boldsymbol{\tau}$, contribute to the minimisation of (\ref{eq:4}) we store the interval (or set of intervals) of $\phi$ space for which it is optimal. We define this interval as follows \begin{align} Int^t_{\boldsymbol{\tau}}=\left\{\phi:f_{\boldsymbol{\tau}}^t(\phi)=\displaystyle\min_{\boldsymbol{\tau}'\in\hat{\mathcal{T}}_t}f_{\boldsymbol{\tau}'}^t(\phi)\right\}.\label{eq:setcalc} \end{align} For a given $t$ the union of these intervals over $\boldsymbol{\tau}$ is just the real line (as for a given $\phi$ at least one changepoint vector $\boldsymbol{\tau}$ corresponds to the optimal segmentation). Using this we can derive a simple algorithm for updating these intervals which involves a search over the real line, recursively finding the function, and associated interval, which is optimal as we increase $\phi$ from $-\infty$ to $\infty$. This method is given in full in Algorithm~\ref{algo_calcsettau}, and there is a detailed explanation in Appendix \ref{App:Alg}. Having calculated $Int^t_{\boldsymbol{\tau}}$ for all $\boldsymbol{\tau}\in\hat{\mathcal{T}}$ we can use these to calculate $\overset{*}{\mathcal{T}}$. We remove $\boldsymbol{\tau}$ from $\hat{\mathcal{T}}$ if $Int^t_{\boldsymbol{\tau}}=\emptyset$ and after doing this for all $\boldsymbol{\tau}\in\hat{\mathcal{T}}$ we are left with precisely those values of $\boldsymbol{\tau}$ which make up $\overset{*}{\mathcal{T}}$. This is used to recursively calculate $\hat{\mathcal{T}}_{t+1}$ \begin{align} \hat{\mathcal{T}}_{t+1}=\hat{\mathcal{T}}_t\cup\left\{(\boldsymbol{\tau},t):\boldsymbol{\tau}\in\overset{*}{\mathcal{T}}_t\right\}.\label{eq:Ttplus1} \end{align} \subsection{Inequality Based Pruning} \label{sec:pelt-like-pruning} A further way pruning can be used to speed up the dynamic programming algorithm is by applying \emph{inequality based pruning} \cite[]{Maidstone2014}, a similar idea to the pruning step used in the PELT algorithm \cite[]{Killick2012a}. This pruning is based on the following result. \begin{theorem} \label{thr:3} Define $K=2\beta+h(1)+h(n)$. If $h(\cdot)$ is a non-negative, non-decreasing function and if for some $\boldsymbol{\tau}$, \begin{align} \min_{\phi}f_{\boldsymbol{\tau}}^t(\phi) > \min_{\phi'}\left[f^{t}(\phi')\right]+K,\label{eq:hold} \end{align} then at any future time $T$, the set of changepoints $\boldsymbol{\tau}$ can never be optimal for the data $\mathbf{y}_{1:T}$. \end{theorem} {\bf Proof:} See Appendix \ref{App:Proof}. This result states that for any candidate changepoint vector, if the best cost at time $t$ is worse than the best cost over all changepoint vectors plus $K$, we can show that the candidate is sub-optimal at all future times as well. In Section~\ref{sec:functional-pruning} we considered candidate changepoints vectors that belonged to the set $\hat{\mathcal{T}}_t$, and updated the related cost functions. We then used functional pruning to reduce this set to only those values that are optimal for some value of $\phi$, namely the set $\overset{*}{\mathcal{T}}$. Using Theorem \ref{thr:3} we can reduce the size of $\hat{\mathcal{T}}_{t+1}$ before the cost functions are updated, discarding candidates from the set if (\ref{eq:hold}) is true. As this reduces the size of the set $\hat{\mathcal{T}}_t$, it also reduces the computational cost of the algorithm. Both pruning steps can be used to restrict the set of candidate changepoint vectors that the dynamic program is run over. We call the resulting algorithm CPOP, for Continuous-piecewise-linear Pruned Optimal Partitioning. The pseudocode for the full method with these pruning steps is outlined in Algorithm~\ref{algo_optpiecewise} in the Appendix. \subsection{Computational Cost of CPOP} \label{sec:CompCost} The computational cost of the CPOP algorithm depends crucially on the size of $\overset{*}{\mathcal{T}}_t$ and $\hat{\mathcal{T}}_{t}$. Denote the size of each set by $|\overset{*}{\mathcal{T}}_t|$ and $| \hat{\mathcal{T}}_{t}|$ respectively. For iteration $t$ of the CPOP, the cost of calculating the quadratics, $f^t_{\boldmath{\tau}}(\phi)$, associated with each $\boldsymbol{\tau}\in\hat{\mathcal{T}}_{t}$, will be linear in $|\hat{\mathcal{T}}_{t}|$. The cost of calculating $Int_{\boldsymbol{\tau}}^t$, the intervals of $\phi$ for which each quadratic is optimal, will have a cost that is of the order of $|\hat{\mathcal{T}}_{t}|$ times the number of disjoint intervals that contribute to the set of $Int_{\boldsymbol{\tau}}^t$. We believe the number of such intervals increases linearly in $|\overset{*}{\mathcal{T}}_t|$. Note that without the inequality-based pruning we have $|\hat{\mathcal{T}}_{t}|=\sum_{s=1}^{t-1} |\overset{*}{\mathcal{T}}_s|$. To investigate empirically how the size of these sets increase with $t$, and what the resulting computational cost of CPOP is, we analysed simulated data sets of different sizes, $n$, and with different numbers of changepoints, $m$. For a given choice of $n$ and $m$ we set the changepoints to be equally spaced, and simulated the value of the underlying mean function at the each changepoint as an independent draw from a Gaussian distribution with variance 4. We then simulated data by adding independent, identically distributed standard Gaussian noise to this mean function at each time-point. We present results for $n=1000$ and for both many changepoints, $m=19$, and no changepoint, $m=0$ in Figure \ref{Fig:CompCost} (qualitatively similar results were obtained for other values of $n$ and $m$). Without pruning, the value of $ |\overset{*}{\mathcal{T}}_t|$ would increase exponentially with $t$. However we see that in both cases $ |\overset{*}{\mathcal{T}}_t|$ remains small for all $t$, with the average values always less than 20. The behaviour of $|\overset{*}{\mathcal{T}}_t|$ is different for the two cases. For the no changepoint case, the size of this set increases linearly with $t$. For the many changepoint case the size initially increases linearly but then appears roughly constant. The reason for this is that the inequality based pruning of Section \ref{sec:pelt-like-pruning} is able to prune many of the segmentations in $|\overset{*}{\mathcal{T}}_t|$ that have a most recent changepoint which is a long-time prior to the actual most recent changepoint \cite[see][for a similar effect of this type of pruning]{Killick2012a}. This reduces the size of $|\overset{*}{\mathcal{T}}_t|$ substantially when there are many changepoints, whereas the inequality based pruning has almost no effect for the case where there are no changepoints. \begin{figure} \centering \makebox[\textwidth][c]{ \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_3a.pdf} }\hspace{5pt} \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_3b.pdf} }} \makebox[\textwidth][c]{ \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_4anew.pdf} }\hspace{5pt} \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_4bnew.pdf} } } \caption{\label{Fig:CompCost} Size of $\overset{*}{\mathcal{T}}_t$ (left-hand column) and $ \hat{\mathcal{T}}_t$ (right-hand column) as a function of $t$ for data simulated with $m=19$ changepoints (top row) and no changepoints (bottom row). Lines show the average size, and shaded regions show plus or minus 1 standard deviation. Results are based on the analysis of 1000 data sets in each case.} \end{figure} We also empirically investigated the overall computational cost of CPOP for different sizes of data set, $n$, and different numbers of changepoints, $m$. Figure \ref{Fig:CompCost2} shows the average time for CPOP. The first plot is of computational cost against $n$ for three different regimes for $m$. For each of the three regimes we see a roughly linear relationship between the log computational cost and $\log(n)$. The slopes of these lines vary between 1.3 for the fixed $m$ regime and 2.3 for the regime where $m$ increases linearly with $n$. These suggest computational cost grows like $n^{1.3}$ and $n^{2.3}$ respectively. This is consistent with the second plot, which shows that for fixed $n$ the computational cost decreases with increasing $m$. \begin{figure}[t] \centering \makebox[\textwidth][c]{ \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_5a_loglog.pdf} }\hspace{5pt} \subfloat[]{ \includegraphics[trim=2 1 2 1,width=7cm]{F4_5b.pdf} }} \caption{\label{Fig:CompCost2} Computational cost, in seconds, of CPOP as we increase $n$ (left-hand plot) and for fixed numbers of observations, $n=1000$, but increasing numbers of changepoints (right-hand plot). For the former case we have used a log-scale on both axes, and we give average computational cost for three regimes for the number of changepoints, $m$: a fixed number of changepoints, $m=50$ (red); a linearly increasing number of changepoints, $m=n/50$ (black); and $m=\lfloor\sqrt{n}\rfloor$ (blue). Lines show the average computational cost, and shaded regions show plus or minus 1 standard deviation. } \end{figure} \section{Statistical Performance of CPOP} \label{sec:Results} We now look empirically at the statistical performance of CPOP, and compare this with two other methods for fitting a continuous piecewise-linear mean function to data and detecting the locations where the slope of this function changes. The most common, general, approach for detecting changes is to use binary segmentation \cite[]{Scott1974}, but as mentioned in the introduction binary segmentation does not work for this problem: there are examples where even if you observed the underlying mean function without noise, binary segmentation would not correctly identify the changepoints. To overcome this, \cite{Baranowski:2016}, present the {\it narrowest-over-threshold} algorithm, henceforth called the NOT algorithm. This algorithm proceeds by (i) taking a pre-specified number, $M$, of intervals of data, $\mathbf{y}_{s_i:t_i}$ say; (ii) performing a generalised likelihood ratio test for a change in slope on each $\mathbf{y}_{s_i:t_i}$; (iii) keeping all intervals for which the test-statistic is above some pre-specified threshold; (iv) ordering these intervals, with the shortest interval first and the longest last; (v) running down this list in order, adding changepoints at each of the inferred changepoint locations for an interval providing that interval does not contain any previously inferred changepoints. The idea of the algorithm is that by concentrating on the smallest intervals in (iv), these will be intervals that are likely to have at most one actual changepoint, and hence the inferred changepoint in step (v) should be close in position to this actual changepoint. In practice, NOT is run for a continuous range of thresholds in step (iii). This will produce a set of different segmentations of the data. The segmentation that is then chosen is the one that minimises the BIC for a model where the residuals are independent Gaussian with unknown variance $\sigma^2$. For a segmentation with $m$ changepoints at locations $\boldsymbol{\tau}$, the BIC corresponds to the minimum, over $\boldsymbol{\phi}$ of \[ n \log\left( \frac{1}{n} \sum_{i=0}^{m} \left[\sum_{t=\tau_i+1}^{\tau_{i+1}} \left(y_t - \frac{\phi_{\tau_{i+1}}-\phi_{\tau_i}}{\tau_{i+1}-\tau_{i}}(t-\tau_i) \right)^2 \right]\right) + 2m\log n. \] This is closely related to our criterion (\ref{eq:cost}) with the BIC penalty, except for the assumption of unknown variance, and the fact that this criterion is only minimised over the set of segmentations found by the NOT algorithm. One advantage of this approach is that it avoids the need to have an estimate of $\sigma$. The other approach we compare to is the trend-filtering algorithm \citep{Kim2009}. Trend-filtering aims to minimise the residual sum of squares of the fitted continuous piecewise-linear mean, but with an $L_1$ penalty on how the slope changes. Again, this is closely related to our criterion (\ref{eq:cost}), except we use an $L_0$ penalty on the changes in slope. Trend-filtering requires a choice of penalty, in the same way that we need to choose the penalty $\beta$ in (\ref{eq:cost}). To mimic the approach of NOT we use a BIC type approach. This involves running the trend-filtering algorithm for a discrete set of penalty values. For a given penalty value, trend-filtering will output an estimate of the mean at each time point. From this we can infer the changepoint locations as the points where the estimated mean has a change in slope. We evaluate the output from each run of the trend-filtering algorithm using BIC. If the estimated mean is $\hat{\phi}_{1:n}$, and this has $m$ changes in slope, then using the fact that for trend-filtering a segmentation with $m$ changes in slope has an effective degrees of freedom that is $m+2$ \citep{Tibshirani2014}, the BIC value is \[ \frac{1}{\sigma^2}\left( \sum_{t=1}^{n} [y_t-\hat{\phi}_t]^2\right) + (m+2)\log(n). \] Other approaches, including fitting a change in mean to differenced data and ignoring the continuity constraint when detecting changepoints, are considered in \cite{Maidstone:thesis}. However these all perform much worse, across all measures of accuracy, than the three approaches we compare here. In the comparisons below we implement CPOP for minimising (\ref{eq:cost}) with the BIC penalty. We use the {\texttt{not}} R-package to implement NOT, and the code available from \url{http://stanford.edu/~boyd/l1_tf} to implement trend-filtering. For NOT we set the number of intervals, $M$ in step (i) of the algorithm above, to $10^5$. This is larger than recommended in \cite{Baranowski:2016}, but we found it gave slightly better results than the default choice of $10^4$ intervals. For trend-filtering and CPOP we need an estimate of the variance of the residuals. Within a segment, the variance of the second differences of the data is easily shown to be 6 times the variance of the residuals. Thus we take second differences of the data, and take one-sixth of the median-absolute-deviation estimator of the variance of these second differences. Of course, being heuristic methods, both NOT and trend-filtering are much faster algorithms than CPOP. Across all the scenarios we considered, trend-filtering and NOT ran in a few seconds, whereas CPOP took between tens of seconds to a few minutes. \begin{figure} \begin{center} \includegraphics[scale=0.6]{Example_Data.pdf} \end{center} \caption{\label{Fig:Scenarios} Example data from the three simulation scenarios we considered: {\texttt{wave1}} and {\texttt{wave2}} (top row) are taken from \cite{Baranowski:2016} and the shape of the mean function is fixed in these scenarios. For the {\texttt{Random}} scenario (bottom row), the form of the mean is random, and we give two example realisations. } \end{figure} The three scenarios that we compared the methods on are shown in Figure \ref{Fig:Scenarios}. The first two of these, {\texttt{wave1}} and {\texttt{wave2}}, are taken from \cite{Baranowski:2016}. These two scenarios have a fixed mean function. We consider extensions of these two scenarios with higher-frequency observations for {\texttt{wave1}}, where we have twice or four times as many observations within each segment; and longer time-series for {\texttt{wave2}}, where we have 20 or 40 segments, each of 150 observations, rather than just 10. In the third scenario, which we call {\texttt{Random}}, we simulate the underlying mean for each data set. This setting has segments of equal length, but the value of the mean function at the start/end of each segment is simulated from a Gaussian distribution with variance 4. For this setting we will consider varying both the number of data points and the number of changepoints. In all cases that data is obtained by adding independent standard Gaussian noise to the mean. Following \cite{Baranowski:2016}, for {\texttt{wave1}} and {\texttt{wave2}} we compare methods using the mean square error (MSE) of the estimates of the mean, and using a scaled Hausdorff distance, $d_H$, to measure accuracy of the changepoint locations. This distance is defined as \[ d_H=\frac{1}{n_s} \max\left\{ \max_j \min_k |\tau_j-\hat{\tau}_k|, \max_k \min_j |\tau_j-\hat{\tau}_k| \right\}, \] where $\hat{\tau}_k$ are the estimated changepoint locations, $\tau_j$ the true changepoint locations, and $n_s$ the length of the largest segment. The idea is that for each true change we find the closest estimated changepoint, and for each estimated changepoint we find the closest true changepoint. We then calculate the distance between each of these pairs of changepoints, and $d_H$ is set to the largest of these distances divided by the length of the longest segment. The smaller $d_H$ the better the estimates of the changespoints, with $d_H=0$ meaning that all changepoints are detected without error, and no other changepoints are estimated. \begin{figure} \begin{center} \includegraphics[scale=0.6]{M3_M4.pdf} \end{center} \caption{\label{Fig:wave_results} Results for CPOP (black solid line), NOT (blue dotted line) and trend-filtering (red dashed line) for {\texttt{wave1}} (top row) and {\texttt{wave2}} (bottom row). We give results for mean square error of the estimate of the mean (left-hand column) and for the accuracy of the estimates of the changepoint locations, measured via $d_H$ (right-hand column). For {\texttt{wave1}} we considered data sets of length $n=1408$, $n=2816$ and $n=5632$, each data set having 8 segments. For {\texttt{wave2}} we considered data sets of length $n=1500$, $n=3000$ and $n=6000$, each data set having segments of length 150. Results are averaged over 100 data sets in for each scenario and each value of $n$. } \end{figure} First we analyse data from the {\texttt{wave1}} and {\texttt{wave2}} scenarios. We consider different lengths of data with either a fixed number of changepoints ({\texttt{wave1}}) or with the number of changepoints increasing linearly with the number of data points ({\texttt{wave2}}). For both {\texttt{wave1}} and {\texttt{wave2}} there is a substantial change in the slope of the mean at each changepoint. As such, these represent relatively straightforward scenarios for detecting changepoints, and both NOT and CPOP perform well at detecting the number of changepoints: NOT correctly identifies the number of changepoints for all 600 simulated data sets, and CPOP correctly identifies the number of changepoints in over 99\% of these cases. By comparison trend-filtering substantially over-estimates the number of changepoints in all cases. For {\texttt{wave1}} the average number of changes detected is 16 for $n=1408$, rising to 29 for $n=5632$, when the true number of changes is 7. We have similar over-estimation for {\texttt{wave2}}. The reason for this is the use the $L_1$ penalty for the change in slope. The $L_1$ penalty is the same for multiple consecutive changes in slope of the same sign as it is for one large change in slope. As a result trend-filtering tends to introduce multiple changepoints around each actual change. This over-estimation of the number of changes results in the much larger value of $d_H$ for this method than for NOT and CPOP: see the right-hand plots of Figure \ref{Fig:wave_results}. Whilst NOT and CPOP perform similarly in terms of accuracy when estimating changepoint location, CPOP is more accurate in terms of estimating the underlying mean: see the MSE results in the left-hand plots of Figure \ref{Fig:wave_results}. Again both methods perform better than trend-filtering. We believe the reason for this is that trend-filtering shrinks the change in slope towards 0. For signals like {\texttt{wave1}} and {\texttt{wave2}} where all changes in slope are substantial, this causes trend-filtering to under-estimate these changes. This can introduce substantial error at estimating the mean in regions around each changepoint. \begin{figure} \begin{center} \includegraphics[scale=0.6]{Random_Results.pdf} \end{center} \caption{\label{Fig:Random_results} Results for CPOP (black solid line), NOT (blue dotted line) and trend-filtering (red dashed line) for the {\texttt{Random}} scenario with a fixed number of changepoints (top row) and a fixed segment length (bottom row). We give results for mean square error of the estimate of the mean (left-hand column) and for the accuracy of the estimates of the changepoint locations, measured via the proportion of true-positives (middle column) and of false-positives (right-hand column). For the top row we have 20 segments for each data set, for the bottom row we have segments of length 100 for each data set. Results are averaged over 100 data sets for each case and each value of $n$. } \end{figure} We now compare the three methods on the {\texttt{Random}} simulation scenario. We consider data sets of length varying from 1000 to 10000, with either a fixed number of 20 segments or with the segment length fixed to 100. This is a harder scenario than either {\texttt{wave1}} or {\texttt{wave2}} as the change in slope differs considerably from changepoint to changepoint, with the change in slope being small in many cases (see the example data sets in the bottom row of Figure \ref{Fig:Scenarios}). As a result there are many changepoints that are hard to detect. In all cases CPOP and NOT under estimate the number of changes, while trend-filtering still over estimates this number. These two different sources of error are masked in the measure $d_H$, and thus we summarise the accuracy of changepoint detection through true-positive and false-positive proportions. To calculate these we say that an actual change is detected if there is an estimated changepoint within a certain distance of it. The results we show have set this distance to be a fifth of the segment length, though qualitatively similar results are obtained with different choices. We calculate the number of false positives as the number of changepoints detected less the number of true positives. Our results are in terms of the true-positive proportion, which is the proportion of actual changepoints detected, and the false-positve proportion, the proportion of detected the changepoints that are false-positive. Results are shown in Figure \ref{Fig:Random_results}. These are qualitatively different from the earlier results. For this problem we see that trend-filtering is most accurate in terms of estimating the underlying mean. We believe that trend-filtering is more suited to this scenario as there are a range of values for how much the slope changes at each changepoint, including many cases where the change is small. Hence the shrinking of the change in slope that trend-filtering induces is actually beneficial. As trend-filtering estimates more changes, it detects a higher proportion of true changepoints, but it has a high false-positive proportion: in all cases over 40\% of the changepoints it finds are false-positives. By comparison both NOT and CPOP have lower false positive proportions, and encouragingly, this proportion decreases as the segment length increases (see top right-hand plot in Figure \ref{Fig:Random_results}). Whilst NOT is marginally better in terms of accuracy of the detected changepoints, CPOP is substantially more accurate in terms of its estimate of the underlying mean. \section{Bacterial Flagella Motor Data} \label{sec:bacteria} We return to the bacterial flagella motor data we introduced in Section \ref{sec:introduction} and Figure \ref{Fig:Sowa1}. For more background on these biological systems see \citep{sowa,Sowa2008,Zhou1998}. Data similar to those we analyse has been collected by \cite{ryu2000torque,chen2000solvent,chen2000torque,sowa2003torque} among others. Here we look at how well we can extract the angular motion by fitting changepoint models, and in particular change-in-slope models using the CPOP algorithm. The data we analyse comes from \cite{sowa} and is shown in Figure \ref{Fig:Sowa2}. It consists of 11,912 observations. \begin{figure} \begin{center} \includegraphics[scale=0.7,angle=0]{Sowa_fast_fits.pdf} \end{center} \caption{\label{Fig:Sowa2} Time-series of angular position \cite[data from][]{sowa} and example fits obtained by NOT (top); CPOP (middle) and trend-filtering (bottom). The fit obtained by CPOP is the one that contains the same number, 182, of changepoints as that found by NOT (see text for more details). For ease of presentation we have plotted the angle of the bacteria, the model we fit assumes continuity of angles of 360 degrees (top of each plot) and 0 degrees (bottom of each plot).} \end{figure} \begin{figure} \begin{center} \includegraphics[scale=0.4,angle=0]{Sowa_RSS_tr.pdf} \end{center} \caption{\label{Fig:Sowa_comp} Accuracy of fits of data shown in Figure \ref{Fig:Sowa2} by a piecewise constant mean (red dashed line), a continuous piecewise-linear mean (black full line) and a discontinuous piecewise-linear mean (blue dotted line). For each type of line we found the best segmentation, in terms of minimising the residual sum of squares (RSS) of the fit, for a range of the number of changepoints. We plot the RSS against the number of free parameters of the fitted mean function for each case. } \end{figure} The aim of our analysis is to fit the underlying angular position. We first compared fitting a continuous piecewise linear mean to both fitting a piecewise constant mean and a discontinuous piecewise linear mean. We fit the latter two by minimising the residual sum of squares plus a penalty times the number of changepoints, using the PELT algorithm \cite[]{Killick2012a}. In all cases we varied the penalty value using the CROPS algorithm \cite[]{Haynes2014}. Different penalty values lead to optimal segmentations with different numbers of changepoints. For each different segmentation we calculated the actual residual sum of squares of the fit we obtained. A plot of this against the number of free parameters in the fitted mean is shown in Figure \ref{Fig:Sowa_comp}. We can see that fitting a continuous piecewise-linear function, which is more natural for this application, leads to a uniformly better fit to the data than the change in mean for any given number of parameters. The assumption of continuity also gives improvements for fitted means with fewer than 400 parameters. While the differences in residual sum of squares looks small, due to the large number of observations, the reduction in log-likelihood, under a model where the residuals are iid Gaussian, is still substantial. For example, for models with fewer than 350 parameters, the best fitting continuous mean has a log-likelihood that is 32.4 units greater than the best fitting discontinuous mean. We also compared the accuracy of using CPOP to analyse this data to that of using NOT and trend-filtering. A comparison of the fits obtained using NOT, CPOP and trend-filtering are shown in Figure \ref{Fig:Sowa2}. We ran NOT with a total of $10^6$ random intervals, and have plotted the segmentation that minimised the SIC. This segmentation has 794 changepoints, largely because it substantially overfits the latter part of the data. For comparison, an example fit from CPOP is also shown. The segmentation obtained using CPOP has 182 changepoints. Despite fewer changes, it has a smaller residual sum of squares than the segmentation that NOT found: 1.72 as compared to 1.80. We also ran trend-filtering for a range of penalty values. For all penalty values that gave a reasonable fit to the data, the number of changes in slope was large: with changes at more than half the time-points. In these cases the majority of changes in slope with small. As a crude approach to choosing a sensible segmentation we defined there to be a change-point if the change in slope was non-zero after rounding to 3 decimal places. Using this definition we then found the segmentation that minimised the SIC. This is shown in the bottom plot of \ref{Fig:Sowa_comp}. This had 278 changepoints under our definition, and 10,850 actual changes in slope. We see that the estimated mean we obtained appears to under-fit the data in a number of places. It has a higher residual sum of squares, 2.94, than the fitted mean shown for either CPOP or NOT. \section{Discussion} \label{sec:discussion} We have presented a continuous-state dynamic programming algorithm for finding the best continuous piecewise linear fit to data under a criterion that measures fit to the data using the residual sum of squares and penalises complexity through the number of changes in slope. This is a setting where standard dynamic programming approaches for changepoint detection do not work, due to the dependence across segments imposed by the continuity constraint. Empirically this approach is feasible for data with up to 10,000 data points and 100s of changepoints. For such challenging scenarios, we see from the analysis of the bacterial flagella motor data, that this method can produce a substantially better fit to the data than faster approximate alternatives like NOT and trend-filtering. The dynamic programming approach we have used has the potential to be applied to a much wider range of changepoint problems with dependence across segments. The key requirement is that we can construct a recursion for a set of functions, our $f^{t}(\phi)$, that are piecewise quadratic in some univariate parameter $\phi$. This requires that we measure fit to the data through the residual sum of squares, that the dependence of the parameters in successive segments is through a univariate quantity $\phi$, and that any constraints on parameters in successive segments respect the piecewise quadratic nature of $f^{t}(\phi)$. This would cover change in mean or slope under monotonicity constraints, our change in slope model with an additional $L_1$ or $L_2$ penalty on the change in slope, or more general models for the mean that are piecewise polynomonial and continuous. The requirement that dependence across segments is through a univariate quantity comes from our functional pruning approach. Such pruning is important for reducing the computational complexity of the algorithm. It is unclear whether functional pruning can be implemented for piecewise quadratic functions, $f^{t}(\phi)$, when $\phi$ is not univariate as the line search approach we take does not generalise beyond the univariate case. Even if not, it may be possible to develop efficient algorithms that implement an approximate version of functional pruning. {\bf Acknowledgements} This work was supported by EPSRC grants EP/N031938/1 (StatScale) and EP/H023151/1 (STOR-i). We thank Ashley Nord and Richard Berry for helpful discussions on the analysis of the bacterial flagella motor data; and Rafal Baranowksi, Yining Chen and Piotr Fryzlewicz for advice on using NOT.
{'timestamp': '2017-02-06T02:04:21', 'yymm': '1701', 'arxiv_id': '1701.01672', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01672'}
arxiv
\section{Introduction} Since \citet{fan2008sure}, a marginal feature screening has been regarded as one canonical tool in ultrahigh-dimensional data analysis. Let $Y$ be a univariate response and $\bX = (X_1, \ldots, X_p)^T$ be a $p$-dimensional covariate. We assume that only a small subset of covariates are informative to explain $Y$. In particular, we assume $|S^*| = d \ll p$ where \begin{align}\label{eq::set} S^* = \{j: F(y|\bX) \mbox{ functionally depends on } X_j \mbox{ for some } y \}, \end{align} with $F(\cdot|\bX)$ being the conditional distribution function of $Y|\bX$. Such assumption is reasonable since including large number of variables with weak signals often deteriorates the model performance due to accumulated estimation errors. Since the introduction of \citet{fan2008sure}, numerous marginal screening methods have been developed (see Section 1 of \citet{mai2015fused} for a comprehensive summary). Among these methods, model-free screening \citep{zhu2011model,li2012feature,mai2015fused} is desirable since the screening is a pre-processing procedure followed by a main statistical analysis. For feature selection in binary classification, Kolmogorov filter (KF) is proposed by \citet{mai2012kolmogorov}. For each $X_j, j = 1, \ldots, p$, KF computes $$ \kappa_j = \sup_x| P(X_j \le x|Y = 1) - P(X_j \le x|Y = -1)|, \quad \mbox{$ j = 1,\ldots,p$,} $$ and selects variables with large $\kappa_j$'s among all $j = 1, \cdots, p$. A sample version of $\kappa_j$ is obtained by replacing the probability measure with its empirical counterpart, leading to the well-known Kolmogorov--Smirnov statistic where its name came from. KF shows impressive performance in binary classification Recently, \citet{mai2015fused} have extended the idea of KF beyond the binary response by slicing data into $G$ pieces depending on the value of $Y$. In particular, a pseudo response $\tilde Y$ taking $g$ if $Y \in (a_g-1, a_g]$ for $g=1, \ldots, G$, is defined for given knots $\mathcal{G} = \{(-\infty =) a_0 < a_1 < \ldots < a_G (= \infty)\}$. Following the spirit of KF, one can select a set of variables with large values of \begin{equation} \label{eq:fkf} \kappa_j^{\GG} = \max_{l,m} \sup_x | P(X_j \le x|\tilde Y = m) - P(X_j \le x|\tilde Y = l)|, \quad \mbox{$j = 1,\ldots,p$}. \end{equation} However, information loss is inevitable due to the lower resolution of pseudo variable $\tilde Y$ compared to $Y$ regardless of the choice of $\mathcal{G}$. To tackle this, \citet{mai2015fused} proposed fused Kolmogorov filter (FKF) that combinies $\kappa_j^\mathcal{G}$ for different $N$ sets of knots $\mathcal{G}_1, \ldots, \mathcal{G}_N$ and selects variables with large values of $\kappa_j^{\text{fused}} = \sum_{\ell = 1}^N \kappa_j^{\mathcal{G}_\ell}$, for $j = 1,\ldots, p$. The source of improvement in FKF is clear, however, it cannot perfectly overcome the information-loss problem caused by slicing. In addition, it is subtle to decide how to slice data in a finite sample case. To this end, we propose the cumulative Kolmogorov filter (CKF). CKF minimizes information loss from the slicing step and is free from choice of slices. As a consequence, it enhances the FKF. \section{Cumulative Kolmogorov filter} We let $F(\cdot | X_j)$ denote the conditional distribution function of $Y$ given $X_j$. Given $x$ such that $0< P(X_j \leq x)<1$, define \begin{equation} \label{eq::ckf1} k_j(x) = \sup_{y} \left|F(y| X_j> x) - F(y|X_j \leq x) \right|, \qquad j = 1, \ldots, p. \end{equation} We remark that \eqref{eq::ckf1} is identical to \eqref{eq:fkf} with $\mathcal{G} = \{-\infty , x , \infty\}$ except that the sliced variable in \eqref{eq::ckf1} is $X_j$ instead of $Y$. The choice of a slicing variable between $X_j$ and $Y$ is not crucial, however, it would be more natural to slice independent variable in regression set up whose target is $E(Y|\bX)$. Now, $$ k_j(x) = \frac{1}{P(X_j \leq x) (1-P(X_j \leq x)) } \sup_y \left| P(X_j \leq x) P(Y \leq y) - P(Y\leq y, X_j \leq x) \right|, $$ which immediately yields $k_j(x) = 0$ for all $x$ satisfying $0<P(X_j \leq x) <1$ if and only if $X_j$ and $Y$ are independent. In fact, $k_j(x)$ indicates the level of dependence as shown in the following lemma. \begin{lemma}\label{bivariate} If $(X_j,Y)$ has a bivariate Gaussian copula distribution such that $(g_1(X_j),g_2(Y))$ is jointly normal with correlations $\rho_j = \text{Cor}(g_1(X_j), g_2(Y))$ after transformation via two monotone funcitons $g_1,g_2$, and $g_1(X_j)$ and $g_2(Y)$ are marginally standard normal. Then \begin{enumerate} \item $k_j(x) = 1$ if $|\rho_j| = 1$ and $k_j(x) = 0$ if $\rho_j = 0$. \item Denoting $y^* = x \big(\frac{1-\sqrt{1-\rho_j^2}}{\rho_j} \big)$, \begin{align*} k_j(x) &= \frac{1}{\Phi(x)(1-\Phi(x))} \left|\int_{-\infty}^{y^*} \Phi \Big( \frac{x- \rho_j u}{\sqrt{1-\rho_j^2}} \Big) \phi(u) du - \Phi(x) \Phi(y^*) \right|. \end{align*} \item For each $x$, $k_j(x)$ is a strictly increasing function of $|\rho_j|$. \end{enumerate} \end{lemma} Nonetheless, \eqref{eq::ckf1} loses lots of information from the dichotomization of $X_j$. To overcome this, we define \begin{align} \label{cum.kf} K_j = E\left[k_j(\tilde X_j)\right],\quad \mbox{for \ $j = 1, \ldots, p$,} \end{align} where $\tilde X_j$ denotes an independent copy of $X_j$. In the population level, \eqref{cum.kf} is fusing infinitely many KFs with all possible dichotomized $X_j$'s. By doing this, we can not only minimize efficiency loss but also be free from the choice of knot sets. Similar idea has been firstly proposed by \citet{zhu2010dimension} in the context of sufficient dimension reduction where the slicing scheme has been regarded as a canonical approach. Given $(Y_i, \bX_i), i = 1, \ldots, n$ where $\bX_i = (X_{i1}, \ldots, X_{ip})^T$, a sample version of \eqref{eq::ckf1} is $\hat k_j(x) = \sup_y \left| \hat F(y| X_j >x) - \hat F(y| X_j \leq x) \right|$ where $\hat F(y| X_j > x) = \frac{\sum_{i=1}^n \mathds{1}_{\{Y_i \leq y, X_{ij} > x \}}}{\sum_{i=1}^n \mathds{1}_{\{ X_{ij} > x\}}}$ and $\hat F(y| X_j \le x)$ is similarly defined. Now, an estimator of \eqref{cum.kf} is given by \begin{align} \label{est.cum.kf} \hat K_{j} = \frac{1}{n}\sum_{i=1}^n \hat k_{j}(X_{ij}). \end{align} Finally, for $d_n \in \mathbb{N}$, we propose CKF to select the following set $$ \hat S(d_n) = \{j: \hat K_{j} \mbox{ is among the first $d_n$ largest of all $\hat K_j, j = 1, \cdots, p$} \}. $$ \section{The Sure Screening Property} We assume a regularity condition. \begin{assumption}\label{ass} There exists a nondegenerate set $S$ such that $S^* \subseteq S$ and $$\Delta_S = \min_{j \in S} K_j - \max_{j \notin S} K_j >0.$$ \end{assumption} Assumption \ref{ass} is similar to the regularity condition (C1) for KFK \citep{mai2015fused}. In fact, FKF requires one additional condition that guarantees that the estimated slices are not very different from oracle slices based on population quantiles of $Y$, which is not necessary for CKF since it is free from the slice choice. KF with a binary response requires only one assumption similar to Assumption~\ref{ass}. \begin{theorem}\label{mainthm} Under Assumption \ref{ass}, when $d_n \geq |S|$ and $\Delta_S>4/n$, $$ P( S^* \subset \hat S(d_n)) \geq 1- \eta, $$ where $$ \eta = p \left(4n\exp(-n\Delta_S^2/128) + 2\exp(-n\Delta_S^2/16) \right). $$ This probability tends to 1 when $\Delta_S \gg \sqrt{\frac{\log (pn)}{n}}$. \end{theorem} The sure screening probability converges to one when $\Delta_S \gg \{\log (p n)/n\}^{1/2}$, which is more relaxed than FKF that requires $\Delta_S$ to be greater than $\{(\log n \log (p N \log n))/n\}^{1/2}$. Theorem \ref{mainthm} demonstrate that CKF indeed improves FKF by minimizing efficiency loss entailed by the slicing step. \section{A simulation study} \subsection{A toy example} Consider a simple regression model $Y = \beta X + \epsilon$ where $X$ and $\epsilon$ are from independent $N(0,1)$. In this regard, \eqref{est.cum.kf} can be thought as a statistic for testing $H_0: \beta = 0$. To demonstrate the performance of CKF, we compare its power to i) $\hat \kappa^{\text{binary}} = \sup_y | \hat F(y|X> \mbox{median}\{X\}) - \hat F(y|X \le \mbox{median}\{X\})|$ and ii) $\sum_{\ell = 1}^4 \hat \kappa^{\mathcal{G}_\ell}/4$ with four equally-spaced knot sets whose sizes are 3,4,5, and 6 as suggested by \citet{mai2015fused}. Figure \ref{fg:motivation} depicts numerically computed power functions of three methods under significance level $\alpha = 0.05$. As expected, CKF \eqref{est.cum.kf} performs best while the simplest $\hat \kappa^{\text{binary}}$ does worst, which echoes the fact that screening performance can be improved by minimizing information loss entailed in the slicing step and CKF indeed achieves it. \begin{figure}[h] \centering \includegraphics[height = 6cm]{motivation} \caption{Power functions under $\alpha = 0.05$. CKF shows clear improvement.} \label{fg:motivation} \end{figure} \subsection{Comparison to other screening methods} We consider the following nine models with $(n, p) = (200, 5000)$ and $\epsilon \sim N(0,1)$ independent of $\bX$: \begin{enumerate} \item $U(Y) = T(\bX)^T \beta + \epsilon$, where $\beta = (2.8 \times 1_2^T, 0_{p-2}^T)^T$, $T(X) \sim N_p (0_p, \bSigma)$ with $\bSigma = CS(0.7)$. $CS(0.7)$ is a compound symmetry correlation matrix with the correlation coefficient of $0.7$. Let $U(Y) = Y$, $T(\bX) = \bX$. \item $T(\bX) = \bX^{1/9}$ and other settings are the same as Model 1. \item $U(Y) = Y^{1/9}$ and other settings are the same as Model 1. \item $U(Y) = T(\bX)^T \beta + \epsilon$, where $\beta = (0.8 \times 1_{10}^T, 0_{p-10}^T)^T$, $T(X) \sim N_p (0_p, \bSigma)$ with $\bSigma = AR(0.7)$. $AR(0.7)$ is an autoregressive correlation matrix with the autoregressive correlation coefficient of $0.7$. Let $U(Y) = Y$, $U(\bX) = \bX$. \item $T(\bX) = \frac{1}{2}\log(\bX)$ and and other settings are the same as Model 4. \item $U(Y) = \log(Y)$ and other settings are the same as Model 4. \item $Y = (X_1 + X_2 + 1)^3 + \epsilon$, where $X_j \stackrel{iid}{\sim} Cauchy$. \item $Y = 4X_1 + 2 \tan (\pi X_2/2) + 5X_3 + \epsilon$, where $X_j \stackrel{iid}{\sim} U(0,1)$ independently. \item $Y = 2(X_1 + 0.8 X_2 + 0.6 X_3 + 0.4 X_4 + 0.2 X_5) + \exp(X_{20} + X_{21} + X_{22})\epsilon$, where $\bX \sim N(0, \bSigma)$ with $\bSigma = CS(0.8)$. \end{enumerate} To avoid a cutoff selection problem, we report the average number of minimum variables needed to recover all informative ones over 100 independent repetitions. Hence, a smaller value implies a better performance. Table \ref{sim1} contains the comparison results against correlation learning \citep[CS,][]{fan2008sure} and distance correlation learning \citep[DCS,][]{li2012feature} as well as FKF. The results clearly show that the proposed CKF has improved performance compared to others including FKF. \begin{table} \scriptsize \centering \begin{tabular}{c c rrrrrrrr} \hline Model & $d$ & \multicolumn{2}{c}{SIS} & \multicolumn{2}{c}{DCS} & \multicolumn{2}{c}{FKF} & \multicolumn{2}{c}{CKF} \\ \hline 1 & 2 & 2.00 & (0.00) & 2.00 & (0.00) & 3.79 & (6.28) & 2.00 & (0.00)\\ 2 & 2 & 2038.12 & (1348.05) & 1985.10 & (1460.82) & 4.62 & (9.14) & 2.00 & (0.00)\\ 3 & 2 & 891.22 & (1071.58) & 350.88 & (794.67) & 3.88 & (6.96) & 2.00 & (0.00)\\ \hline 4 & 10 & 10.04 & (0.20) & 10.04 & (0.20) & 10.26 & (1.09) & 10.06 & (0.24)\\ 5 & 10 & 150.10 & (351.46) & 12.50 & (10.42) & 10.23 & (0.49) & 10.11 & (0.35)\\ 6 & 10 & 1618.50 & (1423.11) & 927.16 & (916.20) & 10.81 & (4.27) & 10.03 & (0.17)\\ \hline 7 & 2 & 1051.14 & (1473.43) & 682.47 & (965.43) & 2.00 & (0.00) & 2.00 & (0.00)\\ 8 & 3 & 2980.23 & (1494.26) & 277.43 & (606.47) & 9.05 & (18.69) & 6.66 & (11.27)\\ 9 & 8 & 3562.30 & (1252.76) & 231.63 & (526.51) & 60.84 & (126.12) & 38.59 & (52.58)\\ \hline \end{tabular} \caption{Average number of minimum variables needed to keep all informative ones over 100 independent repetitions. Standard deviations are in parentheses.}\label{sim1} \end{table} \section{Discussions} We employ a cumulative slicing technique to extend a screening tool for binary response to contiuous one. The idea is quite general and can be applied to t-test-based screening \citep{fan2008high,fan2008sure} as well as logistic-regression-based screening \citep{fan2010sure}. In addition, it is possible to extend the idea of CKF to the censored response by replacing the empirical distribution function with the Kaplan-Meier estimator. \bibliographystyle{dcu}
{'timestamp': '2017-01-09T02:03:32', 'yymm': '1701', 'arxiv_id': '1701.01560', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01560'}
arxiv
\section{Introduction} Neurodegenerative disorders (NDDs), such as Alzheimer's disease (AD), are characterised by the progressive pathological alteration of the brain's biochemical processes and morphology, and ultimately lead to the irreversible impairment of cognitive functions. The correct understanding of the relationship between the different pathological features is of paramount importance for improving the identification of pathological changes in patients, and for better treatment. To this end, the recent availability of collections of imaging and clinical data in NDDs is a unique opportunity to define statistical models for the {joint modelling} of the temporal changes of {imaging}, {biochemical}, and {clinical} biomarkers. The goal of disease progression modeling in NDDs is twofolds: 1) \emph{quantifying} the dynamics of NDDs along with the related temporal relationship between different biomarkers, and 2) \emph{staging} patients based on individual observations for diagnostic and interventional purposes. The related challenge is in the definition of optimal methods to integrate and jointly analyze the heterogeneous and highly multi-modal information available to clinicians. Moreover, longitudinal clinical datasets of NDDs generally lack of a well-defined temporal reference, since the onset of the pathology may vary across individuals according to genetic and environmental factors \cite{yang2011}. Therefore, age or visit date information are biased time references for the individual longitudinal measurements. To tackle this problem, in \cite{donohue2014} the authors proposed to model the temporal biomarker trajectories as a random effect regression problem, building on the well established theory of {self-modeling regression} \cite{kneip1988}. Practically, the trajectories are modelled by monotonic B-splines, and the estimation is performed by subsequent minimization of the partial residuals sum of squares associated with regression parameters and individual time shift, respectively. Based on the assumption of a logistic curve shape for the average biomarker trajectories, \cite{schiratti2015} frames the random effect regression model in a Riemannian setting, in which the random effects identify individual time-shift and acceleration factors. Finally, image-based progression models have been recently proposed \cite{younes2014,bilgel2015}, based on time-reparameterization of voxel/mesh-based measures. While the main focus of current works mainly concerns the modeling of neurodegeneration, the use of disease progression models for predictive purposes is much less investigated. Predictive models of patient staging were proposed within the setting of event based models \cite{fonteijn2011}, or still through random effect modeling \cite{guerrero2016}. However, the event based model relies on the coarse binary discretization of the biomarker changes, and does not account for longitudinal observations, while the model proposed in \cite{guerrero2016} requires cohorts with known disease onset, and therefore does not easily generalise to the study of general clinical populations. In this study we propose an unified approach to the consistent disease progression modeling and probabilistic prediction of clinical data, by introducing a Bayesian regression framework of imaging and clinical biomarker progressions from time series of individual observations. The model is based on Gaussian process (GP) regression, and is formulated to account for individual random effects and time reparameterization, as well to naturally account for missing observations. The {methodological contribution} of this study consists in reformulating disease progression modeling within a Bayesian context, allowing non-parametric estimates of the biomarker evolution, as well as high flexibility in specifying random effects structure, and time reparameterization models. The uniqueness of the time transformation is enforced by imposing a {monotonicity constraint} on the trajectories, via a prior on the temporal derivatives, while the model is computationally efficient thanks to the block-wise algebraic structure of the GP covariance function. From the application point of view, the proposed approach enables novel applications of disease progression modeling such as the \emph{probabilistic prediction} of disease staging in unseen patients. Moreover, the model naturally accounts for missing data, and allows for uncertainty quantification of both evolutions and parameters. Section \ref{section:Model} introduces the proposed GP regression model of joint temporal progression of biomarkers, along with the prior derivatives specification. The resulting posterior and approximated inference scheme through expectation propagation (EP) is described in Section \ref{section:Likelihood}. Finally, Section \ref{section:experiments} illustrates the validation of our model on i) synthetic data and ii) clinical and multivariate imaging measurements from a cohort of 517 amyloid positive individuals of the ADNI database. The experimental results show that our model provides a biologically plausible description of the evolution of AD across the whole disease time-span, as well as statistically significant prediction of disease staging and high classification accuracy on unseen and incomplete testing data. \section{Gaussian process-based random effect modeling of longitudinal progressions}\label{section:Model} In what follows, longitudinal measurements of $N_b$ biomarkers $\{b_1, \ldots, b_{N_b}\}$ over time are given for $N$ individuals. We represent the longitudinal biomarker's measures associated with each individual $j$ as a multidimensional array $(\mathbf{y}^j({t_1}), \mathbf{y}^j({t_2}), \ldots, \mathbf{y}^j({t_{k^j}}))^{\top}$ sampled at $k^j$ multiple time points $ \mathbf{t} = \{{t}_{1}, {t}_{2}, \ldots, {t}_{k^j}\}$. Although different biomarkers may be in reality sampled at different time-points, for sake of notation simplicity in what follows we will assume, without loss of generality, that the sampling time is common among them. The observations for individual $j$ at a single time point $t$ are thus a random sample from the following generative model: \begin{align}\label{GenerativeModel} {\mathbf{y}^j(t)} = \left({{y}_{b_1}^j(t)}, {{y}_{b_2}^j(t)}, \ldots, {y}_{b_{N_b}}^j(t)\right)^{\top} &= \mathbf{f}({t}) + {\boldsymbol{\nu}^j}({t}) + \boldsymbol{\epsilon}, \end{align} where $\mathbf{f}({t}) = ({{f}_{b_1}}({t}), {{f}_{b_2}}({t})\ldots, {{f}_{b_{N_b}}}({t}))^{\top}$ is the fixed effect function modelling the biomarker's longitudinal evolution, $\boldsymbol{\nu}^j({t}) = ({\nu}_{b_1}^j({t}),{\nu}_{b_2}^j({t}), \ldots, {\nu}_{b_{N_b}}^j({t}))^{\top}$ is the individual random effect, and $\boldsymbol{\epsilon} = ({\epsilon}_{b_1},{\epsilon}_{b_2}, \ldots,{\epsilon}_{b_{N_b}})^{\top} $ is observational noise independent from time. The group-wise evolution is modelled as a zero-mean GP, $\mathbf{f}\sim \mathcal{GP}(0,\Sigma_G)$, the individual random effects are assumed to be Gaussian distributed correlated signal $\boldsymbol{\nu}^j\sim \mathcal{N}(0,\Sigma_S)$, while the observational noise is assumed to be a Gaussian heteroskedastic term $\boldsymbol{\epsilon} \sim \mathcal{N}(0,\Sigma_{\epsilon})$, where $\Sigma_{\epsilon}$ is a diagonal matrix $\mbox{diag}[\boldsymbol{\sigma}_{b1}^2,\boldsymbol{\sigma}_{b2}^2, \ldots, \boldsymbol{\sigma}_{b_{N_b}}^2 ]$.\\ \textbf{Fixed Effect Process.} The covariance function $\Sigma_G$ describes the biomarkers temporal variability, and is represented as a block-diagonal matrix \begin{eqnarray}\label{FixCovariance} \Sigma_G(\mathbf{f},\mathbf{f}) &= \mathrm{diag}[ \Sigma_{b_1}(\mathbf{f}_{b_1},\mathbf{f}_{b_1}), \Sigma_{b_2}(\mathbf{f}_{b_2},\mathbf{f}_{b_2}), \ldots, \Sigma_{b_{N_b}}(\mathbf{f}_{b_{N_b}},\mathbf{f}_{b_{N_b}}) ], \end{eqnarray} where each block represents the within-biomarker temporal covariance expressed as a negative squared exponential function: \begin{align} \Sigma_{b}(\mathbf{f}_b(t_1),\mathbf{f}_b(t_2)) &= \eta_b \exp\left(-\frac{(t_1-t_2)^2}{2\,l_b^2}\right), \end{align} and where the parameters $\eta_b$ and $l_b$ are the marginal variance and length-scale of the biomarker's temporal evolution, respectively. \\ \textbf{Individual Random Effects.} The random covariance function $\Sigma_S$ models the individual deviation from the fixed effect, and is represented as a block-diagonal matrix $$\Sigma_S (\boldsymbol{\nu}^j,\boldsymbol{\nu}^j)= \mathrm{diag}[\,\Sigma_{b_1}^j(\boldsymbol{\nu}_{b_{1}}^j,\boldsymbol{\nu}_{b_{1}}^j), \Sigma_{b_2}^j(\boldsymbol{\nu}_{b_{2}}^j,\boldsymbol{\nu}_{b_{2}}^j), \ldots, \Sigma_{b_{N_b}^j}(\boldsymbol{\nu}_{b_{N_b}}^j,\boldsymbol{\nu}_{b_{N_b}}^j) ],$$ where each block $\Sigma_{b}^j$ corresponds to the covariance function associated with the individual process $\boldsymbol{\nu}_{b}^j({t})$. Thanks to the flexibility of the proposed generative model, any form of the random effect covariance $\Sigma_S$ can be easily specified in order to model the subject-specific biomarkers' progression. In what follows we will use a linear covariance form $\Sigma_{b}^j(\boldsymbol{\nu}_{b}^j(t_1), \boldsymbol{\nu}_{b}^j(t_2)) = (\sigma_b^j)^2 \left((t_1 - \overline{\mathbf{t}}) (t_2 - \overline{\mathbf{t}}) \right)$, where $\overline{\mathbf{t}}$ is the average observational time for individual $j$, if more than 4 measurements were available, and i.i.d. Gaussian covariance form $\Sigma_{b}^j(\boldsymbol{\nu}_{b}^j(t_1), \boldsymbol{\nu}_{b}^j(t_2)) = (\sigma_b^j)^{2}$ if 2 or 3 measurements were available, while assigning it to 0 otherwise. This choice is motivated by stability concerns, in order to keep the model complexity compatible with the generally limited number of measurements available for each individual. \\ \textbf{Individual time transformation.} The generative model (\ref{GenerativeModel}) is based on the key assumption that the longitudinal observations across different individuals are defined with respect to the same temporal reference. This assumption may be invalid when the temporal alignment of the individual observations with respect to the common group-wise model is unknown, for instance in the typical scenario of a clinical trial in AD where the patients' observational time is relative to the common baseline, and where the disease onset is a latent event (past or future) which is not directly measurable. We assume that each individual measurement is made with respect to an absolute time-frame $\tau$ through a time-warping function $t = \phi^j(\tau)$ that models the time-reparameterization with respect to the common group-wise evolution. Model (\ref{GenerativeModel}) can thus be reparameterized as \begin{align}\label{GenerativeModelNew} \mathbf{y}^j(\phi^j(\tau)) = \mathbf{f}(\phi^j(\tau)) + \boldsymbol{\nu}^j(\phi^j(\tau)) + \boldsymbol{\epsilon}. \end{align} The present formulation allows the specification of any kind of time transformation, and in what follows we shall focus on the modelling of a linear reparameterization of the observational time $\phi^j(\tau) = \tau + d^j$. This modeling assumption is mostly motivated by the choice of working with a reasonably limited number of parameters, compatibly with the generally short follow-up time available per individual (cfr. Table \ref{Nobs}). Within this setting, the time-shift $d^j$ encodes the disease stage associated with the individual relatively to the group-wise model. Overall, model (\ref{GenerativeModelNew}) is identified by $(N_j + 3) N_b + N_j $ parameters, represented by the fixed effects and noise $\boldsymbol{\theta}_G = \{\eta_{b_k}, l_{b_k}, \epsilon_{b_k}\}_{k=1}^{N_b}$, by the individual random effects parameters $\boldsymbol{\theta}_G^j = \{\sigma_{b_k}^j\}_{k=1}^{N_b}$ and by the time-shifts $d^j$. \\ \textbf{Monotonic constraint in multimodal GP regression.} Due to the non-parametric nature of Gaussian process regression, we need an additional constraint on model (\ref{GenerativeModelNew}) in order to identify a unique solution for the time-warp. By assuming a steady temporal evolution of biomarkers from normal to pathological values, we shall assume that the biomarker trajectories described by (\ref{GenerativeModelNew}) follow a (quasi) monotonic behaviour. This requirement can be implemented by imposing a prior positivity constraint on the derivatives of the GP function $f$. Inspired by \cite{riihimaki2010gaussian}, we impose a monotonicity constraint by assuming a probit-likelihood for the derivative measurements $\mathbf{m}(t)$ associated with the derivative process $\mathbf{\dot{f}}(t) = \frac{\mathrm{d} \mathbf{f}(t)}{\mathrm{d} t}$ at time $t$: \begin{align} p(\mathbf{m}(t)|\mathbf{\dot{f}}(t)) &= \Phi\left(\frac{1}{\lambda}\mathbf{\dot{f}}(t)\right), \end{align} with $\Phi(z) = \int_{-\infty}^z\mathcal{N}(x|0,1)\,dx$. The quantity $\lambda > 0$ is an additional model parameter controlling the degree of positivity enforced on the derivative process, with values approaching to zero for stronger monotonicity constraint. In what follows, the monotonicity of each biomarker is controlled by placing 10 derivative points equally spaced on the observation domain, and by fixing the $N_b$ derivative parameters $\{\lambda_{b_k}\}_{k=1}^{N_b}$ to the value of $e$-6. This choice for the parameter is motivated by the need to enforce a strong monotonicity constraint, necessary for the stability of the initial time-shift estimation. \\ \textbf{On adding a monotonic constraint to the individual observations.} By following a similar construction, we could equally enforce a monotonic behaviour to the random effects associated with the individual trajectories. This additional constraint would however come with a cumbersome increase of the model complexity, since it would introduce an additional layer of virtual derivative parameters (with associated location) per individual. Moreover, while we are interested in modeling a {globally} monotonic biomarker trajectory on the fixed parameters, we relax this constraint at the individual level, since some subjects may be characterised by non strictly monotonic time-series due to specific clinical conditions. \section{Joint Model: marginal likelihood and inference}\label{section:Likelihood} Given the sets of individual biomarker measurements $\mathbf{y}=\{(\mathbf{y}^j(t_i))_{i=1}^{k^j}\}_{j=1}^{N}$, and of $D$ control derivatives $\mathbf{m}=\{m_{b_k}(t_l')\}_{l=1}^D$ at points $t' = \{t_l'\}_{l=1}^D$ for the progression of each biomarker $b_k$, the random effect GP model posterior is: \begin{align} p\left(\mathbf{f},\mathbf{\dot{f}},\boldsymbol{\nu}^j|\mathbf{y},\mathbf{m} \right) &= \frac{1}{Z}p(\mathbf{f},\mathbf{\dot{f}}|t,t')p(\boldsymbol{\nu}|t)p(\mathbf{y}|\mathbf{f},\boldsymbol{\nu})p(\mathbf{m}|\mathbf{\dot{f}})\nonumber\\ &= p(\mathbf{f},\mathbf{\dot{f}}|t,t')p(\boldsymbol{\nu}|t)p(\mathbf{y}|\mathbf{f},\boldsymbol{\nu})\prod_k\prod_l\Phi\left(\frac{1}{\lambda}{\dot{f}}_{b_k}(t_l')\right)\label{posterior}, \end{align} where $\boldsymbol{\nu} = \{\mathbf{\nu}^j\}_{j=1}^N$. Thanks to the linearity of GPs under derivation, we have that $Cov\left(\mathbf{f}(t),\mathbf{\dot{f}}(t')\right) = \frac{\mathrm{d}Cov(\mathbf{f}(t),\mathbf{f}(t'))}{\mathrm{d}t'}$, and that the joint distribution $p\left(\mathbf{f},\mathbf{\dot{f}}|t,t'\right)$ is again a GP: \begin{eqnarray}\label{joint} p\left(\mathbf{f},\mathbf{\dot{f}},\boldsymbol{\nu}^j|t,t'\right) &\sim& \mathcal{GP}\left(\mathbf{f}_{joint}|0,\Sigma_{joint}\right) \nonumber\\ \mathbf{f}_{joint} = \begin{pmatrix}\mathbf{f}\\ \mathbf{\dot{f}} \end{pmatrix} & \sim & \mathcal{N}\left[\left(\begin{array}{c} 0\\ 0 \end{array}\right), \left(\begin{array}{cc} \Sigma_G(\mathbf{f}(t),\mathbf{f}(t)) & \frac{\partial\Sigma_G(\mathbf{f}(t),\mathbf{f}(t'))}{\partial t'}\\ \frac{\mathrm{d}\Sigma_G(\mathbf{f}(t'),\mathbf{f}(t))}{\mathrm{d} t'} & \frac{\mathrm{d}^2\Sigma_G(\mathbf{f}(t'),\mathbf{f}(t'))}{\mathrm{d}{t'}^2} \end{array}\right)\right]\enspace.\nonumber \end{eqnarray} \subsection{Approximated inference with Expectation Propagation} Due to the non-Gaussianity of the derivative likelihood term, the direct inference on the posterior (\ref{posterior}) is not possible due to its analytically intractable form. For this reason, we employ an approximate inference scheme based on expectation propagation (EP) \cite{rasmussen2006gaussian,minka2001expectation}. Following \cite{riihimaki2010gaussian}, we compute an approximated posterior distribution $q\left(\mathbf{f},\mathbf{\dot{f}},\boldsymbol{\nu}^j|\mathbf{y}^j,\mathbf{m}\right)$ by replacing the derivative likelihood terms with local un-normalized Gaussian approximations: \begin{align} q\left(\mathbf{f},\mathbf{\dot{f}},\boldsymbol{\nu}^j|\mathbf{y}^j,\mathbf{m}\right) &=\frac{1}{Z_{EP}} p(\mathbf{f},\mathbf{\dot{f}}|t,t')p(\boldsymbol{\nu}|t)p(\mathbf{y}|\mathbf{f},\boldsymbol{\nu})\prod_k\prod_l \tilde{Z}_{kl}\mathcal{N}(\dot{f}_{b_k}(t_l')|\tilde{\mu}_{kl},\tilde{\sigma}^2_{kl}), \end{align} where $\prod_k\prod_l \tilde{Z}_{kl}\mathcal{N}(\dot{f}_{b_k}(t_l')|\tilde{\mu}_{kl},\tilde{\sigma}^2_{kl}) = \mathcal{N}(\boldsymbol{\tilde{\mu}},\tilde{\Sigma})\prod_{k,l}\tilde{Z}_{kl}$, with $\boldsymbol{\tilde{\mu}} = [\tilde{\mu}_{kl}]$, and $\tilde{\Sigma}$ is a diagonal matrix with elements $\tilde{\sigma}^2_{kl}$. It follows that the marginal posterior has a Gaussian form, $q\left(\mathbf{f},\mathbf{\dot{f}},\boldsymbol{\nu}^j|\mathbf{y}^j,\mathbf{m}\right)\sim\mathcal{N}(\boldsymbol{\mu},\Sigma)$, with $\boldsymbol{\mu} = \Sigma\tilde{\Sigma}^{-1}\boldsymbol{\tilde{\mu}}_{joint}$ , and $\Sigma = (\Sigma_{joint}^{-1} + \tilde{\Sigma}_{joint}^{-1})^{-1}$, where \begin{eqnarray} \boldsymbol{\tilde{\mu}}_{joint} = \begin{pmatrix}\mathbf{y}\\ \boldsymbol{\tilde{\mu}} \end{pmatrix} &\mbox{, and } & \tilde{\Sigma}_{joint} = \left(\begin{array}{cc} \Sigma_{\epsilon} + \Sigma_{S} & 0\\ 0 & \tilde{\Sigma} \end{array}\right)\enspace. \end{eqnarray} \subsubsection{Estimating the EP parameters.} The EP update of the local Gaussian approximation parameters is classically done by iterative moment matching with respect to the product between the cavity distributions $q_{-k'l'}\left(\dot{f}_{b_{k'}}(t'_{l'})\right)$ and the target likelihood term $\Phi\left(\frac{1}{\lambda}\dot{f}_{b_{k'}}(t'_{l'})\right)$. In the GP case the cavity distribution has a straightforward Gaussian form: \begin{eqnarray} q_{-k'l'}\left(\dot{f}_{b_{k'}}(t'_{l'})\right) &=& \int \prod_{k\neq k'}\prod_{l\neq l'} \tilde{Z}_{kl}\mathcal{N}(\dot{f}_{b_k}(t_l')|\tilde{\mu}_{kl},\tilde{\sigma}^2_{kl}) d\dot{f}_{b_k}(t_l')\nonumber\\ &\sim&\mathcal{N}(\dot{f}_{b_{k'}}(t_{l'}')|\mu_{-k'l'},\sigma_{-k'l'}).\label{cavity} \end{eqnarray} As shown in \cite{riihimaki2010gaussian} for univariate monotonic regression, moments and updates of the approximation parameters can be computed in an analogous manner as in the classical GP classification problem \cite{rasmussen2006gaussian}. \subsection{Marginal Likelihood and hyper-parameter estimation} The model's log-marginal likelihood under the EP approximation is: \begin{eqnarray}\label{final_posterior} \log\mathcal{L} &=& -\frac{1}{2}\log|\Sigma_{joint} + \tilde{\Sigma}_{joint}| - \frac{1}{2}\boldsymbol{\tilde{\mu}}_{joint}^T(\Sigma_{joint} + \tilde{\Sigma}_{joint})^{-1}\boldsymbol{\tilde{\mu}}_{joint} +\nonumber\\ &&\sum_{k}\sum_{l}\frac{(\mu_{-kl}-\tilde{\mu}_{kl})^2}{2(\sigma_{-kl}^2)+\tilde{\sigma}_{kl}^2)} + \sum_k\sum_l \log\Phi(\frac{\mu_{-kl}}{\sqrt{\lambda_{k}^2+\sigma_{-kl}^2)}})+\nonumber\\ &&\frac{1}{2}\sum_k\sum_l\log(\sigma_{-kl}^2+\tilde{\sigma}_{kl}^2). \end{eqnarray} In what follows, the optimal parameters are obtained by maximising $\log\mathcal{L}$ through conjugate gradient descent, via alternate optimization between the hyper-parameters $\boldsymbol{\theta}_G$ and $\boldsymbol{\theta}_G^j$, and the individuals' time-shifts $d^j$. The position of the derivative points was updated at each iteration, according to the changes of the GP domain. Regularisation was also enforced by introducing Gaussian priors for the parameters $\boldsymbol{\theta}_G$ and $\boldsymbol{\theta}_G^j$. We note that the block structure of the GP covariance allows the computation of the gradients with respect to the biomarkers' and individual parameters by working on matrices of much smaller dimension than the one of the whole GP, thus considerably improving the numerical stability and the computational efficiency of the optimization procedure. \subsection{Prediction of observations and individual staging} Gaussian processes naturally allow probabilistic predictions given the observed data. At any given time point $t^*$, the posterior biomarker distribution has the Gaussian form $p(\mathbf{f}^*|t^*,\mathbf{y}, t, \mathbf{m}, t') \sim \mathcal{N}(\mathbf{f}^*|\boldsymbol{\mu}^*, \Sigma^*)$ with parameters: \begin{eqnarray} \boldsymbol{\mu^*} &=& \Sigma_G(\mathbf{f}(t^*),\mathbf{f}(t))(\Sigma_{joint} + \tilde{\Sigma}_{joint})^{-1}\boldsymbol{\tilde{\mu}}_{joint}\\ \Sigma^* &=& \Sigma_G(\mathbf{f}(t^*),\mathbf{f}(t^*)) - \Sigma_G(\mathbf{f}(t^*),\mathbf{f}(t))(\Sigma_{joint} + \tilde{\Sigma}_{joint})^{-1}\Sigma_G(\mathbf{f}(t),\mathbf{f}(t^*)). \end{eqnarray} We also derive a probabilistic model for the individual temporal staging given a set of biomarker observations $\mathbf{y}^*$, thanks to the Bayes formula: \begin{eqnarray} p(t^*|\mathbf{y}^*,\mathbf{y}, t, \mathbf{m}, t') = p(\mathbf{y}^*|t^*,\mathbf{y}, t, \mathbf{m}, t')p(t^*)/p(\mathbf{y}^*|\mathbf{y}, t, \mathbf{m}, t'), \end{eqnarray} which we compute by assuming an uniform distribution on $t^*$, and by noting that $p(\mathbf{y}^*|t^*,\mathbf{y}, t, \mathbf{m}, t')~\sim\mathcal{N}(\boldsymbol{\mu}^*,\Sigma^*+\Sigma_{\epsilon})$. In particular, the joint covariance form $\Sigma_G(\mathbf{f}(t^*),\mathbf{f}(t^*))$ can be specified in order to account for incomplete data, and thus generalizes the GP model for predictions in presence of \emph{missing biomarker observations}. \section{Experiments}\label{section:experiments} \subsection{Synthetic multivariate progressions} We benchmarked the model with respect to synthetic multivariate biomarker progressions. We generated random multivariate sigmoid functions for $N_b$ biomarkers, $\mathbf{f}(\tau) = (f_{b_1}(\tau), f_{b_2}(\tau), \ldots, f_{b_{N_b}}(\tau))^{\top}$, with $f_{b_k}(\tau) = 1/(1+\exp(-\alpha_k \tau))$, $\tau\in [0,15]$ and $\alpha_k \sim \mathcal{N}(0,.06) $, and we sampled $N$ individual noisy trajectories at time points $\tau_k^j$: $\mathbf{y}_k^j(\tau_k^j) = f_k(\tau_k^j) + \epsilon$, $\epsilon\sim\mathcal{N}(0,\sigma^2)$. For each individual we used the same initial sampling time point for every biomarker, while the number of samples per biomarker was allowed to independently vary between 1 and 4. The individual time points were subsequently centered by their mean $\mu_k^j$ to obtain shifted time-points $t_k^j = \tau_k^j - \mu_k^j$ defined in the interval $[-2,2]$. The model was applied to estimate biomarker progressions and individual time-shifts with respect to different combinations of trajectory noise $\sigma$, sample size $N$, and number of biomarkers $N_b$. The accuracy of the model in reconstructing the original time series was quantified by Pearson's correlation between the estimated time-shift $d^j$ and the original individual time reference. The experiments were repeated 10 times for each configuration of parameters $\sigma \in \{0.1, 0.2, 0.3, 0.4\}$, $N_b\in\{4, 8\}$, and $N\in\{20,100\}$.\\ \begin{table}[b] \centering \begin{tabular}{c c c c c c || c c c c c } &&\multicolumn{4}{c}{$N = 20$}&\multicolumn{4}{c}{$N = 100$}\\\cline{3-10} &&\multicolumn{4}{|c||}{$\sigma $}&\multicolumn{4}{c|}{$\sigma $} \\ & \multicolumn{1}{c|}{}& 0.1 & 0.2 & 0.3 & 0.4 & 0.1 & 0.2 & 0.3 & \multicolumn{1}{c|}{.4} \\\cline{2-10} \multirow{2}{*}{$N_b$} & \multicolumn{1}{c|}{4\,} &\multicolumn{1}{c|}{ .95 (.03)} &\multicolumn{1}{c|}{ .86 (.08)} &\multicolumn{1}{c|}{ .71 (.17)} &\multicolumn{1}{c||}{ .46 (.29) } & \multicolumn{1}{c|}{ .91 (.04)} & \multicolumn{1}{c|}{.89(.04)} & \multicolumn{1}{c|}{.76 (.17)} & \multicolumn{1}{c|}{.75 (.12)}\\ & \multicolumn{1}{c|}{8\,} &\multicolumn{1}{c|}{ .97 (.01)} & \multicolumn{1}{c|}{.91 (.06) }& \multicolumn{1}{c|}{.86 (.06)} & \multicolumn{1}{c||}{.66 (.3)} & \multicolumn{1}{c|}{.94 (.04)} & \multicolumn{1}{c|}{.94 (.02)} & \multicolumn{1}{c|}{.88 (.06)} & \multicolumn{1}{c|}{.84 (.07)}\\\cline{2-10} \end{tabular}\caption{Mean (sd) $R^2$ correlation coefficient across folds between estimated individual time-shifts and ground truth time reference.}\label{TableSynth} \end{table} {\bf Results.} Table \ref{TableSynth} reports summary correlations between time-shift estimation and the ground truth individual sampling time. The correlation values are generally high, and increase with lower noise levels. Interestingly, the increase in number of modelled biomarkers is associated with a better performance in recovering the underlying disease staging. We also observe that larger sample sizes are associated with higher correlation values, especially with increasing noise levels. We note however an exception for the case $\sigma = 0.1$ where, although the overall performance is still high, the correlation slightly decreases with $N=100$. \subsection{Longitudinal modelling of Alzheimer's disease progression} We collected longitudinal measurements for the ADNI individuals with baseline values of CSF A$\beta$ amyloid lower than the nominal values of 192 pg/ml. This preliminary selection is aimed to validate the model on a clinical population likely to represent the whole disease time-span. The model was trained on a group including normal individuals, mild cognitive impairment subjects converted to AD (MCI conv), and AD patients having at least one measurement for each of the following biomarkers: \emph{volumetric measures} (hippocampal, ventricular, entorhinal, and whole brain volumes), \emph{glucose metabolism} (average normalized FDG uptake in prefrontal cortex, anterior cingulate, precuneus and parietal cortex), \emph{brain amyloidosys} (average normalized AV45 uptake in frontal cortex, anterior cingulate, precuneus and parietal cortex), and \emph{cognitive function} measured by common cognitive questionnaires (ADAS13, RAVLT learning score, FAQ). The testing set was composed by the remaining subjects with at least a missing biomarker, as well as by the subgroup of MCI non converted to AD during the observational time (MCI stable). The volumetric measures were scaled by the individual total intracranial volume, and all the biomarkers measurements were converted into quantile scores (0 to 1 for normal to abnormal values). Table \ref{sociodem} shows baseline clinical and sociodemographic information of the individuals used respectively in training and testing set, while in Table \ref{Nobs} we report the average follow-up time and the ratio of missing data of the pooled sample. \begin{table}[t] \centering \begin{tabular}{ c c c c c c c} Group & N & Age & Sex (\% females) & ADAS13 & Hippo volume ($mm^3$)& AV45 \\ \hline \multicolumn{7}{c}{Training data}\\ \hline NL & 76 & 75.8 (6) & 53 & 9.5 (4.4) & 7358 (762) & 1.24 (0.2)\\ MCI conv& 57 & 72.7 (7) & 42 & 20.3 (6.8) & 6464 (861) & 1.44 (0.2)\\ AD & 21 & 72.7 (10) & 43 & 29.3 (8.7) & 5872 (988) & 1.4 (0.2)\\ \hline \multicolumn{7}{c}{Testing data}\\ \hline NL & 30 & 77.5 (6) & 43 & 11.1 (4.1) & 7137 (800) & 1.03 (0.14)\\ MCI stable& 164 & 73.4 (6.9) & 39 & 15.5 (6.19) & 7028 (1009) & 1.28 (0.2)\\ MCI conv& 71 & 75.4 (6.7) & 40 & 21.3 (5.4) & 5882 (8644) & NA\\ AD & 98 & 74.7 (8) & 40 & 28.6 (8) & 5709 (1105) & 1.59 (0.1)\\ \end{tabular}\caption{Baseline clinical and sociodemographic information for the study cohort. NA: no observations available for the considered group. NL: normal individuals, MCI: mild cognitive impairment, AD: Alzheimer's patients. }\label{sociodem} \end{table} \begin{table}[b] \centering \begin{tabular}{ c c c c c c c c c } Ventr & Hippo & Ent & Whole Brain & ADAS13 & FAQ & RAVLT & AV45 & FDG \\ \hline \multicolumn{9}{c}{Training data}\\ \hline 2.4 (0) & 2.4 (0) & 2.4 (0) & 2.4 (0) &3.2 (0) & 3.2 (0) & 3.2 (0) & 1.3 (0) & 1.9 (0) \\ \hline \multicolumn{9}{c}{Testing data}\\ \hline 1.8 (.1) & 1.8 (.1) & 1.8 (.1) & 1.8 (.1) & 2.4 (0) & 2.5 (0) & 2.4 (0) & 1.3 (65) & 1.6 (31) \\ \end{tabular}\caption{Average follow-up years and percentage of individuals with missing data for each biomarker (in parenthesis).}\label{Nobs} \end{table} The model was applied in order to estimate the temporal biomarker evolution and the disease stage associated with each individual in training and testing set. The plausibility of the model was assessed by i) group-wise comparison of the predicted time-shift, ii) prediction of conversion to AD in the MCI testing group, and iii) correlation with respect to the time to AD diagnosis for the MCI individuals subsequently converted to AD. We finally compared the progression modelled with our approach with respect to the one estimated with the method proposed in \cite{donohue2014}. The method was applied to the training data by using the standard parameters defined in the R package \textsc{grace}\footnote{https://mdonohue.bitbucket.io/grace/}.\\ {\bf Results.} The estimated biomarker progression (Figure \ref{figModelAD}) shows a biologically plausible description of the pathological evolution, compatible with previous findings in longitudinal studies in familial AD \cite{bateman2012}. The progression is defined on a time scale spanning roughly 20 years, and is characterized at the initial stages by high-levels of AV45, followed by an increase in ventricles volume and abnormality of FDG uptake. These latter measures are however heterogeneously distributed across clinical groups, and with rather large variability. The evolution is further characterized by increasing abnormality of the volumetric measures, and finally by the steady worsening of neuropsychological scores such as FAQ. \begin{figure}[t] \centering \includegraphics[width=12cm]{biomarkers.png} \caption{Modelled biomarker progression in A$\beta$ amyloid positive individuals (solid/dashed lines: mean $\pm$ sd). NL: normal individuals, MCI: mild cognitive impairment converted to AD, AD: Alzheimer's patients.} \label{figModelAD} \end{figure} Figure \ref{figPrediction} shows the posterior predicted distribution of the individual time shift. Healthy individuals are associated with the early stages of the pathology in both training and testing data, while MCI and AD patients are characterized by respectively intermediate and late predicted progression stages. The group-wise comparison between the expected time-shifts is statistically significant between each group pairs ($p$ $<$1e-$4$). Furthermore, the temporal positioning of the non converting MCI lies between controls and MCI converters: when using the temporal cut-off based on the $10^{th}$ quantile of the time-shift distribution in the training AD population ($t=3.6$ years) we obtained an accuracy of $0.84$ for the discrimination between MCI converters and stable in the testing data. We also measured a negative correlation with respect to the time to AD diagnosis in training, testing, and pooled MCI converter groups, with $R^2$ respectively equal to $-0.20\, (p=0.1)$, $-0.28\, (p=0.01)$, and $-0.28\, (p=0.001)$. Finally, when applying \cite{donohue2014} to the training data we measured a strong correlation between the resulting individual time-shifts and those obtained with our method ($R^2$ = $0.89$, $p$ $<$1e-$16$). Nevertheless, our estimates provided \emph{consistently larger effect sizes} for the group-wise separation: (1.96,1.36,0.57) with our methods and (1.74, 1.18, 0.47) with \textsc{grace} for AD vs NL, MCI vs NL, and AD vs MCI, respectively. \begin{figure}[t] \centering \includegraphics[width=12cm]{predictions.png} \caption{Posterior prediction for the individual time shift in training (top) and testing (bottom) data. Healthy individuals are generally displaced at the early stages of the pathology, while the predictions for MCI and AD patients are associated with respectively intermediate and late progression stages. NL: normal individuals, MCI: mild cognitive impairment, AD: Alzheimer's patients. } \label{figPrediction} \end{figure} \section{Conclusions} We proposed a unified GP-based approach to disease progression modeling from time-series of biomarker measurements enabling novel applications beyond the state-of-art, such as the probabilistic prediction of disease staging in unseen patients. Furthermore, the model naturally accounts for missing data, and provides uncertainty quantification of the biomarker evolutions. The model provided remarkable modeling and predictive performance when tested on a large clinical cohort, and thus represents a promising instrument for the analysis of clinical trials data. Similarly to \cite{donohue2014}, in this work we focused on the modeling of disease staging represented by a time translation. However, the proposed framework can naturally account for more complex time transformations, provided that a sufficient number of time points is available for each individual. Future extensions of this model will focus on the quantification of the effect of each biomarkers in the predictive performance, for example by integrating feature selection based on automatic relevance determination. Moreover the present work can be extended to model differential progressions underlying sub-pathologies, by framing the proposed random effect regression within the realm of Gaussian process mixture models. Finally, thanks to the flexibility of our framework, further extension of the model will enable to integrate within (\ref{FixCovariance}) a spatio-temporal covariance model (such as the efficient Kronecker form of \cite{lorenzi2015}), to provide a unified framework for jointly modelling time series of images and scalar biomarkers data in a coherent fully Bayesian setting. \section{Acknowledgments} EPSRC grants EP/J020990/01 and EP/M020533/1 support DCA and SO's work on this topic. ML, DCA and SO also received support from the European Union's Horizon 2020 research and innovation programme under grant agreement No 666992 (EuroPOND) for this work. MF gratefully acknowledges support from the AXA Research Fund. \bibliographystyle{splncs}
{'timestamp': '2017-01-09T02:06:46', 'yymm': '1701', 'arxiv_id': '1701.01668', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01668'}
arxiv
\section{Introduction}\label{sec:intro} The goal of a moment transformation is to compute statistical moments of random variables transformed through an arbitrary nonlinear function. The moment transforms find their uses in such problems as sensor system design \citep{Zangl2008}, optimal control \citep{Heine2006,Ross2015} and they are also an indispensable part of local nonlinear filters and smoothers \citep{Sandblom2012,Dunik2013,Saerkkae2016,Wu2006,Tronarp2016}. These algorithms estimate a state of dynamical systems based on noisy measurements and are applied in solving a broad array of engineering problems such as aircraft guidance \citep{Smith1962}, GPS navigation \citep{Grewal2007}, weather forecasting \citep{Gillijns2006}, telecommunications \citep{Jiang2003} and finance \citep{Bhar2010} to name a few. Recursive nonlinear filters can be divided into two categories: global and local. Particle filters are typical representatives of the global filters, which are characterized by weaker assumptions and a higher computational demand. On the contrary, the local filters trade off more limiting assumptions for computational simplicity. For tractability reasons, the local filters often leverage the joint Gaussianity assumption of state and measurement. The main problem then lies in computation of transformed means and covariances, which are subsequently combined with a measurement in an update rule to produce the filtering state estimate. Examples of well-known local nonlinear filters include the unscented Kalman filter (UKF) \citep{Julier2000}, the cubature Kalman filter (CKF) \citep{Arasaratnam2009} and the Gauss-Hermite Kalman filter (GHKF) \citep{Wu2006}, which are collectively known as \emph{sigma-point} filters, and which are characterized by their reliance on the classical numerical integration schemes. A limitation of classical integral approximations, such as the Gauss-Hermite quadrature, is that they are specifically designed to achieve zero error on a narrow class of functions (typically polynomials up to a given degree). Since many nonlinearities encountered in practical problems do not fall into this category, the integrals are, more often than not, approximated with errors which go unaccounted for. Even though error estimates for the classical rules exist, their computation is tedious in practice as they require higher order derivatives \citep{Gautschi2004}. In recent years, the Bayesian quadrature (BQ) has been gaining attention as an exciting alternative for approximate evaluation of integrals. According to \citet{Diaconis1988}, the origins of this method lie as far as Poincaré's publication \citep{Poincare1896} from 1896. Later developments came with O'Hagan's work on Bayes-Hermite quadrature \citet{OHagan1991} and the Bayesian Monte Carlo \citep{Rasmussen2003a}. Seeing BQ as an instance of a probabilistic approach to numerical computing spawned an emerging field of probabilistic numerics with its share of contributions \citep{Osborne2012,Briol2015,Oates2015}. Contrary to the classical rules, the BQ minimizes an average error on a wider class of functions \citep{Minka2000,Briol2015}. The numerical integration process is treated as a problem of Bayesian inference, where, in accordance with the Bayesian paradigm, an integral prior is transformed into a posterior by conditioning on obtained evaluations of the integrated function. The result of integration is much more informative, because it is no longer a single value, but an entire distribution. The posterior mean estimates the integral value, whereas the posterior variance can be construed as a model of the integration error. The BQ approach is uniquely suited to the purpose of our article, which is accounting for the integration errors in the moment transform process. Application of the BQ in nonlinear sigma-point filtering was first investigated by \citet{Sarkka2014}, where the authors elucidate connections between the BQ and the classical rules, but their algorithms do not make use of the integral variance. When our GPQ moment transform is applied in the nonlinear sigma-point filtering, it leads to a similar approach to the previously proposed Gaussian process assumed density filter (GP-ADF) \citep{Deisenroth2009} and the Gaussian process unscented Kalman filter (GP-UKF) \citep{Ko2007}. Both GP-ADF and GP-UKF use the GP models for system identification that takes place prior to running the filters. In our case, however, the crucial difference lies in the fact that the resulting GPQ filters do not require a system identification phase. In our previous contribution \citep{Prueher2016}, we showed how to incorporate integral variance into a nonlinear sigma-point filtering algorithm. This article crystallizes the results of the previous publication into a widely applicable general GPQ moment transform. Applications in sigma-point filtering are enriched with a target tracking example and an additional numerical experiments on common nonlinear coordinate transformation are provided. We also further analyse properties of the proposed transform and give a theoretical proof for positive semi-definiteness of the resulting covariance matrix. The rest of this article is organized as follows. \Cref{sec:problem} introduces the general problem of the classical quadrature based moment transforms. \Cref{sec:gpq_transform} outlines the Gaussian process quadrature (GPQ). In \Cref{sec:moment_transform}, we describe the proposed moment transform based on the GPQ. Numerical experiments and performance evaluations are in \Cref{sec:experiments}. Finally, \Cref{sec:conclusion} concludes the article. \section{Problem Statement}\label{sec:problem} Consider an input Gaussian random variable \( \inVar \in \R^\inDim \) with mean \( \inMean \) and covariance \( \inCov \) transformed through a nonlinear vector function \begin{equation}\label{eq:nonlinearity} \outVar = \nlf(\inVar) \qquad \N*[\inVar][\inMean][\inCov] \end{equation} producing an output \( \outVar \in \R^\outDim \). Even though the output is not Gaussian (due to the nonlinearity of \( \nlf \)), we approximate both variables as jointly Gaussian distributed, so that \begin{equation}\label{eq:gaussian_joint_xy} \N*[\bmqty{\inVar \\ \outVar}][\bmqty{\inMean \\ \outMean}][\bmqty{\inCov & \inoutCov \\ \inoutCov\T & \outCov}], \end{equation} where the transformed moments are given by the following Gaussian weighted integrals \begin{align} \outMean = \E[\inVar]{\nlf(\inVar)} &= \integral \nlf(\inVar)\N[\inVar][\inMean][\inCov] \d[\inVar], \label{eq:outMean_integral} \\ \outCov = \Cov[\inVar]{\nlf(\inVar)} &= \integral (\nlf(\inVar) - \outMean)(\nlf(\inVar) - \outMean)\T \N[\inVar][\inMean][\inCov] \d[\inVar], \label{eq:outCov_integral} \\ \inoutCov = \Cov[\inVar]{\inVar, \nlf(\inVar)} &= \integral (\inVar - \inMean)(\nlf(\inVar) - \outMean)\T \N[\inVar][\inMean][\inCov] \d[\inVar], \label{eq:inoutCov_integral} \end{align} where \( \N[\inVar][\inMean][\inCov] \) denotes probability density of Gaussian random variable. The goal of a moment transform is to compute the moments in \crefrange{eq:outMean_integral}{eq:inoutCov_integral} given the moments of the input variable. Since \( \nlf \) is nonlinear, the integrals cannot be solved analytically in general and have to be approximated by a numerical quadrature. An integral w.r.t. a Gaussian with arbitrary mean and covariance can be converted to an integral over a standard Gaussian, such that \begin{equation}\label{eq:gaussian_integral_decoupling} \integral \nlf(\inVar)\N[\inVar][\inMean][\inCov] \d[\inVar] = \integral \nlf(\inMean + \inCovFct\inVarUnt)\N[\inVarUnt][\zeroVec][\eye] \d[\inVarUnt], \end{equation} where we used a change of variables \( \inVar = \inMean + \inCovFct\inVarUnt \) with \( \inCov = \inCovFct\inCovFct\T \). The standard numerical integration rules can now be applied, which leads to a weighted sum approximation \begin{equation}\label{eq:gaussian_integral_quadrature} \integral \nlf(\inMean + \inCovFct\inVarUnt)\N[\inVarUnt][\zeroVec][\eye] \d[\inVarUnt] = \sum\limits_{i=1}^{\trNum} w_i\nlf(\inMean + \inCovFct\inVarUnt_i), \end{equation} where \( w_i \) are the quadrature weights and \( \inVar_i = \inMean + \inCovFct\inVarUnt_i \) are the sigma-points (evaluation points, design points, abscissas), both of which are prescribed by the specific quadrature rule to satisfy certain optimality criteria. The vectors \( \inVarUnt_i \) are called unit sigma-points. For instance, the $r$-th order Gauss-Hermite (GH) rule \citep{Gautschi2004,Ito2000} uses sigma-points, which are determined as the roots of the $r$-th degree univariate Hermite polynomial $H_r(x)$. Integration of vector valued functions ($ \inDim > 1 $) is handled by a multidimensional grid of points formed by the Cartesian product, leading to the exponential growth ($N = r^\inDim$) w.r.t. dimension \( \inDim \). The GH weights are computed according to \citep{Saerkkae2013} as \begin{equation} w_i = \frac{r!}{[rH_{r-1}(x^{(i)})]^2} \enspace . \end{equation} The rule incurs no integration error if the integrand is a (multivariate) polynomial of \emph{pseudo-degree} \( \leq 2r - 1 \). The well-known Unscented transform (UT) \citep{Julier2000} is also a simple quadrature rule, that uses $ \trNum = 2\inDim + 1 $ deterministically chosen sigma-points \( \inVar_i = \inMean + \inCovFct\inVarUnt_i \) with unit sigma-points defined as columns of the matrix \begin{equation} \bmqty{\inVarUnt_0 & \inVarUnt_1 & \ldots & \inVarUnt_{2\inDim}} = \bmqty{\mathbf{0} & c\eye_\inDim & -c\eye_\inDim} \end{equation} where $ \mathbf{I}_\inDim $ denotes $ \inDim\times\inDim $ identity matrix. The corresponding UT weights are defined by \begin{equation} w_0 = \frac{\kappa}{\inDim+\kappa}, \quad w_i = \frac{1}{2(\inDim+\kappa)}, \quad i = 1, \ldots, 2\inDim \end{equation} with scaling factor $ c = \sqrt{\inDim+\kappa} $. The UT rule can integrate (multivariate) polynomials of \emph{total degree} \( \leq 3 \) without incurring approximation error. Spherical-radial (SR) integration rule, which is a basis of the CKF \citep{Arasaratnam2009}, is very similar to the UT, but lacks the centre point. Thus it uses \( \trNum = 2\inDim \) sigma-points given by \begin{equation} \bmqty{\inVarUnt_1 & \ldots & \inVarUnt_{2\inDim}} = \bmqty{c\eye_\inDim & -c\eye_\inDim} \end{equation} with \( c = \sqrt{\inDim} \) and weights \( w_i = 1/2\inDim, \quad i = 1, \ldots, 2\inDim \). The UT and SR rule are all instances of the fully symmetric rules \citep{McNamee1967}. Together with GH all of these are examples of classical numerical quadratures. In the next section, we introduce an alternative view of numerical integration, upon which, we base our proposed moment transform. \section{Gaussian Process Quadrature}\label{sec:gpq_transform} The main difference between the classical quadrature and the Bayesian quadrature, is that in the Bayesian case the whole numerical procedure is viewed as a probabilistic inference, where, after conditioning on the data, an entire density over the solution is obtained as a result (rather than a single value). That is to say, we start with a prior distribution over the integral which is then transformed into a posterior distribution given our sigma-points and function evaluations. Prior over the integral is induced by putting a prior on the integrated function itself. \subsection{Gaussian Process Regression Model}\label{ssec:gpq_gp_regression} Uncertainty over functions is naturally expressed by a stochastic process. In Bayesian quadrature, Gaussian processes (GP) are used for their favourable analytical properties. Gaussian process is a collection of random variables indexed by elements of an index set, any finite number of which has a joint Gaussian density \citep{Rasmussen2006}. That is, for any finite set of indices \( \mb{x}' = \bmqty{\inVar'_1 & \ldots & \inVar'_m} \), it holds that \begin{equation} \N*[\bmqty{ \nlf*(\inVar'_1) & \ldots & \nlf*(\inVar'_m) }\T][\zeroVec][\kerMat] \end{equation} where the kernel (covariance) matrix \( \kerMat \) is made up of pair-wise evaluations of the kernel (covariance) function. The element of \( \kerMat \) at position \( (i, j) \) is given by \( \bqty{\kerMat}_{ij} \,=\, \kerf(\inVar_i, \inVar_j) = \Cov[\nlf*]{\nlf*(\inVar_i),\, \nlf*(\inVar_j)} \), where \( \mathbb{C} \) is the covariance operator. Choosing a kernel, which in principle can be any symmetric positive definite function of two arguments, introduces modelling assumptions about the underlying function. Since the GP regression is a non-parametric model, it is more expressive than a parametric fixed-order polynomial regression models used in construction of the classical quadrature rules. In Bayesian terms, choosing a kernel specifies a GP prior \( p(\nlf*) \) over functions. Updating the prior with the data \( \D \,=\, \left\lbrace \pqty{\mathbf{x}_i,\ \nlf*(\mathbf{x}_i)} \right\rbrace_{i=1}^\trNum \), which consist of the sigma-points \( \mb{x} \,=\, \bmqty{\inVar_1 & \ldots & \inVar_\trNum} \) and the function evaluations \( \gpObs \,=\, \bmqty{\nlf*(\inVar_1) & \ldots & \nlf*(\inVar_\trNum)}\T \), leads to a GP posterior \( p(\nlf* \mid \D) \) with predictive mean and variance given by \begin{align} \E[\nlf*]{\nlf*(\inVar) \mid \D} &= m_g(\inVar) = \vb{\kerf}\T(\inVar)\kerMat\I\gpObs, \label{eq:gpr_mean} \\ \V[\nlf*]{\nlf*(\inVar) \mid \D} &= \sigma^2_{\nlf*}(\inVar) = \kerf(\inVar, \inVar) - \vb{\kerf}\T(\inVar)\kerMat\I\vb{\kerf}(\inVar), \label{eq:gpr_variance} \end{align} where the \( i \)-th element of \( \vb{\kerf}(\inVar) \) is \( \bqty{\vb{\kerf}(\inVar)}_i = \kerf(\inVar, \inVar_i) \) and \( \mathbb{V} \) denotes the variance operator. These simple equations follow from the formula for conditional Gaussian densities \citep{Rasmussen2006}. \Cref{fig:gp_regression} depicts predictive moments of the GP posterior. Notice, that in places where the function evaluations are lacking, the GP model is more uncertain. \begin{figure}[h] \centering \input{./img/gp_posterior.pgf} \caption[]{True function (dashed), GP posterior mean (solid), observed function values (dots) and GP posterior samples (grey). The shaded area represents GP posterior predictive uncertainty ($ \pm 2\, \sigma_{\nlf*}(\inVar) $), which is collapsed near the observations.} \label{fig:gp_regression} \end{figure} At first, introducing randomness\footnote{Here we mean \emph{epistemic uncertainty}, which is due to the lack of knowledge not due to inherent randomness.} over a \emph{known}\footnote{In a sense, that it can be evaluated for any argument.} integrand may seem quite counter-intuitive. However, consider the fact that the quadrature rule of the form \labelcref{eq:gaussian_integral_quadrature} only sees the integrand through a limited number of function values, which effectively means, that the rule is unaware of the function behaviour in areas where no evaluations are available. The GP regression model then serves as an instrument allowing us to acknowledge this reality. \subsection{Integral Moments} Using a GP for modelling the integrand has a great analytical advantages. Note that, since we use a GP, the posterior density over the integral is Gaussian, which is due to the fact that an integral is a linear operator acting on a Gaussian distributed function.\footnote{This is a generalization of the invariance property of Gaussians under affine transformations.} The posterior mean and variance of the integral \( \E[\inVar]{\nlf*(\inVar)} = \integral \nlf*(\inVar)p(\inVar) \d[\inVar] \) are \citep{Rasmussen2003a} \begin{align} \E[\nlf*]{\E[\inVar]{\nlf*(\inVar)} \mid \D} &= \E[\inVar]{\E[\nlf*]{\nlf*(\inVar) \mid \D}} = \E[\inVar]\big{\vb{\kerf}\T(\inVar)}\kerMat\I\gpObs, \label{eq:integral_mean} \\ \V[\nlf*]{\E[\inVar]{\nlf*(\inVar)} \mid \D} &= \E[\inVar,\inVar']{\Cov[\nlf*]{\nlf*(\inVar), \nlf*(\inVar')\mid \D}} \nonumber \\ &= \E[\inVar,\inVar']{\kerf(\inVar, \inVar')} - \E[\inVar]\big{\vb{\kerf}\T(\inVar)}\kerMat\I\E[\inVar']{\vb{\kerf}(\inVar')}. \label{eq:integral_variance} \end{align} From \cref{eq:integral_mean}, we can see that the mean of the integral is identical to integrating the GP posterior mean, which effectively serves as an approximation of the integrated function. The posterior variance of the integral, given by \cref{eq:integral_variance}, can be construed as a model of the integration error. The \Cref{fig:bayesian_quadrature} depicts the schematic view of the GP quadrature, where integral is applied to a GP distributed integrand yielding a Gaussian density over the value of the integral. Alternatively, one could imagine integrating each realization of the GP posterior separately, yielding a different result every time. \begin{figure}[!h] \centering \input{img/gp_quadrature.pgf} \caption{Gaussian process quadrature. GP distributed function is mapped through a linear operator to yield a Gaussian density over its solution. The GP posterior mean approximation (solid black) of the true function (dashed) and the GP predictive variance (gray band) are based on the function evaluations (dots). } \label{fig:bayesian_quadrature} \end{figure} In light of this view, we could think of the classical quadratures as returning a Dirac distribution over the solution, where all the probability mass is concentrated at one value. In this regard, Bayesian quadrature rule is more realistic, because it is able to acknowledge uncertainty in the integrand due to the minimal number of available evaluations. Also worth noting, is that the classical quadrature rules define precise locations of sigma-points, whereas the BQ does not prescribe any point sets, which raises questions about their placement. In \citep{OHagan1991,Minka2000}, the optimal point set is determined by minimizing the posterior integral variance \eqref{eq:integral_variance}. Another approach developed in \citep{Osborne2012a} uses a sequential active sampling scheme. Applications of GPQ in this article rely on point sets of the classical rules. \section{GPQ Moment Transformation}\label{sec:moment_transform} In this section, we propose the moment transform based on the GPQ and show how it implicitly utilizes posterior integral variance in the moment transformation process. First, we define a general GPQ moment transform, which is applicable for any kernel function, and then give relations for a concrete transform based on the popular RBF (Gaussian) kernel. We begin by employing a GPQ for approximate evaluation of the moment integrals in \crefrange{eq:outMean_integral}{eq:inoutCov_integral}. For a moment, consider a case when the nonlinearity in \cref{eq:nonlinearity} is a scalar function \( \nlf*(\inVar):\ \R^\inDim\to\R \). Since the source of uncertainty is now, not only in the input \( \inVar \), but the nonlinearity \( \nlf* \) as well, the transformed moments also need to reflect this fact. The GPQ transform then approximates the moments as follows \begin{align}\label{eq:gpq_mt_approximation} \E{\outVar*} = \E[\inVar]{\nlf*(\inVar)} &\approx \E[\nlf*, \inVar]{\nlf*(\inVar)} \\ \V{\outVar*} = \V[\inVar]{\nlf*(\inVar)} &\approx \V[\nlf*, \inVar]{\nlf*(\inVar)} \\ \Cov{\inVar, \outVar*} = \Cov[\inVar]{\inVar, \nlf*(\inVar)} &\approx \Cov[\nlf*, \inVar]{\inVar, \nlf*(\inVar)} \end{align} where, using the law of total expectation and variance, we can further write \begin{align} \E[\nlf*, \inVar]{\nlf*(\inVar)} &= \E[\nlf*]{\E[\inVar]{\nlf*(\inVar)}} = \E[\inVar]{\E[\nlf*]{\nlf*(\inVar)}}, \label{eq:gpq_mt_mean}\\ \V[\nlf*, \inVar]{\nlf*(\inVar)} &= \E[\nlf*]{\V[\inVar]{\nlf*(\inVar)}} + \V[\nlf*]{\E[\inVar]{\nlf*(\inVar)}} \label{eq:gpq_mt_variance_0}\\ &= \E[\inVar]{\V[\nlf*]{\nlf*(\inVar)}} + \V[\inVar]{\E[\nlf*]{\nlf*(\inVar)}}, \label{eq:gpq_mt_variance_1}\\ \Cov[\nlf*, \inVar]{\inVar, \nlf*(\inVar)} &= \E[\inVar]{\inVar\E[\nlf*]{\nlf*(\inVar)}} - \E[\inVar]{\inVar}\E[\nlf*, \inVar]{\nlf*(\inVar)}. \label{eq:gpq_mt_crosscovariance} \end{align} The \cref{eq:gpq_mt_mean} shows that the mean of the integral is equivalent to integrating the GP mean function. Since the variance decompositions in \crefrange{eq:gpq_mt_variance_0}{eq:gpq_mt_variance_1} are equivalent, both can be used to achieve the same goal. The form \labelcref{eq:gpq_mt_variance_1} was utilized in derivation of the GP-ADF \citep{Deisenroth2012}, which relies on the solution to the problem of prediction with GPs at uncertain inputs \citep{Girard2003}. So, even though these results were derived to solve a seemingly different problem, we point out, that by using the form \labelcref{eq:gpq_mt_variance_1}, the uncertainty of the mean integral (as seen in the last term of \cref{eq:gpq_mt_variance_0}) is implicitly reflected in the resulting covariance. Furthermore, the form \labelcref{eq:gpq_mt_variance_1} is preferable, because it is more amenable to analytical expression and implementation. Note, that for the deterministic case, when the \emph{integrand} variance \( \V[\nlf*]{\nlf*(\inVar)} = 0 \) and the \emph{integral} variance \( \V[\nlf*]{\E[\inVar]{\nlf*(\inVar)}} = 0 \), the \crefrange{eq:gpq_mt_mean}{eq:gpq_mt_crosscovariance} fall back to the classical expressions given by \crefrange{eq:outMean_integral}{eq:inoutCov_integral}. Compared to the deterministic case the transformed GPQ variance is inflated by the uncertainty in \( \nlf* \). \subsection{Derivations of the transformed moments} So far we have stated the results only for the case of scalar function. In the following summary, general vector functions \( \nlf(\inVar): \R^\inDim\to\R^\outDim \) are modelled by a single GP. That is, one GP models every output dimension using the same values of kernel parameters. Note, that in the following derivations we omit the conditioning on data in the GP predictive moments and use the shorthand \( \E[\nlf]{\nlf(\inVar)} \triangleq \E[\nlf]{\nlf(\inVar) \mid \D},\ \Cov[\nlf]{\nlf(\inVar)} \triangleq \Cov[\nlf]{\nlf(\inVar) \mid \D} \). Expressions for GPQ transformed moments are derived by plugging in the GP predictive moments from \crefrange{eq:gpr_mean}{eq:gpr_variance} into the general expressions in \crefrange{eq:gpq_mt_mean}{eq:gpq_mt_crosscovariance}. The transformed mean in \cref{eq:gpq_mt_mean} thus becomes \begin{equation}\label{eq:gpq_mt_mean_derivation} \outMeanApp = \E[\inVar]{\E[\nlf]{\nlf(\inVar)}} = \mb{y}\T\kerMat\I\E[\inVar]\big{\vb{\kerf}(\inVar)} = \mb{y}\T\wm. \end{equation} The transformed covariance in \cref{eq:gpq_mt_variance_1} can be decomposed \begin{align}\label{eq:gpq_mt_covariance_derivation_0} \outCovApp = \Cov[\nlf, \inVar]{\nlf(\inVar)} &= \Cov[\inVar]{\E[\nlf]{\nlf(\inVar)}} + \E[\inVar]{\Cov[\nlf]{\nlf(\inVar)}} \\ &= \E[\inVar]\big{\E[\nlf]{\nlf(\inVar)}\E[\nlf]{\nlf(\inVar)}\T} - \outMeanApp\outMeanApp\T + \E[\inVar]{\Cov[\nlf]{\nlf(\inVar)}} \\ &= \mb{y}\T\kerMat\I\E[\inVar]\big{\vb{\kerf}(\inVar)\vb{\kerf}\T(\inVar)}\kerMat\I\mb{y} - \outMeanApp\outMeanApp\T + \gpExpVar\eye, \end{align} where \( \gpExpVar = \E[\inVar]\big{\sigma^2_{\nlf*}(\inVar)} = \E[\inVar]{\kerf(\inVar, \inVar)} - \trace\pqty\big{\E[\inVar]\big{\vb{\kerf}(\inVar)\vb{\kerf}\T(\inVar)}\kerMat\I} \). The diagonal matrix in the last term reflects the fact that the outputs of \( \nlf \) are not correlated (modelled independently). Finally, the cross-covariance becomes \begin{align}\label{eq:gpq_mt_crosscovariance_derivation} \inoutCovApp = \Cov[\nlf, \inVar]{\inVar, \nlf(\inVar)} &= \E[\inVar]\big{\inVar\E[\nlf]{\nlf(\inVar)}\T} - \E[\inVar]{\inVar}\E[\inVar]{\E[\nlf]{\nlf(\inVar)}} \\ &= \E[\inVar]\big{\inVar\vb{\kerf}\T(\inVar)}\kerMat\I\mb{y} - \inMean\outMeanApp\T \end{align} Summary of the proposed GPQ moment transform is given below. \ \\ \ \\\textbf{General GPQ moment transform}\\ The general GPQ based Gaussian approximation to the joint distribution of $ \inVar $ and a transformed random variable $ \outVar = \nlf(\inVar) $, where $ \N*[\inVar][\inMean][\inCov] $, is given by \begin{equation} \N*[\bmqty{\inVar \\ \outVar}][\bmqty{\inMean \\ \outMeanApp}][\bmqty{\inCov & \inoutCovApp \\ \inoutCovApp\T & \outCovApp}] \end{equation} where the transformed moments are computed as \begin{align} \outMeanApp &= \mb{y}\T\wm, \label{eq:gpq_mean_out} \\ \outCovApp &= \mb{y}\T\wc\mb{y} - \outMean\outMean\T + \gpExpVar\eye, \label{eq:gpq_cov_out} \\ \inoutCovApp &= \wcc\mb{y} - \inMean\outMean\T, \label{eq:gpq_covio_out} \\ \gpExpVar &= \bar{k} - \trace\pqty\big{\kerCov\kerMat\I}, \label{eq:gpq_expected_gp_variance} \end{align} and where $ \bqty\big{\mb{y}}_{*e} = \bmqty{y^e_1 & \ldots & y^e_\trNum}\T $ are the function values of the $ e $-th output dimension of $ \nlf(\inVar) $. The kernel matrix $ \kerMat $ is defined in \cref{ssec:gpq_gp_regression} and the GPQ weights are \begin{equation}\label{eq:gpq_weights} \wm = \kerMat\I\kerMean,\ \wc = \kerMat\I\kerCov\kerMat\I \ \textnormal{and}\ \wcc = \kerCCov\kerMat\I, \end{equation} where \begin{align} \bqty{\kerMean}_{i} &= \E[\inVar]{\kerf\pqty{\inVar, \inVar_i}}, \label{eq:gpq_kernel_mean} \\ \bqty{\kerCov}_{ij} &= \E[\inVar]{\kerf\pqty{\inVar, \inVar_i}\kerf\pqty{\inVar, \inVar_j}}, \label{eq:gpq_kernel_covariance} \\ \bqty{\kerCCov}_{*j} &= \E[\inVar]{\inVar\kerf\pqty{\inVar, \inVar_j}}, \label{eq:gpq_kernel_crosscovariance} \\ \bar{k} &= \E[\inVar]{\kerf\pqty{\inVar, \inVar}}. \end{align} The sigma-points \( \inVar_i \) can be chosen \emph{arbitrarily}. \subsection{Properties of the general GPQ transform} An important requirement of moment transforms is that they produce valid covariance matrices. \Cref{thm:gpq_psd} given below states that the proposed GPQ transform always produces positive semi-definite covariance matrix. For proof we use the following lemma. \begin{lem}\label{lem:horn} For any \( m\times n \) matrix \( \mb{X} \) and positive definite \( n\times n \) matrix \( \mb{A} \), the matrix \( \mb{XAX}\T \) is positive semi-definite. \end{lem} \begin{proof} See \citep[Observation 7.1.6, p. 399]{Horn1990}. \end{proof} In the following, let \( \mb{a} \succeq 0\ \Leftrightarrow\ \vb{x}\T\mb{a}\vb{x} \geq 0,\ \forall \vb{x}\in\R^n \) for any \( n\times n \) matrix \( \mb{a} \). \begin{thm}[]\label{thm:gpq_psd} The GPQ transformed covariance is positive semi-definite. \end{thm} \begin{proof} Using the expressions for the GPQ weights from \cref{eq:gpq_weights}, we can write \[ \outCov = \mb{y}\T\kerMat\I\pqty\big{\kerCov - \kerMean\kerMean\T}\kerMat\I\mb{y} + \gpExpVar\eye = \mb{z}\T\widetilde{\kerCov}\mb{z} + \gpExpVar\eye = \widetilde{\outCov} + \gpExpVar\eye, \] where \( \widetilde{\outCov} = \mb{z}\T\widetilde{\kerCov}\mb{z},\ \mb{z} = \kerMat\I\mb{y} \) and \( \widetilde{\kerCov} = \kerCov - \kerMean\kerMean\T \). We recognize that \( \widetilde{\kerCov} = \Cov{\vb{\kerf}(\inVar)} = \E{\vb{\kerf}(\inVar)\vb{\kerf}\T(\inVar)} - \E{\vb{\kerf}(\inVar)}\E{\vb{\kerf}(\inVar)}\T \). From the property of covariance matrices it follows that \( \widetilde{\kerCov} \succeq 0 \). The \Cref{lem:horn} implies that \( \widetilde{\outCov} = \mb{z}\T\widetilde{\kerCov}\mb{z} \succeq 0 \) for any matrix \( \mb{Z} \). Finally, since \( \gpExpVar \geq 0 \), we have that \( \outCov = \widetilde{\outCov} + \gpExpVar\eye \succeq 0 \). \end{proof} Evidently, the GPQ moment transform hinges upon the kernel expectations given by \crefrange{eq:gpq_kernel_mean}{eq:gpq_kernel_crosscovariance}. Since we are already using one quadrature to approximate moments, it is thus preferable that these expectations be analytically tractable. A list of tractable kernel-density pairs is provided in \citep{Briol2015}. A popular choice in many applications is an RBF (Gaussian) kernel, expectations of which are summarized below. \begin{thm}[GPQ transform with RBF kernel] Assuming a change of variables has taken place in the Gaussian weighted integrals given by \cref{eq:gaussian_integral_decoupling} and the kernel is of the form \begin{equation}\label{eq:kernel_rbf} \kerf\pqty{\inVarUnt, \inVarUnt'} = \rbfScale^2 \exp\pqty\big{-\tfrac{1}{2}\pqty{\inVarUnt - \inVarUnt'}\T\rbfLam\I\pqty{\inVarUnt - \inVarUnt'}}, \end{equation} where \( \rbfScale \) is scaling parameter and \( \rbfLam = \diag{\bmqty{\ell^2_1 & \ldots & \ell^2_\inDim}} \) is lengthscale, then the expectations given by \crefrange{eq:gpq_kernel_mean}{eq:gpq_kernel_crosscovariance} take on the form \begin{align} \bqty{\kerMean}_i &= \alpha^2\vqty{\rbfLam\I + \eye}^{-\tfrac{1}{2}} \exp\pqty\big{-\tfrac{1}{2}\inVarUnt_i\T\pqty{\rbfLam + \eye}\I\inVarUnt_i}, \label{eq:gpq_rbf_mean} \\ \bqty{\kerCov}_{ij} &= \alpha^4\vqty{2\rbfLam\I + \eye}^{-\tfrac{1}{2}} \exp\pqty{ -\tfrac{1}{2}\pqty{\inVarUnt_i\T\rbfLam\I\inVarUnt_i + \inVarUnt_j\rbfLam\I\inVarUnt_j - \vb{z}_{ij}\T\pqty{2\rbfLam\I + \eye}\I\vb{z}_{ij}} },\label{eq:gpq_rbf_covariance} \\ \bqty{\kerCCov}_{*j} &= \alpha^2\vqty{\rbfLam\I + \eye}^{-\tfrac{1}{2}} \exp\pqty\big{-\tfrac{1}{2}\inVarUnt_j\T\pqty{\rbfLam + \eye}\I\inVarUnt_j} \pqty{\rbfLam + \eye}\I\inVarUnt_j, \label{eq:gpq_rbf_crosscovariance} \\ \bar{k} &= \alpha^2 \end{align} where \( \vb{z}_{ij} = \rbfLam\I(\inVarUnt_i + \inVarUnt_j) \). \end{thm} \begin{proof} Expressions can be derived by writing the RBF kernel as a Gaussian and making use of the formulas for the product of two Gaussian densities (and the normalizing constant). For space reasons, we omit the fairly straightforward, but nevertheless lengthy and tedious, derivations. \end{proof} It is now evident that the GPQ transformed moments depend on the kernel parameters which need to be set prior to computing the weights. The form of \( \rbfLam \) in the RBF kernel formulation above exhibits, so called, automatic relevance determination (ARD). That is to say, by optimizing the lengthscales \( \ell_d \) dimensions contributing most to the variability in the data can be discovered, where a small \( \ell_d \) would indicate high relevance of the \( d \)-th dimension. A typical approach in GP regression would be to optimize the kernel parameters by marginal likelihood (evidence) maximization. However, in the BQ setting this method would likely yield unreliable parameter estimates due to the inherently minimal amount of data available. For these reasons, we resorted to a manual choice of the parameter values which were mostly informed by the prior knowledge of the integrated function. In the following theorem, we prove the weight independence on the kernel scaling parameter. \begin{thm}[Kernel scaling independence] Assume a scaled version of a kernel is used, so that \( \bar{\kerf}(\inVar, \inVar') = c\cdot \kerf(\inVar, \inVar') \), then the weights of the GPQ transform given in \cref{eq:gpq_weights} are independent of the scaling parameter \( c \). \end{thm} \begin{proof} Define a scaled kernel matrix \( {\kerMat}' = c\kerMat,\) and scaled kernel expectations \(\ \bqty{{\kerMean}'}_i = c\E[\inVar]{\kerf\pqty{\inVar, \inVar_i}},\ \bqty{{\kerCov}'}_{ij} = c^2\E[\inVar]{\kerf\pqty{\inVar, \inVar_i}\kerf\pqty{\inVar, \inVar_j}},\ \bqty{{\kerCCov}'}_{*j} = c\E[\inVar]{\inVar\kerf\pqty{\inVar, \inVar_j}} \). Plugging into the expressions for the GPQ weights from the \cref{eq:gpq_weights}, we get \begin{align} \wm' &= {\kerMean}'\pqty{\kerMat'}\I = cc\I\kerMean\kerMat\I = \wm, \\ \wc' &= \pqty{\kerMat'}\I{\kerCov'}\pqty{\kerMat'}\I = c^2c^{-2}\kerMat\I\kerCov\kerMat\I = \wc, \\ \wcc' &= {\kerCCov}'\pqty{\kerMat'}\I = cc\I\kerCCov\kerMat\I = \wcc. \end{align} \end{proof} \begin{cor} The kernel scaling affects only the additive term in the transformed covariance, which becomes \( \gpExpVar = c\bqty{\bar{k} - \trace\pqty\big{\kerCov\kerMat\I}}. \) The transformed mean and cross-covariance are unaffected by the scaling. \end{cor} \subsection{Moment transforms in filtering} An important application area for the moment transforms is in local filtering algorithms, which estimate an evolving system state from noisy measurements. Filters are essentially inference algorithms operating on a state-space model which is given by the two discrete-time equations \begin{align} \stVar_{k} &= \dynf(\stVar_{k-1}) + \stNoise_k, \label{eq:ssm_dynamics}\\ \obsVar_{k} &= \obsf(\stVar_k) + \obsNoise_k, \label{eq:ssm_observation_model} \end{align} describing the system dynamics and the state observation (measurement) process respectively. The evolution of the system state \( \stVar_k \) is described by \cref{eq:ssm_dynamics} where \( \dynf: \R^\inDim\to\R^\inDim \) is the dynamics and the \( \N*[\stNoise_k][\vb{0}][\stNoiseCov] \) is the state noise. The measurements \( \obsVar_k \) are produced by mapping the state through the observation model \( \obsf: \R^\inDim\to\R^\outDim \) and adding the measurement noise \( \N*[\obsNoise_k][\vb{0}][\obsNoiseCov] \). Typically, \( \outDim \leq \inDim \). Let \( \obsVar_{1:k} = \Bqty{\obsVar_1, \ldots, \obsVar_k} \) denote a set of measurements up to time step \( k \). From a probabilistic standpoint, the filtering problem is about inferring a posterior distribution \begin{equation}\label{eq:pdf_filtering_posterior} p(\stVar_k \mid \obsVar_{1:k}) \propto p(\stVar_k,\, \obsVar_{k} \mid \obsVar_{1:k-1}) = p(\obsVar_k \mid \stVar_{k})p(\stVar_k \mid \obsVar_{1:k-1}) \end{equation} where the likelihood \( p(\obsVar_k \mid \stVar_{k}) \) is obtained from \cref{eq:ssm_observation_model} and the prior \( p(\stVar_k \mid \obsVar_{1:k-1}) \) is given by the Chapman-Kolmogorov equation \begin{equation}\label{eq:pdf_chapman_kolmogorov} p(\stVar_k \mid \obsVar_{1:k-1}) = \integral p(\stVar_k \mid \stVar_{k-1})p(\stVar_{k-1} \mid \obsVar_{1:k-1}) \d[\stVar_{k-1}] \end{equation} where the transition density \( p(\stVar_k \mid \stVar_{k-1}) \) is obtained from the system dynamics given by \cref{eq:ssm_dynamics}. Local Gaussian filters make the simplifying assumption that the state and measurement are jointly Gaussian distributed, so that \begin{equation}\label{eq:pdf_gassian_assumption} p(\stVar_k,\, \obsVar_{k} \mid \obsVar_{1:k-1}) \approx \N[\bmqty{\stVar_k \\ \obsVar_{k}}][\bmqty{\stMean_{k|k-1} \\ \obsMean_{k|k-1}}][\bmqty{\stCov_{k|k-1} & \stObsCov_{k|k-1} \\ \stObsCov_{k|k-1} & \obsCov_{k|k-1}}], \end{equation} where the index notation \( k|k-1 \) means that the relevant quantity at time \( k \) is computed from \( \obsVar_{1:k-1} \). Advantage of this simplification is that the posterior is now parametrized by the conditional mean and covariance, which are available in closed form. Using an update rule the state and measurement moments of the joint in \cref{eq:pdf_gassian_assumption} \begin{align} \stMean_{k|k} &= \stMean_{k|k-1} + \stObsCov_{k|k-1}(\obsCov_{k|k-1})\I\pqty\big{\obsVar_k - \obsMean_{k|k-1}}, \label{eq:kalman_update_mean} \\ \stCov_{k|k} &= \stCov_{k|k-1} - \stObsCov_{k|k-1}(\obsCov_{k|k-1})\I(\stObsCov_{k|k-1})\T, \label{eq:kalman_update_covariance} \end{align} are combined to arrive at the approximate conditional mean and covariance of the state. To compute state predictive moments \( \stMean_{k|k-1},\ \stCov_{k|k-1} \) a moment transform is applied in a setting where the input moments are \( \stMean_{k-1|k-1},\ \stCov_{k-1|k-1} \) and the nonlinearity is the dynamics \( \dynf(\stVar_{k-1}) \). Similarly, the measurement moments \( \obsMean_{k|k-1},\ \obsCov_{k|k-1},\ \stObsCov_{k|k-1} \) are obtained by applying a moment transform on input moments \( \stMean_{k|k-1},\ \stCov_{k|k-1} \) with nonlinearity \( \obsf(\stVar_k) \). \section{Experiments}\label{sec:experiments} The proposed GPQ moment transform is first tested on a polar-to-Cartesian coordinate transformation while the later experiments focus on applications in nonlinear filtering. In all cases the GPQ transform uses the RBF kernel given by \cref{eq:kernel_rbf}. Since the sigma-point locations are not prescribed and their choice is entirely arbitrary, we used the point sets of the classical rules mentioned in \Cref{sec:problem} for all examples. The acronym GPQKF denotes all nonlinear Kalman filters based on the GPQ regardless of which point set they use. \subsection{Mapping from Polar to Cartesian Coordinates} Conversion from polar to Cartesian coordinates is a ubiquitous nonlinearity appearing in radar sensors or laser range finders and is given by \begin{equation}\label{eq:polar2cartesian} \bmqty{x \\ y} = \bmqty{r\cos(\theta) \\ r\sin(\theta)}. \end{equation} Since the mapping is conditionally linear (for fixed \( \theta \)) and we use a kernel with ARD in the moment transform, we can exploit this fact and set the kernel lengthscales to \( \ell = \bmqty{60 & 6} \) while the scaling was set to \( \alpha = 1 \). Note, that we set the lengthscale corresponding to range to a relatively large value. This is because the larger lengthscales in the kernel correspond to a slower variation in the approximated function. We compared the performance of the spherical radial transform (SR), which is basis of the cubature Kalman filter \citep{Arasaratnam2009}, and the GPQ transform with SR points (GPQ-SR) for 100 different input moments. The 10 different positions on a spiral in polar coordinates were chosen as input means \( \inMean_i = \bmqty{r_i & \theta_i} \). For each mean we assigned 10 different input covariance matrices \( \inCov_j = \diag{\bmqty{\sigma^2_r & \sigma^2_{\theta,j}}} \), where \( \sigma_r = \SI{0.5}{m} \) and \( \sigma_{\theta,j} \in \bqty{\SI{6}{\degree},\, \SI{36}{\degree}} \) for \( j = 1, \ldots, 10 \). \Cref{fig:polar_spiral} depicts the input means in polar coordinates. \begin{figure}[!h] \centering \input{./img/polar2cartesian_spiral.pgf} \caption{Input means are placed on a spiral. For each input mean \( \inMean_i = \bmqty{r_i & \theta_i} \) (black dot) the radius variance is fixed at \( \sigma_r = \SI{0.5}{m} \) and 10 azimuth variances are considered so that \( \sigma_\theta \in \bqty{\SI{6}{\degree},\, \SI{36}{\degree}} \).} \label{fig:polar_spiral} \end{figure} As a measure of an agreement between two Gaussian densities we used the symmetrized KL-divergence given by \begin{align}\label{eq:skl} \mathrm{SKL} &= \frac{1}{2}\Bqty{\mathbb{KL}\pqty{\N[\outVar][\outMean][\outCov] \,\|\, \N[\outVar][\outMeanApp][\outCovApp]} + \mathbb{KL}\pqty{\N[\outVar][\outMeanApp][\outCovApp] \,\|\, \N[\outVar][\outMean][\outCov]}} \\ &= \frac{1}{4}\Bqty{(\outMean - \outMeanApp)\T\outCov\I(\outMean-\outMeanApp) + (\outMeanApp - \outMean)\T\outCovApp\I(\outMeanApp - \outMean) + \trace(\outCov\I\outCovApp) + \trace(\outCovApp\I\outCov) - 2\outDim}, \end{align} where \( E = \dim(\outVar) \). The ground truth transformed mean \( \outMean \) and covariance \( \outCov \) were computed using the Monte Carlo method with \num{10000} samples. Two SKL scores were considered; the average over means and an average over azimuth variances. The \Cref{fig:polar2cartesian_skl} shows the SKL score calculated for each configuration on the spiral. \begin{figure}[h!] \centering \input{./img/polar2cartesian_skl.pgf} \caption{Performance comparison of the spherical radial (SR) and GPQ with SR points (GPQ-SR) moment transforms in terms of averaged symmetrized KL-divergence. Left: average over a range of azimuth variances; Right: average over the range of input means (positions on the spiral).} \label{fig:polar2cartesian_skl} \end{figure} The left pane of \Cref{fig:polar2cartesian_skl} shows results for individual means averaged over the azimuth variances, whereas the right pane displays averaged SKL over the means. In both cases our proposed moment transform outperforms the classical quadrature transform with the same SR point set. \subsection{UNGM} The performance of nonlinear sigma-point filters based on GPQ transform was first tested in \citep{Prueher2016} on a univariate non-stationary growth model (UNGM), where the system dynamics and the observation model are given by \begin{align} x_k &\,=\, \frac{1}{2}x_{k-1} \,+\, \frac{25x_{k-1}}{1+x^2_{k-1}} \,+\, 8\cos(1.2\,k) \,+\, q_{k-1} \, , \\ z_k &\,=\, \frac{1}{20} x^2_{k-1} \,+\, r_k \, , \end{align} with the state noise $q_{k-1} \sim \mathcal{N}(0, 10)$, measurement noise $r_k \!\sim\! \mathcal{N}(0, 1)$ and initial conditions $x_{0|0} \sim \mathcal{N}(0, 5)$. This model is frequently used as a benchmark in nonlinear filtering \citep{Gordon1993,Kitagawa1996}. For this problem, all of the considered GPQKFs used the same kernel scaling $\alpha = 1$. The lengthscale was set to $\ell = 3.0$ for the UT, $\ell = 0.3$ for SR and GH-5, and $\ell = 0.1$ for all higher-order GH sigma-point sets. The GPQKFs that used UT and GH sigma-points of order 5, 7, 10, 15 and 20 were compared with their classical quadrature-based counterparts, namely, the UKF and the GHKF of the same orders. The UKF operated with $\kappa = 0$. We performed $100$ simulations, each for $ K=500 $ time steps. For evaluation of the filter performance, we used the root-mean-square error (RMSE) \begin{equation}\label{eq:rmse} \mathrm{RMSE} = \sqrt{\frac{1}{K}\sum_{k=1}^{K} \pqty{\inVar_k - \vb{m}^\inVar_{k|k}}^2} \end{equation} to measure the overall difference between the state estimate $\vb{m}^\inVar_{k|k}$ and the true state \( \inVar_k \) across all time steps. The negative log-likelihood of the state estimate \( \vb{m}^\inVar_{k|k} \) and covariance \( \inCov^\inVar_k \) \begin{equation}\label{eq:nll} \mathrm{NLL} = -\log p(\inVar_k \mid \vb{z}_{1:k}) = \frac{1}{2}\bqty{ \log \vqty{2\pi\inCov^\inVar_k} + (\inVar_{k} - \vb{m}^\inVar_{k|k})\T (\inCov^\inVar_k)\I (\inVar_{k} - \vb{m}^\inVar_{k|k}) } \end{equation} was used to measure the overall model fit \citep{Gelman2013}. As a metric that takes into account the estimated state covariance, the inclination indicator \citep{Li2006} given by \begin{equation}\label{eq:nci} \nu = \frac{10}{K} \sum_{k=1}^{K} \log_{10}\frac{ \pqty\big{\inVar_k - \vb{m}^\inVar_{k|k}}^\top \pqty\big{\inCov^\inVar_{k|k}}\I \pqty\big{\inVar_k - \vb{m}^\inVar_{k|k}} }{ \pqty\big{\inVar_k - \vb{m}^\inVar_{k|k}}\T \mb{\Sigma}\I_{k} \pqty\big{\inVar_k - \vb{m}^\inVar_{k|k}} } \end{equation} was used, where $ \mb{\Sigma}_{k} $ is the sample mean-square-error matrix. The filter is said to be optimistic if it underestimates the actual error, which is indicated by $\nu~>~0$ and vice versa. A perfectly credible filter would provide $ \nu = 0 $, that is, it would neither overestimate nor underestimate the actual error. \Crefrange{tab:rmse}{tab:nci} show average values of the performance criteria across simulations with bootstrapped estimates of $\pm 2$ standard deviations \citep{Wasserman2007}. \input{./tab/filter_rmse} As evidenced by the results in Table~\ref{tab:rmse}, the Bayesian quadrature achieves superior RMSE performance for all sigma-point sets. In the classical quadrature case the performance improves with increasing number of sigma-points used. \input{./tab/filter_nll} Table \ref{tab:nll} shows that the performance of GPQKF is clearly superior in terms of NLL, which indicates that the estimates produced by the GPQ-based filters are better representations of the unknown true state development. \input{./tab/filter_nci} The self-assessment of the filter performance is more credible in the case of GPQ, as indicated by lower inclination \( \nu \) in the Table~\ref{tab:nci}. This indicates that the GPQ-based filters are more conservative in their covariance estimates - a consequence of including additional uncertainty (integral variance), which the classical quadrature-based filters do not employ. Also note, that the variance of all the evaluated criteria for GPQ-based filters is mostly an order of magnitude lower. To achieve competitive results, the kernel lengthscale $\ell$ had to be manually set for each filter separately. This was done by running the filters with increasing lengthscale, plotting the performance metrics and choosing the value which gave the smallest RMSE and the inclination closest to zero. Figure~\ref{fig:hypers_sensitivity} illustrates the effect of changing lengthscale on the overall performance of the GPQKF with UT sigma-points. \begin{figure} \centering \input{./img/rmse_nci_nll.pgf} \caption{Sensitivity of GPQKF performance (using UT sigma-points) to changes in the lengthscale parameter $\ell$. The choice $ \ell=3 $ minimizes RMSE and yields nearly optimal inclination \( \nu \).} \label{fig:hypers_sensitivity} \end{figure} \subsection{Target Tracking} As a more application oriented example, we considered a target tracking scenario adopted from \citep{Athans1968,Julier2000}. A spherical object falls down from high altitude entering the Earth's atmosphere with high velocity. The nonlinear dynamics is described by the following set of differential equations \begin{align} \dot{p}(t) &= -v(t) + q_1(t), \label{eq:target_dyn_pos} \\ \dot{v}(t) &= -v^2(t)\theta(t) e^{-\gamma p(t)} + q_2(t), \\ \dot{\theta}(t) &= q_3(t), \label{eq:target_dyn_theta} \end{align} where \( \gamma = 0.164 \) is a constant and the system state \( \vb{x} = \bmqty{p & v & \theta} \) consists of position (altitude) \( p \), velocity \( v \) and a constant ballistic parameter \( \theta \). The zero-mean state noise is characterized by \( \E{q_i(t)q_j(s)} = \stNoiseCov\delta(t-s)\delta(i-j) \), where \( \stNoise = \bmqty{q_1 & q_2 & q_3} \). The range measurements are produced at discrete time intervals by a radar positioned at the altitude of \SI{30}{km} and \SI{30}{km} horizontally to the vertical path of the falling object. Thus the observation model is \begin{equation}\label{eq:target_observation_model} y_k = \sqrt{s_x^2 + (s_y - p_k)^2} + r_k, \end{equation} where \( (s_x,\ s_y) \) is the radar position. The measurements were generated with frequency \SI{10}{Hz} and the measurement noise is zero-mean with variance \( \sigma^2_y = \SI{9.2903e-4}{km^2} \). The mean and covariance of the system initial condition were set to \begin{align}\label{eq:init_true} \vb{x}_0 &= \bmqty{\SI{90}{km} & \SI{6}{km.s^{-1}} & 1.5} \\ \mb{P}_0 &= \diag{\bmqty{\SI{0.0929}{km^2} & \SI{1.4865}{km^2.s^{-2}} & 10^{-4}}} \end{align} while the filter used different initial state estimate \begin{align}\label{eq:init_model} \stMean_{0|0} &= \bmqty{\SI{90}{km} & \SI{6}{km.s^{-1}} & 1.7} \\ \stCov_{0|0} &= \diag{\bmqty{\SI{0.0929}{km^2} & \SI{1.4865}{km^2.s^{-2}} & 10}} \end{align} which implies a lighter object than in reality. In the experiments, we focused on the comparison of our GPQKF with the UT points and the UKF, because this filter was previously used in \citep{Julier2000} to demonstrate its superiority over the EKF on the same tracking problem. The parameters of the UKF were set to \( \kappa = 0,\ \alpha =1,\ \beta = 2 \) following the recommended heuristics \citep{Saerkkae2013}. The GPQKF used different kernel parameters for the dynamics, \( \alpha_f = 0.5,\ \ell_f = \bmqty{10 & 10 & 10} \), and the measurement nonlinearity, \( \alpha_h = 0.5,\ \ell_h = \bmqty{15 & 20 & 20} \). All filters operated with a discrete-time model obtained by Euler approximation with step size \( \Delta t = \SI{0.1}{s} \). The discretized model is given by \begin{align} p(k+1) &= p(k) - \Delta t\, v(k) + q_1(k), \label{eq:target_dyn_pos_disc} \\ v(k+1) &= v(k) - \Delta t\, v^2(k)\theta(k)\exp(-\gamma p(k)) + q_2(k), \\ \theta(k+1) &= \theta(k) + q_3(k) \label{eq:target_dyn_theta_disc}. \end{align} We generated 100 truth trajectories by simulating the continuous-time dynamics, given by the \crefrange{eq:target_dyn_pos}{eq:target_dyn_theta}, for 30 time steps by 4th-order Runge-Kutta scheme and computed the average RMSE and inclination indicator \( \nu \) for both tested filters. \Cref{fig:reentry_pos_vel} shows realizations of the altitude and velocity trajectories along with the average trajectory. Note that when the object is passing directly in front of the radar at approximately \( t=10\ \mathrm{s} \) (i.e. altitude 30 km), the system is almost unobservable. \begin{figure}[h!] \centering \input{./img/reentry_pos_vel.pgf} \caption{Altitude and velocity evolution in time. Trajectory realizations (black) and the average trajectory (red). The greatest deceleration occurs in the period from 10 to 20 seconds.} \label{fig:reentry_pos_vel} \end{figure} \Cref{fig:reentry_position_rmse} depicts the RMSE for each time step averaged over trajectory simulations. The RMSE of the GPQKF tends to be better for all state vector components. The biggest difference is evident in the RMSE of the ballistic parameter where GPQKF shows significantly better performance during the period of the greatest deceleration. \begin{figure}[h!] \centering \input{./img/reentry_state_rmse.pgf} \caption{Evolution of the average RMSE in time for the GPQKF with the UT points and the UKF. From top to bottom: position, velocity and ballistic parameter.} \label{fig:reentry_position_rmse} \end{figure} Overall, the UKF shows signs of an unbalanced estimator as evidenced from \Cref{fig:reentry_position_inclination}, where the inclination \( \nu \) rises significantly above zero, indicating excessive optimism. The GPQKF manages to stay mostly balanced (\( \nu \) wobbles around zero) with the exception of velocity, where it tips toward pessimism towards the end of the trajectory. This behaviour is mostly likely caused by the inclusion of additional functional uncertainty in the transformed covariance as shown in \cref{eq:gpq_mt_variance_0,eq:gpq_mt_variance_1}. \begin{figure}[h!] \centering \input{./img/reentry_state_inclination.pgf} \caption{Evolution of the average inclination in time for the GPQKF with the UT points and the UKF. From top to bottom: position, velocity and ballistic parameter.} \label{fig:reentry_position_inclination} \end{figure} \section{Conclusion}\label{sec:conclusion} In this article, we have shown how a Bayesian view of quadrature can be leveraged for the design of general purpose moment transform. Unlike the classical transforms, the proposed GPQ transform accounts for the integration error incurred in computing the mean by inflating the transformed covariance. The underlying model in the proposed transform is a non-parametric GP regression model, which brings a lot of advantages. Namely, the transform is not restricted by polynomial assumptions on the integrand (unlike the classical methods) and it quantifies predictive uncertainty, which eventually translates into integral uncertainty. The proposed moment transform is entirely general, in that the equations hold for any kernel and input density, however, analytically tractable kernel-density pairs are preferable. We showed that the transform may outperform classical transforms on a coordinate conversion and two nonlinear sigma-point filtering examples. In both experiments, the filters based on the GPQ give more realistic estimates of the covariance, hence are better at self-assessing their estimation error. Currently, the biggest challenge is finding optimal values of the kernel parameters. \bibliographystyle{plainnat}
{'timestamp': '2017-01-06T02:05:29', 'yymm': '1701', 'arxiv_id': '1701.01356', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01356'}
arxiv
\section{Introduction} \label{intro} With the surge towards the cloud, our websites, services and data are increasingly being hosted by third-party data centers. These data centers are often contractually obligated to ensure that data is rarely, if ever unavailable. One cause of unavailability is co-occurring component failures, which can result in outages that can affect millions of websites \cite{Verge2013}, and cost millions of dollars in profits \cite{Pletz2013}. An extensive one-year study of availability in Google's cloud storage infrastructure showed that such failures are relatively harmful. Their study emphasizes that ``correlation among node failure dwarfs all other contributions to unavailability in our production environment" \cite{Ford2010}. One of the main reasons for correlation among data center failure events is dependencies among system components. Much effort has been made in the literature to produce quality statistical models of this correlation \cite{Bakkaloglu2002,Ford2010,Nath2006,Weatherspoon2002} But in using such models researchers do not make use of the fact that many of these dependencies can be explicitly modeled, since they are known to the system designers. In contrast, we propose to make use of the failure domain models which are already used in commercially available cloud storage products \cite{Parallels,VMWare} to avoid correlated failure. To achieve high availability, data centers typically store multiple replicas of data to tolerate the potential failure of system components. This gives rise to the \emph{replica placement problem}, an optimization problem which, broadly speaking, involves determining which servers in the system should store copies of a file so as to maximize a given objective (e.g. reliability, communication cost, response time, or access time). While our focus is on replica placements, our approach could also be used to place replicas of other entities that require high-availability, such as virtual machines or mission-critical tasks. \begin{figure}[tb] \centering \subcaptionbox{Scenario I\label{fig:scenarioI}}[0.48\textwidth]{ \begin{tikzpicture}[scale=0.5, transform shape] \tikzstyle{every node}=[minimum size=0.9cm, circle, align=center, font=\LARGE, draw=black] \pgfmathsetmacro{\xoffset}{1.5} \pgfmathsetmacro{\yoffset}{1.5} \node (agg1) at (0, 0 ) {}; \node [on grid, right = 8 of agg1](agg2) {$v$}; \node [on grid, on grid, below left = 2 of agg1] (rack1) {}; \node [on grid, below right = 2 of agg1] (rack2) {}; \node [on grid, below left = 2 of agg2] (rack3) {}; \node [on grid, below right = 2 of agg2] (rack4) {$u$}; \node [on grid, rectangle, below = 2.5 of rack1] (srv1) {}; \node [on grid, rectangle, right = 1.25 of srv1] (srv2) {}; \node [on grid, rectangle, below = 2.5 of rack2] (srv3) {}; \node [on grid, rectangle, right = 1.25 of srv3] (srv4) {}; \node [on grid, rectangle, below = 2.5 of rack3] (srv6) {}; \node [on grid, rectangle, left = 1.25 of srv6] (srv5) {}; \node [on grid, rectangle, below = 2.5 of rack4,fill=black!20] (srv8) {}; \node [on grid, rectangle, left = 1.25 of srv8, fill=black!20] (srv7) {}; \node [on grid, rectangle, right = 1.25 of srv8, fill=black!20] (srv9) {}; \node [on grid, draw=none, right = 6 of agg2] (cap1) {\huge Rows}; \node [on grid, draw=none, below = 1.44 of cap1] (cap2) {\huge Racks}; \node [on grid, draw=none, below = 2.5 of cap2] (cap3) {\huge Servers}; \draw[->] (agg1) -- (rack1); \draw[->] (agg1) -- (rack2); \draw[->] (agg2) -- (rack3); \draw[->] (agg2) -- (rack4); \draw[->] (rack1) -- (srv1); \draw[->] (rack1) -- (srv2); \draw[->] (rack2) -- (srv3); \draw[->] (rack2) -- (srv4); \draw[->] (rack3) -- (srv5); \draw[->] (rack3) -- (srv6); \draw[->] (rack4) -- (srv7); \draw[->] (rack4) -- (srv8); \draw[->] (rack4) -- (srv9); \end{tikzpicture} \vspace{-6.5mm}} \subcaptionbox{Scenario II\label{fig:scenarioII}}[0.48\textwidth]{ \begin{tikzpicture}[scale=0.5, transform shape] \tikzstyle{every node}=[minimum size=0.9cm, circle, align=center, font=\LARGE, draw=black] \pgfmathsetmacro{\xoffset}{1.5} \pgfmathsetmacro{\yoffset}{1.5} \node (agg1) at (0, 0 ) {}; \node [on grid, right = 8 of agg1](agg2) {$v$}; \node [on grid, on grid, below left = 2 of agg1] (rack1) {}; \node [on grid, below right = 2 of agg1] (rack2) {}; \node [on grid, below left = 2 of agg2] (rack3) {}; \node [on grid, below right = 2 of agg2] (rack4) {$u$}; \node [on grid, rectangle, below = 2.5 of rack1] (srv1) {}; \node [on grid, rectangle, right = 1.25 of srv1] (srv2) {}; \node [on grid, rectangle, below = 2.5 of rack2] (srv3) {}; \node [on grid, rectangle, right = 1.25 of srv3,fill=black!20] (srv4) {}; \node [on grid, rectangle, below = 2.5 of rack3,fill=black!20] (srv6) {}; \node [on grid, rectangle, left = 1.25 of srv6] (srv5) {}; \node [on grid, rectangle, below = 2.5 of rack4] (srv8) {}; \node [on grid, rectangle, left = 1.25 of srv8,fill=black!20] (srv7) {}; \node [on grid, rectangle, right = 1.25 of srv8] (srv9) {}; \node [on grid, draw=none, right = 6 of agg2] (cap1) {\huge Rows}; \node [on grid, draw=none, below = 1.44 of cap1] (cap2) {\huge Racks}; \node [on grid, draw=none, below = 2.5 of cap2] (cap3) {\huge Servers}; \draw[->] (agg1) -- (rack1); \draw[->] (agg1) -- (rack2); \draw[->] (agg2) -- (rack3); \draw[->] (agg2) -- (rack4); \draw[->] (rack1) -- (srv1); \draw[->] (rack1) -- (srv2); \draw[->] (rack2) -- (srv3); \draw[->] (rack2) -- (srv4); \draw[->] (rack3) -- (srv5); \draw[->] (rack3) -- (srv6); \draw[->] (rack4) -- (srv7); \draw[->] (rack4) -- (srv8); \draw[->] (rack4) -- (srv9); \end{tikzpicture} } \caption{Two scenarios represented by directed trees. Boxes represent placement candidates. Greyed boxes are candidates in the current placement.} \label{fig:scenarios} \end{figure} In this work, we present a new optimization objective for avoiding correlated failure, and novel algorithms to optimize this objective. See \autoref{fig:scenarios} for an example model, in which three identical replicas of the same block of data are distributed on servers in a data center. As can be seen in \autoref{fig:scenarioI}, a failure in the power supply unit (PSU) on a single rack could result in a situation where every replica of a data block is completely unavailable, whereas in \autoref{fig:scenarioII}, three PSU failures would need to occur in order to achieve the same result. Best practices avoid Scenario I by ensuring that each replica is housed on a separate rack \cite{Weil2006}. However, this simple heuristic can be suboptimal in some cases. For instance, failures that occur higher in the tree can impact the availability of every data replica stored on adjacent racks. In common technical parlance each of the internal nodes represented in \autoref{fig:scenarios} is termed a \emph{failure domain}. Widely used, modern-day storage area networks such as Parallels' Cloud Storage \cite{Parallels}, and VMWare's Virtual SAN \cite{VMWare} allow the user to specify a hierarchical model of failure domains much like that seen in \autoref{fig:scenarios}. In these models, storage devices which can fail together due to a common hardware dependency are grouped together into a hierarchy. Such models have also appeared in the research literature \cite{RehnSonigo2007,Weil2006}. For instance, the designers of CRUSH proposed a distributed algorithm which pseudo-randomly distributes data across failure domains. In CRUSH, the system administrator is allowed to specify replica placement rules which are used to distribute replicas across multiple failure domains \cite{Weil2006}. While CRUSH allows the user to specify rules which may lead to a undesirable placement such as that seen in \autoref{fig:scenarioI}, our work focuses on the alternative approach of finding an \emph{optimal} replica placement. In the process, we develop a novel objective function which provides insight into what ``optimal" means in terms of replica placement. Concurrent with our work, Korupolu and Rajaraman considered several important extensions and variants of the reliable replica placement problem which they term ``failure-aware placement" \cite{Korupolu2016}. Their work explores important variants of replica placement which allows for a user-specified reliability factor at each node. They define an adversarial optimization problem which finds a \emph{fractional} number of replicas placed at each server. Once having optimized a fractional placement, they provide a randomized rounding approach which attains the optimum value of the fractional solution in expectation. However, the problem which they formulate relies heavily on the assignment of reliability factors to nodes. In the case where all nodes have the same reliability factor, the algorithm of Korupolu and Rajaraman assigns each leaf node an equal assignment of replicas, regardless of the structure of the heirarchy. When randomized rounding is performed on such a fractional placement, all discrete placements will be equally likely. In contrast, our formulation distinguishes between discrete placements based upon the structure of the hierarchy. Other work on reliability in storage area networks has focused on objectives such as mean time to data loss \cite{Chen2007,Lian2005}. These exemplify an approach towards correlated failure which we term ``measure-and-conquer". In measure-and-conquer approaches \cite{Bakkaloglu2002,Ford2010,Nath2006,Weatherspoon2002}, a measured degree of correlation is given as a parameter to the model. In contrast, we model explicit causal relations among failure events which we believe give rise to the correlation seen in practice. More recently, Pezoa and Hayat \cite{Pezoa2014} have presented a model in which spatially correlated failures are explicitly modeled. However, their main goal is the accurate statistical modeling of task redistribution and scheduling in the data center, whereas we are focused on algorithms for replica placement with provable guarantees. In the databases community, work on replica placement primarily focused on finding optimal placements in storage area networks with regard to a particular distributed access model or mutual exclusion protocol \cite{Hu2001,Shekhar2001,Zhang2009}. Similarly, work from the networking community tends to address particular allocation policies or quality of service objectives such as load balancing \cite{RehnSonigo2007,Wu2008}, in contrast to the present work on correlated failure. In general, much of the work from these communities focuses on system models and goals which are substantially different from our own. Recently, there has been a surge of interest in computer science concerning cascading failure in networks. While our model is conceptually related to this work, it does not appear to directly follow from any published model \cite{Blume2011,Kim2010,Nie2014,Zhu2014}. Current work in this area is focused on fault-tolerant network design \cite{Blume2011}, modeling cascading failure \cite{Kim2010,Nie2014}, and developing techniques for adversarial analysis \cite{Zhu2014}. To our knowledge, no one has yet considered the problem of replica placement in such models. \begin{comment} \paragraph{Our Contributions:} In this work, we formalize a criterion for optimizing replica placements. Roughly speaking, our criterion places replicas so as to ensure that every hardware failure event wipes out as few replicas as possible. To this end, we present optimization algorithms for two replica placement problems. Our first algorithm runs in $O(\n + \rho \log \rho)$ time, and can be used to place $\rho$ replicas of a single file on the leaves of a tree (representing servers) with $\n$ vertices. This algorithm starts from the root of the tree and recursively assigns replicas to its children. Our second algorithm can be used to simultaneously optimize placing replicas of multiple files. For this problem, we present an $O(\mpRT)$ time dynamic program, where $\m$ denotes the number of files. \paragraph{Roadmap:} The rest of the text is organized as follows. Specifics concerning our model and objective appear in \autoref{model}. We describe our $O(n + \rho \log \rho)$ time algorithm for finding optimal placements of a single file in \autoref{s:single-block}. In \autoref{s:mp-balancing} we define what it means to optimize multiple placements simultaneously, and demonstrate that similar balancing properties hold. We then exploit these balancing properties to describe an $O(\mpRT)$ algorithm for achieving this goal in \autoref{s:mp-algorithm}. We conclude by briefly describing our future work in \autoref{conclude}. \end{comment} \paragraph{Our Contributions:} In this work, we make the following contributions. We first present a novel optimization goal for avoiding correlated failure and formulate two novel replica placement problems which optimize for this goal. Intuitively, in our problems, the optimization goal is to choose a placement in which \emph{correlated} failures disable as ``few'' replicas as possible. We then present two efficient algorithms for attaining our optimization goal in trees. Both algorithms are based on dynamic programming. The first algorithm finds an optimal placement of replicas for a single block of data. It has a running time of $O(\n + \rho \log \rho)$, where $\n$ denotes the number of vertices in the tree and $\rho$ denotes the number of replicas to be placed. Our second algorithm finds an optimal placement of replicas for multiple data blocks. We define the \emph{skew} of the desired placement to be the difference between the largest and smallest replication factor among all files. When the skew is at most a constant, we present a replica placement algorithm which runs in polynomial time. Finally, we establish the NP-hardness of reliable replica placement in bipartite graphs, even when placing $\rho$ replicas of only one block. \paragraph{Roadmap:} The rest of the text is organized as follows. We describe our system model and formally define single- and multi-block replica placement problems in \autoref{model}. We describe our algorithm for finding an optimal placement for a single file in \autoref{s:single-block}. We describe our algorithm for finding an optimal placement for multiple files in \autoref{s:mp-balancing}. Finally, we present an overview of known complexity results in \autoref{s:np-hard} before discussing future work and concluding in \autoref{s:future-work}. \section{Modeling} \label{model} We model dependencies among failure events as a directed, rooted tree in which all edges point away from the root (i.e. an \emph{arborescence}) where nodes represent failure events and a directed edge from node $u$ to node $v$ indicates that the occurrence of failure event $u$ triggers the occurrence of failure event $v$. These nodes correspond either to real-world hardware unsuitable for storage (e.g. a top-of-rack (ToR) switch), or to abstract events which have no associated physical component (e.g. software failure, and maintenance outages). We refer to this tree as the \emph{failure model}. Given such a tree as input, we consider the problem of selecting nodes on which to store data replicas. Roughly, we define a \emph{placement problem} as the problem of selecting a subset of the leaf nodes, hereafter referred to as a \emph{placement}, from the failure model so as to satisfy some safety criterion. In our application, only leaf nodes, which represent storage servers, are candidates to be part of a placement. Let $\graph{\V}{\E}$ be an arborescence with vertices in $\V$ and arcs in $\E$. Let $\F \subseteq \V$ denote the set of internal nodes, and let $\C$ denote the set of leaves. We are interested in finding a \emph{placement} of size $\rho$, which is defined to be a set $\P \subseteq \C$, with $|\P| = \rho$. There are two types of nodes in tree $\graph{\V}{\E}$: internal nodes, which represent failure events, and leaf nodes, which represent storage servers. A directed edge from internal node $e_1$ to internal node $e_2$ indicates that, in the worst-case, the occurrence of failure event $e_1$ triggers the occurrence of failure event $e_2$. A directed edge from internal node $e$ to leaf node $\ell$ indicates that, in the worst-case, the occurrence of event $e$ compromises storage server $\ell$. We consider failure to act transitively as regards the unavailability of replicas. That is, if a failure event occurs, all failure events reachable from it in $(V,A)$ also occur. To quantify the impact of the failure of an event, we define the notions of \textit{failure number} and \textit{failure aggregate}. \begin{definition}[failure number] \label{def-failure} Given a vertex $u \in \V$ and a placement $\P$, the \textit{failure number} of $u$ with respect to $\P$, denoted $\fnum{u}{\P}$ is defined as $$\fnum{u}{\P} \mathrel{\mathop:}= | \{ \ell \in P \mid \ell \text{ is reachable from } u \text{ in } (\V,\E) \}|.$$ In particular, $\fnum{u}{\P}$ is the number of leaves in $\P$ whose correct operation could be compromised by the occurrence of event $u$. \end{definition} As an example, node $u$ in \autoref{fig:scenarios} has failure number $3$ in Scenario I, and failure number $1$ in Scenario II. Note that with this definition, leaf nodes also have a failure number. The failure number captures a conservative criterion for a safe placement. Our goal is to find a placement which does not induce large failure numbers in any event. To collect all of the failure numbers into a single metric, we define the \textit{failure aggregate}, a novel measure that accounts for the failure number of every event in the model. \begin{definition}[failure aggregate] The \emph{failure aggregate} of a placement $\P$ is a vector in $\mathbb{N}^{\rho+1}$, denoted $\ff{\P}$, where \mbox{$\ff{\P} \mathrel{\mathop:}= \langle p_0, p_1, \ldots, p_\rho\rangle$}, and each $p_i$ is defined as $$p_i \mathrel{\mathop:}= \left| \big\{ e \in \F \cup \C \mid \fnum{e}{\P} = \rho - i\big\} \right|.$$ \end{definition} Intuitively, $p_i$ is the number of nodes whose failure allows $\rho - i$ replicas to survive. In \autoref{fig:scenarios}, Scenario I has failure aggregate of $\langle 2, 0, 3, 10 \rangle$ and Scenario II has failure aggregate of $\langle 0, 1, 7, 7 \rangle$ in \autoref{fig:scenarioII}. All of the problems we consider in this work involve optimizing the failure aggregate. When optimizing a vector quantity, we must choose a meaningful way to totally order the vectors. In the context of our problem, we find that ordering the vectors with regard to the \emph{lexicographic order} naturally encodes our intuition behind an ``optimal" placement. \begin{definition}[lexicographic order] The \emph{lexicographic order} $<_L$ between vectors $\vec{x} = \langle x_0, ..., x_d\rangle$ and $\vec{y} = \langle y_0,...,y_d\rangle$ can be defined via the following formula: \[\vec{x} <_L \vec{y} \iff \exists~ j \in [0,\rho] ~:~\big( x_j < y_j ~\wedge ~\forall ~i < j : [x_i = y_i ]\big)\] The above definition extends to a definition for the symbol $\leq_L$ in the usual way. We use terms \emph{lexico-minimum} and \emph{lexico-minmizes} as an efficient short-hand for phrases ``minimum in the lexicographic order" and ``minimizes with respect to the lexicographic order" respectively. \end{definition} To see why using the lexicographic ordering is desirable, consider a placement $\P$ which lexico-minimizes $\ff{\P} = \langle p_0, p_1, ..., p_\rho \rangle$ among all possible placements. Such a placement is guaranteed to minimize $p_0$, i.e. the number of nodes which compromise \emph{all} of the entities in our placement. Further, among all solutions minimizing $p_0$, $\P$ also minimizes $p_{1}$, the number of nodes compromising \emph{all but one} of the entities in $\P$, and so on for $p_{2}, p_{3},\ldots, p_{\rho}$. Clearly, the lexicographic order nicely prioritizes minimizing the entries of the vector in an appealing manner. This gives rise to the following novel optimization problem. \begin{problem}[Optimal Single-block Placement] \label{p:graph-single-placement} Given an arborescence $\graph{\V}{\A}$ with leaves in $\C$, and positive integer $\rho$, with $\rho < |\C|$, find a placement $\P \subset \C$ with size $\rho$, such that $\ff{\P}$ is lexico-minimum. \end{problem} Essentially, \autoref{p:graph-single-placement} concerns placing $\rho$ replicas of a single block of data. Notice that in this problem we enforce that no more than one replica may be placed at any given leaf. This is reasonable, as co-locating two replicas on the same server would defeat the purpose of replication. In \autoref{s:single-block}, we present an $O(\n + \rho \log \rho)$ algorithm for solving \autoref{p:graph-single-placement}. While a worthy goal, a solution to \autoref{p:graph-single-placement} only optimizes the placement of a single set of replicas. In the data center, multiple sets of replicas must co-exist simultaneously. To address this crucial use-case, we also present an algorithm which simultaneously optimizes multiple replica placements at once. To this end, we define a \emph{multi-placement} $\MP$ to be an $\m$-tuple of placements, $\MP \mathrel{\mathop:}= (\P_1, ..., \P_m)$. In the multi-placement context, we refer to placements $P_1, ...,P_m$ as \emph{\block{s}}, and we refer to each block by its position in the tuple (e.g. placement $P_1$ is block 1, ... placement $P_i$ is block $i$, etc.) In the single-block case, it made sense to ensure that no more than one replica may be placed at any leaf node. In the multi-block case, we must allow multiple replicas from different blocks to be collocated at a leaf node. To this end, we include a capacity $c(\ell)$ for each leaf node $\ell$ in our formulation, and ensure no more than $c(\ell)$ replicas are placed on $\ell$. However, each placement remains a subset of the set of leaves, which means no placement in a multi-placement may place more than one replica on any given leaf. The failure aggregate $\ff{\P}$ defined above extends to multi-placements by taking the sum over all placements in the multi-placement. To allow each block to have a distinct number of replicas, we pad the failure aggregates on the \emph{left} with additional zeroes to achieve a vector with the proper length. More specifically, if placement $\P_i$ consists of $\rho_i$ replicas, then each failure aggregate is defined as a vector of length $\max[\rho_1, ...,. \rho_m]$. We refer to this quantity as the \emph{girth} of the multi-placement, and denote it by $\rho$. Using this notation, the definition of the failure aggregate does not require any modification. We can thus define $\g{\MP} \mathrel{\mathop:}= \sum_{i = 1}^m \ff{\P_i}$, where $\ff{\P_i}$ takes on values in $\mathbb{N}^{\rho+1}$, where $\rho$ is understood to be the girth of the multi-placement $\MP$. This leads naturally to the following problem. \begin{problem}[Optimal Multi-block Placement] \label{p:graph-multi-placement} Given an arborescence, $\graph{\V}{\A}$, with leaves in $\C$, where each leaf $\ell \in \C$ has assigned capacity \mbox{$c(\ell) \in \mathbb{Z}^+$}, a positive integer $m$, and $m$ positive integers $\rho_1, \rho_2, \ldots, \rho_m$ for which \mbox{$\sum_{i=1}^m \rho_i \leq \sum_{\ell \in \C} c(\ell),$} find a multi-placement $\MP = (\P_1, ..., \P_m)$, which lexico-minimizes $\g{\MP}$ subject to the constraints that \begin{enumerate}[1)] \item for each $\ell \in \C$, $\MP$ contains no more than $c(\ell)$ copies of $\ell$, and \item $|\P_i| = \rho_i$ for each $i=1, \ldots, m$. \end{enumerate} \end{problem} In the context of an instance of \autoref{p:graph-multi-placement}, we define: \begin{enumerate}[label={\alph*)}] \item the \emph{\totalSize} as the sum of the sizes of all blocks, denoted by $\mpRepFact = \sum_{i=1}^m \rho_i$, \item the \emph{girth} as the maximum size of any block, denoted by $\rho = \max (\rho_1 ,..., \rho_m)$, \item the \emph{skew} as the absolute difference between the largest and smallest replication factors of each block, denoted by $\skewfactor$. For convenience, we assume that $\skewfactor \geq 1$, that is, $\skewfactor = \max ( \max_i \rho_i - \min_i \rho_i, 1 )$. \end{enumerate} Storage area networks used widely in practice make use of multi-placements with bounded skew\footnote{From the VMWare Virtual SAN Administrator's Guide: ``For $n$ failures tolerated, $n+1$ copies of the virtual machine object are created"\cite{VMWare}. In contrast, the Parallels system allows the number of replicas per chunk to vary between a minimum and maximum value \cite{Parallels}. While our current work does not fully address the replication practices of the Parallels system, our algorithm can still be applied. The Parallels system must store a minimum number of replicas, and we can place these replicas optimally using our algorithm. Moreover, the recommended settings in a Parallels cluster use a maximum and minimum replication factor of 2 and 3 respectively (i.e. the recommended skew is at most one).}. In \autoref{s:mp-balancing} we present an exact dynamic programming algorithm which, for any specification $\rho_1,...,\rho_m$ finds an optimal multi-placement of $m$ blocks with skew $\delta$ and girth $\rho$. Our algorithm runs in polynomial-time when $\delta$ is a fixed constant. In any case, $\delta < \rho$, and in practice, both values are small constants \cite{Parallels,VMWare}. Throughout the paper, anytime we minimize or compare vector quantities we are minimizing or comparing them in the lexicographic order. Moreover, we reserve the symbols $\P$, $\ff{\P}$ and $p_i$, to have their meaning as defined in this section. We will also consistently use $\fnum{u}{\P}$ to refer to the failure number of node $u$ in placement $\P$. The symbol $\mpRepFact$ will be consistently used to denote the \totalSize of a multi-placement, whereas $\rho$ will denote the size of a placement in \autoref{s:single-block} and the girth of a multi-placement in \autoref{s:mp-balancing} and beyond. \section{Solving Single-block Replica Placement} \label{s:single-block} In this section, we describe an algorithm for solving \autoref{p:graph-single-placement}. First, we prove that any optimal placement must be balanced. We then exploit this balancing property to develop an $O(\n + \rho \log \rho)$ algorithm for finding an optimal placement of size $\rho$ on the leaves of an arborescence with $\n$ nodes. As an aside, we note that a greedy algorithm also works for this problem. Briefly, the greedy solution forms a partial placement $\P'$, to which new replicas are added one at a time, until $\rho$ replicas have been placed overall. $\P'$ starts out empty, and at each step, the leaf $u$ which lexico-minimizes $\ff{\P' \cup \{u\}}$ is added to $\P'$. That this na\"{i}ve greedy approach works correctly is not immediately obvious. It can be shown via an exchange argument that each partial placement found by the greedy algorithm is a subset of \emph{some} optimal placement. Proving this is straight-forward, yet somewhat tedious (see \autoref{app:greedy-proof}). However, as we show below, the running time of the greedy approach does not compare favorably with our $O(\n + \rho \log \rho)$ algorithm. The greedy approach solves \autoref{p:graph-single-placement} in $O(\n^2\rho)$ time. Each iteration requires checking $O(|\C|)$ leaves for inclusion. For each leaf $\lf$ which is checked, every node on a path from $\lf$ to the root must have its failure number recomputed. Both the length of a leaf-root path and the number of leaves can be bounded by $O(\n)$ in the worst case, yielding $O(\n^2\rho )$ time overall. \subsection{The Balancing Property for Optimal Placements} Our algorithm for optimal replica placements hinges on the fact that any optimal placement must be \emph{balanced}. Intuitively, this means that the number of replicas which are descendants of any internal node $u$ are distributed among the children of $u$ so that no single child accommodates too many replicas. The intuition behind balancing is made precise in \autoref{d:bal}, which follows below. Let $\Csub{u}$ be the set of leaves which are descendants of node $u$. We refer to $|\Csub{u}|$ as the \emph{capacity of node u}. \begin{definition}\label{d:bal} Given a placement $\P$, let node $u$ have children $\children{1}{\nChildren}$. Let $\Csub{\child{i}}$ be the set of leaves which are descendants of child $\child{i}$. Node $u$ is said to be \emph{balanced with respect to placement $P$} if, for all $\child{i}, \child{j} \in \{\children{1}{\nChildren}\}$ $$|\Csub{\child{i}}| > \fnum{\child{i}}{\P} \implies \fnum{\child{j}}{\P} \leq \fnum{\child{i}}{\P} + 1,$$ and the above condition is referred to as the \emph{balancing condition}. Moreover, placement $\P$ is said to be \emph{balanced} if, all nodes $u \in V$ are balanced with respect to $\P$. \end{definition} The balancing condition holds trivially if $|\Csub{\child{i}}| = \fnum{\child{i}}{P}$. We say that children where $|\Csub{\child{i}}| = \fnum{\child{i}}{P}$ are \emph{filled}, and children where $|\Csub{\child{i}}| > \fnum{\child{i}}{P}$ are \emph{unfilled}. As a consequence of the balancing condition the replicas are ``evenly spread" among the unfilled children. Our algorithm exploits the following result to achieve an $O(\n + \rho \log \rho)$ running time for minimizing $\ff{\P}$ in a tree. \begin{theorem}\label{thm-balanced-sufficiency} Any placement $\P$ in which $\ff{\P}$ is lexico-minimum among all placements for a given tree must be balanced. \end{theorem} \begin{proof} Suppose $\P$ is not balanced, yet $\ff{\P}$ is lexico-minimum. We derive a contradiction as follows. Let $u$ be an unbalanced node, then $u$ must have children $\child{i}$ and $\child{j}$ such that $\child{i}$ is unfilled and $\fnum{\child{i}}{\P} + 1 < \fnum{\child{j}}{\P}$. Since $\child{i}$ is unfilled, we must be able to take one of the replicas placed on a leaf of $\child{j}$ and place it on $\child{i}$ instead. Leaves $\lf_i \in \Csub{\child{i}} \setminus P$ and $\lf_j \in \Csub{\child{j}} \cap P$ must exist, because $\child{i}$ is unfilled, and $\Csub{\child{j}} \cap P$ is non-empty. Set $\P^\ast \mathrel{\mathop:}= (\P \setminus \{\lf_j\}) \cup \{\lf_i\}$. We will show $\P^\ast$ is a strictly better placement than $P$. Let $\ff{\P} = \langle p_0, ..., p_\rho \rangle$, and $\ff{\P^\ast} = \langle p_0^\ast, ..., p_\rho^\ast \rangle$. For convenience, let $\fnum{\child{j}}{\P} = a$. To show that $\ff{\P} >_L \ff{\P^\ast}$, we aim to prove that $p_{\rho - a}^\ast < p_{\rho - a}$, and that $p^\ast_k = p_k$ for all $k<\rho - a$. We will concentrate on proving the former, and afterwards show that the latter follows easily. Let $\path{\lf_i}{\child{i}}$ (respectively $\path{\lf_j}{\child{j}}$) be the nodes on the unique path from $\lf_i$ to $\child{i}$ (respectively $\lf_j$ to $\child{j}$). As a result of the swap, note that only the nodes on these paths have their failure numbers modified. Therefore, to prove $p^\ast_{\rho-a} < p_{\rho-a}$, it suffices to consider the failure numbers of the nodes in $\path{\lf_i}{\child{i}} \cup \path{\lf_j}{\child{j}}$. Let $S^-$ (respectively $S^+$) be the set of nodes whose failures change from $a$ (respectively change to $a$), as a result of the swap. Formally, we define: $$S^- \mathrel{\mathop:}= \{ v \in \V \mid \fnum{v}{\P} = a, \fnum{v}{\P^\ast} \neq a \},$$ $$S^+ \mathrel{\mathop:}= \{ v \in \V \mid \fnum{v}{\P} \neq a, \fnum{v}{\P^\ast} = a \}.$$ By definition, $p^\ast_{\rho-a} = p_{\rho-a} - |S^-| + |S^+|.$ We claim that $|S^-| \geq 1$ and $|S^+| = 0$, which suffices to show that $p^\ast_{\rho-a} < p_{\rho-a}$, as required. To show that $|S^-| \geq 1$, note that $\fnum{\child{j}}{\P} = a$ by definition, and after the swap, the failure number of $\child{j}$ decreases. Therefore, $|S^-| \geq 1$. To show that $|S^+| = 0$, we must prove that no node in $\path{\lf_i}{\child{i}} \cup \path{\lf_j}{\child{j}}$ has failure number $a$ after the swap has occurred. We show the stronger result, that all such nodes' failure numbers are strictly less than $a$. Let $v_j$ be a node on the path $\path{\lf_j}{\child{j}}$, and consider the failure number of $v_j$. Notice that for every such $v_j$, we have that $$\fnum{v_j}{\P^\ast} \leq \fnum{\child{j}}{\P^\ast} = a -1 < a,$$ where the first inequality follows since the failure number of any node is less than or equal to that of any of its ancestors, and $\fnum{\child{j}}{\P^\ast} = a -1$, since the number of replicas on $\child{j}$ decreases by 1 as a result of the swap. Therefore, $\fnum{v_j}{\P^\ast} < a$, for any $v_j \in \path{\lf_j}{\child{j}}$. Likewise, let $v_i$ be a node on the path $\path{\lf_i}{\child{i}}$, and consider the failure number of $v_i$. Since the swap added a replica at node $\child{i}$, clearly $\fnum{v_i}{P^\ast} = \fnum{v_i}{\P} + 1$. Recall also that $\fnum{\child{i}}{\P} + 1 < \fnum{\child{j}}{\P}$, therefore, for all $v_i$, we have $$\fnum{v_i}{\P} \leq \fnum{\child{i}}{\P} < \fnum{\child{j}}{\P} - 1 = a -1,$$ which establishes that $\fnum{v_i}{\P} < a-1$. Substituting $\fnum{v_i}{\P^\ast}$ yields that $\fnum{v_i}{\P^\ast} < a$ for any $v_i \in \path{\lf_i}{\child{i}}$. Therefore, no node in $\path{\lf_i}{\child{i}} \cup \path{\lf_j}{\child{j}}$ has failure number $a$, so $|S^+| = 0$, as desired. Moreover, since we showed that $\fnum{v}{\P^\ast} < a$, for any node $v \in \path{\lf_i}{\child{i}} \cup \path{\lf_j}{\child{j}}$, and these are the only nodes whose failure numbers change, we have also proven that $p_k = p_k^\ast$ for all $k \leq \rho - a$, thus completing the proof. \qed \end{proof} \subsection{An $O(n + \rho\log\rho)$ Algorithm for Optimal Placements} To ease our exposition, we first describe an $O(n\rho)$ version of the algorithm. In \autoref{s:rhologrho}, we make modifications to improve the running time to $O(n + \rho \log \rho)$. Our algorithm finds an optimal placement that is balanced. Conceptually, we can think of our algorithm as assigning $\rho$ replicas to the root of the tree, and assigning these replicas to children of the root in some fashion. We then recursively carry out the same procedure on each child, thereby proceeding down the tree, at each step ensuring that the replicas are assigned according to the balancing property. However, as we move down the tree, we observe that for certain nodes, the balancing condition only determines the number of replicas placed up to an additive factor of $\pm 1$. Therefore, on the way back up the tree, we solve a minimization problem to determine how many replicas to place on each node in order to minimize $\ff{\P}$. To concisely communicate the ``total number of replicas assigned to node $u$", we shall refer to the number of replicas assigned to a node of the tree as its \emph{mass}. More specifically, we proceed as follows. Before the recursive procedure begins, we first record the capacity of each node $u$ via a post-order traversal of the tree. Our algorithm is then executed in two consecutive phases. During the \emph{divide} phase, the algorithm is tasked with dividing the mass assigned to node $u$ among the children of $u$. First, for each child $\child{i}$, we determine $\minRepOn{\child{i}}$, the minimum possible mass on $\child{i}$ in any balanced placement. After the divide phase, we have determined which children $c$ are \emph{definitely-filled\xspace}, $(\minRepOn{\child{i}} = |\Csub{\child{i}}|)$ and which are \emph{possibly-unfilled\xspace}, $(\minRepOn{\child{i}} < |\Csub{\child{i}}|)$. Definitely-filled\xspace children have a mass equal to their capacity, and require no further optimization. To achieve balancing, each possibly-unfilled\xspace child labeled $\child{i}$ must have a mass of either $\minRepOn{\child{i}}$ or $\minRepOn{\child{i}} + 1$. The algorithm is then recursively called on each possibly-unfilled\xspace child to obtain optimal subproblems of mass $\minRepOn{\child{i}}$ and $\minRepOn{\child{i}} + 1$ for their subtrees. After this recursive call is complete, two optimal solutions are available at each possibly-unfilled\xspace child. The \emph{combine} phase then chooses which of the two placements should be used at each possibly-unfilled\xspace child so as to obtain a minimum overall, thereby determining the final mass for each such child. \subsubsection{Divide Phase} When node $u$ is first considered by the divide phase, there are at most two possible values for its final mass. Let these values be $\minRepOn{u}$ and $\minRepOn{u} + 1$. Let $u$ have $t$ children, labeled $\children{1}{\nChildren}$, with capacities $|\Csub{\child{1}}|, ..., |\Csub{\child{\nChildren}}|$. The divide phase determines which children are definitely-filled\xspace, and which are possibly-unfilled\xspace. The set of possibly-unfilled\xspace children can be determined in $O(\nChildren)$ time in a manner similar to the algorithm for the Fractional Knapsack Problem \cite{Dantzig1957}. We iteratively process the children of $u$ and, based upon their capacities, determine whether they are definitely-filled\xspace or possibly-unfilled\xspace in a balanced placement of $\rho$ replicas. We ensure that in each iteration, at least one-half of the children with undetermined status have their definitely-filled\xspace/possibly-unfilled\xspace status determined. To determine which half, the median capacity child with undetermined status is found using the median of medians algorithm \cite{Cormen2009}. Based upon the number of replicas yet to be ``claimed" by definitely-filled\xspace children, either \begin{inparaenum}[a)] \item the set of children with capacity greater than or equal to the median are labeled as possibly-unfilled\xspace, or \item the set of children with capacity less than or equal to the median are labeled as definitely-filled\xspace. \end{inparaenum} The algorithm then recurses on the remaining possibly-unfilled\xspace children. In the process of computing the definitely-filled\xspace and possibly-unfilled\xspace children values of $\minRepOn{\child{i}}$ are determined for all possibly-unfilled\xspace children $\child{i}$. See \autoref{a:get-filled} for pseudocode describing this procedure, and \autoref{f:divide-example} for a sample execution. The proof of correctness is straight-forward but tedious, and is provided in \autoref{app:labeling-proof}. Because the algorithm runs in time $O(\nChildren)$ for a node with $\nChildren$ children, the divide phase takes $O(\n)$ time over the entire tree. \begin{algorithm}[t] \SetKwFunction{getFilled}{Label-Children} \SetKwProg{Fn}{Function}{begin}{end} \Fn{\getFilled{$\{ \children{1}{\nChildren} \}$, $r$}}{ $\filled \gets \emptyset$; \tcp*[r]{$\filled$ := definitely-filled\xspace children} $\unfilled \gets \emptyset$; \tcp*[r]{ $\unfilled$ := possibly-unfilled\xspace children} $M \gets \{ \children{1}{\nChildren} \}$ \tcp*[r]{$M$ := unassigned children} $s \gets r$ \tcp*[r]{$s$ := number of replicas not yet permanently assigned} \While{$M \neq \emptyset$}{ \label{ln:while} $med \gets \text{ median capacity of children in $M$ }$\; $M_{\ell} \gets \{\child{i} \in M : |\Csub{\child{i}}| < med \}$\; $M_{e} \gets \{\child{i} \in M : |\Csub{\child{i}}| = med \}$\; $M_{g} \gets \{\child{i} \in M : |\Csub{\child{i}}| > med \}$\; $x \gets s - \sum_{\child{i} \in M_{\ell}} |\Csub{\child{i}}|$ \; \uIf{$x < (med -1) \cdot (|\unfilled| + |M_{e}| + |M_{g}|)$}{\label{l:case1} $\unfilled \gets \unfilled \cup M_{e} \cup M_{g}$\tcp*{$M_{e} \cup M_{g}$ possibly-unfilled\xspace} $M \gets M - (M_{e} \cup M_{g})$\; }\uElseIf{$x \geq (med) \cdot (|\unfilled| + |M_{e}| + |M_{g}|)$} {\label{l:case2} $\filled \gets \filled\cup M_{\ell} \cup M_{e}$\tcp*{$M_{\ell} \cup M_{e}$ definitely-filled\xspace} $M \gets M - (M_{\ell} \cup M_{e})$\; $s \gets x - \sum_{\child{i} \in M_{e}} |\Csub{\child{i}}|$\; } \Else(\tcp*[f]{$M_{\ell}$ definitely-filled\xspace, $M_{e} \cup M_{g}$ possibly-unfilled\xspace}) { $\unfilled \gets \unfilled \cup M_{e} \cup M_{g}$ \; $\filled \gets \filled \cup M_{\ell}$\; $M \gets \emptyset$\; } } \Return{($\filled$, $\unfilled$)} \tcp*[r]{return definitely-filled\xspace and possibly-unfilled\xspace children} } \caption{Determine definitely-filled\xspace and possibly-unfilled\xspace nodes}\label{a:get-filled} \end{algorithm} \begin{figure} \begin{tikzpicture}[scale=0.95, transform shape,text height=2ex] \usetikzlibrary{patterns} \newlength{\hatchspread} \newlength{\hatchthickness} \newlength{\hatchshift} \newcommand{}{} \tikzset{hatchspread/.code={\setlength{\hatchspread}{#1}}, hatchthickness/.code={\setlength{\hatchthickness}{#1}}, hatchshift/.code={\setlength{\hatchshift}{#1}} hatchcolor/.code={\renewcommand{}{#1}}} \tikzset{hatchspread=3pt, hatchthickness=0.4pt, hatchshift=0pt hatchcolor=black} \pgfdeclarepatternformonly[\hatchspread,\hatchthickness,\hatchshift, {custom north east lines {\pgfqpoint{\dimexpr-2\hatchthickness}{\dimexpr-2\hatchthickness} {\pgfqpoint{\dimexpr\hatchspread+2\hatchthickness}{\dimexpr\hatchspread+2\hatchthickness} {\pgfqpoint{\dimexpr\hatchspread}{\dimexpr\hatchspread} \pgfsetlinewidth{\hatchthickness} \pgfpathmoveto{\pgfqpoint{\dimexpr\hatchshift-0.15pt}{-0.15pt}} \pgfpathlineto{\pgfqpoint{\dimexpr\hatchspread+0.15pt}{\dimexpr\hatchspread-\hatchshift+0.15pt}} \ifdim \hatchshift > 0pt \pgfpathmoveto{\pgfqpoint{-0.15pt}{\dimexpr\hatchspread-\hatchshift-0.15pt}} \pgfpathlineto{\pgfqpoint{\dimexpr\hatchshift+0.15pt}{\dimexpr\hatchspread+0.15pt}} \fi \pgfsetstrokecolor{} \pgfusepath{stroke} } \tikzstyle{every node}=[minimum size=0.5cm, circle, align=center, draw=black] \node (r) {$u$}; \node [below=0.5cm of r, xshift=-0.75cm] (3) {}; \node [left=of 3] (2) {}; \node [left=of 2] (1) {}; \node [right=of 3] (4) {}; \node [right=of 4] (5) {}; \node [right=of 5] (6) {}; \draw[->] (r) -- (1.north east); \draw[->] (r) -- (2.north east); \draw[->] (r) -- (3.north); \draw[->] (r) -- (4.north); \draw[->] (r) -- (5.north west); \draw[->] (r) -- (6.north west); \node [draw=none, below=0.25cm of 1] (11) {1}; \node [draw=none, below=0.25cm of 2] (12) {2}; \node [draw=none, below=0.25cm of 3] (13) {4}; \node [draw=none, below=0.25cm of 4] (14) {5}; \node [draw=none, below=0.25cm of 5] (15) {9}; \node [draw=none, below=0.19cm of 6] (16) {11}; \node [draw=none, left=0cm of 11] {$|\Csub{i}| = $}; \node [draw=none, above right=-0.25cm of r, xshift=0.25cm] {$\repOn{u} \in \{20, 21\}$}; \node [draw=none, rectangle, right=1cm of 16] (e1) {$med = 4.5$}; \node [draw=none] at ($(13)!0.5!(14)$) (mid) {$\LARGE\mid$}; \node [draw=none, rectangle, below=0cm of e1] (e2) {$x=20 \not\leq 3.5(3) = 10.5$}; \node [draw=none, rectangle, below=-0.1cm of e2] (e3) {$x=20 > 4.5(3) = 13.5$}; \node [draw=none] at (e3 -| 11) {$F$}; \node [draw=none] at (e3 -| 12) {$F$}; \node [draw=none] at (e3 -| 13) {$F$}; \draw [transform canvas={yshift=-2.5mm}] (e3.east -| 1.west) -- (e3.east); \node [draw=none, yshift=-0.5cm] at (14 |- e3) (34) {5}; \node [yshift=-0.5cm] at (15 |- e3) (35) {9}; \node [draw=none, yshift=-0.5cm] at (16 |- e3) (36) {11}; \node [draw=none, rectangle, right=1cm of 36] (e4) {$med = 9$}; \node [draw=none, rectangle, below=0cm of e4] (e5) {$x=13 \leq 8(2) = 16$}; \draw [pattern=custom north east lines, hatchspread=10pt] ($(e4.north west -| 1.west)+(0,-0.1)$) rectangle (e4.south east -| mid.west); \node [draw=none] at (e5 -| 15) {$U$}; \node [draw=none] at (e5 -| 16) {$U$}; \draw [transform canvas={yshift=-2.5mm}] (e5.east -| 1.west) -- (e5.east); \node [yshift=-0.5cm] at (14 |- e5) (34) {5}; \node [draw=none, rectangle] at (34 -| e4) (e6) {$med = 5$}; \node [draw=none, rectangle, below=0cm of e6] (e7) {$x=13 \leq 5(3) = 15$}; \node [draw=none] at (e7 -| 14) {$U$}; \draw [pattern=custom north east lines, hatchspread=10pt] ($(e6.north west -| 1.west)+(0,-0.1)$) rectangle (e6.south east -| mid.west); \draw [pattern=custom north east lines, hatchspread=10pt] ($(e6.north west -| 5.west)+(0,-0.1)$) rectangle (e6.south east -| 6.east); \end{tikzpicture} \caption{Example execution of \autoref{a:get-filled}. Either $20$ or $21$ replicas are placed on node $u$, which has six children, with capacities $1,2,4,5,9$ and $11$. Each iteration is divided by a line. The node with the median capacity is circled in each iteration, except in the first iteration, where no node has capacity equal to the median. Computation of the branch conditions at lines \ref{l:case1} and \ref{l:case2} are shown on the right.}\label{f:divide-example} \end{figure} We next show that computing two values at each child is all that is required to compute \emph{both} placements of mass $\minRepOn{u}$ and $\minRepOn{u}+1$ at node $u$. This avoids a combinatorial explosion by keeping constant the number of subproblems considered at each node throughout the recursion. \begin{theorem}\label{thm-two-values} Let $\unfilled$ and $\filled$ be the set of possibly-unfilled\xspace and definitely-filled\xspace children found by \autoref{a:get-filled}, and let $\R$ be the minimum number of replicas to be distributed among the possibly-unfilled\xspace children, i.e. $\R := \minRepOn{u} - \sum_{\child{i} \in \filled} |\Csub{\child{i}}|$. In any case where $\minRepOn{u}$ or $\minRepOn{u} + 1$ replicas must be balanced among $t$ possibly-unfilled\xspace children, it suffices to consider placing either $\smallRep$ or $\bigRep$ children at each possibly-unfilled\xspace child. \end{theorem} \begin{proof} We first show that if $x$ replicas are to be distributed among $|\unfilled|$ possibly-unfilled\xspace children with sufficient capacity in a \emph{balanced} manner, then each child needs to store either $\floorfrac{x}{|\unfilled|}$ or $\ceilfrac{x}{|\unfilled|}$ replicas. Assume, on the contrary, that every child has capacity of at least $\ceilfrac{x}{|\unfilled|}$ but some child stores either at most $\floorfrac{x}{|\unfilled|} - 1$ replicas or at least $\ceilfrac{x}{|\unfilled|} + 1$ replicas. There are two cases depending on whether or not $x \bmod |\unfilled| = 0$. \begin{enumerate}[label={Case \roman*}] \item ($x \bmod |\unfilled| = 0$):~~In this case, $\floorfrac{x}{|\unfilled|} = \ceilfrac{x}{|\unfilled|} = \nicefrac{x}{|\unfilled|}$. If some child stores at most $\nicefrac{x}{|\unfilled|} - 1$ replicas, then some other child must store at least $\nicefrac{x}{|\unfilled|} + 1$, and vice versa. This, in turn, violates the balancing property. \item ($x \bmod |\unfilled| \neq 0$):~~In this case, $\floorfrac{x}{|\unfilled|} < \nicefrac{x}{|\unfilled|} < \ceilfrac{x}{|\unfilled|}$. If some child stores at most $\floorfrac{x}{|\unfilled|} - 1$ replicas, then some other child must store at least $\ceilfrac{x}{|\unfilled|}$ replicas. Likewise, if some child stores at least $\ceilfrac{x}{|\unfilled|} + 1$ replicas, then some other child must store at most $\floorfrac{x}{|\unfilled|}$ replicas. Both situations violate the balancing property. \end{enumerate} We now prove the main result. Note that we need to place either $\R$ or $\R+1$ replicas on $|\unfilled|$ possibly-unfilled\xspace children identified by the labeling algorithm. If $|\unfilled| = 1$, then, clearly, the possibly-unfilled\xspace child needs to store either $\R$ or $\R+1$ replicas. Thus assume that $|\unfilled| \geq 2$. Note that the capacity of each possibly-unfilled\xspace child is at least $\ceilfrac{\R}{|\unfilled|}$. There are three cases depending on the values of $\R \bmod |\unfilled|$ and $(\R + 1) \bmod |\unfilled|$. \begin{enumerate}[label={Case \roman*}] \item ($\R \bmod |\unfilled| = 0$):~~With $\R$ replicas, we need to store exactly $\nicefrac{\R}{|\unfilled|}$ replicas on each possibly-unfilled\xspace child. With $\R + 1$ replicas, we need to store either $\floorfrac{(\R+1)}{|\unfilled|}$ or $\ceilfrac{(\R+1)}{|\unfilled|}$ replicas on each possibly-unfilled\xspace child. But since $\R \bmod |\unfilled| = 0$, $\floorfrac{\R}{|\unfilled|} = \floorfrac{(\R+1)}{|\unfilled|}$, yielding the two values claimed. \item $\left((\R + 1) \bmod |\unfilled| = 0\right)$:~~With $\R$ replicas, we need to store either $\floorfrac{\R}{|\unfilled|}$ or $\ceilfrac{\R}{|\unfilled|}$ replicas on each possibly-unfilled\xspace child. With $\R + 1$ replicas, we need to store exactly $\nicefrac{(\R+1)}{|\unfilled|}$ replicas on each possibly-unfilled\xspace child. But since $(\R + 1) \bmod |\unfilled| = 0$, $\ceilfrac{\R}{|\unfilled|} = \ceilfrac{(\R+1)}{|\unfilled|} = \nicefrac{(\R+1)}{|\unfilled|}$, yielding the two values claimed. \item ($\R \bmod |\unfilled| \neq 0$ and $(\R + 1) \bmod |\unfilled| \neq 0$):~~In this case, $\floorfrac{\R}{|\unfilled|} = \floorfrac{(\R+1)}{|\unfilled|}$ and $\ceilfrac{\R}{|\unfilled|} = \ceilfrac{(\R+1)}{|\unfilled|}$, yielding the two values claimed. \end{enumerate} \noindent This completes the proof. \qed \end{proof} \subsubsection{Combine Phase}\label{s:conquer-phase} Once the recursive call completes, we combine the results from each of the children to achieve the lexico-minimum value of the objective function overall. Let $\unfilled$ be the set of possibly-unfilled\xspace children found in the divide phase. The combine phase decides which $\nHvy$ possibly-unfilled\xspace children receive a mass of $\bigRep$, and which receive a mass of only $\smallRep$. We call a placement with size $\bigRep$ \emph{heavy}, and a placement of size $\smallRep$ \emph{light}. We must select $\nHvy$ children to receive heavy placements in such a way that the overall placement is lexico-minimum. Recall that we must return two optimal placements, one of size $\minRepOn{u}$ and another of size $\minRepOn{u} + 1$. We show how to obtain an optimal placement of size $\minRepOn{u}$, the $\minRepOn{u} + 1$ case is easily obtained thereafter. Let the possibly-unfilled\xspace children be given as $\children{1}{|\unfilled|}$. For each possibly-unfilled\xspace child $\child{i}$ let $\a_i$ (respectively $\b_i$) represent the minimum value of $\ff{\P}$, where $\P$ is any light placement (respectively any heavy placement) of replicas on child $\child{i}$. Recall that the values of optimal heavy and light placements were recursively computed for each child, so values of $\a_i, \b_i \in \intvecs$ are readily available. We formulate an optimization problem by setting decision variables $x_i \in \{0,1\}$, for which $x_i = 0$ if child $\child{i}$ receives a light placement, or $1$ if $\child{i}$ receives a heavy placement. The problem can then be described as an assignment of values to $x_i$ according to the following system of constraints. \begin{equation}\label{e:optProb} \min \sum_{i=1}^{|\unfilled|} \a_i + (\b_i - \a_i)x_i, ~~~\text{subj. to:}~~~ \sum_{i=1}^{|\unfilled|} x_i = \nHvy. \end{equation} An assignment of $x_i$ which satisfies the requirements of (\ref{e:optProb}) can be found by computing $\b_i - \a_i$ for all $i$, and greedily assigning $x_i = 1$ for the children with the $\nHvy$ smallest values of $\b_i - \a_i$. This solution is clearly feasible. \autoref{t:optCorrect} below states that this assignment is also optimal. Our proof of \autoref{t:optCorrect} relies crucially on the fact that the lexicographic order on integer vectors forms a linearly-ordered Abelian group under the operation of component-wise addition. For completeness, we state the properties of a linearly-ordered Abelian group here. \begin{definition} A linearly-ordered Abelian group is a triple $\logroup$, where $\G$ is a set of elements, $\gop$ is a binary operation on $\G$, and $\logeq$ is a linear (total) order on $\G$ such that all of the following properties are satisfied \cite{Levi1947}. \begin{enumerate}[a)] \item \emph{Associativity:} for all $x,y,z\in \G$, $x + (y +z) = (x+y)+z$ \item \emph{Commutativity:} for all $x,y \in \G$, $x + y = y + x$. \item \emph{Identity:} there is an element $0 \in \G$ such that for all $x \in G$, $0 + x = x$. \item \emph{Inverses:} for all $x \in G$, there is an element $x^{-1} \in G$, such that $x + (x^{-1}) = 0$. In commutative (Abelian) groups, $x^{-1}$ is typically denoted $-x$. \item \emph{Translation-invariance:} for all $x,y,z \in \G$, if $x \logeq y$, then $x + z \logeq y + z$. \end{enumerate} \end{definition} It is straight-forward to show that $\groupdef{\intvecs}{+}{\geq_L}$ is a linearly-ordered Abelian group, where $+$ is component-wise addition, and $\geq_L$ is the lexicographic order. Armed with this fact, we can now formally state and prove correctness of the greedy optimization procedure. \begin{theorem}\label{t:optCorrect} Let $\perm = (\perm_1, \perm_2, ..., \perm_{|\unfilled|})$ be a permutation of indices $\{1, ..., |\unfilled|\}$ such that $$\b_{\perm_1} - \a_{\perm_1} \loleq \b_{\perm_2} - \a_{\perm_2} \loleq ... \loleq \b_{\perm_{|\unfilled|}} - \a_{\perm_{|\unfilled|}}.$$ If $\langle x_1, ..., x_{|\unfilled|} \rangle$ is defined according to the following rule: set $x_{\perm_i} = 1$ if and only if \mbox{$i \leq \nHvy$}, else $x_{\perm_i} = 0$, then $\langle x_1, ..., x_{|\unfilled|} \rangle$ is an optimal solution to (\ref{e:optProb}). \end{theorem} \begin{proof} First, notice that any optimal solution to (\ref{e:optProb}) also minimizes the quantity $\sum_{i} (\b_i - \a_i)x_i$. Therefore, it suffices to minimize this quantity. For convenience, we consider $\langle x_1, ..., x_{|\unfilled|}\rangle$ to be the characteristic vector of a subset $S$ of indices $\{1, ..., |\unfilled|\}$. We will show that no other such subset $S'$ can yield a characteristic vector $\langle x'_1, ..., x'_{|\unfilled|} \rangle$ which is strictly better than $\langle x_1, ..., x_{|\unfilled|}\rangle$ as follows. Let $\beta = \nHvy$, and let $S = \{\perm_1, ..., \perm_\beta\}$ be the first $\beta$ entries of $\perm$ taken as as set. Suppose that there is some $S'$ which represents a feasible assignment which is strictly better than that represented by $S$. Clearly, $S' \subseteq \{1,...., |\unfilled|\}$, such that $|S'| = \beta$ and $S \neq S'$. Since $S \neq S'$, and $|S'| = |S|$, we have that there must be some $i \in S \setminus S'$ and $j \in S' \setminus S$. We claim that we can improve on $S'$ by forming $S^\ast = (S' \setminus\{j\}) \cup \{i\}$. Specifically, we claim that \begin{equation}\label{e:non-increasing} \sum_{k \in S^\ast} (\b_k - \a_k) \leq_L \sum_{k \in S'} (\b_k - \a_k), \end{equation} which implies that replacing a single element in $S'$ with one from $S$ does not cause the quantity minimized in (\ref{e:optProb}) to increase. To prove (\ref{e:non-increasing}), note that $j \notin S$ and $i \in S$ implies that $(\b_i - \a_i) \loleq (\b_j - \a_j)$. We now apply the translation-invariance of $\groupdef{\intvecs}{+}{\geq_L}$, which states that for any $x,y,z \in \intvecs$, $x \leq_L y \implies z + x\leq_L z + y$. Let $x = (\b_i - \a_i)$, $y = (\b_j - \a_j)$, and let $z = \sum_{k \in (S^\ast \setminus {i})} (\b_k - \a_k)$. This yields $$\sum_{k \in (S^\ast \setminus \{i\})} (\b_k - \a_k) + (\b_i - \a_i) \leq_L \sum_{k \in (S^\ast \setminus \{i\})} (\b_k - \a_k) + (\b_j - \a_j).$$ But since $S^\ast \setminus \{i\} = S' \setminus \{j\}$, we have that \begin{align*} \sum_{k \in (S^\ast \setminus \{i\})} (\b_k - \a_k) + (\b_i - \a_i) &\leq_L \sum_{k \in (S' \setminus \{j\})} (\b_k - \a_k) + (\b_j - \a_j)\\ \sum_{k \in S^\ast} (\b_k - \a_k) &\leq_L \sum_{k \in S'} (\b_k - \a_k) \end{align*} Thereby proving (\ref{e:non-increasing}). This shows that any solution which cannot be represented by $S$ can be modified to swap in an extra member of $S$ without increasing the quantity minimized by (\ref{e:optProb}). By induction, it is therefore possible to include every element of $S - S'$ until $S'$ is transformed into $S$. Therefore, $\langle x_1, ..., x_{|\unfilled|} \rangle$ is an optimal solution to (\ref{e:optProb}). \qed \end{proof} The required greedy solution can be quickly formed by first selecting the possibly-unfilled\xspace child having the $(\nHvy)^{th}$ largest value of $\b_i - \a_i$ using linear-time selection. Thereafter, the partition procedure from quicksort can be used to find those children having values below this selected child. For clarity of notation, we assume from here on that the possibly-unfilled\xspace children $\children{1}{|\unfilled|}$ are sorted in increasing order of $\b_i - \a_i$, even though \emph{the algorithm performs no such sorting}. At the end of the combine phase, we compute and return the sum \begin{equation}\label{e:combine-sum} \sum_{i \leq \nHvy} \b_i + \sum_{i > \nHvy} \a_i + \sum_{\child{j} \in F} \ff{\Csub{\child{j}}} + \alpf{\minRepOn{u}}, \end{equation} where $\alpf{k}$ is a vector of size $\rho+1$ with a one in the ${k}^{th}$ entry, and zeroes everywhere else. Since node $u$ has mass $\minRepOn{u}$, the $\alpf{\minRepOn{u}}$ term accounts for node $u$'s contribution to $\ff{\P}$. Thus equation (\ref{e:combine-sum}) gives the value of an optimal placement of $\minRepOn{u}$ replicas placed on node $u$. \begin{algorithm}[t] \caption{An $O(n \rho)$ algorithm for optimal single-block placement.}\label{a:placeReplicas} \SetKwFunction{placeReplicas}{Place-Replicas} \SetKwFunction{getFilled}{Label-Children} \SetKwFunction{partition}{Partition} \SetKwFunction{fill}{Filled-Value} \SetKwProg{Fn}{Function}{begin}{end} let $\partition(S, k)$ partition $S$ into sets $L, H$, where $L$ contains the $k$ smallest elements, and $H$ contains the remaining $|S| - k$ elements\; \Fn{\placeReplicas{$u, r$}}{ let $\children{1}{\nChildren}$ be children of $u$ \tcp*{Divide phase} $U, F \gets$ \getFilled{$\{\children{1}{\nChildren}\}, r$} \tcp*{$O(t)$ time} $R \gets \rho - \sum_{\child{i} \in F} |\Csub{\child{i}}|$\; \For(\tcp*[f]{Combine phase}){$\child{i} \in U$} { $\a_i \gets $\placeReplicas{$\child{i}, \smallRep$}\label{l:recurseBegin}\; $\b_i \gets $\placeReplicas($\child{i}, \bigRep$)\label{l:recurseEnd}\; } $L, H \gets$ \partition{$\{\b_1-\a_1,...,\b_{|U|} - \a_{|U|}\}, \nHvy$} \tcp*{$O(|U|\rho)$ time } \Return $\sum_{\child{i} \in L} \b_i + \sum_{\child{i}\in H} \a_i + \sum_{\child{j}\in F} \ff{\Csub{\child{j}}} + \alpf{\rho}$ \tcp*{$O(t\rho)$ time} } \end{algorithm} Pseudocode for the entire algorithm appears in \autoref{a:placeReplicas}. Implementing this procedure directly yields an $O(\n\rho)$ time algorithm, where $n$ is the number of nodes in the tree, and $\rho$ is the number of replicas to be placed. In the next section, we describe several improvements which are used to achieve a running time of $O(n + \rho \log \rho)$. \subsubsection{Transforming to Achieve $O(\n + \rho \log \rho)$ Time}\label{s:rhologrho} First, observe that the maximum failure number returned from child $\child{i}$ is $\minRepOn{\child{i}} + 1$. This, along with the property that every node's failure number is greater than or equal to that of its descendants, implies that the vector returned from $\child{i}$ will have a zero in indices $0,...,\rho - \minRepOn{\child{i}} - 2$. To avoid wasting time, we modify the algorithm to return only the non-zero suffix of this vector, which has length at most $O(\minRepOn{\child{i}})$. At each node, we can compute (\ref{e:combine-sum}) by summing the entries of the vector in decreasing order of their index, and skipping zero entries. Specifically, to compute $\vec{v}_1 + ... + \vec{v}_\nChildren$, we first allocate an empty vector $\vec{w}$ of size $\minRepOn{u} + 1$, to store the result of the sum. For each vector $\vec{v}_i$, we set $\vec{w}[j] \gets \vec{w}[j] + \vec{v}_i[j]$ for indices $j$ from indices $\rho - \minRepOn{\child{i}}$ up to $\rho$. After all the vectors have been processed, $\vec{w} = \vec{v}_1 + ... + \vec{v}_\nChildren$. This algorithm takes only $O(\minRepOn{1}) + ... + O(\minRepOn{t}) = O(\minRepOn{u})$ time to compute a single sum. Using smaller vectors also implies that the $(\nHvy)^{th}$ best child can be found in $O(\minRepOn{u})$ time, since each possibly-unfilled\xspace child returns a vector of size at most $O(\minRepOn{u}/|\unfilled|)$, each comparison need take no more than $O(\minRepOn{u}/|\unfilled|)$ time. Since there are only $|\unfilled|$ children to compare, we obtain $O(\minRepOn{u})$ time in total for linear-time selection when using these sparse vectors. With these modifications, the entire combine phase takes only $O(\minRepOn{u})$ time at every node $u$. We will collectively refer to the techniques presented in this paragraph as \emph{prefix truncation} in later sections. To bring down the running time of the combine phase, note that in any placement, nodes at the same depth have $\rho$ replicas placed on them in total. We can therefore achieve an $O(\rho \log \rho)$ time combine phase overall by ensuring that the combine phase only needs to occur in at most $O(\log \rho)$ levels of the tree. To do this, observe that when $\minRepOn{u} = 0$, any leaf with minimum depth forms an optimal placement of size $1$. Moreover, we can easily construct pointers from each node to its minimum depth leaf during an $O(n)$ time preprocessing phase. Therefore, the combine phase does not need to be executed once $\minRepOn{u} = 0$. To ensure that there are only $O(\log \rho)$ levels, we transform the tree to guarantee that as the combine phase proceeds down the tree, $\minRepOn{u}$ decreases by at least a factor of two at each level. The balancing property ensures that this will automatically occur when there are two or more possibly-unfilled\xspace children at each node. However this is not guaranteed when the tree contains what we term a \emph{degenerate chain}, a path of nodes each of which only have a single possibly-unfilled\xspace child. By removing degenerate chains, we can obtain an $O(\rho \log \rho)$ combine phase. \begin{figure}[tb] \subcaptionbox{A degenerate chain.\label{f:degenerate-unfilled-case}}[0.6\textwidth] { \scalebox{1.0}{\begin{tikzpicture}[scale=0.525] \node[inner sep=0] {\includegraphics[scale=0.45]{improvements-degenerate-case.pdf}}; \draw (-1.75, -1.1) node[circle, fill=white] {$\iddots$}; \draw[decorate, decoration={brace, amplitude=5pt}] (-4, -2) -- (4.0, 4.3) node [midway, xshift=-8, yshift=8, rotate=37] {length $O(\rho)$}; \draw (-3.15, -4) node {\small $T_k$}; \draw (-3.15, -2.55) node {\small $v_k$}; \draw (0.35, -0.45) node {\small $T_3$}; \draw (0.3, 0.4) node {\small $v_3$}; \draw (2.1, 1.75) node {\small $v_2$}; \draw (2.1, 1) node {\small $T_2$}; \draw (4, 2.4) node {\small $T_1$}; \draw (3.9, 3.1) node {\small $v_1$}; \draw(4, 1.8) node {\tiny $O(1)$ leaves}; \draw(2.15, 0.4) node {\tiny $O(1)$ leaves}; \draw(0.2, -1.1) node {\tiny $O(1)$ leaves}; \end{tikzpicture} } } \subcaptionbox{Contracted pseudonode.\label{f:contracted-nodes}}[0.35\textwidth] { \scalebox{1.0}{\begin{tikzpicture}[scale=0.525] \centering \node[inner sep=0] {\includegraphics[scale=0.5]{contracted-nodes-fig.pdf}}; \draw (-0.125, -1.5) node[align=center] {$T_k$}; \draw (-0.125, 0) node[align=center] {$v_k$}; \draw (1.35, 1.35) node[align=center] {$w$}; \end{tikzpicture} } } \caption{Illustration of a degenerate chain.} \end{figure} \autoref{f:degenerate-unfilled-case} illustrates a degenerate chain of length $k$. In this figure, for all $i \in \{1,...,k-1\}$, all nodes in $T_i$ are definitely-filled\xspace. Moreover, node $v_k$ has at least two possibly-unfilled\xspace children. Thus, for $i\in \{1,...,k-1\}$, each $v_i$ has only a single possibly-unfilled\xspace child, namely $v_{i+1}$. It is easy to see that if the number of leaves in each set $T_i$ is constant with respect to $\rho$, then the length of the chain can be as large as $O(\rho)$. This would imply that there can be $O(\rho)$ levels in the tree where the entire combine phase is required. To remove degenerate chains, we contract nodes $v_1, ..., v_{k-1}$ into a single pseudonode, $w$, as in \autoref{f:contracted-nodes}. However, we must take care to ensure that the values returned by pseudonode $w$ take into account contributions from the entire contracted structure. We will continue to use $v_i$ and $T_i$ throughout this section to refer to nodes in a degenerate chain. The remainder of this section treats the removal of degenerate chains at a high level. Interested readers can find detailed pseudocode in \autoref{app:transform-pseudo}. Let $\vec{a_w}, \vec{b_w}$ be the values returned by pseudonode $w$. In order for the transformation to be correct, we need to ensure that these values are the same as those which would have been returned had no transformation been performed. To ensure this, we must consider and include the contribution of each node in the set $S_w = T_1 \cup ... \cup T_{k-1} \cup \{v_1, ..., v_k\}$. It is easy to see that the failure numbers of $v_1, ..., v_{k-1}$ depend only upon whether $\minRepOn{v_k}$ or $\minRepOn{v_k} + 1$ replicas are placed on node $v_k$, while the possibly-unfilled\xspace nodes in sets $T_1,..., T_{k-1}$ have no such dependency. Since the value of $\minRepOn{v_k}$ is only available at the end of the divide phase, we detect and contract degenerate chains immediately afterwards. The transform phase runs as a breadth first search. Detecting degenerate chains is relatively straightforward, but careful memory management is required to keep the running time of this phase below $O(\n + \rho \log \rho)$. When contracting a degenerate chain, we must sum each definitely-filled\xspace node's contribution to the vectors $\vec{a_w}$ and $\vec{b_w}$. Intermediate values of this sum must be stored in an array of size $O(\minRepOn{v_1})$ as we contract the chain. The key to achieving an $O(\n + \rho \log \rho)$ transform phase lies in allocating space for this array only \emph{once} for each chain. Taking care in this way allows us to bring the running time for contracting a degenerate chain of size $|S_w|$ down to $O(|S_w| + \minRepOn{v_1})$. When we sum this expression over all degenerate chains, we obtain a running time of $O(n + \rho \log \rho)$ for the transform phase. To reach this result, examine the sum over values of $\minRepOn{v_1}$ for all \emph{pseudonodes} having the same depth. Since there are at most $\rho$ replicas among such pseudonodes, this sum can be at most $O(\rho)$ at any depth. After the degenerate chains have been contracted, there are only $O(\log \rho)$ levels where $\minRepOn{u} > 1$. Thus, pseudonodes can be only be present in the first $O(\log \rho)$ levels of the final tree. Therefore the $O(\minRepOn{v_1})$ term sums to $O(\rho \log \rho)$ overall. Since the $O(|S_w|)$ term clearly sums to $O(n)$ overall, the transform phase takes at most $O(n + \rho \log \rho)$ time. Including the transform phase implies that there are only $O(\log \rho)$ levels where the combine phase needs to be run in its entirety. Therefore, the combine phase takes $O(\rho \log \rho)$ time overall. When combined with the $O(n)$ divide phase and the $O(n + \rho \log \rho$) transform phase, this yields an $O(n + \rho \log \rho)$ algorithm for solving replica placement in a tree. \section{Solving Multi-block Replica Placement}\label{s:mp-balancing} In this section, we describe an exact algorithm to optimize the simultaneous placement of multiple blocks of replicas at once (i.e. \autoref{p:graph-multi-placement}). As previously discussed, this problem naturally occurs in data centers, where multiple sets of replicas co-exist. Recall that in \autoref{model} we defined a \emph{multi-placement} $\MP$ as an ordered set of $\m$ placements, $\MP \mathrel{\mathop:}= (\P_1, ..., \P_m)$. Recall also that in the multi-placement case, each leaf node has a capacity of $c(\ell)$, the maximum number of replicas which it can accommodate. Moreover, no leaf node will accept more than one replica from any given single placement (or block), as this would in some sense defeat the purpose of replication. We further extended the failure aggregate to multi-placements by defining the failure aggregate of a multi-placement as the sum of the failure aggregates of the individual placements (padded as needed). In the single-placement case, it is easy to see how the failure aggregate of a placement is comprised of local contributions from each node. Each node contributes a factor to the objective based upon its failure number. In the multi-placement case, each node's local contribution to the failure aggregate is not as clear. To clearly state the contribution of each node to the failure aggregate of a multi-placement, we will introduce the concept of the \emph{\signature} of a multi-placement, and the concept of a \emph{sub-multi-placement\xspace} of a multi-placement. Each multi-placement has an associated \emph{\signature}, a vector which summarizes the number of replicas assigned to each block. The $k^{th}$ component of the signature counts the number of blocks which have $k$ replicas assigned to them. Formally, the signature of multi-placement $\MP$ is a vector $\vec{\sigma}(\MP) = \langle n_0, ..., n_\rho\rangle$, where $\rho $ is the size of the largest placement, and $n_k$ is the number of placements in $\MP$ which have size $\rho-k$, (i.e. \sloppy\mbox{$n_k = \left| \{i : [1,...,m] : |P_i| = \rho-k\} \right|$}). As an example application of this concept, recall that the input to an instance of \autoref{p:graph-multi-placement} specifies a series of $m$ integers, $\rho_1, ..., \rho_m$, where $\rho_i$ is the number of replicas placed on block $i$ in a valid solution. It is easy to see that these integers uniquely specify the \signature which a valid solution is allowed to have. For example, if $m=5$ and \mbox{$(\rho_1, \rho_2, \rho_3, \rho_4, \rho_5) = (1,2,2,3,3)$} in an instance of \autoref{p:graph-multi-placement}, then only multi-placements with \signature $\vec{\sigma}(\MP) = \langle 2, 2, 1, 0\rangle$ are valid solutions. Observe also that \emph{any} multi-placement with a \signature of $\langle 2,2,1,0 \rangle$ can be made to satisfy the requirement that $(\rho_1, \rho_2, \rho_3, \rho_4, \rho_5) = (1,2,2,3,3)$ simply by relabeling the blocks appropriately. As a second example, observe that the signature of a multi-placement summarizes the failure numbers associated with the root node. For instance, if $\vec{\sigma}(\MP) = \langle 2, 2, 1,0\rangle$, then there is one block of $\MP$ for which the root has failure number $1$, two blocks for which the root has failure number $2$, and two blocks for which the root has failure number $3$. This last observation hints at the importance of signatures which we wish to convey. The signature of a multi-placement accumulates the failure numbers of the root node across all $\m$ blocks of the multi-placement into an alternate vector form. This vector form has certain advantages since its number of non-zero entries depends on the skew in the desired multi-placement. Using the concept of a \emph{sub-multi-placement\xspace}, we can similarly collect the failure numbers of \emph{any node in the tree}. For any given multi-placement the \emph{sub-multi-placement\xspace} at node $u$ consists only of the replicas of the multi-placement which are assigned to leaves of the subtree rooted at node $u$. More formally, if $\Csub{u}$ is the set of leaves assigned to node $u$, and $\MP= (P_1, P_2, ...,P_m)$, then $\MP_u = (P_1 \cap \Csub{u}, P_2\cap \Csub{u}, ..., P_\m \cap \Csub{u})$. To illustrate this concept, refer to the tree in \autoref{f:sub-placement-ex}. The multi-placement $\MP = (\{a,b,c\}, \{b,d,e\}, \{b,c,e\})$ has a sub-multi-placement\xspace at node $u$ given by $\MP_u = (\{a,b,c\}, \{b\}, \{b\})$. Notice that the signature of $\MP_u$ is given by \mbox{$\vec{\sigma}(\MP_u) = \langle 1, 0, 2, 0 \rangle$}, and furthermore, this collects the failure numbers of $u$ \emph{with respect to the original multi-placement $\MP$} into a convenient form which matches that of the failure aggregate. Specifically, node $u$ has failure number 3 with respect to one block of $\MP$ (block 1), and a failure number of 1 with respect to two blocks of $\MP$ (blocks 2 and 3). \begin{figure} \centering \begin{tikzpicture}[parent anchor=center,child anchor=center,every node/.style={draw, minimum height=6mm}] \node[circle] (root) {} [level distance=12.5mm,sibling distance=15mm] child {node[circle] (u) {$u$} [sibling distance=7mm] child{node[circle] {} [sibling distance=7.5mm] child{node[rectangle] {$a$} } child{node[rectangle] {$b$} } } child{node[rectangle] {$c$} } } child {node[circle] (anchor) {$w$} child{node[circle] {} [sibling distance=7.5mm] child{node[rectangle] {$d$} } child{node[rectangle] {$e$} } } }; \node[draw=none, right=1cm of anchor,yshift=-5mm]{ \normalsize $\begin{array}{lllll} \MP &= (~\{a,b,c\},& \{b,d,e\}, &\{b,d\}&)\vspace{2mm}\\ \MP_u &= (~\{a,b,d\},& \{b\}, &\{b\} &)\vspace{2mm}\\ \MP_w &= (~\{\}, &\{d,e\}, &\{e\} &) \end{array}$}; \end{tikzpicture} \caption{Multi-placement $\MP$ and two of its sub-multi-placement\xspace{s}, $\MP_u$ and $\MP_w$.} \label{f:sub-placement-ex} \end{figure} This suggests a way to rewrite the failure aggregate of a multi-placement into a more convenient form in which each node's individual contribution to the overall failure aggregate is made transparent. Specifically, the failure aggregate of a multi-placement is just the sum of the signatures of all of its sub-multi-placement\xspace{s}, as formalized in the following lemma. \begin{lemma}\label{lem:signature-solution} For any $u \in V$, let $\MP_u$ be the sub-multi-placement\xspace of $\MP$ at node $u$, then \[\g{\MP} = \sum_{u \in V} \sig{\MP_u}. \] \end{lemma} \begin{proof} Let $\sig{\MP_u} = \langle n^u_0, ...,n^u_\rho \rangle$, then $n^u_j$ counts the number of placements of $\MP$ in which node $u$ has failure number $\rho-j$. Furthermore, let $\ff{\P_i} = \langle p^i_0, ...,p^i_\rho \rangle$, then $p^i_j$ counts the number of nodes which have failure number $\rho-j$ with respect to placement $P_i$. We first show that \[\sum_{u\in V} n_j^u = \sum_{i=1}^m p^i_j\] for any failure number $\rho-j$. This correspondence is easy to see as follows. Each node $u$ contributes a factor of 1 for each placement in which $u$ has failure number $\rho-j$ on \emph{both} sides of the correspondence. On the RHS, node $u$ is counted as one of the nodes which has failure number $\rho-j$ with respect to block $i$, so $u$ contributes a factor of 1 to the term $p^i_j$. On the LHS, node $u$ contributes a factor of 1 to the term $n_j^u$, since block $i$ is one of the blocks with respect to which $u$ has failure number of $\rho-j$. Clearly, for every factor of 1 contributed on the LHS another factor of 1 must be contributed on the RHS, thus the two sums are equal. Hence, \begin{multline*}\sum_{u \in V}\sig{\mathcal{P}_u} = \left\langle \sum_{u\in V} n_0^u, \sum_{u\in V} n_1^u, ..., \sum_{u \in V} n_\rho^u \right\rangle = \\ \left\langle \sum_{i=1}^m p^i_0, \sum_{i=1}^m p^i_1, ..., \sum_{i=1}^m p^i_\rho \right\rangle = \sum_{i = 1}^m \ff{P_i} = \g{\mathcal{P}}, \end{multline*}\qed \end{proof} Each node's contribution to the failure aggregate of a multi-placement is thus clear. Node $u$ contributes the signature of its sub-multi-placement\xspace, $\sig{\MP_u}$, to the overall value of $\g{\MP}$. We can therefore optimize $\g{\MP}$ by locally optimizing values of $\sig{\MP_u}$. We can do so directly via a dynamic program as follows. At each node $u$ we compute and store $G_u(\vec{\sigma})$, the optimal value which can be attained by any sub-multi-placement\xspace at node $u$ which has a signature of $\vec{\sigma}$. We show how a table for $G_u(\vec{\sigma})$ can be recursively computed in \autoref{s:mp-dp}. Since there are roughly $O(m^{\rho+1})$ possible signatures for which the value of $\G_u$ must be computed, it is not immediately clear that such an approach will be tractable. As we shall see, if we are given a signature and we want to find an optimal multi-placement which has that signature, we can achieve a significant reduction in running time. First, in the absence of an associated multi-placement, a signature is just a vector $\vec{\sigma} = \langle\sigma_0, ..., \sigma_\rho \rangle \in \mathbb{N}^{\rho + 1}$. Recall that we defined the \emph{skew} of a multi-placement as the absolute difference between the maximum and minimum failure numbers of each block. This definition extends readily to signatures. Specifically, we define the skew of a signature to be the difference between the indices of its maximum and minimum non-zero entries, formally \[skew(\langle\sigma_0, ..., \sigma_\rho \rangle) = \max_{\sigma_i \neq 0} i - \min_{\sigma_j \neq 0} j.\] If the signature consists only of zeroes, we define $skew(\langle 0, ..., 0\rangle) = 0.$ Obviously, the skew of a multi-placement and the skew of its signature are equivalent. Likewise, we define the \emph{girth} of a signature as the maximum index $i$ for which $\sigma_i$ is non-zero. Our key insight is that \emph{in order to find an optimal multi-placement which has skew $\delta$ we only need to compute values of $G_u$ for signatures which have skew $\delta$.} As there are roughly $O(m^\delta)$ such signatures, we can obtain an algorithm which works well when the skew of the desired multi-placement is small. Specifically, we provide an exact algorithm which runs in polynomial time for fixed values of $\delta$. Since $\delta$ is typically small in practice, this comprises a significant speed-up over the brute-force approach. The remainder of this section is organized as follows. In \autoref{s:mp-theory} we prove that it suffices to recursively consider signatures with skew no greater than $\delta$. In \autoref{s:mp-algorithm} we present an exact algorithm for finding an optimal multi-placement based on the above property. \subsection{The Bounded Skew Property for Optimal Multi-placements}\label{s:mp-theory} \begin{comment} In this section, we show that for any signature $\vec{\sigma}$ with skew $\delta$, there exists an optimal multi-placement with signature $\vec{\sigma}$ whose sub-multi-placement\xspace{s} each have skew at most $\delta$. This allows us to consider only a subset of the range of possible signatures which a sub-multi-placement\xspace may have. To unify our arguments, we introduce the concept of an \emph{improving local exchange}, which is similar in spirit to the notion of an augmenting path that is used to show optimality of the Ford-Fulkerson algorithm for maximum network flow. \end{comment} We begin by defining an \emph{exchange} of a multi-placement, which is simply a multi-placement that can be formed by rearranging the assignment of replicas among two blocks. \begin{definition} An \emph{exchange} of a multi-placement $\MP = (P_1, ..., P_m)$ is a multi-placement $\mathcal{Q} = (Q_1,...,Q_m)$ in which \begin{enumerate}[a)] \item $\bigcup_i P_i = \bigcup_i Q_i$ \item $|P_i| = |Q_i|$ for all $i$, \item there exist indices $i,j$ such that for every $k$ different from $i$ and $j$, $P_k = Q_k$. \end{enumerate} Blocks $i$ and $j$ are referred to as the \emph{targets} of the exchange, and we say that the exchange \emph{targets blocks $i$ and $j$}. \end{definition} Notice that part (b) implies that the signature of an exchange matches that of the original multi-placement. We define a \emph{localized exchange} as an exchange which involves only sub-multi-placement\xspace{s} of sibling nodes $u$ and $v$. \begin{definition} A \emph{localized exchange} of a multi-placement $\MP$ is an exchange, say $\mathcal{Q}$ targeting blocks $i$ and $j$, for which there exist sibling nodes $u$ and $v$ such that for all choices of a node $w$ which is not a an ancestor or descendant of $u$ or $v$, the sub-multi-placement\xspace{s} of $\MP$ and $\mathcal{Q}$ at node $w$ are the same, (i.e. $\MP_w = \mathcal{Q}_w$). Moreover, we refer to nodes $u$ and $v$ as the \emph{carriers} of the localized exchange. \end{definition} Refer to \autoref{f:implocex-example} for an example of a localized exchange and a few non-examples. \begin{figure} \centering \begin{tikzpicture}[parent anchor=center,child anchor=center,every node/.style={draw, minimum height=6mm}] \node[circle] (root) {} [level distance=15mm,sibling distance=25mm] child { node[circle] (a) {$a$} [sibling distance=7.5mm] child{ node[rectangle] {$1$} } child{ node[rectangle] {$2$} } } child {node[circle] (u) {} [sibling distance=20mm] child {node[circle] (b) {$b$} [sibling distance=7mm] child{node[circle] {} [sibling distance=7.5mm] child{ node[rectangle]{$3$}} child{ node[rectangle]{$4$}} } child{node[rectangle]{$5$}} child{node[rectangle]{$6$}} } child {node[circle] (c) {$c$} [sibling distance=7.5mm] child{node[circle] {} [sibling distance=7.5mm] child{ node[rectangle] {$7$}} child{node[rectangle] {$8$} } } child{node[rectangle] {$9$}} } }; \node[draw=none, right=1cm of c]{ $\begin{array}{ll} \MP &= \left(\{1,4,6\}, \{2,3,6,8\}\right)\\ \mathcal{Q} &= \left(\{1,8,6\}, \{2,3,6,4\}\right)\vspace{1mm}\\ \multicolumn{2}{l}{\tworowcell{\text{$\mathcal{Q}$ is a localized exchange of $\MP$ with carriers} \\\text{$b$ and $c$ which targets blocks $1$ and $2$.}}}\vspace{1mm}\\ \MP &= \left(\{1,4,6\}, \{2,3,6,8\}\right)\\ \mathcal{Q}' &= \left(\{8,4,6\}, \{2,3,6,1\} \right)\vspace{1mm}\\ \multicolumn{2}{l}{\tworowcell{\text{$\mathcal{Q}'$ is an exchange of $\MP$, but is not localized,} \\\text{since nodes $a$ and $c$ are not siblings.}}}\vspace{1mm}\\ \mathcal{Q}'' &= \left(\{1,4\}, \{2,3,7,8\} \right)\vspace{1mm}\\ \multicolumn{2}{l}{\tworowcell{\text{$\mathcal{Q}''$ is not an exchange of $\MP$, since both} \\\text{properties (a) and (b) are violated.}}}\\ \end{array}$}; \end{tikzpicture} \caption{An example and non-example of a localized exchange ($\mathcal{Q}$ and $\mathcal{Q}'$ respectively), and a non-example of an exchange ($\mathcal{Q}''$).}\label{f:implocex-example} \end{figure} Finally, we define an \emph{improving localized exchange} as a localized exchange $\mathcal{Q}$ in which the objective function improves over that of $\MP$. Because of the constraints imposed on a localized exchange, we only need to check four failure numbers to determine that the objective function has improved. We build this check into the definition below. \begin{definition} An \emph{improving localized exchange} of $\MP$ is a localized exchange $\mathcal{Q}$ with targets $i$ and $j$ and carriers $u$ and $v$ in which \begin{align}\label{e:implocex}\max \left[\fnum{u}{\P_i}, \fnum{u}{\P_j} \right] &> \max \left[ \fnum{u}{Q_i}, \fnum{u}{Q_j}\right], \intertext{and either} \label{e:implocex2} \max \left[\fnum{v}{\P_i}, \fnum{v}{\P_j} \right] &> \max \left[ \fnum{v}{Q_i}, \fnum{v}{Q_j}\right], \intertext{or, in the sub-multi-placement\xspace{s} of $\MP$ and $\mathcal{Q}$ at node $v$, denoted by \mbox{$\MP_v = (\P^v_1,...,P^v_m)$}, and $\mathcal{Q}_v = (Q^v_1,...,Q^v_m)$ respectively,} \label{e:implocex3} P^v_i = Q^v_j &\text { and } P^v_j = Q^v_i. \end{align} \end{definition} Note that \eqref{e:implocex} holds in every improving localized exchange, while only one of \eqref{e:implocex2} or \eqref{e:implocex3} is required to hold. To justify calling these exchanges \emph{improving}, we must prove that if an improving localized exchange exists, it constitutes a strictly better placement, which claim we state as the following lemma. \begin{lemma}\label{lem:implocex} If a multi-placement $\MP$ has an improving localized exchange $\mathcal{Q}$, then $\g{\MP} >_L \g{\mathcal{Q}}$. \end{lemma} \begin{proof} Let $\MP$ be a multi-placement with improving localized exchange $\mathcal{Q}$ with targets $i$ and $j$ and carriers $u$ and $v$. Clearly, the only nodes whose failure numbers could be different in $\mathcal{Q}$ and $\MP$ are nodes which are either ancestors or descendants of node $u$ or node $v$ (for concision, we consider nodes $u$ and $v$ to be descendants of themselves). Thus if $\g{\MP} >_L \g{\mathcal{Q}}$, as claimed, it must be due to a difference in failure number(s) which occurs among these nodes. Without loss of generality, let $a = \fnum{u}{\P_i} = \max[ \fnum{u}{\P_i}, \fnum{u}{\P_j} ] = \max [ \fnum{u}{\P_i}, \fnum{u}{\P_j}, \fnum{v}{\P_i}, \fnum{v}{\P_j}].$ First, we dispense with the descendants of nodes $u$ and $v$. Suppose that \eqref{e:implocex3} holds, then it is easy to see that $\g{\MP_v}$ and $\g{\mathcal{Q}_v}$ are equivalent, since \[\g{\MP_v} = \sum_{i=1}^m \ff{P_i^v}\stackrel{(*)}{=} \sum_{i=1}^m \ff{Q_i^v} = \g{\mathcal{Q}_v} \] where $(*)$ holds by \eqref{e:implocex3} and property (c) of an exchange. Thus, in this case, the overall contribution of descendants of $v$ to the objective value does not change, so they can be \emph{disregarded}. Moreover, since the failure number of every node is upper-bounded by the failure number(s) of its ancestor(s), for any node $w$ which is a descendant of $u$, we have that $\fnum{w}{Q_i} \leq a-1$ and $\fnum{w}{Q_j} \leq a-1$. Thus after making the exchange, the failure numbers of descendants of $u$ (with respect to blocks $i$ and $j$) can be at most $a-1$, and the descendants of $v$ can be disregarded. Suppose instead that \eqref{e:implocex2} holds. Then by combining \eqref{e:implocex} and \eqref{e:implocex2} we obtain, \begin{multline*} \max \left[\fnum{u}{Q_i}, \fnum{u}{Q_j}, \fnum{v}{Q_i}, \fnum{v}{Q_j} \right] < \\ \max \left[\fnum{u}{P_i}, \fnum{u}{P_j}, \fnum{v}{P_i}, \fnum{v}{P_j} \right] = a. \end{multline*} Thus, for any node $w$ which is a descendant of $u$ or $v$, $\fnum{w}{Q_i} \leq a-1$, and $\fnum{w}{Q_j} \leq a-1$. And so after making the exchange, the failure numbers of descendants of $u$ and $v$ w.r.t. blocks $i$ and $j$ can be at most $a-1$. To summarize, each descendant of nodes $u$ and $v$ either has failure number at most $a-1$ with respect to blocks $i$ and $j$, or can be disregarded as a node at which no improvement can occur. Next, we consider the ancestors of $u$ and $v$. Recall that $u$ and $v$ are siblings, so let $x$ be the parent of $u$ and $v$. We show that the failure number of $x$ with respect to blocks $i$ and $j$ does not change as a result of the exchange, since \begin{align*} f(x,Q_i) &= f(u,Q_i) + f(v,Q_i) + \sum_{\substack{c \in children(x)\\ u \neq c \neq v}} \fnum{c}{Q_i}\\ &= |Q^u_i \cup Q^v_i | + \sum_c \fnum{c}{Q_i} ~~~ \textit{(by definition of failure number)}\\ &= |P^u_i \cup P^v_i | + \sum_c \fnum{c}{Q_i} ~~~ \textit{(by properties (b)-(c) of an exchange)}\\ &= |P^u_i \cup P^v_i | + \sum_c \fnum{c}{P_i} ~~~ \textit{(since $\mathcal{Q}$ is localized w}/ \textit{carriers $u$ and $v$)}\\ &= f(u,P_i) + f(u, P_i) + \sum_c \fnum{c}{P_i} = f(x,P_i), \end{align*} and the sum over $c$ is everywhere understood to be constrained as in the first line of the above derivation. We can similarly show that $f(x,Q_j) = f(x,P_j)$ replacing $i$ by $j$ in the above. Since the failure number of $x$ does not change as a result of the exchange, it is easy to see that the failure numbers of all ancestors of $u$ and $v$ likewise do not change. So, for all $k \leq \rho - a$, $\g{\MP}_k = \g{\mathcal{Q}}_k$. Moreover, by \eqref{e:implocex}, it is easy to see that $\g{\MP}_{\rho - a} > \g{\mathcal{Q}}_{\rho - a}$, since at least the failure number of $u$ strictly decreases as a result of the exchange, and $f(u,P_i) = a$. Thus $\g{\MP} >_L \g{\mathcal{Q}}$. \qed \end{proof} This lemma comes in handy when proving theorems about optimal multi-placements by allowing us to construct an improving localized exchange to demonstrate the existence of a better placement. We apply it to prove the following theorems about optimal multi-placements. \begin{theorem}\label{t:delta-skew} In every optimal multi-placement $\MP = \langle P_1, ..., P_m \rangle$ with skew at most $\delta > 0$, for every node $u$, the sub-multi-placement\xspace $\MP_{u}$ has skew at most $\delta$. \end{theorem} \begin{proof} Suppose that in an optimal multi-placement with skew $\delta$, some node has a sub-multi-placement\xspace with skew strictly greater than $\delta$. Let $u$ be a least depth such node. Node $u$ cannot be the root, because if it were then $\MP$ would have a skew greater than $\delta$, contradicting the assumption made in the statement of the theorem. Therefore node $u$ has a parent, which we will denote by $w$. Because $u$ was chosen to be least depth, sub-multi-placement\xspace $\MP_w$ must have a skew of at most $\delta$. In order for sub-multi-placement\xspace $\MP_u$ to have skew strictly greater than $\delta$, there must exist blocks $i$ and $j$ of $\MP$ for which $\fnum{u}{P_i} = a$, and \mbox{$\fnum{u}{P_j} \leq a - \delta - 1$}. Because $\MP_w$ has skew $\delta$, the skew must be corrected by some sibling of $u$, denoted by $v$, for which $\fnum{v}{P_i} \leq b-1$ and $\fnum{v}{P_j} = b$. If no such sibling exists then node $w$ must have a skew of at least $\delta+ 1$, contradicting that $u$ was chosen to have least depth. We will proceed in two cases. In each case, we will construct an improving localized exchange $\mathcal{Q} = \langle Q_1, ..., Q_m\rangle$ with target blocks $i$ and $j$ and carriers $u$ and $v$. \begin{enumerate}[{Case} 1)] \item If $\fnum{v}{P_i} = b-1$ then form $Q_i$ and $Q_j$ by swapping all of node $v$'s replicas which are in block $i$ with all of node $v$'s replicas which are in block $j$. Clearly, this swap satisfies \eqref{e:implocex3}. After making this swap, the signature of $\mathcal{Q}$ will no longer match that of $\MP$, which is a violation of property (b) of an exchange. To maintain property (b), we take one replica from block $i$ which is placed on child $u$ and give it to block $j$. Below we summarize the result of this exchange. \begin{align*} &\MP : && \fnum{u}{P_i} = a && \fnum{u}{P_j} \leq a - \delta - 1 \\ & \mathcal{Q} : && \fnum{u}{Q_i} = a - 1 && \fnum{u}{Q_j} \leq a - \delta \end{align*} Clearly, the maximum failure number in the top row is strictly greater than the maximum failure number in the bottom row, and thus $\mathcal{Q}$ is an improving localized exchange of $\MP$ which satisfies equations \eqref{e:implocex} and \eqref{e:implocex3}. Thus, by \autoref{lem:implocex}, $\MP$ is not an optimal multi-placement, a contradiction. \item If instead $\fnum{v}{P_i} < b-1$, then we must form $\mathcal{Q}$ differently. In this scenario, $\fnum{v}{P_i} \leq b-2$. We swap one of node $v$'s replicas from block $j$ to block $i$. As a result, $\fnum{v}{Q_i} \leq b-1$ and $\fnum{v}{P_j} = b-1$. To maintain property (b), we swap one of node $u$'s replicas from block $i$ to block $j$, exactly as in the previous case. Below we summarize the result of this exchange. \begin{align*} &\MP : && \fnum{u}{P_i} = a && \fnum{u}{P_j} \leq a - \delta - 1 && \fnum{v}{P_i} \leq b - 2 && \fnum{v}{P_j} = b \\ & \mathcal{Q} : && \fnum{u}{Q_i} = a - 1 && \fnum{u}{Q_j} \leq a - \delta && \fnum{v}{Q_i} \leq b-1 && \fnum{v}{Q_j} = b-1 \end{align*} It is easy to see by inspection that the resulting exchange is an improving localized exchange satisfying \eqref{e:implocex} and \eqref{e:implocex2}. Thus $\mathcal{Q}$ is an improving localized exchange, and we obtain a contradiction via \autoref{lem:implocex}.\qed \end{enumerate} \end{proof} \begin{comment} \autoref{t:delta-skew} implies that the set of multi-placements whose sub-multi-placement\xspace{s} each have skew at most $\delta$ \emph{always contains optimal solutions.} In other words, a correct multi-placement optimization algorithm can restrict its search to this subset of multi-placements and still find a \emph{global} optimum. This is exactly what our algorithm does. For each signature $\vec{\sigma}$ with skew at most $\delta$, we recursively find the objective values of optimal sub-multi-placement\xspace{s} with signature $\vec{\sigma}$ at every node $u$. The particulars are the subject of the next section. \end{comment} Note that \autoref{t:delta-skew} restricts the structure of an optimal solution. However, \autoref{t:delta-skew} by itself is not sufficient to infer that a bottom-up dynamic program can restrict its attention to only signatures with bounded skews. This is because a dynamic program typically needs to maintain partial results (e.g., best combination of signatures of a \emph{subset} of children at a node) as it works its way towards finding an optimal solution. We need to show that even these partial results satisfy the same structure as an optimal solution, namely signatures in partial results also have bounded skews. This is the focus of the next theorem. In order to clearly state the theorem, we introduce some notation for combining multi-placements $\MP = (P_1, ..., P_m)$ and $\MP' = (P_1',...,P_m')$. Specifically, we define the \emph{direct sum} of two multi-placements as \mbox{$\MP \oplus \MP' = (P_1 \cup P_1' ,..., P_m \cup P_m')$}. Associativity and commutativity of $\oplus$ easily follow from that of set union. \begin{theorem}\label{t:skew-ordering} Fix an arbitrary linear order, $\prec$, on the nodes of tree $T$. For any choice of signature $\vec{\sigma}$ having skew $\delta$, there exists an optimal multi-placement $\MP^\ast$ with signature $\vec{\sigma}$ in which, for every node $u$ having children $c_1,...,c_t$, where $c_1 \prec c_2 \prec ... \prec c_t$, and for all values of $s \in \{1,...,t\}$, we have that \begin{equation*} \bigoplus_{j=1}^s \MP^\ast_{c_j} \text{ has skew at most $\delta$}. \end{equation*} \end{theorem} The previous two theorems imply that any optimal solution with a signature of skew at most $\delta$ can be constructed from signatures whose skews are also upper-bounded by $\delta$. Moreover, the \emph{order} in which we combine the partial results from the children to construct a partial result at the parent is not relevant. No matter how the children of a node are ordered, a route to an optimum multi-placement which uses only partial results obtained using signatures with skew at most $\delta$ exists. To prove \autoref{t:skew-ordering}, we will require the technical lemma stated below. \begin{lemma}\label{c:skew-ordering} Let $u$ be the root of tree $T$, and let $u$ have children given in the arbitrary order $c_1,...,c_t$. Then, for every choice of signature $\vec{\sigma}$ with skew $\delta$, there is an optimal multi-placement $\MP^\ast = (P^\ast_1, ..., P^\ast_m)$ with signature $\vec{\sigma}$ in which for all values of $s \in \{1,...,t\}$, \begin{equation}\label{eq:dirsum-skew-delta} \bigoplus_{j=1}^s \MP^\ast_{c_j} \text{ has skew at most $\delta$}. \end{equation} \end{lemma} Once established, it is clear that this lemma can be used to easily show \autoref{t:skew-ordering} by applying \autoref{c:skew-ordering} at the root, and then recursively at each of the subtrees formed by descendants of the children of the root. In this manner, once \autoref{c:skew-ordering} is established, one can easily show \autoref{t:skew-ordering} by structural induction. Thus, we will focus on proving \autoref{c:skew-ordering}. \begin{proof}[\autoref{c:skew-ordering}] The proof is by construction. We show that any optimal multi-placement that does not satisfy the statement of the theorem can be transformed into another optimal multi-placement that satisfies the statement of the theorem using a series of exchanges. In our proof, we will need to refer to several sub-multi-placement\xspace{s} of $\MP$ and their constituent placements. We refer to the multi-placement $\bigoplus_{j=1}^k \MP_{c_j}$ as the \emph{partial multi-placement of $\MP$ up to $k$}. But we also need a concise symbol which refers to the replicas from the multi-placement $\bigoplus_{j=1}^k \MP_{c_j}$ which are in block $i$ and are placed on the subtree of $T$ rooted at node $v$. We will denote this set of replicas by $P_{k,i}^v$, and refer to it as a placement. Note that we can refer to placement $\MP$ as ``sub-multi-placement\xspace{"} $\MP_u$ without causing confusion and, having done so, it is also clear that we can refer easily to each of its constituent placements, since $\MP= \MP_u = \bigoplus_{j=1}^t \MP_{c_j} = (P^u_{t,1}, ..., P^u_{t,m})$. Our argument focuses on constructing an exchange $\mathcal{Q}$. We will use the symbol $\Q_{k,i}^v$ to refer to the same portion of $\mathcal{Q}$ that $\P_{k,i}^v$ refers to. Consider an optimal multi-placement $\MP$ with \signature{} $\vec{\sigma}$. If $\MP$ satisfies the statement of the theorem, then the theorem clearly holds. Otherwise, we show how to construct an exchange that takes us ``closer to our goal" by reducing the skew between a pair of ``offending" blocks to at most $\delta$. By repeatedly performing such exchanges, we can eventually construct another optimal multi-placement with the same \signature{} $\vec{\sigma}$ that satisfies the statement of the theorem. To that end, let $k$ be the minimum value such that \[ \bigoplus_{j=1}^k \MP_{c_j} \text{ has skew at least $\delta + 1$} \] Since $\bigoplus_{j=1}^k\MP_{c_j}$ has a skew of at least $\delta + 1$ there must exist blocks $i$ and $j$ such that \begin{equation}\label{e:root-bound} |\fnum{u}{\P_{k,i}^u} - \fnum{u}{P_{k,j}^u}| > \delta \end{equation} There may be multiple candidate block pairs $(i,j)$ for which the above statement holds. Let the set of such pairs be denoted by \[ pairs(k) = \{(i,j) : i < j \text{ and } \left|\fnum{u}{\P_{k,i}^u} - \fnum{u}{\P_{k,j}^u} \right| > \delta) \}. \] \punt{ To prove the theorem, we will show how to construct an exchange $\mathcal{Q}$ in which one of the two conditions holds: \begin{enumerate}[a)] \item $\mathcal{Q}$ is an improving localized exchange of $\MP$, thereby contradicting optimality of $\MP$ via \autoref{lem:implocex}. \item $\mathcal{Q}$ is an exchange of $\mathcal{P}$ for which the statement of the theorem holds. \end{enumerate} If at any point we construct an exchange which satisfies condition (a), we will have constructed an exchange whose existence contradicts the optimality of $\mathcal{P}$, via \autoref{lem:implocex}. Likewise, if at any point we have constructed an exchange which satisfies condition (b), the proof will be complete. To do this, we visit each of the pairs in $pairs(k)$ in lexicographic order. For each pair, we form an exchange $\mathcal{Q}$ which is either \begin{enumerate}[i)] \item an improving localized exchange of $\MP$, or \item a localized exchange in which \mbox{$|\fnum{u}{\P_{k,i}^u} - \fnum{u}{\P_{k,j}^u} | \leq \delta$}, and \mbox{$\g{\mathcal{Q}} = \g{\MP}$}. \end{enumerate} Clearly, if condition (i) is achieved after visiting some pair, then we have achieved condition (a), thereby completing the construction. If instead case (ii) is achieved, we will have constructed an exchange in which the pair $(i,j)$ has been removed from $pairs(k)$, and, as we will show, does not add any \emph{previously visited} pairs to any set $pairs(k')$ where $k' \leq k$. Moreover, since in case (ii) $\g{\MP} = \g{\mathcal{Q}}$ the exchange so constructed is also an optimal solution, by optimality of $\MP$. If after constructing an exchange via case (ii) we find that $pairs(k)$ is empty, we will move to the next smallest value of $k' > k$ for which $pairs(k')$ is non-empty and visit the lexico-minimum pair in this set. If no value of $k'$ is found for which $pairs(k')$ is non-empty, then $\mathcal{Q}$ must be an exchange for which $pairs(j)$ is empty for all values of $j$. Moreover, since the optimality of $\MP$ will have never been contradicted (otherwise we would have ended the construction) $\mathcal{Q}$ will be an optimal solution, thus satisfying the statement of the theorem, and ending the construction by achieving condition (b). We now proceed with the proof, which will progress according to the outline described above. } Let $(i,j)$ be the lexico-minimum element in $pairs(k)$. Since this block pair does not have a skew of $\delta$, clearly, one of two statements must be true. For some value of $a$, we have either \begin{align} \fnum{u}{P_{k,i}^u} &= a, & \fnum{u}{P_{k,j}^u} &\leq a - \delta - 1,\label{eq:lmin-case1}\\ \intertext{or,} \fnum{u}{P_{k,i}^u} &\leq a -\delta - 1, & \fnum{u}{P_{k,j}^u} &= a.\label{eq:lmin-case2} \end{align} both of which follow easily from \eqref{e:root-bound}. In certain cases of this argument we can assume one of \eqref{eq:lmin-case1} or \eqref{eq:lmin-case2} without loss of generality, but in others we must deal with each separately. First, notice that since each of the child sub-multi-placement\xspace{s} are disjoint, for any value of $k \in \{1,...,t\}$, we must have that \begin{equation}\label{e:disjoint-decomp} \fnum{u}{\P_{k,i}^u} = \sum_{j=1}^k \fnum{c_j}{\P_{k,i}^{c_j}}. \end{equation} We will appeal to this fact at several points in the sequel. Suppose that \eqref{eq:lmin-case1} holds. Then, since $k$ was chosen to be minimum, it must be the case that \[ \fnum{c_k}{\P_{k,i}^{c_k}} = b ~\text{ and }~ \fnum{c_k}{\P_{k,j}^{c_k}} \leq b-1, \] since otherwise, by the decomposition of \eqref{e:disjoint-decomp}, it is not possible both for \eqref{e:root-bound} to hold and for $k$ to be minimum. Moreover, since the overall skew of $\MP$ is no greater than $\delta$, there must be some child $c_\ell$ with $k < \ell$ which fixes the skew w.r.t. blocks $i$ and $j$. That is, at child $c_\ell$ we must have that \[ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} \leq d-1 ~\text { and }~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d. \] Symmetric statements hold when \eqref{eq:lmin-case2} holds instead of \eqref{eq:lmin-case1}. We will defer their statement until they are needed. We proceed in four cases, based upon which of the upper bounds involving $b$ and $d$ are tight. In the first three cases (Cases 1-3) we use \autoref{lem:implocex} to derive a contradiction. In the fourth case (Case 4) we remove the pair $(i,j)$ from $pairs(k)$ while not adding any previously visited pairs to $pairs(k')$ for any $k' \leq k$, thereby moving closer to our goal. We can treat Cases 1-3 by assuming that \eqref{eq:lmin-case1} holds without loss of generality. In each of these cases, a symmetric argument applies when \eqref{eq:lmin-case2} is true. The same symmetry does not apply in Case 4, which must be handled more carefully depending on which of equations \eqref{eq:lmin-case1} or \eqref{eq:lmin-case2} holds. \begin{enumerate}[{Case} 1)] \item \mbox{$\fnum{c_k}{\P_{k,i}^{c_k}} = b ~;~ \fnum{c_k}{\P_{k,j}^{c_k}} \leq b - 2 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d-1 ~;~ \fnum{c_\ell}{\MP_{k,j}^{c_\ell}} = d$}.\vspace{2mm} In this case we construct $\mathcal{Q}$, an improving localized exchange of $\MP$ with target blocks $i$ and $j$ and carriers $c_k$ and $c_\ell$ as follows. First, we swap the indices of blocks $i$ and $j$ by setting $Q_{k,i}^{c_\ell} = \P_{k,j}^{c_\ell}$ and $Q_{k,j}^{c_\ell} = \P_{k,i}^{c_\ell}$. This effectively adds a replica to block $i$ and removes a replica from block $j$. To fix the signature, we move one of $c_k$'s replicas from block $i$ to block $j$. The result is summarized as\vspace{2mm} \mbox{$\fnum{c_k}{Q_{k,i}^{c_k}} = b -1 ~;~ \fnum{c_k}{Q_{k,j}^{c_k}} \leq b - 1 ~;~ Q_{k,i}^{c_\ell} = \P_{k,j}^{c_\ell} ~;~ Q_{k,j}^{c_\ell} = \P_{k,i}^{c_\ell}$}.\vspace{2mm} Thus $\mathcal{Q}$ is an improving localized exchange of $\MP$, and the construction is complete.\vspace{2mm} \item \mbox{$\fnum{c_k}{\P_{k,i}^{c_k}} = b ~;~ \fnum{c_k}{\P_{k,j}^{c_k}} = b - 1 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} \leq d-2 ~;~ \fnum{c_\ell}{\MP_{k,j}^{c_\ell}} = d$}.\vspace{2mm} This case is entirely symmetric to the prior one. We do with the replicas of $c_k$ what we we did in the prior case with the replicas of $c_\ell$ and vice versa. The result is summarized as\vspace{2mm} \mbox{$ Q_{k,i}^{c_k} = \P_{k,j}^{c_k} ~;~ Q_{k,j}^{c_k} = \P_{k,i}^{c_k} ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} \leq d -1 ~;~ \fnum{c_\ell}{Q_{k,j}^{c_\ell}} = d - 1 $}\vspace{2mm} Thus $\mathcal{Q}$ is an improving localized exchange of $\MP$, and the construction is complete.\vspace{2mm} \item \mbox{$\fnum{c_k}{\P_{k,i}^{c_k}} = b ~;~ \fnum{c_k}{\P_{k,j}^{c_k}} \leq b - 2 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} \leq d-2 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d$}.\vspace{2mm} In this case, we move one of $c_k$'s replicas from block $i$ to block $j$ and move one of $c_\ell$'s replicas from block $j$ to block $i$. This is summarized as\vspace{2mm} \mbox{$\fnum{c_k}{Q_{k,i}^{c_k}} = b-1 ~;~ \fnum{c_k}{Q_{k,j}^{c_k}} \leq b - 1 ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} \leq d-1 ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} = d-1$}.\vspace{2mm} Thus $\mathcal{Q}$ is an improving localized exchange of $\MP$, and the construction is complete.\vspace{2mm} \item We split into two cases. \begin{enumerate}[{Case 4}a)] \item In this case \eqref{eq:lmin-case1} holds. Recall this means that \[\fnum{u}{P_{k,i}^u} = a ~;~ \fnum{u}{P_{k,j}^u} \leq a - \delta - 1,\] implying that we must have \[\fnum{c_k}{\P_{k,i}^{c_k}} = b ~;~ \fnum{c_k}{\P_{k,j}^{c_k}} = b - 1 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d-1 ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d.\] Furthermore, we must have equality where \mbox{$\fnum{u}{P_{k,j}^u} = a - \delta - 1$}, which we shall argue as follows. Suppose for the purpose of obtaining a contradiction that \mbox{$\fnum{u}{P_{k,j}^u} < a - \delta - 1 \implies \fnum{u}{P_{k,j}^u} \leq a - \delta - 2$}. Then, since by \eqref{e:disjoint-decomp}, we know $\fnum{u}{P_{k,j}^u} = \fnum{u}{P_{k-1,j}^{u}} + \fnum{c_k}{P_{k,j}^{c_k}}$, we obtain \begin{equation}\label{eq:equality-contra1} \fnum{u}{P_{k-1,j}^u} \leq a - \delta - b - 1. \end{equation} But by \eqref{e:disjoint-decomp}, we can similarly obtain that $\fnum{u}{P_{k,i}^u} = \fnum{u}{P_{k-1,i}^{u}} + \fnum{c_k}{P_{k,i}^u}$, which implies that \begin{equation}\label{eq:equality-contra2} \fnum{u}{P_{k-1,i}^u} = a - b. \end{equation} But \eqref{eq:equality-contra1} and \eqref{eq:equality-contra2} together imply that $(i,j) \in pairs(k-1)$, contradicting that $k$ was chosen to be minimum. Thus $\fnum{u}{P_{k,j}^u} = a - \delta - 1$. In this case, we construct $\mathcal{Q}$, a localized exchange of $\MP$ which removes $(i,j)$ from $pairs(k)$. We construct $\mathcal{Q}$ by swapping all replicas of block $i$ with block $j$ at both child $c_k$ and $c_\ell$. Specifically, we set $Q_{k,i}^{c_k} = P_{k,j}^{c_k}$, $Q_{k,j}^{c_k} = Q_{k,i}^{c_k}$, $Q_{k,i}^{c_\ell} = P_{k,j}^{c_\ell}$, and $Q_{k,j}^{c_\ell} = P_{k,i}^{c_\ell}$ Thus, clearly $\g{\mathcal{Q}} = \g{\MP}$ as observed in the argument used to prove \autoref{lem:implocex}. This removes $(i,j)$ from $pairs(k)$, since, when we swap the replicas of blocks $i$ and $j$ at child $c_k$, we effectively decrement the failure number w.r.t. block $i$ by 1 and increment the failure number w.r.t. block $j$ by 1. Thus, the exchange $\mathcal{Q}$ is summarized as \begin{gather*}\fnum{u}{Q_{k,i}^u} = a -1 ~;~ \fnum{u}{Q_{k,j}^u} = a - \delta ~;~\\ \fnum{c_k}{Q_{k,i}^{c_k}} = b -1 ~;~ \fnum{c_k}{Q_{k,j}^{c_k}} = b ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} = d ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} = d-1. \end{gather*} The first line clearly implies $(i,j) \notin pairs(k)$. Now we need to show that this exchange does not add any previously visited pairs to $pairs(k')$ for any $k' \leq k$. If $k' < k$, then this is easily seen, since the only sub-multi-placement\xspace{s} affected by the exchange are those at $c_k$ and $c_\ell$, and $k' < k < \ell$. We must do some more work to show that no previously visited pairs are added to $pairs(k)$. That is to say, we must show that any pair $(x,y) <_L (i,j)$ is not added to $pairs(k)$ by the exchange. It is clear that only pairs for which $x = i$ or $y \in \{i,j\}$ might be added, since only blocks $i,j$ are affected by the exchange, and if $x = j$ then $(j,y) \not<_L (i,j)$ as required. Since $(i,j)$ was the lexicographically smallest element of $pairs(k)$, we know that our bounds on the skew must hold for all block pairs $(x,y)$ which are lexicographically smaller. This allows us to derive bounds on the possible values of $\fnum{u}{P_{k,x}^u}$ and $\fnum{u}{P_{k,y}^u}$ which will make it clear that no previously visited pairs are added by the exchange. Since $(x,j) <_L (i,j)$ for values of $x < i$, we obtain that \mbox{$\fnum{u}{P_{k,x}^u} \leq \fnum{u}{P_{k,j}^u} + \delta \leq a - 1 $}, since otherwise the block pair $(x,j)$ would be in $pairs(k)$, implying $(i,j)$ was not the lexico-minimum. Likewise, since $(x,i) <_L (i,j)$ we obtain that \mbox{$\fnum{u}{P_{k,x}^u} \geq \fnum{u}{P_{k,i}^u} - \delta = a - \delta$.} Thus \mbox{$\fnum{u}{P_{k,x}^u} \in [a - \delta , a - 1]$}. We similarly bound $\fnum{u}{P_{k,y}^u}$ for values of $y$ where $i < y < j$ as follows. Since $(i,y) <_L (i,j)$, we have that $\fnum{u}{P_{k,y}^u} \leq a - \delta$. Since, for any value of $x < i$, $(x,y) <_L (i,j)$ we know that $\fnum{u}{P_{k,y}^u} \leq \fnum{u}{P_{k,x}^u} + \delta \leq a + \delta - 1$. Thus $\fnum{u}{P_{k,y}^u} \in [a-\delta, a+\delta - 1]$. Since $P_{k,x}^u = Q_{k,x}^u$ and $P_{k,y}^u = Q_{k,y}^u$ for all values of $x$ and $y$, we can show that, after the exchange, \begin{enumerate}[I)] \item $(x,i) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,x}^u} \in [a-\delta, a-1]$} and \mbox{$\fnum{u}{Q_{k,i}^u} = a-1$}. \item $(x,j) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,x}^u} \in [a-\delta, a-1]$} and \mbox{$\fnum{u}{Q_{k,j}^u} = a - \delta$.} \item $(i,y) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,y}^u} \in [a-\delta, a+ \delta-1]$}, and $\fnum{u}{Q_{k,i}^u} = a-1$. \end{enumerate} Since previously visited pairs of $pairs(k)$ are one of (I), (II), or (III), no such pairs are added. \item If instead \eqref{eq:lmin-case2} holds then the same argument used in the prior case to show that equality holds in \eqref{eq:lmin-case1} also applies to \eqref{eq:lmin-case2}, where the roles of $i$ and $j$ are reversed. Thus, we have \[\fnum{u}{P_{k,i}^u} = a -\delta - 1 ~;~ \fnum{u}{P_{k,j}^u} = a,\] implying that we must have \[\fnum{c_k}{\P_{k,i}^{c_k}} = b-1 ~;~ \fnum{c_k}{\P_{k,j}^{c_k}} = b ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d ~;~ \fnum{c_\ell}{\P_{k,i}^{c_\ell}} = d-1.\] The exact same exchange is formed using the exact same operations used in the prior case, except that this exchange is now summarized as \begin{gather*}\fnum{u}{Q_{k,i}^u} = a -\delta ~;~ \fnum{u}{Q_{k,j}^u} = a - 1 ~;~\\ \fnum{c_k}{Q_{k,i}^{c_k}} = b ~;~ \fnum{c_k}{Q_{k,j}^{c_k}} = b -1 ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} = d-1 ~;~ \fnum{c_\ell}{Q_{k,i}^{c_\ell}} = d. \end{gather*} Under these conditions we show that no previously visited pairs are added to $pairs(k)$ as follows. First, we bound values of $\fnum{u}{P_{k,x}^u}$ and $\fnum{u}{P_{k,y}^u}$ when $x = i$ or $y \in \{i,j\}$ below. When $(x,i) <_L (i,j)$, we obtain that $\fnum{u}{P_{k,x}^u} \leq a$. Likewise, when $(x,j) <_L (i,j)$, we obtain that $\fnum{u}{P_{k,x}^u} \geq a - \delta$. Similarly, when $(i,u) <_L (i,j)$, we obtain that $\fnum{u}{P_{k,y}^u} \leq a-1$. And finally, when $(x,y) <_L (i,j)$, we obtain that $\fnum{u}{P_{k,y}^u} \geq a - 2\delta$. Thus, after the exchange we can show that \begin{enumerate}[I)] \item $(x,i) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,x}^u} \in [a-\delta, a]$} and $\fnum{u}{Q_{k,i}^u} = a-\delta$. \item $(x,j) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,x}^u} \in [a-\delta, a]$} and $\fnum{u}{Q_{k,j}^u} =$ \mbox{ $a - 1$}. \item $(i,y) \notin pairs(k)$, since \mbox{$\fnum{u}{Q_{k,y}^u} \in [a-2\delta, a-1]$}, and $\fnum{u}{Q_{k,i}^u} = a-\delta$. \end{enumerate} Thus in this case also, previously visited pairs are not added back to $pairs(k)$. \end{enumerate} \end{enumerate} We can perform such exchanges repeatedly to remove all pairs from $pairs(k)$. In other words, by repeatedly performing such exchanges, we can ensure that $pairs(1)$, $pairs(2)$, $\ldots$, $pairs(t)$ all become empty at which point we will obtain an optimal multi-placement that satisfies \eqref{eq:dirsum-skew-delta}. The theorem is thus proved. \qed \end{proof} \subsection{An Exact Algorithm for Optimal Multi-placements}\label{s:mp-algorithm} \begin{comment} In the previous section, we present \autoref{alg:phi-table} for basically generating all possible \signature{s} with skew at most $\delta$ that can be derived by combining two given \signature{s} both of which have skew at most $\delta$. For a constant $\delta$, the algorithm has polynomial time and space complexities. We use this algorithm as a sub-routine in our dynamic program for solving the optimal multi-placement problem for a given skew value. \end{comment} Our algorithm for finding an optimal multi-placement is a bottom-up dynamic program. It uses the following key properties to achieve the desirable running time. First, as mentioned earlier, the optimal value of the objective function of a multi-placement only depends on its signature (by \autoref{lem:signature-solution}). This implies that the state information maintained by our dynamic program is a function of signature and not multi-placement. Second, it is sufficient to only consider those signatures whose skews are upper-bounded by the skew of the desired multi-placement (by \autoref{t:delta-skew} and \autoref{t:skew-ordering}). This further implies that the state information maintained by our dynamic program is a function of a signature with bounded skew. \begin{comment} Observe that, among all sub-multi-placement\xspace{s} sharing the same signature, the optimal solutions all have the same value for the failure aggregate. Thus, \end{comment} For each node of the tree, we maintain a dynamic programming table in which, for each signature $\vec{\sigma}$ with skew $\delta$, we store $G_u(\vec{\sigma})$, the optimal value of any sub-multi-placement\xspace at node $u$ which has signature $\vec{\sigma}$. Given completely filled out tables for every child of $u$, we show how to combine the results to obtain a filled table for $u$ itself in \autoref{s:mp-dp}. Once filled out, the table for $u$ will contain the optimal solution, since a ``sub-multi-placement\xspace{"} of the root is a multi-placement. As we shall see shortly, we will need to understand how the signature is affected when two disjoint multi-placements are combined. Two signatures $\vec{\sigma}_1$ and $\vec{\sigma}_2$ can be combined to form signature $\vec{\sigma}$ only if two disjoint multi-placements with signatures $\vec{\sigma}_1$ and $\vec{\sigma}_2$ can be combined to yield a multi-placement with signature $\vec{\sigma}$. As an example, consider the signatures $\vec{\sigma}_1 = \langle 0,3,1\rangle$ and \mbox{$\vec{\sigma}_2 = \langle 0,2,2 \rangle$}. These signatures can be combined to yield the signature $\vec{\sigma} = \langle2,1,1\rangle$. To see this, notice that we can combine disjoint multi-placements $\MP_1$ and $\MP_2$ with signatures $\vec{\sigma}_1$ and $\vec{\sigma}_2$ to yield a multi-placement $\MP$ with signature $\vec{\sigma}$, by doing the following. Combine two placements of size $1$ from $\MP_1$ with two placements of size $1$ from $\MP_2$. This yields the two placements of size $2$ in $\vec{\sigma}$. To obtain the single placement of size $1$, combine one placement of size $1$ from $\MP_1$ with the empty placement in $\MP_2$. Finally, the remaining empty placements are combined to yield the empty placement in $\vec{\sigma}$. In general, there may be multiple ways to combine two signatures, each of which may yield a different signature as a result. \begin{comment} By \autoref{t:delta-skew} and \autoref{t:skew-ordering}, we only need to focus on signatures which have skews at most $\delta$. This also implies that we will only ever be required to \emph{combine} two signatures of children with skews at most $\delta$. \end{comment} In \autoref{s:combo-signatures} we give an algorithm to compute $\Phi(\vec{\sigma}, \delta)$, the set of all signature pairs which can be combined to yield $\vec{\sigma}$, which has skew $\delta$, in which both signatures in the pair \emph{also} have skew at most $\delta$. Suppose that $u$ and $v$ are the only children of $w$. Then $\Phi(\vec{\sigma}, \delta)$ provides the mapping that we use to compute the value of $G_w(\vec{\sigma})$. Roughly speaking, for every pair ($\vec{\sigma}_1, \vec{\sigma}_2) \in \Phi(\vec{\sigma}, \delta)$ our algorithm uses the values in $G_u(\vec{\sigma}_1)$ and $G_v(\vec{\sigma}_2)$ to update the value in $G_w(\vec{\sigma})$. Because $\Phi(\vec{\sigma},\delta)$ enumerates all possible signature pairs which can be combined to yield $\vec{\sigma}$, by considering every pair in $\Phi(\vec{\sigma}, \delta)$ we consider all possible ways to combine optimal sub-multi-placement\xspace{s} at $u$ and $v$ to yield a sub-multi-placement\xspace at $w$ which has signature $\vec{\sigma}$. The optimal sub-multi-placement\xspace at $w$ will be comprised of one such pair. To ensure we attain the optimum, we try all pairs. Our algorithm starts by computing a table of values of $\Phi(\vec{\sigma}, \delta)$ for all values of $\vec{\sigma}$ (recall that $\delta$ is fixed and given as input). An algorithm to compute this table is described in \autoref{s:combo-signatures}. The dynamic program itself is described in \autoref{s:mp-dp}. Briefly, the dynamic program fills tables of $G_u(\vec{\sigma})$ for all nodes $u$ and signatures $\vec{\sigma}$ by visiting each edge of the tree according to a modified post-order traversal. Each visited edge combines two previously unconnected portions of the tree. When each edge is visited, we update the dynamic programming table associated with the parent node of the edge in question, using the table of values for $\Phi$ to determine how the cells in the dynamic programming table of $G_u(\vec{\sigma})$ are combined. Once the table for the root node has been filled, we can obtain the optimal solution in the usual way by examining a record of the dynamic programming computation. \subsubsection{Combining Signatures with Bounded Skew}\label{s:combo-signatures} Given a signature $\vec{\sigma}$ with skew at most $\delta$, we wish to find all signatures $\vec{\sigma}'$ and $\vec{\sigma}''$, each with skew at most $\delta$ which can be combined to yield $\vec{\sigma}$. Every such combination can be expressed by a positive integer matrix as follows. Let $x_{ij}$ be the number of placements with size $\rho - i$ from $\vec{\sigma}'$ which are combined with placements of size $\rho - j$ from $\vec{\sigma}''$ where $i,j \in \{0,...,\rho\}$ (note we use the convention that matrix rows and columns are zero-indexed). Since no more than $\vec{\sigma}'_i$ placements of size $\rho - i$ can be taken from $\vec{\sigma}'$, we have that $\vec{\sigma}'_i = \sum_j x_{ij}$. Likewise, we have that $\vec{\sigma}''_j = \sum_i x_{ij}$, since no more than $\vec{\sigma}''_j$ placements of size $j$ can be taken from $\vec{\sigma}''$s. Furthermore, we must have exactly as many placements in $\vec{\sigma}'$ and $\vec{\sigma}''$ as we do in $\vec{\sigma}$, that is, \[\sum_{i=0}^{\rho} \vec{\sigma}_i' = \sum_{i=0}^{\rho} \vec{\sigma}_i'' = \sum_{i=0}^{\rho}\sum_{j=0}^\rho x_{ij} = \sum_{i=0}^{\rho} \vec{\sigma}_i = \m. \] Finally, the values of $x_{ij}$ must combine to yield $\vec{\sigma}$. Since when placements of sizes $\rho - i$ and $\rho - j$ are combined they yield one of size $2\rho - i - j$. Setting $2 \rho - i - j = \rho - k$, we have $\rho +k = i+j$, and thus \[\vec{\sigma}_{k} = \sum_{(i,j) : i + j = \rho + k } x_{ij}. \] For fixed $k$, the above sum ranges over the anti-diagonals\footnote{An anti-diagonal of a square matrix is a set of cells $x_{ij}$ for which $i+j=k$, for some fixed $k$.} of a matrix formed by the entries of $x_{ij}$. Thus, the vectors $\vec{\sigma}$, $\vec{\sigma}'$, and $\vec{\sigma}''$ can each be seen to arise from the row, column, and the \emph{last} $\rho + 1$ anti-diagonal sums, respectively, of a non-negative $(\rho + 1) \times (\rho + 1)$ integer matrix $X$, where the sum of all entries in $X$ is $m$. An example matrix $X$ and its relationship to $\vec{\sigma}$, $\vec{\sigma}'$ and $\vec{\sigma}''$ is depicted in \autoref{fig:integer-matrix-example}. \begin{figure} \centering \begin{subfigure}{0.48\linewidth} \begin{tikzpicture}[diagonal/.style={color=gray!30!white, line width=2pt}] \pgfdeclarelayer{bg} \pgfsetlayers{bg,main} \matrix (m) [matrix of math nodes, nodes in empty cells, right delimiter={]}, left delimiter ={[}] { 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 & 2 & 2 \\ 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ } ; \matrix (sigprimeprime) [matrix anchor= north west, matrix of math nodes, nodes in empty cells, xshift=0.5cm] at (m.north east) { 0 \\ 0 \\ 2 \\ 5 \\ 2 \\ 0 \\ } ; \node [left=-0.05cm of sigprimeprime-1-1] {$\langle$}; \node [right=-0.05cm of sigprimeprime-6-1.east] {$\rangle = \vec{\sigma}''$}; \matrix (sigprime) [matrix anchor=south west, matrix of math nodes, nodes in empty cells] at (m.north west) { 0 & 0 & 0 & 2 & 4 & 3 & \rangle \\ } ; \node[left=-0.1cm of sigprime] {$\vec{\sigma}' = \langle $}; \matrix (sigma) [matrix anchor = north west, matrix of math nodes, nodes in empty cells, xshift=-0.75cm] at (m.south west) { 0 & 2 & 4 & 3 & 0 & 0 & \rangle \\ } ; \node [left=-0.1cm of sigma] {$\vec{\sigma} = \langle$}; \begin{pgfonlayer}{bg} \draw[diagonal] (m-1-6.north east) -- (sigma-1-1.north east); \draw[diagonal] (m-2-6.north east) -- (sigma-1-2.north east); \draw[diagonal] (m-3-6.north east) -- (sigma-1-3.north east); \draw[diagonal] (m-4-6.north east) -- (sigma-1-4.north east); \draw[diagonal] (m-5-6.north east) -- (sigma-1-5.north east); \draw[diagonal] (m-6-6.north east) -- (sigma-1-6.north east); \end{pgfonlayer} \draw[dashed] (m-3-4.north west) rectangle (m-5-6.south east); \end{tikzpicture} \subcaption{}\label{f:matrix1} \end{subfigure} \begin{subfigure}{0.48\linewidth}\begin{tikzpicture}[diagonal/.style={color=gray!30!white, line width=2pt}] \pgfdeclarelayer{bg} \pgfsetlayers{bg,main} \matrix (m) [matrix of math nodes, nodes in empty cells, right delimiter={]}, left delimiter ={[}] { 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 2 \\ 0 & 0 & 0 & 2 & 2 & 1 \\ 0 & 0 & 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ } ; \matrix (sigprimeprime) [matrix anchor= north west, matrix of math nodes, nodes in empty cells, xshift=0.5cm] at (m.north east) { 0 \\ 0 \\ 2 \\ 5 \\ 2 \\ 0 \\ } ; \node [left=-0.05cm of sigprimeprime-1-1] {$\langle$}; \node [right=-0.05cm of sigprimeprime-6-1.east] {$\rangle = \vec{\sigma}''$}; \matrix (sigprime) [matrix anchor=south west, matrix of math nodes, nodes in empty cells] at (m.north west) { 0 & 0 & 0 & 2 & 4 & 3 & \rangle \\ } ; \node[left=-0.1cm of sigprime] {$\vec{\sigma}' = \langle $}; \matrix (sigma) [matrix anchor = north west, matrix of math nodes, nodes in empty cells, xshift=-0.75cm] at (m.south west) { 0 & 2 & 4 & 3 & 0 & 0 & \rangle \\ } ; \node [left=-0.1cm of sigma] {$\vec{\sigma} = \langle$}; \begin{pgfonlayer}{bg} \draw[diagonal] (m-1-6.north east) -- (sigma-1-1.north east); \draw[diagonal] (m-2-6.north east) -- (sigma-1-2.north east); \draw[diagonal] (m-3-6.north east) -- (sigma-1-3.north east); \draw[diagonal] (m-4-6.north east) -- (sigma-1-4.north east); \draw[diagonal] (m-5-6.north east) -- (sigma-1-5.north east); \draw[diagonal] (m-6-6.north east) -- (sigma-1-6.north east); \end{pgfonlayer} \draw[dashed] (m-3-4.north west) rectangle (m-5-6.south east); \end{tikzpicture} \subcaption{}\label{f:matrix2} \end{subfigure} \caption[Illustration of two matrix supports which yield a given signature.]{(\subref{f:matrix1}) One of the 6x6 matrix supports that yields signature $\vec{\sigma} = \langle 0,0,2,4,3,0 \rangle$ as a combination of $\vec{\sigma}' = \langle0,0,0,2,4,3 \rangle$ and \mbox{$\vec{\sigma}'' = \langle 0,0,2,5,2,0 \rangle$.} Entries of $\vec{\sigma}$ are formed by the highlighted diagonal sums. (\subref{f:matrix2}) A second matrix support for the same three vectors.}\label{fig:integer-matrix-example} \end{figure} Clearly, every pair of signatures $\vec{\sigma}', \vec{\sigma}''$ which can be validly combined to yield $\vec{\sigma}$ arise from such an integer matrix. We call the matrix $X$ the \emph{matrix support} of the triple $(\vec{\sigma}, \vec{\sigma}', \vec{\sigma}'')$. Notice that a given triple may have multiple matrix supports (see \autoref{f:matrix2}), but every possible pair of signatures $\vec{\sigma}'$ $\vec{\sigma}''$ which can be combined to form $\vec{\sigma}$ has \emph{at least one} matrix support. If $\vec{\sigma}'$ and $\vec{\sigma}''$ each have girth $\rho$, the matrix support will have dimension $(\rho + 1) \times (\rho + 1)$. Moreover each such matrix support is lower anti-triangular\footnote{The \emph{main anti-diagonal} of a square matrix is the set of cells comprising the anti-diagonal starting at the lower-left cell and ending at the upper-right cell. An \emph{lower anti-triangular matrix} is a square matrix in which all entries above the main anti-diagonal are zero.}. To see this, notice that if $X$ is not lower anti-triangular, some entry above the main anti-diagonal is non-zero, which implies that some pair of placements is combined to yield one with size $2\rho - i - j > \rho$, since, for any entry above the main anti-diagonal, $i+j < \rho$. Thus, the placement so yielded would have a size which exceeds the required limit of on the girth of $\vec{\sigma}$, namely $\rho$. Hence no entry above the main anti-diagonal is non-zero. Therefore, by iterating over all lower anti-triangular matrices $[0,m]^{(\rho+1)\times(\rho+1)}$ we can visit all vector triples which have a matrix support, and thereby compute a table of values for $\Phi(\vec{\sigma}, \delta)$. However, when every signature involved has skew bounded by $\delta$, many of the entries of $X$ will be zero. For example in \autoref{fig:integer-matrix-example} each signature has a skew of $2$, and thus only the $3\times 3$ sub-matrix surrounded by a dotted rectangle is non-zero. Since $\vec{\sigma}'$ and $\vec{\sigma}''$ have skews bounded by $\delta$ and these vectors are the column and row sums of $X$, we only need to consider those non-negative integer matrices in which only a $(\delta+1)\times(\delta+1)$ sub-matrix of entries are non-zero. Let $Y$ denote this sub-matrix. Since $X$ is lower anti-triangular, the non-zero entries of $Y$ must on or below the main anti-diagonal of $X$. Moreover, since $\vec{\sigma}$ has a skew bounded by $\delta$, we obtain the additional restriction that at most $\delta+1$ contiguous anti-diagonals of this matrix are non-zero. Such a matrix is referred to as an \emph{anti-banded matrix} and the number of non-zero anti-diagonals is referred to as the \emph{bandwidth} of the matrix. Putting it all together, we have that the set of possible matrix supports is given by the set of lower anti-triangular non-negative integer $(\rho + 1 )\times (\rho+1)$ matrices in which the only non-zero entries are contained within a $(\delta+1)\times(\delta+1)$ anti-banded sub-matrix with bandwidth at most $\delta+1$. Such matrices are schematically depicted in \autoref{fig:banded-matrix-schematic}. \begin{figure} \centering \begin{tikzpicture}[diagonal/.style={color=gray!50!white, line width=2pt}] \usetikzlibrary{intersections} \pgfdeclarelayer{bg} \pgfsetlayers{bg,main} \matrix (m) [matrix of math nodes, nodes in empty cells, right delimiter={]}, left delimiter ={[}] { \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ } ; \matrix (sigprimeprime) [matrix anchor= north west, matrix of math nodes, nodes in empty cells, xshift=0.5cm] at (m.north east) { \phantom{0} \\ \phantom{0} \\ \phantom{0} \\ \phantom{0} \\ \vec{\sigma}'' \\ \phantom{0} \\ \phantom{0} \\ \phantom{0} \\ \phantom{0}\\ } ; \matrix (sigprime) [matrix anchor=south west, matrix of math nodes, nodes in empty cells, yshift=2mm] at (m.north west) { \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0} & \vec{\sigma}' & \phantom{0} & \phantom{0} & \phantom{0}\\ } ; \matrix (sigma) [matrix anchor = north west, matrix of math nodes, nodes in empty cells, xshift=-0.54cm, yshift=-2mm] at (m.south west) { \phantom{0} & \phantom{0} & \phantom{0} & \vec{\sigma} & \phantom{0}& \phantom{0} & \phantom{0} & \phantom{0} & \phantom{0}\\ } ; \draw (sigprime.north west) rectangle (sigprime.south east); \draw (sigprimeprime.north west) rectangle (sigprimeprime.south east); \draw (sigma.north west) rectangle (sigma.south east); \node[anchor=center, rotate=50, align=center] at($(m-5-6.south east)!0.4!(m-6-7.south east)$) {\small non-zero \\ entries}; \draw[dashed] (m-4-5.north west) rectangle (m-7-8.south east); \draw[dashed] (m-4-5.north west) -- ($(sigprimeprime-4-1.north east)+(0.5,0)$); \draw[dashed] (m-7-8.south west) -- ($(sigprimeprime-7-1.south east)+(0.5,0)$); \draw[dashed] (m-4-8.north east) -- ($(sigprime-1-8.north east)+(-0.15,0.5)$); \draw[dashed] (m-7-5.north west) -- ($(sigprime-1-5.north west)+(0,0.5)$); \draw[dashed] (m-4-7.north east) -- ($(sigma-1-1.south west)-(0,0.5)$); \draw[dashed] ($(m-6-8.north east)-(0,0.5)$) -- ($(sigma-1-4.south west)+(0.25,-0.5)$); \draw [decorate,decoration={brace,amplitude=5pt,raise=4pt}] ($(sigprimeprime-4-1.north east)+(0.5,0)$)--($(sigprimeprime-7-1.south east)+(0.5,0)$) node [black,midway,xshift=1cm] {$\delta+1$}; \draw [decorate,decoration={brace,amplitude=5pt,raise=4pt}] ($(sigprime-1-5.north west)+(0.,0.5)$)--($(sigprime-1-8.north east)+(-0.15,0.5)$) node [black,midway,yshift=0.75cm] {$\delta+1$}; \draw [decorate,decoration={brace,amplitude=5pt,raise=4pt}] ($(sigma-1-4.south west)+(0.25,-0.50)$)--($(sigma-1-1.south west)-(0,0.5)$) node [black,midway,yshift=-0.5cm] {$\delta+1$}; \end{tikzpicture} \vspace{-0.5cm} \caption[Schematic representation of an lower anti-triangular matrix in which all non-zero entries are contained an an anti-banded submatrix with bounded bandwidth.]{A schematic representation of an lower anti-triangular non-negative $(\rho+1)\times(\rho+1)$ matrix in which all non-zero entries are contained in an anti-banded $(\delta+1)\times(\delta+1)$ sub-matrix with bandwidth at most $(\delta+1)$.}\label{fig:banded-matrix-schematic} \end{figure} We can enumerate all valid matrix supports by first, selecting the upper-left corner of $Y$ as it sits in $X$. We must keep the $(\delta + 1) \times (\delta + 1)$ sub-matrix of non-zero entries within certain bounds, both to ensure that no entry above the main anti-diagonal is non-zero and to ensure that the sub-matrix does not exceed the boundaries of its parent matrix. The upper left corner of the sub-matrix must lie between diagonal $\rho - \delta$ and diagonal $2(\rho - \delta - 1)$. Thus, it is given by coordinates \[(a,b) \in \{(i,j) \in \{0,...,\rho\}^2 : \rho - \delta \leq i + j \leq 2(\rho - \delta-1)\}.\] Next, we select the index of the first non-zero diagonal in $Y$, which we denote by $d$. Clearly, our choice of $d$ must lie between $1$ and $\delta+1$. However, we must also take care when selecting $d$ to ensure that no entry above the main anti-diagonal of $X$ is non-zero. This is ensured when $d + a+b \geq \rho+1$, which implies that we need to take \[d \in \{\max[1, \rho+1 - a - b],...,\delta+1\}.\] Notice that every choice of $a,b,$ and $d$ generates a unique set of non-zero cells of $X$. Moreover, we have previously determined that the sum of these non-zero cells must be non-negative integers which sum to $m$, that is, the non-zero cells form a weak composition\footnote{Recall that a \emph{weak composition of an integer $n$ into $k$ parts} is an ordered $k$-tuple of non-negative integers whose sum is $n$.} of $m$ into a number of parts equal to the number of cells available. More specifically, we can generate all matrices $X$ by, for each choice of $(a,b)$ and $d$, enumerating all weak compositions of $m$ into $B(d)$ parts, where $B(d)$ is the number of cells in anti-diagonals \mbox{$d, ..., d + \delta$} of a $(\delta+1)\times(\delta+1)$ matrix. Each such weak composition is placed in the non-zero entries of $X$. We can then sum the rows, columns, and anti-diagonals of $X$ to obtain the triple $(\vec{\sigma}, \vec{\sigma}', \vec{\sigma}'')$ for which $X$ is the matrix support. The enumeration of possible matrices for $Y$ is easily accomplished using known loopless gray codes for weak compositions \cite{Savage1997}. However, to use these codes, we must have an exact closed-form for $B(d)$, which we now compute. $B(d)$ is intimately related to the triangular numbers $T_i = \frac{i(i+1)}{2}$. It is not hard to see that $B(d) := (\delta + 1)^2 - T_{d-1} - T_{\delta +1 -d}$ for $d \in \{0,...,\delta+1\}$. This quantity is arrived at by taking the number of cells in a $(\delta+1)^2$ matrix and removing the entries which must be zero. If $d$ is the first non-zero anti-diagonal, then the $T_{d-1}$ entries of the matrix above diagonal $d$ are zero. Likewise, if $\delta+d$ is the last non-zero anti-diagonal then there are $T_{\delta+1 - d}$ entries below diagonal $\delta+d$ which must be zero. Routine simplification of $B(d)$ yields \[ B(d) = \frac{3\delta^2 + \delta}{2} + d(\delta+2 - d) + 2. \] For our running time analysis, we will need a bound on $B(d)$ which it is convenient to describe now. Notice that the only portion of this equation which depends on $d$ is the term $d(\delta+2 - d)$, which we can upper bound by $\frac{1}{4}(\delta+2)^2$ by the AM-GM inequality\footnote{The AM-GM inequality states that $\sqrt{xy} \leq (x+y)/2$. Letting $y = n-x$ and squaring both sides, we have $x(n-x) \leq (x+n-x)^2/4 = n^2/4$. Setting $x = d$ and $n = \delta+2$ yields the claimed bound.}, thus, we have that \begin{equation}\label{eq:diagonal} B(d) \leq \frac{3\delta^2 + \delta}{2} + \frac{(\delta+2)^2}{4} + 2 = \frac{7\delta^2 + 6\delta}{4} + 3. \end{equation} With this formula in hand, we can use \autoref{alg:phi-table} to iterate over all possible matrices $Y$ and thereby obtain a table of values for $\Phi(\vec{\sigma}, \delta)$, for fixed $\delta$ and values of $\vec{\sigma}$ ranging over all possible signatures with skew at most $\delta$. Recall that $\rho$ and $\delta$ are fixed, and given as input. The pseudocode of \autoref{alg:phi-table} has slight inefficiencies to preserve clarity, none of which affect the asymptotic bound on the running time. \begin{algorithm}[h] \caption{Algorithm to fill table for $\Phi(\vec{\sigma}, \delta)$.}\label{alg:phi-table} \SetKwFunction{rowSum}{row-sum} \SetKwFunction{colSum}{col-sum} \SetKwFunction{diagSum}{diag-sum} Let $X$ be a $(\rho+1) \times (\rho+1)$ zero matrix\; \rowSum{$X$} returns the vector of row sums of matrix $X$\; \colSum{$X$} returns the vector of column sums of matrix $X$\; \diagSum{$X,i,j$} returns the vector of diagonal sums over diagonals $i,i+1,...,j$ of matrix $X$ for $1 \leq i < j \leq 2\rho + 1$\; \For{$(a,b) \in \{(i,j) : \rho - \delta \leq i + j \leq 2(\rho - \delta - 1)\}$}{ \For{$d \gets \max[1, \rho + 1 - a - b], ...,\delta+1]$}{ \For{each weak composition $C$ of $\m$ into $B(d)$ parts}{ fill the non-zero entries of submatrix $Y$ according to the entries of $C$\; copy sub-matrix $Y$ into $X$, using $(a,b)$ as the top-left corner of $Y$ in $X$\; $\vec{\sigma}' \gets $\rowSum{$X$} \; $\vec{\sigma}'' \gets $\colSum{$X$} \; $\vec{\sigma} \gets $\diagSum{$X,\rho+1,2\rho-1$}\; $\Phi(\vec{\sigma}, \delta) \gets \Phi(\vec{\sigma}, \delta) \cup \{(\vec{\sigma}', \vec{\sigma}'')\}$\; reset matrix $X$ so every entry is zero\; } } } \end{algorithm} The body of the inner-most loop can be implemented to run in $O(\delta^2)$ time. The weak compositions of $m$ into $B(d)$ parts may each be visited in constant time per composition using a loopless gray code \cite{Savage1997}. Thus, the two innermost loops yield a total number of iterations given by the following formula. \begin{align*} \sum_{d=1}^{\delta+1} \binom{m + B(d) - 1}{B(d) - 1} &\leq \sum_{d=1}^{\delta+1} \binom{m + \frac{7\delta^2 + 6\delta}{4} + 2}{\frac{7\delta^2 + 6\delta}{4}+2} \\ &<(\delta+1)\left( \frac{e(m + \frac{7\delta^2 + 6\delta}{4} + 2)}{\frac{7\delta^2 + 6\delta}{4} + 2} \right)^{\frac{7\delta^2 + 6\delta}{4} + 2}\\ &= (\delta+1)\left( \frac{4em}{7\delta^2 + 6\delta + 8} +e \right)^{\frac{7\delta^2 + 6\delta}{4} + 2.} \intertext{Where the first bound follows from our bound on $B(d)$, the second bound follows by Stirling's approximation, and the remainder is routine simplification. Combining it with the two outer-most loops, and the running time of the body of the inner-most loop, we obtain a running time of} &O\left((\rho-\delta)^2\delta^3\left( \frac{4em}{7\delta^2 + 6\delta + 8} +e \right)^{\frac{7\delta^2 + 6\delta}{4} + 2}\right). \end{align*} We also use the above expression to bound the size of table generated by the algorithm. While each triple of \signature{s} may have multiple matrix supports, the problem of determining an exact number of triples appears to be a difficult one. In fact, mathematicians are still working to find a closed formula for the number of non-negative integer matrices with prescribed row and column sums \cite{Barvinok2012}. Moreover, this problem does not include any constraints on the diagonal sums, or the requirement that all entries sum to a given integer $m$. In the next section we will see how this table is used in a dynamic program to find an optimal solution to \autoref{p:graph-multi-placement}. \subsubsection{Bottom-Up Dynamic Program}\label{s:mp-dp} Recall that $G_u(\vec{\sigma})$ is the value of an optimal sub-multi-placement\xspace at node $u$ which has signature $\vec{\sigma}$. In this section, we present a recurrence which determines a table of values for $G_u(\vec{\sigma})$ at each node $u$. This recurrence is computed for each edge in order of a post-order traversal. For each node $u$, the first edge of $u$ which is visited by our algorithm first is termed an \emph{up\xspace} edge, while all other edges are termed \emph{out\xspace} edges. During the algorithm, we compute several intermediate values of $G_u(\vec{\sigma})$ as edges connecting $u$ to its children are included. Suppose that node $u$ has children $c_1,...,c_\nChildren$. We refer to the subtree rooted at node $u$ and containing children $c_1,...,c_k$ and all of their descendants by $\subtree{u}{k}$. See \autoref{f:notation} for a diagram illustrating this notation. We define $G_u^k(\vec{\sigma})$ as the minimum objective value obtainable in $\subtree{u}{k}$ by a multi-placement with signature $\vec{\sigma}$. Once the table of values for $G_u^k(\vec{\sigma})$ is obtained, we can determine the values of $G_u^{k+1}(\vec{\sigma})$ using the recurrence described below. After every edge connecting $u$ to its children has been visited, we set $G_u(\vec{\sigma}) = G_u^t(\vec{\sigma})$. \begin{figure} \centering \begin{tikzpicture} \tikzset{ circnode/.style={circle,draw,minimum size=.6cm,inner sep=0}, rectnode/.style={draw,minimum width=.25cm,fill=white,minimum height=.6cm,child anchor=north,anchor=north}, } \Tree[.\node {}; [.\node [circnode] (u) {$u$}; \edge node [auto=right,pos=0.4] {up}; [.\node [circnode]{$\child{1}$}; [.\node (start) [circnode,minimum size=0.25cm] {}; ] [.\node [circnode, minimum size=0.25cm] {}; ] [.\node [circnode, draw=none] {$...$}; ] [.\node (end) [circnode, minimum size=0.25cm] {}; ] ] \edge node [auto=right,pos=0.95,xshift=6pt, yshift=-5pt] {out}; [.\node [circnode] {$\child{2}$}; [.\node (start2) [circnode,minimum size=0.25cm] {}; ] [.\node [circnode, minimum size=0.25cm] {}; ] [.\node [circnode, draw=none] {$...$}; ] [.\node (end2) [circnode, minimum size=0.25cm] {}; ] ] \edge node [auto=right,pos=0.5,xshift=7pt,yshift=2pt] {out}; [.\node [circnode] {$\child{3}$}; [.\node (start3) [circnode,minimum size=0.25cm] {}; ] [.\node [circnode, minimum size=0.25cm] {}; ] [.\node [circnode, draw=none] {$...$}; ] [.\node (end3) [circnode, minimum size=0.25cm] {}; ] ] \edge node [auto=left,midway,pos=0.4] {out}; [.\node [circnode] {$\child{4}$}; ] ] ]; \draw[thick,dashed] ($(start.west |- u.north)+(-0.2,0.2)$) rectangle ($(end3.south east)+(0.05,-0.2)$); \node at ($(start.west |- u.north)+(0,0.5)$) {$\subtree{u}{3}$}; \end{tikzpicture} \caption{Diagram illustrating our use of notation. Nodes within the dashed box comprise subtree $\subtree{u}{3}$, along with all of their descendants.}\label{f:notation} \end{figure} \begin{comment} That this scheme works is by no means obvious. In particular we have yet to establish that the objective value of the final solution does not depend upon the \emph{order} in which the children of node $u$ are visited. The situation is made even less clear since only signatures with skew no more than $\delta$ may be used to obtain a running time bounded by $O(\m^\delta)$. However it turns out that the choice of order of children can be made \emph{arbitrarily}. To justify this claim, we must show that every optimal multi-placement $\MP^\ast$ on the leaves of the subtree $\subtree{u}{\nChildren}$ is comprised of optimal sub-multi-placement\xspace{s} $\MP_{c_i}$ \emph{whose skew is no more than $\delta$}. This is the content of \autoref{t:skew-ordering} below. \end{comment} The recurrence we describe for $G_u^k(\vec{\sigma})$ is comprised of three cases, the leaf case, up case, and out case, stated below. The up and out cases handle the inclusion of up and out edges respectively, while the leaf case forms the base case of the recursion. We will justify the recurrence immediately after its statement. \begin{align*} G_u^1(\vec{\sigma}) &= G_{c_1}(\vec{\sigma}) + \vec{\sigma} &&\text{(up case)}\\ G_u^{k+1}(\vec{\sigma}) &= \min_{\vec{\sigma}', \vec{\sigma}'' \in \Phi(\vec{\sigma}, \delta)} \left[ G_u^k(\vec{\sigma}') + G_{c_{k+1}}(\vec{\sigma}'') + \vec{\sigma} - \vec{\sigma}' \right] &&\text{(out case)} \intertext{The base case occurs for a leaf $\ell$, with capacity $c(\ell)$, in which} G_\ell(\vec{\sigma}) &= \left\{\begin{array}{@{}ll@{}} \vec{\sigma} ~~~~& \text{if } \vec{\sigma}_i \leq 1 \text{ for all $i$ and } \sum_{i=0}^{\rho} i\vec{\sigma}_i \leq c(\ell)\\ \infty ~~~~& \text{otherwise} \end{array}\right.&&\text{(leaf case)} \end{align*} We justify this recurrence as follows. Consider first the leaf case. Since each placement is a subset of leaves, no placement may include more than one replica at any given leaf node, justifying the upper bound on values of $\vec{\sigma}_i$. For a leaf node $\ell$, the only possible multi-placements are those which use no more capacity than $\ell$ has been allotted. The capacity used by a multi-placement with \signature $\vec{\sigma}$ is easily seen to be $\sum_{i=0}^\rho i \vec{\sigma}_i$. When the \signature exceeds the capacity, no optimal value exists, which we represent by $\infty$, defined to be lexicographically larger than any vector. In the up case, the only leaves available are those under child $c_1$. In this case, all we must do is include the additional contribution of node $u$ to the optimal value computed for $c_1$. Since the signature of the placement at child $c_1$ is $\vec{\sigma}$, by \autoref{lem:signature-solution}, node $u$ contributes an additional factor of $\vec{\sigma}$ to the optimal solution. To help explain the out case, we appeal to the illustration in \autoref{f:out-case-explained}. Intuitively, we are merely splitting the signature $\vec{\sigma}$ among the subtrees $T_u^k$ and child $c_{k+1}$ in the optimal way. Since $\Phi(\vec{\sigma}, \delta)$ contains all signature pairs which can be combined to form $\vec{\sigma}$, taking the minimum over all such signature pairs yields the best possible combination. Finally, we must adjust the value to account for the fact that the term $G_u^k(\vec{\sigma})$ includes a contribution of $\vec{\sigma}'$ from node $u$, which is now inaccurate. Adding the multi-placement of \signature $\vec{\sigma}''$ has increased the contribution of node $u$ to $\vec{\sigma}$. We account for this increase by including the correction factor $\vec{\sigma} - \vec{\sigma}'$, which removes the incorrect value and includes the correct value in its place. \begin{figure} \centering \begin{tikzpicture} \tikzset{ circnode/.style={circle,draw,minimum size=.7cm,inner sep=0}, smallnode/.style={circle,draw,minimum size=.25cm,inner sep=0}, rectnode/.style={draw,minimum width=.25cm,fill=white,minimum height=.7cm,child anchor=north,anchor=north}, } \Tree[.\node {}; [.\node [circnode] (u) {$u$}; [.\node (start) [smallnode] {}; ] [.\node [smallnode] {}; ] [.\node [smallnode, draw=none] {$...$}; ] [.\node (end) [smallnode] {}; ] ] ] ]; \node [circnode, right=1.25cm of end] (ck) {$c_k$}; \node [smallnode, below=0.25cm of ck] (b) {}; \node [smallnode, right=0.25cm of b] (a) {}; \node [smallnode, left=0.25cm of b] (c) {}; \node [smallnode, below left =0.25cm of b] (e) {}; \node [smallnode, below right =0.25cm of b] (f) {}; \node [smallnode, below right =0.25cm of a] (g) {}; \draw (u.south) -- (ck.north); \draw (b.north) -- (ck); \draw (a.north) -- (ck); \draw (c.north) -- (ck); \draw (b) -- (e.north); \draw (b) -- (f.north); \draw (a) -- (g.north); \draw [decorate,decoration={brace,amplitude=5pt, mirror},yshift=-5pt] (start.south) -- (end.south) node [midway, yshift=-10pt] {\footnotesize $k - 1$}; \draw[thick,dotted] ($(start.west |- u.north)+(-0.3,0.3)$) rectangle ($(end.south east)+(0.2,-0.55)$); \draw[thick,dotted] ($(c.west |- ck.north)+(-0.3,0.3)$) rectangle ($(g.south east)+(0.2,-0.2)$); \node at ($(start.west |- u.north)+(0,0.7)$) (anchor) {$\subtree{u}{k-1}$}; \node at ($(c.west |- ck.north)+(0,0.7)$) {$\subtree{\child{k}}{}$}; \node at ($(u)+(0,-2.1)$) {signature: $\vec{\sigma}'$}; \node at ($(ck)+(0,-1.7)$) (anchor2){signature: $\vec{\sigma}''$}; \draw [thick, dashed] ($(anchor)+(-0.8,0.4)$) rectangle ($(anchor2 -| g.south east)+(0.4,-0.3)$); \node at ($(anchor)+(-0.8,0.8)$) {$\subtree{u}{k}$}; \node[align=center] at ($(anchor2 -| g.south east)+(-2.1,-1)$) {signature: $\vec{\sigma}$\\ $(\vec{\sigma}', \vec{\sigma}'') \in \Phi(\vec{\sigma}, \delta)$}; \end{tikzpicture} \caption{Diagram illustrating how out edges are added to the tree.}\label{f:out-case-explained} \end{figure} One minor detail is not accounted for in the above recurrence. At no point should we report that an optimal multi-placement with signature $\vec{\sigma}$ exists unless the leaves of $T_u^k$ have sufficient capacity to store such a multi-placement. This is easily rectified by defining $\G_u^k = \infty$ when $\sum_{i=0}^\rho i\vec{\sigma}_i > c(T_u^k)$, where $c(T^u_k)$ is defined as the sum of capacities of leaves in the subtree rooted at $T_u^k$. These capacities can be easily obtained as a preprocessing step. Recall that, by convention, we take $\infty$ to be lexicographically larger than any vector. Using the above recurrence it is a simple matter to compute the value of an optimal multi-placement with a particular signature $\vec{\sigma_0}$ with skew bounded by $\delta$. Simply compute, bottom up, $G_u(\vec{\sigma})$ for all values of $\vec{\sigma}$ which have skew at most $\delta$. Once the root node has had the value $\G_u(\vec{\sigma_0}$ filled in, the computation can stop. Of course, we are not merely interested in the value of the optimal solution, we must produce the optimal solution itself. The multi-placement itself is easily obtained by storing the pair of signatures which results in the minimum value for each out-case above. This record of the computation is all that is needed to obtain a multi-placement which has the given signature. Finally, we note that once the table $G_u^{k+1}(\vec{\sigma})$ has been entirely filled out, the table containing values of $G_u^k$ is no longer needed, and can be overwritten by values of $G_u^{k+1}$. In this way, only two tables for $G_u$ ever need to be stored for each node $u$ throughout the procedure. Moreover, the second table can be discarded or reused after the table for $G_u^t$ has been recorded. In total, only $n+1$ tables need to be stored for a complete run of the dynamic program on a tree with $n$ nodes. The running time of the entire procedure can be bounded as follows. Filling out a single table for $G_u^{k}$ takes, at most, time bounded by the time taken to build the table of values for $\Phi$. For each table, we compare and update the objective function, which takes $O(\rho)$ time. Finally, we only perform an update of the table for $G_u$ once for each edge $(u,v)$ in the tree, so, summing over all $\n-1$ edges of the tree, we obtain an overall running time of \[O\left(\n\rho(\rho-\delta)^2\delta^3\left( \frac{4em}{7\delta^2 + 6\delta + 12} +e \right)^{\frac{7\delta^2 + 6\delta}{4} + 3}\right).\] This establishes that \autoref{p:graph-multi-placement} can be solved in polynomial time for fixed values of $\delta$. \section{NP-hardness of Single-block Replica Placement in Bipartite Graphs} \label{s:np-hard} We could also consider replica placement in directed graphs which are more general than trees. To this end, we can define the following extension of \autoref{p:graph-single-placement} by replacing the arborescence by a directed graph, and the set of leaves by a set of \emph{candidate placement} nodes. \begin{problem}[Optimal Single-block Placement in Graphs] \label{p:graph-sp} Given a directed graph $\graph{\V}{\A}$, a set of candidate nodes $C \subseteq \V$, and positive integer $\rho$, with $\rho < |C|$, find a placement $\P \subset C$ with size $\rho$, such that $\ff{\P}$ is lexico-minimum. \end{problem} A similar extension of \autoref{p:graph-multi-placement} is immediate. Note that since the failure number was defined with regards to the reachability relation, no changes are necessary to ensure that the concepts of failure number and failure aggregate remain well-defined. We sketch an argument that \autoref{p:graph-sp} is NP-hard by reduction from \textsc{Dominating Set} \cite{Garey1979} as follows. The input to the \textsc{Dominating Set} problem is an undirected graph $G$, and an integer $k$. The question asked is: ``is there a subset $D$ of exactly $k$ vertices from $G$ such that every vertex not in $?D$ is adjacent to at least one vertex in $D$?" To answer this question, we can form an instance of \autoref{p:graph-sp} by constructing a bipartite graph $(S,T,E)$, where there is a vertex in $S$ and in $T$ for each vertex in $G$. For each edge $(u,v)$ \emph{not included in} $G$, we connect the representative of $u$ in $S$ with the representative of $v$ in $T$ by an edge directed from $S$ to $T$. Thus the neighborhood of each node $u$ in $S$ is the set of vertices which are \emph{not} adjacent to $u$ in $G$. The bipartite graph $(S,T,E)$ then forms a directed graph as required by the input to \autoref{p:graph-sp}. Let $T$ be the set of candidate nodes. Then, a dominating set of size $k$ exists in $G$ if and only if a placement of size $k$ can be made on the nodes of $T$ such that $\ff{\P} \leq_L \langle 0, |\V|, ..., |\V| \rangle.$ The key to the reduction is the zero in the first entry of the vector, which counts the number of nodes with failure number $k$. In a placement $P$, if node $u$ in $S$ has failure number $k$, it indicates that every node in the placement (i.e. the purported dominating set) is adjacent to $u$ \emph{in the complement of $G$}. Equivalently, a node $u$ has a failure number $k$ only if it is is \emph{not} adjacent to any element of $P$. Thus, a placement on $T$ which has no nodes with failure number $k$ must be a dominating set in $G$. The remaining direction is easily shown. This reduction shows that \autoref{p:graph-sp} remains NP-hard even when the input is restricted to \emph{bipartite} graphs. It additionally shows that \emph{even minimizing the first entry of the failure aggregate} is an intractable problem for bipartite graphs. One may wonder whether intractability can be circumvented by instead lexicominimizing a suffix of the failure aggregate. Unfortunately, this does not work. An easy reduction from \textsc{Independent Set} \cite{Garey1979} shows that it is also NP-hard to lexico-minimize even the last three entries of the failure aggregate. Both \textsc{Independent Set} and \textsc{Dominating Set} are special cases of the more general \textsc{Set Cover} \cite{Garey1979} problem, for which an $\Omega(\log n)$ lower bound on the approximation ratio is well known \cite{Dinur2014}. While \textsc{Set Cover} does reduce to \autoref{p:graph-sp}, whether this lower-bound can be made to carry over remains an open question. Indeed, the very notion of what it means to \emph{approximate} a vector quantity \emph{in the lexicographic order} is an interesting one which, to the best of our knowledge, has yet to be explored in the complexity literature. \section{Future Work}\label{s:future-work} In this paper, we have described two algorithms for solving two replica placement problems in trees. The first problem considers how best to select a placement of size $\rho$ on which to place replicas of a single block of data. For this problem, we present an $O(n + \rho \log \rho)$ algorithm. The second problem considers how to optimally select a multi-placement of $\m$ placements. For this problem, we present an algorithm which runs in polynomial time when the skew of the multi-placement is at most a fixed constant. We first propose studying approximations to \autoref{p:graph-sp}, including notions of approximation for lexicographic optimization problems. In addition, we propose pursuing exact algorithms for restricted classes of bipartite graphs such as multi-trees, and bipartite graphs with adjacency matrices which have the consecutive ones property. Such graphs can also be used to model failure in data centers. We also plan to investigate several variants of weighted objectives for both the single-block and multi-placement problems which tie together our approach with that considered in \cite{Korupolu2016}. While the complexity of multi-placement optimization is currently unknown, we do know that the running time can be improved in special cases. For instance, when the skew is at most $1$, we can attain a running time of $O(\n\m^2\rho^3)$ by exploiting some additional balancing properties. Interesting directions for future work on multi-placements include establishing fixed-parameter tractability of the multi-placement problem and proving NP-hardness. It would also be interesting to explore whether the exponent can be brought down to some term which is $o(\delta^2)$. The matrix system described in \autoref{s:combo-signatures} is an important step towards this goal. \section*{Acknowledgements} The authors would like to thank Ian Cook, Conner Davis and Balaji Raghavachari for insightful conversations and comments on drafts. \section*{References} \bibliographystyle{elsarticle-num}
{'timestamp': '2017-04-21T02:02:19', 'yymm': '1701', 'arxiv_id': '1701.01539', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01539'}
arxiv
\section{Introduction} \label{sec:intro} Tsunamigenic megathrust earthquakes generally occur in subduction zones, where an oceanic plate is subducting beneath a continental plate. Stress can build up in locked regions and be violently released. The resulting seafloor motion causes a disturbance of the sea surface that gives rise to gravity waves in the fluid layer. For recent events, it is often the slip on the fault surface that is estimated via inversion techniques from seismic or other observations \cite{hartzell_1994_1996,ji_source_2002,melgar_kinematic_2015}. In order to perform tsunami simulation, it is necessary to transform this fault slip into seafloor deformation. To do this, the earth is typically modeled as a homogeneous, isotropic half-space, where a Green's function solution exists for steady-state linear elasticity with a delta function displacement at a point in the interior. Often the fault surface is approximated by a collection of planar subfaults, e.g. rectangular patches on which the slip is assumed to be constant. Integrating the Green's function over a rectangular subfault gives an explicit expression for the surface deformation as a function of the parameters defining the subfault geometry and the slip. By linearity, these can be summed over the subfaults in order to approximate the deformation from a more complex source \cite{titov_real-time_2005}. In the tsunami modeling literature, this is often called the Okada solution, using the explicit formulas derived by Okada \cite{Okada1985} for rectangular patches. \par This solution, however, only approximates the final static deformation of the surface and does not approximate the transient motion that occurs as seismic waves propagate during the earthquake. It also assumes the surface is flat, while in practice the seafloor is not flat. In particular, the region of maximum surface displacement for subduction zone earthquakes is typically near the relatively steep continental slope at the edge of the shelf, which often terminates in a trench that is deeper than the ocean farther offshore. In tsunami modeling, the Okada solution on the flat surface is typically transferred directly to the actual topography. It is also often assumed that the water column above each point on the seafloor is instantaneously lifted by the sea floor deformation \cite{nosov_tsunami_2014}, causing a displacement of the initially flat sea surface that exactly matches the Okada solution. In this case, one can think of the Okada model as incorporating the ocean into the elastic half space, ignoring the jump in material properties that occurs at the seafloor/water interface. \par Moreover, it is often assumed that the steady state static deformation occurs instantaneously during the earthquake, when in reality the rupture may grow and propagate over the course of several minutes. This can be modeled to some extent using the Okada model by allowing subfaults to rupture at different times and by assuming the resulting static deformation grows over some ``rise time'' associated with the subfault. This quasi-static approach is often used in tsunami modeling, particularly for events such as the 2004 Sumatra-Andaman earthquake that gave rise to the devastating Indian Ocean tsunami. This 1200km long fault ruptured over the course of about 10 minutes. The quasi-static Okada approach is considered generally adequate for many modeling problems, taking into account the uncertainty in the input variables (slip, rupture time, rise time) that are often poorly constrained from observations and inversions, even for recent event. This approach is implemented in the GeoClaw software that is widely used for tsunami modeling \cite{BergerGeorgeLeVequeMandli:awr11,LeVequeGeorgeBerger:an11}, as well as by Dutykh et al. \cite{dutykh_use_2013}. \par For some problems, however, more accurate estimates of sea surface displacement may be required, and in some cases even the transient seismic waves in the earth and associated acoustic waves in the ocean may be important to model. For example, Dutykh and Dias \cite{dutykh_tsunami_2009} noted that transient effects can cause a leading depression wave where an elevation wave is expected. An important potential application is to the study of early warning systems that might be used to provide enhanced warnings based on observations obtained in the source region during and immediately following a major earthquake \cite{nosov_tsunami_2014}. Recent work by Kozdon and Dunham \cite{KozdonDunham2014Hydro}, by Maeda, Furumuro, and collaborators \cite{MaedaFurumura2011,MaedaFurumuraEtAl2013}, and by Saito and Tsushima \cite{SaitoTsushima2016}, for example, has shown that the study of coupled seismic and acoustic waves could be useful in rapid inversion to distinguish between different rupture models. Our work is a part of an ongoing study of the feasibility and potential uses of a cabled network of sea floor sensors to monitor the Cascadia Subduction Zone \cite{eew-whitepaper}. Thus, the goal herein is to develop a high-resolution finite volume method for solving the seismic wave equations (eventually to be coupled with the ocean) that allows the specification of arbitrary slip on a fault surface and works well in the context of the open source Clawpack software \cite{clawpack,mandli2016clawpack}, which includes adaptive mesh refinement (AMR) algorithms in both two and three space dimensions. In addition to providing an efficient and accurate solver for these equations, this will facilitate coupling with the GeoClaw software that is also built on the Clawpack AMR framework and distributed as part of that software. \par This paper focuses on the homogeneous half-space problem in order to verify that the method and implementation presented here can reproduce the exact Okada solution. After deriving the modified Riemann solutions in Sect.~\ref{sec:rp}, computed surface deformations are obtained for a two-dimensional vertical cross section and for a full three-dimensional problem in Sect.~\ref{sec:comparison}. Concluding remarks and discussion of ongoing extensions of this work, including the addition of an ocean layer and seafloor topography, are found in Sect.~\ref{sec:conclusion}. The code producing the simulations shown in this paper is archived at \cite{seismic-zenodo} and active development work can be followed in the Github repository at {\tt github.com/clawpack/seismic}. \section{The elasticity Riemann solver with fault slip} \label{sec:rp} The equations of isotropic linear elasticity can be written as \begin{equation}\label{eq:3delasticity} \begin{split} &\sigma_t - \lambda (\nabla \cdot u)I - \mu (\nabla u + \nabla^T u) = 0,\\ &\rho u_t - \nabla \cdot \sigma = 0,\\ \end{split} \end{equation} where $\sigma$ is the symmetric stress tensor, $u$ is the velocity, $I$ is the identity tensor, $\rho$ is the the density, and $\lambda$, $\mu$ are the Lam\'e parameters. The wave-propagation algorithm discussed in \cite{fvmhp} uses the solutions to the Riemann problems at grid cell interfaces to update cell quantities. This approach extends to other materials, such as orthotropic and poroelastic materials \cite{Lemoine:3d,LemoineOu2014,LemoineOuLeVeque2013}. Here, the fault slip is introduced by modifying the Riemann problems, and corresponding solutions, at cell interfaces that line up with the fault. Given that two-dimensional simulations can be performed in much less time than in three dimensions, the plane-strain case is used first for comparing against the Okada solution for various faults of infinite length in the strike direction. The slip model is also extended to three dimensions and compared to the corresponding Okada solution for a fault of finite length. \subsection{Two dimensions (plane-strain)}\label{sec:2d} In the two-dimensional, plane-strain case, the equations take the form \begin{equation}\label{eq:2delasticity} \begin{split} &\sige11_t - (\lambda+2\mu) \vel1_x - \lambda \vel2_y = 0,\\ &\sige22_t - \lambda \vel1_x - (\lambda+2\mu) \vel2_y= 0,\\ &\sige12_t - \mu(\vel2_x+\vel1_y) =0,\\ &\rho \vel1_t - \sige11_x -\sige12_y =0,\\ &\rho \vel2_t - \sige12_x -\sige22_y =0, \end{split} \end{equation} where superscripts denote components in the $x$ (horizontal) and $y$ (vertical) directions, respectively. This models a vertical slice of the earth ($y \le 0$) with an infinitely long fault in the orthogonal direction. In heterogeneous media, the density $\rho$ and the Lam\'e parameters $\lambda$, $\mu$ can be spatially varying, which results in the following linear hyperbolic system of equations in non-conservative form: \begin{equation*} q_t + A(x,y)q_x + B(x,y)q_y = 0, \end{equation*} where $q = [\sige11,\sige22,\sige12, \vel1,\vel2]^T$ and $A$ and $B$ are the $5 \times 5$ coefficient matrices. As shown in \cite{fvmhp}, the general Riemann solution involves the eigenvectors of $n_x A + n_y B$, where $n = [n_x,n_y]^T$ is the normal vector to the cell-edge. These vectors are \begin{equation}\label{eq:waves} r^p_\pm = \bcm \lambda + 2 \mu n_x^2 \\ \lambda + 2\mu n_y^2 \\ 2\mu n_x n_y \\ \mp c_p n_x \\ \mp c_p n_y \ecm \quad \text{and} \quad r^s_\pm = \bcm - 2\mu n_x n_y \\ 2 \mu n_x n_y \\ \mu (n_x^2 - n_y^2) \\ \pm c_s n_y \\ \mp c_s n_x \ecm, \end{equation} where $r^p_\pm$ and $r^s_\pm$ correspond to the P- and S- waves traveling either in the direction of the normal ($+$) or opposite ($-$). \par Denote $q^*_\pm$ and $q_\pm$ as the initial and resulting states, respectively, on corresponding sides of the cell-edge. These are related via \begin{equation*} \begin{split} q_+ = q^*_+ - \alpha^p_+r^p_+ - \alpha^s_+ r^s_+, \\ q_- = q^*_+ + \alpha^p_- r^p_- + \alpha^s_- r^s_-. \end{split} \end{equation*} where the $\alpha$'s are amplitudes of the P-waves and S-waves. To couple $q_+$ with $q_-$, continuity of normal traction ($\sigma_n := \sigma.n\cdot n$) and normal velocity ($u_n := u \cdot n$) are enforced across the cell-edge. The fault slip is now implemented by enforcing a slip rate $s$ evenly to the two tangential velocities ($u_\tau$) on either side of the cell-edge. These conditions are summarized in matrix form: \begin{equation*} \begin{split} &P_n q_- = P_n q_+, \quad P_\tau q_- = s/2, \text{ and }P_\tau q_+ = -s/2,\\ &\text{where } P_n q := \bcm n_x^2 & n_y^2 & 2n_x n_y & 0 & 0 \\ 0 & 0 & 0 & n_x & n_y \ecm q = \bcm \sigma _n \\ u_n \ecm \\ &\text{ and } P_\tau q := \bcm 0 & 0 & 0 & n_y & -n_x \ecm q = \bcm u_\tau \ecm. \end{split} \end{equation*} The resulting states $q_\pm$ are exchanged for the initial states and eigenvectors to obtain equations for $\alpha^p_\pm$ and $\alpha^s_\pm$. Noting that $P_n r^s_\pm = 0$ and $P_\tau r^p_\pm = 0$ helps to greatly simplify the system: \begin{equation*} \begin{split} &\bcm P_n r^p_+ & P_n r^p_- & 0 & 0 \ecm \bcm \alpha^p_+ \\ \alpha^p_-\ecm = P_n (q^*_+ - q^*_-),\\ &\bcm P_\tau r^s_+ & 0 \\ 0 & P_\tau r^s_- \ecm \bcm \alpha^s_+ \\ \alpha^s_- \ecm = \bcm P_\tau q^*_+ + s/2 \\ -P_\tau q^*_- + s/2 \ecm. \end{split} \end{equation*} The solution is \begin{equation}\label{eq:rpsolution} \alpha^p_\pm = \frac{c_{p\mp}\Delta \sigma^*_n \mp B_\mp \Delta u^*_n}{c_{p+}B_- + c_{p-}B_+} \quad \text{and} \quad \alpha^s_\pm = \frac{u^*_{\tau\pm} \pm s/2}{c_{s\pm}}, \end{equation} where $\Delta \sigma^*_n := \sigma^*_{n+} - \sigma^*_{n-}$ and $\Delta u^*_n := u^*_{n+} - u^*_{n-}$. \par At cell-edges that correspond to a subfault, the goal is to obtain a total displacement $S$ over a time period $\Delta t$, beginning at some rupture time $t_r$. Thus, for time $t_r \leq t \leq t_r+ \Delta t$, the slip rate is imposed as $s = S/\Delta t$ (uniform slip in time). The variable time-stepping algorithm in Clawpack is adjusted so that $\Delta t$ is divided into an integer number of time steps. When the slip rate is zero, the standard Riemann solution is used where continuity of traction and velocity are enforced across the cell-edge. \subsection{Additional numerical details} Fig.~\ref{fig:faultwaves} shows a few time frames of a simulation in which unit slip is imposed for $0 \le t \le 1$ across a fault with dip angle of $0.2$ radians ($\approx 11.5$ degrees), top-edge depth $100$km, and fault plane width $50$km. The AMR capability of Clawpack is utilized with $8$ cells spanning the fault at the coarsest grid level and a Courant number set to $0.9$. There are then 5 additional levels of grids, each twice as refined as the previous level in both space and time. Note that as the seismic waves propagate out, a static stress field remains near the fault plane that indicates a permanent deformation of equal magnitude, but opposite sign, on either side of the fault. For this figure, the fault is deep beneath the surface and so the waves continue propagating outward. In reality, the depth of the fault may be quite shallow relative to its width, so the upward propagating waves would reflect off the surface ($y=0$) by the time shown in this figure. \begin{figure}[t] \center \subfloat[$t = 0$s]{\includegraphics[width=0.49\textwidth]{./fault0}} \subfloat[$t = 1.5$s]{\includegraphics[width=0.49\textwidth]{./fault1}}\\ \subfloat[$t = 5$s]{\includegraphics[width=0.49\textwidth]{./fault2}} \subfloat[$t = 10$s]{\includegraphics[width=0.49\textwidth]{./fault3}} \caption[Compression/tension and shear waves emanating from a dipping fault]{Compression/tension and shear waves emanating from a $1$km, $1$s uniform slip across a fault with dip $0.2$rad, top-edge depth $100$km, and width $50$km, shown at four different times (\textcolor{red}{red}: compression, \textcolor{blue}{blue}: tension, black lines: contours of velocity in the direction tangent to the fault).} \label{fig:faultwaves} \end{figure} \par To address this, a free-surface boundary condition is imposed at the surface by setting ghost cell values in such a way that there is zero traction at the free surface. More specifically, for $h>0$, the value of $\sige i2 (x,h)$ is set to $-\sige i2(x,-h)$, so that $\sige i2 (x,0) \approx (1/2)[\sige i2 (x,h) + \sige i2 (x,-h)] = 0$ for $i=1,2$. A mapped grid, $(X,Y) = \mathcal{M}(x,y)$, is used that lines up with both the fault and the free surface. This is accomplished by interpolating between a normal Cartesian grid ($\mathcal{M}^s(x,y)=(x,y)$) and a grid that is rotated to line up with the fault: $\mathcal{M}^f (x,y) = (x_c + \cos(\theta)(x - x_c) + \sin(\theta)(y-y_c), y_c - \sin(\theta)(x - x_c) + \cos(\theta)(y-y_c))$, where $(x_c,y_c)$ is the centroid of the fault and $\theta$ the dip angle. A distance from the fault is defined as \begin{equation*} \phi(x,y) = \left \{ \begin{tabular}{cl} $\sqrt{(x - x_l)^2 + (y-y_c)^2}$ & for $x < x_l$ \\ $|y-y_c|$ & for $x_l \le x \le x_r$ \\ $\sqrt{(x - x_r)^2 + (y-y_c)^2}$ & for $x_r < x$ \end{tabular} \right ., \end{equation*} where $x_l = x_c - W/2$ and $x_r = x_c + W/2$ for fault width $W$. The grid mapping is now complete as $\mathcal{M}(x,y) = \mathcal{M}^s(x,y)\phi(x,y)/y_c + \mathcal{M}^f(x,y)(1 - \phi(x,y)/y_c)$, for $\phi(x,y) \le y_c$, and $\mathcal{M}(x,y) = \mathcal{M}^s(x,y)$ otherwise. A visualization of this mapped grid is found in Fig.~\ref{fig:mappedgrid}. \begin{figure}[t] \center \includegraphics[width=0.40\textwidth]{./gridl2} \caption{Mapped grid conforming both to fault and to surface.} \label{fig:mappedgrid} \end{figure} \subsection{Extension to three dimensions}\label{sec:3d} Consider the three-dimensional elasticity equation (\ref{eq:3delasticity}) written in non-conservative form: \begin{gather*} q_t + A(x,y,z)q_x + B(x,y,z)q_y + C(x,y,z)q_z = 0, \\ q = [\sige11, \sige22, \sige33, \sige12, \sige23, \sige13, \vel1, \vel2, \vel3]^T, \end{gather*} where positive $x$ is east, positive $y$ is north, and positive $z$ is up. A similar modification to the Riemann problem for this equation is made to incorporate fault slip. In order to simplify the extension to three dimensions, only faults with strike angle of $0$ degrees (top edge pointing north) and rake angle of $90$ degrees (slip is in dip direction) are considered. Note these types of faults are the most common in subduction zones. The mapped grid is an extension of the two-dimensional mapping near the fault: $\mathcal{M}(x,y,z) = \mathcal{M}^s(x,y,z)\phi(x,z)/z_c + \mathcal{M}^f (x,y,z)(1 - \phi(x,z)/z_c)$. Note that this mapping is invariant to $y$, and thus the general Riemann solutions either involve the eigenvectors to $n_xA + n_zC$ or to $B$, because the normal to the cell-faces is either $n = [n_x,0,n_z]^T$ or $n=[0,1,0]^T$. \par If $n=[0,1,0]^T$, the standard Riemann solution for (\ref{eq:3delasticity}) is used because no slip is to be imposed. Thus, assume $n = [n_x,0,n_z]^T$. Denote the tangent vectors $\tau_1 = [n_z, 0, -n_x]^T$ and $\tau_2 = [0, 1, 0]^T$, noting that $\tau_1$ points in the rake direction and $\tau_2$ is orthogonal to $\tau_1$. The eigenvectors of $n_xA + n_zC$ are \begin{equation}\label{eq:waves3d} r^p_\pm = \bcm \lambda + 2\mu n_x^2\\ \lambda\\ \lambda + 2\mu n_z^2 \\ 0 \\ 0 \\ 2 \mu n_x n_z \\ \mp c_p n_x \\ 0 \\ \mp c_p n_z \ecm, \quad r^{s1}_\pm = \bcm -2\mu n_x n_z \\ 0 \\ 2\mu n_x n_z \\ 0 \\ 0 \\ \mu (n_z^2 - n_x^2)\\ \pm c_s n_z \\ 0 \\ \mp c_s n_x \ecm, \quad \text{and } r^{s2}_\pm = \bcm 0 \\ 0 \\ 0 \\ \mu n_x \\ \mu n_z \\ 0\\ 0 \\ \mp c_s \\ 0 \ecm. \end{equation} The initial and resulting states are again related via these eigenvectors: $q_\pm = q^*_\pm \mp \alpha^p_\pm r^p_\pm \mp \alpha^{s1}_\pm r^{s1}_\pm \mp \alpha^{s2}_\pm r^{s2}_\pm$. The conditions at the cell-face are now continuity of normal traction ($\sigma.n \cdot n$) and normal velocity ($u \cdot n$), an evenly imposed slip rate $s$ in the two $\tau_1$ velocities, and zero velocity in the $\tau_2$ direction. As before, these conditions are summarized in matrix form: \begin{equation*} \begin{split} &P_n q_- = P_n q_+, \quad P_{\tau_1} q_- = s/2, \quad P_{\tau_1} q_+ = -s/2, \quad \text{and } \ P_{\tau_2} q_\pm = 0,\\ &\text{where } P_n q := \bcm n_x^2 & 0 & n_z^2 & 0 & 0 & 2n_x n_z & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & n_x & 0 & n_z\ecm q = \bcm \sigma _n \\ u_n \ecm, \\ &\quad \quad P_{\tau_1} q := \bcm 0 & 0 & 0 & 0 & 0 & 0 & n_z & 0 & -n_y \ecm q = \bcm u_{\tau_1} \ecm, \\ &\text{ and } P_{\tau_2} q := \bcm 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \ecm q = \bcm u_{\tau_2} \ecm. \end{split} \end{equation*} The resulting states are again exchanged for the initial states and eigenvectors, and again it is useful to note that $P_n r^{s1}_\pm = P_n r^{s2}_\pm = 0$, $P_{\tau_1} r^p_\pm = P_{\tau_1} r^{s2}_\pm = 0$, and $P_{\tau_2} r^p_\pm = P_{\tau_2} r^{s1}_\pm = 0$. The solution to the resulting system is \begin{equation}\label{eq:rpsolution3d} \alpha^p_\pm = \frac{c_{p\mp} \Delta \sigma^*_n \mp B_\mp \Delta u^*_n}{c_{p+}B_- + c_{p-}B_+}, \quad \alpha^{s1}_\pm = \frac{u^*_{\tau_1} \pm s/2}{c_{s\pm}}, \quad \text{and } \alpha^{s2}_\pm = 0. \end{equation} \section{Comparison of Numerical Results with the Okada Solution} \label{sec:comparison} In Sect.~\ref{sec:2d}, fault slip is modeled in a plane-strain, linearly elastic solid (\ref{eq:2delasticity}) by modifying the corresponding Riemann problems (\ref{eq:waves})-(\ref{eq:rpsolution}) in a novel way. This approach is then extended to three dimensions (\ref{eq:3delasticity}) and the modified Riemann solutions (\ref{eq:waves3d})-(\ref{eq:rpsolution3d}) given. To verify this approach, the Okada solution is used as implemented in the GeoClaw `dtopotools' Python module\footnote{See {\tt www.clawpack.org/okada.html}}. Surface deformation is computed by numerically integrating the velocity at fixed gauge locations along the surface. These values are then compared to those of the Okada solution at the same spatial locations. \subsection{Numerical results in two dimensions} For the plane-strain case, a baseline fault is chosen with unit slip for $0 \le t \le 1$, dip $0.2$ radians ($\approx 11.5$ degrees), top-edge depth $20$km, and fault plane width $50$km. Fig.~\ref{fig:faultandsurfacewaves} shows the resulting simulation at various times. \begin{figure}[t] \center \subfloat[$t=4$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface1} \\ \includegraphics[width=\textwidth]{./timeseries_fault1} \end{minipage} } \subfloat[$t=10$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface2} \\ \includegraphics[width=\textwidth]{./timeseries_fault2} \end{minipage} }\\ \subfloat[$t=20$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface3} \\ \includegraphics[width=\textwidth]{./timeseries_fault3} \end{minipage} } \subfloat[$t=30$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface4} \\ \includegraphics[width=\textwidth]{./timeseries_fault4} \end{minipage} }\\ \subfloat[$t=40$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface5} \\ \includegraphics[width=\textwidth]{./timeseries_fault5} \end{minipage} } \subfloat[$t=70$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries_surface6} \\ \includegraphics[width=\textwidth]{./timeseries_fault6} \end{minipage} } \caption[Compression/tension waves and resulting vertical surface displacement evolving to the Okada solution]{Results for a $1$km, $1$s uniform slip across a fault with dip $0.2$rad, top-edge depth $20$km, and width $50$km. The upper plot at each time shows the surface deformation (\textcolor{blue}{blue solid line} - numerical surface displacement, \textcolor{red}{red dashed line} - Okada solution), and the lower plot shows the compression/tension waves (\textcolor{red}{red}: compression, \textcolor{blue}{blue}: tension).} \label{fig:faultandsurfacewaves} \end{figure} Note that the seismic waves interact with the free surface at the top of the domain, both reflecting off of and traveling along the surface, leaving behind a static deformation. As the waves propagate away, the surface deformation approaches that of the Okada solution. At $t=90$s, with the same AMR strategy used for the results in Fig.~\ref{fig:faultwaves}, the numerical solution was shown to converge to the Okada solution as the number of cells across the fault at the coarsest level is increased. With $8$ cells, the difference between the numerical results at $t=90$s and the Okada solution is less than $2\%$ relative to the maximum Okada deformation. \par To ensure the robustness of this approach to physical fault parameters, the baseline fault is modified to obtain three additional faults. Fig.~\ref{fig:variousparameters} shows the results for a fault with greater top-edge depth ($40$km vs $20$km), another with a greater dip angle ($\approx 22.9$ degrees vs $\approx 11.5$ degrees), and a third with shorter width ($25$km vs $50$km). \begin{figure}[t] \center \subfloat[baseline parameters]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./baseline_vertical} \includegraphics[width=\textwidth]{./baseline_horizontal} \end{minipage} } \subfloat[deeper top-edge $40$km]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./deep_vertical} \includegraphics[width=\textwidth]{./deep_horizontal} \end{minipage} } \subfloat[greater dip angle: $0.4$rad]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./steep_vertical} \includegraphics[width=\textwidth]{./steep_horizontal} \end{minipage} }\\ \subfloat[shorter fault width: $25$km]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./thin_vertical} \includegraphics[width=\textwidth]{./thin_horizontal} \end{minipage} } \subfloat[smooth slip profile]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./smooth_vertical} \includegraphics[width=\textwidth]{./smooth_horizontal} \end{minipage} } \subfloat[bimodal slip profile]{ \begin{minipage}{0.32\textwidth} \includegraphics[width=\textwidth]{./bimodal_vertical} \includegraphics[width=\textwidth]{./bimodal_horizontal} \end{minipage} } \caption[Vertical and horizontal surface displacement for various fault parameters matching that of Okada]{Vertical (top) and horizontal (bottom) surface displacement at $t=90$s matching that of Okada for fault parameters varying from the baseline of a $1$km, $1$s uniform slip across a fault with dip $0.2$rad, top-edge depth $100$km, and width $50$km \textcolor{blue}{Blue solid line}: numerical solution, \textcolor{red}{red dashed line}: Okada solution).} \label{fig:variousparameters} \end{figure} Note that all fault geometries studied show very close agreement, both in vertical and horizontal displacement, with the corresponding Okada solutions. As an additional test, the fault slip profile is also varied. Let $W$ denote the fault width, $p \in [0,W]$ denote the down-dip distance from the top of the fault, $p_0=W/2$, $p_1=W/4$, and $p_2=3W/4$. A smooth fault profile of $S(p) = [1+\cos(\pi(p-p_0)/p_0)]/2$ is chosen, along with a bi-modal profile $S(p) = [1 + \cos(\pi(p-p_1)/p_1)]/2$ for $p \in [0,p_0]$ and $S(p) = [1 + \cos(\pi(p-p_2)/p_1)]/2$ for $p \in (p_0,W]$. The results, also in Fig.~\ref{fig:variousparameters}, show good agreement with the corresponding Okada solutions in all cases. \par \subsection{Numerical results in three dimensions} Next, the extension to three space dimensions from Sect.~\ref{sec:3d} is verified. Similar to what was done in the two-dimensional simulations, a three-dimensional fault is chosen with unit slip for $0 \le t \le 1$, strike $0$ degrees, rake $90$ degrees, dip $0.2$ radians ($\approx 11.5$), centroid depth $25$km, $50$km of width in the dip direction, and $25$km of length in the strike direction. The AMR strategy uses $8$ cells across the dip direction and $4$ cells across the strike direction at the coarsest level, with 3 additional levels of refinement. In two dimensions, the corresponding resolution gave a relative error of less than $4\%$. \begin{figure}[t] \center \subfloat[$t=4$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface1} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault1} \end{minipage} } \subfloat[$t=10$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface2} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault2} \end{minipage} }\\ \subfloat[$t=20$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface3} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault3} \end{minipage} } \subfloat[$t=30$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface4} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault4} \end{minipage} }\\ \subfloat[$t=40$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface5} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault5} \end{minipage} } \subfloat[$t=70$s]{ \begin{minipage}{0.5\textwidth} \includegraphics[width=\textwidth]{./timeseries3d_surface8} \\ \includegraphics[width=\textwidth]{./timeseries3d_fault8} \end{minipage} } \caption[Vertical cross-section of compression/tension waves and plane view of surface deformation]{The upper plot at each time shows a plane view of the surface deformation (\textcolor{bluegreen}{blue-green}: uplift, \textcolor{brown}{brown}: subsidence, black lines: contours of numerical solution, \textcolor{red}{red lines}: contours of the Okada solution), and the lower plot shows a vertical cross-section of the compression/tension waves through the three-dimensional computation (\textcolor{red}{red}: compression, \textcolor{blue}{blue}: tension) } \label{fig:faultandsurfacewaves3d} \end{figure} Fig.~\ref{fig:faultandsurfacewaves3d} shows the seismic waves again interacting with the free surface at the top of the domain. Again, this interaction causes deformation in the surface that, after the waves propagate out of the domain, approaches the Okada solution. At $t=70$, the agreement between the numerical and Okada solution is very good. \section{Conclusion and Discussion} \label{sec:conclusion} While the Okada solution is often adequate for tsunami simulation, the Okada assumptions of instantaneous displacement in a homogeneous half-space may be inadequate for some applications. This work presents a novel way to introduce fault slip via the Riemann problems in the Clawpack simulation software to fully model the seismic waves and transient motion of the seafloor. When solving the linear elasticity hyperbolic system, both in three dimensions (\ref{eq:3delasticity}) and in the case of plane-strain (\ref{eq:2delasticity}), the Riemann solution at a cell interface imposes the slip velocity in the dip direction instead of imposing continuity of tangential traction and velocity. The corresponding eigenvectors (\ref{eq:waves}),(\ref{eq:waves3d}) and coefficients (\ref{eq:rpsolution}),(\ref{eq:rpsolution3d}) are then used by the high-resolution wave-propagation algorithm implemented in Clawpack to solve for surface deformation. \par Two-dimensional results from a baseline fault initially differ from that of Okada for small $t$ but then evolve towards the steady-state solution for larger $t$, as is expected. Physical parameters are varied to observe results for deeper faults, steeper faults, faults of various width, and faults with spatially varying slip profiles. All the dynamic simulations show agreement with the corresponding Okada solution once the seismic waves propagate sufficiently away from the region of interest. The approach is extended to three dimensions and applied to a dipping fault. Again, the dynamic solution evolves towards the corresponding Okada solution. \par The Riemann solution presented here does not assume the elastic medium is homogeneous. Thus, current work involves including an ocean layer as a second elastic medium with a zero shear modulus. This permits direct observation of the sea surface deformation instead of relying on the assumption that the sea surface moves instantaneously with the seafloor. Other current work involves incorporating varying topography, which can also be implemented via the mapped grid approach presented here. Potential future work may include the varying densities of the subduction zone plates and a gravitational force. Finally, it should be noted that this approach to modifying the Riemann problems can be generalized to include a variety of conditions on an interface embedded in an elastic solid, including jumps in tangential or normal traction. \section*{acknowledgements} The authors are grateful to Grady Lemoine for discussions of this work, in particular those involving the modification of the Riemann problems to incorporate fault slip. \bibliographystyle{siamplain}
{'timestamp': '2017-05-16T02:05:28', 'yymm': '1701', 'arxiv_id': '1701.01430', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01430'}
arxiv
\section{Introduction} This work is concerned with the removal of blur in real images. We consider the challenging case where objects move in an arbitrary way with respect to the camera, and might be occluded and/or come into view. Due to the complexity of this task, prior work has looked at specific cases, where blur is the same everywhere (the shift-invariant case), see \eg, \cite{iccpsun,irani}, or follows given models \cite{Hyun2014,sun2015learning} and scenarios \cite{HuDepth,paramCVPR,Whyte2010}. \begin{figure*}[t] \centering \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth,height=1.3\textwidth]{fig_bicycle_im_b.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth,height=1.3\textwidth]{fig_bicycle_im_ponce.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth,height=1.3\textwidth]{fig_bicycle_im_ours.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth,height=1.3\textwidth]{fig_bicycle_im_k.jpg} \end{minipage}\\ (a)\hspace{.2\textwidth}(b)\hspace{.2\textwidth}(c)\hspace{.2\textwidth}(d) \caption{(a) Blurry video frame. (b) Result of \cite{sun2015learning} on the \emph{single} frame (a). (c) Result of the proposed method on the \emph{single} frame (a). (d) Result of the multi-frame method \cite{hyun2015generalized}. \label{fig:demo1}} \end{figure*} Other methods address the modeling complexity by exploiting multiple frames, as in, for example, \cite{hyun2015generalized}. Our objective, however, is to produce high-quality results as in \cite{hyun2015generalized} by using just a single frame (see Fig.~\ref{fig:demo1}). To achieve this goal we use a data-driven approach, where a convolutional neural network is trained on a large number of blurred-sharp image pairs. This approach entails addressing two main challenges: first, the design of a realistic dataset of blurred-sharp image pairs and second, the design of a suitable neural network that can learn from such dataset. We overcome the first challenge by using a commercial high frame-rate video camera (a GoPro Hero5 Black). Due to the high frame-rate, single frames in a video are sharp and motion between frames is small. Then, we use the central frame as the sharp image and the average of all the frames in a video clip as the corresponding blurry image. To avoid averaging frames with too much motion, which would correspond to unrealistic motion blurs, we compute the optical flow between subsequent frames and use a simple thresholding strategy to discard frames with large displacements (more than $1$ pixel). As we show in the Experiments section, a dataset built according to this procedure allows training a neural network and generalizes to images from other camera models and scenes. To address the second challenge, we build a neural network that replicates (scale-space) pyramid schemes used in classical deblurring methods. The pyramid exploits two main ideas: one is that it is easy to remove a small amount of blur, and the second is that downsampling can be used to quickly reduce the blur amount in a blurry image (within some approximation). The combination of these two contributions leads to a method achieving state of the art performance on the single image space-varying motion blur case. \subsection{Related work} \noindent\textbf{Camera Motion.} With the success of the variational Bayesian approach of Fergus et al.~\cite{Fergus2006}, a large number of blind deconvolution algorithms have been developed for motion deblurring~\cite{Babacan2012,Cho2009,Levin2011,iccpsun,Perrone2014,irani,xu2013unnatural,Xu2010}. Although blind deconvolution algorithms consider blur to be uniform across the image, some of the methods are able to handle small variations due to camera shake~\cite{Kohler2012}. Techniques based on blind deconvolution have been adapted to address blur variations due to camera rotations by defining the blur kernel on a higher dimensional space~\cite{Gupta2010,Hirsch2010,Whyte2010}. Another approach to handle camera shake induced space-varying blur is through region-wise blur kernel estimation~\cite{hirsch2011fast,ji2012two}. In 3D scenes, motion blur at a pixel is also related to its corresponding depth. To address this dependency, Hu~\etal and Xu and Jia \cite{HuDepth,Xu2012} first estimate a depth map and then solve for the motion blur and the sharp image. In~\cite{zheng2013forward}, motion blur due to forward or backward camera motion has been explicitly addressed. Notice that blur due to moving objects (see below) cannot be represented by the above camera motion models. \noindent\textbf{Dynamic Scenes.} This category of blur is the most general one and includes motion blur due to camera or object motion. Some prior work \cite{Levin2006,couzinie2013learning} addresses this problem by assuming that the blurred image is composed of different regions within which blur is uniform. Techniques based on alpha matting have been applied to restore scenes with two layers~\cite{dai2009removing,tai2010coded}. Although these methods can handle moving objects, they require user interaction and cannot be used in general scenarios where blur varies due to camera motion and scene depth. The scheme of Kim \etal~\cite{Hyun2013} incorporates alternating minimization to estimate blur kernels, latent image, and motion segments. Even with a general camera shake model for blurring, the algorithm fails in certain scenarios such as forward motion or depth variations~\cite{Hyun2014}. In~\cite{Hyun2014} Kim and Lee, propose a segmentation-free approach but assume a uniform motion model. The authors propose to simultaneously estimate motion flow and the latent image using a robust total variation (TV-L1) prior. Through a variational-Bayesian formulation, Schelten and Roth~\cite{schelten2014localized} recover both defocus as well as object motion blur kernels. Pan \etal~\cite{pansoft} propose an efficient algorithm to jointly estimate object segmentation and camera motion by incorporating soft segmentation, but require user input. \cite{chakrabarti2010analyzing,gast2016parametric,shi2014discriminative} address the problem of segmenting an image into different regions according to blur. Recent works that use multiple frames are able to handle space-varying blur quite well \cite{hyun2015generalized,WieSchLenHir16}. \noindent\textbf{Deep Learning Methods.} The methods in~\cite{Schuler_2013_CVPR,NIPS2014_5485} address non-blind deconvolution wherein the sharp image is predicted using the blur estimated from other techniques. In~\cite{SchHirHarSch16}, Schuler \etal develop an end-to-end system that learns to perform blind deconvolution. Their system consists of modules to extract features, estimate the blur and to perform deblurring. However, the performance of this approach degrades for large blurs. The network of Chakrabarti~\cite{ayaneccv} learns the complex Fourier coefficients of a deconvolution filter for an input patch of the blurry image. Hradi{\v{s}} \etal~\cite{hradivs2015convolutional} predict clean and sharp images from text documents that are corrupted by motion blur, defocus and noise through a convolutional network without an explicit blur estimation. This approach has been extended to license plates in~\cite{license}. \cite{XiaWanHeiHir16} proposes to learn a multi-scale cascade of shrinkage fields model. This model however does not seem to generalize to natural images. Sun \etal~\cite{sun2015learning} propose to address non-uniform motion blur represented in terms of motion vectors. Our approach is based on deep learning and on a single input image. However, we directly output the sharp image, rather than the blur, do not require user input and work directly on real natural images in the dynamic scene case. Moreover, none of the above deep learning methods builds a dataset from a high frame-rate video camera. Finally, our proposed scheme achieves state of the art performance in the dynamic scene case. \section{Blurry Images in the Wild} \label{sec:dataset} One of the key ingredients in our method is to train our network with an, as much as possible, realistic dataset, so that it can generalize well on new data. As mentioned before, we use a high resolution high frame-rate video camera. We build blurred images by averaging a set of frames. Similar averaging of frames has been done in previous work to obtain data for evaluation~\cite{kim2016dynamic,agrawal2009optimal}, but not to build a training set. \cite{kim2016dynamic} used averaging to simulate blurry videos, and \cite{agrawal2009optimal} used averaging to synthesize blurry images, coded exposure images and motion invariant photographs. We use a handheld GoPro Hero5 Black camera, which captures $240$ frames per second with a resolution of $1280{\times}720$ pixels. Our videos have been all shot outdoors. Firstly, we downsample all the frames in the videos by a factor of $3$ in order to reduce the magnitude of relative motion across frames. Then, we select the number $N_e$ of averaged frames by randomly picking an odd number between $7$ and $23$. Out of the $N_e$ frames, the central frame is considered to be the sharp image. We assume that motion is smooth and, therefore, to avoid artifacts in the averaging process we consider only frames where optical flow is no more than $1$ pixel. We evaluate optical flow using the recent FlowNet algorithm \cite{DFIB15} and then apply a simple thresholding technique on the magnitude of the estimated flow. Fig.~\ref{fig:flow} shows an example of the sharp and blurred image pair in our training dataset. In this scene, we find both the camera and objects to be moving. We also evaluate when the optical flow estimate is reliable by computing the frame matching error ($L^2$ norm on the grayscale domain). We found that no frames were discarded in this processing stage (after the previous selection step). We split our \emph{WILD} dataset into training and test sets. \begin{figure*}[t] \centering \begin{minipage}[b]{.48\textwidth \includegraphics[width= 1 \textwidth, height=.5 \textwidth]{fig_flow_blurry.jpg} \end{minipage} \begin{minipage}[b]{.48\textwidth \includegraphics[width= 1 \textwidth, height=.5 \textwidth]{fig_flow_sharp.jpg} \end{minipage}\\ \caption{A sample image pair from the WILD training set. Left: averaged image (the blurry image). Right: central frame (the sharp image).} \label{fig:flow} \end{figure*} \section{The Multiscale Convolutional Neural Network} In Fig.~\ref{fig:cnn} we show our proposed convolutional neural network (CNN) architecture. \begin{figure}[t] \includegraphics[width=.8\linewidth,trim={2.5cm 1.8cm 2.1cm 6cm},clip=true]{fig_cnnnew2} \caption{The DeblurNet architecture. The multiscale scheme allows the network to handle large blurs. Skip connections (bottom links) facilitate the generation of details. \label{fig:cnn}} \end{figure} The network is designed in a pyramid or multi-scale fashion. Inspired by the multi-scale processing of blind deconvolution algorithms \cite{irani,SchHirHarSch16}, we introduce three subgraphs $N_1$, $N_2$, and $N_3$ in our network, where each subgraph includes several convolution/deconvolution (fractional stride convolution) layers. The task of each subgraph is to minimize the reconstruction error at a particular scale. There are two main differences with respect to conventional CNNs, which play a significant role in generating sharp images without artifacts. Firstly, the network includes a skip connection at the end of each subgraph. The idea behind this technique is to reduce the difficulty of the reconstruction task in the network by using the information already present in the blurry image. Each subgraph needs to only generate a \emph{residual image}, which is then added to the input blurry image (after downsampling, if needed). We observe experimentally that the skip connection technique helps the network in generating more texture details. Secondly, because the extent of blur decreases with downsampling \cite{irani}, the multi-scale formulation allows the network to deal with small amounts of blur in each subgraph. In particular, the task for the first subgraph $N_1$ is to generate a deblurred image residual at 1/4 of the original scale. The task for the subgraph $N_2$ is to use the output of $N_1$ added to the downsampled input and generate a sharp image at 1/2 of the original resolution. Finally, the task for the subgraph $N_3$ is to generate a sharp output at the original resolution by starting from the output of $N_2$ added to the input scaled by $1/2$. We call this architecture the \emph{DeblurNet} and give a detailed description in Tab.~\ref{tbl:cnn}. \begin{table*}[t] \begin{center} \begin{adjustbox}{width=1\textwidth} \begin{tabular}{ | l | c c c c c c c | c c c c c | c c c c c | } \hline & \multicolumn{7}{c|}{$N_1$} & \multicolumn{5}{c|}{$N_2$} & \multicolumn{5}{c|}{$N_3$}\\ \hline Type & conv & conv & conv & conv & conv & conv & conv & conv & conv & conv & conv & deconv & conv & conv & conv & conv & deconv\\ OutCh & 96 & 256 & 384 &384& 256&256 & 3 & 256 & 256 & 256 & 256 & 3 & 256 & 256 & 256 & 256 & 3 \\ Kernel & 11& 7& 7& 7& 3&3&3& 5&5&5&5&5& 5&5&5&5&5\\ Stride & $\downarrow$ 2& 1& 1& $\downarrow$ 2& 1&1& 1 & 1 & 1& 1& 1& $\uparrow$ 2 & 1 & 1& 1& 1& $\uparrow$ 2 \\ \hline \end{tabular} \end{adjustbox}\vspace{-.3cm} \caption{The DeblurNet architecture. Batch normalization and ReLU layers inserted after every convolutional layer (except for the last layer of $N_1$) are not shown for simplicity. Downsampling ($\downarrow$) is achieved by using a stride greater than $1$ in convolutional layers. A stride greater than $1$ in deconvolutional ($\uparrow$) layers performs upsampling.} \label{tbl:cnn} \end{center} \end{table*} \noindent\textbf{Training.} We minimize the reconstruction error of all the scales simultaneously. The loss function ${\cal L}= {\cal L}_1+{\cal L}_2+{\cal L}_3$ is defined through the following $3$ losses \begin{equation} \begin{split} {\cal L}_1 &\textstyle = \sum_{(g,f)\in{\mathscr{D}}} \left|N_1(g) + D_{\frac{1}{4}}(g) - D_{\frac{1}{4}}(f)\right|^2\\% \qquad {\cal L}_2 &\textstyle = \sum_{(g,f)\in{\mathscr{D}}} \left|N_2\left(N_1(g)+D_{\frac{1}{4}}(g)\right) + D_{\frac{1}{2}}(g) - D_{\frac{1}{2}}(f)\right|^2\\ {\cal L}_3 &\textstyle = \sum_{(g,f)\in{\mathscr{D}}} \left|N_3\left(N_2\left(N_1(g)+D_{\frac{1}{4}}(g)\right)+D_{\frac{1}{2}}(g)\right) + g - f\right|^2 \end{split} \end{equation} where $\mathscr{D}$ is the training set, $g$ denotes a blurry image, $f$ denotes a sharp image, $D_{\frac{1}{k}}(x)$ denotes the downsampling operation of the image $x$ by factor of $k$, and $N_i$ indicates the $i$-th subgraph in the DeblurNet, which reconstructs the image at the $i$-th scale. \noindent\textbf{Implementation Details.} We used Adam~\cite{kingma2014adam} for optimization with momentum parameters as $\beta_1= 0.9$, $\beta_2 = 0.999$, and an initial learning rate of $0.001$. We decrease the learning rate by $.75$ every $10^4$ iterations. We used 2 Titan X for training with a batch size of $10$. The network needs 5 days to converge using batch normalization~\cite{ioffe2015batch}. \section{Experiments} We tested DeblurNet on three different types of data: a) the WILD test set (GoPro Hero5 Black), b) real blurry images (Canon EOS 5D Mark II), and c) data from prior work. \noindent\textbf{Synthetic vs pseudo-real training.} To verify the impact of using our proposed averaging to approximate space-varying blur, we trained another network with the same architecture as in Fig.~\ref{fig:cnn}. However, we used blurry-sharp image pairs, where the blurry image is obtained synthetically via a shift-invariant convolutional model. As in \cite{ayaneccv}, we prepared a set of $10^5$ different blurs. During training, we randomly pick one of these motion blurs and convolve it with a sharp image (from a mixture of $50K$ sharp frames from our WILD dataset and $100K$ cityscapes images\footnote{www.cityscapes-dataset.com}) to generate blurred data. We refer to this trained network as the \emph{DeblurNet}$^\text{SI}$, where \emph{SI} stands for shift-invariant blur. A second network is instead trained only on the blurry-sharp image pairs from our WILD dataset (a total of $50K$ image pairs obtained from the selection and averaging process on the GoPro Hero5 Black videos). This network is called \emph{DeblurNet}$^\text{WILD}$, where \emph{WILD} stands for the data from the WILD dataset. As will be seen later in the experiments, the \emph{DeblurNet}$^\text{WILD}$ network outperforms the \emph{DeblurNet}$^\text{SI}$ network despite the smaller training set and the fact that the same sharp frames from the WILD dataset have been used. Therefore, due to space limitations, often we will show only results of the \emph{DeblurNet}$^\text{WILD}$ network in the comparisons with other methods. \begin{figure*}[t] \centering \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_input.jpg} \end{minipage} \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_tru_12.jpg} \end{minipage}\\\vspace{-.12cm} (a)\hspace{.45\textwidth}(b)\\ \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_xu_12.jpg} \end{minipage} \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_L0_12.jpg} \end{minipage}\\\vspace{-.12cm} (c)\hspace{.45\textwidth}(d)\\ \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_ponce_12.jpg} \end{minipage} \begin{minipage}[b]{.49\textwidth} \includegraphics[width= 1 \textwidth]{fig_test_set_12_res_12.jpg} \end{minipage}\\\vspace{-.12cm} (e)\hspace{.45\textwidth}(f) \label{fig:exp1} \caption{An example from the WILD test set. (a) blurry image, (b) sharp image (ground truth), (c) Xu and Jia \cite{Xu2010}, (d) Xu \etal \cite{xu2013unnatural}, (e) Sun \etal \cite{sun2015learning}, (f) \emph{DeblurNet}$^\text{WILD}$.\label{fig:test2}} \end{figure*} \begin{figure} \centering \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_tv_Anchor_in_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_tv_Anchor_2_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_tv_Anchor_3_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_tv_Anchor_1_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_1_in.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_2_in.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_3_in.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_1_2.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_2_2.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_3_2.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_1_3.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_2_3.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_3_3.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_1_1.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_2_1.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_tv_Anchor_3_1.jpg} \end{minipage}\\\vspace{-.1cm} (a)\hspace{.22\textwidth}(b)\hspace{.22\textwidth}(c)\hspace{.22\textwidth}(d)\\ \setcounter{subfigure}{0} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_y_car_in_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_y_car_2_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_y_car_3_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_y_car_1_.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_1_in.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_2_in.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_3_in.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_1_2.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_2_2.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_3_2.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_1_3.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_2_3.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_3_3.jpg} \end{minipage} \begin{minipage}[b]{.24\textwidth} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_1_1.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_2_1.jpg} \includegraphics[width=.315\textwidth]{fig_ponceData_y_car_3_1.jpg} \end{minipage}\\\vspace{-.1cm} (e)\hspace{.22\textwidth}(f)\hspace{.22\textwidth}(g)\hspace{.22\textwidth}(h) \caption{Test set from \cite{Hyun2014}. (a,e) Blurry image; (b,f) Kim and Lee \cite{Hyun2014}; (c,g) Sun \etal \cite{sun2015learning}; (d,h) \emph{DeblurNet}$^\text{WILD}$. \label{fig:ponce2}} \end{figure} \begin{figure} \centering \setcounter{subfigure}{0} \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_in_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_2_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_3_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_in.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_in.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_in.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_in.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_2.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_2.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_2.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_2.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_3.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_3.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_3.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_3.jpg} \end{minipage} \\\vspace{-.1cm} (a)\hspace{.3\textwidth}(b)\hspace{.3\textwidth}(c)\\ \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_4_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_5_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width= 1 \textwidth]{fig_ali-_1_.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_4.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_4.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_4.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_4.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_5.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_5.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_5.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_5.jpg} \end{minipage} \begin{minipage}[b]{.32\textwidth} \includegraphics[width=.235\textwidth]{fig_ali-_1_1.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_2_1.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_3_1.jpg} \includegraphics[width=.235\textwidth]{fig_ali-_4_1.jpg} \end{minipage} \\\vspace{-.1cm} (d)\hspace{.3\textwidth}(e)\hspace{.3\textwidth}(f) \caption{Test set from the Canon camera. (a) Blurry image; (b) Xu \etal \cite{xu2013unnatural}; (c) Sun \etal \cite{sun2015learning}; (d) Xu and Jia \cite{Xu2010}; (e) \emph{DeblurNet}$^\text{SI}$; (f) \emph{DeblurNet}$^\text{WILD}$.\label{fig:canon}} \end{figure} \noindent\textbf{WILD test set evaluation.} The videos in the test set were captured at locations different from those where training data was captured. Also, incidentally, the weather conditions during the capture of the test set were significantly different from those of the training set. We randomly chose $15$ images from the test-set and compared the performance of our method against the methods in \cite{Xu2010}, \cite{sun2015learning}, the space-varying implementation of the method in \cite{xu2013unnatural}, and \emph{DeblurNet}$^\text{WILD}$ trained network. An example image is shown in Fig.~\ref{fig:test2}. As can be observed, blur variation due to either object motion or depth changes is the major cause of artifacts. Our \emph{DeblurNet}$^\text{WILD}$ network, however, produces artifact-free sharp images. While the example in Fig.~\ref{fig:test2} gives only a qualitative evaluation, in Table~\ref{tbl:psnr} we report quantitative results. \begin{wraptable}{r}{7.5cm} \begin{tabular}{ @{\hspace{0em}} c @{\hspace{.7em}} c @{\hspace{.7em}} c @{\hspace{.7em}} c @{\hspace{.7em}} c @{\hspace{0em}} } \hline \cite{sun2015learning} & \cite{Xu2010} & \cite{xu2013unnatural} & \emph{DeblurNet}$^\text{SI}$ & \emph{DeblurNet}$^\text{WILD}$ \\ \hline $25.48$ & $23.61$ & $22.50$ & $25.8$ & $\mathbf{28.1}$ \\ \hline \\ \end{tabular}\vspace{-.5cm} \caption{Average PSNR on our WILD test set.\label{tbl:psnr}} \end{wraptable} We measure the performance of all the above methods in terms of Peak Signal-to-Noise Ratio (PSNR) by using the reference sharp image as in standard image deblurring performance evaluations. We can see that the performance of the \emph{DeblurNet}$^\text{WILD}$ is better than that of the \emph{DeblurNet}$^\text{SI}$. This is not surprising because the shift-invariant training set does not capture factors such as reflections/specularities, the space-varying blur, occlusions and coming into view of objects. Notice that the PSNR values are not comparable to those seen in shift-invariant deconvolution algorithms. \noindent\textbf{Qualitative evaluation.} On other available \emph{dynamic scene blur} datasets the ground truth is not available. Therefore, we can only evaluate our proposed network qualitatively. We consider $2$ available datasets and images obtained from a Canon EOS 5D Mark II camera. While Figs.~\ref{fig:ponce2} and \ref{fig:ponce1} show data from \cite{sun2015learning} and \cite{Hyun2014} respectively, Fig.~\ref{fig:canon} shows images from the Canon camera. In Fig.~\ref{fig:canon}, we compare the methods of \cite{Xu2010}, \cite{sun2015learning} and \cite{xu2013unnatural} to both our \emph{DeblurNet}$^\text{SI}$ and \emph{DeblurNet}$^\text{WILD}$ networks. In all datasets, we observe that our method is able to return sharper images with fine details. Furthermore, we observe that in Fig.~\ref{fig:canon} the \emph{DeblurNet}$^\text{WILD}$ network produces better results than the \emph{DeblurNet}$^\text{SI}$ network, which confirms once more our expectations. \begin{figure*}[t] \centering \begin{minipage}[b]{.325\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_people_in_.jpg} \end{minipage} \begin{minipage}[b]{.325\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_people_2_.jpg} \end{minipage} \begin{minipage}[b]{.325\textwidth} \includegraphics[width= 1 \textwidth]{fig_ponceData_people_1_.jpg} \end{minipage} \begin{minipage}[b]{.325\textwidth} \includegraphics[width=.235\textwidth]{fig_ponceData_people_1_in.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_2_in.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_3_in.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_4_in.jpg} \end{minipage} \begin{minipage}[b]{.325\textwidth} \includegraphics[width=.235\textwidth]{fig_ponceData_people_1_2.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_2_2.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_3_2.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_4_2.jpg} \end{minipage} \begin{minipage}[b]{.325\textwidth} \includegraphics[width=.235\textwidth]{fig_ponceData_people_1_1.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_2_1.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_3_1.jpg}\hfill\includegraphics[width=.235\textwidth]{fig_ponceData_people_4_1.jpg} \end{minipage}\\\vspace{-.1cm} (a)\hspace{.3\textwidth}(b)\hspace{.3\textwidth}(c) \caption{Test dataset from \cite{sun2015learning}. (a) Blurry image, (b) Sun \etal\cite{sun2015learning}, (c) \emph{DeblurNet}$^\text{WILD}$.\label{fig:ponce1}} \end{figure*} \noindent\textbf{Shift-invariant blur evaluation.} We provide a brief analysis on the differences between dynamic scene deblurring and shift-invariant motion deblurring. We use an example from the standard dataset of \cite{Kohler2012}, where blur is due to camera shake (see Fig.~\ref{fig:shift}). In the case of a shift-invariant blur, there are infinite $\{$blur, sharp image$\}$ pairs that yield the same blurry image when convolved. More precisely, an unknown 2D translation (shift) in a sharp image $f$ can be compensated by an opposite 2D translation in the blur kernel $k$, that is, $\forall\Delta$, $g(x) = \int f(y+\Delta)k(x-y-\Delta) dy.$ Because of such ambiguity, current evaluations compute the PSNR for all possible 2D shifts of $f$ and pick the highest PSNR. The analogous search is done for camera shake \cite{Kohler2012}. However, with a dynamic scene we have ambiguous shifts at every pixel (see Fig.~\ref{fig:shift}) and such search is unfeasible (the image deformation is undefined). Therefore, all methods for dynamic scene blur would be at a disadvantage with the current shift-invariant blur evaluation methods, although their results might look qualitatively good. \begin{figure}[t] \includegraphics[height= .185 \textwidth]{deblurred2.png} \includegraphics[height= .185 \textwidth]{true2.png} \includegraphics[height= .185 \textwidth]{p1_mod_col2.png} \includegraphics[height= .185 \textwidth]{p2_mod_col2.png}\\\vspace{-.1cm} (a)\hspace{.17\textwidth}(b)\hspace{.22\textwidth}(c)\hspace{.27\textwidth}(d)\hspace{.06\textwidth} \caption{Kohler dataset \cite{Kohler2012} (image 1, blur 4). (a) our result. (b) ground truth. (c,d) Zoomed-in patches. Local ambiguous shifts are marked with white arrows.}\label{fig:shift} \end{figure} \begin{figure}[t] \includegraphics[trim = {5cm 1cm 2cm 2cm}, width= .5 \textwidth]{gif_res_vis_plot.jpg} \caption{Normalized average blur size versus normalized residual magnitude plot. Notice the high level of correlation between the blur size and the residual magnitude. \label{fig:plot}} \end{figure} \begin{figure} \centering \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_b_27_b.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_b_27_rb.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_b_27_ob.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_b_27_s.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_s_3_b.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_s_3_rb.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_s_3_ob.jpg} \end{minipage} \begin{minipage}[b]{.245\textwidth} \includegraphics[width= 1 \textwidth]{gif_res_vis_s_3_s.jpg} \end{minipage} \caption{The images with highest (first row) and lowest (second row) residual norm in the output layer. The image in the first column is the input, the second column shows the estimated residual (the network output), the third column is the deblurred image (first column + second column), and finally the forth column is the ground truth. \label{fig:analysis}} \end{figure} \noindent\textbf{Analysis.} Our network generates a residual image that when added to the blurry input yields the sharp image. Therefore, we expect the magnitude of the residual to be large for very blurry images, as more changes will be required. To validate this hypothesis we perform both quantitative and qualitative experiments. We take $700$ images from another WILD test set (different from the $15$ images used in the previous quantitative evaluation), provide them as input to the \emph{DeblurNet}$^\text{WILD}$ network, and calculate the $L^1$ norm of the network residuals (the output of the last layer of $N_3$). In Fig.~\ref{fig:analysis} we show two images, one with the highest and one with the lowest $L^1$ norm. We see that the residuals with the highest norms correspond to highly blurred images, and vice versa for the low norm residuals. We also show quantitatively that there is a clear correlation between the amount of blur and the residual $L^1$ norm. As mentioned earlier on, our WILD dataset also computes an estimate of the blurs by integrating the optical flow. We use this blur estimate to calculate the average blur size across the blurry image. This gives us an approximation of the overall amount of blur in an image. In Fig.~\ref{fig:plot} we show the plot of the $L^1$ norm of the residual versus the average estimated blur size for all $700$ images. The residual magnitudes and blur sizes are normalized so that mean and standard deviation are $0$ and $1$ respectively. \section{Conclusions} We proposed DeblurNet, a novel CNN architecture that regresses a sharp image given a blurred one. DeblurNet is able to restore blurry images under challenging conditions, such as occlusions, motion parallax and camera rotations. The network consists of a chain of $3$ subgraphs, which implement a multiscale strategy to break down the complexity of the deblurring task. Moreover, each subgraph outputs only a residual image that yields the sharp image when added to the input image. This allows the subgraph to focus on small details as confirmed experimentally. An important part of our solution is the design of a sufficiently realistic dataset. We find that simple frame averaging combined with a very high frame-rate video camera produces reasonable blurred-sharp image pairs for the training of our DeblurNet network. Indeed, both quantitative and qualitative results show state of the art performance when compared to prior dynamic scene deblurring work. We observe that our network does not generate artifacts, but may leave extreme blurs untouched. {\smallskip \noindent\textbf{Acknowledgements.} Paolo Favaro acknowledges support from the Swiss National Science Foundation on project 200021\_153324. } \bibliographystyle{splncs03}
{'timestamp': '2017-08-30T02:07:14', 'yymm': '1701', 'arxiv_id': '1701.01486', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01486'}
arxiv
\section{Introduction} Interference management has been taken into account as one of the most challenging issues to increase the throughput of cellular networks serving multiple users. In multiuser cellular environments, each receiver may suffer from intra-cell and inter-cell interference. Interference alignment (IA) was proposed by fundamentally solving the interference problem when there are multiple communication pairs~\cite{V_Cadambe08_TIT}. It was shown that the IA scheme can achieve the optimal degrees-of-freedom (DoF)\footnote{It is referred that `optimal' DoF is achievable if the outer-bound on DoF for given network configuration is achievable. } in the multiuser interference channel with time-varying channel coefficients. Subsequent studies have shown that the IA is also useful and indeed achieves the optimal DoF in various wireless multiuser network setups: multiple-input multiple-output (MIMO) interference channels~\cite{K_Gomadam11_TIT, T_Gou10_TIT} and cellular networks~\cite{C_Suh11_TC,C_Suh08_Allerton}. In particular, IA techniques~\cite{C_Suh11_TC,C_Suh08_Allerton} for cellular uplink and downlink networks, also known as the interfering multiple-access channel (IMAC) or interfering broadcast channel (IBC), respectively, have received much attention. The existing IA framework for cellular networks, however, still has several practical challenges: the scheme proposed in~\cite{C_Suh08_Allerton} requires arbitrarily large frequency/time-domain dimension extension, and the scheme proposed in~\cite{C_Suh11_TC} is based on iterative optimization of processing matrices and cannot be optimally extended to an arbitrary downlink cellular network in terms of achievable DoF. In the literature, there are some results on the usefulness of fading in single-cell downlink broadcast channels, where one can obtain multiuser diversity gain along with user scheduling as the number of users is sufficiently large: opportunistic scheduling~\cite{R_Knopp95_ICC}, opportunistic beamforming~\cite{P_Viswanath02_TIT}, and random beamforming~\cite{M_Sharif05_TIT}. Scenarios exploiting multiuser diversity gain have been studied also in ad hoc networks~\cite{W_Shin14_TIT}, cognitive radio networks~\cite{T_Ban09_TWC}, and cellular networks~\cite{W_Shin12_TC}. Recently, the concept of opportunistic IA~(OIA) was introduced in~\cite{B_Jung11_CL,B_Jung11_TC,H_Yang13_TWC} for the $K$-cell uplink network (i,e., IMAC model), where there are one $M$-antenna base station (BS) and $N$ users in each cell. The OIA scheme incorporates user scheduling into the classical IA framework by opportunistically selecting $S$ ($S\le M$) users amongst the $N$ users in each cell in the sense that inter-cell interference is aligned at a pre-defined interference space. It was shown in~\cite{B_Jung11_TC,H_Yang13_TWC} that one can asymptotically achieve the optimal DoF if the number of users in a cell scales as a certain function of the signal-to-noise-ratio (SNR). For the $K$-cell downlink network (i.e., IBC model) assuming one $M$-antenna base station (BS) and $N$ per-cell users, studies on the OIA have been conducted in~\cite{W_Shin12_IEICE, J_Jose12_Allerton, J_Lee13_TWC, H_Nguyen13_TSP,H_Nguyen13_arXiv, J_Lee13_arXiv}. More specifically, the user scaling condition for obtaining the optimal DoF was characterized for the $K$-cell multiple-input single-output (MISO) IBC~\cite{W_Shin12_IEICE}, and then such an analysis of the DoF achievability was extended to the $K$-cell MIMO IBC with $L$ receive antennas at each user~\cite{J_Jose12_Allerton, J_Lee13_TWC, H_Nguyen13_TSP,H_Nguyen13_arXiv, J_Lee13_arXiv}---full DoF can be achieved asymptotically, provided that $N$ scales faster than ${\mathsf{SNR}}^{KM-L}$, for the $K$-cell MIMO IBC using OIA~\cite{H_Nguyen13_arXiv, J_Lee13_arXiv}. In this paper, we propose an \textit{opportunistic downlink IA (ODIA)} framework as a promising interference management technique for $K$-cell downlink networks, where each cell consists of one BS with $M$ antennas and $N$ users having $L$ antennas each. The proposed ODIA jointly takes into account user scheduling and downlink IA issues. In particular, inspired by the precoder design in~\cite{C_Suh11_TC}, we use two cascaded beamforming matrices to construct our precoder at each BS. To design the first transmit beamforming matrix, we use a user-specific beamforming, which conducts a linear zero-forcing (ZF) filtering and thus eliminates intra-cell interference among spatial streams in the same cell. To design the second transmit beamforming matrix, we use a predetermined reference beamforming matrix, which plays the same role of random beamforming for cellular downlink~\cite{W_Shin12_IEICE, H_Nguyen13_arXiv, J_Lee13_arXiv} and thus efficiently reduces the effect of inter-cell interference from other-cell BSs. On the other hand, the receive beamforming vector is designed at each user in the sense of minimizing the total amount of received inter-cell interference using \textit{local} channel state information (CSI) in a decentralized manner. Each user feeds back both the effective channel vector and the quantity of received inter-cell interference to its home-cell BS. The user selection and transmit beamforming at the BSs and the design of receive beamforming at the users are completely decoupled. Hence, the ODIA operates in a non-collaborative manner while requiring no information exchange among BSs and no iterative optimization between transmitters and receivers, thereby resulting in an easier implementation. The main contribution of this paper is four-fold as follows. \begin{itemize} \item We first show that the minimum number of users required to achieve $S$ DoF ($S\le M$) can be fundamentally reduced to $\mathsf{SNR}^{(K-1)S-L+1}$ by using the ODIA at the expense of acquiring perfect CSI at the BSs from users, compared to the existing downlink IA schemes requiring the user scaling law $N=\omega(\mathsf{SNR}^{KS-L})$~\cite{H_Nguyen13_arXiv, J_Lee13_arXiv},\footnote{$f(x) = \omega(g(x))$ implies that $\lim_{x \rightarrow \infty} \frac{g(x)}{f(x)}=0$.} where $S$ denotes the number of spatial streams per cell. The interference decaying rate with respect to $N$ for given SNR is also characterized in regards to the derived user scaling law. \item We introduce a limited feedback strategy in the ODIA framework, and then analyze the required number of feedback bits leading to the same DoF performance as that of the ODIA assuming perfect feedback, which is given by $\omega\left( \operatorname{log}_2 \mathsf{SNR}\right)$. \item We present a user scheduling method for the ODIA to achieve optimal multiuser diversity gain, i.e., $\operatorname{log}\log N$ per stream even in the presence of downlink inter-cell interference. \item To verify the ODIA schemes, we perform numerical evaluation via computer simulations. Simulation results show that the proposed ODIA significantly outperforms existing interference management and user scheduling techniques in terms of sum-rate in realistic cellular environments. \end{itemize} The remainder of this paper is organized as follows. Section \ref{SEC:system} describes the system and channel models. Section \ref{SEC:OIA} presents the overall procedure of the proposed ODIA. In Section \ref{sec:achievability}, the DoF achievablility result is shown. Section \ref{SEC:OIA_limited} presents the ODIA scheme with limited feedback. In Section \ref{SEC:Threhold_ODIA}, the achievability of the spectrally efficient ODIA leading to a better sum-rate performance is characterized. Numerical results are shown in Section \ref{SEC:Sim}. Section \ref{SEC:Conc} summarizes the paper with some concluding remarks. \section{System and Channel Models} \label{SEC:system} We consider a $K$-cell MIMO IBC where each cell consists of a BS with $M$ antennas and $N$ users with $L$ antennas each. The number of selected users in each cell is denoted by $S (\le M)$. It is assumed that each selected user receives a single spatial stream. To consider nontrivial cases, we assume that $L < (K-1)S +1$, because all inter-cell interference can be completely canceled at the receivers (i.e., users) otherwise. Moreover, the number of antennas at the users is in general limited due to the size of the form factor, and hence it is more safe to assume that $L$ is relatively small compared to $(K-1)S+1$. The channel matrix from the $k$-th BS to the $j$-th user in the $i$-th cell is denoted by $\mathbf{H}_{k}^{[i,j]}\in \mathbb{C}^{L \times M}$, where $i,k\in \mathcal{K} \triangleq \{ 1, \ldots, K\}$ and $j \in \mathcal{N} \triangleq \{1, \ldots, N\}$. Each element of $\mathbf{H}_k^{[i,j]}$ is assumed to be independent and identically distributed (i.i.d.) according to $\mathcal{CN}(0,1)$. In addition, quasi-static frequency-flat fading is assumed, i.e., channel coefficients are constant during one transmission block and change to new independent values for every transmission block. The $j$-th user in the $i$-th cell can estimate the channels $\mathbf{H}_{k}^{[i,j]}$, $k=1, \ldots, K$, using pilot signals sent from all the BSs. The received signal vector at the $j$-th user in the $i$-th cell is expressed as: \begin{align} \label{eq:received_y} \mathbf{y}^{[i,j]} &= \sum_{k=1}^{K}\mathbf{H}_{k}^{[i,j]} \mathbf{s}_k+ \mathbf{z}^{[i,j]}, \end{align} where $\mathbf{s}_k\in\mathbb{C}^{M \times 1}$ is the transmit signal vector at the $k$-th BS with unit average power, i.e., $E \left\|\mathbf{s}_k\right\|^2 = 1$, and $\mathbf{z}^{[i,j]} \in \mathbb{C}^{L \times 1}$ denotes additive noise, each element of which is independent and identically distributed complex Gaussian with zero mean and the variance of $N_0$. The average SNR is given by $\mathsf{SNR} = {\mathbb{E}\left[\left\| \mathbf{H}_i^{[i,j]}\mathbf{s}_i \right\|^2 \right]}/{\mathbb{E}\left[ \left\| \mathbf{z}^{[i,j]}\right\|^2 \right]} = {1}/{N_0}$. Thus, in what follows we shall use the notation $N_0 = \mathsf{{SNR}^{-1}}$ for notational simplicity. Figure \ref{fig:system_model} shows an example of the MIMO IBC model, where $K=3$, $M=3$, $S=2$, $L=3$, and $N=2$. The details in the figure will be described in the subsequent section. \begin{figure*} \label{fig:system_model} \begin{center} \includegraphics[width=0.87\textwidth]{three_cell_IBC2.eps}\\ \caption{The MIMO IBC model, where $K=3$, $M=3$, $S=2$, $L=3$, and $N=2$.}\label{fig:system_model} \end{center} \end{figure*} \section{Proposed ODIA} \label{SEC:OIA} We first describe the overall procedure of our proposed ODIA scheme for the MIMO IBC, and then define its achievable sum-rate and DoF. \subsection{Overall Procedure} \label{subsec:overall} The ODIA scheme is described according to the following four steps. \subsubsection{Initialization (Broadcast of Reference Beamforming Matrices)} The reference beamforming matrix at the BS in the $k$-th cell is given by $\mathbf{P}_k = \left[ \mathbf{p}_{1,k}, \ldots, \mathbf{p}_{S,k}\right]$, where $\mathbf{p}_{s,k} \in \mathbb{C}^{M \times 1}$ is an \textcolor{black}{orthonormal vector} for $k\in \mathcal{K}$ and $s =1, \ldots, S$. \textcolor{black}{That is, $\mathbf{P}_k$ is an orthonormal basis for an $S$-dimensional subspace of $\mathbb{C}^{M \times M}$.} \textcolor{black}{Each BS randomly generates $\mathbf{P}_{k}$ independently of the other BSs.} If the reference beamforming matrix is generated in a pseudo-random fashion, i.e., it changes based on a certain pattern as if it changes randomly and the pattern is known by the BSs as well as the users, BSs do not need to broadcast them to users. Then, the $j$-th user in the $i$-th cell obtains $\mathbf{H}^{[i,j]}_{k}$ and $\mathbf{P}_k$, $k=1, \ldots, K$. \subsubsection{Receive Beamforming \& Scheduling Metric Feedback} In the second step, we explain how to decide a user scheduling metric at each user along with given receive beamforming, where the design of receive beamforming will be explained in Section~\ref{sec:achievability}. Let $\mathbf{u}^{[i,j]} \in \mathbb{C}^{L \times 1}$ denote the unit-norm weight vector at the $j$-th user in the $i$-th cell, i.e., $\left\| \mathbf{u}^{[i,j]} \right\|^2 = 1$. Note that the user-specific beamforming $\mathbf{V}_k$ will be utilized only to cancel intra-cell interference out, and the inter-cell interference will be suppressed from user scheduling, which will be specified later. Thus, from the notion of $\mathbf{P}_k$ and $\mathbf{H}^{[i,j]}_{k}$, the $j$-th user in the $i$-th cell can compute the following quantity while using its receive beamforming vector $\mathbf{u}^{[i,j]}$, which is given by \begin{align}\label{eq:eta_tilde} \tilde{\eta}^{[i,j]}_{k} &= \left\| {\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}_{k}^{[i,j]} \mathbf{P}_k \right\|^2, \end{align} where $i\in \mathcal{K}$, $j \in \mathcal{N} $, and $k\in \mathcal{K}\setminus i= \{1, \ldots, i-1, i+1, \ldots, K\}$. Using (\ref{eq:eta_tilde}), the scheduling metric at the $j$-th user in the $i$-th cell, denoted by $\eta^{[i,j]}$, is defined as the sum of $\tilde{\eta}^{[i,j]}_{k}$. That is, \begin{align} \label{eq:eta} \eta^{[i,j]} &= \sum_{k=1, k\neq i}^{K} \tilde{\eta}^{[i,j]}_{k}. \end{align} As illustrated in Fig. \ref{fig:system_model}, each user feeds the metric in (\ref{eq:eta}) back to its home-cell BS. In addition to the scheduling metric in (\ref{eq:eta}), for each BS to design the user-specific beamforming $\mathbf{V}_k$, each user needs to feed back the information of the following vector \begin{equation} \label{eq:effective_CH} \mathbf{f}_{i}^{[i,j]} \triangleq \left({\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{H}^{[i,j]}_i \mathbf{P}_ i\right)^{\mathsf{H}}. \end{equation} \subsubsection{User Scheduling} Upon receiving $N$ users' scheduling metrics in the serving cell, each BS selects $S$ users having the metrics up to the $S$-th smallest one. Without loss of generality, the indices of selected users in every cell are assumed to be $(1, \ldots, S)$. Although $\tilde{\eta}^{[i,j]}_{k}$ is not exactly the amount of the generating interference from the $k$-th BS to the $j$-th user in the $i$-th cell due to the absence of $\mathbf{V}_k$, it decouples the design of the user-specific precoding matrix $\mathbf{V}_k$ from the user scheduling metric calculation, i.e., $\eta^{[i,j]}_{k}$ includes no information of $\mathbf{V}_k$. In addition, we shall show in the sequel that the inter-cell interference can be successfully suppressed by using the metric $\eta^{[i,j]}_{k}$ even with $\mathbf{V}_k$ excluded and that the optimal DoF can be achieved. At this point, it is worthwhile to note that the role of $\mathbf{P}_k$ is two-fold. First, it determines the dimension of the effective received channel according to given parameter $S$. By multiplying $\mathbf{P}_k$ to the channel matrix, the dimension of the effective channel is reduced to $S$ rather than $M$, which results in reduced number of inter-cell interference terms as well as reduced average interference level for each interference term. We shall show in the sequel that $\mathbf{P}_k$ plays a role in the end of rendering the user scaling law dependent on the parameter $S$. Second, $\mathbf{P}_k$ separates the user scheduling procedure from the user-specific precoding matrix design of $\mathbf{V}_k$ and also from the receiver beamforming vector design of $\mathbf{u}_k$. By employing the cascaded precoding matrix design, the scheduling metric in (1) becomes independent of $\mathbf{V}_k$ or $\mathbf{u}_k$, and $\mathbf{u}_k$ can be obtained as a function of only $\mathbf{H}_k^{[i,j]}$ and $\mathbf{P}_k$ as shown in (\ref{eq:u_design}). The reason why $\mathbf{P}_k$ is designed to change in a pseudo-random fashion is to increase the fairness of the users scheduling by randomizing the scheduling metric of each user, but can also be fixed if the fairness is not a matter or the channel changes fast enough. In addition, if one wants to further improve the achievable rate, $\mathbf{P}_k$ may be channel-specifically designed combined with the user scheduling, which however results in a collaborative and iterative user scheduling and precoding matrix design. In this and subsequent sections, we focus on how to simply design a user scheduling method to guarantee the optimal DoF. An enhanced scheduling algorithm jointly taking into account the vector to be fed back in (\ref{eq:effective_CH}) and the scheduling metric in (\ref{eq:eta}) may provide a better performance in terms of sum-rate, which shall be discussed in Section \ref{SEC:Threhold_ODIA}. \subsubsection{Transmit Beamforming \& Downlink Data Transmission} As illustrated in Fig.~\ref{fig:system_model}, the precoding matrix at each BS is composed of the product of the predetermined reference beamforming matrix $\mathbf{P}_k$ and the user-specific precoding matrix $\mathbf{V}_i = \left[ \mathbf{v}^{[i,1]}, \ldots, \mathbf{v}^{[i,S]}\right]$, where $\mathbf{v}^{[i,s]} \in \mathbb{C}^{S \times 1}$, $i\in \mathcal{K}$. Let us denote the transmit symbol at the $i$-th BS transmitted to the $j$-th user by $x^{[i,j]}$, where $E\left| x^{[i,s]} \right|^2=1/S$ for $s=1, \ldots, S$. Denoting the transmit symbol vector by $\mathbf{x}_i = \left[ x^{[i,1]}, \ldots, x^{[i,S]}\right]^T$, the transmit signal vector at the $i$-th BS is given by $\mathbf{s}_i = \mathbf{P}_i \mathbf{V}_i \mathbf{x}_i$, and the received signal vector at the $j$-th user in the $i$-th cell is written as \begin{align} \label{eq:rec_vector} \mathbf{y}^{[i,j]} &= \mathbf{H}_i^{[i,j]}\mathbf{P}_i \mathbf{V}_i \mathbf{x}_i + \sum_{k=1, k\neq i}^{K} \mathbf{H}_k^{[i,j]}\mathbf{P}_k \mathbf{V}_k \mathbf{x}_k + \mathbf{z}^{[i,j]} \nonumber \\ &= \underbrace{\mathbf{H}_i^{[i,j]}\mathbf{P}_i \mathbf{v}^{[i,j]} x^{[i,j]}}_{\textsf{desired signal}} + \underbrace{\sum_{s=1, s\neq j}^{S} \mathbf{H}_i^{[i,j]}\mathbf{P}_i \mathbf{v}^{[i,s]} x^{[i,s]}}_{\textsf{intra-cell interference}} \nonumber \\ & + \underbrace{\sum_{k=1, k\neq i}^{K} \mathbf{H}_k^{[i,j]}\mathbf{P}_k \mathbf{V}_k \mathbf{x}_k}_{\textsf{inter-cell interference}} + \mathbf{z}^{[i,j]}. \end{align} The received signal vector after receive beamforming, denoted by $\tilde{y}^{[i,j]} = {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{y}^{[i,j]}$, can be rewritten as: \begin{align}\label{eq:rec_vector_after_BF} \tilde{y}^{[i,j]} &= {\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}} \mathbf{v}^{[i,j]} x^{[i,j]} +{\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\sum_{s=1, s\neq j}^{S} \mathbf{v}^{[i,s]} x^{[i,s]} \nonumber \\ &+ \sum_{k=1, k\neq i}^{K} {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \mathbf{V}_k \mathbf{x}_k + {\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{z}^{[i,j]}, \end{align} where ${\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}}={\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}_k^{[i,j]}\mathbf{P}_k$. By selecting users with small $\eta^{[i,j]}$ in (\ref{eq:eta}), $\mathbf{H}_k^{[i,j]}\mathbf{P}_k$ tends to be orthogonal to the receive beamforming vector $\mathbf{u}^{[i,j]}$; thus, inter-cell interference channel matrices $\mathbf{H}_k^{[i,j]}\mathbf{P}_k\mathbf{V}_k$ in (\ref{eq:rec_vector_after_BF}) also tend to be orthogonal to $\mathbf{u}^{[i,j]}$ as illustrated in Fig. \ref{fig:system_model}. To cancel out intra-cell interference, the user-specific beamforming matrix $\mathbf{V}_i \in \mathbb{C}^{S \times S}$is given by \begin{align} \label{eq:ZF_BF} \mathbf{V}_i &= [\mathbf{v}^{[i,1]},\mathbf{v}^{[i,2]}, \ldots, \mathbf{v}^{[i,S]}] \nonumber \\ &= \begin{bmatrix} {\mathbf{u}^{[i,1]}}^{\mathsf{H}} \mathbf{H}_i^{[i,1]} \mathbf{P}_i \\ {\mathbf{u}^{[i,2]}}^{\mathsf{H}} \mathbf{H}_i^{[i,2]} \mathbf{P}_i \\ \vdots \\ {\mathbf{u}^{[i,S]}}^{\mathsf{H}} \mathbf{H}_i^{[i,S]} \mathbf{P}_i \end{bmatrix}^{-1} \cdot \begin{bmatrix} \sqrt{\gamma^{[i,1]}} & 0 & \cdots & 0 \\ 0 & \sqrt{\gamma^{[i,2]}} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \sqrt{\gamma^{[i,S]}} \\ \end{bmatrix}, \end{align} \label{line:gamma:start}where $\sqrt{\gamma^{[i,j]}}$ denotes a normalization factor for satisfying the unit-transmit power constraint for each spatial stream, i.e., $\gamma^{[i,j]} = 1/\left\| \mathbf{P}_i \mathbf{v}^{[i,j]} \right\|$.\label{line:gamma:end} In consequence, the received signal can be simplified to \begin{align}\label{eq:rec_vector_ZF_BF} \tilde{y}^{[i,j]} &= \sqrt{\gamma^{[i,j]}} x^{[i,j]} + \underbrace{\sum_{k=1, k\neq i}^{K} {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}}\mathbf{V}_k \mathbf{x}_k}_{\textsf{inter-cell interference}} + {\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{z}^{[i,j]}, \end{align} which thus does not contain the intra-cell interference term. As in \cite{N_Jindal06_TIT,T_Yoo07_JSAC,J_Thukral09_ISIT,R_Krishnamachari10_ISIT,S_Pereira07_Asilomar,B_Jung11_TC}, we assume no loss in exchanging signaling messages such as information of effective channels, scheduling metrics, and receive beamforming vectors. \subsection{Achievable Sum-Rate and DoF}\label{subsec:sum_rate} From (\ref{eq:rec_vector_ZF_BF}), the achievable rate of the $j$-th user in the $i$-th cell is given by \begin{align} \label{eq:data_rate_single_user} R^{[i,j]}&=\operatorname{log}_2 \left( 1+ \mathsf{SINR}^{[i,j]} \right) \nonumber \\ &= \operatorname{log}_2 \left( 1+ \frac{ \gamma^{[i,j]} \cdot |x^{[i,j]}|^2}{\left|{{\mathbf{u}^{[i,j]}}^{\mathsf{H}}} \mathbf{z}^{[i,j]}\right|^2+\tilde{I}^{[i,j]}} \right) \nonumber \\ & =\operatorname{log}_2 \left( 1+ \frac{ \gamma^{[i,j]} }{\frac{S}{\mathsf{SNR}} + \sum_{k=1, k\neq i}^{K} \sum_{s=1}^{S} \left| {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \mathbf{v}^{[k,s]}\right|^2 } \right), \end{align} where $\tilde{I}^{[i,j]} \triangleq \sum_{k=1, k\neq i}^{K} \left|{\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \mathbf{V}_k \mathbf{x}_k\right|^2$. Using (\ref{eq:data_rate_single_user}), the achievable total DoF can be defined as \cite{S_Jafar08_TIT} \begin{equation}\label{eq:sum_DoF} \textrm{DoF} = \lim_{\textsf{SNR} \rightarrow \infty} \frac{\sum_{i=1}^{K}\sum_{j=1}^{S}R^{[i,j]}}{\operatorname{log} \textsf{SNR}}. \end{equation} \section{DoF Achievability}\label{sec:achievability} In this section, we characterize the DoF achievability in terms of the user scaling law with the optimal receive beamforming technique. To this end, we start with the receive beamforming design that maximizes the achievable DoF. For given channel instance, from (\ref{eq:data_rate_single_user}), each user can attain the maximum DoF of 1 if and only if the interference $\sum_{k=1, k\neq i}^{K} \sum_{s=1}^{S} \Big|{\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}}\mathbf{v}^{[k,s]}\Big|^2 \cdot \mathsf{SNR}$ remains constant for increasing SNR. Note that $R^{[i,j]}$ can be bounded as \begin{align} \!\!\! &R^{[i,j]} \!\! \ge \!\! \operatorname{log}_2 \!\! \left(\!\!1+ \frac{ \gamma^{[i,j]} }{ \frac{S}{\mathsf{SNR}}+ \sum_{k=1, k\neq i}^{K} \sum_{s=1}^{S} \left\| \mathbf{f}_{k}^{[i,j]}\right\|^2 \left\| \mathbf{v}^{[k,s]}\right\|^2 } \!\!\! \right) \label{eq:data_rate_single_user_bound} \\ & \ge \operatorname{log}_2 \left( 1+ \frac{ \gamma^{[i,j]} }{ \frac{S}{\mathsf{SNR}}+ \sum_{k\neq i}^{K} \sum_{s=1}^{S} \left\| \mathbf{f}_{k}^{[i,j]} \right\|^2 \left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2 } \right) \label{eq:data_rate_single_user_bound2}\\ & = \operatorname{log}_2\left( \mathsf{SNR}\right) + \operatorname{log}_2 \left(\frac{1}{\mathsf{SNR}}+ \frac{ \frac{\gamma^{[i,j]}}{\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2}}{ \frac{S}{\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2}+ I^{[i,j]} } \right), \label{eq:data_rate_single_user_bound3} \end{align} where $\mathbf{v}^{(\operatorname{max})}_{i}$ in (\ref{eq:data_rate_single_user_bound2}) is defined by \begin{align} \label{eq:v_max_def} \mathbf{v}^{(\operatorname{max})}_{i} &= \operatorname{arg} \operatorname{max}\bigg\{ \left\| \mathbf{v}^{[i',j']}\right\|^2: i'\in \mathcal{K}\setminus i, j'\in \mathcal{S}\bigg\}, \end{align} $\mathcal{S} \triangleq \{1, \ldots, S\}$, and $I^{[i,j]}$ in (\ref{eq:data_rate_single_user_bound3}) is defined by \begin{align} I^{[i,j]} \triangleq \sum_{k=1, k\neq i}^{K} \sum_{s=1}^{S}\left\| \mathbf{f}_{k}^{[i,j]}\right\|^2 \cdot \mathsf{SNR}. \end{align} Here, $\mathbf{v}_i^{(\operatorname{max})}$ is fixed for given channel instance, because $\mathbf{v}^{[i,j]}$ is determined by $\mathbf{H}_i^{[i,j]}$, $j=1, \ldots, S$. Recalling that the indices of the selected users are $(1, \ldots, S)$ for all cells, we can expect the DoF of 1 for each user if and only if for some $0 \le \epsilon< \infty$, \begin{equation} I^{[i,j]} < \epsilon, \hspace{10pt} \forall j \in \mathcal{S}, i\in \mathcal{K}. \end{equation} To maximize the achievable DoF, we aim to minimize the sum-interference $\sum_{i=1}^{K} \sum_{j=1}^{S}I^{[i,j]}$ through receive beamforming at the users. Since $I^{[i,j]} = \sum_{s=1}^{S} \eta^{[i,j]} \mathsf{SNR}$, we have \begin{equation} \label{eq:sum_interference_equiv} \sum_{i=1}^{K} \sum_{j=1}^{S}I^{[i,j]} = \sum_{i=1}^{K} \sum_{j=1}^{S}\sum_{s=1}^{S} \eta^{[i,j]} \mathsf{SNR} = S\sum_{i=1}^{K} \sum_{j=1}^{S} \eta^{[i,j]}\mathsf{SNR}. \end{equation} The equation (\ref{eq:sum_interference_equiv}) implies that the collection of distributed effort to minimize $\eta^{[i,j]}$ at the users can reduce the sum of received interference. Therefore, each user finds the beamforming vector that minimizes $\eta^{[i,j]}$ from \begin{align} \label{eq:u_design} \mathbf{u}^{[i,j]} &= \operatorname{arg} \operatornamewithlimits{min}_{\mathbf{u}} \eta^{[i,j]} = \operatorname{arg} \operatornamewithlimits{min}_{\mathbf{u}} \sum_{k=1, k\neq i}^{K} \left\| \mathbf{u}^{\mathsf{H}}\mathbf{H}_{k}^{[i,j]} \mathbf{P}_k \right\|^2. \end{align} Let us denote the augmented interference matrix by \begin{align} \label{eq:G_def} \mathbf{G}^{[i,j]} &\triangleq \Bigg[ \left(\mathbf{H}_{1}^{[i,j]}\mathbf{P}_1\right), \ldots, \left(\mathbf{H}_{i-1}^{[i,j]}\mathbf{P}_{i-1}\right), \left(\mathbf{H}_{i+1}^{[i,j]}\mathbf{P}_{i+1}\right), \nonumber \\ & \quad \quad \quad \ldots, \left(\mathbf{H}_{K}^{[i,j]}\mathbf{P}_{K}\right)\Bigg]^{\mathsf{H}} \in \mathbb{C}^{(K-1)S \times L}, \end{align} and the singular value decomposition of $\mathbf{G}^{[i,j]}$ by \begin{equation} \label{eq:G_SVD} \mathbf{G}^{[i,j]} = \boldsymbol{\Omega}^{[i,j]}\boldsymbol{\Sigma}^{[i,j]}{\mathbf{Q}^{[i,j]}}^{\mathsf{H}}, \displaybreak[0] \end{equation} where $\boldsymbol{\Omega}^{[i,j]}\in \mathbb{C}^{(K-1)S\times L}$ and $\mathbf{Q}^{[i,j]}\in \mathbb{C}^{L\times L}$ consist of $L$ orthonormal columns, and $\boldsymbol{\Sigma}^{[i,j]} = \textrm{diag}\left( \sigma^{[i,j]}_{1}, \ldots, \sigma^{[i,j]}_{L}\right)$, where $\sigma^{[i,j]}_{1}\ge \cdots \ge\sigma^{[i,j]}_{L}$. \pagebreak[0] Then, the optimal $\mathbf{u}^{[i,j]}$ is determined as \begin{equation} \label{eq:W_SVD} \mathbf{u}^{[i,j]}= \mathbf{q}^{[i,j]}_{L}, \end{equation} where $\mathbf{q}^{[i,j]}_{L}$ is the $L$-th column of $\mathbf{Q}^{[i,j]}$. With this choice the scheduling metric is simplified to \begin{equation} \label{eq:LIF_beamforming_simple} \eta^{[i,j]} = {\sigma^{[i,j]}_{L}}^2. \end{equation} Since each column of $\mathbf{P}_k$ is isotropically and independently distributed, each element of the effective interference channel matrix $\mathbf{G}^{[i,j]}$ is i.i.d. complex Gaussian with zero mean and unit variance. \begin{remark}\label{remark:decoupled} In general, the conventional scheduling metric such as SNR or SINR in the IBC is dependent on the precoding matrices at the transmitters, which makes the joint optimization of the precoder design and user scheduling difficult to be separated from each other and implemented with feasible signaling overhead and low complexity. The previous schemes \cite{Q_Shi11_TSP, K_Gomadam11_TIT} for the IBC only consider the design of the precoding matrices and receive filters without any consideration of user scheduling. With the cascaded precoding matrix design, however, the proposed scheme decouples the user scheduling metric calculation and the user-specific precoding matrix $\mathbf{V}_i$, as shown in (\ref{eq:eta_tilde}). In addition, the receive beamforming vector design can also be decoupled from $\mathbf{V}_i$ as shown in (\ref{eq:u_design}). A similar cascaded precoding matrix design was used in \cite{C_Suh11_TC} for some particular cases of the antenna configuration without the consideration of user scheduling. However, the proposed scheme applies to an arbitrary antenna and channel configuration, where the inter-cell interference is suppressed with the aid of opportunistic user scheduling. In addition, we shall show in the sequel that the optimal DoF can be achievable under a certain user scaling condition for an arbitrary antenna configuration without any iterative optimization procedure between the users and BSs. \end{remark} \label{line:remark1:end} \begin{remark}\label{remark:noiteration} Note that although it is assumed in the proposed scheme that each user feeds back the $(1 \times S)$-dimensional vector $\mathbf{f}_i^{[i,j]}$ to its home cell, the amount of CSI feedback is equivalent to that in the conventional single-cell MU-MIMO scheme such as ZF or minimum mean-squared error (MMSE) precoding. On the other hand, the previous iterative transceiver design schemes \cite{Q_Shi11_TSP, K_Gomadam11_TIT} based on local CSI for the IBC require all the selected users to feed back the information of the receive beamformer to all the BSs in the network, which results in $K$ times more feedback compared to the single-cell MU-MIMO scheme even for one iteration where the users feed back their receive beamformers and the BSs update their transmit precoders once. Furthermore, the information of weight coefficients also needs to be fed back to all the BSs in \cite{Q_Shi11_TSP}. We shall show via numerical simulations in the sequel that even with $K$ times less feedback the proposed scheme exhibits superior sum-rate compared to the iterative scheme \cite{Q_Shi11_TSP}. \end{remark} We start with the following lemma to derive the achievable DoF. \begin{lemma}[Lemma 1 \cite{H_Yang13_TWC}] \label{lemma:F_phi} \label{line:lemma:F_phi} The CDF of $\eta^{[i,j]}$, denoted by $F_{\eta}(x)$, can be written as \begin{equation} \label{eq:F_phi} F_{\eta}(x) = c_0 x^{(K-1)S-L+1} + o\left(x^{(K-1)S-L+1} \right), \end{equation} for $0 \le x <1$, where $f(x)=o(g(x))$ means $\lim_{x\rightarrow \infty} \frac{f(x)}{g(x)} = 0$, and $\tilde{c}_0$ is a constant determined by $K$, $S$, and $L$. \end{lemma} We further present the following lemma for the probabilistic interference level of the ODIA. \begin{lemma} \label{lemma:CDF_scaling} The sum-interference remains constant with high probability for increasing SNR, that is, \begin{align} \label{eq:P_def}\mathcal{P}&\triangleq \lim_{\textsf{SNR}\rightarrow \infty} \textrm{Pr} \Bigg\{\sum_{i=1}^{K}\sum_{j=1}^{S} I^{[i,j]} \le \epsilon \Bigg\}=1 \displaybreak[0] \end{align} for any $0<\epsilon<\infty$, if \begin{equation} N = \omega\left( \mathsf{SNR}^{(K-1)S-L+1} \right). \end{equation} \end{lemma} \begin{proof} See appendix \ref{app:lemma2}. \end{proof} Now, the following theorem establishes the DoF achievability of the proposed ODIA. \begin{theorem}[User scaling law] \label{theorem:DoF} The proposed ODIA scheme with the scheduling metric (\ref{eq:LIF_beamforming_simple}) achieves the optimal $KS$ DoF for given $S$ with high probability if \begin{equation} \label{eq:N_scaling} N=\omega\left(\textsf{SNR}^{(K-1)S-L+1}\right). \end{equation} \end{theorem} \begin{proof} If the sum-interference remains constant for increasing SNR with probability $\mathcal{P}$, the achievable rate in (\ref{eq:data_rate_single_user_bound3}) can be further bounded by \begin{align} &R^{[i,j]} \nonumber \\ & \ge \mathcal{P} \! \cdot \! \left[ \operatorname{log}_2\left( \mathsf{SNR}\right)\!\! + \!\! \operatorname{log}_2 \!\! \left( \!\! \frac{1}{\mathsf{SNR}} \! + \! \frac{ \gamma^{[i,j]}/\left(S\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2\right)}{ 1/\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2+ \epsilon } \! \right) \!\! \right], \label{eq:data_rate_single_user_bound5} \end{align} for any $0\le \epsilon < \infty$. Thus, the achievable DoF in (\ref{eq:sum_DoF}) can be bounded by \begin{equation} \label{eq:DoF_SVD_LB} \textrm{DoF} \ge KS \cdot \mathcal{P}. \end{equation} From Lemma \ref{lemma:CDF_scaling}, it is immediate to show that $\mathcal{P}$ tends to 1, and hence $KS$ DoF is achievable if $N = \omega\left( \mathsf{SNR}^{(K-1)S-L+1}\right)$, which proves the theorem. \end{proof} \textcolor{black}{From Theorem \ref{theorem:DoF}, it is shown that there exist a fundamental trade-off between the achievable DoF $KS$ and required user scaling of $N = \omega\left( \mathsf{SNR}^{(K-1)S-L+1}\right)$. This trade-off can also be observed in terms of the sum-rate even under a practical system setup, as we shall show in Section \ref{SEC:Sim}. Therefore, a higher $S$ value can be chosen to achieve higher DoF or sum-rate if there exist more users in the network. } The following remark discusses the uplink and downlink duality on the DoF achievability within the OIA framework. \begin{remark}[Uplink-downlink duality on the DoF achievability] \label{remark:up_down_duality} \label{line:duality_power:start}The same scaling condition of $N=\omega\left( \mathsf{SNR}^{K(S-1)-L+1}\right)$ was achieved to obtain $KS$ DoF in the $K$-cell uplink interference channel \cite{H_Yang13_TWC}, each cell of which is composed of a BS with $M$ antennas and $N$ users each with $L$ antennas. Similarly as in the proposed scheme, the uplink scheme \cite{H_Yang13_TWC} also selects $S$ users that generate the minimal interference to the receivers (BSs). In the uplink scheme, the transmitters (users) perform SVD-based beamforming and the receivers (BSs) employ a ZF equalization, while in the proposed downlink case the transmitters (BSs) perform ZF precoding and the receivers (users) employ SVD-based beamforming. In addition, each transmitter sends the information on effective channel vectors to the corresponding receiver in the uplink case, and vise versa in the downlink case. The transmit power per spatial stream is the same for both the cases. Therefore, Theorem \ref{theorem:DoF} implies that the same DoF is achievable with the same user scaling law for the downlink and uplink cases. \label{line:duality_power:end} \end{remark} The user scaling law characterizes the trade-off between the asymptotic DoF and number of users, i.e., the more number of users, the more achievable DoF. In addition, we relate the derived user scaling law to the interference decaying rate with respect to $N$ for given SNR in the following theorem. \begin{theorem}[Interference decaying rate] \label{theorem:scaling_decay} If the user scaling condition to achieve a target DoF is given by $N = \omega \left( \textsf{SNR}^{\tau'}\right)$ for some $\tau'>0$, then the interference decaying rate is given by \begin{align} E\left\{\frac{1}{\eta^{[i,j]}} \right\} \ge \Theta\left( N^{1/\tau'}\right), \end{align} where $f(x) = \Theta(g(x))$ if $f(x) = O(g(x))$ and $g(x) = O(f(x))$. \end{theorem} \begin{proof} \label{line:theorem2_proof:start}From the proof of Theorem \ref{theorem:DoF}, the user scaling condition to achieve a target DoF is given by $N = \omega \left( \textsf{SNR}^{\tau'}\right)$ if and only if the CDF of $\eta^{[i,j]}$ is given by $a_0 x^{-\tau'} + o(x^{-\tau'})$ for $\tau'>0$. The theorem can be shown by following the footsteps of the proof of \cite[Lemma 4]{H_Yang14_TSP}, and the detailed proof is omitted. \label{line:theorem2_proof:end} \end{proof} From Theorem \ref{theorem:scaling_decay}, the interference decaying rate of the proposed ODIA for the $j$th selected user in the $i$-th cell with respect to $N$ is given by \begin{equation} E\left\{\frac{1}{\eta^{[i,j]}} \right\} \ge \Theta\left( N^{1/((K-1)S-L+1)}\right), \end{equation} which is also the same as the result in the uplink channel \cite{H_Yang14_TSP}. The user scaling law also provides an insight on the interference decaying rate with respect to $N$ for given SNR; that is, the smaller SNR exponent of the user scaling law, the faster interference decreasing rate with respect to $N$. \vspace{20pt} \subsection{Comparison to the previous results}\label{subsec:DoF_comparison} \label{line:comparison1:start}In this subsection, the DoF achievability is compared with the previous results in \cite{H_Nguyen13_arXiv, J_Lee13_TWC, W_Shin12_IEICE}. From \cite[Lemma 4.2]{H_Nguyen13_arXiv}, choosing $M_i = S$ ($S\le M$) therein, where $M_i$ denotes the number of spatial streams in the $i$-th cell, $S$ DoF is achievable per cell, i.e., $KS$ DoF in total, if $N = \Theta\left( \textrm{SNR}^{\rho}\right)$ for $\rho>KS-L$; or equivalently, \begin{align} \label{eq:N_scaling_previous} N = \omega\left( \textrm{SNR}^{KS-L}\right). \end{align} In addition, from \cite[Theorem 6]{J_Lee13_TWC}, choosing $d = S$ ($S\le M$) therein, which is the target DoF for each cell, $KS$ DoF is achievable, under the same scaling condition given in (\ref{eq:N_scaling_previous}). The same conclusion was obtained in \cite{W_Shin12_IEICE}. Intuitively, the exponent of SNR in the user scaling condition represents the number of interference spatial streams after suppression and nulling. Note that the number of total interference spatial streams received at each user is $KS-1$ excluding one desired spatial stream, and that the receive diversity for nulling received interference is $L-1$ leaving one spatial domain for receiving a desired stream. Thus, the exponent of SNR becomes $(KS-1)-(L-1)=KS-L$ as shown in (\ref{eq:N_scaling_previous}). On the other hand, the proposed ODIA pre-nulls $S-1$ intra-cell interference signals at the transmitter, and hence the exponent becomes $(KS-1)-(S-1)-(L-1) = (K-1)S-L+1$ as shown in Theorem \ref{theorem:DoF}. This improvement in the user scaling condition is attributed to the additional CSI feedback of ${\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}_i^{[i,j]} \mathbf{P}_i$, which are used to design the precoding matrix $\mathbf{V}_i$ in (\ref{eq:ZF_BF}). This feedback procedure corresponds to the feedforward of the effective channel vectors in the uplink OIA case \cite{H_Yang13_TWC}. Note that even with this feedback procedure, a straightforward dual transceiver and user scheduling scheme inspired by the uplink OIA would result in an infinitely-iterative optimization between the user scheduling and transceiver design, because the received interference changes according to the precoding matrix and receive beamforming vector. Furthermore, only with the cascaded precoding matrix, the iterative optimization is still needed, since the coupled optimization issue is still there, as shown in \cite{C_Suh11_TC}. It is indeed the proposed ODIA that can achieve the same user scaling condition of the uplink case, i.e., $N = \omega\left( \textrm{SNR}^{(K-1)S-L+1}\right)$, without any iterative design. In addition, the proposed ODIA applies to an arbitrary $M$, $L$, and $K$, whereas the optimal DoF is achievable only in a few special cases in the scheme proposed in \cite{C_Suh11_TC}. \section{ODIA with Limited feedback} \label{SEC:OIA_limited} In the proposed ODIA scheme, the vectors (${\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}^{[i,j]}_{i}\mathbf{P}_i$) in (\ref{eq:effective_CH}) can be fed back to the corresponding BS using pilots rotated by the effective channels \cite{L_Choi04_TWC}. However, this analog feedback requires two consecutive pilot phases for each user: regular pilot for uplink channel estimation and analog feedback for effective channel estimation. Hence, pilot overhead grows with respect to the number of users in the network. As a result, in practical systems with massive users, it is more preferable to follow the widely-used limited feedback approach \cite{D_Love03_TIT}, in which the information of ${\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}^{[i,j]}_{i}\mathbf{P}_i$ is fed back using codebooks. For limited feedback, we define the codebook by \begin{equation} \mathcal{C}_f = \left\{ \mathbf{c}_{1}, \ldots, \mathbf{c}_{N_f}\right\}, \end{equation} where $N_f$ is the codebook size and $\mathbf{c}_k\in \mathbb{C}^{S \times 1}$ is a unit-norm codeword, i.e., $\|\mathbf{c}_i\|^2=1$. Hence, the number of feedback bits used is given by \begin{equation} n_f = \lceil\operatorname{log}_2 N_f \rceil (\textrm{bits}) \end{equation} For ${\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}} = {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{H}^{[i,j]}_{i} \mathbf{P}_i,$ each user quantizes the normalized vector for given $\mathcal{C}_f$ from \begin{align} \label{eq:f_tilde} \tilde{\mathbf{f}}_{i}^{[i,j]} = \operatorname{arg} \operatorname{max}_{ \{\mathbf{w} = \mathbf{c}_k: 1\le k \le N_f\}} \frac{\left| {\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\mathbf{w}\right|^2}{\left\| \mathbf{f}_{i}^{[i,j]}\right\|^2}. \end{align} Now, the user feeds back three types of information: 1) index of $\tilde{\mathbf{f}}_{i}^{[i,j]}$, 2) channel gain of $\left\| \mathbf{f}_{i}^{[i,j]}\right\|^2$, and 3) scheduling metric $\eta^{[i,j]}$. Note that the feedback of scalar information such as channel gains and scheduling metrics can be fed back relatively accurately with a few bits of uplink data, and the main challenge is on the feedback of the angle of vectors \cite{D_Love03_TIT}. Thus, in what follows, the aim is to analyze the impact of the quantized feedback of the index of $\tilde{\mathbf{f}}_{i}^{[i,j]}$. Then, BS $i$ constructs the quantized vectors $\hat{\mathbf{f}}^{[i,j]}$ from \begin{align}\label{eq:f_hat_def} \hat{\mathbf{f}}^{[i,j]} \triangleq \left\| \mathbf{f}_{i}^{[i,j]}\right\|^2 \cdot \tilde{\mathbf{f}}_{i}^{[i,j]}, \hspace{10pt}i=1, \ldots, S, \end{align} and the precoding matrix $\hat{\mathbf{V}}_i$ from \begin{align} \label{eq:V_hat} \hat{\mathbf{V}}_i = \hat{\mathbf{F}}_i^{-1} \boldsymbol{\Gamma}_i, \end{align} where $\boldsymbol{\Gamma}_i = \textrm{diag} \left( \sqrt{\gamma^{[i,1]}}, \ldots, \sqrt{\gamma^{[i,S]}}\right)$ and $\hat{\mathbf{F}}_i = \left[ \hat{\mathbf{f}}^{[i,1]}, \ldots, \hat{\mathbf{f}}^{[i,S]}\right]^{\mathsf{H}}$. With limited feedback, the received signal vector after receive beamforming is written by \begin{align}\label{eq:rec_vector_after_BF_limited} \tilde{y}^{[i,j]} &= {\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\hat{\mathbf{V}}_i \mathbf{x}_i + \cdot \sum_{k=1, k\neq i}^{K} {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \hat{\mathbf{V}}_k \mathbf{x}_k + {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{z}^{[i,j]} \\ & = \sqrt{\gamma^{[i,j]}}x^{[i,j]} + \underbrace{\left( {\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\hat{\mathbf{V}}_i \mathbf{x}_i- \sqrt{\gamma^{[i,j]}}x^{[i,j]}\right)}_{\textrm{residual intra-cell interference}} \nonumber \\ &+ \sum_{k=1, k\neq i}^{K} {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \hat{\mathbf{V}}_k \mathbf{x}_k + {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{z}^{[i,j]}, \end{align} where the residual intra-cell interference is non-zero due to the quantization error in $\hat{\mathbf{V}}_i$. It is important to note that the residual intra-cell interference is a function of $\hat{\mathbf{V}}_i$, which includes other users' channel information, and thus each user treats this term as unpredictable noise and calculates only the inter-cell interference for the scheduling metric as in (\ref{eq:eta}); that is, the scheduling metric is not changed for the ODIA with limited feedback. The following theorem establishes the user scaling law for the ODIA with limited feedback. \begin{theorem} \label{th:codebook} The ODIA with a Grassmannian\footnote{\label{line:footnote_Grassmannian}The Grassmannian codebook refers to a vector codebook having a maximized minimum chordal distance of any two codewords, which can be obtained by solving the Grassmannian line packing problem \cite{D_Love03_TIT}.} or random codebook achieves the same user scaling law of the ODIA with perfect CSI described in Theorem \ref{theorem:DoF}, if \begin{equation} \label{eq:nf_cond0} n_f =\omega\left( \operatorname{log}_2 \mathsf{SNR} \right). \end{equation} That is, $KS$ DoF is achievable with high probability if $N=\omega \left( \mathsf{SNR}^{(K-1)S-L+1}\right)$ and (\ref{eq:nf_cond0}) holds true. \end{theorem} \begin{proof} Without loss of generality, the quantized vector $\hat{\mathbf{f}}^{[i,j]}$ can be decomposed as \begin{align} \label{eq:f_hat2} \hat{\mathbf{f}}^{[i,j]} &= \left\| \mathbf{f}_{i}^{[i,j]}\right\|^2 \cdot \tilde{\mathbf{f}}_{i}^{[i,j]} \nonumber \\ & = \sqrt{1-{d^{[i,j]}}^2}\cdot\mathbf{f}_{i}^{[i,j]}+ d^{[i,j]}\left\|\mathbf{f}_{i}^{[i,j]}\right\|^2 \left(\mathbf{t}^{[i,j]}\right), \end{align} where $\mathbf{t}^{[i,j]}$ is a unit-norm vector i.i.d. over $\textrm{null}\left( \mathbf{f}_{i}^{[i,j]}\right)$ \cite{N_Jindal06_TIT, Z_Peng16_TWC}. At this point, we consider the worse performance case where each user finds $\hat{\mathbf{f}}^{[i,j]}$ such that with a slight abuse of notation \begin{align} \label{eq:f_hat3} \hat{\mathbf{f}}^{[i,j]} = \sqrt{1-{d^{\operatorname{max}}_i}^2}\cdot\mathbf{f}_{i}^{[i,j]}+ d^{\operatorname{max}}_i\nu_i \cdot\mathbf{t}^{[i,j]}, \end{align} where \begin{eqnarray} d^{\operatorname{max}}_i &=& \operatorname{max} \left\{d^{[i,1]}, \ldots, d^{[i,S]} \right\}, \nonumber \\ \nu_i &=& \operatorname{max} \left\{ \left\|\mathbf{f}_{i}^{[i,j]}\right\|^2, j=1, \ldots, S \right\}. \end{eqnarray} Note that more quantization error only degrades the achievable rate, and hence the quantization via (\ref{eq:f_hat3}) yields a performance lower-bound. Inserting (\ref{eq:f_hat3}) to (\ref{eq:V_hat}) gives us \begin{align} \label{eq:V_hat2} \hat{\mathbf{V}}_i = \left( \sqrt{1- {d^{\operatorname{max}}_i}^2}\mathbf{F}_i + d^{\operatorname{max}}_i\nu_i\mathbf{T}_i \right)^{-1} \boldsymbol{\Gamma}_i, \end{align} where ${\mathbf{F}}_i = \left[ \mathbf{f}_{i}^{[i,1]}, \ldots, \mathbf{f}_{i}^{[i,S]}\right]^{\mathsf{H}}$ and ${\mathbf{T}}_i = \left[ {\mathbf{t}}^{[i,1]}, \ldots, {\mathbf{t}}^{[i,S]}\right]^{\mathsf{H}}$. The Taylor expansion of $\left( \sqrt{1-{d^{\operatorname{max}}_i}^2}\mathbf{F}_i + d^{\operatorname{max}}_i\nu_i\mathbf{T} \right)^{-1}$ in (\ref{eq:V_hat}) gives us \begin{align} \label{eq:Taylor} &\left( \sqrt{1-{d^{\operatorname{max}}_i}^2}\mathbf{F}_i + d^{\operatorname{max}}_i\nu_i\mathbf{T}_i \right)^{-1} \nonumber \\ &= \mathbf{F}_i^{-1} - \mathbf{F}_i^{-1}\mathbf{T}_i \mathbf{F}_i^{-1} \nu_id^{\operatorname{max}}_i +\sum_{k=2}^{\infty} \mathbf{A}_k \left(d^{\operatorname{max}}_i\right)^k, \end{align} where $\mathbf{A}_k$ is a function of $\mathbf{F}_i$ and $\mathbf{T}_i$. Thus, $\hat{\mathbf{V}}_i$ can be written by \begin{align} \label{eq:V_hat_final} \hat{\mathbf{V}}_i = \mathbf{F}_i^{-1}\boldsymbol{\Gamma}_i - d^{\operatorname{max}}_i\nu_i\mathbf{F}_i^{-1}\mathbf{T}_i \mathbf{F}_i^{-1}\boldsymbol{\Gamma}_i +\sum_{k=2}^{\infty} \left(d^{\operatorname{max}}_i\right)^k\mathbf{A}_k\boldsymbol{\Gamma}_i \end{align} Inserting (\ref{eq:V_hat_final}) to (\ref{eq:rec_vector_after_BF_limited}) yields \begin{align}\label{eq:rec_vector_after_BF_limited3} \tilde{y}^{[i,j]} &= \sqrt{\gamma^{[i,j]}}x^{[i,j]} \nonumber \\ &- \underbrace{d^{\operatorname{max}}_i\nu_i{\mathbf{t}^{[i,j]}}^{\textsf{H}}\mathbf{F}_i^{-1}\boldsymbol{\Gamma}_i \mathbf{x}_i + \sum_{k=2}^{\infty} \left(d^{\operatorname{max}}_i\right)^k{\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\mathbf{A}_k \boldsymbol{\Gamma}_i \mathbf{x}_i }_{\textrm{residual intra-cell interference}} \nonumber \\ & \hspace{0pt}+ \sum_{k=1, k\neq i}^{K} {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \hat{\mathbf{V}}_k \mathbf{x}_k + {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{z}^{[i,j]}. \end{align} Consequently, the rate $R^{[i,j]}$ in (\ref{eq:data_rate_single_user}) is given by \begin{align} \label{eq:data_rate_single_user3} R^{[i,j]}= \operatorname{log}_2 \left( 1+ \frac{ \gamma^{[i,j]} }{ \frac{S+ \Delta^{[i,j]}}{\mathsf{SNR}}+ \sum_{k\neq i}^{K} \sum_{s=1}^{S} \left| {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}} \mathbf{v}^{[k,s]}\right|^2 } \right), \end{align} where \begin{align} \label{eq:Delta} \Delta^{[i,j]} = \left(d^{\operatorname{max}}_i\right)^2\delta_1\cdot \mathsf{SNR} + \sum_{k=2}^{\infty} \left(d^{\operatorname{max}}_i\right)^{2k}\delta_k\cdot \mathsf{SNR}, \end{align} \begin{eqnarray} \delta_1 &=& \left(\nu_i^2{\mathbf{t}^{[i,j]}}^{\textsf{H}}\mathbf{F}_i^{-1}{\boldsymbol{\Gamma}_i}^2\mathbf{F}_i^{-\mathsf{H}}\mathbf{t}^{[i,j]}\right), \nonumber \\ \delta_k &=& \left({\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}}\mathbf{A}_k \boldsymbol{\Gamma}_i^2\mathbf{A}_k^{\mathsf{H}} \mathbf{f}_{i}^{[i,j]}\right). \end{eqnarray} As in (\ref{eq:data_rate_single_user_bound}) to (\ref{eq:data_rate_single_user_bound3}), the achievable rate can be bounded by \begin{align} \label{eq:R_bound_limitedFB} R^{[i,j]} \!\! & \ge \mathcal{P}' \! \cdot \! \left[ \operatorname{log}_2 \mathsf{SNR} + \operatorname{log}_2 \left( \frac{1}{\mathsf{SNR}} \! + \! \frac{ \frac{\gamma^{[i,j]}}{\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2}}{ \frac{1}{\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2}+ 2\epsilon } \right) \right], \end{align} where \begin{align} \label{eq:P_def2} \mathcal{P}' & \triangleq \textrm{Pr} \Bigg\{\left(\sum_{i=1}^{K}\sum_{j=1}^{S} I^{[i,j]} \le \epsilon\right) \& \left(\Delta^{[i,j]}/\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2 \le \epsilon\right), \nonumber \\ & \quad \quad \quad \forall i\in \mathcal{K}, j\in \mathcal{S} \Bigg\} \displaybreak[0] \\ \label{eq:P_def3}& = \textrm{Pr} \Bigg\{\sum_{i=1}^{K}\sum_{j=1}^{S} I^{[i,j]} \le \epsilon, \forall i\in \mathcal{K}, j\in \mathcal{S} \Bigg\} \nonumber \\ & \quad \cdot \textrm{Pr} \Bigg\{\Delta^{[i,j]} \le \epsilon', \forall i\in \mathcal{K}, j\in \mathcal{S} \Bigg\}, \end{align} where $\epsilon' \triangleq \epsilon\cdot\left\| \mathbf{v}^{(\operatorname{max})}_{i}\right\|^2$. Here, (\ref{eq:P_def3}) follows from the fact that the inter-cell interference $I^{[i,j]}$ and residual intra-cell interference $\Delta^{[i,j]}$ are independent each other. Note also that the level of residual intra-cell interference does not affect the user selection and is determined only by the codebook size $N_f$. Hence, the user selection result does not change for different $N_f$. The achievable DoF is given by \begin{align} \textrm{DoF} \ge \lim_{\textsf{SNR} \rightarrow \infty} KS \cdot \mathcal{P}'. \end{align} If $N=\omega\left(\textsf{SNR}^{(K-1)S-L+1}\right)$, the first term of (\ref{eq:P_def3}) tends to 1 according to Theorem \ref{theorem:DoF}. Thus, the maximum DoF can be obtained if and only if $\Delta^{[i,j]} \le \epsilon'$ for all selected users for increasing SNR. In Appendix \ref{app:th_codebook}, it is shown that $\Delta^{[i,j]} \le \epsilon'$ for all selected users if $n_f =\omega\left( \operatorname{log}_2 \mathsf{SNR}\right)$ for both Grassmannian and random codebooks. Therefore, if $N=\omega\left(\textsf{SNR}^{(K-1)S-L+1}\right)$ and $n_f =\omega\left( \operatorname{log}_2 \mathsf{SNR}\right)$, $\mathcal{P}'$ in (\ref{eq:P_def3}) tends to 1, which proves the theorem. \end{proof} From Theorem \ref{th:codebook}, the minimum number of feedback bits $n_f$ is characterized to achieve the optimal $KS$ DoF, which increases with respect to $\operatorname{log}_2(\mathsf{SNR})$. It is worthwhile to note that the results are the same for the Grassmannian and random codebooks. We conclude this section by providing the following comparison to the well-known conventional results on limited feedback systems. \begin{remark} \label{line:remark_FB1:start} In the previous works on limited feedback systems, the performance analysis was focused on the average SNR or the average rate loss \cite{C_Au-Yeung09_TWC}. In an average sense, the Grassmannian codebook is in general outperforms the random codebook. However, our scheme focuses on the asymptotic codebook performance for given channel instance for increasing SNR, and it turned out that this asymptotic behaviour is the same for the two codebooks. In fact, this result agrees with the previous works e.g., \cite{B_Khoshnevis11_Thesis}, in which the performance gap between the two codebooks was shown to be negligible as $n_f$ increases through computer simulations. \label{line:remark_FB1:end} \end{remark} \begin{remark} For the MIMO broadcast channel with limited feedback, where the transmitter has $L$ antennas and employs the random codebook, it was shown \cite{N_Jindal06_TIT} that the achievable rate loss for each user, denoted by $\Delta R$, due to the finite size of the codebook is \textcolor{black}{upper-bounded} by \begin{equation} \Delta < \operatorname{log}_2 \left(1+\textrm{SNR} \cdot 2^{-n_f/(L-1)} \right). \end{equation} Thus, to achieve the maximum 1 DoF for each user, or to make the rate loss negligible as the SNR increases, the term $\textrm{SNR} \cdot 2^{-n_f/(L-1)}$ should remain constant for increasing SNR. That is, $n_f$ should scale faster than $(L-1)\operatorname{log}_2 (\textrm{SNR})$. \label{line:remark_FB2:start} Note however that the proof of Theorem \ref{th:codebook} is different from that in \cite{N_Jindal06_TIT}, since the residual interference due to the limited feedback, $\Delta^{[i,j]}$, needs to vanish for any given channel instance with respect to SNR to achieve a non-zero DoF per spatial stream. \label{line:remark_FB2:end} Though the system and proof are different, our results of Theorem \ref{th:codebook} are consistent with this previous result. \end{remark} \section{Spectrally Efficient ODIA (SE-ODIA)} \label{SEC:Threhold_ODIA} In this section, we propose a spectrally efficient OIA (SE-ODIA) scheme and show that the proposed SE-ODIA achieves the optimal multiuser diversity gain $\operatorname{log} \operatorname{log} N$. For the DoF achievability, it was enough to design the user scheduling in the sense to minimize inter-cell interference. However, to achieve optimal multiuser diversity gain, the gain of desired channels also needs to be considered in user scheduling. The overall procedure of the SE-ODIA follows that of the ODIA described in Section \ref{SEC:OIA} except the the third stage `User Scheduling'. In addition, we assume the perfect feedback of the effective desired channels ${\mathbf{u}^{[i,j]}}^{\mathsf{H}}\mathbf{H}_i^{[i,j]}\mathbf{P}_i$ for the SE-ODIA. We incorporate the semiorthogonal user selection algorithm proposed in \cite{T_Yoo06_JSAC} to the ODIA framework taking into consideration inter-cell interference. Specifically, the algorithm for the user scheduling at the BS side is as follows: \begin{itemize} \item Step 1: Initialization: \begin{align} \mathcal{N}_1& = \{1, \ldots, N\}, \hspace{10pt} s=1 \end{align} \item Step 2: For each user $j\in \mathcal{N}_s$ in the $i$-th cell, the $s$-th orthogonal projection vector, denoted by $\tilde{\mathbf{b}}_{s}^{[i,j]}$, for given $\left\{ \mathbf{b}_{1}^{[i]}, \ldots, \mathbf{b}_{s-1}^{[i]} \right\}$ is calculated from: \begin{align} \tilde{\mathbf{b}}^{[i,j]}_s &= \mathbf{f}_{i}^{[i,j]} - \sum_{s'=0}^{s-1} \frac{{\mathbf{b}_{s'}^{[i]}}^{\mathsf{H}} \mathbf{f}_{i}^{[i,j]}}{\|\mathbf{b}_{s'}^{[i]}\|^2}\mathbf{b}_{s'}^{[i]} \end{align} Note that if $s=1$, $\tilde{\mathbf{b}}_{1}^{[i,j]} = \mathbf{f}_{i}^{[i,j]}$. \item Step 3: For the $s$-th user selection, a user is selected at random from the user pool $\mathcal{N}_s$ that satisfies the following two conditions: \begin{align} \label{eq:C}\mathsf{C}_1:& \eta^{[i,j]} \le \eta_I, \hspace{10pt}\mathsf{C}_2: \|\tilde{\mathbf{b}}_{s}^{[i,j]}\|^2 \ge \eta_D \end{align} Denote the index of the selected user by $\pi(s)$ and define \begin{equation} \mathbf{b}_{s}^{[i]} = \tilde{\mathbf{b}}^{[i,\pi(s)]}_s. \end{equation} \item Step 4: If $s < S$, then find the $(s+1)$-th user pool $\mathcal{N}_{s+1}$ from: \begin{align} \mathcal{N}_{s+1}& = \left\{j:j \in \mathcal{N}_{s}, j \neq \pi(s), \frac{\left|{\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}} \mathbf{b}_{s}^{[i]}\right|}{\| \mathbf{f}_{i}^{[i,j]}\| \|\mathbf{b}_{s}^{[i]}\|} <\alpha\right\}, \nonumber \\ s &= s+1, \end{align} where $\alpha>0$ is a positive constant. Repeat Step 2 to Step 4 until $s=S$. \end{itemize} To show the SE-ODIA achieves the optimal multiuser diversity gain, we start with the following lemma for the bound on $|\mathcal{N}_s|$. \begin{lemma}\label{lemma:N_card} The cardinality of $\mathcal{N}_s$ can be bounded by \begin{align} |\mathcal{N}_s| & \gtrsim N \cdot \alpha^{2(S-1)}. \end{align} The approximated inequality becomes tight as $N$ increases. \end{lemma} \begin{proof} See Appendix \ref{app:Ns_cardinality}. \end{proof} We also introduce the following useful lemma. \begin{lemma}\label{lemma:quadratic} If $x \in \mathbb{C}^{M \times 1}$ has its element i.i.d. according to $\mathcal{CN}(0, \sigma^2)$ and $\mathbf{A}$ is an idempotent matrix of rank $r$ (i.e., $\mathbf{A}^2= \mathbf{A}$), then $\mathbf{x}^{\mathsf{H}} \mathbf{A} \mathbf{x}/\sigma^2$ has a Chi-squared distribution with $2r$ degrees-of-freedom. \end{lemma} \begin{proof} See \cite{G_Seber03_Book}. \end{proof} In addition, the following lemma on the achievable rate of the SE-ODIA will be used to show the achievability of optimal multiuser diversity gain. \begin{lemma}\label{lemma:effective_gain} For the $j$-th selected user in the $i$-th cell, the achievable rate is bounded by \begin{align} \label{eq:data_rate_single_user4} R^{[i,j]}\ge \operatorname{log}_2 \left( 1+ \frac{ \frac{\left\| \mathbf{b}_{j}^{[i]} \right\|^2}{1+ \frac{(S-1)^4 \alpha^2}{1-(S-1)\alpha^2}} }{ \frac{S}{\mathsf{SNR}} + \sum_{k\neq i}^{K} \sum_{s=1}^{S} \left| {\mathbf{f}_{k}^{[i,j]}}^{\mathsf{H}}\mathbf{v}^{[k,s]}\right|^2 } \right). \end{align} \end{lemma} \begin{proof} Since the chosen channel vectors are not perfectly orthogonal, there is degradation in the effective channel gain $\gamma^{[i,j]}$. Specifically, for the $j$-th selected user in the $i$-th cell, we have \begin{align}\label{eq:gamma_j_bound} \gamma^{[i,j]} &= \frac{1}{\left[ \left(\mathbf{F}_i\mathbf{F}_i^{\mathsf{H}}\right)^{-1} \right]_{j,j}} > \frac{\left\| \mathbf{b}_{j}^{[i]} \right\|^2}{1+ \frac{(S-1)^4 \alpha^2}{1-(S-1)\alpha^2}}, \end{align} which follows from \cite[Lemma 2]{T_Yoo06_JSAC}. Inserting (\ref{eq:gamma_j_bound}) to the sum-rate lower bound in (\ref{eq:data_rate_single_user}) proves the lemma. \end{proof} Now the following theorem establishes the achievability of the optimal multiuser diversity gain. \begin{theorem}\label{theorem:MUD} The proposed SE-ODIA scheme with \begin{equation} \label{eq:eta_D_choice} \eta_D = \epsilon_D \operatorname{log} \mathsf{SNR} \end{equation} \begin{equation}\label{eq:eta_I_choice} \eta_I = \epsilon_I\mathsf{SNR}^{-1} \end{equation} for any $\epsilon_D, \epsilon_I >0$ achieves the optimal multiuser diversity gain given by \begin{equation} R^{[i,j]} = \Theta\left( \operatorname{log} \left( \mathsf{SNR}\cdot \operatorname{log} N\right)\right), \end{equation} with high probability for all selected users in the high SNR regime if \begin{align} \label{eq:N_scaling_MUD} N = \omega \left( \mathsf{SNR}^{\frac{(K-1)S-L+1}{1-(\epsilon_D/2)}}\right). \end{align} \end{theorem} \begin{proof} Amongst $|\mathcal{N}_s|$ users, there should exist at least one user satisfying the conditions $\mathsf{C}_1$ and $\mathsf{C}_2$ to make the proposed user scheduling for the SE-ODIA valid. Thus, we first show the probability that there exist at least one valid user, denoted by $\mathsf{p}_s$, converges to 1, for the $s$-th user selection, if $N$ scales according to (\ref{eq:N_scaling_MUD}) with the choices (\ref{eq:eta_D_choice}) and (\ref{eq:eta_I_choice}). The probability that each user satisfies the two conditions is given by $\textrm{Pr} \left\{ \mathsf{C}_1 \right\} \cdot \textrm{Pr} \left\{ \mathsf{C}_2 \right\}$, because the two conditions are independent of each other. Consequently, $\mathsf{p}_{s}$ is given by \begin{align} \mathsf{p}_s &= 1- \left( 1- \textrm{Pr} \left\{ \mathsf{C}_1 \right\} \cdot \textrm{Pr} \left\{ \mathsf{C}_2 \right\} \right)^{|\mathcal{N}_s|} \\ \label{eq:p_s2}& \gtrsim 1- \left( 1- \textrm{Pr} \left\{ \mathsf{C}_1 \right\} \cdot \textrm{Pr} \left\{ \mathsf{C}_2 \right\} \right)^{N \cdot \alpha^{2(S-1)}}. \end{align} Note that each element of ${\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}} = {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{H}^{[i,j]}_{i} \mathbf{P}_i$ is i.i.d. according to $\mathcal{CN}(0,1)$, because \textcolor{black}{$\mathbf{P}_k$ is independently and randomly chosen orthonormal basis for an $S$-dimensional subspace of $\mathbb{C}^{M \times M}$} and because ${\mathbf{u}^{[i,j]}}^{\mathsf{H}}$ is designed independently of $\mathbf{H}_i^{[i,j]}$ and isotropically distributed over a unit sphere. Thus, ${\mathbf{f}_{i}^{[i,j]}}^{\mathsf{H}} = {\mathbf{u}^{[i,j]}}^{\mathsf{H}} \mathbf{H}^{[i,j]}_{i} \mathbf{P}_i$ has its element i.i.d. according to $\mathcal{CN}(0,1)$. Let us define $\mathbf{P}$ by \begin{align} \mathbf{P} &\triangleq \left( \mathbf{I} - \sum_{s'=0}^{s-1} \frac{ \mathbf{b}_{s'}^{[i]}{\mathbf{b}_{s'}^{[i]}}^{\mathsf{H}}}{ \|\mathbf{b}_{s'}^{[i]}\|^2}\right), \end{align} which is a symmetric idempotent matrix with rank $(S-s+1)$. Since $\mathbf{b}_{s}^{[i]} = \mathbf{P}\mathbf{f}_{i}^{[i,j]}$, from Lemma \ref{lemma:quadratic}, $\left\|\mathbf{b}_{s}^{[i]}\right\|^2$ is a Chi-squared random variable with $2(S-s+1)$ degrees-of-freedom. In Appendix \ref{app:MUD}, for $\eta_D>2$, we show that \begin{equation} \label{eq:ps_conv} \lim_{\mathsf{SNR}\rightarrow \infty} \mathsf{p}_s = 1, \hspace{10pt} \textrm{if } N = \omega \left( \mathsf{SNR}^{\frac{(K-1)S-L+1}{1-(\epsilon_D/2)}}\right). \end{equation} Now, given that there always exist at least one user that satisfies the conditions $\mathsf{C}_1$ and $\mathsf{C}_2$, the achievable sum-rate can be bounded from Lemma \ref{lemma:effective_gain} by \begin{align} \label{eq:data_rate_single_user5} R^{[i,j]}&\ge \operatorname{log}_2 \left( 1+ \frac{ \frac{\left\| \mathbf{b}_{j}^{[i]} \right\|^2}{1+ \frac{(S-1)^4 \alpha^2}{1-(S-1)\alpha^2}} \cdot \frac{1}{\left\|\mathbf{v}_i^{\operatorname{max}} \right\|^2}}{ \frac{S}{\mathsf{SNR}\left\|\mathbf{v}_i^{\operatorname{max}} \right\|^2}+ \sum_{k\neq i}^{K} \sum_{s=1}^{S} \left\| \mathbf{f}_{k}^{[i,j]}\right\|^2 } \right)\\ \label{eq:data_rate_single_user6}& \ge \operatorname{log}_2 \left( 1+ \frac{ \frac{\left\| \mathbf{b}_{j}^{[i]} \right\|^2}{1+ \frac{(S-1)^4 \alpha^2}{1-(S-1)\alpha^2}} \cdot \mathsf{SNR}/\left\|\mathbf{v}_i^{\operatorname{max}} \right\|^2}{ S/\left\|\mathbf{v}_i^{\operatorname{max}} \right\|^2+ KS\epsilon_I} \right)\\ \label{eq:data_rate_single_user7}& = \operatorname{log}_2 \left( 1+ \left\| \mathbf{b}_{j}^{[i]} \right\|^2\mathsf{SNR} \cdot \xi \right)\\ \label{eq:data_rate_single_user8}& \ge \operatorname{log}_2 \left( 1+ \epsilon_D(\operatorname{log} N)\cdot \mathsf{SNR} \right), \end{align} where (\ref{eq:data_rate_single_user6}) follows from the fact that the sum-interference for all selected users, given by $\sum_{j=1}^{S}\sum_{i=1}^{K} \eta^{[i,j]}\mathsf{SNR}$ (See (\ref{eq:sum_interference_equiv})), does not exceed $KS \epsilon_I $ by choosing $\eta_I = \epsilon_I \mathsf{SNR}^{-1}$. Furthermore, $\xi$ is a constant given by \begin{equation} \xi = \frac{1}{\left\| \mathbf{v}_i^{\operatorname{max}}\right\|^2 \left( 1+ \frac{(S-1)^4 \alpha^2}{1-(S-1)\alpha^2}\right)\left(S/\left\|\mathbf{v}_i^{\operatorname{max}} \right\|^2+ KS\epsilon_I\right)}, \end{equation} and (\ref{eq:data_rate_single_user8}) follows from $\| \mathbf{b}_{j}^{[i]} \|^2 \ge \eta_D = \epsilon_D \operatorname{log} N$. Therefore, the proposed SE-ODIA achieves the optimal multiuser diversity gain $\operatorname{log}\log N$ in the high SNR regime, if $N = \omega \left( \mathsf{SNR}^{\frac{(K-1)S-L+1}{1-(\epsilon_D/2)}}\right)$. \end{proof} Therefore, the optimal multiuser gain of $\operatorname{log}\log N$ is achieved using the proposed SE-ODIA with the choices of (\ref{eq:eta_D_choice}) and (\ref{eq:eta_I_choice}). \label{line:SE_ODIA:start} Note that since small $\epsilon_D$ suffices to obtain the optimal multiuser gain, the condition on $N$ does not dramatically change compared with that required to achieve $KS$ DoF (See Theorem \ref{theorem:DoF}). Thus, surprisingly, this means a slight increase in user scaling results in optimal multiuser diversity by using the proposed SE-ODIA. \label{line:SE_ODIA:end} Combining the results in Theorem \ref{theorem:DoF} and \ref{theorem:MUD}, we can conclude the achievability of the optimal DoF and multiuser gain as follows. \begin{remark} In fact, the ODIA described in Section \ref{SEC:OIA} can be implemented using the SE-ODIA approach by choosing $\eta_D = 0$, $\alpha = 1$, and $\eta_I^{[i]} = \operatornamewithlimits{min}\left\{ \eta^{[i,1]}, \ldots, \eta^{[i,N]}\right\}$, where $\eta_I^{[i]}$ denotes $\eta_I$ at the $i$-th cell. In summary, the optimal $KM$ DoF and optimal multiuser gain of $\operatorname{log} \operatorname{log} N$ can be achieved using the proposed ODIA framework, if the number of users per cell increases according to $N = \omega\left( \mathsf{SNR}^{\frac{(K-1)M-L+1}{1-(\epsilon_D/2)}}\right)$ for any $\epsilon_D>0$. \end{remark} \section{Numerical Results} \label{SEC:Sim} In this section, we compare the performance of the proposed ODIA with two conventional schemes which also utilize the multi-cell random beamforming technique at BSs. First, we consider ``max-SNR" technique, in which each user designs the receive beamforming vector in the sense to maximize the desired signal power, and feeds back the maximized signal power to the corresponding BS. Each BS selects $S$ users who have higher received signal power. Second, ``min-INR" technique is considered, in which each user performs receive beamforming in order to minimize the sum of inter-cell interference and intra-cell interference\cite{H_Nguyen13_arXiv, J_Lee13_arXiv}. Hence, intra-cell interference does not vanish at users, while the proposed ODIA perfectly eliminates it via transmit beamforming. Specifically, from (\ref{eq:rec_vector_after_BF}), the $j$-th user in the $i$-th cell should calculate the following $S$ scheduling metrics \begin{align} \eta^{[i,j]}_{\textrm{min-INR}, m} &= \underbrace{\left\|{\mathbf{u}^{[i,j],m}}^{\mathsf{H}} \mathbf{H}_i^{[i,j]}\tilde{\mathbf{P}}_{i,m} \right\|^2}_{\textrm{intra-cell interference}} \nonumber \\ &+ \underbrace{\sum_{k=1, k\neq i}^{K}\left\|{\mathbf{u}^{[i,j],m}}^{\mathsf{H}} \mathbf{H}_k^{[i,j]}\mathbf{P}_{k} \right\|^2}_{\textrm{inter-cell interference}}, \,\, m=1, \ldots, S, \end{align} where $\tilde{\mathbf{P}}_{i,m} \triangleq \left[ \mathbf{p}_{1, i}, \ldots, \mathbf{p}_{m-1,i}, \mathbf{p}_{m+1, i}, \ldots, \mathbf{p}_{S,i} \right]$. For each $m$, the receive beamforming vector $\mathbf{u}^{[i,j],m}$ is assumed to be designed such that $\eta^{[i,j]}_{\textrm{min-INR}, m}$ is minimized. Each user feedbacks $S$ scheduling metrics to the corresponding BS, and the BS selects the user having the minimum scheduling metric for the $m$-th spatial stream, $m=1, \ldots, S$. For more details about the min-INR scheme, refer to \cite{H_Nguyen13_arXiv, J_Lee13_arXiv}. \\ \label{line:Fig_Int:start} Fig. \ref{fig:Interf_N} shows the sum-interference at all users for varying number of users per cell, $N$, when $K=3$, $M=4$, $L=2$, and SNR=$20$dB. The solid lines are obtained from Theorem \ref{theorem:scaling_decay} with proper biases, and thus only the slopes of the solid lines are relevant. The decaying rates of sum-interference of the proposed ODIA are higher than those of the min-INR scheme since intra-cell interference is perfectly eliminated in the proposed ODIA. In addition, the interference decaying rates of the proposed ODIA are consistent with the theoretical results of Theorem \ref{theorem:scaling_decay}, which proves that the user scaling condition derived in Theorem \ref{theorem:DoF} and the interference bound in Theorem \ref{theorem:scaling_decay} are in fact accurate and tight. \label{line:Fig_Int:end} \begin{figure}[t] \begin{center} \includegraphics[width=0.64\textwidth, angle=-0]{new_LIF_N.eps}\\ \caption{Normalized sum-interference vs. $N$ when $K=3$, $M=4$, $L=2$.}\label{fig:Interf_N} \end{center} \end{figure} \label{line:Fig_varyingN:start} Fig.~\ref{fig:rate_SNR_varying_nf_N} shows the sum-rate vs. SNR when $K=2$, $M=3$, $L=2$, and $S=2$. Thus, the total achievable DoF is $KS=4$. Here, to comply with Theorems \ref{theorem:DoF} and \ref{th:codebook}, $N$ and $n_f$ are assumed to scale with respect to SNR as $N=\textrm{SNR}^{(K-1)S-L+1} = \textrm{SNR}^{1}$ and $n_f = \operatorname{log}_2 \textrm{SNR}$, respectively. \label{line:Fig_varyingN2:start} For an upper bound, the genie-aided interference-free ODIA scheme is plotted as `Interference-Free' in which both the intra- and inter-cell interference was removed in the achievable rate calculation of the ODIA scheme.\label{line:Fig_varyingN2:end} It is seen that the proposed ODIA achieves the target DoF of 4 with $N=\textrm{SNR}^{(K-1)-L+1}$, which again proves Theorem \ref{theorem:DoF}. In addition, the ODIA with limited feedback~(ODIA-LF) also achieves the target DoF of 4 for both random and Grassmannian codebooks with $n_f = \operatorname{log}_2 (\textrm{SNR})$, which verifies Theorem \ref{th:codebook}. The Max-SNR scheme achieves zero DoF, since the interference is not suppressed at all for increasing SNR. The Min-INR scheme cannot achieve the target DoF, since the user scaling is not fast enough to satisfy $N=\textrm{SNR}^{KS-L}=\textrm{SNR}^{2}$ (See Section \ref{subsec:DoF_comparison}).\label{line:Fig_varyingN:end} \begin{figure} \begin{center} \includegraphics[width=0.65\textwidth]{new_rates_SNR_varying_nf_N.eps}\\ \caption{Sum-rates versus SNR when $K=2$, $M=3$, $L=2$, $S=2$. The total achievable DoF for all cells is $KS=4$. $N$ and $n_f$ change according to the SNR as $N=\textrm{SNR}^{(K-1)-L+1} = \textrm{SNR}^{1}$ and $n_f = \operatorname{log}_2 \textrm{SNR}$, respectively.}\label{fig:rate_SNR_varying_nf_N} \end{center} \end{figure} To evaluate the sum-rates of the SE-ODIA, the parameters $\eta_I$, $\eta_D$, and $\alpha$ need to be optimized for the SE-ODIA. Fig. \ref{fig:rates_eta} shows the sum-rate performance of the proposed SE-ODIA for varying $\eta_I$ or $\eta_D$ with two different $\alpha$ values when $K=3$, $M=4$, $L=2$, $S=2$, and $N=20$. To obtain the sum-rate according to $\eta_I$, $\eta_D$ was fixed to $1$. Similarly, for the sum-rate according to $\eta_D$, $\eta_I$ was fixed to $1$. If $\eta_I$ is too small, then there may not be eligible users that satisfy the conditions $\mathsf{C}_1$ and $\mathsf{C}_2$ in (\ref{eq:C}). Thus, \textit{scheduling outage}~\footnote{It indicates the situation that there are no users who are eligible for scheduling.} can occur frequently and the achievable sum-rate becomes low. On the other hand, if $\eta_I$ is too large, then the received interference at users may not be sufficiently suppressed. Thus, the achievable sum-rate converges to that of the system without interference suppression. Similarly, if $\eta_D$ is too large, then the scheduling outage occurs; and if $\eta_D$ is too small, then desired channel gains cannot be improved. The orthogonality parameter $\alpha$ plays a similar role; if $\alpha$ is too small, the cardinality of the user pool $|\mathcal{N}_s|$ often becomes smaller than $S$, and scheduling outage happens frequently. If $\alpha$ is too large, then the orthogonality of the effective channel vectors of the selected users is not taken into account for scheduling. In short, the parameters $\eta_I$, $\eta_D$, and $\alpha$ need to be carefully chosen to improve the performance of the proposed SE-ODIA. In subsequent sum-rate simulations, proper sets of $\eta_I$, $\eta_D$, and $\alpha$ were numerically found for various $N$ and SNR values and applied to the SE-ODIA. \begin{figure}[t] \begin{center} \includegraphics[width=0.63\textwidth, angle=-0]{new_rates_eta.eps}\\ \caption{Sum-rates of SE-ODIA vs. $\eta_D$ or $\eta_I$ when $K=3$, $M=4$, $L=2$, $S=2$, and $N=20$.}\label{fig:rates_eta} \end{center} \end{figure} For instance, optimal $(\eta_I, \eta_D, \alpha)$ values that maximize the sum-rate for a few cases are provided in Table \ref{table:param}. It is seen that in the noise-limited low SNR regime, large $\eta_D$ helps, whereas in the interference-limited high SNR regime, small $\eta_I$ improves the sum-rate. On the other hand, as $N$ increases, interference can be suppressed by choosing smaller $\eta_I$ values. \begin{table} \caption{Optimized parameters $(\eta_I, \eta_D, \alpha)$ for different SNRs and $N$ values} \label{table:param} \begin{center} \begin{tabular}{|c|c|c|} \hline & $N$=20 & $N$=50 \\ \hline SNR=3dB & (2.5, 2.5, 0.8) & (2, 2.5, 0.8) \\ \hline SNR=21dB & (1.5, 2, 0.8) & (1, 2, 0.8) \\ \hline \end{tabular} \end{center} \end{table} Fig. \ref{fig:rates_SNR_N20} shows the sum-rates for varying SNR values when $K=3$, $M=4$, $L=2$, $S=2$, and $N=20$. In the noise-limited low SNR regime, the sum-rate of the min-INR scheme is even lower than that of the max-SNR scheme, because $N$ is not large enough to suppress both intra- and inter-cell interference. For comparison, the sum-rate maximizing iterative transceiver design of \cite{Q_Shi11_TSP} is also evaluated allowing one iteration between the BSs and users, i.e., the users feed back their receive beamforming vectors and BSs update their precoding matrices once. Even with one iteration, since each user needs to feed back the information of the receive beamformer to all the BSs in the network, the amount of the feedback is $K$ times more than in the proposed scheme. In addition, because \cite{Q_Shi11_TSP} does not include any consideration of user scheduling, which is in general difficult to be separated from the precoding matrix design, we applied the conventional max-SNR and max-SINR scheduling schemes for the scheme of \cite{Q_Shi11_TSP}, which are labeled by `Max-Sum-Rate w/ Max-SNR Scheduling' and `Max-Sum-Rate w/ Max-SINR Scheduling,' respectively. The precoding matrix was fixed to be the one achieving the max-SNR in the scheduling metric calculation of \cite{Q_Shi11_TSP}, e.g., the scheduling metric for the max-SNR scheme is given by $\mathsf{SNR}\cdot {\lambda_i^{[i,j]}}^2$, where $\lambda_i^{[i,j]}$ is the largest singular value of $\mathbf{H}_i^{[i,j]}$. It is seen from the figure that the proposed ODIA outperforms the conventional schemes for SNRs larger than 3dB due to the combined effort of 1) transmit beamforming perfectly eliminating intra-cell interference and 2) receive beamforming effectively reducing inter-cell interference. In particular, the proposed ODIA shows higher sum-rate than the iterative transceiver design even with $K$ times less feedback due to the separate joint optimization of the precoding matrix design and user scheduling. The sum-rate performance of the ODIA-LF improves as $n_f$ increases as expected. In practice, $n_f=6$ exhibits a good compromise between the number of feedback bits and sum-rate performance for the codebook dimension of 2 (i.e., $S=2$). On the other hand, the proposed SE-ODIA achieves higher sum-rates than the others including the ODIA for all SNR regime, because the SE-ODIA improves desired channel gains and suppresses interference simultaneously. Note however that the SE-ODIA includes the optimization on the parameters for given SNR and $N$ and requires the user scheduling method based on perfect CSI feedback, which demands higher computational complexity than the user scheduling of the ODIA. \begin{figure \begin{center} \includegraphics[width=0.64\textwidth, angle=0]{new_rates_SNR_N20.eps} \caption{Sum-rates versus SNR when $K=3$, $M=4$, $L=2$, $S=2$, and $N=20$.} \label{fig:rates_SNR_N20} \end{center} \end{figure} Fig. \ref{fig:rates_N_linear} shows the sum-rate performance of the proposed ODIA schemes for varying number of users per cell, $N$, when $K=3$, $M=4$, $L=2$, $S=2$, and SNR=$20$dB. For limited feedback, the Grassmannian codebook was employed. The sum-rates of the proposed ODIA schemes increase faster than the two conventional schemes, which implies that the user scaling conditions of the proposed ODIA schemes required for a given DoF or MUD gain are lowered than the conventional schemes, as shown in Theorems \ref{theorem:DoF} and \ref{theorem:MUD}. \begin{figure} \begin{center} \includegraphics[width=0.64\textwidth, angle=-0]{new_rates_N.eps}\\ \caption{Sum-rates vs. $N$ when $K=3$, $M=4$, $L=2$, $S=2$, and SNR=20dB.}\label{fig:rates_N_linear} \end{center} \end{figure} \section{Conclusion} \label{SEC:Conc} In this paper, we proposed an opportunistic downlink interference alignment (ODIA) which intelligently combines user scheduling, transmit beamforming, and receive beamforming for multi-cell downlink networks. In the ODIA, the optimal DoF can be achieved with more relaxed user scaling condition $N=\left( \mathsf{SNR}^{(K-1)S-L+1}\right)$. To the best of our knowledge, this user scaling condition is the best known to date. We also considered a limited feedback approach for the ODIA, and analyzed the minimum number of feedback bits required to achieve the same user scaling condition of the ODIA with perfect feedback. We found that both Grassmannian and random codebooks yield the same condition on the number of required feedback bits. Finally, a spectrally efficient ODIA (SE-ODIA) was proposed to further improve the sum-rate of the ODIA, in which optimal multiuser diversity can be achieved even in the presence of inter-cell interference. Through numerical results, it was shown that the proposed ODIA schemes significantly outperform the conventional interference management schemes in practical environments. \appendices \section{Proof of Lemma \ref{lemma:CDF_scaling}}\label{app:lemma2} Using (\ref{eq:sum_interference_equiv}), $\mathcal{P}$ can be bounded by \begin{align} \label{eq:P_LB0}\mathcal{P} & =\lim_{\textsf{SNR}\rightarrow \infty} \textrm{Pr} \left\{\sum_{i=1}^{K}\sum_{j=1}^{S} \eta^{[i,j]}\mathsf{SNR} \le \epsilon \right\} \\ &\ge \lim_{\textsf{SNR}\rightarrow \infty} \textrm{Pr} \left\{\eta^{[i,j]}\le \frac{\textsf{SNR}^{-1}\epsilon}{KS^2}, \forall i\in \mathcal{K}, \forall j\in \mathcal{S}\right\}.\label{eq:P_BF_LB1} \end{align} Note that the selected users' $\eta^{[i,j]}$ are the minimum $S$ values out of $N$ i.i.d. random variables. Since the CDF of $\eta^{[i,j]}$ is given by (\ref{eq:F_phi}), (\ref{eq:P_BF_LB1}) can be written by \begin{align} \label{eq:P_LB0}\mathcal{P} & \ge\lim_{\textsf{SNR}\rightarrow \infty} \Bigg[ 1- \sum_{i=1}^{S-1}\left( \begin{array}{c} N \\ i \end{array} \right)\bigg(\underbrace{F_{\eta}\left(\frac{\epsilon\textsf{SNR}^{-1}}{KS^2}\right)}_{\triangleq A}\bigg)^{i} \nonumber \\ & \quad \quad \cdot \left(1-F_{\eta}\left(\frac{\epsilon\textsf{SNR}^{-1}}{KS^2}\right)\right)^{N-i} \Bigg]\\ \label{eq:P_LB_last}& \ge\lim_{\textsf{SNR}\rightarrow \infty} \left[ 1- \sum_{i=1}^{S-1}N^i A^{i}\left(1-A\right)^{-i} \left(1-A\right)^{N}\right], \end{align} where \begin{align}\label{eq:P_LB_lastterm} \left(1-A\right)^{N}& \!\!\! = \!\! \bigg( 1- c_0 \left( \frac{\epsilon}{KS^2}\right)^{(K-1)S-L+1} \!\!\! \cdot \mathsf{SNR}^{-((K-1)S-L+1)} \nonumber \\ & - \Omega_{\textsf{SNR}}\left(\mathsf{SNR}^{-((K-1)S-L)}\bigg) \right)^{N}. \end{align} Here, $f(x) = \Omega_x\left( g(x) \right)$ means $\lim_{x \rightarrow \infty} \left|\frac{f(x)}{g(x)}\right|>0$. Thus, $\left(1-A\right)^{N}$ tends to 0 (exponentially) if and only if $N$ scales faster than $\mathsf{SNR}^{(K-1)S-L+1}$. Now, inserting $N=\omega\left( \mathsf{SNR}^{(K-1)S-L+1}\right)$ to (\ref{eq:P_LB_last}) yields $\mathcal{P}$ tending to 1 for increasing SNR, because for given $i$, $\left(1-A\right)^{N}$ vanishes exponentially. \section{Proof of Theorem \ref{th:codebook}} \label{app:th_codebook} i) Grassmannian codebook \\ For the Grassmannian codebook, the chordal distance between any two codewords is the same, i.e., $\sqrt{1-\left| \mathbf{c}_i^{\mathsf{H}} \mathbf{c}_j\right|^2} = d,$, $\forall i \neq j$. The Rankin, Gilbert-Varshamov, and Hamming bounds on the chordal distance give us \cite{A_Barg02_TIT,J_Conway96_EM, W_Dai08_TIT} \begin{equation} \label{eq:dmin_bound} {d^{[i,j]}}^2 \le \operatornamewithlimits{min} \left\{\frac{1}{2}, \frac{(S-1)N_f}{2S(N_f-1)}, \left( \frac{1}{N_f}\right)^{1/(S-1)}\right\}. \end{equation} The bound in (\ref{eq:dmin_bound}) is reduced to the third bound as $N_f$ increases, thus providing arbitrarily tight upper-bound on ${d^{[i,j]}}^2$. Thus, the first term of (\ref{eq:Delta}) remains constant if \begin{align} \left(d^{\operatorname{max}}_i\right)^2\delta_1\cdot \mathsf{SNR} & \le \left( \frac{1}{N_f}\right)^{1/(S-1)}\delta_1\cdot \mathsf{SNR}\le \epsilon'. \end{align} This is reduced to $N_f^{-1/(S-1)} \le \epsilon' \delta_1^{-1} \mathsf{SNR}^{-1}$, or equivalently (\ref{eq:nf_cond0}). Now, if (\ref{eq:nf_cond0}) holds true, $d_i^{\operatorname{max}}$ tends to be arbitrarily small as SNR increases, and thus the second term of (\ref{eq:Delta}) is dominated by the first term. Therefore, if $n_f$ scales with respect to $\operatorname{log}_2(\mathsf{SNR})$ as (\ref{eq:nf_cond0}), the residual intra-cell interference $\Delta^{[i,j]}$ remains constant. ii) Random codebook \\ In a random codebook, each codeword $\mathbf{c}_k$ is chosen isotropically and independently from the $L$-dimensional hyper sphere, and thus the maximum chordal distance of a random codebook is unbounded. Since ${d^{[i,j]}}^2$ is the minimum of $N_f$ chordal distances resulting from $N_f$ independent codewords, the CDF of ${d^{[i,j]}}^2$ is given by \cite{C_AuYeung07_TWC,N_Jindal06_TIT} \begin{equation} \label{eq:F_d_def} F_d(z) \triangleq \textrm{Pr}\left\{{d^{[i,j]}}^2\le z\right\} = 1-\left(1-z^{S-1}\right)^{N_f}. \end{equation} From (\ref{eq:Delta}), the second term of (\ref{eq:P_def3}) can be bounded by \begin{align} \label{eq:PPP} &\textrm{Pr} \Bigg\{\Delta^{[i,j]} \le \epsilon', \forall i\in \mathcal{K}, j\in \mathcal{S} \Bigg\} \nonumber \\ & \ge \textrm{Pr}\left\{\left(d^{\operatorname{max}}_i\right)^2\delta_1\cdot \mathsf{SNR}\le \epsilon', \forall i\in \mathcal{K}\right\} \nonumber \\ & \quad \quad \cdot \textrm{Pr} \left\{ \sum_{k=2}^{\infty} \left(d^{\operatorname{max}}_i\right)^{2k}\delta_k \cdot \mathsf{SNR} \le \epsilon', \forall i\in \mathcal{K} \right\}. \end{align} Subsequently, we have \begin{align} \label{eq:RV_P1} &\textrm{Pr} \!\! \left\{\left(d^{\operatorname{max}}_i\right)^2\delta_1\cdot \mathsf{SNR}\le \epsilon'\right\} \!\! = \!\! \prod_{k=1}^{S} \!\! \textrm{Pr} \! \left\{\left(d^{[k,i]}\right)^2 \!\! \delta_1 \! \cdot \! \mathsf{SNR}\le \epsilon'\right\}, \end{align} which follows from the fact that $d^{[k,i]}$ and $d^{[m,i]}$ are independent for $k\neq m$. From (\ref{eq:F_d_def}) we have \begin{align} \label{eq:RV_P1_2} &\textrm{Pr}\left\{\left(d^{[k,i]}\right)^2\delta_1\cdot \mathsf{SNR}\le \epsilon'\right\} \nonumber \\ &= 1-\left(1-{\epsilon'}^{S-1}\delta_1^{-S+1}\left( \mathsf{SNR}\right)^{-(S-1)}\right)^{N_f}. \end{align} Therefore, $\lim_{\mathsf{SNR}\rightarrow \infty} \textrm{Pr}\left\{\left(d^{\operatorname{max}}_i\right)^2\delta_1\cdot \mathsf{SNR}\le \epsilon'\right\}=1$ if and only if $N_f = \omega \left( \mathsf{SNR}^{S-1}\right)$, or equivalently (\ref{eq:nf_cond0}). Now, if (\ref{eq:nf_cond0}) holds true, $d_{i}^{\operatorname{max}}$ tends to arbitrarily small with high probability as SNR increases. Therefore, the second term of (\ref{eq:Delta}) is dominated by the first term, and hence $\textrm{Pr} \left\{\Delta^{[i,j]} \le \epsilon', \forall i\in \mathcal{K}, j\in \mathcal{S} \right\}$ in (\ref{eq:PPP}) tends to 1. \section{Proof of Lemma \ref{lemma:N_card}} \label{app:Ns_cardinality} Let us define the set $\Pi_s$ by \begin{align} & \Pi_s \triangleq \nonumber \\ & \left\{ \mathbf{h}\in \mathbb{C}^{S \times 1}: \frac{{\mathbf{h}}^{\mathsf{H}} \mathbf{v}}{\| \mathbf{h}\| \|\mathbf{v}\|} <\alpha, \forall \mathbf{v}\in \textrm{span}\left( \mathbf{b}_{1}^{[i]}, \ldots, \mathbf{b}_{s-1}^{[i]}\right) \right\}. \end{align} Since the $s$-th user pool is determined only by checking the orthogonality to the chosen users' channel vectors, for arbitrarily large $N$, we have the followings by the law of large numbers: \pagebreak[0] \begin{align} \label{eq:N_card1} |\mathcal{N}_s| & \! \approx \! N \! \cdot \! \textrm{Pr} \! \left\{ \mathbf{h}\in \mathbb{C}^{S \times 1}: \frac{{\mathbf{h}}^{\mathsf{H}} {\mathbf{b}_{s}^{[i]}}'}{\| \mathbf{h}\| \|\mathbf{b}_{s'}^{[i]}\|} <\alpha, s'=1, \ldots, s-1 \right\} \\ \pagebreak[0] & \ge N \cdot \textrm{Pr}\left\{ \mathbf{h}\in \mathbb{C}^{S \times 1}: \mathbf{h} \in \Pi_s \right\} \\ &= N \cdot I_{\alpha^2}(s-1, S-s+1) \\ \pagebreak[0] \label{eq:N_card2}&\ge N \cdot \alpha^{2(S-1)}, \pagebreak[0] \end{align} where $I_{\alpha^2}$ is the regularized incomplete beta function (See \cite[Lemma 3]{T_Yoo06_JSAC}), and (\ref{eq:N_card2}) follows from $I_{\alpha^2}(s-1, S-s+1) \ge I_{\alpha^2}(S-1, 1) = \alpha^{2(S-1)}$. \section{Proof of (\ref{eq:ps_conv})} \label{app:MUD} Since $\left\|\mathbf{b}_{s}^{[i]}\right\|^2$ is a Chi-squared random variable with $2(S-s+1)$ degrees-of-freedom, for $\eta_D>2$, we have \begin{align} \textrm{Pr} \left\{ \mathsf{C}_2 \right\} & = 1-\frac{\gamma((S-s+1), \eta_D/2)}{\Gamma(S-s+1 )} \\ &= \frac{\Gamma((S-s+1), \eta_D/2)}{\Gamma(S-s+1 )}\\ & = \sum_{m=0}^{S-s} e^{-(\eta_D/2)} \frac{{(\eta_D/2)}^{m}}{m!} \\ & = \frac{e^{-(\eta_D/2)}\cdot {(\eta_D/2)}^{S-s}}{(S-s)!}\left(1+ O\left({(\eta_D/2)}^{-1}\right)\right)\\ \label{eq:C2_final}&\ge \frac{e^{-(\eta_D/2)}}{(S-s)!}, \end{align} where $\Gamma(s,x) = \int_{x}^{\infty} t^{s-1}e^{-t}dt$ is the upper incomplete gamma function and $\gamma(s,x)= \int_{0}^{x}t^{s-1}e^{-t}dt$ is the lower incomplete gamma function. Note that from the CDF of $\eta^{[i,j]}$ (See \cite[Lemma 1]{H_Yang13_TWC}), $\textrm{Pr} \left\{ \eta^{[i,j]} \le \eta_I\right\} = c_0 \eta_I^{\tau} + o(\eta_I^{\tau})$, where $\tau = (K-1)S-L+1$. Thus, from (\ref{eq:eta_D_choice}), (\ref{eq:eta_I_choice}), and (\ref{eq:C2_final}), (\ref{eq:p_s2}) can be bounded by \begin{align} \label{eq:p_s_final} \mathsf{p}_s & \gtrsim 1- \Bigg( 1- \left( c_0(\epsilon_I)^{\tau} {\mathsf{SNR}}^{-\tau} + \Omega\left( {\mathsf{SNR}}^{-(\tau-1)}\right)\right)\nonumber \\ & \hspace{100pt} \times \frac{N^{-(\epsilon_D/2)}}{(S-s)!}\Bigg)^{N \cdot \alpha^{2(S-1)}}. \end{align} The right-hand side of (\ref{eq:p_s_final}) converges to 1 for increasing SNR if and only if \begin{align}\label{eq:scaling_MUD} \lim_{\mathsf{SNR}\rightarrow \infty} & \left(N \cdot \alpha^{2(S-1)}\right) \cdot \left( c_0 (\epsilon_I)^{\tau} {\mathsf{SNR}}^{-\tau} + \Omega\left( {\mathsf{SNR}}^{-(\tau-1)}\right)\right) \nonumber \\ & \cdot \frac{N^{-(\epsilon_D/2)}}{(S-s)!} = \infty. \end{align} Since the left-hand side of (\ref{eq:scaling_MUD}) can be written by $ \tilde{c}_0\frac{N^{1-(\epsilon_D/2)}}{\mathsf{SNR}^{\tau}} + \tilde{c}_1\frac{N^{1-(\epsilon_D/2)}}{o\left(\mathsf{SNR}^{\tau}\right)}$, where $\tilde{c}_0$ and $\tilde{c}_1$ are positive constants independent of SNR and $N$, it tends to infinity for increasing SNR, and thereby $\mathsf{p}_s$ tends to 1 if and only if $N = \omega \left( \mathsf{SNR}^{\frac{(K-1)S-L+1}{1-(\epsilon_D/2)}}\right)$.
{'timestamp': '2017-01-09T02:05:36', 'yymm': '1701', 'arxiv_id': '1701.01625', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01625'}
arxiv
\section{Introduction} Let $A\in \R^{n\times n}$ be a square matrix with entries $A_{i,j}$ for $1\leq i,j \leq n$. The permanent of $A$ is defined as: $$\mathrm{Per}(A)\stackrel{\textup{def}}{=} \sum_{\sigma \in S_n} \prod_{i=1}^n A_{i,\sigma(i)},$$ where $S_n$ is the set of all permutations over $n$ symbols, i.e., the set of bijections $\sigma: \{1,2,\ldots, n\} \to \{1,2,\ldots, n\}$. The matrix permanent makes its appearance in various branches of science and mathematics and algorithms to compute it are sought after, especially in theoretical computer science. In a foundational result, Valiant~\cite{Valiant79} proved that it is unlikely that there is an efficient algorithm that computes the permanent of a matrix -- even when the matrix is non-negative (the problem is $\mathbf{\#P}-$complete). Jerrum, Sinclair and Vigoda~\cite{JSV04}, building upon a long line of work, showed that the Markov Chain Monte Carlo framework can be deployed to obtain a randomized algorithm to estimate the permanent of any non-negative matrix to within a factor of $1+\epsilon$ in time that is polynomial in the bit-lengths of $A$ and $1/\epsilon$. A different approach to estimate the value of the permanent of a non-negative matrix has been developed -- notably in the works of Linial, Samorodnitsky and Wigderson~\cite{LSW98} and Gurvits and Samorodnitsky~\cite{GS02}. Roughly, the idea in these works is to reduce the computation of the permanent of a non-negative matrices to that of a $n \times n$ doubly stochastic matrix by computing a certain {\em scaling}. The latter work \cite{GS02} reveals how the scalings can be viewed as solutions to certain convex programs -- leading to convex programming relaxations for the permanent. The resolution of the van der Waerden conjecture by Egorychev~\cite{Egorychev81} and Falikman~\cite{Falikman81} -- that the permanent of a doubly stochastic matrix is lower bounded by $e^{-n}$ -- resulted in a deterministic algorithm to estimate the permanent up to a multiplicative ratio of $e^n$. Of note here is a relaxation introduced by Gurvits~\cite{Gurvits06}, called the {\em capacity} of the associated polynomial $p_A$ (applies more generally), which allowed him to deploy the theory of hyperbolic or real-stable polynomials to derive the same result. These ideas were further developed in the works of~\cite{gurvits2011unleashing,GS14} where a curious convex program was presented and, it was shown using an inequality due to Schrijver~\cite{schrijver1998counting}, that this program estimates the value of the permanent up to a $2^n$ factor. The problem of computing the permanent has also attracted attention in statistical physics and, in particular, the belief propagation literature \cite{WC10,Vontobel13,CY13}. These algorithms are geared towards computing approximations to the Gibbs distribution associated to the matrix $A$. A bit more formally, if $G=(V,W,E)$ is the bipartite graph where $|V|=|W|=n$ and $(i,j) \in E$ if $A_{i,j} >0$ and $\mathcal{M}$ is the set of perfect matchings in $G$, then the Gibbs distribution induced by $A$ and supported on $\mathcal{M}$ is one where, for a matching $M \in \mathcal{M}$, the probability of $M$, denoted by, $p(M)$, is $$ p(M) \stackrel{\textup{def}}{=} \frac{\prod_{(i,j) \in M} A_{i,j}} {{\mathrm{Per}(A)}}.$$ The idea then is to maintain a proxy to $p(M)$, or a {\em belief} distribution $b:\mathcal{M} \to \mathbb{R}_{\geq 0}$ and iteratively update it according to certain rules. It is not clear when and how quickly such algorithms converge although they seem to work well in practice and for locally tree-like graphs. \medskip {\em Are these three seemingly distinct approaches to compute the permanent, coming from different areas, connected?} \medskip \noindent The goal of this paper is to present some old and some new results in a unified manner which seem to suggest that there may be a close connection between the latter two approaches. The starting point to our work is the well-known fact that the following convex program has $\log \mathrm{Per}(A)$ as its optimal value. \begin{equation} \begin{aligned} \sup ~& \sum_{M\in \mathcal{M}} b(M) \log \frac{\prod_{(i,j) \in M} A_{i,j}}{b(M)} \\ \mbox{\rm s.t. } & \sum_{M\in \mathcal{M}} b(M) =1\\ & b(M) \geq 0 ~~~~~~~~~~ \forall M\in \mathcal{M} \end{aligned} \label{eq:exact} \end{equation} Each variable of this program corresponds to a perfect matching in $G$, and the goal is to find a probability distribution over perfect matchings in $G$ that minimizes the Kullback-Leibler divergence from the Gibbs distribution. Thus, if one could compute the optimal value of this program then one could estimate the permanent exactly. However, the number of variables in this program can be exponentially large and it is not clear how to solve it. One can take the dual of this program, however, that leads (predictably) to the same problem; see \cite{SinghV14} for more details. We show how we can bypass this barrier and construct approximate convex programs starting from this one by making assumptions on the distribution we are seeking. Key to these simplifications are some heuristics from belief propagation, which result in certain relations between these marginals that one (wishfully) expects the optimal distribution $p$ to satisfy. Assuming these relationships, one can then write the above convex program entirely in terms of the first order marginals of the distribution $b$ -- dramatically reducing the number of variables. Of course, as a result of these simplifications, the convex programs obtained are approximations of the one above; see \eqref{eq:entr} and \eqref{eq:entrg}. However, as proved by Gurvits~\cite{Gurvits06} and Gurvits and Samorodnitsky~\cite{GS14}, they give us some of the best deterministic algorithms to estimate the value of $\mathrm{Per}(A)$. We expect that our point of view will lead to new convex programming methods for other counting problems (such as those studied in \cite{SV16}) by leveraging on heuristic reasonings from belief propagation. \section{Relaxations via Belief Propagation} Belief propagation algorithms attempt to find the Gibbs distribution $p$ by maintaining belief distributions $b$ supported over $\mathcal{M}$. These relations are often arrived at by considering the case when $G$ is a tree. In the following two subsections, we show that using two different relations, we end up with two different convex programs which, in turn, via standard techniques from convex programming allow us to recover the convex programs from \cite{GS02,Gurvits09,gurvits2011unleashing,GS14,AMOV16}. Some of the results we present are implicit in the papers by \cite{WC10,Vontobel13,CY13,CS15}. Our contribution is to present the unified picture along with some new relations. Let us now introduce some notation to explain the ideas formally. For a probability distribution $b$ supported on $\mathcal{M}$ we denote by $b_{i,j}(1)$ the probability that the edge $(i,j)$ is present in a random matching drawn from $b$, similarly $b_{i,j}(0)=1-b_{i,j}(1)$ is the probability that the edge is absent. Denote $B_{i,j}=b_{i,j}(0),$ it follows in particular that \begin{enumerate} \item $\sum_{j=1}^n B_{i,j}=1$ for all $1\leq i \leq n$, and \item $\sum_{i=1}^n B_{i,j}=1$ for all $1\leq j \leq n$. \end{enumerate} In other words, $B=(B_{i,j})_{i,j \in [n]}$ is a doubly stochastic matrix with support determined by $A$. We denote this set by $\Omega_n(A)$ and the set of all doubly stochastic matrices by $\Omega_n$. \subsection{Gurvits' first relaxation for the permanent} The starting point here is the following observation that when $G$ is a tree and $b$ is any distribution over perfect matchings in $G$, then \begin{equation}\label{eq:prod} b(M) =\prod_{(i,j): M_{i,j}=1} b_{i,j}(1). \end{equation} In other words, the probability of a perfect matching in $G$ is completely determined by the marginal probabilities of the edges and is computed as if all the events (corresponding to picking a particular edge) were independent. The reason why this is trivially true in the case of a tree is because a tree has at most one perfect matching. Therefore, all the marginals are either zero or one, depending whether a given edge belongs to the unique perfect matching or not. The heuristic jump then occurs when one, wishfully thinking, hopes that these relations hold for all graphs -- {\em at least when $b$ is the Gibbs distribution $p$}. While incorrect, assuming that $b$ satisfies \eqref{eq:prod}, leads us to the convex program as an approximation to that in~\eqref{eq:exact} in the following manner: \begin{align*} \sum_{M\in \mathcal{M}} b(M) \log \frac{\prod_{(i,j) \in E: M_{i,j}=1} A_{i,j}}{\prod_{(i,j):M_{i,j}=1}b_{i,j}(1)} = &\sum_{M\in \mathcal{M}} b(M) \log \frac{\prod_{(i,j) \in E: M_{i,j}=1} A_{i,j}}{\prod_{(i,j) \in E: M_{i,j}=1}B_{i,j}} \\ =& \sum_{M\in \mathcal{M}} b(M) \left( \sum_{(i,j) \in E: M_{i,j}=1} \log \frac{ A_{i,j}}{B_{i,j}} \right). \end{align*} \noindent The expression on the right hand side can be simplified further. Consider \begin{eqnarray*} \sum_{M\in \mathcal{M}} b(M) \left( \sum_{(i,j) \in E: M_{i,j}=1} \log \frac{ A_{i,j}}{B_{i,j}} \right) & = & \sum_{(i,j) \in E} \sum_{M\in \mathcal{M} : M_{i,j}=1} b(M) \log \frac{ A_{i,j}} {B_{i,j}}\\ & = & \sum_{(i,j) \in E} \log \frac{ A_{i,j}}{B_{i,j}} \sum_{M\in \mathcal{M} : M_{i,j}=1} b(M) \\ & = & \sum_{(i,j) \in E} B_{i,j} \log \frac{ A_{i,j}}{B_{i,j}}. \end{eqnarray*} \noindent Thus the relaxation~\eqref{eq:exact} reduces to the problem of maximizing the above expression over $B\in \Omega_n(A)$, i.e., we arrive at the following convex program:\footnote{In~\eqref{eq:entr} we switched from $\Omega_n(A)$ to $\Omega_n$ as the domain for $B$, however it is not hard to see that the value of the relaxation is not affected.} \begin{equation} \begin{aligned} R_E(A)\stackrel{\textup{def}}{=} \sup_{B\in \Omega_n} \sum_{(i,j) \in E} B_{i,j} \log \frac{A_{i,j}}{B_{i,j}}.\\ \end{aligned} \label{eq:entr} \end{equation} \noindent Using Lagrangian duality, we can now derive the relaxation considered by Gurvits. For variables $z_1,\ldots,z_n$ consider the polynomial $q_A(z) \stackrel{\textup{def}}{=} \prod_{i=1}^n \sum_{i=1}^n A_{i,j} z_j$. One can show using standard techniques that the following is the dual of the above convex program. \begin{equation}\label{eq:capa} R_C(A)\stackrel{\textup{def}}{=} \inf _{z >0} \frac{q_A(z)}{\prod_{i=1}^n z_i}. \end{equation} \noindent Formally one can prove the following theorem (see Appendix~\ref{sec:eq} and \cite{CS15}): \begin{theorem}\label{thm:rc} For all non-negative $n\times n$ matrices $A$, $R_C(A)= \exp(R_E(A)).$ \end{theorem} \noindent Since the coefficient of $\prod_{i=1}^n z_i$ in $q_A(z)$ is equal to $\mathrm{Per}(A)$ it is easy to see that $$ \mathrm{Per}(A)\leq R_C(A).$$ Furthermore an important result of Gurvits~\cite{Gurvits06}, which makes this convex program interesting, asserts that an upper bound holds: $$R_C(A) \leq e^n \cdot \mathrm{Per}(A).$$ Note that even though we arrived at this convex program by making an incorrect assumption on the Gibbs distribution, the result is a relaxation which provably approximates the permanent up to a factor of $e^n$ -- thus yielding a {\em deterministic} algorithm to estimate the value of the permanent of $A$. \medskip We conclude this section by showing how \eqref{eq:entr} can be reinterpreted in the language of polynomials, resulting in another relaxation for the permanent implicit in the work of~\cite{AMOV16} (see also~\cite{Gurvits09}). To explain their relaxation, consider any two positive matrices $C$ and $D$ such that their entry-wise product is equal to $A$, i.e., $A_{i,j}=C_{i,j} \cdot D_{i,j}$ for all $1\leq i,j\leq n$. Define $n^2-$variate polynomials $p(x)=\prod_{i=1}^n \sum_{j=1}^n x_{i,j} C_{i,j}$ and $q(y) = \prod_{j=1}^n \sum_{i=1}^n y_{i,j}D_{i,j}$. Then the relaxation is as follows:\footnote{In the relaxation defining $R_P(A)$ one can equivalently optimize over a larger domain for $B$, namely $B\in [0,1]^{n\times n}$.} $$R_P(A) \stackrel{\textup{def}}{=} \sup_{B\in \Omega_n} \inf_{x>0, y>0} \frac{p(x)\cdot q(y) \cdot \prod_{i,j} B_{i,j}^{B_{i,j}} }{\prod_{i,j} (y_{i,j} x_{i,j})^{B_{i,j}}}.$$ We observe that this relaxation is equivalent to~\eqref{eq:entr}. \begin{theorem}\label{thm:equiv_ep} For all non-negative $n\times n$ matrices $A$, $R_P(A)= \exp({R_E(A)}).$ \end{theorem} \noindent The proof can be easily deduced from the following observation. \begin{claim}\label{lemma:poly} Let $r$ be the following polynomial over $n^2$ variables $x_{i,j}$ (for $1\leq i,j \leq n$) $$r(x) = \prod_{i=1}^n \sum_{j=1}^n M_{i,j}x_{i,j},$$ where $M$ is any matrix with positive entries. Let $B\in \Omega_n$ be any doubly stochastic matrix, then $$\inf_{x\in \R^{n\times n}_{>0}} \frac{r(x)}{\prod_{ i,j} x_{i,j}^{B_{i,j}}}=\exp \inparen{ \sum_{i,j} B_{i,j} \log \frac{M_{i,j}}{B_{i,j}}}.$$ \end{claim} The proof of Claim~\ref{lemma:poly} appears in Appendix~\ref{sec:proof_claim}. \subsection{Gurvits' second relaxation for the permanent} To derive the second relaxation, as before we start with a relation among a distribution $b$ and its marginals which holds (again trivially) when $G$ is a tree. \begin{equation} \label{eq:approx2} b(M) = \frac{\prod_{M_{i,j}=1}b_{i,j}(1)}{\prod_{M_{i,j}=0} b_{i,j}(0)}. \end{equation} % \noindent The reason this is true for trees is that for the unique perfect matching $M$ of $G$ for $(i,j)\in M$ we have $b_{i,j}(1)=1$ and for $(i,j) \notin M$ we have $b_{i,j}(0)=1$. As in the previous section, we make a jump and assume that this relation holds for any bipartite graph -- at least for the case of the Gibbs distribution. Let us simplify the convex program~\eqref{eq:exact} using~\eqref{eq:approx2} as an assumption. We obtain that the objective of the convex program~\eqref{eq:exact} can be written as \begin{eqnarray*} \sum_{M\in \mathcal{M}} b(M) \log \frac{\prod_{(i,j) \in E: M_{i,j}=1} A_{i,j}}{ \frac{\prod_{(i,j) \in E: M_{i,j}=1}B_{i,j}}{\prod_{(i,j) \in E: M_{i,j}=0} (1-B_{i,j})}} & =& \sum_{M\in \mathcal{M}} b(M) \left( \sum_{(i,j) \in E: M_{i,j}=1} \log \frac{ A_{i,j}}{B_{i,j}} + \sum_{(i,j) \in E: M_{i,j}=0} \log (1-B_{i,j}) \right). \end{eqnarray*} The expression on the right hand side can be simplified as before to obtain \begin{eqnarray*} \sum_{M\in \mathcal{M}} b(M) \left( \sum_{(i,j) \in E: M_{i,j}=1} \log \frac{ A_{i,j}}{B_{i,j}} \right) & = & \sum_{(i,j) \in E} B_{i,j} \log \frac{ A_{i,j}}{B_{i,j}}. \end{eqnarray*} \noindent Similarly, $$ \sum_{M\in \mathcal{M}} b(M) \left( \sum_{(i,j) \in E: M_{i,j}=0} \log (1-B_{i,j}) \right) = \sum_{(i,j) \in E} (1- B_{i,j}) \log (1-B_{i,j}). $$ This allows us to rewrite the convex program~\eqref{eq:exact} in the following form: \begin{equation}\label{eq:entrg} R_O(A)\stackrel{\textup{def}}{=} \sup_{B\in \Omega_n} \sum_{(i,j) \in E} B_{i,j} \log \frac{ A_{i,j}} {B_{i,j}}+ \sum_{(i,j) \in E} (1- B_{i,j}) \log (1-B_{i,j}). \end{equation} \noindent It is worth noting that even though the program~\eqref{eq:exact} is convex, it does not imply that the objective in \eqref{eq:entrg} is convex. In fact it is convex only when restricted to the domain $\Omega_n$, which was observed by~\cite{Vontobel13}. Even more remarkable is the fact that, despite us plugging in the relations between the marginals that are only guaranteed to hold when $G$ is a tree, it was proved that the approximation guarantee is even better as for the first relaxation. Here proving that this convex program has any relation to the permanent requires some work and, indeed, Gurvits, using an inequality due to Schrijver \cite{schrijver1998counting}, proved that $$\exp(R_O(A)) \leq \mathrm{Per}(A).$$ Notice here that the estimate obtained from the convex program provides a {\em lower bound} to the permanent unlike Gurvits' first relaxation. Subsequently, Gurvits and Samorodnitsky~\cite{GS14} proved that this quantity in fact provides a sharp estimate for the permanent: $$ \mathrm{Per}(A) \leq 2^n \cdot \exp(R_O(A)).$$ \noindent Finally, we show how another polynomial-based relaxation for the permanent that is implicit in \cite{AMOV16} is equivalent to~\eqref{eq:entrg}. Let, as before, $C$ and $D$ be two positive matrices such that their entry-wise product is equal to $A$, i.e., $A_{i,j}=C_{i,j} \cdot D_{i,j}$ for all $1\leq i,j\leq n$. Define polynomials $p(x)=\prod_{i=1}^n \sum_{j=1}^n x_{i,j} C_{i,j}$ and $q(y) = \prod_{j=1}^n \sum_{i=1}^n y_{i,j}D_{i,j}$. Consider the following \begin{equation}\label{eq:poly_odd} R_Q(A) \stackrel{\textup{def}}{=} \sup_{B\in \Omega_n} \inf_{x>0, y>0} \frac{p(x)\cdot q(y) \cdot \prod_{i,j} B_{i,j}^{B_{i,j}} \cdot \prod_{i,j}(1-B_{i,j})^{1-B_{i,j}}}{\prod_{i,j} (y_{i,j} x_{i,j})^{B_{i,j}}}. \end{equation} As in the case of the first relaxation, we have the following theorem. \begin{theorem}\label{thm:equiv_oep} For all non-negative $n\times n$ matrices $A$, $R_Q(A)= \exp({R_O(A)}).$ \end{theorem} This theorem can be easily deduced from Claim~\ref{lemma:poly}. Indeed, for a fixed $B$, $x$ and $y$ are separable in the objective of $R_Q$, hence Claim~\ref{lemma:poly} can be applied separately to both of them, to yield the claimed result. \bibliographystyle{alpha}
{'timestamp': '2017-01-06T02:07:04', 'yymm': '1701', 'arxiv_id': '1701.01419', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01419'}
arxiv
\section{Introduction} The natural proofs barrier \cite{razborovRudich} showed that a large class of circuit-based proof techniques could not separate $\cc{P}$ from $\cc{NP}$, assuming the existence of pseudo-random generators of a certain strength. In light of the recent advances in techniques for lower bounds on algebraic circuits \cite{AV, koiranChasm, K12, tavenas, KSSregular, KLSS14, KLSS14b, KSFOCS14, GKKS, sarafSurvey, KayalSurvey14, KSLowArity15, KSic15, KS5, KSTopFanIn, KKPS15, ASSSJacobian, KSsmall16, KSfiner, AFSSV, CKSV16, FKS16, GKKSchasm, KSlocal16, KSfew16, KST16cubic, KST16, KNS16, KMS16, PSS}, it is natural to wonder whether our current algebraic techniques could plausibly separate $\cc{VP}$ from $\cc{VNP}$, or whether there is some barrier in this setting as well. People often hand-wave about an ``algebraic natural proofs barrier,'' by analogy to Razborov--Rudich, but it has not been clear what this means precisely, and to date no such barrier is known in a purely algebraic setting (see below for a discussion of the related work by Aaronson and Drucker \cite{AD, ADblog} in a partially algebraic, partially Boolean setting). There are several difficulties in coming up with such a barrier in the algebraic context. Razborov and Rudich's notion of natural proof has two key ingredients: (1) largeness---the technique works to show that random functions are hard---and (2) constructivity---deciding whether a function satisfies the hypotheses of the technique can be done efficiently given its truth table. These two ingredients in combination allow them to make the connection to pseudo-random generators. However, in the algebraic world, all \emph{three} of these notions are unclear: What should largeness mean in an algebraic context? What should constructivity mean? Is there a good algebraic notion of pseudo-random generator?\footnote{Although Agrawal's notion of algebraic PRG \cite{agrawalPRG} is useful in its own setting, it is not clear whether it could be used for an algebraic natural proofs barrier, and in fact connecting our formulation to Agrawal's PRGs remains an interesting open problem.} In a mixed Boolean-algebraic setting, Aaronson and Drucker \cite{AD, ADblog} provide satisfactory answers, but in a purely algebraic setting finding a constellation of three answers to these questions that align to give a satisfying algebraic natural proofs barrier has been an open question for more than twenty years. In the purely algebraic setting---algebraic circuits over an arbitrary field---we take largeness to mean Zariski-openness (the complement of the zero set of a set of polynomial equations), and constructivity to mean that the property is computable by an algebraic circuit whose size is polynomial in the number of coefficients of the function being tested. These two properties cover essentially all known algebraic lower bounds to date \cite{GrochowGCTUnity, ADblog} (see also \cite[Section~3.9]{SYsurvey}). Rather than connecting these notions directly to PRGs, we connect them to a slightly different derandomization problem, but one that is natural from the algebraic viewpoint: polynomial identity testing (PIT). Here, we suggest that the coefficient vectors of random linear projections of the determinant (respectively, a generic algebraic circuit) should produce good hitting sets for restricted versions of PIT. (This is closely related to Aaronson and Drucker's suggestion that they form a pseudo-random family of algebraic functions \cite{AD, ADblog}; see Section~\ref{sec:related} for details.) We observe that if this is true, then many proof techniques---including those of the recent advances---cannot be used to separate $\cc{VP}_{ws}$ from $\cc{VNP}$. As in the original natural proofs barrier, we thus show that a strong enough derandomization assumption implies that certain techniques cannot prove strong lower bounds. We recently learned that Forbes, Shpilka and Volk came to the same connection with PIT independently, and were able to show some of the derandomization assumptions unconditionally \cite{SV}. In the final two sections, we comment on how this algebraic natural proofs barrier bears on geometric complexity theory, and how it might be used to prove lower bounds in (algebraic) proof complexity. \subsection{The idea} \label{sec:idea} Almost all algebraic circuit lower bounds to date proceed either by the substitution method, or by a ``rank-type'' method, namely: associate to each polynomial $f$ some matrix $M(f)$---e.\,g., a matrix of partial derivatives or shifted partial derivatives, perhaps exponentially large---show an upper bound on the rank of $M(f)$ for any $f \in \mathcal{C}_{easy}$, and show a lower bound on the rank of $M(f_{hard})$ for some polynomial $f_{hard}$. In all examples to date, the entries of the matrix $M(f)$ are linear functions of the coefficients of $f$; as the rank of $M(f)$ is determined by the vanishing of its minors, we can view this method as an instance of the following more general ``polynomial method.'' For a polynomial $f$, let $\coeff{f}$ denote its coefficient vector. The polynomial method is to find a ``meta-polynomial'' $T$ (called ``test polynomials'' in \cite{GrochowGCTUnity})---whose variables are the coefficients of polynomials $f$---such that $T(\coeff{f})=0$ for all $f \in \mathcal{C}_{easy}$, but $T(\coeff{f_{hard}}) \neq 0$. The first step here---as in the original natural proofs barrier---is to consider the circuit complexity of the meta-polynomials $T$ themselves, relative to their number of inputs. The new idea here is to consider which classes of meta-polynomials have $\{\coeff{f} : f \in \mathcal{C}_{easy}\}$ as a hitting set. Let us consider what this looks like for the rank-type methods mentioned above. Suppose that we are considering polynomial families $f=(f_n)_{n=1,2,3\dotsc}$ in $n^c$ variables of degree $n$. The space of such polynomials has dimension $\binom{n + n^c -1}{n} = 2^{\Theta(n \log n)}$. Since this will be the number of variables of our meta-polynomials (we might call them ``meta-variables''), let us denote it by $N$. The matrices $M(f)$ typically have dimension $\text{poly}\xspace(N)$, which is still $2^{\Theta(n \log n)}$. If we are considering whether or not $M(f)$ has rank $\leq r$ or $> r$, then we are considering the (non)vanishing of the $(r+1) \times (r+1)$ minors, which are themselves determinants of size at most $\text{poly}\xspace(N) \times \text{poly}\xspace(N)$. Therefore, these meta-polynomials lie in the circuit class we denote $\cc{VP}_{ws}(N)$, which is defined just like $\cc{VP}_{ws}$, but where everything---degree, circuit size, etc.---is measured as a function of the number of variables $N$. This circuit complexity upper bound on the meta-polynomials is the algebraic analogue of Razborov and Rudich's constructivity criterion. Now, suppose we want to prove a lower bound against some class $\mathcal{C}_{easy}$ using such a rank-type argument. If the coefficient vectors of polynomials in $\mathcal{C}_{easy}$ form a hitting set (perhaps infinite) for $\cc{VP}_{ws}(N)$, then no meta-polynomial as in the preceding paragraph can vanish on $\mathcal{C}_{easy}$, precluding such arguments. This is the fundamental connection we advance between algebraic circuit lower bounds (by the polynomial method) and polynomial identity testing. \subsection{Relationship with previous work} \label{sec:related} Efremenko, Landsberg, Schenck, and Weyman \cite{ELSW1, ELSW2} proved unconditionally that the method of shifted partial derivatives cannot prove a lower bound stronger than $\Omega(n^2)$ on the permanent versus determinant problem. While parts of their methods are not specific to these polynomials, their results \emph{are} specific to the method of shifted partial derivatives. In contrast, our general framework has the potential to rule out proving lower bounds by \emph{any} method where the meta-polynomials are easily computable. While in this paper all our results are conditional, some of them are made unconditional in Forbes--Shpilka--Volk \cite{SV}. Aaronson and Drucker \cite{AD, ADblog} (see Aaronson's survey \cite[Section~6.5.3]{Asurvey} for an overview) had similar ideas, but ours differ in several respects. One strength of their work compared to ours is that they considered not just algebraic, but mixed Boolean-algebraic settings---that is, considering polynomials over finite fields as Boolean functions of the bitwise description of the field elements---and this allowed them to draw equivalences between the existence of Boolean and (suitably formulated) algebraic pseudo-random functions. In contrast, our work is purely algebraic, and rather than using pseudo-random generators, we use hitting sets for polynomial identity testing. The difference between their work and ours which allows us to make the connection with PIT is as follows. They considered a polynomial family $f_n$ to be pseudo-random if it could not be distinguished from a random polynomial family of similar degree by any meta-polynomial computed by small circuits $C_n$, in the sense that $\Pr[f_n(C_n(f_n(x)))=f_n(x)]$ was negligible as a function of $n$ (smaller than $1/n^c$ for any $c$) \cite[Slide~8]{AD}. In order for this to make sense, they considered polynomial families $(f_n)$ over fields of growing size $\mathbb{F}_{p(n)}$ (and the probability is taken uniformly over $x \in \mathbb{F}_{p(n)}^n$). This is quite close to the usual Boolean definition of pseudo-randomness, which is what allowed them to make that connection. In contrast, we say that a meta-polynomial computed by some circuit $C_n$ distinguishes one polynomial $f_n$ from another polynomial $g_n$ if $C_n$ outputs 0 when given the coefficient vector of $f_n$ as input, and outputs a nonzero value when given the coefficient vector of $g_n$. (By using interpolation, we can replace ``coefficient vector'' with ``vector of evaluations at sufficiently many points'' for any class which supports interpolation, that is, which is closed under affine linear transformations of the variables.) By only considering a meta-polynomial to distinguish one polynomial from another by its vanishing/non-vanishing, rather than in the probabilistic sense of pseudo-randomness, we are able to work over arbitrary fields, and make the connection with PIT instead of pseudo-random functions. We note, however, that if in their work one instead considers algebraic Turing machines (a la Blum--Shub--Smale) to distinguish functions---as they suggest at one point---then probability goes away. By considering the possible paths through such a machine, one gets a condition which is a logical combination of conditions on the vanishing/non-vanishing of certain polynomials, rather than the vanishing/non-vanishing of a single polynomial. See Remark~\ref{rmk:vanishing} for more details. \section{Preliminaries} A \emph{family} of polynomials $f=(f_n)$ consists of one polynomial $f_n$ for each $n$, usually on a number of variables that depends on $n$. A sequence of integers $a_1, a_2, \dotsc$ is \emph{p-bounded} if there is a polynomial $n^c + c$ such that $a_n \leq n^c + c$ for all sufficiently large $n$. A \emph{p-family} is a family of polynomials $(f_n)$ such that the number of variables of $f_n$ and the degree of $f_n$ are both p-bounded. We will primarily be interested in p-families throughout. A non-uniform algebraic complexity class is a collection of families of polynomials. $\cc{VP}$ is the collection of p-families $(f_n)$ such that $f_n$ computable by an algebraic circuit of $\text{poly}\xspace(n)$ size. $\cc{VNP}$ is the collection of p-families $(g_n)$ such that there is a family $(f_n(x,e)) \in \cc{VP}$ such that $g_n(x) = \sum_{e \in \{0,1\}^{\text{poly}\xspace(n)}} f_n(x,e)$. $\cc{VP}_{ws}$ is the collection of p-families $f=(f_n)$ such that $f_n(x) = \det_{\text{poly}\xspace(n)}(L_n(x))$ where $L_n(x)$ is matrix whose entires are affine linear functions of the $x_i$. $\cc{\Sigma \Pi \Sigma}$ is the collection of p-families computable by polynomial-size, depth-three, layered circuits, with a linear combination gate at the output, preceded by a layer of multiplication gates, preceded by a layer of linear combinations of the input; that is, the polynomial is a sum of polynomially many products of linear functions of the inputs. A polynomial $f(x_1, \dotsc, x_n)$ is a \emph{projection} of a polynomial $g(y_1, \dotsc, y_m)$ if there are affine linear functions $\ell_1(\vec{x}), \dotsc, \ell_m(\vec{x})$ such that $f(\vec{x}) = g(\ell_1(\vec{x}), \dotsc, \ell_m(\vec{x}))$, identically as polynomials. A polynomial family $f=(f_n)$ is a \emph{p-projection} of a polynomial family $g=(g_n)$ if there is a polynomial $t(n)$ such that for all $n$, $f_n$ is a projection of $g_{t(n)}$. Let $\Poly^d(v)$ denote the space of \emph{homogeneous} polynomials of degree $d$ in $v$ variables, and $\Poly^{\leq d}(v)$ denote the space of (not necessarily homogeneous) polynomials of degree at most $d$ in $v$ variables. Homogeneity is used for technical simplicity; essentially everything we say can be modified to several other natural settings, such as non-homogeneous polynomials or multilinear polynomials. Rather than the definitional viewpoint of a complexity class as a collection of families of polynomials, it will be useful to ``reverse the order of quantifiers'', and to consider, for each $n$, a subset of $\Poly^{d(n)}(v(n))$, and to consider a complexity class as a family of such subsets, one for each $n$. This viewpoint is implicit in much work on lower bounds in algebraic complexity theory, going back to work of Strassen (e.\,g., \cite{strassen}), and is explicit in geometric complexity theory (e.\,g., \cite{gct1, gct2, gctJACM, gct5, BLMW}). An example will help make this clear: In terms of lower bounds showing that some polynomial is not in $\cc{VP}_{ws}$, it is useful to think of $\cc{VP}_{ws}$ as being ``captured'' by the following family of sets: \[ \mathcal{D}_n \stackrel{def}{=} \{ f(x) \in \Poly^{\leq n}(n^2) : (\exists L)[f(x) = \det_n(L(x))]\} \] where the $L$ we consider here are those such that $L(X)$ is an $n \times n$ matrix whose entries are affine linear combinations of the variables $x_i$. The family $\mathcal{D}=(\mathcal{D}_n)_{n=1,2,3,\dotsc}$ captures $\cc{VP}_{ws}$ in the sense that, given a family of polynomials $g=(g_n)$, showing that $g_n \notin \mathcal{D}_{m_n}$ for all polynomially bounded sequences $(m_n)$ and for infinitely many $n$ proves that $g \notin \cc{VP}_{ws}$. We crystalize this into the following definition: \begin{definition} A family of subsets $(\mathcal{F}_n)$ with $\mathcal{F}_n \subseteq \Poly^{d(n)}(v(n))$ \emph{captures} a non-uniform algebraic complexity class $\mathcal{C}$ if: \begin{enumerate} \item For every family of polynomials $(f_n)$ with $f_n \in \mathcal{F}_n$ for all $n$, it follows that $(f_n) \in \mathcal{C}$, and \item For every family of polynomials $f=(f_n) \in \mathcal{C}$, there is a polynomially bounded sequence of integers $m_n$ such that $f_n \in \mathcal{F}_{m_n}$ for every $n$. \end{enumerate} We say that $(\mathcal{F}_n)$ \emph{captures $\mathcal{C}$ with padding} if we replace the last item by \begin{enumerate} \item[2$^\prime$.] For every family of polynomials $f=(f_n) \in \mathcal{C}$, there are polynomially bounded sequences of integers $e_n, m_n$ and a family of linear forms $\ell=(\ell_n)_{n=1}^{\infty}$ such that $\ell_n(x)^{e_n} f_n(x) \in \mathcal{F}_{m_n}$ for every $n$. \end{enumerate} \end{definition} It is readily seen that the family $\mathcal{D}_n$ above captures $\cc{VP}_{ws}$. Its homogeneous version, \[ \mathcal{D}^h_n \stackrel{def}{=} \{ f(x) \in \Poly^{n}(n^2) : (\exists L)[f(x) = \det_n(L(x))]\} \] where we only conisder \emph{linear} $L$ (zero constant term), captures homogeneous polynomials in $\cc{VP}_{ws}$ with padding. Similarly, the family \[ \mathcal{SPS}_n \stackrel{def}{=} \left\{ f \in \Poly^{\leq n}(n) : \left[\exists a_{ijk} \in \mathbb{F}\right]\left(f = \sum_{i=1}^n \prod_{j=1}^{d(i)} \sum_{k=1}^n a_{ijk} x_k\right) \right\} \] captures $\cc{\Sigma \Pi \Sigma}$. While essentially all non-uniform algebraic complexity classes that are ever considered have a natural family of sets that captures them, note that such families are not unique. For example, $\cc{VP}_{ws}$ is also captured by the family of sets \[ \mathcal{W}_n \stackrel{def}{=} \{ f \in \Poly^{\leq n}(n) : f \text{ can be computed by a weakly-skew circuit of size } \leq n \}. \] While each $\mathcal{W}_n$ is quite different from each $\mathcal{D}_n$, this merely reflects the fact that weakly-skew circuit size and determinantal complexity are not equal, despite the fact that they are polynomially related. Throughout, whenever we refer to a complexity class such as $\cc{VP}_{ws}(n)$, we really mean ``$\mathcal{F}_n$, for any fixed family $\mathcal{F}_n$ that captures $\cc{VP}_{ws}$ (possibly with padding).'' \subsection{Meta-polynomials and meta-complexity classes} Given a space of polynomials $\Poly^{d_n}(v_n)$, we may consider \emph{meta-polynomials} on this space, which are polynomials $T$ whose variables correspond to the \emph{coefficients} of polynomials in $\Poly^{d_n}(v_n)$. That is, $T$ is a polynomial in $N = \binom{d_n + v_n-1}{d_n}$ variables. We denote the space of homogeneous meta-polynomials of degree $D$ by $\Poly^D(\Poly^{d_n}(v_n)) \cong \Poly^D(N)$. Given a polynomial $f \in \Poly^{d_n}(v_n)$ and a meta-polynomial $T \in \Poly(\Poly^{d_n}(v_n))$, we denote by $T(\coeff{f})$ the evaluation of $T$ at the coefficient vector of $f$. We will generally use capital letters to denote meta-polynomials, their degrees, and their number of variables, and lower-case letters for (non-meta) polynomials. \begin{example*} The familiar polynomial $b^2 - 4ac$ may be considered as a meta-polynomial on the space $\Poly^2(2)$ of degree 2 homogeneous polynomials in 2 variables, namely, $\Poly^2(2) = \{ a x^2 + b xy + c y^2 : a,b,c \in \mathbb{F}\}$. Then $T=b^2 - 4ac \in \Poly^2(\Poly^2(2))$, and evaluating $T$ at a polynomial $f = a x^2 + b xy + c y^2$ has the usual and natural meaning. \end{example*} We will want to consider families of meta-polynomials $T=(T_n)$ with $T_n \in \Poly(\Poly^{d_n}(v_n))$. If $v_n, d_n$ are themselves at least linear in $n$, then the number of variables of $T_n$ is exponential in $n$, so this family does not technically fit into the usual algebraic complexity classes as defined above. We would nonetheless like an analogue of the above classes where $T_n$ may depend on more than $\text{poly}\xspace(n)$ variables, but its other relevant quantities are polynomial in its (usually much larger than $\text{poly}\xspace(n)$) number of variables. We annotate such classes with a capital $N$, where $N_n$ is the number of variables of $T_n$ (in this case, $\dim \Poly^{d_n}(v_n)$). \begin{definition}[Stretched complexity classes] \label{def:stretched} Given an algebraic complexity class $\mathcal{C}$, and a function $N(n)$, we define \emph{$\mathcal{C}$ with stretch $N$}, denoted $\mathcal{C}(N)$, as the class of families of polynomials $T = (T_n)$ such that there is a family $\overline{T} \in \mathcal{C}$ with $T_n = \overline{T}_{N(n)}$. \end{definition} For most standard algebraic complexity classes, such as $\cc{VP}$, $\cc{VP}_{ws}$, $\cc{VNP}$, or $\cc{\Sigma\Pi\Sigma}$, this is equivalent to: \begin{defStretchedPrime}[Alternative definition of stretched, for standard classes] Given an algebraic complexity class $\mathcal{C}$, and a function $N(n)$, we define \emph{$\mathcal{C}$ with stretch $N$}, denoted $\mathcal{C}(N)$, as the class of families of polynomials $T = (T_n)$ such that $T$ satisfies the hypotheses of $\mathcal{C}$ with ``polynomial in $n$'' everywhere replaced by ``polynomial in $N(n)$.'' \end{defStretchedPrime} To see that the two are equivalent: Given $T \in \mathcal{C}(N)$ according to Definition~\ref{def:stretched}$^\prime$, if we let $\overline{n}(N)$ be the inverse of $N(n)$ rounded to the nearest integer, then defining a family $\overline{T}_n = T_{\overline{n}(N(n))}$ satisfies Definition~\ref{def:stretched}. The opposite direction is clear. For example, $\cc{VP}(N)$ denotes the class of families of polynomials $T=(T_n)$ where $T_n$ has $\text{poly}\xspace(N)$ many variables, is of $\text{poly}\xspace(N)$ degree, and can be computed by circuits of $\text{poly}\xspace(N)$ size. We define $\cc{VNP}(N)$, $\cc{VP}_{ws}(N)$ and $\cc{\Sigma\Pi\Sigma}(N)$ analogously. Since we will typically be considering polynomials in $\text{poly}\xspace(n)$ many variables with $\text{poly}\xspace(n)$ degree, the space $\Poly^{d_n}(v_n)$ will have dimension $N_n = 2^{n^{O(1)}}$, so we have that $n = \text{poly}\xspace(\log N)$. \section{An algebraic natural proofs barrier via polynomial identity testing} We start by giving our definition of ``algebraic natural property;'' an algebraic natural proof in our sense will essentially be one that uses such a property. As is the case with Razborov--Rudich natural proofs, the latter is not a precise, formal definition, but in practice this will cause us no difficulties, and in particular does not affect our results (which are precise and formal). In the algebraic setting, a property of polynomials is a collection of subsets $C_n \subseteq \Poly^{d_n}(v_n)$ for some (usually p-bounded) sequences $d_n, v_n$. (Recall that everything we say is easily adapted to other kinds of polynomials such as non-homogeneous or multilinear.) \begin{definition}[Natural property] A property of polynomials $C=(C_n)$ with $C_n \subseteq \Poly^{d_n}(v_n)$ is \emph{natural} if it contains a set $C_n^* \subseteq C_n$ for each $n$ satisfying the following two conditions: \begin{enumerate} \item \emph{Largeness: } $C_n^*$ is the complement of the zero-set of a meta-polynomial $T_n$. \item \emph{Constructivity: } The meta-polynomial family $T=(T_n)$ has degree and circuit size bounded by a polynomial in the number of its variables ($=\text{poly}\xspace(\dim \Poly^{d_n}(v_n)) = \text{poly}\xspace(\binom{d_n + v_n - 1}{d_n})$). That is, $T \in \cc{VP}(N)$ for $N_n = \dim \Poly^{d_n}(v_n)$. \item \emph{Usefulness: } The algebraic circuit size of any family of functions $(f_n)$ with $f_n \in C_n$ for all $n$ is super-polynomial, that is, for any constant $d$, for sufficiently large $n$ the circuit size of $f_n$ is greater than $n^d$. \end{enumerate} \end{definition} \begin{remark}[Deciding by (non)vanishing] \label{rmk:vanishing} It is important for the connection with PIT that constructivity here be in terms of computing $T$ symbolically as a polynomial (or at least, some $T'$ such that $\{f : T'(f) \neq 0\} \subseteq C_n$), and not merely in terms of \emph{deciding} whether a given function $f$ is contained in $C_n^*$ (as is the case with Razborov--Rudich natural proofs). However, we note that even if we had allowed instead, say, Blum--Shub--Smale-style algebraic Turing machines to decide, given $\coeff{f}$, whether or not $f \in C_n^*$, then much of the machinery still survives. In particular, the generic path through a BSS machine is still Zariski-open, being the intersection of finitely many Zariski-open subsets, and the ``yes/no'' output of the machine on generic inputs depends only on the vanishing/non-vanishing of a given polynomial. However, we would then need our hitting set to hit not only this final ``decider'' polynomial, but also all of the ``branching'' polynomials encountered along the generic computation path. If we wanted to consider all paths through the BSS machine, and not just the generic one, the situation becomes significantly more complicated, and as far as we are aware hitting sets for such computations have not been considered in the literature. \end{remark} \begin{remark}[Choice of field] In terms of which fields to work over, in order to make the connection with derandomization, we want to work over fields that are large enough that derandomizing PIT over those fields is at least plausible. For simplicity, it may be easier to think of $\mathbb{F}$ as any infinite field. In principle, one could also work over a family of fields $\mathbb{F}_{s(n)}$ of size $s(n)$ greater than twice the degree of the polynomials under consideration (so the Schwarz--Zippell-DeMillo--Lipton Lemma holds). Note that for $s(n) < 2^{\text{poly}\xspace(n)}$, the algebraic natural proofs barrier of Aaronson and Drucker also applies \cite{AD, ADblog}. \end{remark} We generalize this to: \begin{definition}[$\Gamma$-natural against $\Lambda$] For two complexity classes $\Gamma, \Lambda$, a property $C = (C_n)$ is \emph{$\Gamma$-natural against $\Lambda$} if it contains a subset $C_n^* \subseteq C_n$ satisfying: \begin{enumerate} \item \emph{Largeness: } $C_n^*$ is the complement of the zero-set of a meta-polynomial $T_n$. \item \emph{$\Gamma$-Constructivity: } The meta-polynomial family $T=(T_n)$ is in the meta-complexity class $\Gamma(N)$, where $N_n = \dim \Poly^{d_n}(v_n)$. \item \emph{Usefulness against $\Lambda$: } Any family of functions $f=(f_n)$ with $f_n \in C_n$ for all $n$ is not contained in $\Lambda$. \end{enumerate} \end{definition} As observed in \cite{GrochowGCTUnity}, essentially all known algebraic circuit lower bounds to date are natural in this sense; in fact, most of them are $\cc{VP}_{ws}$-natural against the relevant complexity class, as they are defined by the rank of a matrix of size $\text{poly}\xspace(N) \times \text{poly}\xspace(N)$ (see Section~\ref{sec:idea}). The key observation is the following. If there is a hitting set against $\cc{VP}$ which consists of the coefficient vectors of polynomials of number of variables, degree, and size $\text{poly}\xspace(\log n)$, then there is no property that is $\cc{VP}$-natural against $\cc{VP}$. In other words, if for every meta-polynomial $T \in \cc{VP}(N)$, there is some polynomial $f \in \cc{VP}$ such that $T(\coeff{f}) \neq 0$, then one cannot prove a lower bound against $\cc{VP}$ by exhibiting a meta-polynomial that vanishes on a family of sets capturing $\cc{VP}$. As all such lower bounds to date are of this form \cite{GrochowGCTUnity}, and it is reasonable to expect future such lower bounds to be as well (see, e.\,g., \cite{strassen} or \cite[Appendix~B]{GrochowGCTUnity} for a more extended discussion of this expectation), this rules out quite a large class of lower bounds methods. We formalize this observation with a definition and a theorem: \begin{definition}[Succinct hitting set] An algebraic complexity class $\Lambda$ is a \emph{succinct hitting set} against another class $\Gamma$ if there is a family of sets $\Lambda(n)$ which captures $\Lambda$, such that $\{\coeff{f} : f \in \Lambda(n)\}$ is a hitting set against $\Gamma(N)$, where $N$ is the dimension of the ambient space of $\Lambda(n)$. Namely, for all nonzero $T \in \Gamma(N)$, there is some $f \in \Lambda(n)$ such that $T(\coeff{f}) \neq 0$. \end{definition} \begin{theorem} For any two algebraic complexity classes $\Gamma, \Lambda$, there is a $\Lambda$-succinct hitting set against $\Gamma$ if and only if there is no property which is $\Gamma$-natural against $\Lambda$. \end{theorem} We have essentially already given the proof in the paragraph above. \qed The main open question is thus: \begin{open} Is $\cc{VP}$ a succinct hitting set against $\cc{VP}$? Is $\cc{VP}_{ws}$ a succinct hitting set against $\cc{VP}_{ws}$? \end{open} We note that it is not even obvious whether or not $\cc{VNP}$ is a succinct hitting set against $\cc{VP}_{ws}$. An important first step would be to show that known hitting sets against subclasses $\Gamma \subseteq \cc{VP}$ can be made $\Lambda$-succinct for as small a class $\Lambda$ as possible. For several pairs $(\Lambda, \Gamma)$ this is achieved in \cite{SV}. \begin{remark}[Generators] A \emph{generator} for a class $\Gamma$ is a vector-valued function $\vec{G}(x_1, \dotsc, x_s)$ such that for any nonzero $f \in \Gamma$, $f(\vec{G}(\vec{x}))$ is not identically zero as a polynomial in $\vec{x}$. In other words, the image of $\vec{G}$---essentially an $s$-dimensional variety---is a hitting set (perhaps infinite) against $\Gamma$. The number of variables, $s$, is called the seed length of the generator; generators of small seed length are useful because they reduce PIT for $\Gamma$ from a many-variable problem to $s$-variable PIT, which is easily solved for small $s$. For most standard classes $\Lambda$, we note that if $\Lambda$ is a succinct hitting set against $\Gamma$, then this set is a generator against $\Gamma$ of small seed length. For most classes---such as $\cc{VP}, \cc{VNP}, \cc{VP}_{ws}$, $\cc{\Sigma \Pi \Sigma}$---are the image of a simply specified polynomial map $\vec{G}$ on few parameters. For example, the set of linear projections of the $n \times n$ determinant captures $\cc{VP}_{ws}(n)$ (with padding). This means that we may consider $\cc{VP}_{ws}(n)$ as the image of the map $M_{n^2 \times n^2} \to \Poly^n(n^2)$ which sends an $n^2 \times n^2$ matrix $L$ to the function $\det_n(L(\vec{x}))$, where we think of the $n \times n$ matrix $x$ simply as a vector of length $n^2$. If $\cc{VP}_{ws}$ is a hitting set for some class $\Gamma(N)$, then we may view it as a generator for $\Gamma(N)$ using the preceding encoding. The seed length of this generator is $n^4 = \text{poly}\xspace(n)$ variables, but it outputs vectors in $\Poly^n(n^2)$, which has dimension $N$ that is exponential in $n$. So when $\cc{VP}_{ws}$ is a hitting set against some $\Gamma$, this generator still reduces from finding a hitting set in $N=2^{\Theta(n \log n)}$ variables to finding a hitting set in $n^4 = \text{poly}\xspace(\log N)$ variables. As in the preceding example of $\cc{VP}_{ws}$ and the determinant, generators of small seed length are obvious for many classes; for $\cc{VP}$ this is somewhat less obvious, but is still true \cite{razElusive}. \end{remark} \section{Relationship with other topics in complexity} \subsection{Geometric complexity theory} \label{sec:GCT} In geometric complexity theory (GCT), the suggestion is not merely to use the polynomial method to find a meta-polynomial $T$ that vanishes on $\mathcal{C}_{easy}$ but not on some $f_{hard}$, but to additionally take advantage of the fact that most standard non-uniform classes $\mathcal{C}(n)$ are invariant under the action of some nontrivial group $G$, such as $\GL_n$ or $S_n$. This is because most measures of complexity do not depend on how we name the variables (leading to $S_n$ symmetry), and in many cases only change polynomially given a linear change of variables (leading to $\GL_n$ symmetry). The suggestion, without loss of generality, is thus to use a property $C_n$ to separate $\mathcal{C}(n)$ from $f_{hard}$ such that $C_n$ is also sent to itself by the same symmetry group. In this case, rather than considering a single meta-polynomial $T$, we may, again without loss of generality, consider the entire linear span $V$ of all meta-polynomials $T'$ that are in the $G$-orbit of $T$. (When $G$ is $S_n$ it is clear that $V$ is finite-dimensional; even over infinite fields, however, this is also true of the $\GL_n$-orbit of $T$.) $V$ is then a representation of $G$ or $G$-module; following \cite{GrochowGCTUnity} we refer to a $G$-module of meta-polynomials as a ``test $G$-module,'' since its vanishing is a test for having a given $G$-invariant property. For $G=\GL_n$ (a natural group of symmetries for many standard algebraic circuit classes such as $\cc{VP}$, $\cc{VP}_{ws}$, $\cc{VNC}$, $\cc{VNP}$, $\cc{VQP}$, $\cc{\Sigma \Pi \Sigma}$), every irreducible $G$-module contains an essentially unique highest weight vector (see, e.\,g., \cite{fultonHarris}) (=highest weight test polynomial), which is an ``HWV obstruction'' in the terminology of \cite{BI}. (Conversely, every HWV obstruction gives rise to a test module.) Considering these HWV obstructions directly, B\"{u}rgisser\xspace and Ikenmeyer were able to prove lower bounds on matrix multiplication using the technology of GCT \cite{BI}. This raises the natural question of: given the label $\lambda$ of an irreducible $\GL_n$-module ($\lambda$ is a partition with at most $n$ parts, see, e.\,g., \cite{fultonHarris}), how computationally hard is it to construct its (unique) highest weight test polynomial? However, from the viewpoint of algebraic natural proofs, we are led to a related but slightly different question. The first natural question to think of is to determine the circuit complexity of the HWV obstructions. However, algebraic natural proofs suggests asking something still further. Namely, suppose that $\Gamma$-natural proofs cannot prove lower bounds against $\Lambda$, and suppose that $\Lambda(n)$ is invariant under a group $G_n$ (not necessarily $\GL_n$---in particular, we do not need the theory of highest weights for what we are about to say). Then given a sequence of test $G_n$-modules $V_n$, potentially useful against $\Lambda(n)$, if there is a sequence of meta-polynomials $T_n \in V_n$ such that $(T_n)_{n=1,2,3,\dotsc}$ is in $\Gamma$, then for infinitely many $n$, $V_n$ is not useful against $\Lambda(n)$---that is, $V_n$ does not vanish identically on $\Lambda(n)$. We are thus led to the question: \begin{open} \label{q:complexityTestModule} For any given sequence of test $G$-modules $V_n$, what is the complexity of the \emph{easiest} family of meta-polynomials $(T_n \in V_n)$? \end{open} In particular, while the complexity of any given $T_n \in V_n$ doesn't change within the orbit of $T_n$, $V_n$ itself contains all \emph{linear combinations} of points on this orbit, and some such linear combinations could have significantly lower complexity than, say, the HWVs in $V_n$ (when $V_n$ is a test $\GL_n$-module). Note that, whether or not there is a natural proofs barrier for $\cc{VP}$, the above question is interesting. For if there is such a barrier, then any family of test $G$-modules with low-complexity polynomials cannot be used to prove lower bounds.\footnote{It is interesting to note that if, for a given sequence of labels $\lambda(n)$, we could find an upper bound on the easiest family of test polynomials in \emph{any} family of test $\GL_n$-modules isomorphic to $V_{\lambda(n)}$, then this could be used to rule out \emph{multiplicity} obstructions. At the moment, there are essentially no techniques known for ruling out multiplicity obstructions, only for ruling out occurrence obstructions, e.\,g., \cite{ikenmeyerPanova,BIP,GIP}.} Conversely, if there is no such barrier, then any family of test $G$-modules with low-complexity polynomials might be a good place to look for test polynomials to prove lower bounds, since we might hope that low-complexity test polynomials would be easier to understand and therefore easier to use to try to prove lower bounds. This question is perhaps more immediately interesting in the following specific cases: Given a class $\Gamma$ for which it is shown in \cite{SV} that $\Gamma$-natural proofs cannot prove lower bounds against $\cc{VP}$, which families $V_{\lambda(n)}$ of test $\GL_n$-modules contain a family of test polynomials $T_n$ such that $(T_n) \in \Gamma$? Note that, even for test $\GL_n$-modules $V$, the highest weight meta-polynomials need not be the easiest polynomials in $T$. So although considering HWV obstructions may be useful for proving lower bounds, in order to prove that certain test $\GL_n$-modules are \emph{not} useful for lower bounds, one needs to consider the more general Open Question~\ref{q:complexityTestModule}. \subsection{Algebraic proof complexity} Pitassi \cite{pitassi96, pitassiICM} and Grochow \& Pitassi \cite{GP} introduced the Ideal Proof System (IPS), for refuting unsatisfiable CNFs using algebraic reasoning. While IPS is a very strong proof system---at least as strong as Extended Frege---they also introduced a variant of this system called the \emph{Geometric} IPS (it is an open question whether Geometric IPS can p-simulate general IPS). Using the connection in this paper it may be plausible to prove unconditional lower bounds against Geometric IPS. We now discuss this in a bit more detail. \begin{definition*}[{Geometric Ideal Proof System, ``Geometric IPS,'' \cite[Appendix~B]{GP}}] Given an unsatisfiable system of polynomial equations $f_1(\vec{x}) = \dotsb = f_m(\vec{x}) = 0$, a \emph{geometric IPS certificate} of unsatisfiability consists of an algebraic circuit $C(y_1, \dotsc, y_m)$ such that \begin{enumerate} \item $C(\vec{0}) = 1$, and \item $C(f_1(\vec{x}), \dotsc, f_m(\vec{x})) = 0$, in other words, $C$ is a polynomial relation amongst the $f_i$. \end{enumerate} For any algebraic circuit class $\mathcal{C}$, a \emph{geometric $\mathcal{C}$-IPS proof} is an algebraic circuit in $\mathcal{C}$ on inputs $y_1, \dotsc, y_m$ computing some geometric IPS certificate. \end{definition*} This system may be used to prove that a 3CNF formula is unsatisfiable as follows. Given a 3CNF formula with $m$ clauses, we translate it into a system of $m$ polynomials of degree at most $3$ in the natural way, so that any Boolean assignment to the variables satisfies a clause iff the corresponding polynomial evaluates to 0. Then the 3CNF is unsatisfiable iff the corresponding equations $f_1(\vec{x}) = \dotsb = f_m(\vec{x}) = x_1^2 - x_1 = \dotsb = x_n^2 - x_n = 0$ are unsatisfiable over $\mathbb{F}$. In \cite[Appendix~B]{GP} it shown that geometric IPS, without any complexity bounds on the circuit computing a certificate, is a sound and complete proof system for such systems of equations. In fact, over any algebraically closed field or any dense subfield of $\mathbb{C}$, they showed that the same is true even if the equations $x_i^2 - x_i = 0$ are omitted. The idea of the geometric IPS is to consider the equations $f_1(x_1, \dotsc, x_n), \dotsc, f_m(x_1, \dotsc, x_n)$ as a map $f\colon \mathbb{F}^n \to \mathbb{F}^m$, and to note that the system of equations $f_1 = \dotsc = f_m = 0$ is satisfiable iff 0 is in the image of the map $f$. A geometric IPS certificate proves that, not only is 0 not in the image, but 0 is not even in the \emph{closure} of the image of the map $f$. The geometric object of interest here is thus the image of the map $f$. Suppose we have a family $(\mathcal{F}_n)_{n=1,2,\dotsc}$ of systems of polynomial equations \[ \mathcal{F}_n = (f_{n,1}(x_1, \dotsc, x_{n^c}), \dotsc, f_{n,n^d}(\vec{x})), \] such that the images of the maps $f_{n}\colon \mathbb{F}^{n^c} \to \mathbb{F}^{n^d}$ are a hitting set against some circuit class $\Lambda$. Then, by condition (2) of the above definition, no geometric $\Lambda$-IPS certificate can exist. Although here we are using the evaluations of polynomials rather than their coefficient vectors, note that for any class $\Lambda$ capable of interpolation---that is, closed under affine linear transformations---a succinct hitting set can be defined either in terms of coefficient vectors or in terms of the vector of evaluations at sufficiently many points. \begin{open} For various $\Lambda$ for which hitting sets are known, prove lower bounds on the Geometric $\Lambda$-Ideal Proof System by finding a succinct hitting set of the following form: there is a family of unsatisfiable 3CNFs $(\varphi_n)$ such that, if $f_n$ is the above polynomial map associated to $\varphi_n$, then the image of $f_n$ is a hitting set against $\Lambda$. \end{open} Of course, it would also be interesting to show that for certain $\Lambda$ no hitting sets of this form exist. Unfortunately, we were unable to get the same connection to work for general IPS. The natural object to look at for general IPS is not the image of $f$, but rather its graph $\{(\vec{\alpha}, \vec{f}(\vec{\alpha})) : \vec{\alpha} \in \mathbb{F}^n\}$. The issue is that, when the $f_i$ are themselves described by small circuits, as is essentially always the case in instances of complexity-theoretic interest, the function $y_i - f_i(\vec{x})$ is a very easily computable function which vanishes on the graph of $f$. \begin{open} Find and exploit an analogous connection between algebraic natural proofs / hitting sets and (general) IPS. \end{open} \section*{Acknowledgments} We thank Scott Aaronson and Andy Drucker for conversations about their work \cite{AD, ADblog}, the relationship between the two approaches and how they might be combined. We thank Amir Shpilka for conversations related to Section~\ref{sec:GCT} and for his encouragement to publicize our thinking, even in light of the results of \cite{SV} which (independently) supercede ours. During the course of this work, J.A.G. was supported by A. Borodin's NSERC Grant \# 482671, an Omidyar Fellowship from the Santa Fe Institute, and NSF grant DMS-1620484; M.S. was supported by NSF grant CCF-1218711 and by Simons Foundation Award 332622; and S.S. was supported in part by NSF grant CCF-1350572. \bibliographystyle{plainurl}
{'timestamp': '2017-01-09T02:08:12', 'yymm': '1701', 'arxiv_id': '1701.01717', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01717'}
arxiv
\section{Introduction} \label{sec:intro} Recent years have seen a proliferation of online peer-to-peer marketplaces~\cite{Einav-p2p-2016}. Examples abound and the services covered range from personal loans (Prosper, LendingClub, SocietyOne) and ride (Uber, Lyft) to household tasks (TaskRabbit) and accommodations (Airbnb). Enabled by the Internet and information technology, these marketplaces aim to match sellers who are willing to share underutilized goods or services with buyers who need them~\cite{Azevedo-matching-2016, Roth-matchmaking-2015}. Such marketplaces are thus often referred to as examples of the so-called ``sharing economy''~\cite{Malhotra-sharing-2014, Cusumano-sharing-2015, Sundararajan-sharing-2016}. Airbnb, a primary example of this type of marketplaces, connects hosts who have spare rooms with guests who need accommodations. Founded in $2008$, it now has more than two million listings located in more than $191$ countries, and has accumulated more than $60$ million guests.\footnote{https://www.airbnb.com/about/about-us} Accompanied by its rapid growth, Airbnb has confronted intense debates, regulatory challenges, and battles. Advocates argue that the platform enables many householders to become small business owners and reduce their rental burden. It may also make travelers pay less than hotel prices and have a more local and authentic experience, exemplified by its slogan ``live there.'' Opponents argue that many hosts rent their entire homes for short-terms, which is illegal in many cities~\cite{Schneiderman-Airbnb-2014, NYT-illegal-2014, Guttentag-airbnb-2015}. This usage also involves two other critical issues. First, entire homes that are used for short-term rentals on Airbnb may be taken down from local housing markets, which may drive the rents up. A recent study, however, suggested that this might not be the case~\cite{Stulberg-538-2016}. Second, the coming-in of more travelers may be disruptive to residential neighborhoods. Another argument from opponents is that some hosts who own a large number of listings may be operating business on Airbnb but may fail to fulfill their tax obligations. This gives them advantages over hotels and makes them ``free riders,'' because accommodation taxes collected from hotels are often used for tourism promotions that benefit all accommodation suppliers~\cite{Guttentag-airbnb-2015}. Although much debated, to what extent the discussed arguments are empirically grounded remains to be seen. To this end, here we present the first large-scale data-driven study on Airbnb, focusing on the entire market. By measuring key characteristics directly related to these arguments, we paint a more complete yet complicated picture of Airbnb. First, regrading the issue of short-term rentals of entire homes, we document that across many countries, entire homes account for the majority of listings; $68.5\%$ of all listings are entire homes and only $29.8\%$ are private rooms. Although we do not further quantify the extent to which they are used for short-term rentals---a limitation of our work---simply due to the unavailability of proprietary data from Airbnb on listing bookings, we note that the statistics of room types have changed from $2012$ when $57\%$ are entire homes and $41\%$ are private rooms~\cite{Guttentag-airbnb-2015}. This change suggests that Airbnb has been becoming more like a rental marketplace rather than a spare-room sharing platform. Moreover, listings owned by business operators may more likely be rented in short-terms, compared with other ordinary hosts. Second, regarding the issue of business operators, we characterize in a great detail who they are and what their listings are. Our results suggest a heavier usage from business operators than previously thought. The number of listings owned by a host is distributed according to a power-law, spanning three orders of magnitude. One third of all listings are owned by $9.4\%$ of hosts, each of whom has at least three listings, and one host even owns $1,800$ listings. Furthermore, we show that business operators are early-movers towards joining Airbnb and behave more professionally than ordinary hosts and that their listings are disproportionately of the entire home type and located in the US. These results reinforce the rental marketplace notion of Airbnb. Third, our analysis reveals predominantly positive star-ratings of listings, which is different from previously observed J-shaped distribution. This positivity bias is consistent with a bias toward using positive words in reviews, and the extent is greater than Yelp reviews. These results may suggest that many guests had overall positive experiences during their stays, corroborating advocates' argument on traveler experiences. It can also indicate the presence of selection bias in review behaviors~\cite{Fradkin-bias-2015}---only those who had great experiences chose to give reviews. Taken together, we believe that our work significantly advances the current understanding of how Airbnb is being used. Our main contributions in this work are: \begin{itemize} \item We crawl Airbnb listing data on a global scale. (\S~\ref{sec:data}) \item We analyze geolocations, room types, star-ratings, and reviews of listings. (\S~\ref{sec:listing}) \item We characterize hosts who own multiple listings on Airbnb and those listings owned by them. (\S~\ref{sec:multi-listing}) \item We investigate factors linked to listings' future rental performance. (\S~\ref{sec:review-growth}) \end{itemize} \section{Data} \label{sec:data} \subsection{Data Collection} \begin{table} \caption{Statistics of our data set about Airbnb} \label{tab:stats} \begin{tabular}{l l r} \toprule \multicolumn{2}{l}{Countries} & $193$ \\ \midrule \multirow{3}{*}{Listings} & Active & $2,018,747$ \\ & Unavailable & $284,039$ \\ & Total & $2,302,786$ \\ \midrule \multirow{3}{*}{Users} & Hosts & $1,313,626$ \\ & Guests & $11,150,017$ \\ & Total & $12,156,178^{*}$ \\ \midrule \multicolumn{2}{l}{Reviews} & $19,377,978$ \\ \bottomrule \textit{Note:} & \multicolumn{2}{l}{$^{*}$ $307,465$ users are both hosts and guests} \end{tabular} \end{table} On Airbnb, each listing has a web page showing its details such as room type, price, reviews from previous guests, host information, etc. For example, the listing called ``Van Gogh's Bedroom'' can be visited at https://www.airbnb.com/rooms/10981658. The main goal of our data collection is to accumulate as many listings as possible, so that we can perform a systematic analysis. There are two steps in the data collection process: (1) accumulating listing IDs; and (2) downloading their HTML files and reviews. We describe them in detail below, and before that, let us present in Table~\ref{tab:stats} some summary statistics about the collected data set. To our best knowledge, these are the first public and exact statistics about the Airbnb marketplace. In the first step, we accumulated listing IDs by exploiting the hierarchical structure of the Airbnb site map, which has three levels: country, regions in the country, and search results of listings in the region. The top level at \texttt{/sitemaps} lists $152$ countries, each of which has a hyperlink pointing to the web page that lists regions in the country. All the regions in Australia, for example, are listed at \texttt{/sitemaps/AU}. Each region, again, has a hyperlink pointing to the page of search results of listings in the region. Our script followed all these hyperlinks and obtained $83,174$ regions in $152$ countries. Then for each region, our script visited its search page and saved all the listing IDs there. We repeated this search process $7$ times, with each new search resulting in a smaller number of new IDs. The only constraint stopping us from more searches is the availability of computing and storage resources. In total, we accumulated $2,302,786$ unique listings. In the second step, for each listing, our script visited its web page, saved the HTML file, and collected all the reviews. As we are also interested in rental performances of listings, we repeated this step $3$ times---after the 1st, 2nd, and 7th search. The statistics in Table~\ref{tab:stats} and the analyses presented in \S~\ref{sec:listing} and \S~\ref{sec:multi-listing} are based on the latest crawl. We found $284,039$ ($12.3\%$) listings were unavailable, by which we mean visiting them redirected to a search page with a message saying ``the listing is no longer available.'' As an example, see \texttt{/rooms/11599049}. The entire data collection process was performed between May and September, $2016$. Note that we followed the crawler-etiquette described in Airbnb's \texttt{robots.txt}:\footnote{https://www.airbnb.com/robots.txt} None of the three directories we visited---\texttt{/sitemaps}, \texttt{/s/}, and \texttt{/rooms/\{listing ID\}}---are specified as disallowed in the file. \subsection{Summary Statistics Analysis} \begin{figure} \includegraphics[width=\columnwidth]{nhosts_by_month.pdf} \caption{Cumulative number of hosts.} \label{fig:host-month} \end{figure} \begin{figure*} \includegraphics[width=\textwidth]{listings_world.png} \caption{Geolocations of Airbnb listings. (a) Dot plot of all the 2,018,747 active listings; (b--c) Histogram of longitude and latitude; (d--g) Dot plot of listings in the city of Los Angeles, New York, London, and Barcelona. See Appendix~\ref{app:copyright} for the copyright of city maps.} \label{fig:listing-world} \end{figure*} We compare the statistics in Table~\ref{tab:stats} with official ones. The only official but approximate numbers we found were already mentioned in \S~\ref{sec:intro}: $191$+ countries, $2M$+ listings, and $60M$+ total guests. Our obtained number of countries and listings seem to be comparable to official ones. We note, however, that the number of guests ($11M$) is much smaller than the official one ($60M$). One obvious reason is that here we have only counted those guests who have left at least one review captured in our data set but not every guest has given reviews. Next, we provide estimations of some statistics that are still unknown or may be outdated. First, $307,465$ users are both hosts and guests, accounting for $23.4\%$ of all hosts, counted based on the observation that they own listings and give reviews to other listings. This gives one answer to the Quora question.\footnote{https://www.quora.com/What-percentage-of-Airbnb-hosts-are-also-guests} Second, Fig.~\ref{fig:host-month} presents the cumulative number of hosts in each month from March $2008$ to August $2016$, constructed using the month information that indicates when they joined Airbnb. We see that an exponential growth of number of hosts started from around $2012$. Third, we make an estimate of an important statistic---the guest-to-host review rate---meaning the fraction of stays where guests have left reviews to their hosts after the conclusion of their stays. We approximate it as \begin{equation} \begin{split} \text{guest-to-host review rate} &= \frac{\text{\# stays with reviews left}}{\text{\# total stays}} \\ &\approx \frac{19,102,711}{102,718,148} = 18.6\%. \end{split} \end{equation} Here the number of stays with reviews left is simply the number of reviews (excluding automatic reviews, cf.~\S~\ref{subsec:review}), and the total number of stays is estimated by extrapolating the distribution of number of reviews per guest showed in Fig.~\ref{fig:review}(a) from the $11M$ guests to the entire population of $60M$ guests. Our estimate has already been significantly smaller than the reported $72\%$ in $2012$ by Airbnb's CEO Brian Chesky.\footnote{https://www.quora.com/What-percent-of-Airbnb-hosts-leave-reviews-for-their-guests/answer/Brian-Chesky?srid=uU9cX} It remains to be seen how accurate our estimation is and how the one disclosed in early days is different from the one nowadays. \section{Measuring Airbnb Listings} \label{sec:listing} \subsection{Geolocations} \begin{figure*} \centering \includegraphics[width=\textwidth]{room_type_by_country.pdf} \caption{Room types of Airbnb listings. (a) Distribution of room types of all active listings; (b) Number of listings by room type in the top 30 countries with the highest number of listings. Countries with smaller number of entire homes than private rooms are marked red; (c) Distribution of the ratio between entire homes and private rooms in countries with high, medium, and low number of listings.} \label{fig:rtype-country} \end{figure*} Let us start with where Airbnb listings are located---a question repeatedly asked by hoteliers, policy-makers, and other stakeholders (e.g.,~\cite{Schneiderman-Airbnb-2014}). Using each listing's approximate geolocation information in latitude/longitude values provided by Airbnb, we present in Fig.~\ref{fig:listing-world}(a) a dot plot showing geolocations of all active listings across the world. We see that listings are globally distributed. To understand their geographic concentration, Figs.~\ref{fig:listing-world}(b) and (c) respectively show the histograms of longitude and latitude values. We observe that, on the continental level, listings are heavily located in Western Europe, North America, East and South Asia, and Pacific Asia. Focusing on the country level, Airbnb has reached a world-wide yet heterogeneous coverage. US is the largest market for Airbnb, with $308,714$ listings totaling for $15.29\%$ of all listings, followed by France ($11.82\%$), Italy ($10.07\%$), Spain ($6.16\%$), and United Kingdom ($3.93\%$). Figure~\ref{fig:rtype-country}(b) lists the top $30$ countries, which in total account for $83.55\%$ of all listings. Meanwhile, many countries have only hundreds of listings, and there are no listings in a lot of African countries. Focusing on cities, Figs.~\ref{fig:listing-world}(d)--(g) respectively display locations of listings in the city of Los Angeles, New York, London, and Barcelona. As here we are interested in the global distribution, we leave the detailed study of how listings are located within cities as future work. Some studies have done so focusing on London~\cite{Quattrone-who-2016} and Barcelona~\cite{Gutierrez-BCN-2016}. \subsection{Room Types} Next, we study the distribution of the three types of rooms of Airbnb listings: \textit{entire home/apartment}, \textit{private room}, and \textit{shared room}. As suggested by their names, entire home means that the host will not be present in the home during one's stay; private room means that the guest will occupy a private bedroom and share other spaces with others; and shared room means the guest will share the bedroom with other guests. While the latter two types of listings may align with the symbolism of the sharing economy that hosts occasionally share their spare rooms, it is the type of entire home that (1) directly contrasts with such symbolism; and (2) becomes the necessary condition for hosts to convert residential houses into short-term rentals and for business operators to conduct business by renting out their numerous properties. Hosts who use entire homes in such ways have become one of the main targets of regulations in some cities. For instance, the New York State Legislature recently passed a bill that subjects hosts to fines when they rent their entire homes for less than thirty days,\footnote{http://www.forbes.com/sites/briansolomon/2016/06/17/new-york-wants-to-fine-airbnb-hosts-up-to-7500} and the bill was recently signed by New York Governor Andrew~M.~Cuomo.\footnote{http://www.nytimes.com/2016/10/22/technology/new-york-passes-law-airbnb.html} The statistics about room types are therefore among the key characteristics mentioned in many reports by various interest groups (e.g.,~\cite{Schneiderman-Airbnb-2014}), yet they are still unknown at the entire-marketplace level. Figure~\ref{fig:rtype-country}(a) shows that on the entire market, $68.5\%$ of listings are entire homes, while only $29.8\%$ are private rooms; Airbnb has $1.3$ times more entire homes than private rooms. These statistics are in contrast with the ones back in $2012$ when $57\%$ were entire homes and $41\%$ were private rooms~\cite{Guttentag-airbnb-2015}. Such change indicates that Airbnb, a primary example of the ``sharing economy,'' is more like a rental marketplace rather than a spare-room sharing platform. We investigate variations of the room type distribution across countries. Figure~\ref{fig:rtype-country}(b) shows the number of the three types of listings in the top $30$ countries with the largest number of listings. Among them, $27$ countries have more entire homes than private rooms. In the US, which has the largest number of listings, $65.8\%$ are entire rooms, and the ratio between number of entire homes and private rooms reaches $2$. The only three countries or regions where there are more private rooms than entire homes are Taiwan ($0.57$), India ($0.91$), and Ireland ($0.96$), though the ratio is close to one for the latter two countries. We further calculate the ratio for each of the $150$ countries with more than $100$ listings (Countries with small number of listings have large fluctuations of the ratio.), and show in Fig.~\ref{fig:rtype-country}(c) the distributions of the ratio for the three equally-sized groups of countries, based on their total number of listings. We see that the ratio is greater than one across many countries and even larger for countries with smaller number of listings. \subsection{Star-ratings} We now focus on star-ratings and reviews, which are the reputation system of Airbnb and important sources of information for guests to pick listings~\cite{Luca-design-2016}. At the conclusion of each stay, both the host and guest can give reviews to and rate each other at a scale from $1$ to $5$ stars with a unit of $0.5$ star. Each listing will receive an average star-rating once it is rated by at least $3$ guests.\footnote{https://www.airbnb.com/help/article/1257/how-do-star-ratings-work} The star-rating of each individual review, however, is not publicly disclosed. Figure~\ref{fig:rating-rtype}(a) shows a bimodal distribution of star-ratings over all listings. More than half of them ($54.6\%$) have not received their ratings, and $40.6\%$ have $4.5$ or $5$ stars. These three categories of listings account for over $95\%$ of all listings, and the number of listings with $3.5$ or lower stars is essentially negligible. Focusing on listings that have received star-ratings, Fig.~\ref{fig:rating-rtype}(a) inset shows that star-ratings are overwhelmingly positive; $89.5\%$ of them have $4.5$ or $5$ stars, and the mean (median) rating is $4.67$ ($4.5$). These results are consistent with a previous small-scale study~\cite{Zervas-review-2015}. However, this heavily skewed distribution is sightly different from previously observed J-shaped distribution of product reviews~\cite{Hu-Jshape-2009}. In particular, such distribution suggests that the number of 1-star products is high, which is not the case for Airbnb listings. \begin{figure} \centering \includegraphics[width=\columnwidth]{rating_by_rtype.pdf} \caption{Distribution of star-ratings.} \label{fig:rating-rtype} \end{figure} We explore variations of this distribution by room type. Figures~\ref{fig:rating-rtype}(b)--(d) respectively show the star-rating distributions of entire homes, private rooms, and shared rooms. Although, for shared rooms, $4.5$-star listings are of a higher fraction than $5$-star listings, there is very limited variation of the distribution: The majority of listings, irrespective of room type, have either no or very high ratings. This, on the one hand, suggests that many guests had great experiences during their stays, but makes star-ratings less informative and distinguishable for future guests to choose among potential listings, on the other. \subsection{Reviews} \label{subsec:review} There are $19,377,978$ reviews given by $11,150,017$ guests. We are aware that Airbnb will post an automatic review if a host cancels a reservation, serving as one penalty for the cancellation.\footnote{https://www.airbnb.com/help/article/314/why-did-i-get-a-review-that-says-i-canceled} We find $275,267$ automatic reviews, amounting to $1.4\%$ of all reviews. This provides an upper bound of the cancellation rate by hosts, as not every stay yields a review. We removed all automatic reviews before further analysis. \subsubsection{Distribution of Review Counts} On the Airbnb review system, which is different from others like Yelp, only guests who concluded their stays can give reviews. This makes the number of reviews a listing has received a proxy of its business attention, although the review rate and number of stayed nights associated with each review may be different. Therefore, we analyze how reviews are distributed among listings, showing in Fig.~\ref{fig:review}(a) the survival distribution. We shift it by one to make the zero-review data point visible in the logarithmic scale. We see that although Airbnb is a relatively young marketplace, reviews have already been heterogeneously distributed among listings. About $35.7\%$ listings do not have reviews, and respectively $12.2\%$ and $7.4\%$ listings have one and two reviews. The remaining $44.6\%$ listings, each of which has at least three reviews, account for $93.6\%$ reviews. In \S~\ref{sec:review-growth}, we demonstrate the presence of the rich-get-richer mechanism in explaining the growth of reviews. We next analyze the relation between listing age and number of reviews. As we do not know when each listing was established, nor do we know when each and every review was given, we use the Airbnb age of its host---the number of months passed since they joined Airbnb---as a proxy of the listing age. Focusing on listings with at least one review, Fig.~\ref{fig:review}(b) shows the 10th, 50th, and 90th percentile of number of reviews of listings grouped by host age. We observe that (1) the number of reviews in general increases with host ages; (2) even for hosts who joined Airbnb for years, the median number of reviews still remains in the order of ten; and (3) the review count is heterogeneously distributed even for hosts who joined Airbnb in the same month. Figure~\ref{fig:review}(a) also shows a heavy-tailed distribution of number of reviews per guest. Respectively $66.3\%$ and $17.8\%$ guests have given one and two reviews, while only $0.63\%$ guests have left at least $10$ reviews. \begin{figure} \includegraphics[width=\columnwidth]{reviews_2.pdf} \caption{Review counts on Airbnb. (a) Distribution of number of reviews per listing and guest; (b) Number of reviews of listings with different host ages.} \label{fig:review} \end{figure} \subsubsection{Review Content} \label{subsubsec:word} We start investigating text content of reviews with what languages are used. Using the \texttt{langdetect} language detection library,\footnote{https://pypi.python.org/pypi/langdetect} we found $49$ languages used. Table~\ref{tab:lang} reports the percentages of reviews written in the top $10$ most used languages. English dominates this ranking, with $72.8\%$ of reviews using it, followed by French, Spanish, German, and Italian. From now on, we focus on the $14,094,229$ English reviews. \begin{table} \caption{Top 10 languages used in reviews} \label{tab:lang} \begin{tabular}{l r | l r} \toprule Language & $\%$ & Language & $\%$ \\ \midrule English & 72.8 & Chinese (Simplified) & 1.6 \\ French & 10.3 & Korean & 1.3 \\ Spanish & 3.8 & Portuguese & 1.0 \\ German & 3.5 & Dutch & 0.9 \\ Italian & 2.3 & Russian & 0.9 \\ \bottomrule \end{tabular} \end{table} \textbf{Positive/Negative words:} Recall that a vast majority ($89.5\%$) of listings have $4.5$ or $5$ stars (Fig.~\ref{fig:rating-rtype}(a) inset). This raises the question of whether this strongly skew toward positive star-ratings is consistent with a usage bias toward positive vocabulary. To answer this, we use a recently released resource that contains norms of almost $14K$ English words~\cite{Warriner-norms-2013}, each of which has a valence score from $1$ to $9$, where valence greater than $5$ means positive words and smaller than $5$ negative words. We calculate the ratio of the frequency of positive and negative words in Airbnb reviews. To compare the skewness, we also calculate the ratio for $2.7M$ Yelp reviews.\footnote{https://www.yelp.com/dataset\_challenge/} Table~\ref{tab:ratio} shows that the ratio doubles for Airbnb reviews. This confirms a bias toward using positive words, and the extent is even greater than reviews on Yelp, which already exhibits a positive bias~\cite{Jurafsky-yelp-2014}. Given that Airbnb is a P2P platform where hosts can also choose which guests to accommodate, this finding may open up further investigations into user behaviors on different platforms. \section{Measuring Multi-listing Hosts} \label{sec:multi-listing} In this section, we investigate a key issue repeatedly discussed in the current debate---the existence of hosts who own multiple listings on Airbnb. Hereafter, we call them ``multi-listers.'' Note that they may have different names in various reports, such as ``commercial hosts,'' ``professional hosts,'' and ``business operators,'' all attempting to capture the possibility that they may operate business on Airbnb, as an ordinary host is less likely to own numerous listings. Despite being a critical issue, there has been no systematic analysis about multi-listers and their listings. \subsection{Existence of Multi-listers} Recall that there are $2,018,747$ active listings owned by $1,313,626$ hosts (Table~\ref{tab:stats}), thus on average every host owns $1.54$ listings. Figure~\ref{fig:nlisting-th}(a) shows the survival distribution of number of owned listings per host. We observe a somewhat surprising heavy-tailed distribution that spans more than three orders of magnitude, similar to what have been observed in many complex systems~\cite{Albert-cn-2002}. We fit the empirical distribution with a power-law function $p(x) = \frac{\alpha-1}{x_{\min}} \left( \frac{x}{x_{\min}} \right)^{-\alpha}$ using the methods developed in refs~\cite{Clauset-powerlaw-2009, Alstott-powerlaw-2014}, and obtain $\alpha=2.65$ and $x_{\min}=15$. These results not only demonstrate the existence of ``super multi-listers''---hosts who can own up to $1,800$ listings, but also indicate that the existence of multi-listers is prevalent. Simply put, although the vast majority of hosts have a small number of listings, there is a consistent number of hosts who own a large number of listings. In particular, $1,030,134$ ($78.4\%$) and $159,627$ ($12.2\%$) hosts respectively own one and two listings, and the remaining $9.43\%$ hosts own $33.16\%$ of all listings. \begin{table} \caption{Ratio of frequency of positive and negative words used in Airbnb and Yelp reviews} \label{tab:ratio} \begin{tabular}{l c c} \toprule & Airbnb reviews & Yelp reviews \\ \midrule Ratio & 13.749 & 6.705 \\ \bottomrule \end{tabular} \end{table} To further characterize multi-listers and their listings, we need to answer a key question---which threshold of number of owned listings per host allows us to separate hosts into two groups and then compare them. Previous literature have not reached a consensus about this. The New York State Attorney General, for example, defined ``commercial hosts'' as those who have three or more unique listings~\cite{Schneiderman-Airbnb-2014}. Li \textit{et al.} defined ``professional hosts'' as those who have two or more listings~\cite{Li-agent-2015}. Here, we argue that a typical threshold value may not be well-defined, as Fig.~\ref{fig:nlisting-th}(a) clearly suggests that the number of owned listings is a multi-scale phenomenon. Moreover, as we shall show, focusing on a particular value loses the whole picture and can even be misleading. Instead, we simply increase the threshold and study how various measures of interest change accordingly. Specifically, for a given threshold, we characterize (1) the subset of hosts whose number of owned listings \textit{exceeds} the given threshold; and (2) the subset of listings owned by those hosts. If the threshold is zero, we simply focus on all hosts and all listings. \subsection{Listings Owned by Multi-listers} Figures~\ref{fig:nlisting-th}(b)--(e) present the characterization results for listings owned by multi-listers. Figure~\ref{fig:nlisting-th}(b) shows the percentages of listings in $5$ countries, United States (US), Spain (ES), Croatia (HR), Italy (IT), and Australia (AU), selected because they have the largest number of listings when the threshold is $20$. We observe that as we increase the threshold, listings owned by multi-listers are disproportionately located in the US. We also see that a decreasing portion of listings are from Italy, while Spain and Croatia have an increasing portion. Figure~\ref{fig:nlisting-th}(b) (and Fig.~\ref{fig:nlisting-th}(d)) also illustrates why focusing on a particular threshold can be misleading. For example, if one focused on a particular value ($1$ or $2$), one would have concluded that the number of US listings owned by multi-listers is proportional to total listings in the US, which is not the case. \begin{figure*} \includegraphics[width=\textwidth]{nlisting_th_room_host.pdf} \caption{Characterizing multi-listers and their listings. (a) Survival distribution of number of owned listings per host. From (b) to (h), we focus on (1) the subset of hosts whose number of owned listings \textit{exceeds} a threshold; and (2) the subset of listings owned by those hosts, and show how various measures change as we increase the threshold. (b) Percentage of listings located in 5 countries; (c) Number of listings and their total reviews; (d) Percentage of entire homes; (e) The median of the distribution of the maximum distance between pairs of listings owned by a host; (f) Mean Airbnb age of hosts; (g) Percentage of hosts who give descriptions; (h) Percentage of hosts whose profile photos have facial features.} \label{fig:nlisting-th} \end{figure*} Figure~\ref{fig:nlisting-th}(c) focuses on how the total number of listings and number of reviews received by them change as we increase the threshold. We observe a faster decrease of review counts, indicating that the average number of reviews per listing decreases. When the threshold is $0$, on average a listing has $9.6$ reviews, which decreases to $2.6$ when the threshold reaches $20$. Therefore, listings owned by multi-listers are less reviewed. Figure~\ref{fig:nlisting-th}(d) shows that an increasing portion of listings are entire homes as the threshold increases. When the threshold is $20$, more than $92\%$ of listings are entire homes, compared to $68.5\%$ on the entire market. This confirms the previous conjecture that commercial hosts seek to rent out their entire home properties. Figure~\ref{fig:nlisting-th}(e) answers the question of how far away the listings owned by a single host. Using listings' latitude/longitude values, we calculate, for each host, the maximum distance among all pairwise distances between two of their listings, capturing the geographical diameter of their ``managerial'' activities. Figure~\ref{fig:nlisting-th}(e) shows that the median of the distribution of maximum distance over all hosts whose number of listings exceeds a given threshold, though keeps increasing, is in the order of $10km$. This suggests that listings owned by multi-listers may locate within a city and that they may operate business locally. \subsection{Multi-listers} Figures~\ref{fig:nlisting-th}(f)--(h) show the characterization results for multi-listers. First, Fig.~\ref{fig:nlisting-th}(f) demonstrates that multi-listers are early-movers towards joining Airbnb, as their mean Airbnb age is larger than other hosts. Figure~\ref{fig:nlisting-th}(g) focuses on the percentages of hosts who give descriptions in the space-limited ``Your Host'' section on listings' web pages. Presenting self-description is one important way to establish trust between guests and hosts. Surprisingly, only $47.3\%$ of all hosts have given descriptions (threshold $0$), and multi-listers are more likely to do so. Using the method described in ref.~\cite{Monroe-fighting-2008} and setting the threshold to $10$, we find the top $10$ overrepresented words used in multi-listers' descriptions are ``https,'' ``vacation,'' ``wildsch\"{o}nau,'' ``properties,'' ``rentals,'' ``team,'' ``villas,'' ``rental,'' ``apartments,'' and ``services,'' indicating that they use the description section to advertise their listings. Figure~\ref{fig:nlisting-th}(h) examines another way to establish trust---showing faces in profile photos. Using a service provided by Face++ to detect whether there are facial features presented in a given photo,\footnote{http://www.faceplusplus.com/detection\_detect/} we find that for $69.5\%$ of all hosts, there are faces detected in their profile photos. Multi-listers are less likely to show faces in their photos, and a manual inspection reveals that many of them use company's logos as profile photos. \section{Modeling Review Growth} \label{sec:review-growth} In the last section, we have found notable differences between multi-listers and other hosts. This raises the question of whether the differences are linked to listings' future rental performances. To answer this, we approximate performances with number of new reviews, as we do not know listings' actual booked nights. For each listing, we calculate the number of new reviews it has received in one month, which is our response variable. The first two columns in Table~\ref{tab:regress} list predictors and their definitions. Instant Book is a listing feature, meaning that a potential guest can book the listing without the host's approval.\footnote{https://www.airbnb.com/help/article/187/what-is-instant-book} The \texttt{superhost} badge is awarded to a host if they satisfies a series of requirements set by Airbnb.\footnote{https://www.airbnb.com/superhost} Response time of a host is transformed into numerical values, so that a faster response corresponds to a larger value. We fit a linear regression model by ordinary least squares (OLS) to understand factors linked to the growth of reviews. The last column in Table~\ref{tab:regress} presents the regression results. Other predictors being the same, listings with more existing reviews will have more new reviews, demonstrating the presence of the rich-get-richer mechanism that has been found to explain the growth of numerous systems~\cite{Perc-Matthew-2014}. Listings whose ratings have one more star will have $0.169$ more review. A private room will gain $0.112$ more review than an entire home, while a shared room will have $0.091$ less review than an entire home. A listing that can be instantly booked will have $0.272$ more review than those without the Instant Book feature. Being a \texttt{superhost}, giving descriptions, maintaining high response rate, responding in short time, and owning a smaller number of listings all have positive effects on review growth, though the effect is small for the number of owned listings. \begin{table} \caption{Regression results for monthly new reviews} \label{tab:regress} \begin{tabular}{l l l} \toprule $reviews$ & Number of reviews & $0.037^{***}$ \\ & & (0.0001) \\ $rating$ & Star-rating & $0.169^{***}$ \\ & & (0.001) \\ $room\_type$ & Room type & \\ & \hspace{2cm}private & $0.112^{***}$ \\ & & (0.003) \\ & \hspace{2cm}shared & $-0.091^{***}$ \\ & & (0.011) \\ $amenities$ & \# available amenities & $0.017^{***}$ \\ & & (0.0003) \\ $instant\_book$ & Instant book is allowed & \\ & \hspace{2cm}1 & $0.272^{***}$ \\ & & (0.003) \\ $photos$ & Number of photos & $-0.002^{***}$ \\ & & (0.0001) \\ $host\_age$ & Host age & $-0.018^{***}$ \\ & & (0.0001) \\ $host\_super$ & Host is a \texttt{superhost} & \\ & \hspace{2cm}1 & $0.259^{***}$ \\ & & (0.005) \\ $host\_desp$ & Host gives descriptions & \\ & \hspace{2cm}1 & $0.040^{***}$ \\ & & (0.003) \\ $host\_resp\_rate$ & Host response rate & $0.229^{***}$ \\ & & (0.013) \\ $host\_resp\_time$ & Host response time & $0.220^{***}$ \\ & & (0.002) \\ $host\_nlisting$ & \# owned listings & $-0.001^{***}$ \\ & & (0.00002) \\ Constant & & $-0.446^{***}$ \\ & & (0.011) \\ \midrule Observations & \multicolumn{2}{r}{1,140,488} \\ Adjusted R$^{2}$ & \multicolumn{2}{r}{0.388} \\ \bottomrule \textit{Note:} & \multicolumn{2}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \section{Related Work} There is a growing interest in Airbnb and other sharing economy platforms from diverse disciplines, ranging from computer science to economics to law. Empirical studies have focused on, for example, star-ratings of listings~\cite{Zervas-review-2015} and geolocations of listings within cities~\cite{Quattrone-who-2016, Gutierrez-BCN-2016}. Our focus here is the entire Airbnb platform. There are studies that have reported the presence of discrimination on Airbnb~\cite{Edelman-digital-2014, Edelman-racial-2017}. Some work have investigated factors associated with listings' price, such as the receipt of star-ratings~\cite{Gut-price-2015} and race~\cite{Kakar-race-2016} and personal photos~\cite{Ert-trust-2016} of their hosts. The impact of Airbnb on hotel industry revenue~\cite{Zervas-impact-2015, Zervas-impact-2016} and on tourism industry employment~\cite{Fang-effect-2016} has been investigated. Discussions about regulations of Airbnb have also generated much attention~\cite{Cohen-self-2015, Edelman-shortcuts-2015}. Li \textit{et~al.} investigated differences in performances and behaviors between professional hosts---those who own two or more listings---and non-professional hosts on Airbnb~\cite{Li-agent-2015}. Our analysis, however, reveals the lack of threshold that allows us to separate professional and non-professional hosts. Studies focusing on the motivations behind joining Airbnb to provide hospitality have pointed out that monetary compensation and sociability are two important aspects~\cite{Ikkala-monetizing-2015, Lampinen-hosting-2016}. Fradkin \textit{et~al.} experimentally investigated the determinants and bias in the Airbnb review system~\cite{Fradkin-bias-2015}. Fradkin proposed ranking algorithms for the Airbnb search engine~\cite{Fradkin-search-2015}. \section{Conclusion and Future Work} In this work, we have presented the first large-scale data-driven study on Airbnb. After crawling the largest ever number of Airbnb listings, we have measured their geolocations, room types, star-ratings, and reviews. We have also characterized in a great detail hosts who own multiple listings as well as their listings. We have built a linear regression model to understand factors linked to the growth of reviews. As these aspects are among the key points discussed in the ongoing debate and among important features in the sharing economy, we believe that our work provides valuable insights for various stakeholders and may serve as a public and empirical reference to inform the debate. One major limitation of our work is that we do not measure listing occupancy. Therefore we do not know to what extent a listing is rented in short-terms or what revenue differences are between multi-listers and ordinary hosts. We notice that it is feasible to crawl listing calendar data. However, one issue of using such data is that, given a listing is unavailable on some dates, we cannot tell if it is rented out or simply blocked by the host for not renting. Another technical challenge is to large-scale monitor the calender data on a daily basis. Future work may do so on a small scale. Other future work include studying geolocation at a finer level, measuring hosts' behavioral changes, and understanding the effect of review content on listings' future rentals.
{'timestamp': '2017-05-15T02:07:06', 'yymm': '1701', 'arxiv_id': '1701.01645', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01645'}
arxiv
\section{Introduction} Shannon~\cite{Sha56} showed that noiseless feedback does not increase the capacity of single-user memoryless channels. Despite this seemingly negative result, feedback significantly simplifies coding schemes and improves the performance in terms of the error probability~\cite{SK66, YHK2011a, Wu14, Burn14,TFT16}. Burnashev~\cite{Burnashev1976} demonstrated that the {\em reliability function} for the discrete memoryless channel (DMC) with feedback improves dramatically when the transmission time is random. This is known as {\em variable-length feedback}. In fact, the reliability function of a DMC with variable-length feedback admits a particularly simple expression \begin{align} E(R)= {B_1} \left(1-\frac{R}{C}\right)\label{eqn:burn} \end{align} for all rates $0\le R\le C$, where $C$ is the capacity of the DMC and $B_1$ is determined by the relative entropy between conditional output distributions of the two most ``most distinguisable'' channel input symbols~\cite{Burnashev1976}. Yamamoto and Itoh~\cite{YamamotoItoh1979} proposed a simple and conceptually important two-phase coding scheme that attains the reliability function in \eqref{eqn:burn}. Since these reliability function (or error exponent) results are of paramount importance in practical single-user feedback communication systems, we are motivated to extend the results to a simple network scenario---namely, the discrete memoryless broadcast channel (DM-BC) with a common message (also known as the common-message DM-BC) \cite{Wu14,Trillingsgaard15,Trillingsgaard2016}. We provide upper and lower bounds on the reliability function and show that the bounds coincide if the DM-BC is stochastically degraded. In this scenario, the reliability function is dominated by the ``worst branch'' of the DM-BC. \subsection{Main Contributions}\label{sec:main_contr} Our main technical contributions are as follows: \begin{itemize} \item Firstly, for the achievability part, we generalize Yamamoto and Itoh's coding scheme~\cite{YamamotoItoh1979} so that it is applicable to the DM-BC with a common message and variable-length feedback. In this enhanced scheme, we supplement some new elements to the original arguments in~\cite{YamamotoItoh1979}. These include (i) defining an appropriate set of $K$ stopping times and (ii) proving that the expectation of the maximum of these $K$ stopping times can be appropriately bounded assuming that the individual stopping times' expectations and variances are also appropriately bounded. This complication of having to control the {\em maximum} of a set of stopping times does not arise in single-user scenarios such as~\cite{Burnashev1976,Burnashev80,Nak08}. \item Secondly, for the converse part, we adapt and combine proof techniques introduced by Burnashev for two different problems---namely, the reliability function for DMCs with variable-length feedback in~\cite{Burnashev1976} and that for sequential hypothesis testing in~\cite{Burnashev80}. This allows us to obtain an upper bound for the reliability function for the common-message DM-BC with variable-length feedback. There is an alternative and more elegant proof technique to establish the converse part of~\eqref{eqn:burn} by Berlin {\em et al.}~\cite{Berlin2009a} but generalizing the technique therein to our setting does not seem to be feasible. \item Thirdly, even though the bounds on the reliability function do not match for general DM-BCs, we identify a particular class of DM-BCs, namely {\em stochastically degraded} DM-BCs~\cite[Sec.~5.6]{elgamal} for which the reliability function is known exactly. For the {\em less capable} DM-BCs (to be defined formally in Definition~\ref{def:order}), even though we only have bounds on the reliability function, from these bounds, we can establish the capacity of such channels with variable-length feedback. \end{itemize} \subsection{Related Works} We summarize some related works in this subsection. In~\cite{Burnashev80}, Burnashev extended the ideas in his original paper in DMCs with variable-length feedback~\cite{Burnashev1976} to be amenable to the more general problem of sequential hypothesis testing. In particular, he studied the minimum expected number of observations (transmissions) to attain some level of reliability and found the reliability function for large class of single-user channels (beyond DMCs), including the Gaussian channel~\cite{Burnashev80}. Berlin {\em et al.}~\cite{Berlin2009a} provided a simple converse proof for Burnashev's reliability function~\cite{Burnashev1976}. Their converse proof suggests that a {\em communication} and a {\em confirmation} phase are implicit in any scheme for which the probability of error decreases exponentially fast with (the optimal) exponent given by \eqref{eqn:burn}. Under this viewpoint, this converse proof approach is parallel to the Yamamoto and Itoh's achievability scheme~\cite{YamamotoItoh1979}. Nakibo\u{g}lu and Gallager~\cite{Nak08} investigated variable-length coding schemes for (not necessarily discrete) memoryless channels with variable-length feedback and with cost constraints and established the reliability function. Their achievability proof is an extension of Yamamoto and Itoh's~\cite{YamamotoItoh1979} and their converse proof uses two bounds on the difference of the conditional entropy random variable similarly to~\cite{Burnashev1976} with some extra arguments to account for the average cost constraints. Chen, Williamson, and Wesel~\cite{TYChen2014} proposed a two-phase stop-feedback coding scheme where each phase uses an incremental redundancy scheme achieving Burnashev's reliability function~\eqref{eqn:burn} while maintaining an expansion of the size of the message set that yields a small backoff from capacity. Their coding scheme uses a stop-feedback code~\cite{Yury2011} for the first-phase and a sequential probability ratio test~\cite{Wald1947} for the second-phase. We also mention the work by Shrader and Permuter~\cite{Brooke2009a} who studied the feedback capacity of compound channels~\cite{Wolfowitz59, Blackwell59}. The authors considered fixed-length feedback while our focus is on variable-length feedback. Mahajan and Tatikonda~\cite{Mahajan12} considered the variable-length case for the same channel and established inner and outer bounds on the so-called error exponent region. While the common-message DM-BC we study is somewhat similar to the compound channel~\cite{Wolfowitz59, Blackwell59}, the techniques we use are different and we establish the {\em exact} reliability function for stochastically degraded DM-BCs. Tchamkerten and Telatar, in a series of elegant works~\cite{Tchamkerten05, Tchamkerten06, Tchamkerten06a}, considered conditions in which one can achieve Burnashev's exponent in \eqref{eqn:burn} universally, i.e., without precise knowledge of the DMC. Recently, there have also been numerous efforts to establish fundamental limits of single- and multi-user channels with variable-length feedback for {\em non-vanishing} error probabilities. See~\cite{Yury2011,Trillingsgaard:2014,Trillingsgaard15,Trillingsgaard2016,TruongTan16a} for an incomplete list. However, we are concerned with quantifying the exponential rate of decay of the error probability similarly to~\eqref{eqn:burn}. \subsection{Paper Organization} The rest of this paper is structured as follows: In Section \ref{sec:dmc_bc}, we provide the problem formulation for the DM-BC with a common message under variable-length feedback with termination. The main results concerning the reliability function, conditions under which the results are tight, and some accompanying discussions are stated in Section~\ref{sec:mainresult}. In Section~ \ref{achproof}, we provide the achievability proof. The converse proof is provided in Section~\ref{sec:conveseproof}. We also explain the novelties of our arguments relative to existing works at the end of the proofs in Sections~\ref{achproof} and~\ref{sec:conveseproof}. Auxiliary technical results that are not essential to the main arguments are relegated to the appendices. \section{Problem Setting}\label{sec:dmc_bc} \subsection{Notational Conventions} We use asymptotic notation such as $O(\cdot)$ in the standard manner; $f(n)=O(g(n))$ holds if and only if the implied constant $\limsup_{n\to\infty} |f(n)/g(n)|<\infty$. Also $f(n)=o(g(n))$ if and only if $\lim_{n\to\infty}|f(n)/g(n)|=0$. In this paper, we use $\ln x$ to denote the natural logarithm so information units throughout are in nats. The binary entropy function is defined as $h(x):=-x\ln x-(1-x)\ln(1-x)$ for $x\in [0,1]$. We also define the function $(x)_a:=x \mathbf{1}\{x\geq a\}$ for $x, a\in \mathbb{R}$. The minimum of two numbers $a$ and $b$ is denoted interchangeably as $\min\{a,b\}$ and $a\wedge b$. As is usual in information theory $Z_i^j$ denotes the vector $(Z_i,Z_{i+1},\ldots, Z_j)$. For any discrete product sample space $\mathcal{Z} \times \mathcal{T}$, a sigma-algebra $\mathcal{F}$ on $\mathcal{Z} \times \mathcal{T}$, two random variables $Z, T$ (not necessary measurable with respect to $\mathcal{F}$), and two regular conditional probability measures $\mathbb{P}(\cdot|\mathcal{F}), \mathbb{Q}(\cdot|\mathcal{F})$ on $\mathcal{Z} \times \mathcal{T}$, define \begin{align} \label{eq1notation} \mathcal{H}(Z|\mathcal{F})&:=-\sum_{z\in \mathcal{Z}} \mathbb{P} (z|\mathcal{F})\ln \mathbb{P}(z|\mathcal{F}),\\ H(Z) &:=\mathcal{H}(Z|\sigma(\emptyset,\mathcal{Z}\times \mathcal{T})),\\ D(\mathbb{P}\|\mathbb{Q})&:=\sum_{(z,t) \in \mathcal{Z}\times \cal T} \mathbb{P}(z,t|\sigma(\emptyset,\mathcal{Z}\times \mathcal{T})) \ln \frac{\mathbb{P}(z,t|\sigma(\emptyset,\mathcal{Z}\times \mathcal{T}))}{\mathbb{Q}(z,t|\sigma(\emptyset,\mathcal{Z}\times \mathcal{T}))},\\ \mathcal{I}(Z;T|\mathcal{F})&:=\sum_{(z,t) \in \mathcal{Z}\times \cal T} \mathbb{P}(z,t|\mathcal{F}) \ln \frac{\mathbb{P}(z,t|\mathcal{F})}{\mathbb{P}(z|\mathcal{F})\mathbb{P}(t|\mathcal{F})},\\ I(Z;T)&:=\mathcal{I}(Z;T|\sigma(\emptyset,\mathcal{Z} \times \mathcal{T}). \label{eq6notation} \end{align} If $\mathcal{F}=\sigma(Y^n)$ for some vector $Y^n$, we write $\sigma(Y^n)$ as $Y^n$ in all above notations~\eqref{eq1notation}--\eqref{eq6notation} for simplicity~\cite{Billingsley}. \subsection{Basic Definitions} \begin{definition} \label{def1} A $(M,N)$-{\em variable-length feedback code with termination (VLFT)} for a $K$-user DM-BC $P_{Y_1,Y_2,\ldots,Y_K|X}$ with a common message, where $N$ is a positive real and $M$ is a positive integer, is defined by \begin{itemize} \item A set of equiprobable messages $\mathcal{W}=\{1,2,\ldots,M\}$. \item A sequence of encoders $f_n: \mathcal{W} \times \mathcal{Y}_1^{n-1}\times \mathcal{Y}_2^{n-1} \times\cdots \times \mathcal{Y}_K^{n-1} \to \mathcal{X}, n\geq 1$, defining channel inputs \begin{align} X_n=f_n(W,Y_1^{n-1},Y_2^{n-1},\cdots,Y_K^{n-1}).\label{eqn:enc} \end{align} \item $K$ sequences of decoders $g^{(j)}_n: \mathcal{Y}_j^n \to \mathcal{W}, j=1,2,\ldots,K$, providing the best estimate $W$ at time $n$ at the corresponding decoders. \item A stopping random variable $\tau:=\max\{\tau_1,\tau_2,\ldots,\tau_K\}$, where for each $j\in \{1,2,\ldots,K\}$, $\tau_j$ is a stopping time of the filtration $\{\sigma(Y_j^n)\}_{n=0}^{\infty} $. Furthermore, $\tau$ satisfies the following constraint: \begin{align} \label{eq8def} \mathbb{E}(\tau) \leq N. \end{align} \end{itemize} \end{definition} The final decision at decoder $j = 1,2, \ldots, K$ is computed at time $\tau_j$ as follows: \begin{align} \hat{W}_j&=g^{(j)}_{\tau_j}(Y_j^{\tau_j}). \end{align} The {\em error probability} of a given variable-length coding scheme is defined as \begin{align} \mathsf{P}_{\mathrm{e}}(R,N):=\mathbb{P}\bigg(\bigcup_{j=1}^K \{\hat{W}_j \neq W\}\bigg). \end{align} The {\em rate} of the $(M,N)$-VLFT code (cf.~Definition~\ref{def1}) is defined as \begin{align} R_N:=\frac{\ln M}{N}. \end{align} \begin{definition} \label{def:rel} $(R,E)\in\mathbb{R}_+^2$ is an {\em achievable rate-exponent pair} if there exists a family of $(M_N,N)$-VLFT codes (for $N\to\infty$) satisfying \begin{align} \liminf_{N \to \infty} R_N &\ge R,\label{eq:Rate}\\ \lim_{N\to \infty} \mathsf{P}_{\mathrm{e}}(R_N,N)&=0,\\ \liminf_{N\to \infty}\,\,-\frac{\ln \mathsf{P}_{\mathrm{e}}(R_N,N)}{N} &\geq E, \end{align} where $R_N = N^{-1} \ln M_N$. The {\em reliability function} of the DM-BC with VLFT is \begin{align} E(R):=\sup\{E : (E,R)\mbox{ is an ach.\ rate-exp.\ pair} \}. \end{align} \end{definition} In a VLFT code for the DM-BC, the word ``termination'' is used to indicate that in order to realize the code in a practical setting, one needs to send a reliable end-of-packet signal by a method other than using the transmission channel. In other words, the encoder decides when to stop the transmission of signals~\cite{Yury2011,Trillingsgaard2016}. We now recapitulate a set of orderings of channels~\cite[Ch.~5]{elgamal}. \begin{definition} \label{def:order} A DM-BC $P_{Y_1,Y_2,\ldots,Y_K|X}$ is {\em less capable}\footnote{In the literature~\cite[Sec.~5.6]{elgamal}, the term {\em more capable} is typically used when $Y_1$ is the ``strongest receiver''. However, in our context, $Y_1$ is the ``weakest receiver'' so we use the (somewhat atypical) term {\em less capable} here.} \cite[Sec.~5.6]{elgamal} (with respect to the first channel $P_{Y_1|X}$) if \begin{equation} I(X;Y_1)\le \min_{1\le j\le K} I(X;Y_j) \end{equation} for all $P_X$. A DM-BC $P_{Y_1,Y_2,\ldots,Y_K|X}$ is {\em stochastically degraded} \cite[Sec.~5.4]{elgamal} (with respect to $P_{Y_1|X}$) if there exists a random variable $\tilde{Y}_1$ such that \begin{align} \tilde{Y}_1|\{X=x\} \sim P_{Y_1|X}(\cdot|x), \quad &\forall \, \tilde{y}_1 \in \mathcal{Y}_1,\quad \mbox{and}\\ X-Y_j-\tilde{Y}_1, \quad\,&\forall \, j=2,3,\ldots,K \end{align} A DM-BC $P_{Y_1,Y_2,\ldots,Y_K|X}$ is {\em physically degraded} \cite[Sec.~5.4]{elgamal} (with respect to $P_{Y_1|X}$) if \begin{equation} X-Y_j-Y_1 \end{equation} forms a Markov chain for all $ j= 2,\ldots,K$. \end{definition} Clearly, the set of all physically degraded DM-BCs contained in the set of all stochastically degraded DM-BCs which is contained in the set of all less capable DM-BCs. We omit another commonly-encountered set of orderings for DM-BCs, namely {\em less noisy} DM-BCs~\cite[Sec.~5.6]{elgamal}. \begin{definition} \label{def:info_q} For a DM-BC with a common message and VLFT as in Definition~\ref{def1} we define for each $1\leq j \leq K$, \begin{align} B&:=\max_{x,x'\in \mathcal{X}} \min_{1\leq j\leq K} D(P_{Y_j|X}(\cdot|x)\|P_{Y_j|X}(\cdot|x'),\\ B_j&:=\max_{x,x' \in \mathcal{X}} D(P_{Y_j|X}(\cdot|x)\|P_{Y_j|X}(\cdot|x')),\\ B_{\mathrm{max}}&:=\max_{1\leq j \leq K} B_j,\\ T_j&:=\max_{x,x'\in \mathcal{X}, y \in \mathcal{Y}_j}\frac{P_{Y_j|X}(y|x)}{P_{Y_j|X}(y|x')},\\ C&:=\max_{P_X} \min_{1\leq j\leq K} I(X;Y_j),\\ C_j&:=\max_{P_X}I(X;Y_j),\\ \overline{C}&:=\min_{1\leq j\leq K} \max_{P_X} I(X;Y_j). \end{align} \end{definition} \section{Main Results}\label{sec:mainresult} We now state bounds on the reliability function of the $K$-user DM-BC channel $P_{Y_1,Y_2,\ldots,Y_K|X}$ with a common message and with VLFT. \begin{theorem} \label{thm:main_res} For any $K$-user DM-BC channel $P_{Y_1,Y_2,\ldots,Y_K|X}$ with VLFT (cf.~Definition \ref{def1}) such that $B_{\mathrm{max}}<\infty$, \label{mainthm} \begin{align} E(R)&\geq B \left(1-\frac{R}{C}\right),\quad \forall R<C, \label{eq1:mainthm} \end{align} and \begin{align} \label{eq2:mainthm} E(R) &\leq \min_{1\leq j\leq K} B_j\left(1-\frac{R}{C_j}\right), \quad \forall R<\overline{C}. \end{align} \end{theorem} Since the reliability function yields bounds on the capacity of the DM-BC, we immediately obtain the following. \begin{corollary} \label{cor:cap_bc} Under the condition $B_{\mathrm{max}}<\infty$, the capacity of the DM-BC with VLFT, namely $C_{\mathrm{BC}\mbox{-}\mathrm{VLFT}} $, satisfies \begin{align} C \leq C_{\mathrm{BC}\mbox{-}\mathrm{VLFT}} \leq \overline{C}. \end{align} \end{corollary} Although there is, in general, a gap between the upper and lower bounds on the reliability function (and capacity) provided in Theorem \ref{mainthm} (and Corollary~\ref{cor:cap_bc}), under some conditions on the DM-BC, the reliability function (and capacity) is known exactly. \begin{theorem} \label{stochasticDM} For a less capable DM-BC with VLFT such that $B_{\mathrm{max}} <\infty$, \begin{align} B \left(1-\frac{R}{C_1} \right)\leq E(R) \leq B_1 \left(1-\frac{R}{C_1}\right), \quad \forall R<C_1. \label{eqn:less_cap} \end{align} Furthermore, if the DM-BC with VLFT is stochastically degraded (or physically degraded), \begin{align} E(R)=B_1 \left(1-\frac{R}{C_1}\right),\quad \forall R<C_1. \label{eqn:stoc_deg} \end{align} \end{theorem} \begin{corollary} \label{cor:cap} Under the condition $B_{\mathrm{max}}<\infty$, the capacity of any less capable DM-BC with VLFT \begin{align} C_{\mathrm{BC}\mbox{-}\mathrm{VLFT}} = C=C_1= \overline{C}. \label{eqn:cap_less_cap} \end{align} \end{corollary} \begin{IEEEproof}[Proof of Theorem \ref{stochasticDM} and Corollary \ref{cor:cap}] For any less capable DM-BC we have $I(X;Y_1) \leq I(X;Y_j)$ for all $P_X$ and for all $ j=2,3,\ldots,K$. Hence, \begin{align} C&=\max_{P_X} \min_{1\leq j\leq K} I(X;Y_j),\\ &=\max_{P_X} I(X;Y_1)=C_1. \end{align} Plugging this into \eqref{eq1:mainthm} establishes the lower bound in~\eqref{eqn:less_cap}. For less capable DM-BCs, we also have $C_1=\max_{P_X} I(X;Y_1) \leq C_j=\max_{P_X} I(X;Y_j)$ for all $ j=2,3,\ldots,K$, hence \begin{align} \overline{C}&:=\min_{1\leq j\leq K} \max_{P_X} I(X;Y_j)\\ &=\max_{P_X} I(X;Y_1)=C_1. \label{eqn:cC1} \end{align} As a result, for less capable DM-BCs, the capacity is $C=C_1=\overline{C}$, establishing \eqref{eqn:cap_less_cap}. Moreover, from~\eqref{eq2:mainthm} in Theorem~\ref{mainthm}, for all $R<\overline{C}=C_1$ (cf.~Eqn.~\eqref{eqn:cC1}), \begin{align} E(R) \leq \min_{1\leq j\leq K} B_j\left(1-\frac{R}{C_j}\right) \leq B_1\left(1-\frac{R}{C_1}\right). \end{align} This establishes the upper bound in~\eqref{eqn:less_cap}. For stochastically degraded DM-BCs, there exists a random variable $\tilde{Y}_1$ such that $X-Y_j-\tilde{Y}_1$ for all $ j=1,2,\ldots,K$ and $P_{\tilde{Y}_1|X} = P_{Y_1|X}$. Therefore, we have \begin{align} D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x'))=D(P_{\tilde{Y}_1|X}(\cdot|x)\|P_{\tilde{Y}_1|X}(\cdot|x')). \end{align} Observe that for any $x,x' \in \mathcal{X}$ and $j\in \{2,3,\ldots,K\}$, we also have \begin{align} D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x'))&=\sum_{y_1} P_{Y_1|X}(y_1|x)\ln \frac{P_{Y_1|X}(y_1|x)}{P_{Y_1|X}(y_1|x')}\\ &=\sum_{y_1} \sum_{y_j} P_{\tilde{Y}_1 Y_j|X}(y_1 y_j|x)\ln \frac{\sum_{y_j} P_{\tilde{Y}_1 Y_j|X}(y_1 y_j|x)}{\sum_{y_j} P_{\tilde{Y}_1 Y_j|X}(y_1 y_j|x')}\\ &=\sum_{y_1} \sum_{y_j} P_{Y_j|X}(y_j|x)P_{\tilde{Y}_1|Y_j}(y_1|y_j) \ln \frac{\sum_{y_j} P_{Y_j|X}(y_j|x)P_{\tilde{Y}_1|Y_j}(y_1|y_j)}{\sum_{y_j} P_{Y_j|X}(y_j|x')P_{\tilde{Y}_1|Y_j}(y_1|y_j)} \label{eqn:follow_mc}\\ &\le \sum_{y_1} \sum_{y_j} P_{Y_j|X}(y_j|x) P_{\tilde{Y}_1|Y_j}(y_1|y_j) \ln \frac{P_{Y_j|X}(y_j|x)}{P_{Y_j|X}(y_j|x')} \label{eqn:log_sum}\\ &=\sum_{y_j} P_{Y_j|X}(y_j|x) \ln \frac{P_{Y_j|X}(y_j|x)}{P_{Y_j|X}(y_j|x')} \left(\sum_{y_1} P_{\tilde{Y}_1|Y_j}(y_1|y_j)\right)\\ &=D(P_{Y_j|X}(\cdot|x)\|P_{Y_j|X}(\cdot|x')). \end{align} Here, \eqref{eqn:follow_mc} follows from the Markov chains $X-Y_j-\tilde{Y}_1 $ for $j=1,2,\ldots,K$ and \eqref{eqn:log_sum} follows from the log-sum inequality. It follows that \begin{align} B&=\max_{x,x'\in \mathcal{X}} \min_{1\leq j\leq K} D(P_{Y_j|X}(\cdot|x)\|P_{Y_j|X}(\cdot|x')) \\ &=\max_{x,x' \in \mathcal{X}} D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x')) =B_1, \end{align} and hence \eqref{eqn:stoc_deg} is established. \end{IEEEproof} A few remarks concerning Theorem \ref{thm:main_res} are in order. \begin{itemize} \item There is a gap between the lower and upper bounds for the general DM-BC. One reason that pertains to the achievability part is because each decoder $j \in \{1,2,\ldots, K\}$, at time $n$, only has its own sequence $Y_j^n$. Thus, it is difficult to establish an appropriate hypothesis test within the coding scheme by Yamamoto-Itoh~\cite{YamamotoItoh1979} such that this hypothesis test works for any possible realization of the other random variables $\{Y_i^n:i \neq j\}$. \item For the converse, if we use the same hypothesis test for single-user channels with VLFT as in Berlin {\em et al.}'s work~\cite{Berlin2009a}, it is challenging to obtain a useful result. The hypothesis test in~\cite[Prop.~1]{Berlin2009a} involves the sufficient statistic $V_n:=\ln {P_\mathrm{A}(Y_1^n)}-\ln{P_\mathrm{N}(Y_1^n)}$. Because $X_k$ depends on $(W, Y_1^{k-1},\ldots, Y_K^{k-1})$ for each $k\in\mathbb{N}$ (cf.~Eqn.~\eqref{eqn:enc}), we cannot simply append $(Y_2^n, \ldots,Y_K^n)$ to $Y_1^n$ in~the expression for $V_n$ and still obtain the desired upper bound as in~\cite[Prop.~1]{Berlin2009a}. \item Moreover, if we directly adapt the key ideas in Burnashev's converse proof for sequential hypothesis testing in~\cite[Lemmas~3 and~4]{Burnashev80}, we will only obtain the following almost sure bound for each $j\in\{1,\ldots, K\}$: \begin{align} &\mathbb{E}\left[\mathcal{H}(W|Y_j^n)-\mathcal{H}(W|Y_j^{n+1})|Y_j^n \right] \nn\\ \label{eq47remark} &\leq \max_{w, w' \in \mathcal{W}}\sup_n \sup_{ y_j^{n-1}} D \big(P_{Y_{j,n}|Y_j^{n-1},W}(\cdot|y_j^{n-1},w)\,\big\|\,P_{Y_{j,n}|Y_j^{n-1},W}(\cdot|y_j^{n-1},w') \big). \end{align} This is then insufficient to establish our converse. \item Our Lemma~\ref{lem5new} is stronger than the corresponding one to prove the converse of~\eqref{eqn:burn} in Burnashev~\cite[Lemma 3]{Burnashev1976} since we do not need to assume that the conditional entropies $\mathcal{H}(W|Y_j^n)$ for $j=1,2,\ldots,K$ are bounded. Consequently, the construction of submartingales in the proof of Lemma~\ref{conversethm} (in the converse proof in Section \ref{sec:conveseproof}) is much simpler. \item We have a tight reliability function result for stochastically degraded DM-BCs in \eqref{eqn:stoc_deg}. Usually, orderings of the channels (less/more capable, less noisy, stochastically and physically degraded) are used to obtain tight capacity or capacity region results for DM-BCs~\cite[Secs.~3.4~\&~3.6]{elgamal}. Here, in contrast, we use the orderings to establish a tight reliability function result. \end{itemize} \section{Achievability Proof of Theorem \ref{thm:main_res} }\label{achproof} In this section, we provide the achievability proof of Theorem \ref{thm:main_res}. We start with a preliminary lemma. \begin{lemma}[Expectation of the Maximum of Random Variables]\label{lem1b} Let $\{(X_{1L},X_{2L},\ldots,X_{KL})\}_{L\ge 1}$ be $K$ sequences of random variables satisfying \begin{align} \mathbb{E} [X_{jL} ]&= L +o(1), \quad\mbox{and}\\ \var(X_{jL}) &= o(1),\quad j=1,2,\ldots,K, \end{align} as $L\to\infty$. Then, as $L\to\infty$, we have \begin{align} \mathbb{E}(\max\{X_{1L},X_{2L},\ldots, X_{KL}\}) = L+O(\sqrt{L}). \label{eqn:exp_max} \end{align} \end{lemma} \begin{IEEEproof} The proof can be found in Appendix \ref{app:exp_rvs}. \end{IEEEproof} The achievability part of Theorem \ref{thm:main_res} can be stated succinctly as follows. \begin{lemma} \label{yamamotolemma} If $B_{\mathrm{max}} <\infty$, \begin{align} \label{ach:errexp} E(R) \geq B \left(1-\frac{R}{C}\right),\quad \forall R< C. \end{align} \end{lemma} \begin{IEEEproof} The achievability proof is an extension of Yamamoto-Itoh's variable-length coding scheme~\cite{YamamotoItoh1979} for the DMC with noiseless variable-length feedback. However, we devise some additional and crucial ingredients to account for the presence of multiple channel outputs and multiple decoded messages. In the coding scheme, the encoder decides whether or not to stop the transmission. We show that for all $L\in\mathbb{N}$ there exists an $(\lceil e^{RL}\rceil, L+O(\sqrt{L}))$-VLFT code with achievable exponent $B \left(1-R/C\right)$. Choose $P_X^*:=\argmax_{P_X} \min_{1\leq j\leq K} I(X;Y_j)$ and $x_{\mathrm{c}}, x_{\mathrm{e}} \in \mathcal{X}$ such that \begin{align} (x_{\mathrm{c}},x_{\mathrm{e}}):=\argmax_{(x,x')\in \mathcal{X}} \min_{1\leq j\leq K} D\big(P_{Y_j|X}(\cdot|x)\|P_{Y_j|X}(\cdot|x') \big). \end{align} Since we assume that $B_{\mathrm{max}} <\infty$, we have $P_{Y_j|X}(y|x)>0$ for all $y \in \mathcal{Y}_j, x\in \mathcal{X}$ for all $j=1,2,\ldots,K$. Fix a non-negative number $R$ satisfying $0\leq R<C$. We design a code for each block of $L$ transmissions as per the Yamamoto-Itoh coding scheme with rate $R$~\cite{YamamotoItoh1979}. Let this code length $L$ be divided into two parts, $\gamma L$ for the message mode and $(1-\gamma)L$ for the control mode. In the message mode, one of $M=\lceil e^{LR}\rceil$ messages is \emph{transmitted by a random coding scheme} with block-length $\gamma L$~\cite{Gallager1965a}, and in the control mode a pair of control signals $(\mathrm{c}, \mathrm{e})$ is transmitted by another block code with length $(1-\gamma)L$. The control signal $\mathrm{c}$ is only sent when all the $K$ receivers correctly decode the transmitted message in the message mode. Now, the variable-length coding scheme for the DM-BC with a common message is created by repeating the length-$L$ transmission at times $n\in \{\mu L: \mu=1,2,3,\ldots\}$ and using the same decoding algorithm as in~\cite{YamamotoItoh1979} at all the decoders. The decoder $j \in \{1,2,\ldots, K\}$ defines a stopping time $\tau_j$ as follows: \begin{enumerate} \item If $n\in \{\mu L:\mu=2,3,4,\ldots\}$, we define \begin{align} \mathbf{1}\{\tau_j=n\}& = \prod_{t=1}^{\mu-1} \mathbf{1}\left\{g_n^{(j)}\left(Y_{j,(t-1)L+\gamma L+1}^{(t-1)L+L}\right)=\mathrm{e}\right\} \mathbf{1}\left\{g_n^{(j)}\left(Y_{j,(l-1)L+\gamma L+1}^{n}\right)=\mathrm{c}\right\}; \end{align} \item If $n = L$, we define \begin{align} \mathbf{1}\{\tau_j=n\}=\mathbf{1} \left\{g_n^{(j)}\left(Y_{j,\gamma L+1}^{L}\right)=\mathrm{c}\right\}; \end{align} \item Otherwise, \begin{align} \mathbf{1}\{\tau_j=n\}=\mathbf{1}\{\emptyset\}. \end{align} \end{enumerate} In addition, the estimated message at the stopping time $\tau_j$ has the following form: \begin{align} \hat{W}_j:=g_{\tau_j}^{(j)}\left(Y_{j,\tau_j-L}^{\tau_j- (1-\gamma)L }\right),\quad j=1,2,\ldots, K. \end{align} Since $\mathcal{Y}_j$ for $ j\in\{1,2,\ldots,K\}$ is finite, for each fixed $n \in \mathbb{Z}_{+}$ all the decoding regions at each decoder $j$ are finite sets, which are Borel sets in $\mathbb{R}^n$. Combining this fact with the definition of $\tau_j$, we have $\mathbf{1}\{\tau_j=n\}\in \sigma(Y_j^n)$ for all $ n\in\mathbb{N}$. Let \begin{align} q_L^{(j)}:=\mathbb{P}\left(g_n^{(j)}(Y_{j,\gamma L+1}^L)=\mathrm{e}\right), \quad j=1,2,\ldots,K. \end{align} By the proposed transmission method, given $W=w\in \mathcal{W}$ we have that $Y_{j,(t-1)L+1}^{(t-1)L+L}$ for $t\in\mathbb{N}$ are independent random vectors. Since the messages in $ \mathcal{W}$ are equiprobable, we obtain \begin{align} \mathbb{P}(\tau_j=n)=\begin{cases} \big[q_L^{(j)}\big]^{l-1} \big[1-q_L^{(j)}\big],&\mbox{if}\quad n\in \{\mu L: \mu=1,2,3,\ldots\}\\ 0,&\mbox{otherwise}\end{cases}. \end{align} Hence, we have \begin{align} \sum_{n=0}^{\infty} \mathbb{P}(\tau_j=n) = \sum_{\mu=1}^{\infty} \big[q_L^{(j)}\big]^{\mu-1} \big[1-q_L^{(j)}\big]=1. \end{align} Thus, $\tau_j$ is a stopping time with respect to $\{\sigma(Y_j^n)\}_{n=0}^{\infty}$. Now, since we use the same decoding algorithm as~\cite{YamamotoItoh1979} for each repeated transmission block of length $L$ at each decoder $j$, it is easy to see that the error probability for the $j$-th decoder $\mathsf{P}_{\mathrm{E}}^{(j)}:=\mathbb{P}(\hat{W}_j \neq W)$ and $q_L^{(j)}$ can be written as follows~\cite{YamamotoItoh1979}: \begin{align} \label{eq41new} \mathsf{P}_{\mathrm{E}}^{(j)}&= \mathsf{P}_{1\mathrm{e}}^{(j)}\mathsf{P}_{2\mathrm{e}\mathrm{c}}^{(j)}, \\ q_L^{(j)}&=\mathsf{P}_{1\mathrm{e}}^{(j)}(1-\mathsf{P}_{2\mathrm{e}\mathrm{c}}^{(j)})+(1-\mathsf{P}_{1\mathrm{e}}^{(j)})\mathsf{P}_{2\mathrm{c}\mathrm{e}}^{(j)}. \end{align} Here, $\mathsf{P}_{1\mathrm{e}}^{(j)}$, $\mathsf{P}_{2\mathrm{e}\mathrm{c}}^{(j)}$, and $\mathsf{P}_{2\mathrm{c}\mathrm{e}}^{(j)}$ respectively denote the error probability of decoder $j$ in the message mode, the probability that the message $\mathrm{e}$ is sent at the control mode but the decoder $j$ decodes the message $\mathrm{c}$, the probability that $\mathrm{c}$ is sent at the control mode but the decoder $j$ decodes $\mathrm{e}$~\cite[pp.~730]{YamamotoItoh1979}. Since $q_L^{(j)}$ is the same for all repeated transmissions, each of blocklength $L$, we have for all $j=1,2,\ldots,K$, \begin{align} \mathbb{E}(\tau_j)&= \sum_{n=0}^{\infty} n \mathbb{P}(\tau_j=n)\\ &=\sum_{\mu=1}^{\infty} \mu L \big[q_L^{(j)}\big]^{\mu-1} \big[1-q_L^{(j)}\big]\\ \label{eq59newest} &=\frac{L}{1-q_L^{(j)}}. \end{align} In addition, we also have \begin{align} \label{eq60newest} \var(\tau_j)=\frac{L^2 q_L^{(j)}}{\big[1-q_L^{(j)}\big]^2}. \end{align} Let $l:=(1-\gamma)L$. We assign length-$l$ codewords $X_{\mathrm{c}}^l=(x_{\mathrm{c}},x_{\mathrm{c}},\ldots,x_{\mathrm{c}}) \in\mathcal{X}^l$ and ${X}_{\mathrm{e}}^l=(x_{\mathrm{e}},x_{\mathrm{e}},\ldots,x_{\mathrm{e}})\in\mathcal{X}^l$ to control the signals $\mathrm{c}$ and $\mathrm{e}$ respectively. Decoding of the control signal is done as follows. Choose an arbitrarily small $\delta>0$. Let us say the number of output symbols $y \in \mathcal{Y}_j$ contained in the received sequence $Y_j^l=y_j^l$ equals to $l_y\in\{1,\ldots,l\}$. We suppress the dependence of $l_y$ on $j$ for notational convenience. If every $l_y$ satisfies the typicality condition \begin{align} (1-\delta) P_{Y_j|X}(y|x_{\mathrm{c}}) \leq \frac{l_y }{l} \leq (1+\delta) P_{Y_j|X}(y|x_{\mathrm{c}}), \end{align} then $y_j^l$ is decoded to $\mathrm{c}$, otherwise to $\mathrm{e}$. Then, {defining $F(\cdot)$ to be the random coding error exponent for DMCs~\cite{Gallager1965a} and $R_{L\gamma}:=R/\gamma< \min_{1\leq j\leq K} I(X;Y_j)=C$ (since $X\sim P_X^*$), it follows from~\cite{YamamotoItoh1979} that} \begin{align} \label{keynew} \mathsf{P}_{1\mathrm{e}}^{(j)} &\stackrel{.}{\leq} \exp\left[-\gamma L F(R_{L\gamma})\right], \\ \mathsf{P}_{2\mathrm{c}\mathrm{e}}^{(j)} &\stackrel{.}{\leq} \exp\left[-(1-\gamma) L (f_j(\delta)-o(1))\right], \label{keynew1980} \end{align} where $f_j(\delta)>0$ for any $\delta>0$. In \eqref{keynew} and \eqref{keynew1980} we used the usual notation $a_L\stackrel{.}{\leq} b_L$ to mean that $\limsup_{L\to\infty}\frac{1}{L}\log\frac{a_L}{b_L}\le 0$. Also, by Stein's lemma, \begin{align} \label{stein} \lim_{L\to \infty} -\frac{\ln \mathsf{P}_{2\mathrm{e}\mathrm{c}}^{(j)}}{(1-\gamma) L}= D \big(P_{Y_j|X}(\cdot|x_{\mathrm{c}})\|P_{Y_j|X}(\cdot|x_{\mathrm{e}})\big). \end{align} Moreover from~\eqref{eq41new} and~\eqref{keynew}--\eqref{keynew1980} we have \begin{align} \label{important2} q_L^{(j)} \stackrel{.}{\leq} \exp(-L c^{(j)} ),\quad j=1,2,\ldots,K \end{align} for some exponent $c^{(j)}>0$. Consequently, from~\eqref{eq59newest},~\eqref{eq60newest}, and~\eqref{important2} we obtain for all $j$ that \begin{align} \label{veryimporant11} \mathbb{E}(\tau_j)&=L+o(1),\\ \label{veryimporant12} \var(\tau_j)&=o(1). \end{align} From~\eqref{veryimporant11},~\eqref{veryimporant12}, and Lemma~\ref{lem1b} we obtain that \begin{align} \label{keypointnew} \mathbb{E}(\tau) = L+O(\sqrt{L}). \end{align} Now, since for each $j = 1,2,\ldots, K$, $\mathsf{P}_{\mathrm{E}}^{(j)}$ is kept the same for all repeated transmission blocks of length $L$, we have \begin{align} \label{eq113new2016} \mathsf{P}_{\mathrm{e}}(R,L+O(\sqrt{L}))\leq \sum_{j=1}^K \mathsf{P}_{\mathrm{E}}^{(j)}. \end{align} Moreover, it is easy to see from~\eqref{eq41new},~\eqref{keynew}--\eqref{keynew1980}, and~\eqref{keypointnew} that $\mathsf{P}_{\mathrm{E}}^{(j)}\to 0$ for all $j=1,2,\ldots, K$ as $L \to \infty$ if $0\leq R_{L\gamma}=R/\gamma< C$ and $0\leq \gamma<1$. Combining these requirements and~\eqref{eq113new2016}, we have $\mathsf{P}_{\mathrm{e}}(R,L+O(\sqrt{L})) \to 0$ as $L\to \infty$ if we choose $1>\gamma >R/C$. Now, since $\gamma> R/C$, a feasible value of $\gamma$ that we can choose is \begin{align} \label{gammakey} \gamma=\frac{R}{C-\varepsilon}, \end{align} where $\varepsilon>0$ is chosen small enough so that $\gamma$ remains smaller than $1$. It follows that for any $R\in [0,C)$, we have \begin{align} \liminf_{L\to \infty} -\frac{\ln\mathsf{P}_{\mathrm{e}}(R,L+O(\sqrt{L}))}{L+O(\sqrt{L})} &\geq \liminf_{L \to \infty}- \frac{\ln\big(\sum_{j=1}^K \mathsf{P}_{\mathrm{E}}^{(j)} \big) }{L+O(\sqrt{L})}\\ &\geq \liminf_{L \to \infty} \left\{\min_{1\le j\le K}- \frac{\ln( K \mathsf{P}_{\mathrm{E}}^{(j)})}{L+O(\sqrt{L})} \right\}\\ &= \min_{1\leq j\leq K} \left\{ \liminf_{L \to \infty} - \frac{\ln \mathsf{P}_{\mathrm{E}}^{(j)}}{L+O(\sqrt{L})}\right\} \label{eqn:liminf_min}\\ &\geq \min_{1\leq j\leq K} \left\{\lim_{L\to \infty} - \frac{\ln \mathsf{P}_{2\mathrm{e}\mathrm{c}}^{(j)}}{L}\right\}\label{eqn:yi}\\ &=\min_{1\leq j\leq K} D(P_{Y_j|X}(\cdot|x_{\mathrm{c}})\|P_{Y_j|X}(\cdot|x_{\mathrm{e}}))\left(1-\frac{R}{C-\varepsilon}\right)\label{eqn:yi2} \\ \label{eqkeylan} & = B\left(1-\frac{R}{C-\varepsilon}\right), \end{align} where \eqref{eqn:liminf_min} follows from the facts that $K$ is a constant and that $\liminf_{L\to\infty} \min_j \{a_{jL}\}=\min_j \liminf_{L\to\infty} \{a_{jL}\}$ for any family of sequences $\{a_{jL}\}$; \eqref{eqn:yi} follows from~\eqref{eq41new}; and~\eqref{eqn:yi2} follows from~\eqref{stein} and~\eqref{gammakey}. This means that $(R, B(1-R/(C-\varepsilon)))$ is an achievable rate-exponent pair for any $0\leq R<C$. By the arbitrariness of $\varepsilon>0$, we obtain \begin{align} \label{eqkeylan2} E(R)\geq B \left(1-\frac{R}{C}\right). \end{align} Finally, for any $N\in \mathbb{R}_+$ choose $L=\lfloor N-O(\sqrt{N}) \rfloor$ such that $L+O(\sqrt{L})\leq N$. By using the $(\lceil e^{RL}\rceil, L+O(\sqrt{L}))$-VLFT code constructed above, we conclude that there exists an $(\lceil e^{\lfloor (N-O(\sqrt{N}))R\rfloor }\rceil,N)$-VLFT code such that~\eqref{ach:errexp} holds. \end{IEEEproof} We remark that for the proof of Lemma~\ref{yamamotolemma}, we extended Yamamoto and Itoh's coding scheme~\cite{YamamotoItoh1979} for the DM-BC with a common message and VLFT. In the proof, we supplemented some new elements to the original argument in \cite{YamamotoItoh1979}. These include defining appropriate stopping times $\{\tau_1,\tau_2,\ldots , \tau_K\}$ and proving that the expectation of the maximum of these $K$ stopping times with expectations and variances respectively bounded by $L+o(1)$ and $o(1)$ is $L+O(\sqrt{L})$ (cf.\ Lemma~\ref{lem1b}) \section{Converse Proof of Theorem \ref{thm:main_res}}\label{sec:conveseproof} In this section, we provide the converse proof of Theorem \ref{thm:main_res}. We start with a few preliminary lemmas. At the end of the proof (after the proof of Lemma \ref{conversethm}), we discuss the novelites in our converse proof vis-\`a-vis Burnashev's works in~\cite{Burnashev1976} and~\cite{Burnashev80}. \begin{lemma} \label{lem1newest} Under the condition that $\mathbb{P}(\tau <\infty)=1$ (cf.\ Definition \ref{def1}), the following inequalities hold \begin{align} \mathbb{E}\left[\mathcal{H}(W|Y_j^{\tau_j})\right] &\leq h(\mathsf{P}_{\mathrm{e}}(R_N,N))+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln(M-1), \end{align} for each $1\leq j\leq K$ and $N$ sufficiently large. \end{lemma} \begin{IEEEproof} The proof of this Lemma is essentially the same as~\cite[Lemma~1]{Burnashev80}. For completeness and compatibility in the notations, we provide the complete proof in Appendix~\ref{append}. Note that the error event here is different from~\cite[Lemma~1]{Burnashev80}. It is the union of error events of individual branches of the DM-BC, i.e., $\cup_{j=1}^K \{\hat{W}_j \neq W\}$. \end{IEEEproof} \begin{lemma} \label{lem3new} For any $n\geq 0$ the following inequalities hold almost surely (cf.~Definition~\ref{def:info_q}) \begin{align} \mathbb{E}[\mathcal{H}(W|Y_j^n)- \mathcal{H}(W|Y_j^{n+1})|Y_j^n] &\leq C_j, \quad 1\leq j\leq K. \end{align} \end{lemma} \begin{IEEEproof} Observe that \begin{align} \mathbb{E}[\mathcal{H}(W|Y_1^n)- \mathcal{H}(W|Y_1^{n+1})|Y_1^n]&=\mathbb{E}[\mathcal{H}(W|Y_1^n)- \mathcal{H}(W|Y_1^{n+1})|Y_1^n]\\ &= \mathbb{E}[\mathcal{I}(W;Y_{1,n+1}|Y_1^n)|Y_1^n]\\ &= \mathcal{I}(W;Y_{1,n+1}|Y_1^n)\\ &\leq \mathcal{I}(W,X_{n+1};Y_{1,n+1}|Y_1^n)\\ \label{eq53new} &\leq \mathcal{I}(X_{n+1};Y_{1,n+1}|Y_1^n)+ \sum_{x\in \mathcal{X}} \mathcal{I}(W;Y_{1,n+1}|X_{n+1}=x,Y_1^n)\mathbb{P}(X_{n+1}=x|Y_1^n). \end{align} Now, for any fixed $Y_1^n=y_1^n$, the (random) mutual information in the sum can be expressed as \begin{align} &\mathcal{I}(W;Y_{1,n+1}|X_{n+1}=x,Y_1^n=y_1^n)\nn\\* &=I(W;Y_{1,n+1}|X_{n+1}=x,Y_1^n=y_1^n)\\ &=\sum_{w\in \mathcal{W}, y\in \mathcal{Y}_1} \mathbb{P}(W=w,Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n)\nn\\ \label{eq55new} & \qquad \times \ln \frac{\mathbb{P}(W=w,Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n)}{\mathbb{P}(W=w|X_{n+1}=x,Y_1^n=y_1^n)\mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n)}. \end{align} Since $(W,Y_1^n,Y_2^n,\ldots,Y_K^n)-X_{n+1}-(Y_{1,n+1},Y_{2,n+1},\ldots,Y_{K,n+1})$ forms a Markov chain, we obviously also have the following Markov chain: \begin{align} (W,Y_1^n)-X_{n+1}-Y_{1,n+1}.\label{eqn:mc1} \end{align} Hence, we have \begin{align} &\mathbb{P}(W=w,Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n)\\ &=\mathbb{P}(W=w|X_{n+1}=x,Y_1^n=y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n, W=w)\\ &=\mathbb{P}(W=w|X_{n+1}=x,Y_1^n=y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x)\\ &=\mathbb{P}(W=w|X_{n+1}=x,Y_1^n=y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x,Y_1^n=y_1^n). \end{align} From~\eqref{eq55new} we obtain \begin{align} \mathcal{I}(W;Y_{1,n+1}|X_{n+1}=x,Y_1^n=y_1^n)=0,\quad \forall (x,y_1^n) \in \mathcal{X} \times \mathcal{Y}_1^n. \end{align} It follows from~\eqref{eq53new} that \begin{align} \mathbb{E}[\mathcal{H}(W|Y_1^n)- \mathcal{H}(W|Y_1^{n+1})|Y_1^n]&\leq \mathcal{I}(X_{n+1};Y_{1,n+1}|Y_1^n)\\ &\leq C_1,\quad a.s. \end{align} A completely analogous argument goes through to yield the corresponding upper bounds for $j=2,3,\ldots,K$. \end{IEEEproof} We remark that in the above proof, we need to use some additional arguments involving the Markov chain in \eqref{eqn:mc1} to show that Lemma~\ref{lem3new} holds in the (general DM-BC) case where $X_{n+1}$ is a function of $W$ and {\em all} $Y_j^n$ for $j=1,2,\ldots,K$. In the DMC, $X_{n+1}$ is a function of $W$ and {\em only} $Y_1^n$ The following lemma is a restatement of \cite[Lemma 7]{Burnashev1976}. \begin{lemma} \label{lem3} For arbitrary non-negative numbers $p_l, f_i, \beta_{il}$ where $l=1,2,\ldots,L$ and $i=1,2,\ldots,N$, we have the following inequality \begin{align} \sum_{l=1}^L p_l \ln \left(\frac{\sum_{i=1}^N f_i}{\sum_{i=1}^N \beta_{il}}\right) \leq \max_i \sum_{l=1}^L p_l \ln \frac{f_i}{\beta_{il}}. \end{align} \end{lemma} \begin{lemma} For any $n\geq 0$ the following inequalities hold almost surely (cf.~Definition \ref{def:info_q}) \label{lem5new} \begin{align} \label{eq66new} \mathbb{E}[\ln\mathcal{H}(W|Y_j^n)-\ln \mathcal{H}(W|Y_j^{n+1})|Y_j^n] &\leq B_j, \quad 1\leq j\leq K. \end{align} \end{lemma} \begin{IEEEproof} The proof is based on Burnashev's arguments in~\cite{Burnashev1976} and~\cite{Burnashev80} with some modifications to account for the fact that at each transmission time $n+1$, the transmitted signal $X_{n+1}$ is a function of $W$ and {\em all} $Y_1^n, Y_2^n,\ldots,Y_K^n$. We can assume that $P_{Y_j|X}(y_j|x)>0$ for all $ x \in \mathcal{X}, y_j \in \mathcal{Y}_j $ and all $ j=1,2,\ldots,K$, otherwise the inequalities~\eqref{eq66new} trivially hold since $B_j=\infty$. For each $i=1,2,\ldots,M$ and $y\in\mathcal{Y}_1$, define \begin{align} \label{eq70} p_i&:=\mathbb{P}(W=i|Y_1^n), \\ p_i(y)&:=\mathbb{P}(W=i|Y_1^n, Y_{1,n+1}=y),\label{eqn:piy} \\ p(y|W=i)&:=\mathbb{P}(Y_{1,n+1}=y|Y_1^n, W=i),\\ p(y|W\neq i)&:=\mathbb{P}(Y_{1,n+1}=y|Y_1^n, W\neq i),\\ \label{eq73} p(y)&:=\mathbb{P}(Y_{1,n+1}=y|Y_1^n). \end{align} We may assume without loss of generality that $p_i \neq 1$ for all $ i \in\mathcal{W}=\{1,\ldots,M\}$. Otherwise, again the inequalities in~\eqref{eq66new} trivially hold. Using Lemma~\ref{lem3} and the definitions in~\eqref{eq70}--\eqref{eq73} we have \begin{align} \label{eq75new} \mathbb{E}\left[\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1})\,\big|\,Y_1^n\right]&=\sum_{y \in \mathcal{Y}_1} p(y)\ln\left[\frac{-\sum_{i=1}^M p_i \ln p_i}{-\sum_{i=1}^M p_i(y) \ln p_i(y) }\right]\\ \label{eq76new} &\leq \max_{i} \left\{\sum_{y \in \mathcal{Y}_1} p(y)\ln\left[\frac{- p_i \ln p_i}{-p_i(y) \ln p_i(y) }\right] \right\} \end{align} Define \begin{equation} F_i:=\sum_{y \in \mathcal{Y}_1} p(y)\ln\left[\frac{ - p_i \ln p_i}{- p_i(y) \ln p_i(y) }\right] \end{equation} It is easy to see that \begin{align} \label{eq77new} p(y)&=p_i p(y|W=i)+(1-p_i) p(y|W\neq i),\\ \label{eq78new} p_i(y)&=\frac{p_i p(y|W=i)}{p(y)}, \end{align} and \begin{align} p(y|W=i)&=\mathbb{P}(Y_{1,n+1}=y|Y_1^n, W=i)\\ &=\sum_{x \in \mathcal{X}} \mathbb{P}(X_{n+1}=x|W=i,Y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x, W=i,Y_1^n)\\ &=\sum_{x \in \mathcal{X}} \mathbb{P}(X_{n+1}=x|W=i,Y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x) \label{eqn:use_mc}\\ &=:\sum_{x \in \mathcal{X}} \alpha_{ix} P_{Y_1|X}(y|x). \label{eqn:inv} \end{align} Here, \eqref{eqn:use_mc} follows from the Markov chain $(W,X_1^n,X_2^n,\ldots,X_K^n)-X_{n+1}-(Y_{1,n+1},Y_{2,n+1},\ldots,Y_{K,n+1})$ and \eqref{eqn:inv} follows from the invariance (stationarity) of the distribution $\mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x)$ in $n$, which is derived from the invariance of the distribution $\mathbb{P}(Y_{1,n+1}=y_1,Y_{2,n+1}=y_2,\ldots,Y_{K,n+1}=y_K|X_{n+1}=x)$ in $n$. Similarly, we have \begin{align} p(y|W\neq i)&=\mathbb{P}(Y_{1,n+1}=y|Y_1^n, W\neq i)\\ &=\sum_{x \in \mathcal{X}} \mathbb{P}(X_{n+1}=x|W\neq i,Y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x, W\neq i,Y_1^n)\\ &=\sum_{x \in \mathcal{X}} \mathbb{P}(X_{n+1}=x|W\neq i,Y_1^n) \mathbb{P}(Y_{1,n+1}=y|X_{n+1}=x)\\ & =:\sum_{x \in \mathcal{X}} \beta_{ix} P_{Y_1|X}(y|x). \end{align} It is easy to see that for each fixed message $i \in \mathcal{W} = \{1,\ldots, M\}$ we have \begin{align} \label{eqkey} \sum_{x \in \mathcal{X}} \alpha_{ix}=\sum_{x\in \mathcal{X}} \beta_{ix}=1, \quad \alpha_{ix}\geq 0, \beta_{ix} \geq 0. \end{align} Observe that $F_i$ is a function of variables $p_i, \{\alpha_{ix}\}$ and $\{\beta_{ix}\}$. For the purpose of finding an upper bound on $\max_i \{F_i\}$ in~\eqref{eq76new}, we can consider only the constraints in~\eqref{eqkey} and find the maximization of $F_i$ over this convex set since other constraints that define the feasible set will only make $F_i$ smaller. With this consideration, let us consider find the maximization of $F_i$ over $\{\beta_{ix}\}$ with the assumption that $\sum_{x\in \mathcal{X}} \beta_{ix}=1$ and $\beta_{ix} \geq 0$. Fix an arbitrary $x' \in \mathcal{X}$, then we have $\beta_{ix'}=1-\sum_{x\in \mathcal{X}\setminus\{x'\}}\beta_{ix}$. We readily obtain that the derivatives of $F_i$ for any $x\in \mathcal{X}\setminus \{x'\}$ are \begin{align} \label{eq88} \frac{\mathrm{d}^2 F_i}{\mathrm{d}\beta_{ix}^2}&=\frac{\partial^2 F_i}{\partial \beta_{ix}^2}+ \frac{\partial^2 F_i}{\partial \beta_{ix'}^2}-2 \frac{\partial^2 F_i}{\partial \beta_{ix} \partial \beta_{ix'}},\\ \frac{\partial^2 F_i}{\partial \beta_{ix} \partial \beta_{ix'}}&=(1-p_i)^2 \sum_{y \in \mathcal{Y}_1} \frac{\partial^2 F_i}{\partial p(y)^2} P_{Y_1|X}(y|x) P_{Y_1|X}(y|x'),\\ \label{eq90} \frac{\partial^2 F_i}{\partial p(y)^2}&=\frac{1}{p(y)}\left[1-\left(\ln \frac{p(y)}{p_i p(y|W=i)}\right)^{-1}+\left(\ln \frac{p(y)}{p_i p(y|W=i)}\right)^{-2}\right] > 0. \end{align} Hence, from~\eqref{eq88} to~\eqref{eq90} we obtain \begin{align} \label{eq91new} \frac{\mathrm{d}^2 F_i}{\mathrm{d}\beta_{ix}^2} =(1-p_i)^2 \sum_{y \in \mathcal{Y}_1} \frac{\partial^2 F_i}{\partial p(y)^2} \left(P_{Y_1|X}(y|x)-P_{Y_1|X}(y|x')\right)^2\geq 0, \end{align} for any $x \in \mathcal{X}\setminus\{x'\}$. If for all $x\in \mathcal{X}\setminus\{x'\}$ we have $D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x'))=0$, it follows that \begin{align} p(y|W=i)&=\sum_{x\in \mathcal{X}} \alpha_{ix} P_{Y_1|X}(y|x)\\ &=\sum_{x\in \mathcal{X}} \alpha_{ix} P_{Y_1|X}(y|x')\\ &=\sum_{x\in \mathcal{X}-\{x'\}} \alpha_{ix} P_{Y_1|X}(y|x')+\alpha_{ix'} P_{Y_1|X}(y|x') \\ &=(1-\alpha_{ix'}) P_{Y_1|X}(y|x')+ \alpha_{ix'} P_{Y_1|X}(y|x') \\ &=(1-\alpha_{ix'}) P_{Y_1|X}(y|x)+ \alpha_{ix'} P_{Y_1|X}(y|x) \\ &=P_{Y_1|X}(y|x), \end{align} for any $i\in\mathcal{W}$ and $y\in \mathcal{Y}_1$. In combination with the fact that the message is uniformly distributed on the message set $\mathcal{W}$, we obtain \begin{align} p(y|W\neq i)= P_{Y_1|X}(y|x). \label{eqn:p_P} \end{align} Hence, it is easy to show that \begin{align} p(y)&= P_{Y_1|X}(y|x),\\ p_i(y)&=p_i, \end{align} for all $i\in\mathcal{W}$ and $y\in \mathcal{Y}_1$. Therefore, we have \begin{align} \mathbb{E}\left[\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1})\,\big|\, Y_1^n\right]=0. \end{align} Now, we treat the remaining case where the relative entropy is positive. For any $x\in \mathcal{X}$ there always exists an $x' \in \mathcal{X} \setminus \{x\}$ such that $D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x'))>0$. By choosing that $x'$ as a fixed symbol satisfying the preceding condition,~\eqref{eq91new} becomes a strict inequality. Therefore, $\beta_{ix}$ must be zero or one. Consequently, for all fixed $i\in\mathcal{W}$, all the values of $\beta_{ix}$ for all $ x\in \mathcal{X}$ except for one are zero. Similarly, for any $x \in \mathcal{X} \setminus \{x'\}$ such that $D(P_{Y_1|X}(\cdot|x)\|P_{Y_1|X}(\cdot|x'))>0$, we have \begin{align} \label{eq92key} \frac{\partial^2 F_i}{\partial \alpha_{ix}^2}&=\sum_{y \in \mathcal{Y}_1} \left(P_{Y_1|X}(y|x)-P_{Y_1|X}(y|x')\right)^2 \frac{[p(y)-p_i p(y|W=i)]^2}{p(y) p^2(y|W=i)} \nn\\* &\qquad\times \left[1-\left(\ln \frac{p(y)}{p_i p(y|W=i)}\right)^{-1}+\left(\ln \frac{p(y)}{p_i p(y|W=i)}\right)^{-2}\right] > 0. \end{align} Consequently, either $\alpha_{ix}=0$ or $\alpha_{ix}=1, x\in \mathcal{X}$. From~\eqref{eq76new},~\eqref{eq77new}, and~\eqref{eq78new} together with above results, we obtain \begin{align} \label{eq93new} \mathbb{E}\left[\mathcal{H}(W|Y_1^n)-\mathcal{H}(W|Y_1^{n+1})|Y_1^n\right]\leq \max\left\{0, \max_{x,x'}\max_{\eta} \left\{\sum_{y \in \mathcal{Y}_1} p(y) \ln \frac{\eta \ln \eta}{f(y)\ln f(y)}\right\}\right\}, \end{align} where $\eta \in \{p_1,p_2,\ldots,p_M\}$, $(x, x') \in \mathcal{X}^2$ and \begin{align} \label{eq94new} p(y)&=\eta P_{Y_1|X} (y|x)+(1-\eta) P_{Y_1|X} (y|x'), \\ \label{eq95new} f(y)&=\eta \frac{P_{Y_1|X}(y|x)}{p(y)}. \end{align} We see from~\eqref{eq94new} and~\eqref{eq95new} that \begin{align} \sum_{y \in \mathcal{Y}_1} p(y) \ln \frac{\eta\ln \eta}{f(y)\ln f(y)}=\sum_{y \in \mathcal{Y}_1} p(y) \ln \left[\frac{p^2(y)}{P_{Y_1|X}(y|x)P_{Y_1|X}(y|x')}\right]+\sum_{y \in \mathcal{Y}_1} p(y)\ln \left[\frac{P_{Y_1|X}(y|x')\ln \eta}{p(y)\ln f(y)}\right]. \end{align} Note that \begin{align} \frac{P_{Y_1|X}(y|x')}{p(y)}=\frac{1-f(y)}{1-\eta}. \end{align} It follows that \begin{align} \ln \left[\frac{P_{Y_1|X}(y|x')\ln \eta}{p(y)\ln f(y)}\right]&=\ln\left[\frac{(1-f(y))\ln \eta}{(1-\eta)\ln f(y)} \right]\\ &=\left[\ln(1-f(y))-\ln(-\ln f(y))\right]-\left[\ln(1-\eta)-\ln(-\ln \eta)\right]. \end{align} From~\eqref{eq95new}, we have \begin{align} \sum_{y \in \mathcal{Y}_1} p(y) f(y)=\sum_{y \in \mathcal{Y}_1} \eta P_{Y_1|X}(y|x)=\eta. \label{eqn:equals_eta} \end{align} Combining with the fact that the function $x\mapsto\ln(1-x)-\ln(-\ln x)$ is concave on $(0,1)$~\cite[pp.~424]{Burnashev80}, we obtain the following almost surely \begin{align} \sum_{y \in \mathcal{Y}_1} p(y) \left[\ln(1-f(y))-\ln(-\ln f(y))\right] \leq \ln(1-\eta)-\ln(-\ln \eta). \label{eqn:app_jens} \end{align} Note that $p(y)$ and $\eta$ are random because they depend on $Y_1^n$ which is also random (cf.~Eqns.~\eqref{eq70} and~\eqref{eqn:piy}). This means that \begin{align} \label{eq103new} \sum_{y \in \mathcal{Y}_1} p(y)\ln \left[\frac{P_{Y_1|X}(y|x')\ln \eta}{p(y)\ln f(y)}\right] \leq 0. \end{align} In addition, observe that \begin{align} &p(y) \ln \left[\frac{p^2(y)}{P_{Y_1|X}(y|x)P_{Y_1|X}(y|x')}\right]\nn\\* &=\left(\eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')\right)\ln \left[\frac{\left(\eta P_{Y_1|X}(y|x)+(1-\eta)P_{Y_1|X}(y|x')\right)^2}{P_{Y_1|X}(y|x) P_{Y_1|X}(y|x')} \right] \\ &=\left(\eta P_{Y_1|X}(y|x)+(1-\eta)P_{Y_1|X}(y|x')\right)\ln \left(\eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')\right) \nn\\ &\quad + \left(\eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')\right)\ln\left[\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}+(1-\eta)\ln\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right]\\ &\leq \left(\eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')\right)\ln\left[\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}+(1-\eta)\ln\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right]\\ &= \left(\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')} P_{Y_1|X}(y|x')+(1-\eta)\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}P_{Y_1|X}(y|x)\right)\ln\left[\eta\frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}+(1-\eta)\ln\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right]\\ &\le \left(\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')} +(1-\eta)\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)} \right)\ln\left[\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}+(1-\eta)\ln\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right] \label{eqn:removable}\\ &\le \max\left\{0,\eta P_{Y_1|X} (y|x) \ln \left[\frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}\right]+(1-\eta) P_{Y_1|X} (y|x') \ln \left[\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right]\right\}.\label{eqn:removable2} \end{align} Here, note that the inequality in~\eqref{eqn:removable} can be removed if $\ln\big[\eta \frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}+(1-\eta)\ln\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\big] \leq 0$. Inequality \eqref{eqn:removable2} follows from the convexity of the function $x\mapsto x\ln x$ for $x>0$. Hence, we obtain \begin{align} &\sum_{y \in \mathcal{Y}_1} p(y) \ln \left[\frac{p^2(y)}{P_{Y_1|X}(y|x)P_{Y_1|X}(y|x')}\right] \nn \\ &\leq \max\left\{0,\eta \sum_{y\in \mathcal{Y}_1} P_{Y_1|X} (y|x) \ln \left[\frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}\right]+(1-\eta) \sum_{y \in \mathcal{Y}_1} P_{Y_1|X} (y|x') \ln \left[\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}\right]\right\}\\ \label{eq111new} &\leq B_1\quad \mbox{a.s.} \end{align} From~\eqref{eq93new},~\eqref{eq103new}, and~\eqref{eq111new} we have~\eqref{eq66new} for $j=1$. We obtain the inequalities for $j\in \{2,3,\ldots,K\}$ analogously. \end{IEEEproof} \begin{lemma} \label{lem6new} For any $n\geq 0$ and $y \in \mathcal{Y}_j$ the following inequalities hold almost surely (cf.~Definition \ref{def:info_q}) \begin{align} \ln\mathcal{H}(W|Y_j^n)-\ln\mathcal{H}(W|Y_j^{n+1})\,\big|\,Y_j^n, \{Y_{j,n+1} = y\} \leq \ln T_j, \label{eqn:difference_H} \end{align} for all $j=1,2,\ldots,K$. The conditioning on the random variable $Y_j^n$ and the event $\{Y_{j,n+1} = y\}$ means that the inequalities~\eqref{eqn:difference_H} hold almost surely $Y_j^n$ (i.e., for all realizations of $Y_j^n$) for a fixed realization of $Y_{j,n+1}=y$. \end{lemma} \begin{IEEEproof} This proof is on Burnashev's argument in~\cite{Burnashev1976} with some additional arguments in the corresponding optimization problem to account for the fact that the transmitted signal at time $n+1$, i.e. $X_{n+1}$, depends on $W$ and all $Y_1^n, \ldots,Y_K^n$. Note the inequality~\cite[pp.~264]{Burnashev1976} \begin{align} \frac{\sum_{i=1}^K \alpha_i}{\sum_{l=1}^K \beta_l} \geq \min_i \frac{\alpha_i}{\beta_i}, \quad \alpha_i,\beta_i \geq 0. \end{align} Using the same notation as in Lemma~\ref{lem5new} and the fact that the function $x\mapsto -x\ln x$ is concave, we have for any $y\in \mathcal{Y}_1$ that \begin{align} \psi(y)&:=\frac{\mathcal{H}(W|Y_1^{n+1})|Y_1^n, \{Y_{1,n+1}=y\}}{\mathcal{H}(W|Y_1^n)|Y_1^n}\\ &=\frac{-\sum_{i=1}^M p_i(y)\ln p_i(y)}{-\sum_{i=1}^M p_i \ln p_i}\\ &\geq \min_{i}\left[\frac{p_i(y)\ln p_i(y)}{p_i \ln p_i}\right]. \end{align} It follows that \begin{align} -\ln \psi(y)&= \ln\mathcal{H}(W|Y_1^n)-\ln\mathcal{H}(W|Y_1^{n+1})\Big|Y_1^n, \{Y_{1,n+1}=y \} \label{eq164:lem7a}\\ \label{eq164:lem7} &\leq \ln \left\{\max_i \left[\frac{p_i \ln p_i}{p_i(y)\ln p_i(y)}\right]\right\}. \end{align} Similarly to the argument in the proof of Lemma~\ref{lem5new}, we first disregard all other constraints and consider the optimization (maximization) problem in the $\{ \ldots \}$ in~\eqref{eq164:lem7} subject to the constraints \begin{align} \sum_{x\in \mathcal{X}} \alpha_{ix} &=1, \\ \sum_{x\in \mathcal{X}} \beta_{ix} &=1, \\ \alpha_{ix}&\geq 0,\\ \beta_{ix}&\geq 0. \end{align} Note that we have \begin{align} \label{eq129new} p_i(y)=\frac{p_i \sum_{x\in \mathcal{X}} \alpha_{ix} P_{Y_1|X}(y|x)}{p_i \sum_{x\in \mathcal{X}} \alpha_{ix} P_{Y_1|X}(y|x)+(1-p_i)\sum_{x\in \mathcal{X}} \beta_{ix} P_{Y_1|X}(y|x)}. \end{align}Define \begin{equation} \chi_{x,x',\eta}:= \frac{\eta P_{Y_1|X}(y|x)}{ \eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')} \end{equation} and \begin{align} A_{x,x',\eta}:= \frac{\eta \ln \eta}{ \chi_{x,x',\eta} \ln \chi_{x,x',\eta} } . \end{align} Using the same arguments as~Lemma~\ref{lem5new}, we can show that \begin{align} \label{eq171:lem7} \frac{p_i \ln p_i}{p_i(y)\ln p_i(y)} \leq \max\left\{0, \max_{0\leq \eta \leq 1} \max_{x,x' \in \mathcal{X}} A_{x,x',\eta}\right\}. \end{align} Now, if $P_{Y_1|X}(y|x')\geq P_{Y_1|X}(y|x)$, we have \begin{align} \max_{0\leq \eta\leq 1} A_{x,x',\eta} =\frac{P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x)}. \end{align} If $P_{Y_1|X}(y|x')< P_{Y_1|X}(y|x)$, then by using the fact that for any $0\leq x\leq 1$ and $ 1\leq a\leq 1/x$ we have \begin{align} \frac{x\ln x}{(ax)\ln (ax)} \leq \frac{1-x}{1-ax}, \end{align} we obtain \begin{align} \max_{0\leq \eta \leq 1} A_{x,x',\eta} &\leq \max_{0\leq \eta \leq 1} \frac{1-\eta}{1-\chi_{x,x',\eta}} \\ &=\max_{0\leq \eta \leq 1} \frac{\eta P_{Y_1|X}(y|x)+(1-\eta) P_{Y_1|X}(y|x')}{P_{Y_1|X}(y|x')} \\ \label{eq178:lem7} &=\frac{P_{Y_1|X}(y|x)}{P_{Y_1|X}(y|x')}. \end{align} Consequently, the conclusion of the lemma in~\eqref{eq66new} follows by combining~\eqref{eq164:lem7},~\eqref{eq171:lem7}, and~\eqref{eq178:lem7}. \end{IEEEproof} \begin{lemma} \label{lem7newest} The following inequalities for each $1\leq j\leq K$ hold almost surely \begin{align} \mathbb{E}\left[\left(\ln \mathcal{H}(W|Y_j^n)-\ln \mathcal{H}(W|Y_j^{n+1})\right)_a|Y_j^n\right]\leq \varphi(a) \end{align} where \begin{align} \varphi(a)&:=\max_{1\leq j\leq K}\left(\ln T_j\right)_a. \label{eqn:def_varphi} \end{align} Under the condition $B_{\mathrm{max}}<\infty$, $\varphi(a)=0$ for $a$ sufficiently large. \end{lemma} \begin{IEEEproof} From Lemma~\ref{lem6new} we know that for any $n\geq 0$ and $y \in \mathcal{Y}_1$ we have the following inequalities \begin{align} \ln\mathcal{H}(W|Y_1^n)-\ln\mathcal{H}(W|Y_1^{n+1})\,\Big|\, Y_1^n, \{Y_{1,n+1}=y_1\} &\leq \ln T_1. \end{align} Since $\ln T_1$ is non-negative and using the fact that if $x\leq y$ and $y\geq 0$ we have $(x)_a \leq (y)_a$ for any $a \in \mathbb{R}$, we obtain \begin{align} \left(\ln\mathcal{H}(W|Y_1^n)-\ln\mathcal{H}(W|Y_1^{n+1})\right)_a \,\Big|\, Y_1^n, \{Y_{1,n+1}=y_1\} &\leq \left(\ln T_1\right)_a. \end{align} Therefore, we have for any $a\in \mathbb{R}$ \begin{align} &\mathbb{E}\left[\left(\ln\mathcal{H}(W|Y_1^n)-\ln\mathcal{H}(W|Y_1^{n+1})\right)_a \Big|Y_1^n\right]\nn\\* &=\sum_{y\in \mathcal{Y}_1} \mathbb{P}(Y_{1,n+1}=y_1|Y_1^n) \left(\ln\mathcal{H}(W|Y_1^n)-\ln\mathcal{H}(W|Y_1^{n+1})\right)_a \, \Big| \, Y_1^n, \{Y_{1,n+1}=y_1\} \label{eqn:condition} \\ &\leq \sum_{y\in \mathcal{Y}_1} \mathbb{P}(Y_{1,n+1}=y_1|Y_1^n) \left(\ln T_1\right)_a \\ &=\left(\ln T_1\right)_a, \end{align} where the conditioning on $\{ Y_{1,n+1}=y_1\}$ in~\eqref{eqn:condition} means that $Y_{1,n+1}$ in the term $\ln\mathcal{H}(W|Y_1^{n+1})$ takes on the value $y_1$. Similarly, for the other $j = 2,\ldots, K$, we have \begin{align} \mathbb{E}\left[\left(\ln\mathcal{H}(W|Y_j^n)-\ln\mathcal{H}(W|Y_j^{n+1})\right)_a \Big|Y_j^n\right] \leq \left(\ln T_j\right)_a . \end{align} Recall the definition of $\varphi$ in \eqref{eqn:def_varphi}. We note that since $B_{\mathrm{max}} <\infty$, we have $P_{Y_j|X}(y|x) >0$ for all $x\in \mathcal{X}$ and $ y \in \mathcal{Y}_j$ for all $ j=1,2,\ldots,K$. It follows that $T_j <\infty $ for all $ j=1,2,\ldots,K$ and so $\varphi(a)=0$ for $a$ sufficiently large. This concludes the proof of the lemma. \end{IEEEproof} The converse part of Theorem \ref{thm:main_res} can be stated succinctly as follows. \begin{lemma} \label{conversethm} The reliability function for a DM-BC with common message and VLFT satisfies \begin{align} E(R) &\leq \min_{1\leq j\leq K} B_j\left(1-\frac{R}{C_j}\right), \quad \forall R< \overline{C}. \label{eqn:converse_lemma} \end{align} \end{lemma} \begin{IEEEproof} The proof is similar to Burnashev's arguments in~\cite{Burnashev1976} and~\cite{Burnashev80}. There are some subtle differences, hence for completeness, we provide the entire proof. Here, a combination of~\cite{Burnashev1976} and~\cite{Burnashev80} makes the proof that the sequences $\xi^{(j)}_n$ (as defined in \eqref{eqn:xi_def} in the following) are submartingales simpler. It is enough to show that \eqref{eqn:converse_lemma} holds for $\mathbb{P}(\tau<\infty)=1$ and $B_{\mathrm{max}}<\infty$. Now, as in Burnashev's arguments~\cite{Burnashev80}, we consider the $K$ random sequences \begin{align} \xi^{(j)}_n :=\begin{cases} C_j^{-1}\mathcal{H}(W|Y_j^n)+n,& \; \mbox{if}\; \;\;\mathcal{H}(W|Y_j^n) \geq A_j,\\ B_j^{-1} \ln\mathcal{H}(W|Y_j^n)+b+n,&\;\mbox{if} \;\;\; \mathcal{H}(W|Y_j^n) \leq A_j \end{cases}. \label{eqn:xi_def} \end{align} where $A_j$ is the largest positive root of the following equation in $x$: \begin{align} \label{eqkey2000} \frac{x}{C_j}=\frac{\ln x}{B_j}+b. \end{align} For $b$ sufficiently large, we will show that the $K$ sequences $\xi^{(j)}_n$ respectively form submartingles with respect to the filtrations $\{\sigma(Y_j^n)\}_{n=0}^{\infty}$ for $j=1,2,\ldots,K$. Note that when $b$ sufficiently large, \eqref{eqkey2000} can be shown to have two distinct positive roots $a_j,A_j$ and that $A_j/a_j$ can be make arbitrarily large by increasing $b$~\cite[pp.~256]{Burnashev1976}. Indeed, first we suppose that $\mathcal{H}(W|Y_1^n) \leq A_1$. Then, we obtain \begin{align} \mathbb{E}\left[\xi_n^{(1)}-\xi_{n+1}^{(1)}|Y_1^n\right] &=-1+\mathbb{E}\Big[B_1^{-1} \ln \mathcal{H}(W|Y_1^n) + b-(B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})+b)\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1}) \leq A_1\}\nn\\ &\qquad -C_1^{-1}\mathcal{H}(W|Y_1^{n+1})\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1}) > A_1\}\Big|Y_1^n\Big]\\ &\le -1+B_1^{-1}\mathbb{E}\left[\ln\mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1})\,\big|\, Y_1^n\right] \label{eqn:lessA1a}\\ &\le -1 +B_1^{-1} \times B_1 =0.\label{eqn:lessA1b} \end{align} Here, \eqref{eqn:lessA1a} follows from the fact that $x/C_1 \geq (\ln x)/B_1 + b$ for $x \geq A_1$ and \eqref{eqn:lessA1b} follows from Lemma~\ref{lem5new}. Now, suppose that $\mathcal{H}(W|Y_1^n) > A_1$. Let $a_1$ be the smaller of the two positive roots of~\eqref{eqkey2000}. Then, for $b$ sufficiently large we obtain \begin{align} &\mathbb{E}\left[\xi_n^{(1)}-\xi_{n+1}^{(1)}|Y_1^n\right]\nn\\* &=-1+C_1^{-1}\mathbb{E}\left[\mathcal{H}(W|Y_1^n)-\mathcal{H}(W|Y_1^{n+1})|Y_1^n\right]\nn\\* &\quad +\mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1} \leq A_1\}|Y_1^n \right]\label{eqn:geA1a} \\ &\le -1+C_1^{-1}C_1 + \mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1} \leq A_1\}|Y_1^n \right]\\ &=\mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1}) \leq A_1\}|Y_1^n \right]\\ &=\mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1}\{\mathcal{H}(W|Y_1^{n+1}) \leq a_1\}|Y_1^n \right]\nn\\* &\quad + \mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1} \{a_1<\mathcal{H}(W|Y_1^{n+1}) \leq A_1\}|Y_1^n \right]\\ &\le \mathbb{E}\left[(C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})-b)\mathbf{1} \{\mathcal{H}(W|Y_1^{n+1}) \leq a_1\}|Y_1^n \right] \label{eq192new2017} \\ &\le B_1^{-1}\mathbb{E}\left[(\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1}))\mathbf{1} \{\mathcal{H}(W|Y_1^{n+1}) \leq a_1\}|Y_1^n \right] \label{eq193lan} \\ &\le B_1^{-1}\mathbb{E}\left[(\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1}))\mathbf{1} \Big\{\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1}) >\ln\left(\frac{A_1}{a_1}\right)\Big\}\Big|Y_1^n \right] \label{eqn:geA1b} \\ &=B_1^{-1}\mathbb{E}\left[(\ln \mathcal{H}(W|Y_1^n)-\ln \mathcal{H}(W|Y_1^{n+1}))_{\ln\left(\frac{A_1}{a_1}\right)}\Big|Y_1^n \right]\\ &\leq B_1^{-1}\varphi\left(\ln\left(\frac{A_1}{a_1}\right)\right) \label{eqn:geA1c}\\ &= 0. \label{eqn:geA1d} \end{align} Here, \eqref{eqn:geA1a} follows from Lemma~\ref{lem3new},~\eqref{eq192new2017} follows from the fact that $C_1^{-1}\mathcal{H}(W|Y_1^{n+1})\leq B_1^{-1}\ln \mathcal{H}(W|Y_1^{n+1})+b$ when $a_1<\mathcal{H}(W|Y_1^{n+1}) \leq A_1$,~\eqref{eq193lan} follows from the fact that if $\mathcal{H}(W|Y_1^{n+1})\leq a_1$ and $\mathcal{H}(W|Y_1^n) > A_1$ we have $C_1^{-1}\mathcal{H}(W|Y_1^{n+1})-b\leq C_1^{-1} a_1 -b =B_1^{-1} \ln a_1 \leq B_1^{-1} \ln A_1 \leq B_1^{-1}\ln \mathcal{H}(W|Y_1^n)$, \eqref{eqn:geA1b} follows from the assumption that $\mathcal{H}(W|Y_1^n) > A_1$, and \eqref{eqn:geA1c}, \eqref{eqn:geA1d} follow from the Lemma~\ref{lem7newest} and the fact that $A_1/a_1$ can be make arbitrarily large by increasing $b$. The above arguments leading to~\eqref{eqn:geA1d} and~\eqref{eqn:geA1d} together with~\eqref{eqn:lessA1b} confirm that $\xi^{(1)}_n$ forms a submartingale with respect to the filtration $\{\sigma(Y_1^n)\}_{n=0}^{\infty}$. A completely analogous argument goes through for $j=2,3,\ldots,K$. Now, since we know that \begin{align} \label{eqn:xi_limit} \xi_0^{(1)}=\mathbb{E}[\xi_0^{(1)}] \leq \mathbb{E}[\xi_{n\wedge\tau}^{(1)}]\leq \limsup_{n\to \infty} \mathbb{E}[\xi_{n\wedge \tau}^{(1)}], \end{align} it follows that for $N$ sufficiently large we have \begin{align} C_{1}^{-1} \ln M&=\xi_0^{(1)} \label{eqn:ach_rate_a1} \\ &\leq \limsup_{n\to \infty} \mathbb{E}[\xi_{n\wedge \tau}^{(1)}]\\ & \leq C_1^{-1}\limsup_{n\to \infty} \mathbb{E}\left[\mathcal{H}(W|Y_1^{\tau_1\wedge n})\mathbf{1}\{\mathcal{H}(W|Y_1^{\tau_1\wedge n})\geq A_1\}\right]\nn\\ &\quad + \limsup_{n\to \infty} \mathbb{E}\left[\tau_1 \wedge n\right] + \limsup_{n\to \infty} B_1^{-1} \mathbb{E}\left[\ln\mathcal{H}(W|Y_1^{\tau_1\wedge n})\mathbf{1}\{\mathcal{H}(W|Y_1^{\tau_1\wedge n})\leq A_1\} \right]+b\label{eqn:ach_rate_a0} \\ &\leq C_1^{-1}\limsup_{n\to \infty} \mathbb{E}\left[\mathcal{H}(W|Y_1^{\tau_1\wedge n})\right]\nn\\ &\quad + \limsup_{n\to \infty} \mathbb{E}\left[\tau_1 \wedge n\right] + \limsup_{n\to \infty} B_1^{-1} \mathbb{E}\left[\ln\mathcal{H}(W|Y_1^{\tau_1\wedge n})\mathbf{1}\{\mathcal{H}(W|Y_1^{\tau_1\wedge n})\leq A_1\} \right]+b\\ &\le C_1^{-1}\limsup_{n\to \infty} \mathbb{E}\left[\mathcal{H}(W|Y_1^{\tau_1\wedge n})\right] + \limsup_{n\to \infty} \mathbb{E}\left[\tau_1 \wedge n\right] + \limsup_{n\to \infty} B_1^{-1} \ln \mathbb{E}\left[\mathcal{H}(W|Y_1^{\tau_1\wedge n}) \right]+b \label{eqn:ach_rate_a}\\ &=C_1^{-1}\mathbb{E}\left[\mathcal{H}(W|Y_1^{\tau_1})\right]+\mathbb{E}\left[\tau_1\right] + B_1^{-1} \mathbb{E}\left[\ln\mathcal{H}(W|Y_1^{\tau_1})\right]\\ &\le C_1^{-1}[1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M] + \mathbb{E}\left[\tau_1\right]+ B_1^{-1} \ln [h(\mathsf{P}_{\mathrm{e}}(R_N,N))+\mathsf{P}_{\mathrm{e}}(R_N,N) \ln M]+b \label{eqn:ach_rate_b}\\ &= C_1^{-1}[1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M] + \mathbb{E}\left[\tau_1\right]+ B_1^{-1} \ln [-\mathsf{P}_{\mathrm{e}}(R_N,N)\ln \mathsf{P}_{\mathrm{e}}(R_N,N) \nn\\* &\quad -(1-\mathsf{P}_{\mathrm{e}}(R_N,N))\ln(1-\mathsf{P}_{\mathrm{e}}(R_N,N))+\mathsf{P}_{\mathrm{e}}(R_N,N) \ln M]+b\\ &\le C_1^{-1}[1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M] + \mathbb{E}\left[\tau_1\right]+ B_1^{-1} \ln [-\mathsf{P}_{\mathrm{e}}(R_N,N)\ln \mathsf{P}_{\mathrm{e}}(R_N,N)+\frac{1}{e}+\mathsf{P}_{\mathrm{e}}(R_N,N) \ln M]+b\label{eqn:ach_rate_c}\\ &= C_1^{-1}[1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M] + \mathbb{E}\left[\tau_1\right]+ B_1^{-1} \ln [-\mathsf{P}_{\mathrm{e}}(R_N,N)\ln \mathsf{P}_{\mathrm{e}}(R_N,N)+\mathsf{P}_{\mathrm{e}}(R_N,N) \ln M]+O(1)\label{eqn:ach_rate_d} \\ &= C_1^{-1}[1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M] + \mathbb{E}\left[\tau_1\right]+ B_1^{-1}\ln \mathsf{P}_{\mathrm{e}}(R_N,N) + B_1^{-1} \ln (\ln M-\ln \mathsf{P}_{\mathrm{e}}(R_N,N))+O(1).\label{eqn:ach_rate_e} \end{align} Here, \eqref{eqn:ach_rate_a1} follows from~\eqref{eqn:xi_def} and $\mathcal{H}(W|Y_1^{0})=H(W)=\ln M$, \eqref{eqn:ach_rate_a0} follows from~\eqref{eqn:xi_def} and~\eqref{eqn:xi_limit}, \eqref{eqn:ach_rate_a} follows from the fact that for any random variable $G$, $\mathbb{E}[(\ln G) \mathbf{1}\{G\leq g\}]\leq \ln \mathbb{E}(G)$ for $g \geq 1$ (which is assured by taking $b$ sufficiently large so $A_1$ eventually becomes larger than $1$), \eqref{eqn:ach_rate_b} follows from Lemma~\ref{lem1newest}, \eqref{eqn:ach_rate_c} follows from the fact that $-x\ln x\leq 1/e$ for $0\leq x\leq 1$, and \eqref{eqn:ach_rate_d} follows from the fact that $B_1 <\infty$. Therefore, we obtain \begin{align} \ln M &\leq 1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M + C_1 \mathbb{E}\left[\tau_1\right]+ C_1 B_1^{-1}\ln \mathsf{P}_{\mathrm{e}}(R_N,N) + C_1 B_1^{-1} \ln (\ln M-\ln \mathsf{P}_{\mathrm{e}}(R_N,N))+O(1)\\ &\leq 1+\mathsf{P}_{\mathrm{e}}(R_N,N)\ln M + C_1 N + C_1 B_1^{-1}\ln \mathsf{P}_{\mathrm{e}}(R_N,N) + C_1 B_1^{-1} \ln (\ln M-\ln \mathsf{P}_{\mathrm{e}}(R_N,N))+O(1). \end{align} A similar bound holds for the other branches indexed by $j=2,\ldots,K$. It follows that for all $j=1,2,\ldots,K$, we have \begin{align} E(R)&\leq \liminf_{N\to \infty}\,\,-\frac{\ln \mathsf{P}_{\mathrm{e}}(R_N,N)}{N}\\ &\leq \limsup_{N\to \infty}\,\,-\frac{\ln \mathsf{P}_{\mathrm{e}}(R_N,N)}{N}\\ &\leq \limsup_{N\to \infty}\,\,B_j\left(1-\frac{R_N}{C_j}\right),\\ &= B_j\left(1-\frac{\liminf_{N\to \infty} R_N}{C_j}\right),\\ &\leq B_j\left(1-\frac{R}{C_j}\right) \end{align} for all $R<C_j$. Therefore, we finally obtain \eqref{eqn:converse_lemma} as desired. \end{IEEEproof} Let us now say a few words about the novelties in the converse proof vis-\`a-vis Burnashev's works in~\cite{Burnashev1976} and~\cite{Burnashev80}. In the original work on DMCs with variable-length feedback by Burnashev~\cite{Burnashev1976}, he proved Lemma~\ref{lem5new} for the case $K=1$ under the assumption that $\mathcal{H}(W|Y_1^n)$ is bounded. Hence, the construction of submartingles in Lemma~\ref{conversethm} was more complicated. More specifically, Burnashev needed to make of use~\cite[Lemma~5]{Burnashev1976}, and the constructed submartingale is a combination of two other submartingales in~\cite[Eqn.~(4.20)]{Burnashev1976}. This is meant to account for the constraint concerning the boundedness of $\mathcal{H}(W|Y_1^n)$. In a later work for the related problem of sequential hypothesis testing~\cite{Burnashev80}, Burnashev proved a lemma similar to Lemma~\ref{lem5new} under no constraints on $\mathcal{H}(W|Y_1^n)$. However, as we pointed out in the remark in~\eqref{eq47remark}, this direct proof does not lead to the desired result for our setting in which $K\geq 2$. We need to adapt and combine the two different proof techniques in~\cite{Burnashev1976} and~\cite{Burnashev80} to prove Lemma~\ref{lem5new}. \appendices \section{Proof of Lemma \ref{lem1b}}\label{app:exp_rvs} \begin{IEEEproof} We use the same proof technique as in~\cite[Lemma 8]{TruongTan16a}. In Lemma \ref{lem1b}, $K$ may be greater than or equal to $3$, so a direct application of~\cite[Lemma 8]{TruongTan16a} is cumbersome. However, since we are not seeking tight bounds on the second-order term in the asymptotic expansion of $\mathbb{E}(\max\{X_{1L},X_{2L},X_{3L},...,X_{KL}\})$ as in~\cite[Lemma 8]{TruongTan16a}, it is enough to show that if the following conditions hold \begin{align} \label{eq632017} \mathbb{E} ( X_{jL} )&= L +O(\sqrt{L}),\quad j=1,2,\quad\mbox{and}\\ \label{eq642017} \var(X_{jL}) &= O(L),\quad j=1,2, \end{align} then, we have \begin{align} \mathbb{E}(\max\{X_{1L},X_{2L}\}) &= L+O(\sqrt{L}),\\ \label{oldtech} \var(\max\{X_{1L},X_{2L}\})&=O(L). \end{align} This is because if the desired statement in \eqref{eqn:exp_max} holds for two sequences of random variables, it will hold for three if $\var(\max\{X_1,X_2\})=O(L)$ since $\max\{X_1,X_2,X_3\}=\max\{\max\{X_1,X_2\},X_3\} $. This argument obviously holds verbatim if we have $K$ sequences of random variables. Now, observe that \begin{align} \label{eqoldkey} \max\{X_{1L},X_{2L}\}&=\frac{1}{2}\left[X_{1L}+X_{2L}+|X_{1L}-X_{2L}|\right] . \end{align} Moreover, we have \begin{align} \mathbb{E}\left(|X_{1L}-X_{2L}|^2\right)+\mathbb{E}\left(|X_{1L}+X_{2L}|^2\right)&=2[\mathbb{E}(X_{1L}^2)+\mathbb{E}(X_{2L}^2)]\\ &=2\left[\var(X_{1L})+(\mathbb{E} [X_{1L}])^2+ \var(X_{2L})+(\mathbb{E} [ X_{2L}])^2\right]\\ &=2\left[O(L)+(\mathbb{E} [X_{1L}])^2+ (\mathbb{E} [X_{2L}])^2\right]. \end{align} In addition, we also have \begin{align} \mathbb{E}\left(|X_{1L}+X_{2L}|^2\right)&\geq \left(\mathbb{E} [X_{1L}+X_{2L}]\right)^2. \end{align} Hence, we obtain \begin{align} \left(\mathbb{E}|X_{1L}-X_{2L}|\right)^2&\leq \mathbb{E}\left(|X_{1L}-X_{2L}|^2\right)\\ &\leq 2\left[O(L)+(\mathbb{E} [X_{1L}])^2+ (\mathbb{E} [X_{2L}])^2\right]-\left(\mathbb{E}[X_{1L}+X_{2L}]\right)^2\\ &= O(L)+(\mathbb{E} [X_{1L}]-\mathbb{E} [X_{2L}])^2\\ &=O(L)+(L+O(\sqrt{L})-L-O(\sqrt{L}))^2\\ \label{eqoldkey1} &= O(L). \end{align} It follows from~\eqref{eq632017},~\eqref{eqoldkey}, and~\eqref{eqoldkey1} that \begin{align} \mathbb{E}\left[\max\{X_{1L},X_{2L}\}\right]&=\frac{1}{2}\mathbb{E}\left[X_{1L}+X_{2L}\right]+O(\sqrt{L})\\ &=L+O(\sqrt{L}). \end{align} Now, we estimate the variance as follows: \begin{align} \var(\max\{X_{1L},X_{2L}\})&=\mathbb{E}\left(\max\{X_{1L},X_{2L}\}-\mathbb{E}\left[\max\{X_{1L},X_{2L}\}\right]\right)^2\\ &= \frac{1}{2}\mathbb{E}\left(X_{1L}+X_{2L}+|X_{1L}-X_{2L}|-\mathbb{E}[X_{1L}+X_{2L}+|X_{1L}-X_{2L}|]\right)\\ \label{eqh1} &=\frac{1}{2}\mathbb{E}\left[\left(X_{1L}-\mathbb{E}[X_{1L}]+X_{2L}-\mathbb{E}[X_{2L}]+|X_{1L}-X_{2L}|-\mathbb{E}[|X_{1L}-X_{2L}|]\right)^2\right]\\ &\le \frac{3}{2}\mathbb{E}\left[(X_{1L}-\mathbb{E}[X_{1L}])^2+(X_{2L}-\mathbb{E}[X_{2L}])^2+(|X_{1L}-X_{2L}|-\mathbb{E}[|X_{1L}-X_{2L}|])^2\right] \label{eqn:var1}\\ &=\frac{3}{2}\left[\var(X_{1L})+\var(X_{2L})+\var(|X_{1L}-X_{2L}|)\right]\\ &\leq \frac{3}{2}\left[\var(X_{1L})+\var(X_{2L})+\mathbb{E}(|X_{1L}-X_{2L}|^2)\right]\\ &\le\frac{3}{2}\left[O(L)+O(L)+O(L)\right]\label{eqn:var2}\\ \label{eq872017} &=O(L). \end{align} Here, \eqref{eqn:var1} follows from the Cauchy-Schwarz inequality and \eqref{eqn:var2} follows from~\eqref{eq642017} and~\eqref{eqoldkey1}. Since $\var(\max\{X_{1L},X_{2L}\})\geq 0$, we obtain from~\eqref{eq872017} that \begin{align} \var(\max\{X_{1L},X_{2L}\})=O(L). \end{align} \end{IEEEproof} \section{Proof of Lemma~\ref{lem1newest}} \label{append} \begin{IEEEproof} We have \begin{align} \mathbb{E}\left[\mathcal{H}(W|Y_1^{n \wedge \tau_1}\right]&=\sum_{i=1}^n \mathbb{E}\left[\mathcal{H}(W|Y_1^i)|\tau_1=i\right]\mathbb{P}(\tau_1=i) + \mathbb{E}\left[\mathcal{H}(W|Y_1^n)|\tau_1>n\right]\mathbb{P}(\tau_1>n). \end{align} Using the fact that $\mathcal{H}(W|Y_1^n)$ is almost surely bounded by $\ln M$, we have for two natural numbers $m<n$ that \begin{align} \left| \mathcal{H}(W|Y_1^{n \wedge \tau_1})-\mathcal{H}(W|Y_1^{m \wedge \tau_1})\right|& \leq \mathbb{E}\left[\mathcal{H}(W|Y_1^n)|\tau_1>n\right]\mathbb{P}(\tau_1>n) \nn\\ &\quad + \sum_{i=m+1}^n \mathbb{E}\left[\mathcal{H}(W|Y_1^i)|\tau_1=i\right]\mathbb{P}(\tau_1=i)+\mathbb{E}\left[\mathcal{H}(W|Y_1^m)|\tau_1>m\right]\mathbb{P}(\tau_1>m)\\ &\leq M \left[\mathbb{P}(\tau_1>n) + \sum_{i=m+1}^n\mathbb{P}(\tau_1=i)+ \mathbb{P}(\tau_1>m)\right]\\ &=2\mathbb{P}(\tau_1>m)\ln M \to 0, \quad \mbox{as}\quad m\to \infty, \end{align} which yields that $\lim_{n\to \infty} \mathbb{E}\left[\mathcal{H}(W|Y_1^{n \wedge \tau})\right]$ exists since $\mathbb{R}$ is complete. Define the error event \begin{align} \mathcal{E}: =\big\{\hat{W}_1 \neq W\big\}. \end{align} By Fano's inequality we have \begin{align} H(W|\hat{W}_1,\tau_1=n) &\leq h[\mathbb{P}(\hat{W}_1\neq W|\tau_1=n)]+ \mathbb{P}(\hat{W}_1\neq W|\tau_1=n) \ln (M-1)\\ &= h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1). \end{align} Hence, \begin{align} H(W|\hat{W}_1,\tau_1=n) \leq h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1). \end{align} It follows that \begin{align} \label{eq38} \sum_{j=1}^M H(W|\hat{W}_1=j,\tau_1=n)\mathbb{P}(\hat{W}_1=j|\tau_1=n) \leq h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1). \end{align} Now, for any random variable $Z$, define an $M$-tuple (vector) \begin{align} \mathbf{P}_{W|Z=z}:= \left(P_{W|Z}(1|z), P_{W|Z}(2|z),\ldots, P_{W|Z}(M|z) \right). \label{eqn:ent_z} \end{align} In the following, we overload the notation $\mathcal{H}(\mathbf{P})$ to mean the entropy of the probability mass function defined by the vector $\mathbf{P}$. Observe that \begin{align} \label{eq40} H(W|\hat{W}_1=j,\tau_1=n) =\mathcal{H}( \mathbf{P}_{W|\hat{W}_1=j,\tau_1=n} ), \end{align} where $Z$ in \eqref{eqn:ent_z} is replaced by $(\hat{W},\tau_1)$ and $z$ by $(j,n)$. Now, we see that \begin{align} P_{W|\hat{W}_1,\tau_1}(w|j, n)&=\sum_{y_1^n} P_{W|Y_1^n \hat{W}_1,\tau_1}(w|y_1^n, j, n) P_{Y_1^n|\hat{W}_1,\tau_1}(y_1^n|j, n)\\ &=\sum_{y_1^n} P_{W|Y_1^n}(w|y_1^n) P_{Y_1^n|\hat{W}_1,\tau_1}(y_1^n|j, n) \label{eqn:mc3}\\ &=\mathbb{E}\left[P_{W|Y_1^n}(W=w|Y_1^n)\,\big|\,\hat{W}_1=j,\tau_1=n\right]. \label{eqn:exp_p} \end{align} Here, \eqref{eqn:mc3} follows the Markov chain $W-Y_1^n - (\hat{W}_1,1\{\tau_1=n\})$. In vector notation, \eqref{eqn:exp_p} means that \begin{align} \label{eq44} \mathbf{P}_{W|\hat{W}_1=j,\tau_1=n}=\mathbb{E}\left[ \mathbf{P}_{W|Y_1^n} \,\big|\,\hat{W}_1=j,\tau_1=n\right], \end{align} where the expectation on the right is over the randomness of $Y_1^n$. Using~\eqref{eq40} and~\eqref{eq44} and Jensen's inequality noting that $\mathbf{P}\mapsto\mathcal{H}(\mathbf{P})$ is concave, we have \begin{align} H(W|\hat{W}_1=j,\tau_1=n)&=\mathcal{H}\left(\mathbb{E}\left[\mathbf{P}_{W|Y_1^n}\,\big|\,\hat{W}_1=j, \tau_1=n\right]\right)\label{eq46a}\\ &\geq \mathbb{E}\left[\mathcal{H}\left( \mathbf{P}_{W|Y_1^n} \,\big|\, \hat{W}_1=j, \tau_1=n \right)\right].\label{eq46} \end{align} From~\eqref{eq38} and~\eqref{eq46} we obtain \begin{align} \sum_{j=1}^M \mathbb{E}\left[\mathcal{H}\big(\mathbf{P}_{W|Y_1^n} \,\big|\,\hat{W}_1=j, \tau_1=n \big)\right] \mathbb{P}(\hat{W}_1=j|\tau_1=n) \leq h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1). \end{align} Hence, \begin{align} \label{eq2702017} \mathbb{E}\left[\mathcal{H}\left(\mathbf{P}_{W|Y_1^n} \,\big|\,\tau_1=n \right)\right] \leq h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1) \end{align} It follows that for $N$ sufficiently large \begin{align} \mathbb{E}[\mathcal{H}(W|Y_1^{\tau_1})]&=\sum_{n=1}^{\infty} \mathbb{E}\left[\mathcal{H}\left(\mathbf{P}_{W|Y_1^n} \,\big|\, \tau_1=n \right)\right] \mathbb{P}(\tau_1=n)\\ &\leq \sum_{n=1}^{\infty} \left[h[\mathbb{P}(\mathcal{E}|\tau_1=n)]+ \mathbb{P}(\mathcal{E}|\tau_1=n) \ln (M-1)\right] \mathbb{P}(\tau_1=n)\label{eq2412016b}\\ &\le h(\mathbb{P}(\mathcal{E}))+\mathbb{P}(\mathcal{E}) \ln (M-1),\label{eq2412016a}\\ &\le h(\mathsf{P}_{\mathrm{e}}(R_N,N))+ \mathsf{P}_{\mathrm{e}}(R_N,N) \ln (M-1).\label{eq2412016} \end{align} Here, \eqref{eq2412016b} follows from~\eqref{eq2702017}, \eqref{eq2412016a} follows from the fact that the function $h(x)$ is concave and \eqref{eq2412016} follows from the increasing property of the entropy function $h(x)$ for $0\leq x\leq 1/2$, $\mathcal{E} \subset \cup_{j=1}^K \{\hat{W}_j \neq W\}$, and $\mathsf{P}_{\mathrm{e}}(R_N,N)\to 0$ as $N \to \infty$ (so $\mathsf{P}_{\mathrm{e}}(R_N,N)\le 1/2$ for $N$ sufficiently large). A completely analogous argument applies for $j=2,3,\ldots,K$. \end{IEEEproof} \bibliographystyle{unsrt}
{'timestamp': '2017-01-13T02:02:53', 'yymm': '1701', 'arxiv_id': '1701.01530', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01530'}
arxiv
\section{Introduction} Recent years have witnessed the rise of mobile crowd sensing (MCS), a newly-emerged sensing paradigm that outsources the collection of sensory data to a crowd of participating users, namely (crowd) workers, who usually carry increasingly capable mobile devices (e.g., smartphones, smartwatches, smartglasses) with a plethora of on-board sensors (e.g., gyroscope, camera, GPS, compass, accelerometer). Currently, a large variety of MCS systems \cite{PMohanSenSys08, AThiagarajanSenSys09, JErikssonMobiSys08, myheartmap, SHuTOSN15, YChengSenSys14} have been deployed that cover almost every aspect of our lives, including healthcare, smart transportation, environmental monitoring, and many others. To perform the sensing tasks, the participating workers typically consume their own resources such as computing and communicating energy, and expose themselves to potential privacy threats by sharing their personal data. For this reason, a participant would not be interested in participating in the sensing tasks, unless she receives a satisfying reward to compensate her resource consumption and potential privacy breach. Therefore, it is necessary to design an effective \textit{incentive mechanism} that can achieve the maximum user participation. Due to the paramount importance of stimulating participation, many incentive mechanisms \cite{HKaiMobiHoc16, XHongAllerton14, CManHonMobiHoc15, GLinINFOCOM15, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, CYanjiaoINFOCOM16, HShiboINFOCOM14, TLuoINFOCOM15, DLingjieINFOCOM12, ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, ZXinglinTPDS14, ZHonggangINFOCOM16, WYuemingINFOCOM15, IKoutsopoulosINFOCOM13, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16, FZhenniINFOCOM14, KMerkouriosMobiHoc16, PLingjunINFOCOM16, DPengMobiHoc15} have been proposed by the research community. However, most of these aforementioned past literature assume that there is only one data requester who also serves as the platform in the MCS system. In practice, however, there are usually \textit{multiple data requesters} competing for human resources, who usually outsource worker recruiting to third-party platforms (e.g., Amazon Mechanical Turk \cite{AMT}) that have already gathered a large number of workers. Therefore, in this paper, we focus on such MCS systems where three parties, including the data requesters, a platform (i.e., a cloud-based central server), as well as a crowd of participating workers co-exist, and aim to develop \textit{a new incentive mechanism that can decide which worker serves which data requester at what price}. In real practice, the sensory data provided by individual workers are usually quite unreliable due to various factors (e.g., poor sensor quality, lack of sensor calibration, environment noise). Hence, in order to cancel out the possible errors from individual workers, it is highly necessary that the platform utilizes a \textit{data aggregation mechanism} to properly aggregate their noisy and even conflicting data. In an MCS system, the incentive and the data aggregation mechanism are usually not isolated from each other. In fact, the data aggregation mechanism typically interacts with the incentive mechanism, and thus, affects its design and performance. Intuitively, if the platform aggregates workers' data in naive ways (e.g., voting and average) that treat all workers' data equally, the incentive mechanism does not need to distinguish them with respect to their reliability. However, a weighted aggregation method that puts higher weights on more reliable workers is much more desirable, because it shifts the aggregated results towards the data provided by the workers with higher reliability. Accordingly, the incentive mechanism should also incorporate workers' reliability, and selects workers that are more likely to provide reliable data. Therefore, different from most of the aforementioned existing work \cite{HKaiMobiHoc16, XHongAllerton14, CManHonMobiHoc15, GLinINFOCOM15, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, CYanjiaoINFOCOM16, HShiboINFOCOM14, TLuoINFOCOM15, DLingjieINFOCOM12, ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, ZXinglinTPDS14, ZHonggangINFOCOM16, WYuemingINFOCOM15, IKoutsopoulosINFOCOM13, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16, FZhenniINFOCOM14, KMerkouriosMobiHoc16, PLingjunINFOCOM16, DPengMobiHoc15}, we propose CENTURION\footnote{The name CENTURION comes from in\underline{CENT}ivizing m\underline{U}lti-\underline{R}equester mob\underline{I}le cr\underline{O}wd se\underline{N}sing.}, a novel \textit{integrated framework} for \textit{multi-requester} MCS systems, which consists of a \textit{weighted data aggregation mechanism} that considers workers' diverse reliability in the calculation of the aggregated results, together with an incentive mechanism that selects workers who potentially will provide more reliable data. Specifically, CENTURION's incentive mechanism is based on \textit{double auction} \cite{RMcAfeeJET92}, which involves auctions among not only the workers, but also the data requesters, and is able to incentivize the participation of both data requesters and workers. This paper makes the following contributions. \begin{itemize}[leftmargin=*]\compresslist \item Different from existing work, we propose a novel \textit{integrated framework} for \textit{multi-requester} MCS systems, called CENTURION, consisting of a data aggregation and an incentive mechanism. Such an integrated design, which captures the interactive effects between the two mechanisms, is much more complicated and challenging than designing them separately. \item CENTURION's double auction-based incentive mechanism is able to incentivize the participation of both data requesters and workers, and bears many desirable properties, including \textit{truthfulness}, \textit{individual rationality}, \textit{computational efficiency}, as well as \textit{non-negative social welfare}. \item The data aggregation mechanism of CENTURION takes into consideration workers' reliability, and calculates \textit{highly accurate} aggregated results. \end{itemize} In the rest of this paper, we first discuss the past literature that are related to this work in Section \ref{sec:relatedwork}, and introduce the preliminaries in Section \ref{sec:prelim}. Then, the design details of CENTURION's data aggregation and incentive mechanism are described in Section \ref{sec:dd}. In Section \ref{sec:perleval}, we conduct extensive simulations to validate the desirable properties of CENTURION. Finally in Section \ref{sec:conc}, we conclude this paper. \section{Related Work}\label{sec:relatedwork} Aware of the paramount importance of attracting worker participation, the research community has recently developed various incentive mechanisms \cite{HKaiMobiHoc16, XHongAllerton14, CManHonMobiHoc15, GLinINFOCOM15, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, CYanjiaoINFOCOM16, HShiboINFOCOM14, TLuoINFOCOM15, DLingjieINFOCOM12, ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, ZXinglinTPDS14, ZHonggangINFOCOM16, WYuemingINFOCOM15, IKoutsopoulosINFOCOM13, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16, FZhenniINFOCOM14, KMerkouriosMobiHoc16, PLingjunINFOCOM16, DPengMobiHoc15} for MCS systems. Among them, game-theoretic incentive mechanisms \cite{HKaiMobiHoc16, XHongAllerton14, CManHonMobiHoc15, GLinINFOCOM15, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, CYanjiaoINFOCOM16, HShiboINFOCOM14, TLuoINFOCOM15, DLingjieINFOCOM12, ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, ZXinglinTPDS14, ZHonggangINFOCOM16, WYuemingINFOCOM15, IKoutsopoulosINFOCOM13, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16, FZhenniINFOCOM14}, which utilize either auction \cite{GLinINFOCOM15, ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, FZhenniINFOCOM14, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, IKoutsopoulosINFOCOM13, ZXinglinTPDS14, ZHonggangINFOCOM16, WYuemingINFOCOM15, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16} or other game-theoretic models \cite{TLuoINFOCOM15, DLingjieINFOCOM12, CManHonMobiHoc15, XHongAllerton14, HShiboINFOCOM14, CYanjiaoINFOCOM16}, have gained increasing popularity due to their ability to tackle workers' selfish and strategic behaviors. These mechanisms typically aim to maximize the platform's profit \cite{ZQiINFOCOM15, ZXiangINFOCOM15, YDejunMobicom12, ZXinglinTPDS14, TLuoINFOCOM15, DLingjieINFOCOM12, HShiboINFOCOM14, CYanjiaoINFOCOM16, ZHonggangINFOCOM16, WYuemingINFOCOM15} or social welfare \cite{GLinINFOCOM15, JHaimingMobiHoc15, YWenTVT14, ZDongINFOCOM14, CManHonMobiHoc15}, and minimize the platform's payment \cite{IKoutsopoulosINFOCOM13, XHongAllerton14, HKaiMobiHoc16, JHaimingMobiHoc16, JHaimingICDCS16, WJingICDCS16} or social cost \cite{FZhenniINFOCOM14}. Different from most of the aforementioned past literature which assume that there exists only one data requester, we propose a novel incentive mechanism for MCS systems with \textit{multiple data requesters} that compete for human resources. In fact, there do exist several prior work \cite{ZHonggangINFOCOM16, ZXiangINFOCOM15, FZhenniINFOCOM14} designing incentive mechanisms for the multi-requester scenario. However, they do not provide any \textit{joint design} of the data aggregation and the incentive mechanism as in this paper, which is much more challenging than designing the two mechanisms as isolated modules. Moreover, although similar integrated designs that consider the two mechanisms are proposed in some existing work \cite{JHaimingMobiHoc16, JHaimingICDCS16}, as previously mentioned, they assume that only one data requester exists in the MCS system. \section{Preliminaries}\label{sec:prelim} In this section, we introduce the system overview, reliability level model, auction model, as well as the design objectives. \subsection{System Overview}\label{sec:sysoverview} CENTURION is an MCS system framework consisting of a cloud-based platform, a set of participating workers, denoted as $\mathcal{W}=\{w_1,\cdots, w_N\}$, and a set of requesters, denoted as $\mathcal{R}=\{r_1,\cdots, r_M\}$. Each requester $r_j\in\mathcal{R}$ has a sensing task $\tau_j$ to be executed by the workers. The set of all requesters' tasks is denoted as $\mathcal{T}=\{\tau_1,\cdots, \tau_M\}$. We are specifically interested in the scenario where $\mathcal{T}$ is a set of $M$ different \textit{binary classification tasks} that require workers to locally decide the classes of the events or objects, and report to the platform their local decisions (i.e., the labels of the observed events or objects). Such MCS systems, collecting binary labels from the crowd, constitute a large portion of the currently deployed MCS systems (e.g., congestion detection systems that decide whether or not particular road segments are congested \cite{AThiagarajanSenSys09}, geotagging campaigns that tag whether bumps or potholes exist on specific segments of road surface \cite{PMohanSenSys08, JErikssonMobiSys08}). Each task $\tau_j$ has a true label $l_j\in\{-1,+1\}$, unknown to the requesters, the platform, and the workers. If a worker $w_i$ is chosen to execute task $\tau_j$, she will provide to the platform a label $l_{i,j}$. We define $\mathbf{l}=[l_{i,j}]\in\{-1,+1,\bot\}^{N\times M}$ as the matrix containing all workers' labels, where $l_{i,j}=\bot$ means that task $\tau_j$ is not executed by worker $w_i$. For every task $\tau_j$, the platform aggregates workers' labels into an aggregated result, denoted as $\widehat{l}_j$, so as to cancel out the errors from individual workers. The framework of CENTURION is given in Figure \ref{fig:sysframe}, and we describe its workflow as follows. \begin{figure}[htb] \centering \includegraphics[width=0.38\textwidth]{SystemArchitecture-V3.eps} \caption{Framework of CENTURION (where circled numbers represent the order of the events).} \label{fig:sysframe} \end{figure} \begin{itemize}[leftmargin=*]\compresslist \item \textbf{Incentive Mechanism.} Firstly, in the double auction-based incentive mechanism, each requester $r_j$ submits to the platform a sensing request containing the sensing task $\tau_j$ to be executed (step \circled{1}), and a bid $a_j$, the amount she is willing to pay if the task is executed (step \circled{2}). Then, the platform announces the set of sensing tasks $\mathcal{T}$ to the workers (step \circled{3}). After receiving the task set, every worker $w_i$ sends to the platform the set of tasks she wants to execute, denoted as $\Gamma_i\subseteq\mathcal{T}$, as well as a bid $b_i$, which is her bidding price for executing them (step \circled{4}). Based on received bids, the platform determines the set of winning requesters $\mathcal{S_R}$, the set of winning workers $\mathcal{S_W}$, as well as the payment $p_j^r$ charged from every winning requester $r_j$ and the payment $p_i^w$ paid to every winning worker $w_i$ (step \circled{5}). Note that losing requesters' tasks are not executed, and thus, they do not submit any payment. Similarly, losing workers do not receive any payment, as they do not execute any task. \item \textbf{Data Aggregation Mechanism.} Next, the platform collects the labels submitted by the winning workers (step \circled{6}), calculates the aggregated results, and sends them to the winning requesters (step \circled{7}). \item Finally, the platform charges $p_j^r$ from winning requester $r_j$ (step \circled{8}), and pays $p_i^w$ to winning worker $w_i$ (step \circled{9}). \end{itemize} We denote the requesters' and workers' bid profile as $\mathbf{a}=(a_1,\cdots,a_M)$ and $\mathbf{b}=(b_1,\cdots,b_N)$, respectively. Moreover, the requesters' and workers' payment profile is denoted as $\mathbf{p}^r=(p_1^r,\cdots,p_M^r)$ and $\mathbf{p}^w=(p_1^w,\cdots,p_N^w)$, respectively. \subsection{Reliability Level Model} Before worker $w_i$ executes task $\tau_j$, her label about this task can be regarded as a random variable $L_{i,j}$. Then, we define the \textit{reliability level} of a worker in Definition \ref{def:reliabilitylevel}. \begin{myDef}[Reliability Level]\label{def:reliabilitylevel} A worker $w_i$'s reliability level $\theta_{i,j}$ about task $\tau_j$ is defined as the probability that she provides a correct label about this task, i.e., \begin{equation} \begin{aligned} \theta_{i,j}=\textnormal{\text{Pr}}[L_{i,j}=l_j]\in[0,1]. \end{aligned} \end{equation} Moreover, we denote the workers' reliability level matrix as $\boldsymbol{\uptheta}=[\theta_{i,j}]\in[0,1]^{N\times M}$. \end{myDef} We assume that the platform knows the reliability level matrix $\boldsymbol{\uptheta}$ \textit{a priori}, and maintains a historical record of it. In practice, the platform could obtain $\boldsymbol{\uptheta}$ through various approaches. For example, as, in many scenarios, workers tend to have similar reliability levels for similar tasks, the platform could assign to workers some tasks with known labels, and use workers' labels about these tasks to estimate their reliability levels for similar tasks as in \cite{DOlesonHCOMP11}. In cases where ground truth labels are not available, $\boldsymbol{\uptheta}$ can still be effectively inferred from workers' characteristics (e.g., the prices of a worker's sensors, a worker's experience and reputation for similar tasks) using the algorithms proposed in \cite{HLiWWW14}, or estimated using the labels previously submitted by workers about similar tasks by the methods in \cite{QLiSIGMOD14, CMengSenSys15}. \subsection{Auction Model}\label{sec:auctionmodel} In this paper, we consider the scenario where both requesters and workers are \textit{strategic} and \textit{selfish} that aim to maximize their own utilities. Since CENTURION involves auctions among not only the workers, but also the requesters, we utilize the following \textit{double auction for \underline{M}ulti-r\underline{E}quester mobi\underline{L}e cr\underline{O}wd se\underline{N}sing (MELON double auction)}, formally defined in Definition \ref{def:auction}, as the incentive mechanism. \begin{myDef}[MELON Double Auction]\label{def:auction} In a \textit{double auction for multi-requester mobile crowd sensing (MELON double auction)}, each requester $r_j$ obtains a value $v_j$, if her task $\tau_j$ is executed, and bids to the platform $a_j$, the amount she is willing to pay for the execution of her task. Each worker $w_i$ is interested in executing one subset of the tasks, denoted as $\Gamma_i\subseteq\mathcal{T}$, and bids to the platform $b_i$, her bidding price for executing these tasks. Her actual sensing cost for executing all tasks in $\Gamma_i$ is denoted as $c_i$. Both the requesters' values and workers' costs are unknown to the platform. \end{myDef} Then, we define a requester's and worker's utility, as well as the platform's profit in Definition \ref{def:requesterutility}, \ref{def:workerutility}, and \ref{def:profit}. \begin{myDef}[Requester's Utility]\label{def:requesterutility} A requester $r_j$'s utility is defined as \begin{equation} u_j^r= \begin{cases} \begin{aligned} &v_j-p_j^r,&&\text{if~}r_j\in\mathcal{S_R}\\ &0,&&\text{otherwise} \end{aligned}. \end{cases} \end{equation} \end{myDef} \begin{myDef}[Worker's Utility]\label{def:workerutility} A worker $w_i$'s utility is defined as \begin{equation} u_i^w= \begin{cases} \begin{aligned} &p_i^w-c_i,&&\text{if~}w_i\in\mathcal{S_W}\\ &0,&&\text{otherwise} \end{aligned}. \end{cases} \end{equation} \end{myDef} \begin{myDef}[Platform's Profit]\label{def:profit} The profit of the platform is defined as \begin{equation} \begin{aligned} u_0=\sum_{j:r_j\in\mathcal{S_R}}p_j^r-\sum_{i:w_i\in\mathcal{S_W}}p_i^w. \end{aligned} \end{equation} \end{myDef} Based on Definition \ref{def:requesterutility}, \ref{def:workerutility}, and \ref{def:profit}, we define the social welfare of the MCS system in Definition \ref{def:socialwelfare}. \begin{myDef}[Social Welfare]\label{def:socialwelfare} The social welfare of the MCS system is defined as \begin{align} u_{\textnormal{\text{social}}}&=u_0+\sum_{i:w_i\in\mathcal{W}}u_i^w+\sum_{j:r_j\in\mathcal{R}}u_j^r\notag\\ &=\sum_{j:r_j\in\mathcal{S_R}}v_j-\sum_{i:w_i\in\mathcal{S_W}}c_i. \end{align} \end{myDef} Clearly, the social welfare is the sum of the platform's profit and all requesters' and workers' utilities. \subsection{Design Objectives} In this paper, we aim to ensure that CENTURION bears the following advantageous properties. Since the requesters are strategic and selfish in our model, it is possible that any requester $r_j$ submits a bid $a_j$ that deviates from $v_j$ (i.e., her value for task $\tau_j$). Similarly, any worker $w_i$ might also submit a bid $b_i$ that differs from $c_i$ (i.e., her cost for executing all tasks in $\Gamma_i$). Thus, one of our objectives is to design a \textit{truthful} incentive mechanism defined in Definition \ref{def:truthfulness}. \begin{myDef}[Truthfulness]\label{def:truthfulness} A MELON double auction is truthful if and only if bidding $v_j$ and $c_i$ is the dominant strategy for each requester $r_j$ and worker $w_i$, i.e., bidding $v_j$ and $c_i$ maximizes, respectively, the utility of each requester $r_j$ and worker $w_i$, regardless of other requesters' and workers' bids. \end{myDef} By definition \ref{def:truthfulness}, we aim to ensure that both requesters and workers bid truthfully to the platform. Apart from truthfulness, another desirable property that we aim to achieve is \textit{individual rationality} defined in Definition \ref{def:ir}. \begin{myDef}[Individual Rationality]\label{def:ir} A MELON double auction is individual rational if and only if no requesters or workers receive negative utilities, i.e., we have $u_j^r\geq 0$, and $u_i^w\geq 0$, for every requester $r_j$ and worker $w_i$, respectively. \end{myDef} Individual rationality is a crucial property to stimulate the participation of both requesters and workers, because it ensures that the charge to a requester is no larger than her value, and a worker's sensing cost is also totally compensated. As mentioned in Section \ref{sec:sysoverview}, CENTURION aggregates workers' labels to ensure that the aggregated results have satisfactory accuracy, which is mathematically defined in Definition \ref{def:accuracy}. \begin{myDef}[$\beta_j$-Accuracy]\label{def:accuracy} A task $\tau_j$ is executed with $\beta_j$-accuracy if and only if $\textnormal{\text{Pr}}[\widehat{L}_j\not=l_j]\leq\beta_j$, where $\beta_j\in(0,1)$, and $\widehat{L}_j$ denotes the random variable representing the aggregated result for task $\tau_j$. \end{myDef} By Definition \ref{def:accuracy}, $\beta_j$-accuracy ensures that the aggregated result equals to the true label with high probability. Note that, for every task $\tau_j$, $\beta_j$ is a parameter chosen by the platform, and a smaller $\beta_j$ implies a stronger requirement for the accuracy. In short, our objectives are to ensure that the proposed CENTURION framework provides satisfactory \textit{accuracy guarantee} for the aggregated results of all executed tasks, and incentivizes the participation of both requesters and workers in a \textit{truthful} and \textit{individual rational} manner. \section{Design Details}\label{sec:dd} In this section, we present the design details of the incentive and data aggregation mechanism of CENTURION. \subsection{Data Aggregation Mechanism} \subsubsection{Proposed Mechanism}\label{sec:mechanism} ~ Although the data aggregation mechanism follows the incentive mechanism in CENTURION's workflow, we introduce it first, as it affects the design of the incentive mechanism. In order to capture the effect of workers' diverse reliability on the calculation of the aggregated results, CENTURION adopts the following \textit{weighted aggregation method}. That is, the aggregated result $\widehat{l}_j$ for every executed task $\tau_j$ is calculated as \begin{equation}\label{eq:aggregation} \begin{aligned} \widehat{l}_j=\text{sign}\Bigg(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}l_{i,j}\Bigg), \end{aligned} \end{equation} where $\lambda_{i,j}>0$ is worker $w_i$'s weight on task $\tau_j$. Furthermore, the function $\text{sign}(x)$ equals to $+1$, if $x\geq 0$, and $-1$ otherwise. Intuitively, higher weights should be assigned to workers who are more likely to submit correct labels, which makes the aggregated results closer to the labels provided by more reliable workers. In fact, many state-of-the-art literature \cite{QLiSIGMOD14, CMengSenSys15} utilize such weighted aggregation method to aggregate workers' data. As the weight $\lambda_{i,j}$'s highly affect the accuracy of the aggregated results, we propose, in the following Algorithm \ref{al:aggregation}, the data aggregation mechanism of CENTURION. \begin{algorithm}[h] \small \KwIn{$\boldsymbol{\uptheta}$, $\mathbf{l}$, $\boldsymbol{\Gamma}$, $\mathcal{S_R}$, $\mathcal{S_W}$\;} \KwOut{$\big\{\widehat{l}_j|r_j\in\mathcal{S_R}\big\}$\;} \ForEach{$j$ \text{s.t.} $r_j\in\mathcal{S_R}$}{\label{line:aggregationstart} $\widehat{l}_j\leftarrow\sum_{i:w_i\in\mathcal{S_W}, \tau_j\in\Gamma_i} \big(2\theta_{i,j}-1\big)l_{i,j}$\;\label{line:aggregation} } \Return $\big\{\widehat{l}_j|r_j\in\mathcal{S_R}\big\}$\; \caption{Data Aggregation Mechanism}\label{al:aggregation} \end{algorithm} Algorithm \ref{al:aggregation} takes as inputs the reliability level matrix $\boldsymbol{\uptheta}$, the workers' label matrix $\mathbf{l}$, the profile of workers' interested task sets, denoted as $\boldsymbol{\Gamma}=(\Gamma_1,\cdots,\Gamma_N)$, the winning requester set $\mathcal{S_R}$, and the winning worker set $\mathcal{S_W}$. Note that a large $\theta_{i,j}$ indicates that a worker $w_i$ has a high reliability level for task $\tau_j$, and any worker $w_i$ with $\theta_{i,j}\leq 0.5$ will not be selected as a winner by the incentive mechanism. The aggregated result $\widehat{l}_j$ for each winning requester $r_j$'s task $\tau_j$ is calculated (line \ref{line:aggregationstart}-\ref{line:aggregation}) using Equation (\ref{eq:aggregation}) with the weight \begin{equation}\label{eq:weight} \begin{aligned} \lambda_{i,j}=2\theta_{i,j}-1,~\forall r_j\in\mathcal{S_R},~w_i\in\mathcal{S_W},~\tau_j\in\Gamma_i. \end{aligned} \end{equation} By Equation (\ref{eq:weight}), we have that $\lambda_{i,j}$, i.e., worker $w_i$'s weight for task $\tau_j$, increases with $\theta_{i,j}$, which conforms to our intuition that the higher the probability that worker $w_i$ provides a correct label about task $\tau_j$, the more her label $l_{i,j}$ should be counted in the calculation of the aggregated result about this task. We provide the formal analysis about the data aggregation mechanism in Section \ref{sec:analysisaggregation}. \subsubsection{Analysis}\label{sec:analysisaggregation} ~ In Theorem \ref{theo:accuracy}, we prove that the aggregated results calculated by Algorithm \ref{al:aggregation} has desirable accuracy guarantee. \begin{myTheo}\label{theo:accuracy} For each executed task $\tau_j$, the data aggregation mechanism given in Algorithm \ref{al:aggregation} minimizes the upper bound of the error probability of the aggregated result, i.e., $\textnormal{Pr}[\widehat{L}_j\not=l_j]$ (where $\widehat{L}_j$ is the random variable representing the aggregated result for task $\tau_j$ mentioned in Definition \ref{def:accuracy}), and satisfies that \begin{equation} \begin{aligned} \textnormal{Pr}[\widehat{L}_j\not=l_j]\leq\exp\Bigg(-\frac{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2}{2}\Bigg). \end{aligned} \end{equation} \end{myTheo} \begin{proof} We denote $X_{i,j}$ as the random variable for worker $w_i$'s weighted label about task $\tau_j$, i.e., $X_{i,j}=\lambda_{i,j} l_j$ with probability $\theta_{i,j}$, and $X_{i,j}=-\lambda_{i,j} l_j$ with probability $1-\theta_{i,j}$. Then, we define $X_j=\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i} X_{i,j}$, and thus, $\mathbb{E}[X_j]=\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\mathbb{E}[X_{i,j}]=\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}l_j\lambda_{i,j}(2\theta_{i,j}-1)$. The error probability of the aggregated result can be calculated as $\text{Pr}[\widehat{L}_j\not=l_j]=\text{Pr}[X_j<0|l_j=1]\text{Pr}[l_j=1]+\text{Pr}[X_j\geq 0|l_j=-1]\text{Pr}[l_j=-1]$, and based on the Chernoff-Hoeffding bound, we have \begin{equation*} \scalefont{0.84} \begin{aligned} \text{Pr}[X_j<0|l_j=1]&=\text{Pr}[\mathbb{E}[X_j]-X_j>\mathbb{E}[X_j]|l_j=1]\\ &\leq\exp\Bigg(-\frac{2(\mathbb{E}[X_j|l_j=1])^2}{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\lambda_{i,j})^2}\Bigg)\\ &=\exp\Bigg(-\frac{\big(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}(2\theta_{i,j}-1)\big)^2}{2\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}^2}\Bigg). \end{aligned} \end{equation*} Then, we define the vector $\boldsymbol{\uplambda}_j=[\lambda_{i,j}]$ for every executed task $\tau_j$, which contains every $\lambda_{i,j}$ such that $w_i\in\mathcal{S_W}$, and $\tau_j\in\Gamma_i$. Therefore, minimizing the upper bound of $\text{Pr}[X_j<0|l_j=1]$ is equivalent to finding the vector $\boldsymbol{\uplambda}_j$ that maximizes the function $f(\boldsymbol{\uplambda}_j)$ defined as \begin{equation*}\label{eq:flambda} \begin{aligned} f(\boldsymbol{\uplambda}_j)=\frac{\big(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}(2\theta_{i,j}-1)\big)^2}{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}^2}. \end{aligned} \end{equation*} Based on the Cauchy-Schwarz inequality, we have \begin{equation*} \scalefont{0.91} \begin{aligned} f(\boldsymbol{\uplambda}_j)&\leq\frac{\big(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}^2\big)\big(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2\big)}{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}^2}\\ &=\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2, \end{aligned} \end{equation*} and equality is achieved if and only if $\lambda_{i,j}\propto 2\theta_{i,j}-1$. Thus, \begin{equation}\label{eq:conprob1} \scalefont{0.84} \begin{aligned} \text{Pr}[X_j<0|l_j=1]\leq\exp\Bigg(-\frac{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2}{2}\Bigg). \end{aligned} \end{equation} Similarly, from the Chernoff-Hoeffding bound, we have \begin{equation*} \scalefont{0.78} \begin{aligned} \text{Pr}[X_j\geq0|l_j=-1]\leq\exp\Bigg(-\frac{\big(\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}(2\theta_{i,j}-1)\big)^2}{2\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}\lambda_{i,j}^2}\Bigg). \end{aligned} \end{equation*} The upper bound of $\text{Pr}[X_j>0|l_j=-1]$ is also minimized if and only if $\lambda_{i,j}\propto 2\theta_{i,j}-1$ based on the Cauchy-Schwarz inequality, and we have \begin{equation}\label{eq:conprob2} \scalefont{0.8} \begin{aligned} \text{Pr}[X_j\geq 0|l_j=-1]\leq\exp\Bigg(-\frac{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2}{2}\Bigg). \end{aligned} \end{equation} From Inequality (\ref{eq:conprob1}) and (\ref{eq:conprob2}), we have that when $\lambda_{i,j}=2\theta_{i,j}-1$, the upper bound of $\textnormal{Pr}[\widehat{L}_j\not=l_j]$ is minimized, and \begin{equation*} \begin{aligned} \textnormal{Pr}[\widehat{L}_j\not=l_j]\leq\exp\Bigg(-\frac{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2}{2}\Bigg), \end{aligned} \end{equation*} which exactly proves Theorem \ref{theo:accuracy}. \end{proof} By Theorem \ref{theo:accuracy}, we have that the data aggregation mechanism proposed in Algorithm \ref{al:aggregation} upper bounds the error probability $\textnormal{Pr}[\widehat{L}_j\not=l_j]$ by $\exp\big(-\frac{1}{2}\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2\big)$, which in fact is the minimum upper bound of this probability. Next, we derive Corollary \ref{cor:accurcay}, which is directly utilized in our design of the incentive mechanism in Section \ref{sec:incentivemechanism}. \begin{myCor}\label{cor:accurcay} For every executed task $\tau_j$, the data aggregation mechanism proposed in Algorithm \ref{al:aggregation} satisfies that if \begin{equation}\label{eq:errConstraintinCor} \begin{aligned} \sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2\geq 2\ln\bigg(\frac{1}{\beta_j}\bigg), \end{aligned} \end{equation} then $\textnormal{Pr}[\widehat{L}_j\not=l_j]\leq\beta_j$, i.e., $\beta_j$-accuracy is satisfied for this task $\tau_j$, where $\beta_j\in(0,1)$ is a platform chosen parameter. Moreover, we define $\boldsymbol{\upbeta}$ as the vector $(\beta_1,\cdots, \beta_M)$. \end{myCor} \begin{proof} By setting the upper bound of $\textnormal{Pr}[\widehat{L}_j\not=l_j]$ given in Theorem \ref{theo:accuracy} to be no greater than $\beta_j\in(0,1)$, we have \begin{equation*} \begin{aligned} \exp\Bigg(-\frac{\sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2}{2}\Bigg)\leq\beta_j, \end{aligned} \end{equation*} which is equivalent to \begin{equation}\label{eq:errConstraintinProof} \begin{aligned} \sum_{i:w_i\in\mathcal{S_W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2\geq 2\ln\bigg(\frac{1}{\beta_j}\bigg). \end{aligned} \end{equation} Hence, together with Theorem \ref{theo:accuracy}, we have that Inequality (\ref{eq:errConstraintinProof}) indicates that $\textnormal{Pr}[\widehat{L}_j\not=l_j]\leq\beta_j$. \end{proof} Corollary \ref{cor:accurcay} gives us a sufficient condition, represented by Inequality (\ref{eq:errConstraintinCor}), that the set of winning workers $\mathcal{S_W}$ selected by the incentive mechanism (proposed in Section \ref{sec:incentivemechanism}) should satisfy so as to achieve $\beta_j$-accuracy for each executed task $\tau_j$. \subsection{Incentive Mechanism}\label{sec:incentivemechanism} Now, we introduce the design details of CENTURION's incentive mechanism, including its mathematical formulation, the hardness proof of the formulated integer program, the proposed mechanism, as well as the corresponding analysis. \subsubsection{Mathematical Formulation} ~ As mentioned in Section \ref{sec:auctionmodel}, CENTURION's incentive mechanism is based on the MELON double auction defined in Definition \ref{def:auction}. In this paper, we aim to design a MELON double auction that \textit{maximizes the social welfare}, while guaranteeing \textit{satisfactory data aggregation accuracy}. The formal mathematical formulation of its winner selection problem is provided in the following \textit{MELON double auction social welfare maximization (MELON-SWM) problem.} ~\\ \textbf{MELON-SWM Problem:} \begin{small} \begin{align} \max&\sum_{j:\tau_j\in\mathcal{T}}a_jy_j-\sum_{i:w_i\in\mathcal{W}}b_ix_i\\ \text{s.t.}& \sum_{i:w_i\in\mathcal{W},\tau_j\in\Gamma_i}(2\theta_{i,j}-1)^2 x_i\geq 2\ln\bigg(\frac{1}{\beta_j}\bigg)y_j,~\forall\tau_j\in\mathcal{T}\label{eq:constraint}\\ &x_i, y_j\in\{0,1\},~\forall w_i\in\mathcal{W},~\tau_j\in\mathcal{T} \end{align} \end{small} \vspace{-0.4cm} \textbf{Constants.} The MELON-SWM problem takes as inputs the task set $\mathcal{T}$, the worker set $\mathcal{W}$, the requesters' and workers' bid profile $\mathbf{a}$ and $\mathbf{b}$, the profile of workers' interested task sets $\boldsymbol{\Gamma}$, the workers' reliability level matrix $\boldsymbol{\uptheta}$, and the $\boldsymbol{\upbeta}$ vector. \textbf{Variables.} On one hand, the MELON-SWM problem has a vector of $M$ binary variables, denoted as $\mathbf{y}=(y_1,\cdots,y_M)$. Any $y_j=1$ indicates that task $\tau_j$ will be executed, and thus, requester $r_j$ is a winning requester (i.e., $r_j\in\mathcal{S_R}$), whereas $y_j=0$ means $r_j\not\in\mathcal{S_R}$. On the other hand, the problem has another vector of $N$ binary variables, denoted as $\mathbf{x}=(x_1,\cdots,x_N)$, where $x_i=1$ indicates that worker $w_i$ is a winning worker (i.e., $w_i\in\mathcal{S_W}$), and $x_i=0$ means $w_i\not\in\mathcal{S_W}$. \textbf{Objective function.} The objective function satisfies that $\sum_{j:\tau_j\in\mathcal{T}}a_jy_j-\sum_{i:w_i\in\mathcal{W}}b_ix_i=\sum_{j:r_j\in\mathcal{S_R}}a_j-\sum_{i:w_i\in\mathcal{S_W}}b_i$, which is exactly the social welfare defined in Definition \ref{def:socialwelfare} based on the requesters' and workers' bids. \textbf{Constraints.} For each task $\tau_j$, Constraint (\ref{eq:constraint}) naturally holds, if $y_j=0$. When $y_j=1$, it is equivalent to Inequality (\ref{eq:errConstraintinCor}) given in Corollary \ref{cor:accurcay}, which specifies the condition that the set of selected winning workers $\mathcal{S_W}$ should satisfy in order to guarantee $\beta_j$-accuracy for task $\tau_j$. To simplify the presentation, we introduce the following notations, namely $q_{i,j}=(2\theta_{i,j}-1)^2$, $\mathbf{q}=[q_{i,j}]\in[0,1]^{N\times M}$, $Q_j=2\ln\big(\frac{1}{\beta_j}\big)$, and $\mathbf{Q}=[Q_j]\in[0,+\infty)^{M\times 1}$. Thus, Constraint (\ref{eq:constraint}) can be simplified as \begin{equation}\label{eq:constraintsimple} \begin{aligned} \sum_{i:w_i\in\mathcal{W},\tau_j\in\Gamma_i}q_{i,j} x_i\geq Q_j y_j,~\forall\tau_j\in\mathcal{T}. \end{aligned} \end{equation} Besides, we say a task $\tau_j$ is \textit{covered} by a solution, if $y_j=1$. \subsubsection{Hardness Proof} ~ We prove the NP-hardness of the MELON-SWM problem by performing a polynomial-time reduction from the 3SAT(5) problem which is formally defined in Definition \ref{def:3SAT}. \begin{myDef}[3SAT(5) Problem]\label{def:3SAT} In a 3SAT(5) problem, we are given a set $\mathcal{O}=\{z_1,\cdots,z_n\}$ of $n$ Boolean variables, and a collection $C_1,\cdots,C_m$ of $m$ clauses. Each clause is an OR of exactly three literals, and every literal is either a variable of $\mathcal{O}$ or its negation. Moreover, every variable participates in exactly 5 clauses. Therefore, $m=\frac{5n}{3}$. Given some constant $0<\epsilon<1$, a 3SAT(5) instance $\varphi$ is a Yes-Instance if there is an assignment to the variables of $\mathcal{O}$ satisfying all clauses, whereas it is a No-Instance (with respect to $\epsilon$), if every assignment to the variables satisfies at most $(1-\epsilon)m$ clauses. An algorithm $\mathcal{A}$ distinguishes between the Yes- and No-instances of the problem, if, given a Yes-Instance, it returns a ``YES'' answer, and given a No-Instance it returns a ``NO'' answer. \end{myDef} Regarding the hardness of the 3SAT(5) problem, we introduce without proof the following well-known Lemma \ref{theo:SATHard}, which is a consequence of the PCP theorem \cite{SAroraJACM98}. \begin{myLemma}\label{theo:SATHard} There is some constant $0<\epsilon<1$, such that distinguishing between the Yes- and No-instances of the 3SAT(5) problem, defined with respect to $\epsilon$, is NP-complete. \end{myLemma} Next, we introduce Theorem \ref{theo:reduction} and \ref{theo:welfarematching} that will be utilized to prove the NP-hardness of the MELON-SWM problem. \begin{myTheo}\label{theo:reduction} Any 3SAT(5) instance is polynomial-time reducible to an instance of the MELON-SWM problem. \end{myTheo} \begin{proof} The reduction goes as follows. Assume there is a 3SAT(5) instance $\varphi$ on $n$ variables and $m$ clauses. We define 3 parameters: $X=\frac{\epsilon m}{100}$ ($0<\epsilon<1$), $Y=mnX$, and $Z=mnY$. The exact values of $Y$ and $Z$ are not important. We just need to ensure $Z\gg Y\gg X$. We construct an instance of the MELON-SWM problem corresponding to $\varphi$, by defining the task set $\mathcal{T}$, and the profile of workers' interested task sets $\boldsymbol{\Gamma}$. Out of the 8 possible assignments to the variables of some clause $C_k\in\varphi$, exactly one does not satisfy $C_k$. Let $A_k$ be the set of the remaining 7 assignments. We define a set of tasks $\Gamma(C_k,\alpha)$ for each clause $C_k$ and assignment $\alpha\in A_k$, let $\boldsymbol{\Gamma}=[\Gamma(C_k, \alpha)]$ for each clause $C_k\in\varphi$ and assignment $\alpha\in A_k$, set the $q_{i,j}$ value of each worker $w_i$ and task $\tau_j\in\Gamma_i$ as $q_{i,j}=1$, and set her bid as $b_i=3+Y+Z$. We also create a dummy worker $w_0$, with $q_0=1$, $b_0=0$, and $\Gamma_0$ being her interested task set. We start with all set $\Gamma(C_k, \alpha)$'s being empty, gradually define the tasks, and specify which sets they belong to. The task set $\mathcal{T}$ consists of 4 subsets. \begin{itemize}[leftmargin=*]\compresslist \item The 1st subset $E_1$ contains a task $\tau(z_l, \gamma)$ for each variable $z_l\in\mathcal{O}$ and assignment $\gamma\in\{T,F\}$ to this variable. $\tau(z_l, \gamma)$ belongs to each set $\Gamma(C_k , \alpha)$, such that $z_l$ participates in $C_k$, and the assignment $\alpha$ to the variables of $C_k$ gives assignment $\gamma$ to $z_l$. The $Q_j$ value of the task $\tau_j$ corresponding to $\tau(z_l, \gamma)$ is set as $5-\text{the number of the clauses containing~}z_l$, and the value $v_j$ of this task is set as $5$. \item The 2nd subset $E_2$ contains $m$ tasks $\tau_1,\cdots,\tau_m$. Each $\tau_k\in E_2$ belongs to all sets corresponding to $C_k$ and $C_{k+1}$, i.e., $\tau_k$ belongs to all sets $\{\Gamma(C_k, \alpha)|\alpha\in A_k\}\cup\{\Gamma(C_{k+1},\alpha')|\alpha'\in A_{k+1}\}$ with the subscripts being modulo $m$. The $Q_k$ value of each such $\tau_k$ is set as $2$, and its value $v_k$ is set as $Y$. \item The 3rd subset $E_3$ contains a task $\tau(C_k)$ for each clause $C_k$, and $\tau(C_k)$ belongs to set $\Gamma(C_k,\alpha)$ for each $\alpha\in A_k$. The $Q_j$ value of the task $\tau_j$ corresponding to $\tau(C_k)$ is set as 1, and its value $v_j$ is set as $Z$. \item The 4th subset $E_4$ contains a single task $\tau^*$, whose $Q_j$ value is set as $1$ and value $v_j$ is set as $X$. The task $\tau^*$ only belongs to set $\Gamma_0$. \end{itemize} This finishes the description of the reduction. Clearly, given a 3SAT(5) instance $\varphi$, we can construct an instance of the MELON-SWM problem in time polynomial in $n$. \end{proof} We now analyze the optimal social welfare for an instance of the MELON-SWM problem that corresponds to a 3SAT(5) instance $\varphi$, when $\varphi$ is a Yes- or No-Instance. Note that the following analysis uses the same reduction as in Theorem \ref{theo:reduction}. \begin{myTheo}\label{theo:welfarematching} If the 3SAT(5) instance $\varphi$ is a Yes-Instance, then there is a solution to the resulting instance of the MELON-SWM problem whose social welfare is $X$. If $\varphi$ is a No-Instance, then any solution has social welfare at most $0$. \end{myTheo} \begin{proof} Let $\varphi$ be a Yes-Instance, and $A$ be an assignment to the variables satisfying all clauses. We construct a solution $\mathcal{S}'$ to the MELON-SWM problem. Firstly, we add $\Gamma_0$ to $\mathcal{S}'$. Next, for each clause $C_k$, we add to $\mathcal{S}'$ the unique set $\Gamma(C_k,\alpha)$, where $\alpha$ is the assignment consistent with $A$. Then $|\mathcal{S}'|=m$, and the total cost of all sets is $(Y+Z+3)m$. We now analyze the number of tasks covered by $\mathcal{S}'$, and their values. Clearly, $\tau^*$ is covered by $\mathcal{S}'$, and it contributes $X$ to the solution value. \begin{itemize}[leftmargin=*]\compresslist \item For each clause $C_k\in\varphi$, the unique task $\tau(C_k)\in E_3$ is covered. Thus, all tasks in $E_3$ are covered, and overall they contribute value $mZ$ to the solution. \item Consider some $\tau_k\in E_2$. $\mathcal{S}'$ contains one set corresponding to $C_k$ and $C_{k+1}$, respectively. Since $\tau_k$ belongs to both these sets, and its $Q_k$ is 2, it is covered. Thus, all tasks in $E_2$ are covered, and they contribute value $mY$ to the solution. \item Consider some variable $z_k\in\mathcal{O}$, and let $\gamma_k\in\{T,F\}$ be the assignment to $z_k$ under $A$. If $C_k$ is any clause containing $z_k$, and $\Gamma(C_k, \alpha)$ is the set that belongs to $\mathcal{S}'$, then $\alpha$ gives the assignment $\gamma_k$ to $z_k$. Thus, for all five clauses containing $z_k$, the corresponding sets chosen to $\mathcal{S}'$ contain $\tau(z_k,\gamma_k)$, and this task is covered. So the total number of tasks of $E_1$ covered by $\mathcal{S}'$ is $n$. Each such task contributes value 5, and the total value contributed by the tasks in $E_1$ is $5n=3m$. \end{itemize} Therefore, the overall social welfare of this solution is $X+mZ+mY+3m-(Z+Y+3)m=X$. Assume now that $\varphi$ is a No-Instance, and let $\mathcal{S}'$ be any solution with positive social welfare. We can assume that $\Gamma_0\in\mathcal{S}'$, and task $\tau^*$ is covered by $\mathcal{S}'$. We then introduce the following observations, whose proofs are provided in the appendices. \begin{myObs}\label{theo:obs1} For every clause $C_k$ of $\varphi$, at most one of the sets $\{\Gamma(C_k,\alpha)|\alpha\in A_k\}$ belongs to $\mathcal{S}'$, and $|\mathcal{S}'|=m$. \end{myObs} \begin{myObs}\label{theo:obs3} For every variable $z_k\in\mathcal{O}$, at most one of the two tasks $\tau(z_k, T)$ and $\tau(z_k, F)$ is covered by $\mathcal{S}'$. \end{myObs} We say that a variable $z_k\in\mathcal{O}$ is bad if neither $\tau(z_k, T)$ nor $\tau(z_k, F)$ is covered by $\mathcal{S}'$; otherwise it is good. We next show that only a small number of the variables are bad. \begin{myObs}\label{theo:obs4} There are at most $\frac{\epsilon n}{100}$ bad variables. \end{myObs} Then, we construct the following assignment to the variables of $\mathcal{O}$. If variable $z_k\in\mathcal{O}$ is good, then there is a unique value $\gamma_k\in\{T,F\}$, such that task $\tau(z_k, \gamma_k)$ is covered by $\mathcal{S}'$. We then assign $z_k$ the value $\gamma_k$. If $z_k$ is bad, we assign it any value arbitrarily. We now claim that the above assignment satisfies more than $(1-\epsilon)m$ clauses. We say that a clause is bad if it contains a bad variable, and it is good otherwise. Since there are at most $\frac{\epsilon n}{100}$ bad variables, and each variable participates in 5 clauses, the number of bad clauses is at most $\frac{\epsilon n}{20}\leq\frac{3\epsilon m}{100}$. So there are more than $(1-\epsilon)m$ good clauses. Let $C_l$ be a good clause, and $\Gamma(C_l,\alpha)$ be the set corresponding to $C_l$ that belongs to $\mathcal{S}'$. Then $\alpha$ is an assignment to the variables of $C_l$ that satisfies $C_l$, and each variable participating in $C_l$ was assigned a value consistent with $\alpha$. So clause $C_l$ is satisfied. To conclude, we have assumed that $\varphi$ is a No-Instance, and showed that, if the MELON-SWM problem has a solution with non-negative social welfare, there is an assignment to the variables of $\varphi$ satisfying more than $(1-\epsilon)m$ of its clauses, which is impossible for a No-Instance. Therefore, if $\varphi$ is a No-Instance, every solution has social welfare at most $0$. \end{proof} Next, we describe Theorem \ref{theo:NPHard} that states the \textit{NP-hardness} and \textit{inapproximability} of the MELON-SWM problem. \begin{myTheo}\label{theo:NPHard} The MELON-SWM problem is NP-hard, and for any factor $\phi$, there is no efficient $\phi$-approximation algorithm to the MELON-SWM problem. \end{myTheo} \begin{proof} Based on Theorem \ref{theo:reduction}, there exists a reduction from any 3SAT(5) problem instance $\varphi$ to an instance $\mathcal{I}(\varphi)$ of the MELON-SWM problem. From Theorem \ref{theo:welfarematching}, we have that the optimal solution to $\mathcal{I}(\varphi)$ also gives a solution to $\varphi$. That is, if the optimal social welfare of $\mathcal{I}(\varphi)$ is positive, then $\varphi$ is a Yes-Instance; otherwise, $\varphi$ is a No-Instance. Together with Lemma \ref{theo:SATHard} stating the NP-completeness of the 3SAT(5) problem, we conclude that the MELON-SWM problem is NP-hard. In fact, Theorem \ref{theo:reduction} and \ref{theo:welfarematching} give an inapproximability result about the MELON-SWM, as well. Suppose there is an efficient factor-$\phi$ approximation algorithm $\mathcal{A}$ for the MELON-SWM problem. We can use it to distinguish Yes- and No-instances of the 3SAT(5) problem on $n\gg\phi$ variables. If $\varphi$ is a Yes-Instance, then the algorithm has to return a solution with positive social welfare for $\mathcal{I}(\varphi)$, and if $\varphi$ is a No-Instance, then any solution has social welfare at most 0. So algorithm $\mathcal{A}$ distinguishes the Yes- and the No-instances of 3SAT(5), contradicting Lemma \ref{theo:SATHard}. \end{proof} \subsubsection{Proposed Mechanism} ~ Theorem \ref{theo:NPHard} not only shows the NP-hardness of the MELON-SWM problem, but also indicates that there is no efficient algorithm with a guaranteed approximation ratio for it. Therefore, we relax the requirement of provable approximation ratio, and propose the following MELON double auction that aims to ensure \textit{non-negative social welfare}, instead. Its winner selection algorithm is given in the following Algorithm \ref{al:wd}. \begin{algorithm}\label{al:wd} \SetAlgoNlRelativeSize{0} \SetNlSkip{0.3em} \small \KwIn{$\mathcal{T}$, $\mathcal{R}$, $\mathcal{W}$, $\boldsymbol{\Gamma}$, $\mathbf{a}$, $\mathbf{b}$, $\mathbf{q}$, $\mathbf{Q}$\;} \KwOut{$\mathcal{S_R}$, $\mathcal{S_W}$, $\mathcal{C}$\;} \tcp{Initialization} $\mathcal{S_R}\leftarrow\emptyset$, $\mathcal{S_W}\leftarrow \emptyset$\;\label{line:iniwd} \tcp{Find a feasible cover} $\mathcal{C}\leftarrow\texttt{FC}(\mathcal{T}, \boldsymbol{\Gamma}, \mathbf{q}, \mathbf{Q})$\;\label{line:feasiblecover} \ForEach{$j$ \text{s.t.} $\tau_j\in\mathcal{T}$}{\label{line:Cjforstart} $\mathcal{C}_j\leftarrow\{w_i|w_i\in\mathcal{C}, \tau_j\in\Gamma_i\}$\;\label{line:Cjforend} } \tcp{Main loop} \While{$\max_{j:r_j\in\mathcal{R}}\big(a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i\big)\geq 0$}{\label{line:mainloopwinnerstart} $j^*\leftarrow\arg\max_{j:r_j\in\mathcal{R}}\big(a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i\big)$\;\label{line:maxindex} $\mathcal{S_R}\leftarrow\mathcal{S_R}\cup\{r_{j^*}\}$\;\label{line:incrstar} $\mathcal{R}\leftarrow\mathcal{R}\setminus\{r_{j^*}\}$\;\label{line:excrstar} $\mathcal{S_W}\leftarrow\mathcal{S_W}\cup\mathcal{C}_{j^*}$\;\label{line:incCjstar} \ForEach{$j$ \text{s.t.} $r_i\in\mathcal{R}$}{\label{line:innerforwinner} $\mathcal{C}_j\leftarrow\mathcal{C}_j\setminus\mathcal{C}_{j^*}$\;\label{line:mainloopwinnerend} } } \Return$\mathcal{S_R}, \mathcal{S_W}$\;\label{line:returnwinner} \caption{MELON Double Auction Winner Selection} \end{algorithm} Algorithm \ref{al:wd} takes as inputs the task set $\mathcal{T}$, the requester set $\mathcal{R}$, the worker set $\mathcal{W}$, the profile of workers' interested task sets $\boldsymbol{\Gamma}$, the requesters' and workers' bid profile $\mathbf{a}$ and $\mathbf{b}$, the $\mathbf{q}$ matrix, as well as the $\mathbf{Q}$ vector. Firstly, it initializes the winning requester and worker set as $\emptyset$ (line \ref{line:iniwd}). Then, it calculates a \textit{feasible cover}, denoted by $\mathcal{C}$, containing the set of workers that make Constraint (\ref{eq:constraintsimple}) feasible for each task $\tau_j$ given that each $y_j=1$, by calling another algorithm $\texttt{FC}$ which takes the task set $\mathcal{T}$, the profile of workers' interested task sets $\boldsymbol{\Gamma}$, the $\mathbf{q}$ matrix, and the $\mathbf{Q}$ vector as inputs (line \ref{line:feasiblecover}). Algorithm $\texttt{FC}$ can be easily implemented in time polynomial in $M$ and $N$. For example, $\texttt{FC}$ could greedily select each worker $w_i$ into the feasible cover in a decreasing order of the value $\sum_{j:\tau_j\in\Gamma_i}q_{i,j}$ until all constraints are satisfied. The computational complexity of such $\texttt{FC}$ is $O(N)$. We assume that $\texttt{FC}$ adopts such a greedy approach in the rest of this paper. Note that the specific choice of $\texttt{FC}$ is not important, as long as it returns a feasible cover in polynomial time. Next, for each task $\tau_j$, Algorithm \ref{al:wd} chooses from the feasible cover the set of workers $\mathcal{C}_j$ whose interested task sets contain this task (line \ref{line:Cjforstart}-\ref{line:Cjforend}). Based on $\mathcal{C}$, the main loop (line \ref{line:mainloopwinnerstart}-\ref{line:mainloopwinnerend}) of the algorithm selects the set of winning requesters and workers that give non-negative social welfare. It executes until $\max_{j:r_j\in\mathcal{R}}\big(a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i\big)$, the \textit{maximum marginal social welfare} of including a new requester $r_j$ and the set of workers $\mathcal{C}_j$ into, respectively, the winning requester and worker set, becomes negative (line \ref{line:mainloopwinnerstart}). In each iteration of the main loop, the Algorithm finds first the index $j^*$ of the requester $r_{j^*}$ that provides the \textit{maximum marginal social welfare} (line \ref{line:maxindex}). Next, it includes $r_{j^*}$ into the winning requester set $\mathcal{S_R}$ (line \ref{line:incrstar}), removes $r_{j^*}$ from the requester set $\mathcal{R}$ (line \ref{line:excrstar}), and includes all workers in $\mathcal{C}_{j^*}$ into the winning worker set $\mathcal{S_W}$ (line \ref{line:incCjstar}). The last step of the main loop is to remove all workers in $\mathcal{C}_{j^*}$ from $\mathcal{C}_j$ for each task $\tau_j$ (line \ref{line:innerforwinner}). Finally, Algorithm \ref{al:wd} returns the winning requester and worker set $\mathcal{S_R}$ and $\mathcal{S_W}$ (line \ref{line:returnwinner}). Next, we present the pricing algorithm of the MELON double auction in Algorithm \ref{al:pricing}. \begin{algorithm}\label{al:pricing} \SetAlgoNlRelativeSize{0} \SetNlSkip{0.3em} \small \KwIn{$\mathcal{T}$, $\mathcal{R}$, $\mathcal{W}$, $\boldsymbol{\Gamma}$, $\mathbf{a}$, $\mathbf{b}$, $\mathbf{q}$, $\mathbf{Q}$, $\mathcal{S_R}$, $\mathcal{S_W}$\;} \KwOut{$\mathbf{p}^r$, $\mathbf{p}^w$\;} \tcp{Initialization} $\mathbf{p}^r\leftarrow\mathbf{0}$, $\mathbf{p}^w\leftarrow\mathbf{0}$\;\label{line:inipricing} \tcp{Pricing for winning requesters} \ForEach{$j$ \text{s.t.} $r_j\in\mathcal{S_R}$}{\label{line:looprpstart} run Algorithm \ref{al:wd} on $\mathcal{R}\setminus \{r_j\}$ and $\mathcal{W}$\;\label{line:wdinrp} $\mathcal{S'_R}\leftarrow$winning requester set when line \ref{line:wdinrp} stops\;\label{line:imsets} \ForEach{$k$ \text{s.t.} $r_k\in\mathcal{S'_R}$}{\label{line:innerforrpstart} $p_j^r\leftarrow\min\big\{p_j^r, \sum_{w_i\in\mathcal{C}'_j}b_i+a_k-\sum_{w_i\in\mathcal{C}'_k}b_i\big\}$\;\label{line:innerforrpend} } \If{$\mathcal{C}'_j=\emptyset$}{\label{line:ifempty} $p_j^r\leftarrow\min\{p_j^r, 0\}$\;\label{line:looprpend} } } \tcp{Pricing for winning workers} \ForEach{$i$ \text{s.t.} $w_i\in\mathcal{S_W}$}{\label{line:loopwpstart} run Algorithm \ref{al:wd} on $\mathcal{R}$ and $\mathcal{W}\setminus \{w_i\}$\;\label{line:wdinwp} $\mathcal{S'_R}\leftarrow$winning requester set when line \ref{line:wdinwp} stops\;\label{line:imsetswp} \ForEach{$k$ \text{s.t.} $w_i\in\mathcal{C}'_k$ and $r_k\in\mathcal{S'_R}$}{\label{line:forwpstart} sort requesters according to the decreasing order of $a_j-\sum_{i:w_i\in\mathcal{C}'_j}b_i$\;\label{line:sort} $f\leftarrow$index of the first requester with $w_i\not\in\mathcal{C}'_f$\;\label{line:firstindex} \eIf{$r_f\in\mathcal{S'_R}$}{\label{line:ifinSprimeR} $p_i^w\leftarrow\max\big\{p_i^w, a_k-\sum_{w_h\in\mathcal{C}'_k}b_h-\big(a_f-\sum_{w_h\in\mathcal{C}'_f}b_h\big)\big\}$\; }{ $p_i^w\leftarrow\max\big\{p_i^w, a_k-\sum_{w_h\in\mathcal{C}'_k}b_h\big\}$\;\label{line:loopwpend} } } } \Return$\mathbf{p}^r$, $\mathbf{p}^w$\;\label{line:returnpricing} \caption{MELON Double Auction Pricing} \end{algorithm} Apart from the same inputs to Algorithm \ref{al:wd}, Algorithm \ref{al:pricing} also takes as inputs the winning requester and worker set $\mathcal{S_R}$ and $\mathcal{S_W}$, outputted by Algorithm \ref{al:wd}. Firstly, Algorithm \ref{al:pricing} initializes the requesters' and workers' payment profile as zero vectors (line \ref{line:inipricing}). Then, it calculates the payment $p_j^r$ charged from each winning requester (line \ref{line:looprpstart}-\ref{line:looprpend}). For each $r_j\in\mathcal{S_R}$, Algorithm \ref{al:wd} is executed on the worker set $\mathcal{W}$ and requester set $\mathcal{R}$ except requester $r_j$ (line \ref{line:wdinrp}). Next, it sets $\mathcal{S'_R}$ as the winning requester set when line \ref{line:wdinrp} stops (line \ref{line:imsets}). For each $r_k\in\mathcal{S'_R}$, Algorithm \ref{al:pricing} finds the minimum bid $a_{j,k}$ for requester $r_j$ to replace $r_k$ as the winner. To achieve this, $a_{j,k}$ should satisfy $a_{j,k}-\sum_{w_i\in\mathcal{C}'_j}b_i=a_k-\sum_{w_i\in\mathcal{C}'_k}b_i$, which is equivalent to $a_{j,k}=\sum_{w_i\in\mathcal{C}'_j}b_i+a_k-\sum_{w_i\in\mathcal{C}'_k}b_i$. Note that $\mathcal{C}'_1,\cdots,\mathcal{C}'_M$ denote the sets $\mathcal{C}_1,\cdots,\mathcal{C}_M$ when the specific requester $r_k$ is selected into $\mathcal{S'_R}$. If $\mathcal{C}'_j$ is not empty, the minimum value among these $a_{j,k}$'s is chosen as the payment $p_j^r$ (line \ref{line:innerforrpstart}-\ref{line:innerforrpend}); otherwise, it is further compared with $0$ (line \ref{line:ifempty}-\ref{line:looprpend}), since requester $r_j$ could win, in this case, as long as her bid is non-negative. Next, Algorithm \ref{al:pricing} derives the payment $p_i^w$ to each winning worker $w_i$ (line \ref{line:loopwpstart}-\ref{line:loopwpend}). Similar to line \ref{line:wdinrp}, Algorithm \ref{al:wd} is executed on the requester set $\mathcal{R}$ and worker set $\mathcal{W}$ except worker $w_i$ (line \ref{line:wdinwp}), and $\mathcal{S'_R}$ is set as the winning requester set when line \ref{line:wdinwp} stops (line \ref{line:imsetswp}). In the rest of the algorithm, we also use $\mathcal{C}'_1,\cdots,\mathcal{C}'_M$ to denote the sets $\mathcal{C}_1,\cdots,\mathcal{C}_M$ when the specific requester $r_k$ is selected into $\mathcal{S'_R}$. For each set $\mathcal{C}'_k$ such that $w_i$ belongs to $\mathcal{C}'_k$ and $r_k$ belongs to $\mathcal{S'_R}$, the algorithm calculates the maximum bid $b_{i,k}$ for worker $w_i$ to be selected as a winner at this point (line \ref{line:forwpstart}-\ref{line:loopwpend}). The calculation firstly sorts requesters in the decreasing order of their marginal social welfare, i.e., $a_j-\sum_{i:w_i\in\mathcal{C}'_j}b_i$ (line \ref{line:sort}), and finds the index $f$ of the first the requester in this order such that $w_i$ does not belong to $\mathcal{C}'_f$ (line \ref{line:firstindex}). If $r_f$ is a winning requester in $\mathcal{S'_R}$, then $b_{i,k}$ should satisfy $a_k-\big(\sum_{w_h\in\mathcal{C}'_k}b_h+b_{i,k}\big)=a_f-\sum_{w_h\in\mathcal{C}'_f}b_h$, which is equivalent to $b_{i,k}=a_k-\sum_{w_h\in\mathcal{C}'_k}b_h-\big(a_f-\sum_{w_h\in\mathcal{C}'_f}b_h\big)$; otherwise, $b_{i,k}$ should satisfy $a_k-\big(\sum_{w_h\in\mathcal{C}'_k}b_h+b_{i,k}\big)=0$, which is equivalent to $b_{i,k}=a_k-\sum_{w_h\in\mathcal{C}'_k}b_h$. Then, the maximum value among these $b_{i,k}$'s are chosen as the payment $p_i^w$ (line \ref{line:ifinSprimeR}-\ref{line:loopwpend}). Finally, Algorithm \ref{al:pricing} returns the requesters' and workers' payment profile $\mathbf{p}^r$ and $\mathbf{p}^w$ (line \ref{line:returnpricing}). \subsubsection{Analysis of the Proposed Mechanism} ~ In this section, we prove several desirable properties of our MELON double auction, described in Algorithm \ref{al:wd} and \ref{al:pricing}. Firstly, we show its truthfulness in Theorem \ref{theo:truthfulness}. \begin{myTheo}\label{theo:truthfulness} The proposed MELON double auction is truthful. \end{myTheo} \begin{proof} We prove the truthfulness of the MELON double auction by showing that it satisfies the properties of \textit{monotonicity} and \textit{critical payment}. \begin{itemize}[leftmargin=*]\compresslist \item \textbf{Monotonicity.} The algorithm \texttt{FC} called by Algorithm \ref{al:wd} is independent of the requesters' and workers' bids, and winners are selected based on a decreasing order of the value $a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i$. Thus, if a requester $r_j$ wins by bidding $a_j$, she will also win the auction by bidding any $a'_j>a_j$. Similarly, if a worker $w_i$ wins by bidding $b_i$, she will win the auction, as well, if her bid takes any value $b'_i<b_i$. \item \textbf{Critical payment.} Algorithm \ref{al:pricing} in fact pays every winning requester and worker the infimum and supremum of her bid, respectively, that can make her a winner. \end{itemize} As proved in \cite{LBlumrosenAGT07}, these two properties make an auction truthful, i.e., each requester $r_j$ maximizes her utility by bidding $v_j$, and each worker $w_i$ maximizes her utility by bidding $c_i$. Therefore, the MELON double auction is truthful. \end{proof} Next, we show that the proposed MELON double auction satisfies individual rationality in Theorem \ref{theo:ir}. \begin{myTheo}\label{theo:ir} The proposed MELON double auction is individual rational. \end{myTheo} \begin{proof} By Definition \ref{def:requesterutility} and \ref{def:workerutility}, losers of the MELON double auction receive zero utilities. From Theorem \ref{theo:truthfulness}, every winning requester $r_j$ bids $v_j$, and every winning worker $w_i$ bids $c_i$ to the platform. Moreover, they are paid, respectively, the infimum and supremum of the bid for them to win the auction. Therefore, it is guaranteed that all requesters and workers receive non-negative utilities, and thus the proposed MELON double auction is individual rational. \end{proof} In Theorem \ref{theo:complexity}, we prove that the proposed MELON double auction has a polynomial-time computational complexity. \begin{myTheo}\label{theo:complexity} The computational complexity of the proposed MELON double auction is $O(M^3 N+M^2 N^2)$. \end{myTheo} \begin{proof} As mentioned in Section \ref{sec:mechanism}, the algorithm \texttt{FC} (line \ref{line:feasiblecover}) in Algorithm \ref{al:wd} takes a greedy approach, and has a computational complexity of $O(N)$. Line \ref{line:Cjforstart}-\ref{line:Cjforend} of Algorithm \ref{al:wd} that find the sets $\mathcal{C}_1,\cdots,\mathcal{C}_M$ terminate at most after $MN$ steps. Next, the main loop (line \ref{line:mainloopwinnerstart}-\ref{line:mainloopwinnerend}) terminates after $M$ iterations in worst case. Within each iteration, finding the index of the requester that provides the maximum marginal social welfare (line \ref{line:maxindex}) takes $O(M)$ time, and updating the sets $\mathcal{C}_1,\cdots,\mathcal{C}_M$ takes $O(MN)$ time. Therefore, the computational complexity of the main loop is $O(MN)$, and thus, that of Algorithm \ref{al:wd} is $O(M^2 N)$ overall. After Algorithm \ref{al:wd}, our MELON double auction executes its pricing algorithm described by Algorithm \ref{al:pricing}, where the loop for requester pricing (line \ref{line:inipricing}-\ref{line:looprpend}) terminates in worst case after $M$ iterations. Clearly, the computational complexity of each iteration of the loop is dominated by the execution of Algorithm \ref{al:wd} in line \ref{line:wdinrp}. Therefore, the requester pricing (line \ref{line:inipricing}-\ref{line:looprpend}) in Algorithm \ref{al:pricing} takes $O(M^3 N)$ time. Following a similar method of analysis, we can conclude that the worker pricing in Algorithm \ref{al:pricing} takes $O(M^2 N^2)$ time. Hence, the computation complexity of Algorithm \ref{al:pricing}, as well as that of the overall MELON double auction is $O(M^3 N+M^2 N^2)$. \end{proof} Finally, we show in Theorem \ref{theo:positivesocialwelfare} that our MELON double auction guarantees non-negative social welfare, as required. \begin{myTheo}\label{theo:positivesocialwelfare} The MELON double auction guarantees non-negative social welfare. \end{myTheo} \begin{proof} Clearly, in the winner selection algorithm described by Algorithm \ref{al:wd}, a requester $r_j$ and the workers in $\mathcal{C}_j$ could be selected as winners, only if the corresponding marginal social welfare $a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i$ is non-negative (line \ref{line:mainloopwinnerstart}). Thus, as the overall social welfare given by Algorithm \ref{al:wd} is the sum of the aforementioned marginal social welfare of every iteration where new winners are selected, the MELON double auction guarantees non-negative social welfare. \end{proof} \section{Performance Evaluation}\label{sec:perleval} In this section, we introduce the baseline methods, simulations settings, as well as simulation results of the performance evaluation about our proposed CENTURION framework. \subsection{Baseline Methods} In our evaluation of the incentive mechanism, the first baseline auction is the \underline{M}arginal \underline{S}ocial \underline{W}elfare greedy (MSW-Greedy) double auction. As in Algorithm \ref{al:wd}, it also initializes the winner sets as $\emptyset$, executes the algorithm $\texttt{FC}$ to obtain a feasible cover $\mathcal{C}$, and chooses from $\mathcal{C}$ the set $\mathcal{C}_j$ containing each worker $w_i$ such that $\tau_j\in\Gamma_i$ for each task $\tau_j$. Different from the MELON double auction, it sorts requesters in a decreasing order of their marginal social welfare, i.e., the value $a_j-\sum_{i:w_i\in\mathcal{C}_j}b_i$ for each requester $r_j$. Then, it selects the requester $r_j$ and the set of workers in $\mathcal{C}_j$ as winners until the marginal social welfare becomes negative. Its pricing algorithm is the same as that of the MELON double auction. Clearly, the MSW-Greedy double auction is truthful and individual rational. Another baseline auction is the one that initi\underline{A}lizes the feas\underline{I}ble cover $\mathcal{C}$ as the entire wo\underline{R}ker set $\mathcal{W}$, which we call AIR double auction. The rest of its winner selection, as well as the entire pricing algorithm is the same as those of our MELON double auction. It is easily provable that the AIR double auction is also truthful and individual rational. Furthermore, we compare our weighted data aggregation mechanism with a mean aggregation mechanism, which outputs $+1$ as the aggregated result for a task if the mean of workers' labels about this task is non-negative, and outputs $-1$, otherwise. Another baseline aggregation mechanism that we consider is the median aggregation that takes the median of workers' labels about a task as its aggregated result. \subsection{Simulation Settings} \begin{table}[h]\scriptsize\setlength{\tabcolsep}{3.6pt} \centering \begin{tabular}{|c|c|c|c|c|c|c|c|} \hline Setting&$v_j$&$c_i$&$\theta_{i,j}$&$\beta_j$&$|\Gamma_i^*|$&$N$&$M$\\ \hline\hline I&$[10,20]$&$[5,15]$&$[0,1]$&$[0.05,0.1]$&$[15,20]$&$[90,150]$&$60$\\ \hline II&$[10,20]$&$[5,15]$&$[0,1]$&$[0.05,0.1]$&$[15,20]$&$60$&$[20, 80]$\\ \hline \end{tabular} ~\\~\\ \caption{Simulation settings}\label{table:setting} \end{table} The parameter settings in our simulation are given in Table \ref{table:setting}. Specifically, parameters $v_j$, $c_i$, $\theta_{i,j}$, $\beta_j$, and $|\Gamma_i^*|$ are sampled uniformly at random from the intervals given in Table \ref{table:setting}. The worker $w_i$'s true interested task set $\Gamma_i^*$ contains $|\Gamma_i^*|$ tasks that are randomly selected from the task set $\mathcal{T}$. In setting I, we fix the number of requesters as $60$ and vary the number of workers from $90$ to $150$, whereas we fix the number of workers as $60$ and vary the number of requesters from $20$ to $80$ in setting II. \subsection{Simulation Results} \begin{figure}[h] \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{socialWelfareFixTask.eps}\\ \vspace{-0.2cm} \caption{Social welfare (setting I)} \label{fig:socialWelfareFixTask} \end{minipage} \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{socialWelfareFixUser.eps}\\ \vspace{-0.2cm} \caption{Social welfare (setting II)} \label{fig:socialWelfareFixUser} \end{minipage} \end{figure} \begin{figure}[h] \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{MAEFixTask.eps}\\ \vspace{-0.2cm} \caption{MAE (setting I)} \label{fig:MAEFixTask} \end{minipage} \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{MAEFixUser.eps}\\ \vspace{-0.2cm} \caption{MAE (setting II)} \label{fig:MAEFixUser} \end{minipage} \end{figure} \vspace{-0.2cm} \begin{figure}[h] \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{errProbFixTask.eps}\\ \vspace{-0.2cm} \caption{Error probability (setting I)} \label{fig:errProbFixTask} \end{minipage} \begin{minipage}{.49\linewidth} \centering \includegraphics[width=1\textwidth]{errProbFixUser.eps}\\ \vspace{-0.2cm} \caption{Error probability (setting II)} \label{fig:errProbFixUser} \end{minipage} \end{figure} In Figure \ref{fig:socialWelfareFixTask} and \ref{fig:socialWelfareFixUser}, we compare the social welfare generated by our MELON double auction with those of the two baseline auctions. These two figures show that our MELON double auction generates social welfare far more than the MSW-Greedy and AIR double auction under both setting I and II. We evaluate CENTURION's accuracy guarantee in setting I and II with a minor change of the parameter $\beta_j$, i.e., $\beta_j$ for each task $\tau_j$ is fixed as $0.05$ to simplify presentation. We compare the mean absolute error (MAE) for all tasks, which is defined as $\text{MAE}=\frac{1}{M}\sum_{j:\tau_j\in\mathcal{T}}|\hat{l}_j-l_j|$, of our weighted aggregation mechanism proposed in Algorithm \ref{al:aggregation} with those of the mean d median aggregation. The simulation for each combination of worker and requester number is repeated for $50000$ times, and we plot the means and standard deviations of the MAEs in Figure \ref{fig:MAEFixTask} and \ref{fig:MAEFixUser}. From these two figures, we observe that the MAE of our weighted aggregation mechanism is far less than those of the mean and median aggregation. Then, we show our simulation results about $\text{Pr}[|\hat{l}_j-l_j|]$, referred to as task $\tau_j$'s error probability (EP). After $50000$ repetitions of the simulation for any given combination of worker and requester number, empirical values of the EPs are calculated, and the means and standard deviations of the empirical EPs are plotted in Figure \ref{fig:errProbFixTask} and \ref{fig:errProbFixUser}. These two figures show that the empirical EPs are less than the required upper bound $\beta_j$ and far less than those of the mean and median aggregation. \section{Conclusion}\label{sec:conc} In this paper, we propose CENTURION, a novel integrated framework for multi-requester MCS systems, consisting of a double auction-based incentive mechanism that stimulates the participation of both requesters and workers, and a data aggregation mechanism that aggregates workers data. Its incentive mechanism bears many desirable properties including truthfulness, individual rationality, computational efficiency, as well as non-negative social welfare, and its data aggregation mechanism generates highly accurate aggregated results. \begin{spacing}{1} \bibliographystyle{IEEEtran} \small
{'timestamp': '2017-01-09T02:02:47', 'yymm': '1701', 'arxiv_id': '1701.01533', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01533'}
arxiv
\section{Introduction} In recent years, multicarrier code-division multiple-access (MC-CDMA) based on the quasi-/perfect- complementary sequence set (in abbreviation, QCSS/PCSS) has attracted much attention due to its potential to achieve low-/zero- interference multiuser performance \cite{HHC2001}, \cite{HHCBook}. Here, a QCSS (or PCSS) refers to a set of two-dimensional matrices with low (or zero) non-trivial auto- and cross- correlation sums \cite{Liu-TCOM2014}$-$\cite{LiuGuanMow14}. In this paper, a complementary sequence is also called a complementary matrix, and vice versa. To deploy a QCSS (or PCSS) in an MC-CDMA system, every data symbol of a specific user is spread by a complementary matrix by simultaneously sending out all of its row sequences over a number of non-interfering subcarrier channels. Because of this, the number of row sequences of a complementary matrix, denoted by $M$, is also called the \textit{number of channels}. At a matched-filter based receiver, de-spreading operations are performed separately in each subcarrier channel, followed by summing the correlator outputs of all the subcarrier channels to attain a correlation sum which will be used for detection. A PCSS may also be called a mutually orthogonal complementary sequence set (MOCSS) \cite{TSENG72}$-$\cite{Han-2011}, a concept extended from mutually orthogonal Golay complementary pairs (GCPs) \cite{Golay61}$-$\cite{LiuLiGuan-2013}. However, a drawback of PCSS is its small set size \cite{HHC08-REAL}. Specifically, the set size (denoted by $K$) of PCSS is upper bounded by the number of channels, i.e., $K\leq M$. This means that a PCSS based MC-CDMA system with $M$ subcarriers can support at most $M$ users only. Against such a backdrop, there have been two approaches aiming to provide a larger set size, i.e., $K>M$. The first approach is to design zero- or low- correlation zone (ZCZ/LCZ) based complementary sequence sets, called ZCZ-CSS \cite{Fan07}, \cite{HHC08} or LCZ-CSS \cite{Liu-TCOM2011}. A ZCZ-CSS (LCZ-CSS) based MC-CDMA system is capable of achieving zero- (low-) interference performance but requires a closed-control loop to dynamically adjust the timings of all users such that the received signals can be quasi-synchronously aligned within the ZCZ (LCZ). A second approach is to design QCSS which has uniformly low correlation sums over all non-trivial time-shifts. As such, QCSS can be utilized to achieve low-interference performance with a simpler timing-control system. To the authors' best knowledge, the first aperiodic correlation lower bound of QCSS was derived by Welch in \cite{Welch74}, which states: \begin{equation}\label{Welch_bound_for_cc} \delta^2_{\max} \geq M^2N^2\frac{\frac{K}{M}-1}{K(2N-1)-1}, \end{equation} where every quasi-complementary sequence is a matrix of order $M\times N$ (thus, every row sequence has length of $N$) with assumed energy of $M^2N^2$. The aforementioned set size upper bound of PCSS, namely, $K\leq M$, can also be obtained from (\ref{Welch_bound_for_cc}) by setting $\delta_{\max}=0$. On the other hand, if $0<\delta_{\max}\ll MN$, one can show that $K>M$, meaning that a larger set size can be supported by QCSS. Recently, a generalized Levenshtein bound (GLB) for QCSS has been derived by Liu, Guan and Mow in [\ref{LiuGuanMow14}, \textit{Theorem 1}]. The key idea behind the GLB (including the Levenshtein bound \cite{Levenshtein99}) is that the weighted mean square aperiodic correlation of any sequence subset over the complex roots of unity should be equal to or greater than that of the whole set which includes all possible complex roots-of-unity sequences. The Levenshtein bound was extended from binary sequences to complex roots-of-unity sequences by Bozta\c{s} \cite{Serdar1998}. A lower bound for aperiodic LCZ sequence sets was derived in \cite{Peng04} by an approach similar to Levenshtein's. In its bounding equation, GLB is a function of the ``simplex" weight vector $\mathbf{w}$, the set size $K$, the number of channels $M$, and the row sequence length $N$. A necessary condition (shown in [\ref{LiuGuanMow14}, \textit{Theorem 2}]) for the GLB to be tighter than the Welch bound is that $K\geq \overline{K}+1$, where \begin{equation}\label{nece_cond_QCSSBd2} \overline{{K}}\triangleq \left \lfloor 4(MN-1)N\sin^2\frac{\pi}{2(2N-1)} \right \rfloor, \end{equation} with \begin{equation}\label{nece_cond_QCSSBd2_} \lim\limits_{N\rightarrow \infty}\overline{K}=\left \lfloor \frac{\pi^2M}{4} \right \rfloor. \end{equation} Although a ``step-function" weight vector was adopted in [\ref{LiuGuanMow14}, (34)], it only leads to a tighter GLB for $K\geq3M+1$. As a matter of fact, the tightness of GLB remains unknown for \begin{displaymath} \frac{\left \lfloor \frac{\pi^2M}{4} \right \rfloor}{M}<\frac{K}{M}<3+\frac{1}{M}, \end{displaymath} when $N$ is sufficiently large. The main objective of this paper is to optimize and then tighten the GLB for \textit{all} $K\geq \overline{K}+1$ (instead of \textit{some}). For this, we are to find a (locally) optimal weight vector which is used in the bounding equation. A similar research problem was raised in \cite{Levenshtein99} for traditional binary sequences (i.e., non-QCSS with $M=1$). See \cite{LiuParaGuanBozas14} for more details. The optimization of GLB on QCSS (with $M\geq2$), however, is more challenging because an analytical solution to a non-convex GLB (in terms of weight vector $\mathbf{w}$) for \textit{all} possible cases of $(K,M)$ is in general intractable. We first adopt a frequency-domain optimization approach in Section III-B to minimize the (non-convex) fractional quadratic function of GLB. This is achieved by properly exploiting the specific structure of the circulant quadratic matrix in the numerator of the fractional quadratic term of GLB. Following this optimization approach, we find a new weight vector which leads to a tighter GLB for \textit{all} $(K,M)$ cases satisfying $K\geq \overline{K}+1$ and $M\geq2$, asymptotically (in $N$). Our finding shows that the condition of $K\geq \overline{K}+1$, shown in [\ref{LiuGuanMow14}, Theorem 2], is not only necessary but also sufficient, as $N$ tends to infinity. Moreover, in Section III-C, it is proved that the newly found weight vector is a local minimizer to the fractional quadratic function of GLB, asymptotically. We then examine in Sections IV two weight vectors which were presented in \cite{LiuParaGuanBozas14} for the tightening of the Levenshtein bound on conventional single-channel (i.e., $M=1$) sequence sets. We extend their tightening capability to GLB on multi-channel (i.e., $M\geq2$) QCSS, although the proof is not straightforward. It is shown that each of these two weight vectors gives rise to a tighter GLB (over the Welch bound) for several small values of $M$ provided that $K\geq \overline{K}+1$. It is also noted that the GLB from the newly found weight vector is (in general) tighter than the GLBs from these two (earlier found) weight vectors, as shown by some numerical results. \section{Preliminaries} In this section, we first present some necessary notations and define QCSS. Then, we give a brief review of GLB. \subsection{Introduction to QCSS} For two complex-valued sequences $\mathbf{a}=[a_0,a_1,\cdots,a_{N-1}]$ and $\mathbf{b}=[b_0,b_1,\cdots,b_{N-1}]$, their aperiodic correlation function at time-shift $\tau$ is defined as \begin{equation} \rho_{\mathbf{a},\mathbf{b}}(\tau)=\left \{ \begin{array} {c@{\quad \quad}l} \sum\limits_{t=0}^{N-1-\tau} a_{t} b^{*}_{t+\tau} , & 0{\leq}\tau{\leq}(N-1); \\ \sum\limits_{t=0}^{N-1+\tau} a_{t-\tau} b^*_{t}, & -(N-1){\leq}\tau{\leq}-1;\\ 0, & |\tau|\geq N. \end{array} \right. \end{equation} When $\mathbf{a}\neq\mathbf{b}$, $\rho_{\mathbf{a},\mathbf{b}}(\tau)$ is called the aperiodic cross-correlation function (ACCF); otherwise, it is called the aperiodic auto-correlation function (AACF). For simplicity, the AACF of $\mathbf{a}$ is denoted by $\rho_{\mathbf{a}}(\tau)$. Let $\mathcal{C}=\{\mathbf{C}^0,\mathbf{C}^1,\cdots,\mathbf{C}^{K-1}\}$ be a set of $K$ matrices, each of order $M\times N$ (where $M\geq 2$), i.e., \begin{equation}\label{matrix_form_of_CC} \begin{split} \mathbf{C}^\nu =\left [ \begin{array}{c} \mathbf{c}^\nu_0\\ \mathbf{c}^\nu_1 \\ \vdots \\ \mathbf{c}^\nu_{M-1} \end{array} \right ]_{M\times N} =\left [ \begin{matrix} c^\nu_{0,0} & c^\nu_{0,1} & \cdots & c^\nu_{0,N-1}\\ c^\nu_{1,0} & c^\nu_{1,1} & \cdots & c^\nu_{1,N-1}\\ \vdots & \vdots & \ddots & \vdots\\ c^\nu_{M-1,0} & c^\nu_{M-1,1} & \cdots & c^\nu_{M-1,N-1}\\ \end{matrix} \right ], \end{split} \end{equation} where $0\leq \nu \leq K-1$. Define the ``aperiodic correlation sum" of matrices $\mathbf{C}^\mu$ and $\mathbf{C}^\nu$ as follows, \begin{equation}\label{aperiodic_corr_CC} {\rho}_{\mathbf{C}^\mu,\mathbf{C}^\nu}(\tau)=\sum\limits_{m=0}^{M-1}\rho_{\mathbf{c}^\mu_m,\mathbf{c}^\nu_m}(\tau),~~0\leq \mu,\nu\leq K-1. \end{equation} Also, define the aperiodic auto-correlation tolerance $\delta_{a}$ and the aperiodic cross-correlation tolerance $\delta_{c}$ of $\mathcal{C}$ as \begin{displaymath} \begin{array}{l} \delta_{\text{a}}\triangleq\max \left \{\Bigl |\rho_{\mathbf{C}^\mu,\mathbf{C}^\mu}(\tau) \Bigl |:~\begin{matrix} 0<\tau\leq N-1,\\ 0\leq \mu\leq K-1. \end{matrix} \right \},\\ \delta_{\text{c}}\triangleq\max \left \{\Bigl |\rho_{\mathbf{C}^\mu,\mathbf{C}^\nu}(\tau) \Bigl |:~\begin{matrix} 0\leq \tau \leq N-1,\\ \mu\neq\nu, 0\leq \mu,\nu\leq K-1. \end{matrix} \right \}\\ \end{array} \end{displaymath} respectively. Moreover, define the aperiodic tolerance (also called the ``maximum aperiodic correlation magnitude") of $\mathcal{C}$ as $\delta_{\max}\triangleq\max\{\delta_{\text{a}},\delta_{\text{c}}\}$. When $\delta_{\max}=0$, $\mathcal{C}$ is called a \textit{perfect complementary sequence set} (PCSS); otherwise, it is called a \textit{quasi-complementary sequence set} (QCSS)\footnote{QCSS can also be defined with respect to the ``periodic correlation sums". The interested reader may refer to \cite{Liu-WCL13}.}. In particular, when $M=2$ and $K=1$, a PCSS reduces to a matrix consisting of two row sequences which have zero out-of-phase aperiodic autocorrelation sums. Such matrices are called Golay complementary matrices (GCMs) or Golay complementary pairs (GCPs) in this paper, and either sequence in a GCP is called a Golay sequence. Note that the transmission of a PCSS or a QCSS requires a multi-channel system. Specifically, every matrix in a PCSS (or a QCSS) needs $M\geq2$ non-interfering channels for the separate transmission of $M$ row sequences. This is different from the traditional single-channel sequences with $M=1$ only. \subsection{Review of GLB} Let $\mathbf{w}=[w_0,w_1,\cdots,w_{2N-2}]^{\text{T}}$ be a ``simplex" weight vector which is constrained by \begin{equation}\label{Leven_weight_vector} w_i\geq0,~~i=0,1,\cdots,2N-2, ~~\text{and} ~~ \sum\limits_{i=0}^{2N-2}w_i=1. \end{equation} Define a quadratic function \begin{equation}\label{Leven-quad-fun-equ} \begin{split} Q(\mathbf{w},a) & \triangleq\mathbf{w}^\text{T} \mathbf{Q}_{a} \mathbf{w}\\ & =a\sum\limits_{i=0}^{2N-2}w^2_i+\sum\limits_{s,t=0}^{2N-2}\tau_{s,t,N}w_s w_t, \end{split} \end{equation} where $\mathbf{Q}_{a}$ is a $(2N-1)\times(2N-1)$ circulant matrix with all of its diagonal entries equal to $a$, and its off-diagonal entries $\mathbf{Q}_{a}(s,t)=\tau_{s,t,N}$, where $s\neq t$ and \begin{equation}\label{defi_of_l} 0\leq \tau_{s,t,N}\triangleq\min\left \{|t-s|,2N-1-|t-s| \right \} \leq N-1. \end{equation} The GLB for QCSS over complex roots of unity in \cite{LiuGuanMow14} is shown below. \vspace{0.1in} \begin{lemma}\label{generalized_welch_bound_for_cc} \begin{equation}\label{generalized_welch_bound_for_cc-equ} \delta^2_{\max} \geq M \left [ N-\frac{{Q}\left(\mathbf{{w}},\frac{N(MN-1)}{K}\right)}{1-\frac{1}{K}\sum\limits_{i=0}^{2N-2}w_i^2} \right ]. \end{equation} A weaker simplified version of (\ref{generalized_welch_bound_for_cc-equ}) is given below. \begin{equation}\label{simplified_GLB} \delta^2_{\max} \geq M \left [ N-{{Q}\left(\mathbf{{w}},\frac{MN^2}{K}\right)} \right ]. \end{equation} \end{lemma} \vspace{0.1in} \begin{remark} Setting ${\mathbf{w}}=\frac{1}{2N-1}(1,1,\cdots,1)$, the GLB reduces to the Welch bound for QCSS in (\ref{Welch_bound_for_cc}). \end{remark} \vspace{0.1in} \begin{remark}\label{rmk_nece_cond} [\ref{LiuGuanMow14}, \textit{Theorem 2}] For the GLB to be tighter than the corresponding Welch bound, it is \textit{necessary} that $K\geq \overline{K}+1$, where $\overline{K}$ is defined in (\ref{nece_cond_QCSSBd2}). \end{remark} \vspace{0.1in} \begin{remark [\ref{LiuGuanMow14}, \textit{Corollary 1}] Applying the weight vector ${{\mathbf{{w}}}}$ with \begin{equation}\label{leven_LCZ_weighting_vector} {{w}}_i=\left \{ \begin{array}{cl} \frac{1}{m}, & ~~i\in \{0,1,\cdots,m-1\};\\ 0, & ~~i\in \{m,m+1,\cdots,2N-2\}; \end{array} \right . \end{equation} where $1\leq m \leq N$, to (\ref{generalized_welch_bound_for_cc-equ}), we have \begin{equation}\label{ZL_corollary_4_equ} \delta^2_{\max} \geq \max_{1\leq m\leq N} \frac{3MNKm-3M^2N^2-MK(m^2-1)}{3(mK-1)}. \end{equation} The lower bound in (\ref{ZL_corollary_4_equ}) is tighter than the Welch bound for QCSS in (\ref{Welch_bound_for_cc}) if one of the two following conditions is fulfilled: (1): $3M+1\leq K \leq 4M-1$, $M\geq2$ and \begin{equation}\label{N_range_for_K_leq_4M} N\geq \left \lfloor \frac{K-1+\sqrt{-3K^2+(12M-6)K+12M+1}}{2(K-3M)} \right \rfloor+1; \end{equation} (2): $K\geq4M$, $M\geq2$ and $N\geq2$. \end{remark} \section{Proposed Weight Vector for Tighter GLB } \subsection{Motivation} The necessary condition in \textit{Remark \ref{rmk_nece_cond}} implies that for a given $M,N$, the Welch bound for QCSS cannot be improved if $K \leq \overline{{K}}$, where $\overline{{K}}$ is defined in (\ref{nece_cond_QCSSBd2}). On the other hand, the weight vector in (\ref{leven_LCZ_weighting_vector}) can only lead to a tighter GLB for $K\geq3M+1$. Because of this, the tightness of GLB is unknown in the following ambiguous zone. \begin{equation}\label{GLBgap_} \frac{\overline{K}}{M} < \frac{K}{M} < 3+\frac{1}{M}. \end{equation} For sufficiently large $N$, the above $K/M$ zone further reduces to \begin{equation}\label{GLBgap} \frac{\left \lfloor \frac{\pi^2M}{4} \right \rfloor}{M}<\frac{K}{M} < 3+\frac{1}{M}, \end{equation} by recalling (\ref{nece_cond_QCSSBd2_}). One may visualize this zone in the shaded area of Fig. \ref{Fig_GLBgap} for $2\leq M \leq 256$. \begin{figure}[!ht] \centering \scalebox{0.55} {\includegraphics{GLBgap3.eps}} \caption{The tightness of GLB is unknown over the shaded $K/M$ zone, where $N$ is sufficiently large.} \label{Fig_GLBgap} \end{figure} We are therefore interested in finding a weight vector which is capable of optimizing and tightening the GLB for \textit{all} (rather than \textit{some}) $K\geq \overline{K}+1$. Relating this objective to Fig. \ref{Fig_GLBgap}, such a weight vector can give us a tighter GLB for the largest $K/M$ region right above the red diamond symbols. However, the optimization of GLB in (\ref{generalized_welch_bound_for_cc-equ}) is challenging because its fractional quadratic term (in terms of $\mathbf{w}$) is indefinite. More specifically, the quadratic term ${Q}\left(\mathbf{{w}},\frac{N(MN-1)}{K}\right)$ in the numerator is indefinite as some eigenvalues of the corresponding circulant matrix are negative when $K\geq \overline{K}+1$ [\ref{LiuGuanMow14}, Appendix B]. It is noted that indefinite quadratic programming (QP) is NP-hard \cite{MK1987}, even it has one negative eigenvalue only \cite{PV1991}. Moreover, checking local optimality of a feasible point in constrained QP is also NP-hard \cite{PS1998}. Although some optimality conditions for constrained QP have been derived by Bomze from the copositivity perspective \cite{Bomze1997-1,Bomze1997-2,Bomze2015}, the situation becomes more complicated when indefinite fractional quadratic programming (FQP) problems are dealt with. According to \cite{ABJ2014}, GLB may be classified as a standard FQP (StFQP) as the feasible set is the standard simplex. To the best of the authors' knowledge, Preisig pioneered an iterative algorithm for which convergence to a KKT point (but cannot be guaranteed to be a local minimizer) of the StFQP can be proved \cite{Preisig1996}. Two algorithms for StFQP based on semidefinite programming (SDP) relaxations are presented in \cite{ABJ2014}, yet the optimalities of the resultant solutions are unknown. As a matter of fact, the algorithms developed in \cite{ABJ2014,Preisig1996} may only be feasible for medium-scaled StFQP with $N\leq 200$. In contrast, we target at an analytical solution (as opposed to a numerical solution) which is applicable to large scale of GLB (e.g., the sequence length $N>1000$). Thus, the techniques used in \cite{ABJ2014,Preisig1996} may not be useful for the specific StFQP problem considered in this paper. In the sequel, we introduce a frequency-domain optimization approach which finds a local minimizer (i.e., a weight vector) of the GLB. We show that the obtained weight vector leads to a tighter GLB for \textit{all} $K\geq \overline{K}+1$ and $M\geq 2$, asymptotically. \vspace{0.1in} \subsection{GLB from Weight Vector 1} To tighten the GLB in (\ref{generalized_welch_bound_for_cc-equ}), we adopt a novel optimization approach in this subsection, motivated by the observation that any circulant matrix [e.g., $\mathbf{Q}_a$ in (\ref{Leven-quad-fun-equ}) which forms a part of the GLB quadratic function in (\ref{generalized_welch_bound_for_cc-equ})] can be decomposed in the frequency domain. Define $\xi_L=\exp\left ( {-\sqrt{-1}2\pi}/{L} \right )$ and the $L$-point discrete Fourier transform (DFT) matrix as \begin{equation} \mathbf{F}_{L}=[f_{m,n}]_{m,n=0}^{L-1},~\text{where}~f_{m,n}=\xi^{mn}_L. \end{equation} Denote by $\mathbf{q}$ the first column vector of $\mathbf{Q}_{a}$ in (\ref{Leven-quad-fun-equ}), i.e., \begin{equation} \mathbf{q}=[a,1,2,\cdots,N-1,N-1,\cdots,2,1]^{\text{T}}. \end{equation} Let \begin{equation} \mathbf{v} =\mathbf{F}_{2N-1}\mathbf{w}=[v_0,v_1,\cdots,v_{2N-2}]^{\text{T}}. \end{equation} It is noted that $v_0=\sum_{i=0}^{2N-2}w_i=1$. By \cite{Gray-book}, the circulant matrix $\mathbf{Q}_a$ defined in (\ref{Leven-quad-fun-equ}) can be expressed as \begin{equation}\label{Qa_in_FreqDomain} \mathbf{Q}_a = \frac{1}{2N-1} \mathbf{F}^{\text{H}}_{2N-1}\text{diag}({\text{\mbox{\boldmath{$\lambda$}}}}) \mathbf{F}_{2N-1}, \end{equation} where \begin{equation} {\text{\mbox{\boldmath{$\lambda$}}}} =\mathbf{F}_{2N-1}\mathbf{q}=[\lambda_0,\lambda_1,\cdots,\lambda_{2N-2}]^{\text{T}}, \end{equation} and $\text{diag}({\text{\mbox{\boldmath{$\lambda$}}}})$ is the matrix with ${\text{\mbox{\boldmath{$\lambda$}}}}$ being the diagonal vector and zero for all the non-diagonal matrix entries. Consequently [\ref{NYY2014}, Theorem 3.1], \begin{equation}\label{GLB_quadra_fd} Q(\mathbf{w},a) = \frac{1}{2N-1} \sum\limits_{l=0}^{2N-2}\lambda_l \left | v_l\right |^2. \end{equation} Similarly, \begin{equation}\label{GLB_quadra_fd_} \sum\limits_{i=0}^{2N-2}w^2_i = \frac{1}{2N-1} \sum\limits_{l=0}^{2N-2}\left | v_l\right |^2. \end{equation} By [\ref{LiuGuanMow14}, Appendix B], we have \begin{equation} \lambda_0=a+(N-1)N, \end{equation} and \begin{equation}\label{lambda_i_equ} \lambda_l=a-\frac{1-(-1)^l \cos{\frac{\pi l}{2N-1}}}{2\sin^2{\frac{\pi l}{2N-1}}}, \end{equation} for $l=1,\cdots,2N-2$. Note that $\lambda_l=\lambda_{2N-1-l}$ for $l\in \{1,2,\cdots,N-1\}$. Moreover, we remark that \begin{equation}\label{lambda_l1_equ} \lambda_l>\lambda_1,~~\text{for}~2\leq l \leq N-1. \end{equation} This is because \begin{enumerate} \item if $l$ is odd: \begin{equation} \lambda_l-\lambda_1=\frac{\sin^2{\frac{\pi l}{2(2N-1)}}-\sin^2{\frac{\pi}{2(2N-1)}}}{4\sin^2{\frac{\pi}{2(2N-1)}}\sin^2{\frac{\pi l}{2(2N-1)}}}>0. \end{equation} \item if $l$ is even: \end{enumerate} \begin{equation} \lambda_l-\lambda_1=\frac{\cos \frac{\pi l}{2N-1}+\cos \frac{\pi}{2N-1}}{8\sin^2{\frac{\pi}{2(2N-1)}}\cos^2{\frac{\pi l}{2(2N-1)}}}>0. \end{equation} To maximize the GLB in (\ref{generalized_welch_bound_for_cc-equ}), it is equivalent to consider the following optimization problem. \vspace{0.1in} \begin{problem} \begin{equation}\label{opti_freqd} \begin{split} & \min_{\mathbf{v}}\frac{\lambda_0 + \sum\limits_{l=1}^{2N-2}\lambda_l |v_l|^2}{2N-1-\frac{1}{K}-\frac{1}{K}\sum\limits_{l=1}^{2N-2}|v_l|^2},\\ & ~~\text{subject to}~\mathbf{w} =\frac{1}{2N-1}\mathbf{F}^{\text{H}}_{2N-1}\mathbf{v}\geq 0. \end{split} \end{equation} \end{problem} \vspace{0.1in} Since $\mathbf{w}$ is real-valued, $\mathbf{v}$ is conjugate symmetric, i.e., $v_l=v^*_{2N-1-l}$ for $l=1,2,\cdots,2N-2$. Having this in mind, we define \begin{equation} r^2= \sum_{l=1}^{N-1}|v_l|^2=\sum_{l=N}^{2N-2}|v_l|^2. \end{equation} Taking advantage of the fact that $\lambda_1=\lambda_{2N-2}$ are strictly smaller than other $\lambda_l$'s with nonzero $l$ as shown in (\ref{lambda_l1_equ}), we have \begin{equation}\label{opti_freqd_ineq} \sum\limits_{l=1}^{2N-2}\lambda_l |v_l|^2=2\lambda_1 r^2+\sum\limits_{l=2}^{2N-3}(\lambda_l-\lambda_1) |v_l|^2\geq 2\lambda_1 r^2, \end{equation} where the equality is achieved if and only if $v_l=0$ for $l=2,3,\cdots,2N-3$. Inspired by this observation, we relax the non-negativity constraint on $\mathbf{w}$, i.e., some negative $w_i$'s may be allowed (but the sum of all elements of $\mathbf{w}$ must still be equal to 1). With this, the optimization problem in (\ref{opti_freqd}) can be translated to \begin{equation}\label{opti_freqd_trans} \begin{split} & \min_{r} \min_{\sum_{l=1}^{2N-2}|v_l|^2=2r^2} \frac{\lambda_0 + \sum\limits_{l=1}^{2N-2}\lambda_l |v_l|^2}{2N-1-\frac{1+2r^2}{K}},\\ = & \min_{r} \frac{\lambda_0 + 2 \lambda_1 r^2}{2N-1-\frac{1}{K}-\frac{2r^2}{K}}, \end{split} \end{equation} where \begin{equation}\label{lambdas} \begin{split} \lambda_0 & = \frac{N(MN-1)}{K}+N(N-1),\\ \lambda_1 & = \frac{N(MN-1)}{K}-\frac{1}{4\sin^2 \frac{\pi}{2(2N-1)}}. \end{split} \end{equation} From now on, we adopt the setting of \begin{displaymath} \begin{split} v_1 & =v^*_{2N-2}=r\exp\left (\sqrt{-1}\theta \right ),\\ v_l & =0,~\text{for}~l=2,3,\cdots,2N-3, \end{split} \end{displaymath} where $r,\theta$ denote the magnitude and phase of $v_1$, respectively. Since $\mathbf{w} =\frac{1}{2N-1}\mathbf{F}^{\text{H}}_{2N-1}\mathbf{v}$, we have \begin{equation}\label{wtvec3_equ} \begin{split} \mathbf{w}&=\frac{1}{2N-1}\left [1+2r\cos \theta, 1+2r\cos \left (\theta+\frac{2\pi}{2N-1}\right ) \right.,\\ & ~~~~~~~~~~~~~~~~~~~~~~~~\left. \cdots,1+2r\cos \left (\theta+\frac{2\pi(2N-2)}{2N-1} \right ) \right ]^{\text{T}}. \end{split} \end{equation} To optimize the fractional function in (\ref{opti_freqd_trans}), we have the following lemma. \vspace{0.1in} \begin{lemma}\label{lem_monofun} The fractional function $\frac{\lambda_0 + 2 \lambda_1 r^2}{2N-1-\frac{1}{K}-\frac{2r^2}{K}}$ in terms of $r^2$ in (\ref{opti_freqd_trans}) is \begin{enumerate} \item[] Case 1: monotonically decreasing in $r^2$ if $K\geq\overline{K}+1$ and $\frac{\lambda_0}{|\lambda_1|}<(2N-1)K-1$; \item[] Case 2: monotonically increasing in $r^2$ if $K\leq \overline{K}$, or $K\geq \overline{K}+1$ and $\frac{\lambda_0}{|\lambda_1|}\geq (2N-1)K-1$. \end{enumerate} \end{lemma} \vspace{0.1in} \begin{proof} To prove Case 1, we first show that $\lambda_1<0$ if and only if \begin{displaymath} K\geq \overline{K}+1=\left \lfloor 4(MN-1)N\sin^2\frac{\pi}{2(2N-1)} \right \rfloor+1, \end{displaymath} where $\overline{K}$ is defined in (\ref{nece_cond_QCSSBd2}). For ease of analysis, we write \begin{equation}\label{K_split_equ} 4(MN-1)N\sin^2\frac{\pi}{2(2N-1)}=n+\epsilon, \end{equation} where $n$ is a positive integer and $0\leq \epsilon<1$. Thus, $\overline{K}+1=n+1$. Consequently, we have \begin{equation} \begin{split} \lambda_1 & = a-\frac{1}{4\sin^2 \frac{\pi}{2(2N-1)}}\\ & = \frac{N(MN-1)}{K}-\frac{1}{4\sin^2 \frac{\pi}{2(2N-1)}}\\ & =\frac{N(MN-1)}{K} \left [1- \frac{K}{4N(MN-1)\sin^2 \frac{\pi}{2(2N-1)}} \right]\\ & \leq \frac{N(MN-1)}{K} \left ( 1- \frac{n+1}{n+\epsilon} \right )\\ & <0, \end{split} \end{equation} with which the proof of Case 1 follows. The proof of Case 2 can be easily obtained by following a similar argument. \end{proof} \vspace{0.1in} For Case 2 of \textit{Lemma \ref{lem_monofun}}, it can be readily shown that the minimum of the fractional function $\frac{\lambda_0 + 2 \lambda_1 r^2}{2N-1-\frac{1}{K}-\frac{2r^2}{K}}$ in (\ref{opti_freqd_trans}) is achieved at $r=0$. Thus, the weight vector in (\ref{wtvec3_equ}) reduces to \begin{equation}\label{wtvec3_equ2} \begin{split} \mathbf{w}&=\frac{1}{2N-1}\cdot \left [1, 1,\cdots,1 \right ]^{\text{T}}, \end{split} \end{equation} where the corresponding GLB reduces to the Welch bound in (\ref{Welch_bound_for_cc}). Next, let us focus on the application of Case 1 for GLB tightening. In this case, we wish to know the upper bound of $r^2$ in order to minimize the fractional function of $r^2$ in (\ref{opti_freqd_trans}). Coming back to the constraint of $\mathbf{w}$ given in (\ref{Leven_weight_vector}), $r$ and $\theta$ should satisfy \begin{equation} 1+2r\min_{i=0,1,\cdots,2N-2}\cos \left (\theta+\frac{2\pi i}{2N-1}\right )\geq 0. \end{equation} Thus, \begin{equation} 0\leq r\leq \max\limits_{\theta}\frac{-1}{\min\limits_{i=0,1,\cdots,2N-2}\cos \left (\theta+\frac{2\pi i}{2N-1}\right )}=\frac{1}{2\cos\left ( \frac{\pi}{2N-1}\right )}, \end{equation} where the upper bound is achieved with equality when $\theta=\frac{2\pi j}{2N-1}$ for any integer $j$. By substituting $r=\frac{1}{2\cos\left ( \frac{\pi}{2N-1}\right )}$ into (\ref{wtvec3_equ}), we obtain the following weight vector. \begin{equation}\label{wgtvec3_equ} w_i=\frac{1}{2N-1}\left ( 1+\frac{\cos \frac{2\pi(i+j)}{2N-1}}{\cos \frac{\pi}{2N-1}}\right ), \end{equation} where $i=0,1,\cdots,2N-2$ and $j$ is any integer. The resultant GLB from this weight vector is shown in the following lemma. \vspace{0.1in} \begin{lemma}\label{coro_GLB_from_wetvec3} For $K\geq\overline{K}+1$ and $\frac{\lambda_0}{|\lambda_1|}<(2N-1)K-1$, we have \begin{equation}\label{coro_GLB_from_wetvec3-equ} \delta^2_{\max}\geq M \left [N- \frac{K \left (\lambda_0-\frac{|\lambda_1|}{2\cos^2 \frac{\pi}{2N-1}} \right )}{(2N-1)K-1-\frac{1}{2\cos^2 \frac{\pi}{2N-1}}}\right ], \end{equation} where $\lambda_0,\lambda_1$ are given in (\ref{lambdas}). \end{lemma} \vspace{0.1in} To analyze the asymptotic tightness of the lower bound in (\ref{coro_GLB_from_wetvec3-equ}), we note that when $N$ is sufficiently large, the second condition in \textit{Lemma \ref{coro_GLB_from_wetvec3}}, i.e., \begin{equation}\label{cond_Case1} \frac{\lambda_0}{|\lambda_1|}<(2N-1)K-1, \end{equation} is true for $K\geq \overline{K}+1$. To show this, we substitute $\lambda_0,\lambda_1$ into (\ref{cond_Case1}). After some manipulations, one can see that the inequality in (\ref{cond_Case1}) holds if and only if \begin{equation}\label{cond_Case1_2} \begin{split} K> & 4(MN-1)N\sin^2\frac{\pi}{2(2N-1)}\\ & +\frac{4N(N-1)\sin^2 \frac{\pi}{2(2N-1)}+1}{2N-1}. \end{split} \end{equation} Carrying on the expression in (\ref{K_split_equ}), we require \begin{equation}\label{cond_Case1_3} K-n\geq 1>\epsilon+\frac{4N(N-1)\sin^2 \frac{\pi}{2(2N-1)}+1}{2N-1}, \end{equation} which is guaranteed to hold for sufficiently large $N$ because $\epsilon$ is strictly smaller than 1 by assumption. Furthermore, we note that \begin{equation} \begin{split} \lim\limits_{N \rightarrow\infty}\frac{K\lambda_0}{N} & = (K+M)N,\\ \lim\limits_{N \rightarrow\infty}\frac{K|\lambda_1|}{2N\cos^2 \frac{\pi}{2N-1}} & = \left ( \frac{2K}{\pi^2} -\frac{M}{2}\right )N. \end{split} \end{equation} Therefore, \begin{equation} \lim\limits_{N \rightarrow\infty}\frac{K \left (\lambda_0-\frac{|\lambda_1|}{2\cos^2 \frac{\pi}{2N-1}} \right )}{N\cdot \left[ (2N-1)K-1-\frac{1}{2\cos^2 \frac{\pi}{2N-1}}\right ]}=\frac{3M}{4K}+\frac{1}{2}-\frac{1}{\pi^2}. \end{equation} On the other hand, let us rewrite the Welch bound expression (\ref{Welch_bound_for_cc}) as \begin{equation}\label{decomposed-welch-bound} M^2N^2\frac{\frac{K}{M}-1}{K(2N-1)-1} = M \left ( N- \mathcal{R}_1 \right ) \end{equation} with \begin{equation}\label{R1} \mathcal{R}_1 \triangleq \frac{N(MN-1)+N(N-1)K}{(2N-1)K-1}. \end{equation} Then, \begin{equation}\label{ch4_R1_largeN} \lim\limits_{N\rightarrow \infty}\frac{\mathcal{R}_1}{N}=\frac{1}{2}+\frac{M}{2K}. \end{equation} With (\ref{R1}) and (\ref{ch4_R1_largeN}), one can show that the lower bound in \textit{Lemma \ref{coro_GLB_from_wetvec3}} is asymptotically tighter than the Welch bound in (\ref{Welch_bound_for_cc}) if and only if the following equation is satisfied. \begin{equation}\label{asym_bd_wtvec3} \frac{1}{2}+\frac{M}{2K}>\frac{3M}{4K}+\frac{1}{2}-\frac{1}{\pi^2}. \end{equation} Equivalently, we need to prove that for $K=\left \lfloor \frac{\pi^2M}{4}\right \rfloor+1$ (as $N \rightarrow\infty$), the following inequality holds. \begin{equation}\label{BdfromOptWtVec2} d_1(M)\triangleq \frac{\left \lfloor \frac{\pi^2M}{4}\right \rfloor+1}{M}- \frac{\pi^2}{4} > 0. \end{equation} One can readily show that the condition $d_1(M)>0$ given in (\ref{BdfromOptWtVec2}) is true for \textit{all} $M\geq 2$. Therefore, we have the following theorem. \vspace{0.1in} \begin{theorem}\label{th4OptWtVec} The GLB in (\ref{coro_GLB_from_wetvec3-equ}) which arises from the weight vector in (\ref{wgtvec3_equ}) reduces to \begin{equation}\label{aym_lwrbd_wec3_equ} \delta^2_{\max} \gtrsim MN\left [ \left ( \frac{1}{2}+\frac{1}{\pi^2}\right ) -\frac{3M}{4K}\right ], \end{equation} for sufficiently large $N$. Such an asymptotic lower bound is tighter than the Welch bound for \textit{all} $K\geq \overline{K}+1$ and for \textit{all} $M\geq 2$. \end{theorem} \subsection{Proof of Local Optimality} In this subsection, we prove the proposed weight vector in (\ref{wgtvec3_equ}) is a local minimizer of the GLB in (\ref{generalized_welch_bound_for_cc-equ}) under certain condition. We consider the weight vector $\mathbf{w}$ by setting $j=0$ in (\ref{wgtvec3_equ}) because other values of $j$ will lead to identical value of GLB [cf. (\ref{GLB_quadra_fd}) and (\ref{GLB_quadra_fd_})]. \begin{equation}\label{proposed_wgtvec} w_i=\frac{1}{2N-1}\left ( 1+\frac{\cos \frac{2\pi i}{2N-1}}{\cos \frac{\pi}{2N-1}}\right ),~i\in\{0,1,\cdots,2N-2\}. \end{equation} Note that the frequency domain vector $\mathbf{v}=\mathbf{F}_{2N-1}\mathbf{w}$ has $v_0=1, v_1=v_{2N-2}=\frac{1}{2\cos \frac{\pi}{2N-1}}$ and $v_l=0$ for all $l\in\{2,3,,\cdots,2N-3\}$. Our problem in this subsection can be formally cast as follows. \vspace{0.1in} \begin{problem} Define the fractional quadratic function $f(\mathbf{x})$\footnote{Note that $f(\mathbf{x})$ is essentially the fractional quadratic term in (\ref{generalized_welch_bound_for_cc-equ}) by replacing $\mathbf{w}$ with $\mathbf{x}$.} as follows. \begin{equation}\label{FQP_defi} f(\mathbf{x})\triangleq\frac{\mathbf{x}^{\text{T}}\mathbf{Q}_a\mathbf{x}}{1-\frac{1}{K}\cdot \mathbf{x}^{\text{T}}\mathbf{x}},\\ \end{equation} where $x_i\geq0, i\in\{0,1,\cdots,2N-2\},\sum _{i=0}^{2N-2}x_i=1$, $\mathbf{Q}_a$ is the circulant matrix defined in (\ref{Leven-quad-fun-equ}) which has order $(2N-1)$ and with $a=(MN-1)N/K$. When $K=\overline{K}+1$ and $M,N$ becomes sufficiently large, prove that the weight vector $\mathbf{w}$ in (\ref{proposed_wgtvec}) is a local minimizer of $f(\mathbf{x})$, i.e., \begin{equation}\label{local_mini_equ} f(\mathbf{w}+\mathbf{e})\geq f(\mathbf{w}), \end{equation} holds for any feasible perturbation $\mathbf{e}$ which has sufficiently small norm. \end{problem} \begin{proof} To get started, we define \begin{equation} \begin{split} \alpha(\mathbf{w},\mathbf{e}) & \triangleq \mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{w}\mathbf{e}^{\text{T}}\mathbf{e}-\mathbf{w}^{\text{T}}\mathbf{w}\mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e},\\ \beta(\mathbf{w},\mathbf{e}) & \triangleq \mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{w}\mathbf{e}^{\text{T}}\mathbf{w}-\mathbf{w}^{\text{T}}\mathbf{w}\mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{e},\\ \gamma(\mathbf{w},\mathbf{e}) & \triangleq \frac{\alpha(\mathbf{w},\mathbf{e})+2\beta(\mathbf{w},\mathbf{e})}{K}. \end{split} \end{equation} It is easy to show that (\ref{local_mini_equ}) is equivalent to the following inequality. \begin{equation}\label{local_mini_equ2} 2\mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\gamma(\mathbf{w},\mathbf{e})\geq 0. \end{equation} Let $\mathbf{E}=\mathbf{F}_{2N-1}\mathbf{e}$. Since $\mathbf{e}$ is a real vector, $\mathbf{E}$ is conjugate symmetric in that $E_l=E^*_{2N-1-l}$ for $l=1,2,\cdots,2N-2$. By taking advantage of (\ref{Qa_in_FreqDomain}), we present the following properties which will be useful in the sequel. \begin{subequations} \begin{align} & E_0=\sum\limits_{i=0}^{2N-2}e_i=0;\label{multi_equ1}\\ & \mathbf{w}+\mathbf{e}\geq 0;\label{multi_equ2}\\ & \mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{e}=\lambda_1 \cdot \frac{E_1+E^*_1}{2(2N-1)\cos \frac{\pi}{2N-1}};\label{multi_equ3}\\ & \mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e}=\frac{2}{2N-1}\cdot \sum\limits_{i=1}^{N-1}\lambda_i |E_i|^2; \label{multi_equ4}\\ & \mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{w}=\frac{1}{2N-1}\left ( \lambda_0+\frac{\lambda_1}{2\cos^2\frac{\pi}{2N-1}}\right );\label{multi_equ5}\\ & \mathbf{e}^{\text{T}}\mathbf{w}=\frac{E_1+E^*_1}{2(2N-1)\cos \frac{\pi}{2N-1}};\label{multi_equ6}\\ & \mathbf{w}^{\text{T}}\mathbf{w}=\frac{1}{2N-1}\left ( 1+\frac{1}{2\cos^2\frac{\pi}{2N-1}}\right );\label{multi_equ7}\\ & \mathbf{e}^{\text{T}}\mathbf{e}=\frac{2}{2N-1}\sum\limits_{i=1}^{N-1}|E_i|^2\label{multi_equ8}. \end{align} \end{subequations} By (\ref{multi_equ4}), (\ref{multi_equ5}), (\ref{multi_equ7}) and (\ref{multi_equ8}), we have \begin{equation} \begin{split} \alpha(\mathbf{w},\mathbf{e})& =\frac{2}{(2N-1)^2}\cdot \Bigl \{ (\lambda_0-\lambda_1)|E_1|^2 \\ & \left. + \sum\limits_{i=2}^{N-1} \left [ (\lambda_0-\lambda_1) + \frac{\lambda_1-\lambda_i}{2\cos^2 \frac{\pi}{2N-1}} \right ] |E_i|^2\right \}. \end{split} \end{equation} By (\ref{multi_equ3}), (\ref{multi_equ5}), (\ref{multi_equ6}) and (\ref{multi_equ7}), we have \begin{equation} \beta(\mathbf{w},\mathbf{e})=\frac{\lambda_0-\lambda_1}{2(2N-1)^2}\cdot \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}. \end{equation} Therefore, $\gamma(\mathbf{w},\mathbf{e})$ can be expressed in the form shown in (\ref{gamma_equ}). \begin{figure*} \begin{equation}\label{gamma_equ} \begin{split} \gamma(\mathbf{w},\mathbf{e}) & = \frac{\lambda_1}{K(2N-1)^2} \cdot \left \{ \sum\limits_{i=2}^{N-1}\frac{|E_i|^2}{\cos^2 \frac{\pi}{2N-1}}-2|E_1|^2-\frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}\right \}\\ & ~+\frac{1}{K(2N-1)^2} \cdot \left \{ 2\lambda_0 |E_1|^2+ \sum\limits_{i=2}^{N-1}\left ( \lambda_0-\lambda_i-\frac{\lambda_i}{\cos^2\frac{\pi}{2N-1}}\right ) |E_i|^2+\lambda_0 \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}\right \}. \end{split} \end{equation} \end{figure*} Since $\mathbf{e}$ is a small perturbation, let us assume \begin{equation}\label{rho_defi_equ} 0\leq 2\sum\limits_{i=1}^{N-1}|E_i|^2\ll 1. \end{equation} Next, we proceed with the following two cases. \begin{enumerate} \item Case I: If there exists $E_i\neq 0$ for $i\in\{2,3,\cdots,N-1\}$. Since we consider $K=\overline{K}+1$ with sufficiently large $M,N$, it is readily to show that $\lambda_i>0$ holds for any $i\in\{2,3,\cdots,N-1\}$ [see (\ref{lambda_even_equ}) and (\ref{lambda_odd_equ})]. By (\ref{multi_equ4}), let us write \begin{equation} \mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e}(2N-1)=2\lambda_1 |E_1|^2+\xi, \end{equation} where $\xi=2\sum\limits_{i=2}^{N-1}\lambda_i |E_i|^2>0$. Furthermore, write \begin{equation}\label{local_mini_equ3} \Bigl[ 2\mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\gamma(\mathbf{w},\mathbf{e}) \Bigl ]\cdot (2N-1)=\lambda_1 A+B, \end{equation} where \begin{equation}\label{AB_equ} \begin{split} A = & 2\left ( 1-\frac{1}{K(2N-1)}\right )|E_1|^2\\ & ~~~+ \left ( 1-\frac{1}{K(2N-1)}\right )\cdot\frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}\\ & ~~~+\frac{1}{K(2N-1)} \sum\limits_{i=2}^{N-1}\frac{|E_i|^2}{\cos^2 \frac{\pi}{2N-1}},\\ B = & \xi + \frac{1}{K(2N-1)} \cdot 2\lambda_0 |E_1|^2\\ & +\frac{1}{K(2N-1)} \cdot \sum\limits_{i=2}^{N-1}\left ( \lambda_0-\lambda_i-\frac{\lambda_i}{\cos^2\frac{\pi}{2N-1}}\right ) |E_i|^2\\ &+\frac{1}{K(2N-1)} \cdot \lambda_0 \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}. \end{split} \end{equation} \vspace{0.1in} \begin{remark}\label{rmk_on_AB} Since $K=\left \lfloor 4(MN-1)N\sin^2 \frac{\pi}{2(2N-1)} \right \rfloor+1$, $A$ and $B$ approach to \\$\left (2|E_1|^2+E_1+E^*_1 \right)$ and $\xi$, respectively, as $M$ grows sufficiently large. \end{remark} \vspace{0.1in} To show (\ref{local_mini_equ}) [and (\ref{local_mini_equ2})] holds, we only need to prove the right-hand term of (\ref{local_mini_equ3}) divided by $a$ is nonnegative, asymptotically. For this, our idea is to consider a fixed $N$ (sufficiently large) and prove that: (1) $\lim\limits_{M\rightarrow + \infty} \frac{B}{a}$ is lower bounded by a nonnegative value determined by $N$ only; (2) $\lim\limits_{M\rightarrow + \infty}\frac{\lambda_1}{a}$ tends to zero (with an upper bounded $\lim\limits_{M\rightarrow + \infty}A$) regardless the value of $N$. From (\ref{lambda_i_equ}), we have \begin{equation} \frac{\lambda_{2i}}{a}=1-\frac{1}{4a\cos^2 \frac{\pi(2i)}{2(2N-1)}},~2\leq 2i \leq N-1. \end{equation} For ease of analysis, let $N$ be an even integer\footnote{When $N$ is odd, we can prove (\ref{local_mini_equ}) [and (\ref{local_mini_equ2})] holds by almost the same arguments.}. Hence, $\max\limits_{2\leq 2i \leq N-1}(2i)=N-2$. Since $\frac{\lambda_{2i}}{a}$ is a decreasing function of $i$, we have \begin{equation}\label{lambda_even_equ} \frac{\lambda_{2i}}{a}\geq 1-\frac{1}{4a\cos^2 \frac{\pi(N-2)}{2(2N-1)}}>2/3. \end{equation} Also, \begin{equation \frac{\lambda_{2i+1}}{a}=1-\frac{1}{4a\sin^2 \frac{\pi(2i+1)}{2(2N-1)}}\geq 1- \frac{1}{4a \sin^2 \frac{3\pi}{2(2N-1)}}, \end{equation} where $2\leq 2i+1\leq N-1.$ By noting $\sin 3x > 2\sin x$ ($x$ a small positive angle) and $K=\overline{K}+1$, we have \begin{equation}\label{lambda_odd_equ} \begin{split} \frac{\lambda_{2i+1}}{a} & > 1-\frac{1}{4}\cdot \frac{\left \lfloor 4(MN-1)N\sin^2 \frac{\pi}{2(2N-1)} \right \rfloor+1}{4(MN-1)N\sin^2 \frac{\pi}{2(2N-1)}}\\ & > 1-\frac{1}{4}\cdot\frac{4}{3}=\frac{2}{3}. \end{split} \end{equation} By (\ref{lambda_even_equ}) and (\ref{lambda_odd_equ}), we obtain \begin{equation}\label{lim_xi_a_equ} \lim\limits_{M\rightarrow + \infty} \frac{B}{a}=\frac{\xi}{a}=\sum\limits_{i=2}^{N-1}\left (\frac{\lambda_i}{a} \right ) \cdot 2|E_i|^2 \geq \frac{2}{3}\cdot \left ( 2\sum\limits_{i=2}^{N-1}|E_i|^2 \right ) \end{equation} On the other hand, \begin{equation}\label{lambda1_equ} \begin{split} & \lim\limits_{M\rightarrow+\infty}\frac{\lambda_1}{a} \\ = & \lim\limits_{M\rightarrow+\infty}\left [1-\frac{\left \lfloor 4(MN-1)N\sin^2 \frac{\pi}{2(2N-1)} \right \rfloor+1}{4N(MN-1)\sin^2 \frac{\pi}{2(2N-1)}} \right ]\\ \rightarrow & ~ 0^{-}, \end{split} \end{equation} where $0^{-}$ denotes a sufficiently small value (negative) that approaches zero from the left. Therefore, we have \begin{equation}\label{lim_gep_equ} \begin{split} & \lim\limits_{M\rightarrow +\infty}\frac{\Bigl[ 2\mathbf{w}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\mathbf{e}^{\text{T}}\mathbf{Q}_a\mathbf{e}+\gamma(\mathbf{w},\mathbf{e}) \Bigl ]\cdot (2N-1)}{a}\\ = & {\lim\limits_{M\rightarrow+\infty}\frac{\lambda_1}{a}} \cdot \underbrace{\lim\limits_{M\rightarrow+\infty}A}_{\text{upper bounded}} + {\lim\limits_{M\rightarrow+\infty}\frac{B}{a} \end{split} \end{equation} By (\ref{lim_xi_a_equ}) and (\ref{lambda1_equ}), we assert that when $M$ is sufficiently large, the sign of the limit in (\ref{lim_gep_equ}) will be identical to that of $\xi/a$ [cf. (\ref{lim_xi_a_equ})] which is nonnegative. This shows that (\ref{local_mini_equ}) [and (\ref{local_mini_equ2})] holds for Case I, asymptotically. \vspace{0.1in} \item Case II: If $E_i=0$ for all $i\in\{2,3,\cdots,N-1\}$. In this case, (\ref{AB_equ}) reduces to \begin{equation}\label{AB_equ2} \begin{split} A = & 2\left ( 1-\frac{1}{K(2N-1)}\right )|E_1|^2\\ & + \left ( 1-\frac{1}{K(2N-1)}\right )\frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}},\\ B = & \frac{\lambda_0}{K(2N-1)} \cdot \left \{ 2 |E_1|^2+ \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}}\right \}. \end{split} \end{equation} Since $\mathbf{E}=\mathbf{F}_{2N-1}\mathbf{e}$, we have \begin{equation} e_i=\frac{2}{2N-1}\text{Re}\left \{E_1\exp\left ( \frac{\sqrt{-1}2\pi i }{2N-1}\right ) \right \}, \end{equation} where $\text{Re}\{x\}$ denotes the real part of complex data $x$. Consider $E_1$ which takes the following form. \begin{equation}\label{Ei_equ} E_1=\frac{t}{2\cos \frac{\pi}{2N-1}}\exp\left ( \sqrt{-1}\psi\right ), \end{equation} where $0\leq t\ll 1$ and $\psi$ denotes the phase shift of $E_1$. As a result, $e_i$ can be expressed as \begin{equation} e_i=\frac{t}{(2N-1)\cos \frac{\pi}{2N-1}} \cdot \cos\left ( \frac{2\pi i}{2N-1}+\psi\right ). \end{equation} Thus, \begin{equation}\label{lambda1AB_CaseII} \begin{split} & \lambda_1 A+B\\ = & \left ( 2 |E_1|^2+ \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}} \right ) \cdot \left ( \lambda_1 + \frac{\lambda_0-\lambda_1}{K(2N-1)}\right ). \end{split} \end{equation} Since $\lambda_1\thicksim O(N^2),\frac{\lambda_0-\lambda_1}{K(2N-1)}\thicksim O(\frac{N}{K})\thicksim O(\frac{N}{M})$, we assert that for sufficiently large $M,N$, \begin{equation}\label{lambda1AB_CaseII_2} \lambda_1+\frac{\lambda_0-\lambda_1}{K(2N-1)}<0, \end{equation} holds because it will be dominated by the negative $\lambda_1$. Our next task is to show that $\left ( 2 |E_1|^2+ \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}} \right )\leq 0$. By (\ref{Ei_equ}), we have \begin{equation}\label{lambda1AB_CaseII_3} 2 |E_1|^2+ \frac{E_1+E^*_1}{\cos \frac{\pi}{2N-1}} =\frac{1}{2\cos^2\frac{\pi}{2N-1}}(t^2+2t\cos \psi). \end{equation} It is required in (\ref{multi_equ2}) that $w_i+e_i\geq 0$ for all $i$, i.e., \begin{equation} \cos \frac{\pi}{2N-1} + \cos \frac{2 \pi i}{2N-1} + t \cos \left ( \frac{2\pi i}{2N-1} +\psi\right )\geq 0. \end{equation} Setting $i=N$, we have \begin{equation} \begin{split} & \cos \left ( \frac{2\pi N}{2N-1} +\psi\right )\geq 0 \\ \rightarrow & \left ( \frac{1}{2}-\frac{1}{2N-1}\right )\pi \leq \psi \leq \left ( \frac{3}{2}-\frac{1}{2N-1}\right ). \end{split} \end{equation} Setting $i=N$, we have \begin{equation} \begin{split} & \cos \left ( \frac{2\pi (N-1)}{2N-1} +\psi\right )\geq 0 \\ \rightarrow & \left ( \frac{1}{2}+\frac{1}{2N-1}\right )\pi \leq \psi \leq \left ( \frac{3}{2}+\frac{1}{2N-1}\right ). \end{split} \end{equation} Therefore, \begin{equation} \begin{split} & \left ( \frac{1}{2}+\frac{1}{2N-1}\right )\pi \leq \psi \leq \left ( \frac{3}{2}-\frac{1}{2N-1}\right ) \\ \rightarrow & -1\leq \cos \psi <0. \end{split} \end{equation} This shows $t^2+2t \cos \psi\leq 0$ holds provided $t\leq -2\cos \psi$. This can be easily satisfied by a sufficiently small $t$. Together with (\ref{lambda1AB_CaseII})-(\ref{lambda1AB_CaseII_3}), we conclude that (\ref{local_mini_equ}) [and (\ref{local_mini_equ2})] holds for Case II, asymptotically. This completes the proof of the local optimality of the proposed weight vector in (\ref{proposed_wgtvec}). \end{enumerate} \end{proof} \begin{remark} Following a proof similar to the above, one can easily show that the weight vector $\mathbf{w}$ in (\ref{proposed_wgtvec}) is also a local minimizer of the constrained QP of $\min\limits_{\mathbf{w}} {Q}\left(\mathbf{{w}},\frac{N(MN-1)}{K}\right)$ when $K=\overline{K}+1$ and $M,N$ are sufficiently large. \end{remark} \section{Discussions and Comparisons} In this section, we first consider another two weight vectors and study the tightness of their resultant GLBs. Then, we compare them with the proposed weight vector in (\ref{wgtvec3_equ}) by some numerical results. \subsection{GLB from Weight Vector 2} In \cite{LiuParaGuanBozas14}, Liu \emph{et al} showed that the following ``positive-cycle-of-sine" weight vector $\mathbf{w}$ \begin{equation}\label{sine_shape_weight_vector} {w}_i=\left \{ \begin{array}{ll} \tan \frac{\pi}{2m} \sin \frac{\pi i}{m}, & ~~i\in \{0,1,\cdots,m-1\};\\ 0, & ~~i\in \{m,m+1,\cdots,2N-2\}, \end{array} \right . \end{equation} where $2\leq m \leq 2N-1$, asymptotically leads to a tighter Levenshtein bound (i.e., $M=1$) for all $K\geq3$ \cite{Levenshtein99}. \vspace{0.1in} By [\ref{LiuParaGuanBozas14}, \textit{Proposition 1}], one can show that the resultant GLB from the weight vector in (\ref{sine_shape_weight_vector}) can be written as follows. \begin{corollary}\label{new_LwerBd_from_new_wv} \begin{equation}\label{ZL-corollary-new-weight-vector-equ} \delta^2_{\max}\geq M \left [ N-\frac{N(MN-1)m\tan^2\frac{\pi}{2m}+2KQ({{\mathbf{{w}}}},0)}{2K-m\tan^2\frac{\pi}{2m}} \right ], \end{equation} where \begin{equation} \begin{split} & Q(\mathbf{w},0) \\ = & \left\{ \begin{array}{ll} \frac{m}{4}\left(1-\tan^2\frac{\pi}{2m} \right ), \\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\text{for}~2 \leq m \leq N, \\ -\frac{3m-4N+2}{4} -\frac{m}{4}\tan^2\frac{\pi}{2m}+\frac{ m-N-1}{2} \cos \frac{N\pi}{m}\\ + \left ( \frac{2m-2N+1}{4}\tan\frac{\pi}{2m}+\frac{3}{4\tan\frac{\pi}{2m}} \right )\sin\frac{N\pi}{m}, \\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\text{for}~N<m\leq 2N-1. \end{array} \right. \end{split} \end{equation} \end{corollary} \vspace{0.1in} In what follows, we analyze the asymptotic tightness of the lower bound in (\ref{ZL-corollary-new-weight-vector-equ}). Define $r \triangleq \lim\limits_{N\rightarrow \infty} m/N$. Obviously, $r$ is a real-valued constant with $0<r<2$ when $m$ is on the same order of $rN$ (i.e., $m\sim rN$); and $r\rightarrow 0$ when $m$ is dominated by $N$ asymptotically (i.e., $m \sim o(N)$). Furthermore, define the fractional term in (\ref{ZL-corollary-new-weight-vector-equ}) as \begin{equation}\label{R2} \mathcal{R}_2 \triangleq \frac{N(MN-1)m\tan^2\frac{\pi}{2m}+2KQ({\mathbf{{w}}},0)}{2K-m\tan^2\frac{\pi}{2m}}. \end{equation} It is easy to see that the lower bound in (\ref{ZL-corollary-new-weight-vector-equ}) is tighter than the Welch bound in (\ref{Welch_bound_for_cc}) if and only if \begin{equation}\label{iff} \mathcal{R}_1>\min\limits_{2\leq m \leq 2N-1} \mathcal{R}_2, \end{equation} where $\mathcal{R}_1$ is defined in (\ref{R1}). As $N$ tends to infinity, the inequality in (\ref{iff}) is equivalent to \begin{equation}\label{asymp_iff} \lim\limits_{N\rightarrow \infty}\frac{\mathcal{R}_1}{N} > \lim\limits_{N\rightarrow \infty} \min\limits_{2\leq m \leq 2N-1} \frac{\mathcal{R}_2}{N}. \end{equation} When $m \sim o(N)$, we have $r\rightarrow 0$ and $rN \in [2,\infty)$ as $N\rightarrow\infty$. In this case, one can show that \begin{equation} \begin{split} &\lim\limits_{N \rightarrow\infty} \frac{\mathcal{R}_2}{N} \\ =&\lim\limits_{N \rightarrow\infty} \frac{N(MN-1)rN \tan^2\frac{\pi}{2rN}+2K\cdot\frac{rN}{4}\left(1-\tan^2\frac{\pi}{2rN} \right )}{N(2K-rN\tan^2\frac{\pi}{2rN})} \\ =& \lim\limits_{N \rightarrow\infty} \frac{MN(rN \tan^2\frac{\pi}{2rN})+\frac{Kr}{2}\left(1-\tan^2\frac{\pi}{2rN} \right )}{2K-rN\tan^2\frac{\pi}{2rN}} \\ =& \left\{ \begin{array}{ll} \infty, & \text{for}~2 \leq rN < \infty; \\ \frac{M\pi^2}{8Kr}+\frac{r}{4} \rightarrow \infty, & \text{for}~rN \rightarrow \infty, \end{array} \right. \end{split} \end{equation} which can be ignored without missing the minimum point of interest in the right-hand side of (\ref{asymp_iff}). Hence, we shall assume $r$ to be a non-vanishing real-valued constant with $0 < r< 2$, and rewrite (\ref{asymp_iff}) as \begin{equation}\label{asymp_iff_} \lim\limits_{N\rightarrow \infty}\frac{\mathcal{R}_1}{N} > \min\limits_{0<r<2} \lim\limits_{N\rightarrow \infty} \frac{\mathcal{R}_2}{N}. \end{equation} Here, the order of the limit and minimization operations can be exchanged because $\lim\limits_{N\rightarrow \infty}\frac{\mathcal{R}_2}{N}$ as a function of $r$ exists, as shown below. Next, noting that $\lim\limits_{N\rightarrow \infty}m\tan^2 \frac{\pi}{2m}=\lim\limits_{N\rightarrow \infty}rN\tan^2\frac{\pi}{2rN}=0$, we can express (\ref{R2}) as \begin{equation}\label{R2_2} \begin{split} \lim\limits_{N \rightarrow\infty} \frac{\mathcal{R}_2}{N} & =\lim\limits_{N \rightarrow\infty}\frac{MN-1}{2K}m\tan^2\frac{\pi}{2m}+\lim\limits_{N \rightarrow\infty}\frac{Q({{\textbf{{w}}}},0)}{N}, \end{split} \end{equation} where \begin{equation}\label{R2_2a} \begin{split} \lim\limits_{N \rightarrow\infty}\frac{MN-1}{2K}m\tan^2\frac{\pi}{2m}=\frac{M\pi^2}{8Kr}, \end{split} \end{equation} and after some manipulations, \begin{equation}\label{ch4_Q_largeN} \begin{split} f(r) & \triangleq \lim\limits_{N \rightarrow\infty}\frac{Q({{\textbf{{w}}}},0)}{N}\\ & = \left \{ \begin{array}{cl} r/4, & ~~\text{for}~0< r\leq 1; \\ \frac{4-3r}{4} + \frac{r-1}{2}\cos\frac{\pi}{r} + \frac{3r}{2\pi}\sin\frac{\pi}{r}, &~~\text{for}~1<r< 2. \end{array} \right. \end{split} \end{equation} By (\ref{ch4_R1_largeN}), (\ref{R2_2a}) and (\ref{ch4_Q_largeN}), it follows that (\ref{asymp_iff_}) reduces to \begin{equation}\label{asym_bd_wtvec2} \frac{1}{2} + \frac{M}{2K} > \min_{0<r<2} \left(\frac{M\pi^2}{8Kr} + f(r)\right). \end{equation} Equivalently, we assert that the asymptotic lower bound in (\ref{ZL-corollary-new-weight-vector-equ}) is tighter than the Welch bound if and only if \begin{equation}\label{asym_bd_wtvec2_equ} \frac{K}{M} > \min_{0< r < 2} L(r)\approx 2.483257, \end{equation} where \begin{equation} {L}(r) \triangleq \left \{ \begin{array}{ll} \frac{\pi^2-4r}{4r-2r^2}, & \text{for}~0<r\leq 1;\\ \frac{\pi^2-4r}{2r(3r-2)-4r(r-1)\cos\frac{\pi}{r}-12\frac{r^2}{\pi}\sin \frac{\pi}{r}}, & \text{for}~1<r< 2. \end{array} \right. \end{equation} \begin{figure}[!ht] \centering \scalebox{0.55} {\includegraphics{Fig_optimal_r_.eps}} \caption{A plot of $L(r)$ and $\pi^2/4$ versus $r$.} \label{Fig_optimal_r2} \end{figure} In Fig. \ref{Fig_optimal_r2}, $L(r)$ and $\pi^2/4$ versus $r$ over the range of $0.8\leq r \leq 2$ are plotted. It can be obtained from (\ref{overlineK}) and Fig. \ref{Fig_optimal_r2} that \begin{equation} \frac{\lim\limits_{N\rightarrow\infty}\overline{K}}{M} \leq \underbrace{\frac{\pi^2}{4}}_{\approx 2.467401} < ~\underbrace{\min_{0< r < 2} {L}(r)}_{\approx 2.483257}. \end{equation} By (\ref{asym_bd_wtvec2_equ}), one can see that the proposed weight vector in (\ref{sine_shape_weight_vector}) asymptotically leads to a tighter GLB for \textit{all} $K\geq \overline{K}+1$ if and only if the value of $M$ satisfies the following condition [c.f.~(\ref{nece_cond_QCSSBd2_2})] \begin{equation}\label{ch5_dM_equ} d_2(M) \triangleq \frac{\left \lfloor \frac{\pi^2M}{4}\right \rfloor+1}{M}- \min_{0< r < 2} {L}(r) > 0. \end{equation} \vspace{0.1in} In Fig. \ref{fig_dM}, $d_2(M)$ versus $M$ is also plotted. By identifying $M$ satisfying $d_2(M)>0$ [shown in (\ref{ch5_dM_equ})], we arrive at the following theorem. \begin{figure*}[!ht] \centerline{ \subfloat[$2\leq M \leq 512$]{\includegraphics[width=3in]{d2d3_a.eps} \label{fig_second_case}} \hfil \subfloat[$2\leq M \leq 80$]{\includegraphics[width=3in]{d2d3_b.eps} \label{fig_first_case}} } \caption{A plot of $d_2(M)$ in (\ref{ch5_dM_equ}) and $d_3(M)$ in (\ref{ch5_dM_equ2}) versus $M$, where subplot (a) is a zoom-in of subplot (b). It is noted that a positive $d_2(M)$ [or $d_3(M)$] corresponds to a tighter GLB over the Welch bound.} \label{fig_dM} \end{figure*} \vspace{0.1in} \begin{theorem}\label{tighter_M_rmk} The GLB in (\ref{ZL-corollary-new-weight-vector-equ}) which arises from the weight vector in (\ref{sine_shape_weight_vector}) reduces to \begin{equation}\label{aym_lwrbd_wec2_equ} \delta^2_{\max}\gtrsim MN \left [1-\min_{0<r<2} \left(\frac{M\pi^2}{8Kr} + f(r)\right)\right ], \end{equation} for sufficiently large $N$, where $f(r)$ is given in (\ref{ch4_Q_largeN}). Such an asymptotic lower bound is tighter than the Welch bound for \textit{all} $K\geq \overline{K}+1$ if and only if \begin{equation}\label{distri_optimal_M} \begin{split M \in & \Bigl \{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,\\ & ~~~22,24, 26,28,30,31,33, 35,37,39,41,43,45,60 \Bigl \}. \end{split} \end{equation} \end{theorem} \vspace{0.1in} \subsection{GLB from Weight Vector 3} Let us consider the weight vector obtained by minimizing the following function using the Lagrange multiplier. \begin{equation}\label{mini_F} \mathcal{F}_{K,M,N,m}(\mathbf{w})=Q\left(\mathbf{w},\frac{MN^2}{K}\right)-2\lambda\left (\sum\limits_{i=0}^{m-1}w_i-1 \right), \end{equation} where $w_i=0$ for $i\in \{m,m+1,\cdots,2N-2\}$ and $2\leq m \leq 2N-1$. The idea is to optimize the weaker GLB in (\ref{simplified_GLB}). By relating the quadratic minimization solution of $\mathcal{F}_{K,M,N,m}(\mathbf{w})$ to the Chebyshev polynomials of the second kind, one can obtain the weight vector\footnote{Although it looks similar to that in [\ref{LiuParaGuanBozas14}, Lemma 2], such a weight vector is more generic as it applies to QCSS with different $M\geq 2$.} below. Let $K\leq MN^2$ and $\cos \varphi=1-\frac{K}{MN^2}$. Also, let $m$ be an even positive integer with $m \varphi<\pi+\varphi$. For $\varphi_0=(\pi-m\varphi+\varphi)/2$, define the following weight vector \begin{equation}\label{LevWtVec_equ} {w}_i=\left \{ \begin{array}{ll} \frac{\sin \frac{\varphi}{2}}{\sin \frac{m\varphi}{2}} \sin (\varphi_0+i\varphi), & i\in \{0,1,\cdots,m-1\};\\ 0, & i\in \{m,m+1,\cdots,2N-2\}. \end{array} \right . \end{equation} Setting $m=\left \lfloor \frac{\pi}{\varphi}\right \rfloor+1$, one can minimize $\mathcal{F}_{K,M,N,m}(\mathbf{w})$ in (\ref{mini_F}) over different $m$ and get a generalized version of the Levenshtein bound in [\ref{Levenshtein99}, \textit{Corollary 4}] as follows. \vspace{0.1in} \begin{corollary}\label{coro_bd1} \begin{equation}\label{lev_bd_cor4} \delta^2_{\max} \geq M\left (N-\left \lceil \frac{\pi N}{\sqrt{8K/M}} \right \rceil \right ),~~\text{for}~K\leq MN^2. \end{equation} \end{corollary} \vspace{0.1in} As $N\rightarrow\infty$, the lower bound in (\ref{lev_bd_cor4}) is tighter than the Welch bound in (\ref{Welch_bound_for_cc}) if and only if \begin{equation}\label{equ_coro2_tighter} \frac{1}{2}+\frac{M}{2K}> \lim_{N\rightarrow\infty} \frac{1}{N} \left \lceil \frac{\pi N}{\sqrt{8K/M}} \right \rceil = \frac{\pi}{\sqrt{8K/M}}, \end{equation} or equivalently, \begin{equation}\label{equ_coro2_tighter2} \frac{K}{M}>\frac{\pi^2}{4}-1+ {\sqrt{\left (\frac{\pi^2}{8}-1 \right )\frac{\pi^2}{2}}} \approx 2.541303, \end{equation} where the right-hand side of (\ref{equ_coro2_tighter}) is obtained from (\ref{lev_bd_cor4}) Recall that as $N\rightarrow\infty$, a necessary condition (cf. \textit{Remark \ref{rmk_nece_cond}}) for the GLB to be tighter than the corresponding Welch bound is \begin{equation}\label{nece_cond_QCSSBd2_2} \frac{K}{M} \geq \frac{\lim\limits_{N\rightarrow\infty}\overline{K}+1}{M} =\frac{\left \lfloor\frac{\pi^2M}{4}\right \rfloor+1}{M}. \end{equation} Clearly, \begin{equation}\label{overlineK} \frac{\lim\limits_{N\rightarrow\infty}\overline{K}}{M} =\frac{\left \lfloor\frac{\pi^2M}{4}\right \rfloor}{M} \leq \frac{\pi^2}{4} \approx 2.467401, \end{equation} which is smaller than the right-hand side of (\ref{equ_coro2_tighter2}). It can be asserted that the resultant GLB obtained from the weight vector in (\ref{LevWtVec_equ}) with $m=\left \lfloor {\pi}/{\varphi}\right \rfloor+1$ is tighter if and only if the value of $M$ satisfies the condition \begin{equation}\label{ch5_dM_equ2} d_3(M) \triangleq \frac{\left \lfloor \frac{\pi^2M}{4}\right \rfloor+1}{M}-\left [ \frac{\pi^2}{4}-1+ {\sqrt{\left (\frac{\pi^2}{8}-1 \right )\frac{\pi^2}{2}}}\right ] > 0. \end{equation} This is because when condition (\ref{ch5_dM_equ2}) is satisfied, $K\geq \lim\limits_{N\rightarrow\infty} \overline{K}+1$ is not only a necessary condition [cf. (\ref{nece_cond_QCSSBd2_2})] but also a sufficient condition [cf. (\ref{equ_coro2_tighter2})] for the GLB to be asymptotically tighter than the Welch bound. In Fig. \ref{fig_dM}, $d_3(M)$ versus $M$ is plotted. By identifying $M$ satisfying $d_3(M)>0$ [shown in (\ref{ch5_dM_equ2})], we have the following theorem. \vspace{0.1in} \begin{theorem}\label{tighter_M_rmk2} The GLB in (\ref{lev_bd_cor4}) which arises from the weight vector in (\ref{LevWtVec_equ}) is asymptotically tighter than the Welch bound for \textit{all} $K\geq \overline{K}+1$ if and only if \begin{equation}\label{distri_optimal_M2} M \in \Bigl \{3,5,7,9 ,11\Bigl \}. \end{equation} \end{theorem} \vspace{0.1in} \subsection{Discussions} Denote by $\mathrm{B}_1,\mathrm{B}_2,\mathrm{B}_3$ the optimized asymptotic lower bounds in (\ref{aym_lwrbd_wec3_equ}), (\ref{aym_lwrbd_wec2_equ}), (\ref{lev_bd_cor4}), respectively. We remark that (1), Both $\mathrm{B}_1$ and $\mathrm{B}_2$ are greater than $\mathrm{B}_3$ for any $M\geq2$; (2), $\mathrm{B}_1>\mathrm{B}_2$ except for $M\in \{3,5,7,9\}$. The proof is omitted as it can be easily obtained from the tightness analysis in Section III-B and Section IV. To further visualize their relative strengths of these three lower bounds, we calculate in Table I the ratio values of $\frac{\mathrm{B}_1}{\mathrm{B}_{\text{W}}},\frac{\mathrm{B}_2}{\mathrm{B}_{\text{W}}},\frac{\mathrm{B}_3}{\mathrm{B}_{\text{W}}}$ with $M\in \{2,3,\cdots,25\}$, where $N=2048,K=\overline{K}+1$ and $\mathrm{B}_{\text{W}}$ denotes the corresponding Welch bound. A ratio value which is larger than 1 corresponds to a tighter GLB (over the Welch bound). With Table I, one may verify the three sets of $M$ for tighter GLB in \textit{Theorems 1-3} as well as the above-mentioned remark in this subsection. In particular, we can see that $\frac{\mathrm{B}_1}{\mathrm{B}_{\text{W}}}>1$ for all $M\geq2$, showing that weight vector 1 is superior than the other two as it is capable of tightening the GLB for all possible $M$, asymptotically. \begin{table*}[!ht] \setlength{\tabcolsep}{4pt} \centering \label{table_of_small_value} \caption{Comparison of $\frac{\mathrm{B}_1}{\mathrm{B}_{\text{W}}},\frac{\mathrm{B}_2}{\mathrm{B}_{\text{W}}},\frac{\mathrm{B}_3}{\mathrm{B}_{\text{W}}}$ with different $M$, where $N=2048,K=\overline{K}+1$. } \begin{tabular}{|c||c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline $M$ & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13\\ \hline \hline $\frac{\mathrm{B}_1}{\mathrm{B}_{\text{W}}}$ & 1.0043 & 1.0241 & 1.0043 & 1.0166 & 1.0042 & 1.0133 & 1.0042 & 1.0113 & 1.0042 & 1.0101 & 1.0042 & 1.0092 \\ \hline $\frac{\mathrm{B}_2}{\mathrm{B}_{\text{W}}}$ & 1.0026 & 1.0293 & 1.0025 & 1.0187 & 1.0025 & 1.0141 & 1.0025 & 1.0116 & 1.0025 & 1.0099 & 1.0025 & 1.0088 \\ \hline $\frac{\mathrm{B}_3}{\mathrm{B}_{\text{W}}}$ & \textit{0.9909} & 1.0232 & \textit{0.9909} & 1.0106 & \textit{0.9910} & 1.0049 & \textit{0.9910} & 1.0025 & 0.9910 & 1.0002 & \textit{0.9910} & \textit{0.9988} \\ \hline \hline $M$ & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25\\ \hline \hline $\frac{\mathrm{B}_1}{\mathrm{B}_{\text{W}}}$ & 1.0042 & 1.0086 & 1.0042 & 1.0003 & 1.0042 & 1.0007 & 1.0042 & 1.0010 & 1.0042 & 1.0013 & 1.0042 & 1.0016 \\ \hline $\frac{\mathrm{B}_2}{\mathrm{B}_{\text{W}}}$ & 1.0025 & 1.0079 & 1.0025 & \textit{0.9977} & 1.0025 & \textit{0.9983} & 1.0025 & \textit{0.9987} & 1.0025 & \textit{0.9990} & 1.0025 & \textit{0.9993} \\ \hline $\frac{\mathrm{B}_3}{\mathrm{B}_{\text{W}}}$ & \textit{0.9910} & \textit{0.9969} & \textit{0.9910} & \textit{0.9841} & \textit{0.9910} & \textit{0.9849} & \textit{0.9910} & \textit{0.9859} & \textit{0.9910} & \textit{0.9870} & \textit{0.9910} & \textit{0.9865} \\ \hline \end{tabular} \end{table*} \section{Conclusions} The generalized Levenshtein bound (GLB) in [\ref{LiuGuanMow14}, \textit{Theorem 1}] is an aperiodic correlation lower bound for quasi-complementary sequence sets (QCSSs) with \textit{number of channels} not less than 2 (i.e., $M\geq2$). Although GLB was shown to be tighter than the corresponding Welch bound [i.e., (\ref{Welch_bound_for_cc})] for certain cases, there exists an ambiguous zone [shown in (\ref{GLBgap_}) and (\ref{GLBgap})] in which the tightness of GLB over Welch bound is unknown. Motivated by this, we aim at finding a properly selected weight vector in the bounding equation for a tighter GLB for \textit{all} (other than \textit{some}) $K\geq \overline{K}+1$, where $K$ denotes the set size, and $\overline{K}$ is a value depending on $M$ and $N$ (the sequence length). As the GLB is in general a non-convex fractional quadratic function of the weight vector, the derivation of an analytical solution for a tighter GLB for \textit{all} possible cases is a challenging task. The most significant finding of this paper is weight vector 1 in (\ref{wgtvec3_equ}) which is obtained from a frequency-domain optimization approach. We have shown that its resultant GLB in (\ref{coro_GLB_from_wetvec3-equ}) is tighter than Welch bound for \textit{all} $K\geq \overline{K}+1$ and for \textit{all} $M\geq2$, asymptotically. This finding is interesting as it explicitly shows that the GLB tighter condition given in [\ref{LiuGuanMow14}, \textit{Theorem 2}] is not only necessary but also sufficient, asymptotically, as shown in \textit{Theorem \ref{th4OptWtVec}}. Interestingly, we have proved in Section III-C that weight vector 1 in (\ref{wgtvec3_equ}) is local minimizer of the GLB under certain asymptotic conditions. We have shown that both weight vectors 2 and 3 [given in (\ref{sine_shape_weight_vector}) and (\ref{LevWtVec_equ}), respectively] lead to tighter GLBs for \textit{all} $K\geq \overline{K}+1$ but only for certain small values of $M$ not less than 2. Note that although they were proposed in \cite{LiuParaGuanBozas14}, the focus of \cite{LiuParaGuanBozas14} was on the tightening of Levenshtein bound for traditional single-channel (i.e., $M=1$) sequence sets, whereas in this paper we have extended their tightening capability to GLB for multi-channel (i.e., $M\geq2$) QCSS. Furthermore, we have shown in \textit{Theorem \ref{tighter_M_rmk}} and \textit{Theorem \ref{tighter_M_rmk2}} that weight vector 2 is superior as its admissible set of $M$ [see (\ref{distri_optimal_M})] is larger and subsumes that of weight vector 3.
{'timestamp': '2017-01-09T02:03:14', 'yymm': '1701', 'arxiv_id': '1701.01550', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01550'}
arxiv
\section{Introduction} \label{s::intro} The Li-Fraumeni syndrome (LFS) is a rare disorder that substantially increases the risk of developing several cancer types, particularly in children and young adults. It is characterized by autosomal dominant mutation inheritance with frequent occurrence of several cancer types: soft tissue/bone sarcoma, breast cancer, lung cancer, and other types of cancer that are grouped together as ``other cancers" \citep{nichols2001germ,birch2001relative}. A majority of LFS is caused by germline mutations in the TP53 tumor suppressor gene \citep{malkin1990germ,srivastava1990germ}. The LFS data that motivate our work are family data collected through patients diagnosed with pediatric sarcoma (i.e., probands) who were treated at MD Anderson Cancer Center from 1944 to 1982 and their extended kindred. The data consist of 186 families, with a total of 3686 subjects. The size of the families ranges from 3 to 717, with the median at 7. This dataset is the longest followed-up cohort in the world (followed up for 20-50 years), and among the largest collection of TP53 mutation carriers in all cohorts that are available for LFS. Considering the prevalence of TP53 mutations in a general population is as low as 0.0001 to 0.003, this dataset provides a specially enriched collection of TP53 mutations, which then allow us to characterize its effect on a diverse cancer outcomes. For each subject, the duration until he/she develops cancer is recorded as the primary endpoint. Although it is possible for LFS patients to experience multiple cancers during their lifetime, here, we focus on only the time to the first primary cancer since only a few patients represented in the database experienced multiple primary cancers. Table \ref{tb::summary2} shows the cancer-specific summaries for the LFS data. Further descriptions of the data are provided by \citet{lustbader1992segregation}, \citet{strong1992li}, and \citet{hwang2003germline}. \input{tb_summary} The primary objective here is to estimate the cancer-specific age-at-onset penetrance as a measure of the risk of experiencing a specific cancer for a person with a specific genotype (i.e., TP53 mutation status). Penetrance, which plays a crucial role in genetic research, is defined as the proportion of individuals with the genetic variants (i.e., {genotype}) that cause a particular trait who also have clinical symptoms of the trait (i.e., {phenotype}). When the clinical traits of interest are age-dependent (e.g., cancers), it is often more desirable to estimate the age-at-onset penetrance, defined as the probability of disease onset by a certain age, while adjusting for additional covariates if necessary. For the LFS study, the age-at-onset penetrance is defined as the conditional probability of having LFS-related cancers by a certain age given a certain TP53 mutation status. Cox proportional hazard regression models \citep[][among many others]{GaudermanFaucett1997, WuStrongShete2010} have been most widely used for this task. Other approaches have included nonparametric estimation \citet{wang2007nonparametric} and parametric estimation based on logistic regression \citep{abel1990time} or a Weibull model \citep{hashemian2009kin}. Estimating the age-at-onset penetrance for the LFS data is challenging for several reasons. First, LFS involves multiple types of cancer, and subjects have simultaneous competing risks of developing multiple types of cancer. \citet{chatterjee2003adjustment} proposed a penetrance estimation method under a competing risk framework for a kin-cohort design. However, their method is not directly applicable if the pedigree size is large and/or there is additional genetic information from relatives. \citet{gorfine2011frailty} and \citet{gorfine2014calibrated} proposed frailty-based competing risk models for family data, assuming that genotypes are completely observed for all family members, which is not the case for the LFS data. Second, the genotype (i.e., TP53 mutation status) is not measured for the majority (about 74\%) of subjects and the LFS data are clustered in the form of families. Accommodating the missing data and accounting for family or pedigree data structure are statistically and computationally challenging. As shown later, to efficiently utilize the observed genotype data nested in the family structure, we need to marginalize the likelihood over (or integrate out) all possible genotypes for subjects with missing genotype information, and meanwhile take into account the available genotypes in the family under the given pedigree structure. Third, the LFS data are not a random sample, but have been collected through probands diagnosed with sarcoma at young ages. That is, the data oversampled sarcoma patients. Such a sampling scheme inevitably creates bias, known as \textit{ascertainment bias}, and should be properly adjusted to obtain unbiased results. Several likelihood-calibrated models have been developed to correct the ascertainment bias, including the retrospective model \citep{KraftThomas2000}, the conditional-on-ascertainment variable model \citep{ewens1986resolution,pfeiffer2001inference}, and the ascertainment-corrected joint model \citep{KraftThomas2000,IversenChen2005}, among others. To address these challenges, in this article, we develop a Bayesian semiparametric approach to estimate the cancer-specific age-at-onset penetrance in the presence of the competing risks of developing multiple cancers. We employ a Bayesian semiparametric competing risk model to model the time to different types of cancer and introduce the family-wise likelihood to minimize information loss from missing genotypes and harness the information contained in the pedigree structure. We employ the peeling algorithm \citep{elston1971general} to evaluate the family-wise likelihood, and utilize the ascertainment-corrected joint model (Kraft and Thomas, 2000) to correct the ascertainment bias. The rest of the article is organized as follows. In Section \ref{s::model}, we define the cancer-specific age-at-onset penetrance and describe our Bayesian semiparametric competing risk model including details about the family-wise likelihood and the ascertainment bias correction. In Section \ref{s::sampling}, we provide an algorithm to fit the models and carry out a simulation study in Section \ref{s::simulation}. We apply the proposed methodology to the LFS data in Section \ref{s::analysis}. Discussions follow in Section \ref{s::discussion}. \section{Model} \label{s::model} \subsection{Cancer-specific Age-at-onset Penetrance} \label{ss::cs.penetrance} Let $G$ denote a subject's genotype, and $X$ denote the baseline covariates (e.g., gender). Suppose that $K$ types of cancer are under consideration and compete against each other such that the occurrence of one type of cancer censors the other types of cancer. Let $T_k$ denote the time to the $k$th type of cancer, $k=1, \ldots, K$, and define $T = \min_{k \in \{1, \cdots, K\}} T_k$ and $Y = \min \{T, C \}$, where $C$ is a conditional random censoring time given $G$ and $X$, i.e., $T \bot C|G,X$. Let $D$ denote the cancer type indicator, with $D=k$ if $T=T_k<C$ (i.e., the $k$th type of cancer that occurs); otherwise, $D=0$ (i.e., censored observation). The actual observed time-to-event data are $H=(Y, D)$. Traditionally, when analyzing subjects at risk of developing a single disease, the age-at-onset penetrance is defined as the probability of having the disease at a certain age given a certain genotype. In order to study LFS, where subjects simultaneously have the (competing) risk of developing multiple types of cancer, this standard definition must be extended. Borrowing ideas from the competing risk literature, we define the $k$th \textit{cancer-specific age-at-onset penetrance}, denoted by $q_k(t|G, X)$, as the probability of having the $k$th type of cancer at age $t$ prior to developing other cancers (competing risks), given a specific genotype $G$ and additional baseline covariates $X$ if necessary, that is, \begin{align} \label{eq::cs.penetrance} q_k(t|G,X) = {\rm Pr}(T \le t, D = k|G, X), \qquad k = 1, \cdots, K. \end{align} The cancer-specific penetrance $q_k(t|G,X)$ can be estimated as \begin{equation} \label{eq::cs.penetrance2} q_k(t|G,X) = \int_{0}^{t}\lambda_k(u|G, X) S(u|G, X) du, \qquad k = 1, \cdots, K, \end{equation} where \begin{equation} \label{eq::cs.hazard} \lambda_k(t|G, X) = \lim_{h \downarrow 0} \frac{\mbox{Pr}(t \le T < t+h, D = k | T > t, G, X)}{h}, \end{equation} and $$S(t|G, X) = \exp\left\{-\sum_{k=1}^K \Lambda_k(t|G, X)\right\},$$ with $\Lambda_k(t|G, X) = \int_{0}^{t}\lambda_k(u|G,X) du$. In the competing risk literature, $\lambda_k(t|G, X)$ and $\Lambda_k(t|G, X)$ are referred to as the cancer-specific hazard and cancer-specific cumulative hazard, respectively. We note that it may be tempting to define the cancer-specific age-at-onset penetrance function as ${\rm Pr}(T_{k} \le t | G, X)$, which is analogous to the conventional definition of penetrance for a single disease. However, that quantity is not identifiable in nonparametric models \citep{tsiatis1975nonidentifiability}. Besides cancer-specific penetrance, it is often of practical interest to estimate the overall age-at-onset penetrance, defined as \begin{align} \label{eq::penetrance} q(t|G, X) = \mbox{Pr}(T \le t | G, X), \end{align} which is the probability that a subject has any type of cancer by age $t$ given his/her genotype $G$ and baseline characteristics $X$, and can be calculated through the cancer-specific penetrance $q_k(t|G, x)$ using $q(t|G, X) = \sum_{k=1}^K q_k(t|G, X)$. \subsection{Competing Risk Model} \label{ss::model} In the rest of the article, without loss of generality, we focus on the LFS data where $X$ denotes gender coded as 1 for the male and 0 for the female, and $G$ denotes TP53 mutation status. As LFS is autosomal dominant, let $G=1$ denote genotype $ Aa$ or $AA$, and $G=0$ denote genotype $aa$, where $A$ and $a$ denote the (minor) mutated and wildtype alleles in the TP53 tumor suppressor gene, respectively. Let $\mathbf{Z} = (G, X, G \times X )^T$, with $G \times X$ denoting the interaction between $G$ and $X$. We model the hazard for the $k$th type of cancer, say $\lambda_k(t|\mathbf{Z}, \xi_{i, k})$, using a frailty model as follows: \begin{align} \label{eq::frailty.model} \lambda_k(t|\mathbf{Z}, \xi_{i, k}) = \lambda_{0,k} (t) \xi_{i,k} \exp\{\boldsymbol{\beta}_{k}^T \mathbf{Z}\}, \qquad k = 1, \cdots, K, \end{align} where $\boldsymbol{\beta}_k$ denotes the regression coefficient parameter vector; $\lambda_{0,k}(t)$ is a baseline hazard function; and $\xi_{i,k}$ is the $i$th family-specific frailty (or random effect) used to account for the within-family correlation induced by non-genetic factors that are not included in $X$. The pedigree information (or genetic relationship) within a family will be incorporated through the family-wise likelihood described in Section 2.3. We assume that $\xi_{i,k}$ follows a gamma distribution, $\xi_{1,k}, \cdots, \xi_{I,k} \sim Gamma(\nu_k, \nu_k)$. Such a gamma frailty has been widely used in frailty models \citep{duchateau2007frailty}. Under this model, the cancer-specific age-at-onset penetrance can be expressed as \begin{align} q_k(t|\mathbf{Z}) &= \int_0^t \int_{\boldsymbol{\xi} \in [0, \infty)^K} \lambda_k (u|\mathbf{Z}, \xi_k) S(u|\mathbf{Z},\boldsymbol{\xi}) f(\boldsymbol{\xi} | \boldsymbol{\nu}) d\boldsymbol{\xi} du \nonumber \\ &=\int_0^t \frac{\nu_k}{(\nu_k - \log \{S_k^*(u|\mathbf{Z})\})} \lambda_{0,k}(u) \exp\{\boldsymbol{\beta}_k^T\mathbf{Z}\} S(u|\mathbf{Z}) du, \label{eq::cs.penetrance3} \end{align} where $S_k^*(t|\mathbf{Z}) = \exp\left\{-\int_{0}^t \lambda_{k,0}(u) \exp\{\boldsymbol{\beta}_k^T \mathbf{Z}\} du \right\}$ and $S(t|\mathbf{Z}) = \prod_{k=1}^K S_k(t|\mathbf{Z})$ with \begin{align*} S_k(t|\mathbf{Z}) & = \int_{0}^{\infty} \exp\left\{-\int_{0}^t \lambda_k (u|\mathbf{Z},\xi_k) du \right\} f(\xi_k | \nu_k) d \xi_k \\ & = \left[ \frac{\nu_k}{\nu_k - \log\{S_k^*(t|\mathbf{Z})\}} \right]^{\nu_k}. \end{align*} Because the penetrance depends on the survival function, it is imperative to specify the baseline hazard $\lambda_{0,k} (t)$, which appears in (\ref{eq::frailty.model}). To this end, we propose to approximate the cumulative baseline hazard $\Lambda_{0,k} (t) = \int_{0}^{t} \lambda_{0,k} (s) ds$ via Bernstein polynomials \citep{lorentz1953bernstein} since $\Lambda_{0,k} (t)$ is monotone increasing. Bernstein polynomials are popular in Bayesian nonparametric function estimation, with shape restrictions due to desired properties such as the optimal shape restriction property \citep{carnicer1993shape} and the convergence property of their derivatives \citep{lorentz1953bernstein}. Without loss of generality, we assume $t$ has been rescaled, e.g., by the largest observed time, such that $t \in [0,1]$. Now, we have $\Lambda_{0,k}(t)$ approximated by Bernstein polynomials of degree $M$ as follows \citep{chang2005bayesian}. \begin{eqnarray} \Lambda_{0,k}(t) \approx \sum_{l=1}^{M} \omega_{l,k} {M \choose l} t^{l} (1-t)^{M-l}, \label{eq::beta.approximation} \end{eqnarray} where $\omega_{l,k} = \Lambda_{0,k}(l/M)$ and $\omega_{1,k} \le \cdots \le \omega_{M, k}$ to ensure that $\Lambda_{0,k}(t)$ is monotone increasing. Notice that $l$ is running from 1 because of $\Lambda_{0,k}(0) = 0$. Applying the re-parameterization of $\gamma_{l,k} = \omega_{l,k} - \omega_{l-1,k}$ with $\omega_{0, k} = 0$ and $\gamma_{l,k} \ge 0, l = 1, \cdots, M$, the right-hand side of (\ref{eq::beta.approximation}) can be equivalently rewritten as \begin{align} \sum_{m=1}^{M} \gamma_{m,k} \int_0^{t} \frac{u^{m} (1-u)^M-m}{Beta(m, M-m+1)} du = \boldsymbol{\gamma}_k^T \mathbf{B}_M(t), \label{eq::beta.approximation2} \end{align} where $\mathbf{B}_M(t) = (B_M(t,1), \cdots, B_M(t,M))^T$, with $B_M(t,m)$ being the distribution function of the beta distribution evaluated at the value of $t$ with parameters $m$ and $M-m+1$, and $\boldsymbol{\gamma}_k = (\gamma_{1,k}, \cdots, \gamma_{M,k})^T$ \citep{mckay2011variable}. Therefore, it follows that \begin{eqnarray} \label{eq::baseline} \lambda_{0,k}(t) \approx \boldsymbol{\gamma}_k^T \mathbf{b}_M(t), \end{eqnarray} where $\mathbf{b}_M(t) = (b_M(t,1), \cdots, b_M(t,M))^T$ and $b_M(t, m) = \partial B_M(t,m)/\partial t$ (i.e., associated beta density). Finally, the frailty model (\ref{eq::frailty.model}) can be written as \begin{align} \label{eq::cs.penetrance4} \lambda_k(t|\mathbf{Z}; \boldsymbol{\beta}_k, \boldsymbol{\gamma}_k, \xi_{i,k}) = \{\boldsymbol{\gamma}_k^T \mathbf{b}_M(t)\} \xi_{i,k} \exp\{\boldsymbol{\beta}_{k}^T \mathbf{Z}\}. \end{align} The proposed nonparametric baseline hazard model \eqref{eq::baseline} is more flexible than parametric models, such as exponential and Weibull models, without imposing a restrictive parametric structure on the shape of the baseline hazard. Compared to the piecewise constant hazard model, our approach produces a smooth estimate of hazard and also avoids selection of knots, which is often subjective. The numerical comparison of different baseline models is provided in Section \ref{ss:compare} and {\textit{Supplementary Materials}} Section C. \subsection{Family-wise Likelihood} Let $i$ index the family and $j$ index the individual within the family, where $i=1, \cdots, I$, and $j = 1, \cdots, n_i$. For the $i$th family, let $\mathbf{H}_{i} = (H_{i1}, \cdots, H_{i n_i})$ with $H_{ij} = (Y_{ij}, D_{ij})$ and $\mathbf{X}_{i} = (X_{i1}, \cdots, X_{i n_i})$. Let $\mathbf{G}_{i, obs}$ and $\mathbf{G}_{i, mis}$ respectively denote the observed and missing parts of genotype data $\mathbf{G}_{i} = (G_{i1}, \cdots, G_{i n_i})$, i.e., $\mathbf{G}_{i}=(\mathbf{G}_{i, obs}, \mathbf{G}_{i, mis})$ if we ignore the order of the elements for simplicity. Conditional on frailty $\boldsymbol{\xi}_{i}=(\xi_{i,1}, \cdots, \xi_{i,K})$, the likelihood of $\mathbf{H}_{i}$ for the $i$th family is $\Pr (\mathbf{H}_i | \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta} , \boldsymbol{\xi}_{i})$ which we call the family-wise likelihood, where $\boldsymbol{\theta} = \{(\boldsymbol{\beta}_k^T, \boldsymbol{\gamma}^T_k) : k = 1, \cdots, K \}$ denotes a vector of model parameters except the frailty. Evaluation of the family-wise likelihood $\Pr (\mathbf{H}_i | \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta} , \boldsymbol{\xi}_{i})$ is not trivial because the individual disease histories $H_{i1}, \cdots, H_{in_i}$ are not conditionally independent given $\mathbf{G}_{i, obs}$ and $\boldsymbol{\xi}_{i}$, due to the dependency through $\mathbf{G}_{i,mis}$. Note that $H_{i1}, \cdots, H_{in_i}$ will be conditionally independent when conditional on complete genotype data $\mathbf{G}_{i}$ and $\boldsymbol{\xi}_{i}$. In this article, we use Elston-Stewart's peeling algorithm \citep{elston1971general,lange1975extensions,FernandoStrickerElston1993} to compute the family-wise likelihood, described as follows. We assume that there is no loop in the pedigree, which is generally true in practice, and suppress the family subscript $i$ and the conditional arguments except $\mathbf{G}_{obs}$ for notational brevity. A pedigree without loop can be partitioned into two disjoint groups, known as anterior and posterior, that are connected only through an arbitrary pivot member, say $j$. The anterior are the member in the pedigree who are connected to the pivot member through his/her parents, and the posterior are the member in the pedigree who are connected to the pivot member through his/her spouse and offsprings, see Figure \ref{fg:ped.sim} for an example. In our implementation, we use the proband as the pivot member of each family. Let $\mathbf{H}_j^-$, and $\mathbf{H}_j^+$ denote the phenotypes of anterior and posterior, respectively. We partition $\mathbf{H} = (\mathbf{H}_j^-, H_j, \mathbf{H}_j^+)$. Because anterior and posterior are connected only through the pivot member $j$, $\mathbf{H}_j^-$ and $\mathbf{H}_j^+$ are conditionally independent given pivot member's genotype $G_j$. If $G_j$ is unobserved, the family-wise likelihood $P(\mathbf{H}|\mathbf{G}_{obs})$ can be written as \begin{align} \Pr(\mathbf{H}|\mathbf{G}_{obs}) & = \sum_{G_{j}} {\Big\{}\Pr(G_j | \mathbf{G}_{obs}) \Pr(\mathbf{H}_j^-, H_j, \mathbf{H}_j^+ | G_{j}, \mathbf{G}_{obs}) {\Big\}} \nonumber \\ & = \sum_{G_{j}} \Big\{\Pr(G_{j}|\mathbf{G}_{obs}) \Pr(\mathbf{H}_j^- | G_{j}, \mathbf{G}_{obs}) \Pr(H_j | G_{j}, \mathbf{G}_{obs}) \Pr(\mathbf{H}_j^+ | G_{j}, \mathbf{G}_{obs}) \Big\}\nonumber \\ & = \sum_{G_{j}} {\Big\{}\mathds{A}_j(G_{j}|\mathbf{G}_{obs}) \Pr(H_j|G_{j}) \mathds{P}_j(G_j|\mathbf{G}_{obs}) {\Big\},} \label{eq:f.lk} \end{align} where \begin{align*} \begin{array} {ll c l} \mbox{(Anterior probability of $j$)} & \mathds{A}_j(G_j|\mathbf{G}_{obs}) & = & \Pr(\mathbf{H}_{j}^-, G_{j}|\mathbf{G}_{obs}), \\ \mbox{(Posterior probability of $j$)} & \mathds{P}_j(G_j|\mathbf{G}_{obs}) & = & \Pr(\mathbf{H}_{j}^+| G_{j},\mathbf{G}_{obs}), \end{array} \end{align*} and the individual likelihood $\Pr (H_j | G_j)$ is computed from the proposed model as \begin{align*} \Pr (H_j | G_j) : = \Pr (H_{ij} | G_{ij}, X_{ij}, \boldsymbol{\theta} , \boldsymbol{\xi}_i) \propto \prod_{k = 1}^K \left\{\lambda_{k}(Y_{ij}|\mathbf{Z}_{ij}, \boldsymbol{\theta}, \boldsymbol{\xi}_i)\right\}^{\Delta_{ijk}} \exp \left\{ - \Lambda_k(Y_{ij}|\mathbf{Z}_{ij}, \boldsymbol{\theta}, \boldsymbol{\xi})\right\}, \end{align*} with $\Delta_{ijk} = 1$ if $D_{ij} = k$ and 0 otherwise \citep{prentice1978analysis,maller2002analysis}. In the case that $G_j$ is observed, the summation in \eqref{eq:f.lk} is not needed and the family-wise likelihood is reduced to \begin{align} \Pr(\mathbf{H}|\mathbf{G}_{obs}) & = \mathds{A}_j(G_{j}|\mathbf{G}_{obs}) \Pr(H_j|G_{j}) \mathds{P}_j(G_j|\mathbf{G}_{obs}). \label{eq:f.lk2} \end{align} To calculate $\mathds{A}_j(G_j|\mathbf{G}_{obs})$ and $\mathds{P}_j(G_j|\mathbf{G}_{obs})$, $\mathbf{H}_j^-$ and $\mathbf{H}_j^+$ can be further partitioned into anterior and posterior in a similar way as above. Thus, the family-wise likelihood $\Pr(\mathbf{H}|\mathbf{G}_{obs})$ can be evaluated in a recursive way. An illustrative example of using the peeling algorithm to evaluate the family-wise likelihood is provided in \textit{Supplementary Materials} Section A. \citet{FernandoStrickerElston1993} provides the details on the recursive formulation of the algorithm. \subsection{Ascertainment Bias Correction} \label{ss::ascertainment} For studies of rare diseases, such as LFS, ascertainment bias is inevitable when family data are collected through probands in high-risk populations in which disease cases are more likely to be observed. In order to correct the ascertainment bias, we employ the ascertainment-corrected joint (ACJ) likelihood \citep{KraftThomas2000,IversenChen2005}. In particular, we closely follow the approach proposed by \citet{IversenChen2005}. Let ${\mathcal A}_i$ denote the ascertainment indicator variable, such that ${\mathcal A}_i=1$ if the $i$th family is ascertained and $0$ otherwise. In the LFS data, a family is ascertained and included in the sample only if the proband is diagnosed with sarcoma. Following the idea of \citet{IversenChen2005}, the ACJ likelihood for the LFS data is given by \begin{align} \label{eq::abc} & \mbox{Pr}(\mathbf{H}_i, \mathbf{G}_{i, obs}| \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i, \mathcal{A}_i=1) \nonumber \\ & \qquad \qquad = \frac{\Pr(\mathcal{A}_i=1|\mathbf{H}_i, \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i) \Pr(\mathbf{H}_i| \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)\Pr(\mathbf{G}_{i, obs}| \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)}{\Pr(\mathcal{A}_i=1| \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)}. \end{align} Because the ascertainment decision is made on the basis of $H_{i1}$ (i.e., phenotype of the proband) in a deterministic way, the first term in the numerator of equation \eqref{eq::abc}, i.e., $\Pr(\mathcal{A}_i=1|\mathbf{H}_i, \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)$, is independent of the model parameters $\boldsymbol{\theta}$ and $\boldsymbol{\xi}_i$. In addition, the third term in the numerator of equation \eqref{eq::abc}, i.e., $\Pr(\mathbf{G}_{i, obs}| \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)$ is also independent of both $\boldsymbol{\theta}$ and $\boldsymbol{\xi}_i$, the parameters of the penetrance model. As a result, we have \begin{equation} \label{eq::acj} \mbox{Pr}(\mathbf{H}_i, \mathbf{G}_{i, obs}, \mathbf{X}_i| \boldsymbol{\theta}, \boldsymbol{\xi}_i, {\mathcal A}_i=1) \propto \frac{\mbox{Pr}(\mathbf{H}_i | \mathbf{X}_i, \mathbf{G}_{i, obs}, \boldsymbol{\theta}, \boldsymbol{\xi}_i)}{\mbox{Pr}({\mathcal A}_i =1 |\mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i)}. \end{equation} This means that the ascertainment bias can be corrected by inverse-probability weighting the likelihood by the corresponding ascertainment probability, which is given by \begin{align} \label{eq::abc.lfs} \mbox{Pr}({\mathcal A}_i=1| \mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i) = \sum_{H_{i1}} \mbox{Pr}({\mathcal A}_i=1|H_{i1}) \mbox{Pr}(H_{i1}|X_{i1}, \boldsymbol{\theta}, \boldsymbol{\xi}_i). \end{align} In the LFS data, a family is ascertained only if the proband is diagnosed with sarcoma (coded as $D=2$). We assume that the sarcoma patients visiting MD Anderson Cancer Center are not be very different from the ones visiting other clinics, then it follows $$ \mbox{Pr}({\mathcal A}_i=1|Y_{i1}, D_{i1} = 2) = 1 \,\,{\rm and} \,\, \mbox{Pr}({\mathcal A}_i=1|Y_{i1}, D_{i1} \neq 2) = 0. $$ The assumption is empirically acceptable in our application, and partially validated in Section 5.4 by comparing our estimates for non-carriers to those from the US population. In general, however, the assumption may not be valid, then we cannot generalize our results to the US population, but to the patients visiting MD Anderson Cancer Center only. Recalling $H_{i1}=(Y_{i1}, D_{i1})$, the ascertainment probability \eqref{eq::abc.lfs} is given by \begin{align} \label{eq::abc.prob} \mbox{Pr}({\mathcal A}_i=1|\mathbf{X}_i, \boldsymbol{\theta}, \boldsymbol{\xi}_i) & = \mbox{Pr}(Y_{i1}, D_{i1} = 2 |X_{i1}, \boldsymbol{\theta}, \boldsymbol{\xi}_i) \notag \\ & = \sum_{G} \mbox{Pr}(Y_{i1}, D_{i1} = 2 |G, X_{i1}, \boldsymbol{\theta}, \boldsymbol{\xi}_i) \mbox{Pr}(G|X_{i1}) \notag \\ & = \sum_{G} \Bigg[ \lambda_{2}(Y_{i1}|G, X_{i1}, G \times X_{i1}, \boldsymbol{\beta}_2, \boldsymbol{\gamma}_2, \xi_{i,2}) \nonumber \\ & \qquad \times \exp \bigg\{ - \sum_{k = 1}^K \Lambda_k(Y_{i1}|G, X_{i1}, G \times X_{i1}, \boldsymbol{\beta}_k, \boldsymbol{\gamma}_k, \xi_{i,k})\bigg\} \mbox{Pr}(G|X_{i1})\Bigg]. \end{align} The gender-specific prevalence $\mbox{Pr}(G|X_{i1})$ is often assumed to be gvien when estimating the penetrance \citep{IversenChen2005}. In our application, the TP53 mutation prevalence is independent of gender i.e., $\Pr(G|X) = \Pr(G)$, and it can be calculated on the basis of the mutated allele frequency $\phi_A$, i.e., $\mbox{Pr}(G = 0)=(1-\phi_A)^2$ and $\mbox{Pr}(G = 1)=1-(1-\phi_A)^2$. The prevalence of a germline TP53 mutation in the Western population is known to be $\phi_A=0.0006$ \citep{lalloo2003prediction}. As shown above, the key is that we assume that the mutated allele frequency $\phi_A$ is known or can be reliably estimated from external data sources. Given a known mutated allele frequency $\phi_A$, the frequency of each genotype $G$ can be determined using the Mendelian laws of inheritance. Thus, coupling with the penetrance model, the sampling probability can be estimated, e.g., equation (\ref{eq::abc.prob}), and used to inversely weight the observed data likelihood to make inference for the target population. For many genetic studies, it is often reasonable to assume that the mutated allele frequency $\phi_A$ is known or can be reliably estimated from external data sources. The ACJ likelihood of the entire data of $I$ mutually independent families is given by the product of \eqref{eq::acj} \begin{align*} \Pr (\mathbf{H}, \mathbf{G}_{obs}|\mathbf{X}, \boldsymbol{\theta}, \boldsymbol{\xi}, {\mathcal{A}}) \propto \prod_{i=1}^I \frac{\Pr (\mathbf{H}_i | \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\theta} , \boldsymbol{\xi}_{i})}{\mbox{Pr}({\mathcal A}_i=1|\boldsymbol{\theta}, \boldsymbol{\xi}_i)}, \end{align*} where $\mathbf{H} = (\mathbf{H}_i, \cdots, \mathbf{H}_I)$, $\mathbf{G}_{obs} = (\mathbf{G}_{1, obs}, \cdots, \mathbf{G}_{I,obs})$ and ${\mathcal{A}} = ({\mathcal{A}}_1, \cdots, {\mathcal{A}}_I)$. \section{Prior and Posterior Sampling} \label{s::sampling} We use an independent normal prior for $\boldsymbol{\beta}_k$, i.e., $ \boldsymbol{\beta}_k \sim N(\mathbf{0}, \sigma^2 \mathbf{I}), $ where $\mathbf{0}$ and $\mathbf{I}$ denote a zero vector and an identity matrix, respectively, and we set a large value of $\sigma$ for vague priors. For the nonnegative parameter $\gamma_{m,k}, m = 1, \cdots, M, k = 1, \cdots, K$ for the baseline hazard, we use the noninformative flat prior. We assign $\nu_k$, $k = 1, \cdots, K$, the independent vague gamma prior $Gamma(0.01, 0.01)$. See Section \ref{ss::sensitivity} for the results of the sensitivity analysis of $\gamma_{m,k}$ and $\nu_k$. For the choice of $M$, a large value provides more flexibility to model the shape of the baseline hazard, but at the cost of increasing the computational burden. \citet{GelfandMallick1995} suggest that a small value of $M$ works well for most applications. We set $M = 5$ in the analysis. Let $\mbox{Pr}(\boldsymbol{\theta})$ and $\mbox{Pr}(\boldsymbol{\nu})$ denote the prior distributions of $\boldsymbol{\theta}$ and $\boldsymbol{\nu}$, respectively. The joint posterior distribution of $\boldsymbol{\nu}$, $\boldsymbol{\xi}$ and $\boldsymbol{\theta}$ is given by \begin{align*} \mbox{Pr}(\boldsymbol{\theta}, \boldsymbol{\xi}, \boldsymbol{\nu}|\mathbf{H}, \mathbf{G}_{obs}, \mathbf{X}, {\mathcal{A}}) \propto \Pr (\mathbf{H}, \mathbf{G}_{obs}|\mathbf{X}, \boldsymbol{\theta}, \boldsymbol{\xi}, {\mathcal{A}}) \cdot \mbox{Pr}(\boldsymbol{\theta}) \cdot \mbox{Pr}(\boldsymbol{\xi}|\boldsymbol{\nu}) \cdot \mbox{Pr}(\boldsymbol{\nu}). \end{align*} We employ the random walk Metropolis-Hastings algorithm within Gibbs sampler to sample the posterior distribution. We generate 100,000 posterior samples in total and take every fifth sample for thinning after discarding the first 10,000 samples for burn-in. We implement the Markov chain Monte Carlo (MCMC) algorithm in \texttt{R}, which takes about three seconds per single MCMC iteration. We observe that the physical computing time is approximately linear, corresponding to the number of families, $I$, regardless of the family size $n_i$. \section{Simulation} \label{s::simulation} \begin{figure}[!b] \centering \includegraphics[width = 0.9\textwidth]{sim_ped2} \caption{Pedigree of the simulated family of three generations with 30 members. } \label{fg:ped.sim} \end{figure} We conduct a simulation study to evaluate the performance of the proposed method. Suppose that there are two competing cancers, indicated by $D=1$ and 2, respectively. We simulate 200 families of three generations with 30 members (see Figure \ref{fg:ped.sim}) that are collected through probands indexed by $\{1\}$ in Figure \ref{fg:ped.sim} with the second type of cancers (i.e., $D=2$), as follows: \begin{enumerate} \item We first simulate a genotype $G \sim Bernoulli (0.0001)$ for the proband. Given $G$, we then simulate his/her true time to cancer, $T_k, k = 1,2$, from the following cancer-specific frailty model: \begin{align} \label{eq:model} \lambda_k(t|G) = \lambda_{0,k}(t) \xi_k \exp(\beta_k G), \qquad k = 1, 2, \end{align} with $\beta_1 = 4, \beta_2 = 10$, $\lambda_{0,1}(t) = 0.1 , \lambda_{0,2}(t) = 0.0005$, and $\xi_1, \xi_2 \stackrel{iid}{\sim} Gamma(0.25, 0.25)$. We choose these simulation parameters such that the second type of cancer (i.e., $D=2$) is rare with the prevalence of about 0.0003, while that of the first type of cancer is about 0.05. Random censoring time $C$ is simulated from $Exponential(2)$. To mimic the ascertainment process of the LFS data, only probands with $D=2$ are selected and included in the sample as probands. We repeat the above procedure until 200 probands are collected. \item Given probands' data, we generate genotypes of their family members as follows. If proband $\{1\}$ is a non-carrier ($G = 0$), all family members are set as non-carriers; otherwise, we randomly select one of proband's parents $\{3, 4\}$ as a carrier and set the another as a non-carrier. Offsprings and siblings of the proband, including $\{7,8,9,10,11,12\}$, are set as carriers with probability 0.5. If $\{11\}$ is carrier, his offsprings, including $\{19, 20,21\}$, are set as carries with probability 0.5, otherwise set as noncarriers. Genotypes of $\{22,23,24\}$ are generated similarly based on the genotype of their mother $\{12\}$. Assuming that the mutation is extremely rare, the family members who are not genetically related with the proband, including $\{2,5,6,13,14,15,16,17,18,25,26,27,28,29,30\}$, are set as non-carriers. \item Given the genotypes, the time to cancer of the family members are generated from model \eqref{eq:model}. \item Lastly, we randomly delete genotypes for a half of subjects who are not a proband. \end{enumerate} We set $M=3$ for the Bernstein model for the baseline hazard functions, $\lambda_{0,k}(t), k = 1, 2$. For estimation, we generate 10,000 posterior samples after discarding the first 1,000 samples as burn-in. Trace plots suggest that the posterior sampling converges well. The proposed method has three main components: the family-wise likelihood to handle missing genotypes, the ACJ likelihood to correct the ascertainment bias, and the frailty to capture the family-specific random effects. To evaluate the effects of these three components, we compare our approach with alternative approaches, under which there is (1) no missing genotype, (2) no ascertainment bias correction, and (3) no frailty. Table \ref{tb:sim} shows absolute biases and standard deviations of estimates under different approaches. For the baseline hazard $\lambda_{0,k}(t)$, bias and standard deviation are numerically integrated over $t$. We can see that the estimates without ascertainment bias correction are severely biased, especially for $\beta_2$ and $\lambda_{0,2}(t)$, showing the importance of performing the ascertainment bias correction. In addition, the estimates with frailty tend to have smaller biases than those assuming no frailty. Lastly, the efficiency loss due to missing genotypes is generally small, suggesting that the family-wise likelihood efficiently utilizes the observed data. \begin{table}[!htbp] \begin{center} \begin{tabular}{cl rcrc c rcrc} \hline & &\multicolumn{4}{c}{No bias correction} && \multicolumn{4}{c}{Bias correction} \\ \cline{3-6}\cline{8-11} & Genotype &\multicolumn{2}{c}{No fraility} & \multicolumn{2}{c}{Frailty} && \multicolumn{2}{c}{No fraility} & \multicolumn{2}{c}{Frailty} \\ \cline{1-6}\cline{8-11} \multirow{2}*{$\beta_1$} & No missing & 1.1968 & (.3608) & 0.7818 & (.3385) && 1.0667 & (.3633) & 0.4905 & (.3420) \\ & Missing & 1.4363 & (.4117) & 1.2627 & (.3421) && 1.2824 & (.4120) & 0.8681 & (.3942) \\ \cline{1-6} \cline{8-11} \multirow{2}*{$\beta_2$} & No missing & 5.5993 & (.1973) & 4.7515 & (.2051) && 0.8659 & (.3220) & 0.2347 & (.4627) \\ & Missing & 5.7480 & (.2225) & 5.4368 & (.2267) && 1.2012 & (.3016) & 0.4764 & (.3293) \\ \cline{1-6} \cline{8-11} \multirow{2}*{$\lambda_{0,1}(t)$} & No missing & 0.0227 & (.0366) & 0.0194 & (.0409) && 0.0190 & (.0394) & 0.0116 & (.0479) \\ & Missing & 0.0184 & (.0374) & 0.0167 & (.0398) && 0.0166 & (.0395) & 0.0123 & (.0449) \\ \cline{1-6} \cline{8-11} \multirow{2}*{$\lambda_{0,2}(t)$} & No missing & 0.1025 & (.0505) & 0.0914 & (.0518) && 0.0004 & (.0004) & 0.0043 & (.0038) \\ & Missing & 0.1340 & (.0641) & 0.1116 & (.0540) && 0.0010 & (.0008) & 0.0053 & (.0045) \\ \hline \end{tabular} \caption{Absolute biases and standard deviations (in parentheses) of estimates based on 100 simulations. } \label{tb:sim} \end{center} \end{table} \section{Application} \label{s::analysis} We apply the proposed methodology to analyze the LFS data. We consider three types of LFS-related cancers ($K=3$): breast cancer ($k=1$), sarcoma ($k=2$), and other cancers ($k=3$). Because the individuals with breast cancer in the LFS data are all female (Table \ref{tb::summary2}), we impose the following constraint on the hazard of developing breast cancer: \begin{align} \label{eq:no.male.breast.model} \lambda_1(t|G, X) = \left\{ \begin{array}{ll} 0, & \mbox{for $X = 0$ (male)}, \\ \lambda_{0,1}(t) \xi_{1} \exp\{\beta_{G,1} G\}, & \mbox{for $X = 1$ (female)}, \end{array} \right. \end{align} while other types of cancer ($k = 2,3$) are assumed to follow the model of the form \eqref{eq::frailty.model}. There is only one baseline covariate available in the LFS database (i.e., gender), however our method can readily accommodate more covariates. We ignore all cancers that occurred after 75 years of age and treat them as censored at age 75, since cancers diagnosed after 75 years of age are clinically irrelevant for estimating the penetrance of LFS. \subsection{Model Parameter Estimates} \label{ss::para.est} Posterior estimates for the regression coefficients $\boldsymbol{\beta}_k$ and the inverse of the frailty variances $\boldsymbol{\nu}_k, k = 1, 2, 3$ are reported in Table \ref{tb::posterior}. Genotype has a strong effect on the incidence of all cancer types, with TP53 mutation carriers being more likely to have cancers. Gender also plays a significant role in sarcoma and other cancers. The regression coefficient of gender is negative, suggesting that males in this population are more likely to develop sarcoma and other cancers than females. The estimates of $\nu_k$s are quite large, which suggests that after accounting for the pedigree structure through the family-wise likelihood, within-family correlations are not very strong in this particular dataset. To check this, we compared the penetrance estimates obtained from our model to those from the model that does not include frailty and found them to be quite similar (see {\textit{Supplementary Materials}} Section D.3). Although the model without frailty may be preferred in practice due to its parsimony, we present the results of the frailty model to emphasize that our approach allows for further flexibility; the results are nearly identical in terms of the penetrance estimates. \input{tb_posterior.tex} Figure \ref{fg::baseline} depicts the posterior estimates of the cumulative baseline hazard. Age has stronger effects on breast and other cancers than on sarcoma. The cumulative baseline hazards of breast and other cancers increase exponentially with age, while that of sarcoma increases approximately linearly with age. We observe that the uncertainty of the sarcoma baseline hazard estimate is much larger than those of the others. This is because the ascertainment bias is generated from the probands with sarcoma, which makes the ascertainment-bias-corrected likelihood \eqref{eq::acj} more sensitive to the parameters directly related to sarcoma. \input{fg_baseline.tex} \subsection{Age-at-onset Penetrance} \input{fg_survcurve.tex} The first three panels (a)--(c) of Figure \ref{fg::survcurve} depict the estimated age-at-onset penetrances, $q_k(t|G, X), k = 1, \cdots, 3$, respectively, for breast cancer, sarcoma, and other cancers. It is not surprising that the TP53 mutation carriers ($G = 1$) have higher risk of developing cancer than the non-carriers ($G = 0$), regardless of cancer type. The patterns of cancer-specific penetrance are quite different across cancer types, which justifies the proposed cancer-specific approach. It is of clinical interest that there is a sizable chance that the female TP53 mutation carrier will develop breast cancer before 20 years of age, which is rarely seen in females with BRCA1 and BRCA2 mutations (two well-known susceptibility gene mutations for breast cancer) \citep{berry2002brcapro}. This suggests that early-onset breast cancer is an important feature of TP53 mutation. We also find that non-carriers have very low probability of developing sarcoma, although the data contain many cases of sarcoma in non-carriers due to the use of individuals with sarcoma as probands for collecting the samples (see Table \ref{tb::summary2}). In contrast, ignoring the ascertainment bias leads to substantially biased estimates, see {\textit{Supplementary Materials} Section D.2} for the comparison between our estimates and the estimates without performing ascertainment bias correction. Figure \ref{fg::survcurve}, panel (d) shows the overall age-at-onset penetrance obtained by stacking three cancer-specific penetrances, i.e., $q(t|G,X)= \sum_{k=1}^3 q_k(t|G, X)$. The overall age-at-onset penetrance quantifies the probability of having any type of cancer by a certain age for carriers of TP53 mutations. Among the non-carriers, females have lower cancer risk than males; whereas the female mutation carrier has higher risk than the male mutation carrier due to the excessively high risk of the female carrier developing breast cancer. Overall, TP53 mutation carriers have very high lifetime risk of developing cancer, demonstrating the importance of the accurate detection of TP53 germline mutations. \subsection{Personalized Risk Prediction} \label{s::risk.prediction} An important application of our analysis results and estimate of age-at-onset penetrance $q_k(t|G, X)$ is to provide a personalized risk prediction for future subjects who are at risk of developing LFS-related cancers. Our prediction method has two important advantages. First, it allows us to incorporate the subject's family cancer history to make more accurate risk prediction. Second, it is capable to make risk prediction for a subject without knowing his/her genotype. This is desirable because in practice, genetic test is often of a great financial and psychological burden for patients. Making risk prediction without performing a genetic test allows us to quickly detect individuals with high risk of LFS and provide prompt and proper clinical treatments during an early stage of disease, which is particularly important in the management of rare diseases such as LFS. Specifically, given a family's cancer history $\mathbf{H}_i$ and covariates $\mathbf{X}_i$, the risk that the $j$th individual in the $i$th family will develop the $k$th type of cancer by age $t$, $R_{ijk}(t|\mathbf{H}_i, \mathbf{X}_i)$, is predicted by \begin{align} \label{eq:cs.risk} R_{ijk}(t|\mathbf{H}_i, \mathbf{X}_i) = \Pr(T_{ij} \le t, D_{ij} = k|\mathbf{H}_i, \mathbf{X}_i) = \sum_{G_{ij} \in \{0, 1\}} \mbox{Pr}(G_{ij}|\mathbf{H}_i, \mathbf{X}_i) q_k(t|G_{ij}, X_{ij}). \end{align} That is, the predicted cancer-specific risk is a weighted average of the cancer-specific penetrance $q_k(t|G_{ij}, X_{ij})$. The weight $\mbox{Pr}(G_{ij}|\mathbf{H}_i, \mathbf{X}_i)$, also known as carrier probability, is the likelihood that the subject carries a specific genotype $G_{ij}$, given his/her family cancer history $\mathbf{H}_i$ and covariates $\mathbf{X}_i$. It can be routinely calculated using Bayes' rule and Mendelian laws of inheritance, see {{\it Supplementary Materials} Section B} for details. As we assume that the subject's genotype $G_{ij}$ is unknown, the calculation of the risk in (\ref{eq:cs.risk}) is marginalized over all possible values of $G_{ij}$. To illustrate the utility of our method, consider two hypothetical families that have similar pedigree structures, but different genotypes and cancer histories, as shown in Figure \ref{fg::illu_ped}. Family 1 does not carry the mutated allele and has three cases of cancer (two breast and one other cancers), and family 2 carries the mutated allele with four cases of cancer (one breast, two sarcoma and one other cancers). \begin{figure}[!htbp] \centering \subfigure[Family 1]{ \includegraphics[width = 0.45\textwidth]{ped_neg}} \subfigure[Family 2]{ \includegraphics[width = 0.45\textwidth]{ped_pos}} \caption{Pedigrees of two families, where square and circle represent male and female subjects, respectively. The symbol is partitioned into four sections, which represent statuses of genotype (topleft), breast cancer (bottom left), sarcoma (bottom right), and other cancers (topright). Filled sections represent that the subject carries a mutated allele or had a certain type of cancer. The number in the parentheses is subject's current age. } \label{fg::illu_ped} \end{figure} As mothers (the second generation) in both families had breast cancer, it is of great interest to predict the cancer risk for their daughters, referred to as counselees 1 and 2 in Figure \ref{fg::illu_ped}. We consider two situations: the genotypes of the counselees are known or unknown. Specifically, when the genotypes of the counselees and their family are unknown, we predict the cancer risk for the counselees based on equation \eqref{eq:cs.risk} with the cancer-specific penetrance estimated from the LFS data. When the genotypes of the conselees are known (i.e., conselee 1 is non-carrier and 2 is carrier), the risk prediction is straightforward and the cancer risk of the conselees is simply the estimated cancer-specific penetrances $q_k(t|G, X)$. Figure \ref{fg::illu_risk} shows the predicted cancer-specific risks of the counselees when their genotypes are known and unknown. Clearly, counselee 2 has a substantially higher risk of developing cancer than the counselee 1. Based on this result, we may recommend more frequent cancer screening for counselee 2. We note that counselee 2 has a very low risk of developing sarcoma although her family has two cases of sarcoma. This is because, as shown in Figure \ref{fg::survcurve}(b), the penetrance for sarcoma is high in male, but very low in female. \begin{figure}[!htbp] \centering \subfigure[Counselee 1 ($G$ is known)]{ \includegraphics[width = 0.47\textwidth]{risk_neg_known}} \subfigure[Counselee 1 ($G$ is unknown)]{ \includegraphics[width = 0.47\textwidth]{risk_neg_unknown}} \subfigure[Counselee 2 ($G$ is known)]{ \includegraphics[width = 0.47\textwidth]{risk_pos_known}} \subfigure[Counselee 2 ($G$ is unknown)]{ \includegraphics[width = 0.47\textwidth]{risk_pos_unknown}} \caption{Predicted cancer-specific risk for counselees 1 and 2 when their genotypes $G$ are known or unknown.} \label{fg::illu_risk} \end{figure} \subsection{External and Interval Validation} As an external validation, we compare our estimates of non-carrier penetrance to those provided by the National Cancer Institute on the basis of the Surveillance, Epidemiology, and End Results (SEER) data. SEER is an authoritative source of information on cancer incidence and survival in the United States. It currently collects and publishes cancer incidence and survival data from population-based cancer registries that cover approximately 28\% of the US population. SEER is the only comprehensive source of population-based information in the United States that includes the stage of cancer at the time of diagnosis and patient survival data. The SEER estimate can be regarded as a reference estimate for the normal US population (i.e., non-carrier). More details regarding SEER estimates can be found at \url{http://seer.cancer.gov}. \input{fg_exvalidation.tex} Figure \ref{fg::ex.validation} compares the penetrance of breast cancer, sarcoma, and all cancers for non-carriers to the most recent SEER estimates based on the data collected from 2008 to 2010. We can see that the estimates of non-carrier penetrance are generally consistent with the corresponding SEER estimates, suggesting that the proposed methodology performs well. For the purpose of comparison, we also show the estimate of the overall cancer penetrance based on the conventional Cox model for the time to cancer diagnosis using subjects with known genotypes. As shown in Figure \ref{fg::ex.validation}, panel (c), the estimate of the overall cancer risk based on the proposed method is much closer to the SEER estimate than the estimate based on the Cox model. \input{fg_cvroc.tex} We conduct internal validation through cross-validation. First, we randomly split the data (i.e., 186 families) into two halves. We use one half (i.e., 93 families) as the training families $\{(\mathbf{H}_i^{\textrm{tr}}, \mathbf{X}_i^{\textrm{tr}}, \mathbf{G}_{obs,i}^{\textrm{tr}}), i = 1, \cdots, 93\}$, and the other half as the test families, $\{(\mathbf{H}_{i^\prime}^{\textrm{tr}}, \mathbf{X}_{i^\prime}^{\textrm{tr}}, \mathbf{G}_{obs,i^\prime}^{\textrm{tr}}),$ $i^\prime = 1, \cdots, 93\}$. Next, we estimate the cancer-specific penetrance using the training families, denoted by $\hat q_k^{\textrm{tr}}(t|G, X)$. Based on this estimate and equation \eqref{eq:cs.risk}, we predict the cancer-specific risk at a given age $t_c$ for subjects in the test families, i.e., $R_{i^\prime jk}(t_c| \mathbf{H}_{i^\prime}^\textrm{ts}, \mathbf{X}_{i^\prime}^\textrm{ts})$. Given a certain risk cutoff $\psi$, we predict that a subject will have $k$th type of cancers by age $t_c$ if $R_{i^\prime jk}(t_c| \mathbf{H}_{i^\prime}^\textrm{ts}, \mathbf{X}_{i^\prime}^\textrm{ts})>\psi$. By varying the risk cutoff $\psi$ and comparing the predicted cancer status with the actually observed cancer status of the test families, we obtain the receiver operating characteristic (ROC) curves of our cancer risk prediction model. Figure \ref{fg::cv.roc} depicts the ROC curve of the predicted risk of the test family members at age 50 years for different cancer types. These results show reasonable performance, with the area under the ROC curves (AUC) being 0.773, 0.791 and 0.755 for predicting breast cancer, sarcoma and other cancers, respectively. For breast cancer, the ROC curves are generated from the females only since we assume no breast cancer for the males. We also consider the ROC curves for other caner-onset ages, $t_c = 30, 40$, and $60$ years. The results are generally similar to that of $t_c=50$ years, see {\textit{Supplementary Materials} Section F}. \subsection{Model Comparison} \label{ss:compare} Due to the complicated structure of the LFS data (e.g., family structure, missing genotype, ascertainment bias and competing risks), standard model diagnosis tools for survival models, such as residuals \citep{schoenfeld1982partial,therneau1990martingale} and chi-squared goodness-of-fit tests \citep{hjort1990goodness,hollander1992chi,li1993generalized}, are not applicable here. We assess the adequacy of the proposed model through model comparison. We consider four alternative models. The first three models are obtained by replacing the Bayesian nonparametric baseline hazard model with three parametric models: the exponential, Weibull, and piecewise-constant models, respectively. {For the piecewise-constant model, we use four equally spaced knots to obtain five partitions.} The fourth model is obtained by removing the frailty $\xi_{i, k}$ from the competing risk model (\ref{eq::frailty.model}). We use two metrics to measure the goodness of fit of the models: the deviance information criterion (DIC) and conditional predictive ordinate \citep[CPO,][]{ibrahim2005bayesian}. The DIC measures the overall goodness of fit of a model and the CPO measures the predictive ability of a model. The CPO for the $i$th family is defined as \begin{align} \label{eq::cpo} \mbox{CPO}_i = \Pr(\mathbf{H}_i|{\mathcal{D}_{(-i)}}, \mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\xi}_i, {\mathcal{A}_i}) = \ \left[ E \left(\frac{1}{\Pr(\mathbf{H}_i|\mathbf{G}_{i, obs}, \mathbf{X}_i, \boldsymbol{\xi}_i, \boldsymbol{\theta}, {\mathcal{A}_i})} \right) \right]^{-1} \end{align} where $\mathcal{D}_{(-i)} = (\mathbf{H}_{(-i)}, \mathbf{G}_{(-i), obs}, \mathbf{X}_{(-i)})$ represents the data with the $i$th family data deleted, and the expectation is made with respect to the posterior distribution of $\boldsymbol{\theta}$. The Monte Carlo approximation of \eqref{eq::cpo} is given by $$ \widehat{\mbox{CPO}}_i = \left[\frac{1}{L}\sum_{\ell = 1}^L \frac{1}{\Pr(\mathbf{H}_i|\mathbf{G}_{i, obs}, \mathbf{X}_i, {\hat \boldsymbol{\xi}_{i,(l)}}, {\hat \boldsymbol{\theta}_{(\ell)}}, {\mathcal{A}_i})}\right]^{-1} $$ where $\hat \boldsymbol{\xi}_{i,(\ell)}$ and $\hat \boldsymbol{\theta}_{(\ell)}$ denote posterior samples from the $\ell$th MCMC iteration, $\ell=1, \cdots, L$. Table \ref{tb::compare} shows the DIC and $\sum_{i=1}^I \log \widehat{\mbox{CPO}}_i$, known as the pseudo-marginal log-likelihood (PsML), for the different models. Smaller DIC values and larger PsML values suggest a better model. The proposed model based on Bernstein polynomials provides better goodness of fit and predictive ability than the models with exponential, Weibull, or piecewise-constant baseline hazards. The difference between the proposed model and the model without frailty is small, suggesting a weak within-family correlation. This is concordant with our finding that $\boldsymbol{\nu}$ estimates are large (see Table \ref{tb::posterior}). For the purpose of comparison, we also perform the analysis based only on the subset of the data for whom the genotypes are observed, and the analysis without ascertainment bias correction. The estimates of cancer-specific penetrance under different approaches are provided in {\it Supplementary Materials} (Section D). \begin{table}[!htbp] \begin{center} \begin{tabular} {ccccc} \hline & Baseline & Frailty & & \\ Model & hazard & included & DIC &. PsML \\ \hline 1 &Exponential & Yes & 3273.7 & {$-$1657.120} \\ 2 & Weibull & Yes & 3020.2 & {$-$1512.252} \\ 3 & Piecewise & Yes & 3010.3 & {$-$1513.405} \\ 4 & Bernstein. & No & 2989.3 & {$-$1499.735} \\ Proposed & Bernstein & Yes & 2983.7 & {$-$1499.689} \\ \hline \end{tabular} \caption{Comparison of the proposed model with four alternative models. } \label{tb::compare} \end{center} \end{table} \subsection{Sensitivity Analysis} \label{ss::sensitivity} We consider nine different combinations of priors for $\gamma_{m,k}$ and $\nu_k$: three different priors for $\gamma_{m,k}$ including flat prior, $Gamma(0.01, 0.01)$, and $Gamma(1, 1)$; and three priors for $\nu_k \sim Gamma(0.01, 0.01), Gamma(0.1, 0.1)$ and $Gamma(1, 1)$. The results (see {\textit{Supplementary Materials}} Section E) show that the estimates are not particularly sensitive to the choice of priors. \section{Discussion} \label{s::discussion} In the LFS study, estimating cancer-specific penetrance is not trivial under the presence of competing risks, but is essential for providing better treatment that is personalized to the patient's needs. We developed a cancer-specific age-at-onset penetrance model and proposed an associated Bayesian estimation scheme. The proposed method can incorporate all the family histories in the estimation by exploiting the family-wise likelihood. We also corrected the ascertainment bias, which is an important task in family data studies of rare diseases. One detriment when modeling the cause-specific hazard in competing risk analysis is that covariate effects on the subdistribution (i.e., cancer-specific penetrance) are not interpretable. As an alternative, \citet{fine1999proportional} proposed a proportional model for the subdistribution that enables us to directly assess the covariate effects on the corresponding cancer-specific penetrance. It is not difficult to equivalently rewrite the individual likelihood in terms of the cancer-specific penetrance and the associated derivative \citep{maller2002analysis}. The family-wise likelihood approach can be similarly applied to this alternative modeling approach. In the LFS study, a patient can have multiple primary cancers during his or her lifetime. In the current approach, we consider only the first cancer that occurred and discard all the subsequent cancer history. In order to incorporate a longitudinal history that may involve multiple cancers, our approach can be extended to the so-called multi-state model \citep{putter2007tutorial} to recurrently observe multiple failures. In theory, the multi-state model can be regarded as an extended version of the competing risk model. However, it is practically challenging to collect data for a sufficient number of subjects who have multiple primary cancers in order to attain an appropriate level of estimation accuracy. \section*{Supplementary Material} \label{SM} {\it Supplementary Material} includes an illustrative example of the peeling algorithm, a description of the carrier probability estimation based on family cancer history, additional simulation results for different baseline hazard models, penetrance of LFS estimated by various competing methods, prior sensitivity analysis, and cross-validated ROC curves at different ages. \bibliographystyle{dcu}
{'timestamp': '2018-05-04T02:04:36', 'yymm': '1701', 'arxiv_id': '1701.01558', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01558'}
arxiv
\section{INTRODUCTION}\label{introduction} \subsection{Reinforcement Learning for Industrial Robotics} In a close future, it is likely to see robots programming themselves to carry out new industrial tasks. From manufacturing to assembling, there are a wide range of tasks that can be performed faster and with higher accuracy by robot manipulators. Over the past two decades, reinforcement learning in robotics \cite{survey_RL_robotics, survey_PS_robotics} has made rapid progress and enabled robots to learn a wide variety of tasks \cite{interestRobotRL1, interestRobotRL2, interestRobotRL3}. The emergence of self-programming robots might speed up the development of industrial robotic platforms insofar as robots can learn to execute tasks with very high accuracy and precision. One major step in a robot learning algorithm is the exploration phase. In such phase, random commands are sent to the robot such that it discovers both its environment and the way it responds to commands sent. In this process, random commands are sent to the robot, which can result in any possible movement within its reachable workspace. In an industrial context, such unpredictable behavior is dangerous, for instance when a robot has to learn a task jointly with a human worker (e.g. an assembly task). For this reason, it seems interesting to work with KUKA LBR iiwa robot manipulators, which are very good for collaborative tasks as their compliance can be adjusted easily and they can be programmed to stop when feeling contact. \subsection{Literature Overview} Reinforcement Learning (RL) and Optimal Feedback Control (OFC) are very similar in their formulation : find a policy that minimizes a certain cost function under a certain dynamics (see section \ref{section2} for more details). They both enable to phrase many challenging robotic tasks. Indeed, a solution to such problem is both an optimal open-loop trajectory and a feedback controller. If the dynamics is linear and the cost function quadratic, an optimal solution can be computed analytically using Linear-Quadratic-Regulators theory \cite{optimal_control_book}. When the dynamics is more complex (non-linear), the problem becomes more difficult but can still be solved with iterative Linear-Quadratic-Regulator algorithm (iLQR or iLQG) \cite{iLQG2}. As its name suggests, this algorithm iteratively fits local linear approximations to the dynamics and computes a locally optimal solution under this linear model. In the context of RL, the dynamics is considered unknown. To deal with this issue, \cite{mitrovic, GPS_unknown_dynamics_simulation} have proposed to build the linear model by exploring the environment and make a linear regression. In \cite{CDC16}, we recently proposed another method that consists in computing the cost function likewise, using exploration and quadratic regression. This way, the model is more precise and can converge faster towards high precision tasks, which is the main purpose of our research. Indeed, in some tasks, for example Cartesian positioning, a typical approach \cite{GPS_unknown_dynamics_robot} consists in including the Cartesian position in the state, build a linear model and then build a quadratic cost from this linear approximation. Such approach does not really make sens as this quantity has already been approximated in the first order and thus cannot produce a good second order model for update. \subsection{Main contribution and paper organization} In this paper, we extend the concepts of \cite{CDC16}. Second order methods have been implemented to compute trajectory update and this way increase the speed of convergence by reducing the number of iLQG pass required. We also study the influence of different parameters on the speed of convergence.Such parameters are compared and chosen using the V-REP software \cite{VREP}. Finally, we propose an experimental validation on the physical device, using the parameters found by simulation. The KUKA LBR iiwa learns a positioning task in Cartesian space using angular position control without any geometric model provided. This rather simple task enables to measure easily the accuracy of the policy found. The paper is organized as follows. Derivation of iLQG with learnt dynamics and cost function is written in section \ref{section2}. In section \ref{section3}, we try to find the best learning parameters through simulating the same learning situation with different parameters using the VREP simulation software. Experimental validation on KUKA LBR iiwa is presented in section \ref{section4} and section \ref{discussion} proposes a discussion on the results and future work. \section{LEARNING A LOCAL TRAJECTORY WITH HIGH PRECISION}\label{section2} This section summarizes the method used. First, the derivation of iLQG in the context of unknown dynamics and learnt cost function is written. The second order method to compute the improved controller is explain in a second step. \subsection{A few definitions}\label{subsection21} \begin{figure}[t] \centering \includegraphics[width=3.5cm, height=4.62cm]{trajectory_optimization.pdf} \caption{Definition of a trajectory} \label{trajectory_definition} \end{figure} This section begins with some useful definitions: \begin{itemize} \item A \textbf{trajectory} $\tau$ of length $T$ is defined by the repetition $T$ times of the pattern shown in Fig. \ref{trajectory_definition}. Mathematically, it can be denoted by \begin{displaymath} \{\mathbf{x}_0, \mathbf{u}_0, \mathbf{x}_1, \mathbf{u}_1, ..., \mathbf{u}_{T-1}, \mathbf{x}_{T}\}, \end{displaymath} where $\mathbf{x}_t$ and $\mathbf{u}_t$ represent respectively state and control vectors. In our problem (see section \ref{section3} and \ref{section4}), the state is the vector of joint positions and the actions are joints target positions. \vspace{5pt} \item The \textbf{cost} and \textbf{dynamics} functions are defined as follows: \begin{equation} \label{general_cost} l_t = L_t(\mathbf{x_t}, \mathbf{u}_t), \end{equation} \begin{equation} \label{general_dynamics} \mathbf{x}_{t+1} = F_t(\mathbf{x}_t, \mathbf{u}_t). \end{equation} $L_t$ outputs the cost and $F_t$ the next state, both with respect to previous state and action. \vspace{5pt} \item The \textbf{controller} is the function we want to optimize. For a given state, it needs to output the action with smallest cost that follows the dynamics. In our case, it is denoted by $\Pi$ and has the special special form of a time-varying linear controller: \begin{equation} \label{global_controller} \mathbf{u}_t = \Pi(\mathbf{x}_t) = K_t \mathbf{x}_t + k_t. \end{equation} \end{itemize} The guiding principle of iLQG is to alternate between the two following steps. From a nominal trajectory, denoted by $\mathbf{\bar{x}}_t$ and $\mathbf{\bar{u}}_t$, $ t \in \{0, ..., T\}$, compute a new local optimal controller. From a given controller, draw a new nominal trajectory. \subsection{Local approximations of cost and dynamics}\label{subsection22} As explained earlier, from a given nominal trajectory $\bar{\tau}$, the goal is to update the controller such that the cost is minimized in its neighborhood. In this process, the first step is to compute local approximations of the cost function and dynamics around the nominal trajectory: \begin{equation} \label{local_dynamics} F_t(\mathbf{\bar{x}}_t + \mathbf{\delta x}_t, \mathbf{\bar{u}}_t + \mathbf{\delta u}_t) = \mathbf{\bar{x}}_{t+1} + F_{xu_t} \mathbf{\delta xu}_t, \end{equation} \begin{IEEEeqnarray}{l} \label{local_cost} L_t(\mathbf{\bar{x}}_t + \mathbf{\delta x}_t, \mathbf{\bar{u}}_t + \mathbf{\delta u}_t) = \bar{l}_t + L_{xu_t} \mathbf{\delta xu}_t + \nonumber\\ \frac{1}{2} \mathbf{\delta xu}_t^T L_{xu,xu_t} \mathbf{\delta xu}_t, \end{IEEEeqnarray} where $\mathbf{\delta x}_t$ and $\mathbf{\delta u}_t$ represent variations from the nominal trajectory and $xu_t$ is the vector $[x_t,u_t]^T$. The notation $A_z$ (resp. $A_{z_1,z_2}$) is the Jacobian (resp. Hessian) matrix of $A$ w.r.t. $z$ (resp. $z_1$ and $z_2$). We propose to compute both approximations following an exploration and regression scheme. The first stage generates a certain number $N$ of random trajectories around the nominal. These trajectories are normally distributed around $\bar{\tau}$ with a certain time-varying covariance $\Sigma_t$. Hence, during the sample generation phase, the controller is stochastic and follows: \begin{equation} \label{global_controller} P(\mathbf{u}_t|\mathbf{x}_t) = \mathcal{N}(K_t \mathbf{x}_t + k_t, \Sigma_t), \hspace{5pt} \forall t \in \{0, ..., T\}, \end{equation} where $\mathcal{N}$ stands for normal distribution. From these samples, we can make two regressions a linear one to get the dynamics and a second order polynomial one \cite{polyreg} to approximate the cost function. \subsection{Update the controller} This section is about updating the controller once we have good Taylor expansions of the dynamics and cost function. In order to get a controller with low cost over the whole trajectory, we need to use the two value functions: $Q$ and $V$. $Q^{\Pi}_t$ represents the expected cost until the end of the trajectory if following $\Pi$ after being in state $x_t$ and selecting action $u_t$. $V^{\Pi}_t$ is the same but conditioned only on $x_t$, if $\Pi$ is deterministic, these two functions are exactly the same. The reader can refer to \cite{RL_textbook} for more detailed definitions of these value functions. First, we need to compute quadratic Taylor expansions of both value functions: \begin{IEEEeqnarray}{l} \label{local_Q} Q^{\Pi}_t(\mathbf{\bar{x}}_t + \mathbf{\delta x}_t, \mathbf{\bar{u}}_t + \mathbf{\delta u}_t) = Q_{0_t} + Q_{xu_t} \mathbf{\delta xu}_t + \nonumber\\ \frac{1}{2} \mathbf{\delta xu}_t^T Q_{xu,xu_t} \mathbf{\delta xu}_t, \end{IEEEeqnarray} \begin{equation} \label{local_V} V^{\Pi}_t(\mathbf{\bar{x}}_t + \mathbf{\delta x}_t) = V_{0_t} + V_{xu_t} \mathbf{\delta xu}_t + \frac{1}{2} \mathbf{\delta xu}_t^T V_{xu,xu_t} \mathbf{\delta xu}_t. \end{equation} In the context of trajectory optimization defined above, \cite{GPS_unknown_dynamics_robot} shows that these two functions can be approximated quadratically by \begin{IEEEeqnarray}{l} \label{new_Q} Q_{xu,xu_t} = L_{xu,xu_t} + F_{xu_t} V_{x,x_{t+1}} F_{xu_t}^T, \nonumber\\ Q_{xu_t} = L_{xu_t} + V_{x_{t+1}} F_{xu_t}^T, \nonumber\\ V_{x,x_t} = Q_{x,x_t} + Q_{u,x_t}^T Q_{u,u_t}^{-1} Q_{u,x_t}\nonumber\\ V_{x_t} = Q_{x_t} + Q_{u,x_t}^T Q_{u,u_t}^{-1} Q_{u_t}^T. \end{IEEEeqnarray} These functions are computed backward for all the time steps, starting with $V_T = l_T(x_T)$, the final cost. Under such quadratic value functions, following the derivation in \cite{iLQG}, we can show that the optimal controller under such dynamics and cost is defined by \begin{IEEEeqnarray}{l} \label{new_Q} K_t=-Q_{u,u_t}^{-1} Q_{u,x_t}, \nonumber\\ k_t=\bar{u_t} -Q_{u,u_t}^{-1} Q_{u_t} - K_t \bar{x_t}. \end{IEEEeqnarray} A criterion to compute the new covariance is also needed. The goal being to explore the environment, we follow \cite{GPS} and choose the covariance with highest entropy in order to maximize information gained during exploration. Such covariance matrix is: \begin{equation} \Sigma_t = Q_{u,u_t}^{-1}. \end{equation} \subsection{Limit the deviation from nominal trajectory} The controller derived above is optimal only if the dynamics and cost are respectively linear and quadratic everywhere. The approximations being only valid locally, the controller needs to be kept close from the nominal trajectory to remain acceptable for update. This problem can be solved by adding a constraint to the cost minimization problem: \begin{equation} \label{KL_constraint} D_{KL}(p_{new}(\tau)||p_{old}(\tau)) \leq \epsilon, \end{equation} where $D_{KL}$ is the statistical Kullback-Leibler divergence. $p_{old}(\tau)$ and $p_{new}(\tau)$ are the probability trajectory distributions under the current controller and the updated one. \cite{GPS_unknown_dynamics_robot} shows that such constrained optimization problem can be solved rather easily by introducing the modified cost function: \begin{equation} l_{mod}(x_t, u_t) = \frac{1}{\eta} l(x_t, u_t) - \log(p_{old}(x_t, u_t)) \end{equation} Indeed, using dual gradient descent, we can find a solution to the constrained problem by alternating between the two following steps: \begin{itemize} \item Compute the optimal unconstrained controller under $l_{mod}$ for a given $\eta$ \item If the controller does not satisfy (\ref{KL_constraint}), increase $\eta$. \end{itemize} A large $\eta$ has the effect of increasing the importance on constraint satisfaction, so the larger $\eta$ is, the closer the new trajectory distribution will be from the previous one. \subsection{Initialize $\eta$ and choose $\epsilon$} The way $Q$ is defined from approximation does not guaranty positive definiteness for $Q_{u,u_t}$. Which means that it might not be eligible to be a covariance matrix. This issue is addressed by increasing $\eta$ such that the distribution is close enough from the previous one. As the previous trajectory has a positive definite covariance, there must be an $\eta$ that will enforce positive definiteness. This gives a good way to initialize $\eta$ for a given pass. Finally, the choice of $\epsilon$ is very important. If it is too small, the controller sequence won't progress towards optimality. On the other hand, if it is too large, it might be unstable. The idea is to start with a certain $\epsilon_{ini}$ and decrease it if the new accepted controller is worst than the previous one. \section{KUKA LBR IIWA POSITIONING: TUNE THE LEARNING PARAMETERS}\label{section3} A validation of the method is proposed on learning a simple inverse kinematics task. We consider a KUKA LBR iiwa robot (Fig. \ref{iiwa_VREP}), where the geometric parameters are unknown. The state variables are the joints angular positions and the control vector gathers target joints positions for next state. The idea is to reach a Cartesian position of the end effector with high accuracy ($<0.1mm$) without any geometric model. \subsection{Cost function} For this problem, the cost function needs to be expressed in terms of the Cartesian distance between the end-effector and the target point. We chose the cost function proposed in \cite{GPS_unknown_dynamics_robot}: \begin{equation} l(d)=d^2 + v \log(d^2 + \alpha), \end{equation} where $v$ and $\alpha$ are both real user defined parameters. As we do not consider any geometric parameter of the robot, the distance cannot be obtained with direct model considerations and needs to be measured from sensors. \subsection{Tune the algorithm parameters} Previous work \cite{CDC16} showed that a number of samples around $40$ is a good balance between accurate quadratic regression and exploration time for $7$ d.o.f. robots. So we carry out our experiments with $N=40$. Among all the parameters defined in previous sections, we identified $4$ critical ones : $cov_{ini}$ (the initial covariance, defined below), $v$ and $\alpha$ from the cost function, $\epsilon_{ini}$. In this section, we learned optimal angular positions for the situation below with different sets of values on these parameters using V-REP simulation software. The situation is the following: \begin{itemize} \item Initial position : All $7$ angles at $0$ (straight position on Fig. \ref{iiwa_VREP}) \item Target position : Cartesian vector $[500, 500, 500]^T$ in $mm$, in the robot frame (red sphere on Fig. \ref{iiwa_VREP}) \item Initial mean command : target angular positions = initial positions (no move command). \end{itemize} Fig. \ref{iiwa_VREP} show a trajectory found by the algorithm. The initial covariance matrix is also an important parameter as it defines the exploration range for all the future steps. Indeed, if it has large values, next iteration needs to have large covariance also because of (\ref{KL_constraint}). In our implementation, we start with diagonal covariance matrix where all the diagonal entries are the same. we denote $cov_{ini}$ the initial value of such diagonal entries, it is one of the parameters to be studied. \begin{figure}[t] \centering \includegraphics[width=4cm, height = 5.6cm]{iiwa_fl.PNG} \caption{Trajectory learnt on V-REP software with a KUKA LBR iiwa} \label{iiwa_VREP} \end{figure} \subsection{Results and analysis} From what we acknowledged running our algorithm, we picked up three values for each parameter and tried all the $81$ possible combinations to choose a good set of parameters for positioning task. Results obtained are summarized in table \ref{table_result}. In our simulation, the robot was only allowed $16$ trials to reach $0.1mm$ precision. Thus, we insist that in table \ref{table_result}, an underlined number represents the number of iLQG iterations before convergence whereas other numbers are the remaining distance to objective after $16$ iterations. \begin{table}[ht] \caption{Algorithm parameters influence} \begin{center} \begin{tabular}{c|c|c|c|c} \multicolumn{5}{c}{$cov_{ini}=1$}\tabularnewline \hline \multirow{2}{*}{$v$} & \multirow{2}{*}{$\epsilon_{ini}$} & \multicolumn{3}{c}{$\alpha$}\tabularnewline & & $10^{-3}$ & $10^{-5}$ & $10^{-7}$\tabularnewline \hline \multirow{3}{*}{$0.1$} & \textcolor{Black}{100} & \underline{\textcolor{Black}{11}} & \underline{\textcolor{Black}{16}} & \underline{\textcolor{Black}{13}}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{0.25} & \underline{\textcolor{gray}{12}} & \underline{\textcolor{gray}{10}}\tabularnewline & \textcolor{Blue}{10000} & \underline{\textcolor{Blue}{13}} & \textcolor{Blue}{0.27} & \underline{\textcolor{Blue}{8}}\tabularnewline \cline{1-5} \multirow{3}{*}{$1$} & \textcolor{Black}{100} & \textcolor{Black}{0.11} & \underline{\textcolor{Black}{14}} & \underline{\textcolor{Black}{16}}\tabularnewline & \textcolor{gray}{1000} & \underline{\textcolor{gray}{10}} & \underline{\textcolor{gray}{12}} & \underline{\textcolor{gray}{10}}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{0.10} & \textcolor{Blue}{1.69} & \textcolor{Blue}{0.24}\tabularnewline \cline{1-5} \multirow{3}{*}{$10$} & \textcolor{Black}{100} & \textcolor{Black}{0.11} & \textcolor{Black}{0.22} & \textcolor{Black}{0.84}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{0.13} & \underline{\textcolor{gray}{12}} & \textcolor{gray}{0.20}\tabularnewline & \textcolor{Blue}{10000} & \underline{\textcolor{Blue}{13}} & \textcolor{Blue}{0.23} & \underline{\textcolor{Blue}{15}}\tabularnewline \hline \end{tabular} \vspace*{2.5mm} \begin{tabular}{c|c|c|c|c} \multicolumn{5}{c}{$cov_{ini}=10$}\tabularnewline \hline \multirow{2}{*}{$v$} & \multirow{2}{*}{$\epsilon_{ini}$} & \multicolumn{3}{c}{$\alpha$}\tabularnewline & & $10^{-3}$ & $10^{-5}$ & $10^{-7}$\tabularnewline \hline \multirow{3}{*}{$0.1$} & \textcolor{Black}{100} & \textcolor{Black}{0.32} & \textcolor{Black}{0.15} & \textcolor{Black}{0.39}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{0.45} & \textcolor{gray}{0.28} & \textcolor{gray}{0.22}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{0.30} & \textcolor{Blue}{0.29} & \textcolor{Blue}{0.31}\tabularnewline \cline{1-5} \multirow{3}{*}{$1$} & \textcolor{Black}{100} & \textcolor{Black}{0.14} & \textcolor{Black}{0.32} & \textcolor{Black}{0.32}\tabularnewline & \textcolor{gray}{1000} & \underline{\textcolor{gray}{14}} & \textcolor{gray}{1.93} & \textcolor{gray}{1.70}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{1.82} & \textcolor{Blue}{0.99} & \textcolor{Blue}{0.11}\tabularnewline \cline{1-5} \multirow{3}{*}{$10$} & \textcolor{Black}{100} &\textcolor{Black}{0.34} & \textcolor{Black}{0.38} & \textcolor{Black}{0.39}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{0.71} & \textcolor{gray}{0.29} & \textcolor{gray}{0.53}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{0.70} & \textcolor{Blue}{0.14} & \textcolor{Blue}{2.31}\tabularnewline \hline \end{tabular} \vspace*{2.5mm} \begin{tabular}{c|c|c|c|c} \multicolumn{5}{c}{$cov_{ini}=100$}\tabularnewline \hline \multirow{2}{*}{$v$} & \multirow{2}{*}{$\epsilon_{ini}$} & \multicolumn{3}{c}{$\alpha$}\tabularnewline & & $10^{-3}$ & $10^{-5}$ & $10^{-7}$\tabularnewline \hline \multirow{3}{*}{$0.1$} & \textcolor{Black}{100} & \textcolor{Black}{12.79} & \textcolor{Black}{12.42} & \textcolor{Black}{17.83}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{4.42} & \textcolor{gray}{0.30} & \textcolor{gray}{3.50}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{2.88} & \textcolor{Blue}{10.93} & \textcolor{Blue}{2.60}\tabularnewline \cline{1-5} \multirow{3}{*}{$1$} & \textcolor{Black}{100} & \textcolor{Black}{24.37} & \textcolor{Black}{15.75} & \textcolor{Black}{10.13}\tabularnewline & \textcolor{gray}{1000} & \textcolor{gray}{7.66} & \textcolor{gray}{6.32} & \textcolor{gray}{1.87}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{2.67} & \textcolor{Blue}{8.37} & \textcolor{Blue}{6.44}\tabularnewline \cline{1-5} \multirow{3}{*}{$10$} & \textcolor{Black}{100} & \textcolor{Black}{1.93} & \textcolor{Black}{8.93} & \textcolor{Black}{$10^{11}$}\tabularnewline & \textcolor{gray}{1000} & \color{gray}{8.03} & \textcolor{gray}{2.23} & \textcolor{gray}{3.50}\tabularnewline & \textcolor{Blue}{10000} & \textcolor{Blue}{2.70} & \textcolor{Blue}{4.83} & \textcolor{Blue}{2.60}\tabularnewline \hline \end{tabular} \\[5pt] \label{table_result} \caption*{ \textit{ An underlined figure represents the number of iLQG iterations to reach $0.1mm$ precision, Other numbers represent the distance remaining after $16$ iterations.}} \end{center} \end{table} Together with the raw data in table \ref{table_result}, we plot the evolution of the distance within the iterations of a simulation for several sets of parameters. Looking at table \ref{table_result}, it seems that the most critical parameter is $cov_{ini}$. Fig. \ref{cov_curve} shows three learning curves where only $cov_{ini}$ varies. From here it appears that the initial covariance is not crucial in the early stages of the learning process. However, looking at the bottom plot, which is a zoom on the final steps, we acknowledge that if the covariance is too large, the algorithm will not converge towards the desired accuracy behavior. Hence, we recommend to keep $cov_{ini}$ around $1$ to obtain the desired accurate behavior. \begin{figure}[tb] \centering \includegraphics[width=2.5in]{covariance_influence.pdf} \caption{Covariance variation for $v=1$, $\alpha=10^{-5}$, $\epsilon_{ini}=1000$} \label{cov_curve} \end{figure} After setting $cov_{ini}$ to $1$, we made the same plots for the other parameters (Fig. \ref{other_curves}). These reveal that $v$ and $\alpha$ do not appear to influence the behavior in this range of values. However, looking at the bottom plot, we can see that $\epsilon_{ini}$ needs to be kept large enough such that an iLQG iteration can make enough progress towards optimality. For small $\epsilon_{ini}$, we waste time stuck near the initial configuration. For the three plots in Fig. \ref{other_curves}, the zooms are not included as they do not reveal anything more. \begin{figure}[tb] \centering \includegraphics[width=2.7in]{other_influence.pdf} \caption{Variation of other parameters for $cov_{ini}=1$. When they do not vary, other parameters take the following values : $v=1$, $\alpha=10^{-5}$, $\epsilon_{ini}=1000$} \label{other_curves} \end{figure} Results in table \ref{table_result} seem to correspond to what has been said above. Hence, for the experimental validation in section \ref{section4}, we choose the configuration with smallest number of iterations: $cov_{ini}=1$, $v=0.1$, $\alpha=10^{-7}$ and $\epsilon_{ini}=10000$. \section{EXPERIMENTAL VALIDATION ON THE ROBOT}\label{section4} In this section, we run our algorithm on a real KUKA LBR iiwa for a similar positioning task. The situation is slightly different: \begin{itemize} \item Initial position : $[140,0,0,0,0,0,0]^T$, angular positions in $^{\circ}$ (Fig. \ref{iiwa_pictures}, left picture) \item Target position : $[-600,400,750]^T$, Cartesian position, in $mm$ and in the robot frame. \item Initial mean command : target angular positions = initial positions (no move command). \end{itemize} \begin{figure}[!tb] \centering \includegraphics[width=4cm, height = 4.8cm]{iiwa_initial_optimized.jpg} \includegraphics[width=4cm, height = 4.8cm]{iiwa_final_optimized.jpg} \caption{Initial configuration of the KUKA LBR iiwa.} \label{iiwa_pictures} \end{figure} The choice of changing the initial configuration was motivated by two reasons. First, it enables to show that the parameters found in section \ref{section3} are not case dependant. Second, we had constraints with our working environment and this configuration was better regarding research going on with other robots simultaneously. Fig. \ref{iiwa_pictures} shows the KUKA LBR iiwa in its initial and final configuration (after reaching the desired end-effector position). \subsection{Results obtained on the robot} The learning process defined above resulted in the learning curve on Fig. \ref{LCrobot}. We note that it takes as many steps to go from initial configuration to $1mm$ accuracy than from $1mm$ to $0.1mm$. The final command provided by the algorithm is $[144.266,25.351,2.328,-56.812,5.385,24.984,4.754]^T$. Regarding the learning time, the overall process took approximately $9$ minutes, $6$ for exploration and $3$ for calculations. \begin{figure}[tb] \centering \includegraphics[]{learning_curve_robot.pdf} \caption{Learning curve iLQG on the robot.} \label{LCrobot} \end{figure} \subsection{Measure the Cartesian distance}\label{measurements} On this experimental validation, the distance was computed from the end-effector position read from the robot internal values. Even if it was probably computed thanks to direct DH model, our algorithm used it as an output from a black box. Thus, similar results would have been obtained using any other distance measurement sensor (e.g. laser tracker). We just note that, the precision reached is relative to the measurement tool precision. However, in future work, it will be useful to use an external measurement tool in order to compare our positioning method precision with other techniques. Indeed, the precision of the inverse kinematics of the robot cannot be defined with internal robot measurements. The previous statement is precisely the reason why we need to calibrate industrial robots. Hence, we will need to train the robot with external distance measurement sensors and to compare the precision with other methods using the same sensors. \section{DISCUSSION}\label{discussion} In previous work \cite{CDC16}, we showed that learning the cost function is more stable and converges faster than including distance in the state and approximate it in the first order. Here, we extend this work with second order improvement of the controller, which shows faster convergence properties under well chosen parameters. The high precision reached for this simple positioning task let us hope that such methods will be suitable for more complex industrial tasks. In many applications, it is also interesting to handle orientation of the end effector. Such modification is not an issue, one just needs to make several points on the end effector match several target points ($2$ or $3$ depending on the shape of the tool). This has been done with V-REP and converges just as well, even if taking more time. We chose not to present these results in this paper as they do not show any additional challenge and learning curves are less easy to interpret as distances are to be averaged between the three points. In future work, we plan on trying to handle manipulation tasks with contact, which is a major challenge as the functions to approximate will not be smooth anymore near contact points. \FloatBarrier \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:01:58', 'yymm': '1701', 'arxiv_id': '1701.01497', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01497'}
arxiv
\section{Conclusion}\label{sec:conclusion} In this paper we consider the design, implementation and evaluation of virtual network migration on GENI as a working example of a future SDN-enabled wide-area infrastructure. VN migration adds network agility to the repertoire of network functions and provides a mechanism that enables the deployment of important policies for resource management, energy conservation and attack defense. We show how agility can be enabled on top of GENI's slicing approach, enumerate and address challenges in the design of efficient VN migration mechanisms, and develop and deploy an implementation of a controller architecture that achieves our VN migration objectives. We perform a set of experiments that help us understand the implications of various design decisions and network parameters on VN migration performance. Our work also exposes some limitations on the current design of GENI. \section{Mitigating GENI Limitations}\label{sec:suggestion} When we started our work, our goal was to design, implement, and evaluate an efficient VN migration mechanism in GENI as an example of a future SDN-enabled wide-area network. While it is possible to deploy virtual networks on GENI and use proper remote scheduling implementation to enable live migration, we observe that some GENI limitations complicate the design. These constraints are not only particular to our VN migration research, but may also apply to other types of experimentation. We summarize the features that are not well supported by GENI. This will aid in future GENI development and also in informing the designs of GENI-inspired SDN-enabled wide area infrastructure. \subsection{Interaction with the Substrate Network} GENI deploys virtualization architectures to share physical resources for simultaneous experiments. It provides multiple models of virtualization to cater for different levels of performance and isolation requirements. However, experimenters are only free to select from the provided virtualization models, and do not have the privilege to modify the model or build an alternative one. In particular, we have the following constraints if our experimentation explores the interaction between the virtualized architectures and the substrate networks. \paragraph{Little knowledge about substrate networks} Under the current GENI context, we only have access to limited information about the substrate network such as the geographical information about GENI aggregates and VM load on each physical machine. Without sufficient real-time information about the physical substrate, it is difficult or impossible to implement an algorithm that has interaction with the substrate network. For example, some VN migration research may require real-time statistics about the substrate network to determine when to trigger the migration and where to migrate a VN. More generally, to support experimentation where the placement of the virtual topology is affected by the performance of the substrate network, we expect GENI to expose more network statistics such as link utilization, throughput, and latency. \paragraph{Difficulty in debugging} The virtualization techniques are deployed on GENI to support simultaneous experiments on limited physical infrastructure. However, virtualized architecture not only implies a trade-off between performance and isolation, but also makes debugging challenging. The virtualization architecture may bring unexpected problems, and the limited access to physical substrate further increases the difficulty in debugging. In our VN migration research, we had a hard time finding the cause of the duplicated packets when shared VLANs are used. We can only debug by observing the traffic in virtual topology and infer what is happening in the physical substrate. We expect GENI to develop efficient debugging tools to make the debugging process easier. Besides, it is impossible to debug without a deep understanding of the mechanisms (e.g., how shared VLAN works). Most GENI tutorials only introduce how to use their features. It would be helpful if GENI can include more architecture design of GENI features in its tutorials. \paragraph{No control of substrate networks} We have flexibility to assign bandwidth to our virtual links in the reservation stage, but we cannot adjust parameters for the substrate network. Therefore, it is difficult to evaluate an algorithm with bandwidth constraints. This constraint makes it difficult to observe how dynamics in physical substrate such as changes in bandwidth or latency can affect the performance of a virtualized architecture. \subsection{Multi-domain Network Research} In GENI, a slice is a unit that contains all computing and networking resources for an experiment. The common usage of GENI is to reserve all resources for an experiment within an slice and isolate different slices. One possible design for multi-domain network experiment is to place all domains within the same slice and build different administrative controllers to handle different domains. The disadvantage is obvious: there is no isolation among domains, and we are unable to add more domains to dynamically scale up the networks. Alternatively, we can place one domain on one slice with isolated administration. To enable inter-slice communication, we need to use shared VLANs to connect slices, which complicate the virtual topology and makes it difficult to scale up. Neither of the two designs are ideal solutions for experiments that involves multiple domains. \subsection{Dynamic Resource Reservation} The GENI platform requires experimenters to reserve all resources on GENI slices before running their experiments. Most GENI resource does not provide flexibility to partially modify the resources. In our work, we take advantage of the shared VLAN feature to make resource reservation more dynamic. This resource reservation method requires the experimenters to consider which virtual links in the first slice should be converted to shared VLAN at the beginning when they design their experiments. Each design is particular to a specific topology: whenever we need a new virtual topology, we need to reconsider the shared VLAN. The restriction in resource reservation makes it difficult to scale up an experiment. \section{Migration Controller Architecture}\label{sec:implementation} The migration controller stands in the center of our migration architecture and is responsible for the migration process. It clones the flow tables from the old switches to the new switches, schedules the migration sequences and switches traffic between VNs. We implement our migration controller on GENI using the POX controller platform \cite{pox-controller}. The migration controller runs on the POX controller while other client applications keep operating normally. The controller architecture is shown in Figure \ref{fig:advanced-controller}. \begin{figure} \vskip -5pt \centering \includegraphics[width=0.5\textwidth]{./figure/advanced_controller.png} \vskip -5pt \caption{Migration controller architecture} \vskip -10pt \label{fig:advanced-controller} \end{figure} \textbf{Mapping Module}: specifies how to map the switches in the old VN to the switches in the new VN. It also includes mapping of the virtual network interfaces in the old switches and in the new switches. When reserving resources on GENI, we cannot specify virtual network interfaces in the request Rspec file and GENI aggregate arbitrarily assigns virtual network interfaces to VMs. We need to query the virtual network interface corresponding to a certain IP address and store that information in the Mapping Module. \textbf{Flow Table Manager}: When a request for VN migration is initiated, the Flow Table Manager polls switches that are affected by migration, translates flow tables from the old VN based on the mapping information stored in the Mapping Module, and installs the flows into the new switches. \textbf{Scheduler}: calculates the sequence of rule installation based on our traffic redirection algorithm to minimize the packet loss. \textbf{Traffic Redirector}: After all flows are successfully installed, the Flow Table Manager notifies the Traffic Redirector to generate traffic redirection commands. The traffic Redirector retrieves the sequence of rule installation from the Scheduler and redirects the traffic from the old VN to the new VN. \textbf{VN Presenter}: intercepts events from switches, translates them based on mapping information from the Mapping Module, and presents a consistent VN topology to client applications. This module hides all migration process from clients. \textbf{Status Monitor}: collects dynamic network statistics and decides where and when to migrate based on the VN placement algorithm. Our focus is to migration mechanisms, thus we have not implemented the Status Monitor. \textbf{Migration API}: Migration APIs are similar to OpenFlow controller APIs so that client applications adapt to the new APIs easily. The migration APIs allow client SDN applications to configure migration parameters such as migration destinations and triggering requirements. The client SDN applications should use migration API to retrieve virtual switch information, the connections to virtual switches, and events from virtual switches to get a consistent view of the VN. \section{Introduction} Virtualization is well-recognized as a technique to share physical resources, providing the appearance of dedicated resources and isolation from others sharing the same physical resources. Virtual networks run over a physical network substrate, with an allocation of physical network resources (e.g., routers, switches, links, paths, or portions thereof) to the virtual network. A virtual network (VN) thus contains a collection of virtual nodes and virtual links assigned to a subset of the underlying physical resources. A virtual link spans one or more physical links in the substrate, and a substrate node can host multiple virtual nodes. Network virtualization allows significant flexibility in network operation. Most important are the flexibility in the VN's {\em placement} (the specific mapping of VNs elements to substrate resources \cite{VNmappingsurvey}) and VN {\em agility} (the ability to remap the VN to a different set of substrate resources over time). Our interest in this paper is on enabling VN agility through {\em VN migration} mechanisms. This refers to the process of remapping some or all of a VN's logical topology to a new set of physical resources. VN migration research considers both {\em policy}, when and why a VN is migrated, and {\em mechanism}, how a VN is migrated. Research into VN migration policy is motivated by specific objectives. These have included: efficient utilization of dynamic resources \cite{fan2006dynamic,fajjari2011vnr}, recovery from failure \cite{tang2008efficient,gillani2012fine}, defending against attacks \cite{gillaniagile}, and reducing energy consumption \cite{MiucciVN}. Our focus in this paper is on VN migration mechanisms. The development of such mechanisms can be quite challenging because of the desire to make them {\it transparent} or {\it seamless} -- informally, with minimal impact on running applications. A further challenge is that a VN migration mechanism is highly dependent on the technology deployed in the substrate. There is, therefore, no generic mechanism that can be used universally. Previous research has developed mechanisms for VN migration in different environments. In the data center context, Ghorbani et al. develop migration methods within their LIME architecture that provably meet a transparency definition based on valid behaviors in a migration-free setting~\cite{ghorbani2014transparent}. In the wide-area context, Lo et al.~\cite{lo2014virtual} develop a tool for VN migration in PlanetLab~\cite{chun2003planetlab}, a well-known shared infrastructure used for network experimentation. Their PL-VNM tool implements a migration schedule heuristic that minimizes packet loss under ideal conditions, but in practice cannot ensure zero loss, due in part to coarse timing control in PlanetLab. In this paper we focus on developing VN migration mechanisms for GENI, a recently developed infrastructure for sharing wide-area network resources~\cite{berman2014geni}. A key technology included in GENI is software-defined networking (SDN) where the packet-processing rules in switches are installed and modified from a logically-centralized controller~\cite{mckeown2008openflow}. SDNs offer a number of advantages including ease of network management and the opportunity for increased innovation. Our focus on GENI is motivated by the fact that SDN-enabled wide-area networks are likely to become an important building block of future networking and GENI represents a fully-functional instantiation of this technology. As such, techniques developed for GENI will have wider applicability. Further, because SDN technology is at a stage where its future can be influenced, lessons we learn about the capability of such technology in supporting network agility can have significant value on future developments. \begin{figure}[h] \vskip -10pt \centering \includegraphics[width=0.5\textwidth]{./figure/migration_steps.png} \vskip -10pt \caption{VN migration process from VN1 to VN2:In step 1, setup VN1 and connect virtual switches in VN1 to the SDN controller. In step 2, setup VN2 and connect virtual switches in VN2 to the SDN controller. In step 3, the migration controller clones flow tables from VN1 to VN2 based on the mapping. In step 4, connect VN2 with the hosts and disconnect VN1.} \vskip -15pt \label{fig:migration-steps} \end{figure} Our work focuses on migrating an entire VN from the initial placement to the final placement, without moving the hosts~\footnote{ Note that this model for hosts differs from the data center context where hosts are migrated with the VN. In shared wide-area infrastructure, we assume the hosts are customer-premise equipment and remain in place when the VN moves.}. Figure \ref{fig:migration-steps} illustrates the migration steps assuming an SDN-enabled infrastructure. A migration controller interacts with the SDN controller to initialize and schedule the migration process. Prior to migration, virtual switches on the VN1 are controlled by the client application running on the SDN controller, and VN1 is used to deliver traffic (Step 1). When the migration starts, VN2 is setup (Step 2) and flow tables on the virtual switches in VN1 are cloned to the virtual switches in VN2 based on the mapping (Step 3). The migration controller issues commands to reconnect hosts from VN1 to VN2 in Step 4 and to disconnect VN1. This paper addresses several challenges in realizing the basic VN migration steps above. In addressing these challenges we make the following contributions: (1) We develop approaches that enable VN agility in the SDN-enabled GENI infrastructure; (2) Develop and evaluate options for dealing with the dynamic allocation of resources inherent in migration, where the initial mapping to physical resources is known but the future mappings necessitated by migration may not be; (3) Propose an approach for managing the hosts that connect to the VN and will remain in place when the VN migrates; (4) Develop techniques to mitigate the disruption caused by live VN migration, to minimize packet loss observed by the application in the data plane and to maintain the topological view in the control plane (as observed by the application running on the SDN controller). We carefully manage process steps and flow table migration sequences to achieve this; (5) Evaluate, using an implementation running on GENI, how the performance of live VN migrations as a function of design decisions and network parameters; and (6) Expose some limitations of the GENI infrastructure and propose approaches to their mitigation. The remainder of the paper is structured as follows. In Section \ref{sec:background} we develop a framework for enabling VN agility within the context of the GENI substrate technology. We highlight a decision regarding VN migration related to the allocation of resources in or across GENI slices. Section \ref{sec:migration-challenges} proposes mechanisms to address the challenges associated with VN migration on GENI to meet the goals of efficiently and transparency and our solutions. We develop a controller architecture and describe the deployment of our VN migration mechanism within GENI in Section \ref{sec:implementation}. In Section \ref{sec:performance-evaluation} we present results from experiments conducted using our prototype with the aim of evaluating its performance. Section \ref{sec:suggestion} discusses GENI limitations that were exposed by our research and approaches to address them. Related Work is covered in Section \ref{sec:related-work}. We conclude the paper in Section VIII. \section{Dealing with VN Migration Challenges}\label{sec:migration-challenges} After VN agility is enabled in GENI as discussed in the previous section, we are still faced with several challenges as we strive to meet the goals of efficiency and transparency. In this section we investigate three distinct challenges and propose mechanisms to deal with them. The challenges are: (1) how to manage inter-slice communication that connects the hosts to both VNs temporarily during the migration; (2) how to minimize packet loss by scheduling the flow table migration sequence; and (3) how to provide a seamless interface to SDN applications during and after migration. The first challenge is specific to a sliced platform like GENI and the other two challenges can be generalized to other SDN environment. In the section following this one we use the solutions for each challenge to inform the design of a migration controller architecture. \subsection{Inter-slice Connection}\label{inter-slice-connection-section} We described two VN-to-Slice allocation options in Section \ref{vn-to-slice-section}. In the first option, all hosts, the old VN, and the new VN are located within the same slice. We will not discuss the first design in detail since it follows the common usage of the GENI testbed. We will focus on the second design, where the old VN, the new VN, and the hosts are assigned to three different slices. The challenge in the second design is to direct traffic from one slice to another given the current GENI constraints which do not support virtual links between slices. It should be noted that the dynamic tunnel implemented in LIME \cite{ghorbani2014transparent} does not apply for our case. The tunnel uses the control plane for data links and cannot guarantee performance such as bandwidth and latency. Moreover, the control plane is a shared channel on GENI and should not be used to send a large amount of data. \subsubsection{Broadcasting problem in a virtualization environment} To enable inter-slice communication, it may seem natural to use a shared VLAN to connect a host slice to VN slices. The traffic is broadcast within the same VLAN, no matter in which slice a switch is located. The connection/disconnection of the VNs with the hosts are controlled by turning up/down the network interfaces on virtual switches. Figure \ref{fig:wo-gw} presents an example of this approach. The topology includes three hosts, the old VN (VN1), the new VN (VN2), and the controller slice. In our virtual topology, each host connects to both VN1 and VN2 with a shared VLAN. When host1 sends data to host2, the data will be broadcast to both OVS1 and OVS1'. When VN1 is in use, the network interfaces of OVS1 is up and the network interfaces of OVS1' is down. After the migration, we redirect traffic from VN1 to VN2 by turning down the interfaces of OVS1 and turning up the interfaces of OVS1'. \begin{figure}[h] \vskip -10pt \centering \includegraphics[width=0.4\textwidth]{./figure/wo_gw_topo.png} \vskip -5pt \caption{An example of using shared VLAN to connect the host and the VNs} \vskip -10pt \label{fig:wo-gw} \end{figure} Unfortunately, this approach can violate the correctness of the migration in a virtualized environment. GENI uses XEN \cite{barham2003xen} as a virtual machine monitor to allow multiple virtual machines to share the same hardware resources. Xen only allows a privileged virtual machine called domain 0 to access the physical Network Interface Card (NIC). Domain 0 communicates with other virtual machines through a set of back-end interfaces. All the packets destined to a virtual machine will be first transferred to domain 0 and then destined to the virtual machine. The packets stored in domain 0 are not dropped when the network interfaces in the virtual machine is turned down. When the virtual network interface goes up again, these buffered packets will be copied from domain 0 memory to the receiver virtual machine's memory. \begin{figure}[h] \vskip -10pt \centering \includegraphics[width=0.4\textwidth]{./figure/broadcast_problem.png} \vskip -10pt \caption{an example of a VN and its substrate} \vskip -10pt \label{fig:broadcast-problem} \end{figure} We illustrate why this small number of buffered packets can be a problem through a one-node VN example as shown in Figure \ref{fig:broadcast-problem}. In our virtual topology, host1 connects two switches with shared VLAN1 and host2 connects two switches with shared VLAN2. In actual substrate network, there is a rack switch residing in the shared VLAN to broadcast packets to all switches in the same VLAN. Before migration, we connect VN1 with the hosts by turning up the network interfaces eth1 and eth2 and disconnect VN2 by turning down the network interfaces eth1' and eth2'. The data from host1 to host2 is broadcast by Rack{\_}SW1 to eth1 and eth2, and then broadcast by Rack{\_}SW2 to eth2' and host2. Although we turn down the virtual network interface eth1' and eth2', a small number of packets are still stored in the XEN domain 0. During the migration, we switch from VN1 to VN2 by turning up eth1' and eth2' and turning down eth1 and eth2. Previously buffered packets in domain 0 are transferred through eth1' and eth2' to the virtual machine that hosts SW2. These packets have the same matching fields (e.g, same source and destination IP) but request different actions(e.g, send through different ports). In the standard SDN implementation of the learning switch, this is considered as an error. The switch will install rules to drop all packets for several seconds, resulting in a much longer disconnection time than normal migration process. In the worst case, when conflicting rules are installed on the openflow switch, the switch may stop forwarding packets, which requires manual configuration to recover. \subsubsection{Mitigate the broadcasting problem -- gateway design} To avoid the broadcasting problem, we propose a gateway design which establishes additional SDN switches as `gateways' to switch traffic from the old VN to the new VN. The gateways are layer 2 devices that sit between hosts and VNs, hiding changes in VNs from end hosts. Figure \ref{fig:gw-topo} presents an example of the gateway design that enables migration within the same aggregate. Each host is connected with a gateway, and each gateway uses two different shared VLANs to connect to the two VNs. The gateway switch is responsible for forwarding packets from hosts to a certain VN. In the process of VN migration, the migration controller issues commands to the gateway switches, asking them to redirect traffic from VN1 to VN2 after all flow tables in VN1 are cloned to VN2. The controller sends SDN commands to the gateway switches to update the flow tables, redirecting traffic from VN1 to VN2. \begin{figure} \vskip -10pt \centering \includegraphics[width=0.4\textwidth]{./figure/gw_topo.png} \vskip -10pt \caption{Gateway design} \label{fig:gw-topo} \end{figure} The gateway design can be extended to enable migration across substrates. As mentioned earlier, we use GENI aggregates to represent substrates in different locations. Virtual components in different aggregates are connected with a special link called stitched links. Unfortunately, a stitched link cannot be part of a shared VLAN. We use additional nodes to serve as a bridge to connect stitched links and shared VLANs. A cross-aggregates example is shown in Figure \ref{fig:gw-topo-stitch}. The hosts, VN1, and VN2 are located in three different aggregates. GENI does not provide inter-slice stitched links to connect gateway switches in the host slice with SDN switches in two VNs directly. To connect gateways with VN1, we put three more additional nodes in the host slice. These three nodes are in the same aggregate with VN1 and we use the stitched link to connect them with the gateway switches. Then we use shared VLANs to connect those three nodes to the virtual switches in VN1. Those three additional nodes serve as a bridge to connect the host slice with VN1. We do the same to connect the hosts with VN2. \begin{figure} \centering \includegraphics[width=0.45\textwidth, height=55mm]{./figure/gw-topo-stitch.png} \caption{Topology to enable cross-aggregate migration} \vskip -20pt \label{fig:gw-topo-stitch} \end{figure} \subsection{Minimizing Packet Loss}\label{scheduling-section} In our migration mechanism, packet loss may occur when the migration controller issues commands to gateway switches to disconnect the old VN and reconnect the new VN. In a traditional network without SDN features, unicast Reverse Path Forwarding (uRPF) \cite{dalal1978reverse} in strict mode drops traffic received on an interface that is not used to forward the return traffic. We illustrate why VN migration always introduces packets loss in symmetric routing through a two-node topology. In Figure \ref{fig:scheduling-problem}, there are two hosts and two VNs, each VN containing two virtual nodes. Each host connects to both VN1 and VN2 through a gateway switch. We define f\textsubscript{1,2} as the traffic flow from host1 to host2, and f\textsubscript{2,1} as the traffic flow from host2 to host1. We migrate the virtual network from VN1 to VN2. Before migration, GW1 directs f\textsubscript{1,2} from in-port 1 to out-port 2, directs f\textsubscript{2,1} from in-port 2 to in-port 1, and drops any traffic from in-port 3 to disconnect VN2. The same applies for GW2 to control traffic from/to host2. When the migration begins, our migration controller issues commands to GW1 and GW2 and updates their flow tables to redirect traffic from VN1 to VN2. We assume GW1 finishes update at time t\textsubscript{1,2} and GW2 finishes at time t\textsubscript{2,1}. We define d\textsubscript{1} as the latency from GW1 to GW2 and d\textsubscript{2} as the latency from GW2 to GW1. The data rate of f\textsubscript{1,2} is r\textsubscript{1} and the data rate of f\textsubscript{2,1} is r\textsubscript{2}. We therefore calculate the number of dropped data c\textsubscript{1,2} for f\textsubscript{1,2} and c\textsubscript{2,1} for f\textsubscript{2,1} as follows: \[ c_{1,2}=\begin{cases} (t_{2,1}-t_{1,2})-d_1)\times r_1, &\text{if } t_{2,1}-t_{1,2}\geq d_1\ \\ (t_{1,2}-t_{2,1})+d_1)\times r_1, &\text{otherwise} \end{cases} \] \[ c_{2,1}=\begin{cases} (t_{1,2}-t_{2,1})-d_2)\times r_2, &\text{if } t_{1,2}-t_{2,1}\geq d_2\ \\ (t_{2,1}-t_{1,2})+d_2)\times r_2, &\text{otherwise} \end{cases} \] It is obvious that $t_{2,1}-t_{1,2} = d_1(d_1 >= 0)$ and $t_{1,2}-t_{2,1} = d_2(d_2 >=0)$ cannot be both satisfied. At least one of c\textsubscript{1,2} and c\textsubscript{2,1} is larger than 0, which means additional packet loss is unavoidable in this setting. \begin{figure} \centering \includegraphics[width=0.9\linewidth]{./figure/scheduling_problem.png} \caption{The topology of two-node VN on GENI} \vskip -20pt \label{fig:scheduling-problem} \end{figure} \subsubsection{Flow Migration Sequence} SDN shows promise to enable lossless migration with an optimized sequence of rule installation. We propose a scheduling sequence to remove the additional packet drop introduced by VN migration. Algorithm \ref{alg:traffic-redirection} shows pseudocode for the traffic redirection process. We install rules to let traffic coming from the new VN to go through the gateway switches. Then we update rules on gateway switches to direct traffic from hosts to the new VN. Finally, we insert drop rules to disconnect the old VN. By following this sequence, we avoid dropping packets buffered in the old VN. \begin{algorithm} \caption{Traffic Redirection Algorithm}\label{alg:traffic-redirection} \begin{algorithmic}[1] \For{$gateway \in gatewayList$} \State $Ports_h \gets $Ports on gateway that point to hosts \For{$Port \in Ports_h$} \State install new rule $r$ where $r.inPort$ = $PortToVN2$ and $r.outPort$ = $Port$ \EndFor \EndFor \For{$gateway \in gatewayList$} \For{$Port \in Ports_h$} \State update rule $r$ set $r.outPort$ = $PortToVN2$ where $r.outPort$ = $PortToVN1$ and $r.inPort$ = $Port$ \EndFor \EndFor \For{$gateway \in gatewayList$} \For{$Port \in Ports_h$} \State update rule $r$ set $r.action$ = $dropPkt$ where $r.outPort$ = $PortToVN1$ and $r.inPort$ = $Port$ \EndFor \EndFor \end{algorithmic} \end{algorithm} Algorithm \ref{alg:traffic-redirection} also applies to partial VN migration when only part of the old VN is remapped to different physical machines. In the partial VN migration, the traffic redirection occurs at the neighboring nodes of the partial network instead of the gateways. In this case, all neighboring nodes of the partial network should be treated as gateway switches and the same algorithm can be applied to minimize the packet loss. \subsubsection{Remote Scheduling Methods} We have two implementations for issuing migration commands to disconnect the old VN and connect the new VN. The first option is to control VN connection by turning up/down network interfaces using SSH sessions. We refer this type of scheduling as SSH scheduling. With this scheduling method, there is a lag between the time when the command is issued and the time when the command is actually executed in the remote node. Besides, GENI requires SSH key-based authentication before executing commands on a node, which might lead to a longer lag time. The second implementation, called OpenFlow-message scheduling, redirects traffic by installing flows on gateways based on the OpenFlow messages from the migration controller. This method does not support complicated operations such as executing a monitoring script. We expect this method to be faster than SSH scheduling because it does not introduce authentication overhead. \subsection{Seamless Migration} Our migration mechanism should ensure the illusion of a consistent VN for the client SDN applications during and after the migration. We discuss possible inconsistencies in the migration process and our solutions. \subsubsection{Topology Changes} As mentioned in Section \ref{sec:migration-challenges}, both the old and the new VN are connected during the migration. To present the client SDN applications with a consistent view of a single VN, our migration controller intercepts all OpenFlow events, changes the datapath ID of the events based on the mapping between the old and the new VN, and passes the modified events to the client SDN applications. No events about the topology changes in the VN2 should be passed to the client SDN applications. \subsubsection{Switch State Changes} A switch maintains information about its ports and flow tables. Ideally, a switch should present the same switch Information including datapath ID, serial number and ports in the old and the new VN. Unfortunately, GENI does not allow users to assign virtual network interfaces to the virtual switch and the ports number are randomly assigned during reservation stage. It is highly likely that the virtual switch has different ports status in the new VN. Since the flow tables contain the port information, our migration controller modifies the flow tables based on the port mapping when it clones flow tables from old switches to new switches. \section{Performance Evaluation}\label{sec:performance-evaluation} In this section, we evaluate the performance of our migration mechanism in terms of the migration time, packet loss during migration, latency, and the controller overhead. More evaluation results can be found in the accompanying technical report \cite{}. \subsection{Migration Time} \subsubsection{SSH vs. OpenFlow-messaging} We evaluate whether OpenFlow-message scheduling performs better than SSH scheduling in terms of the time difference between command issue and command execution. We use our migration controller to issue command to turn down/up a network interface using SSH session for 50 times. We repeat the same experiments with OpenFlow-message scheduling. Figure \ref{fig:of-vs-ssh} shows the CDF of the time difference between the time when migration commands are issued by the controller and the time when the migration finishes with SSH scheduling and OpenFlow-message scheduling. All OpenFlow-message scheduling completes within 0.1 second, but about 50\% of SSH scheduling takes 1s or longer to finish. This confirms our earlier assessment that OpenFlow-Message scheduling is much faster and has lower variance than SSH scheduling. \begin{figure} \vskip -10pt \centering \includegraphics[width=0.49\textwidth, height=50mm]{./figure/of-vs-ssh.png} \vskip -5pt \caption{CDF of time difference between command issued and execution} \vskip -15pt \label{fig:of-vs-ssh} \end{figure} \subsubsection{Migration Duration} Figure \ref{fig:mt-flowsize} shows how migration time changes as the flow table size grows with 95\% confidence level upper and lower bands. The migration time is negligible when flow table size is small. It takes less than 1s to finish the migration when the flow table size is smaller than 1000. The migration duration increases roughly linearly with the number of rules per switch and can take 7s when there are 10,000 rules. The migration time depends on the number of rules and the number of switches but is independent of the topology. \begin{figure} \vskip -10pt \centering \includegraphics[width=0.4\textwidth, height=50mm]{./figure/new/mt-flowsize.png} \vskip -5pt \caption{Migration time as flow table size per switch grows} \vskip -15pt \label{fig:mt-flowsize} \end{figure} \subsection{Packet Loss During Migration} \subsubsection{Move a Complete VN within a Substrate} We build a prototype of the basic migration controller using the POX controller platform \cite{pox-controller} and evaluate its performance through experiments on the topology illustrated in Figure \ref{fig:gw-topo} with three hosts and six virtual switches. All virtual switches are Open vSwitches \cite{pfaff2009extending}. We use iperf to generate UDP traffic for 10 seconds between all pairs of hosts and migrate VN from its initial position to final position at time t=5s. We vary the data sending rate to see whether our migration controller works well in relatively high data rate. We perform three sets of experiments: (a) a baseline experiment where no migration occurs, (b) migration with symmetric routing, where traffic redirection commands are issued at the same time by controller, and (c) migration with asymmetric routing, where traffic redirection commands are issued in an optimized sequence. We repeat the experiments for 30 times for each data rate and measure the migration time and data loss rate. \begin{figure} \centering \begin{subfigure}{0.45\textwidth} \centering \includegraphics[width=0.8\textwidth]{./figure/h1-h2-detail-figure.png} \caption{From host1 to host3} \label{fig:h1-h3-drop} \end{subfigure} \begin{subfigure}{0.45\textwidth} \centering \includegraphics[width=0.8\textwidth]{./figure/h2-h1-detail-figure.png} \caption{From host3 to host1} \vskip -5pt \label{fig:h3-h1-drop} \end{subfigure} \caption{Average packet loss as percentage of total packets (baseline, symmetric routing, optimized scheduling) at different data rates for the flow between host1 and host3} \vskip -15pt \label{fig:avg-loss} \end{figure} We only present results for forwarding and reverse flows between host1 and host3 due to space constraints. In Figure \ref{fig:avg-loss}, the percentage of average packet loss on y-axis is based on the measurement of UDP traffic for 10s, and the x-axis shows baseline experiment, symmetric routing, and asymmetric routing for different data sending rates. For both the forwarding and the reserve flows, the packet loss rate in asymmetric routing is almost the same with that in a migration-free setting. It demonstrate that asymmetric routing prevents hosts from experiencing significant increase in packet loss during migration. \begin{figure} \vskip -5pt \centering \includegraphics[width=0.4\textwidth, height=50mm]{./figure/new/loss-rtt.png} \caption{The performance of symmetric routing and asymmetric routing for different RTTs} \vskip -15pt \label{fig:loss-rtt} \end{figure} \subsubsection{Impact of RTT} During the migration, packet loss occurs when packets buffered in the old VN are dropped by gateway switches because of the traffic redirection. As shown in Figure \ref{fig:loss-rtt}, the performance of the symmetric routing is much worse than that of the asymmetric routing, especially when the flow table size is large. The average packet drop rate for symmetric routing increases linearly with the increase of the RTT while the packet drop rate for asymmetric routing is very close to zero for any RTT values. \begin{figure} \centering \includegraphics[width=0.4\textwidth, height=50mm]{./figure/new/ctrl-throughput.png} \caption{Controller performance for different switch numbers} \vskip -15pt \label{fig:ctrl-throughput} \end{figure} \subsection{Control-Plane Overhead} Our migration controller intercepts the events, modifies the datapath ID based on the mapping between the old and the new virtual switches, and passes the new events to the client application. These operations cause overhead at the controller. To evaluate the controller performance, we use the cbench program \cite{sherwood2010cbench}, which creates and sends a large number of OpenFlow messages to the controller. Figure \ref{fig:ctrl-throughput} shows performance of the unmodified POX controller and our migration controller from one switch to 64 switches. The y-axis shows the number of flows that a switch can handle within a second. Our migration controller processes roughly 3\% fewer flows per second than the unmodified controller does. \section{Related Work}\label{sec:related-work} Some of the VN embedding solutions suggest reconfiguration or remapping of the VN\cite{fan2006dynamic,fajjari2011vnr,tang2008efficient,gillani2012fine,gillaniagile}. However, all of those works use simulation to demonstrate the effectiveness of their solutions. It remains a challenging task for network researchers to move their experiments to a real infrastructure when there is a lack of effective migration mechanism. There has been some work addressing the challenges of VN migration in a real infrastructure. Prior work \cite{lo2014virtual} proposes an orchestration mechanism for VN migration on PlanetLab, using the same technology to move a single virtual router without disrupting current traffic traversing the virtual network presented in \cite{wang2008virtual}. Other work \cite{pisa2010openflow,ghorbani2014transparent} shows how to migrate VN within software defined networks. Pisa et al. considers the basic migration scenario for migrating virtual network in traditional network and software defined network\cite{pisa2010openflow}. Ghorbani et al. \cite{ghorbani2014transparent} move the whole SDN network with the hosts in the data center context. It concentrates on low level configuration including packet-in events, traffic statistics and rule timeout to handle correctness violation \cite{ghorbani2014towards}. \section{Enabling Full VN Agility in GENI}\label{sec:background} GENI is relatively mature shared infrastructure. As such GENI provides support for for sharing, isolation, resource allocation, and multiple physical substrate ``owners''. GENI, however, was not designed specifically to support our desired transparent and efficient VN agility. Our work, therefore, involves the development and evaluation of options to support VN agility within GENI. This section explores some critical aspects of providing agility support. Because GENI uses its own unique terminology, Table \ref{tb:geni-concepts} summarizes how the general VN terminology maps to GENI terms. \begin{table}[!t] \renewcommand{\arraystretch}{1.3} \begin{footnotesize} \caption{GENI Context vs. Virtual Components} \label{tb:geni-concepts} \centering \footnotesize \begin{tabular}{|c|c|} \hline Component & GENI Context\\ \hline\hline Substrate networks & GENI testbed\\ \hline Virtual Network(s) & GENI slice\\ \hline Physical location & GENI aggregate\\ \hline Virtual links within a VN & LANs\\ \hline Virtual links between VNs & Shared VLAN\\ \hline Virtual links connecting different physical locations & Stitched links\\ \hline Mapping between VN to physical substrate & Rspec file\\ \hline \end{tabular} \end{footnotesize} \vskip -10pt \end{table} \subsection{Allocating VNs to Slice(s)}\label{vn-to-slice-section} GENI is a ``sliced'' platform that allows concurrent experiments on shared infrastructure. A GENI slice is a unit that contains all the resources for an experiment, including computing resources and network links. This is already a form of network virtualization used primarily to isolate experiments in GENI. In a real-world GENI-like substrate, slicing would be used to isolate commercial network providers sharing the same physical substrate. Slices exist in one or more aggregates; each aggregate is an independent collection of physical resources often operated by the same entity (e.g., a specific university). Figure \ref{fig:geni-arch} shows two slices on the GENI infrastructure. Slice 1 has three virtual nodes in Aggregate A, while Slice 2 has six virtual nodes across Aggregate A and Aggregate B connected with stitched link through the backbone network. Each slice is an isolated environment where virtual nodes and virtual links can be added. Each virtual node in a slice can be accessed by the user who creates the slice with corresponding SSH key. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{./figure/new/geni-arch.png} \vskip -10pt \caption{An example of GENI architecture} \vskip -15pt \label{fig:geni-arch} \end{figure} Slices are meant to be deployed for the long term and are thus not agile. To enable agility, VNs will need to be deployed within slices as an additional layer of virtualization. We consider two options for mapping VNs to slices with an eye to migration. The first option is to build all VNs (original and future) and hosts for migration within the same slice. This approach follows the common usage model for GENI to include all resources for an experiment within a single slice. However, this option has three disadvantages: 1) There is no clear isolation between the different VNs. 2) Most GENI resources cannot be modified after the reservation. Once resources are reserved on a slice, no partial modification (e.g, add a virtual link or a virtual node) is allowed. In the case of migration, this restriction requires us to reserve all resources for hosts and VNs, including those that will be migrated to in the future, at the outset. 3) When a VN or a host fails, we need to rebuild the whole virtual topology. Alternatively, it is possible to allocate a single VN to a slice, starting with the original VN and later allocating a VN to migrate to. Deploying a VN on one slice is straightforward. The challenge for deploying and migrating a VN between two slices is caused by the difficulty to enable the inter-slice communication during migration. We cannot create a virtual link to connect virtual components in different slices directly. Instead, we can set up a VLAN, a broadcast domain at the data link layer, to connect virtual components in different slices. All virtual components in the same VLAN will receive the broadcasting packets even when the virtual components are in separate slices. Compared with deploying all VNs on one slice, this second design provides clear separation between VNs and gives more flexibility in resource reservation. We can reserve one VN first and create another VN when needed. However, it complicates the virtual topology during migration. We will talk further about shared VLANs and migration in Section \ref{sec:migration-challenges}. \subsection{Mapping Virtual Switches to Physical Machines} GENI uses a Resource Specification (RSpec) document to describe a requested virtual topology and its physical substrate, including ID of the virtual machines (VM), virtual network interface configuration, VLAN tags assigned to links, and corresponding hardware information. The RSpec is submitted with the GENI aggregate manager API to aggregates in order to reserve resources. The requested virtual topology is translated to a request Rspec file by Rspec generation tools, and GENI aggregates automatically allocate resources to the requested VN based on the Rspec file. While GENI aggregate's automatic assignment of resources can meet the requirements of most experiments, it may be necessary to have the flexibility of mapping virtual nodes to specific physical resources for VN migration research. Although Rspec generating tools do not directly support resource assignment, we are able to map a virtual node to a specific machine by manually modifying the request Rspec. The Omni tool \cite{omni} provides commands to obtain information about all reserved and available resources at a specific aggregate, including machine ID, machine status, hardware types, and OS types. We can locate the component name for a specific physical machine in the resource information returned by Omni and copy its component ID to the request Rspec file to achieve a fixed mapping. \subsection{Assigning VNs to Substrates} In VN migration, it might be necessary to migrate between different physical substrates, or aggregates in GENI terminology. A GENI aggregate comprises a set of resources under common control including storage resources, computing nodes, and OpenFlow switches \cite{berman2014geni}. Experimenters can reserve multiple aggregates within the same slice and connect them with stitched links (See Figure \ref{fig:geni-arch}). It is also possible to allocate each VN to a different aggregate and connect them with both shared VLAN and stitched links. We will show how to use shared VLAN and stitched links together in Section \ref{sec:migration-challenges}.
{'timestamp': '2017-01-09T02:07:52', 'yymm': '1701', 'arxiv_id': '1701.01702', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01702'}
arxiv
\section{Introduction} Aspect-based opinion mining is one of the main frameworks for sentiment analysis. It aims to extract fine-grained opinion targets from opinion texts and its importance resides in the fact that without knowing the aspects, opinion analyses are of limited use \cite{liu_sentiment_2012}. The concept originated more than 10 years ago as a specific case of sentiment analysis and has gradually gained relevance as a concrete and complete problem in opinion mining. The key task in aspect-based sentiment analysis is to extract the aspects or targets that have been commented in opinion documents. Sentiment orientation can be obtained later based on the extracted terms using or adapting any of the generic approaches for sentiment classification. Therefore, an important amount of focus has been posed on the problem of aspect extraction. Researchers have proposed several methods for aspect extraction so far, and many authors consider that these approaches largely fall into three main categories. On the one hand, we find syntactical or linguistic methods, which are generally based on other basic NLP tasks, such as POS-tagging and parsing, plus some fixed rules or rankings mechanisms. On the other hand, we find purely statistical approaches, which are mainly based on topic modeling. Finally, we also find extensive work on supervised learning methods, in which case the problem is approached as sequence labeling. Experiments with both Neural Networks and Graphical Models have reported fairly good results so far. A review of the literature in syntactical approaches showed us that most of the proposed ideas are inspired by or directly built on top of previous methods. Papers generally include detailed comparisons of the approaches, but we found very few publications accompanied by code releases that make it easier to effectively compare and contrast methods. We believe the lack of code availability is increasingly becoming a threat to validity in the field by adding layers of obscurity to new approaches, specially to those that are built on top of previous ideas. Given the current state in the field, in this paper we study replicability issues in aspect-based opinion mining. We focus on syntactic methods, which tend to show a lower degree of transparency due to the increasing level of model complexity and the lack of code availability. In that sense, in this work we want to encourage discussion on this topic by addressing some key questions. \begin{enumerate} \item Are the explanations given in the papers generally sufficient to replicate the proposed models? \item Do differences in preprocessing have a big impact on performance? \item Do parameters need to be heavily tuned in order to achieve the reported performance? \end{enumerate} Our goal throughout this paper is to start exploring possible answers to these questions and provide an environment for further discussions and improvements. We will try to tackle the questions keeping in mind that reproducibility of an experimental result is a fundamental assumption in science. As we will see in the next section, the inability to replicate the experimental results published in a paper is an issue that has been considered in various other machine learning and computer science conferences. There have been several discussions arising from this issue and there seems to be a widespread view that we need to do something to address this problem. We would like to join this quest too. \section{Related Work} Aspect-based opinion mining aims to identify the aspects of entities being reviewed in an text and to determine the sentiment reviewers express for each aspect. Aspects usually correspond to arbitrary topics considered important or representative of the text that is being analyzed. The aspect-based approach has become fairly popular. Since its conception, arguably after \newcite{hu_mining_2004}, many unsupervised approaches based on statistical and syntax analysis such as \newcite{qiu_opinion_2011} and \newcite{liu_opinion_2012} have been developed. While here we specifically tackle these kind of models, other popular unsupervised techniques such as \newcite{mukherjee_aspect_2012} are based on LDA. On the other hand, existing supervised approaches in the field are mainly based on sequence labeling. Since 2014 the SemEval workshop included a shared task on the topic \cite{pontiki_semeval-2014_2014}, which has also encouraged the development of new supervised methods. We find approaches based on CRFs such as \newcite{mitchell_open_2013} and deep learning \cite{irsoy_opinion_2014} \cite{liu_fine-grained_2015}, \cite{zhang_neural_2015}. The replicability issue has been tackled numerous times in different areas of science. For example, \newcite{casadevall_reproducible_2010} explore the importance and limits of reproducibility in scientific manuscripts in the field of Microbiology. In the field of Machine Learning, \newcite{drummond_replicability_2009} discusses issues arising from the inability to replicate the experimental results published in a paper. Also, \newcite{raeder_consequences_2010} show that when comparing the performance of different techniques some methodological choices can have a significant impact on the conclusions of any study. Furthermore, we also find studies in Software Engineering. For example, \newcite{monperrus_critical_2014} aimed to contribute to the field with a clarification of the essential ideas behind automatic software repair and included an in-depth critical analysis of \newcite{kim_automatic_2013}, an approach that had been published the year before in the same conference. It is also possible to find work on replicability in Natural Language Processing. Conferences such as CICLing have undertaken maximum effort ---though so far rather fruitless--- in order to address the topic, giving a special prize every year to the best replicable paper\footnote{http://cicling.org/why\_verify.htm}. In addition, the proceedings of the ACL conference have included words on this topic on several occasions. For example, \newcite{kilgarriff_googleology_2007} introduces the issues of data cleaning and pre-processing, specially for those cases that involve crawling and/or downloading linguistic data. The paper claims that even though expertise and tools are available for most of these preprocessing steps, such as lemmatizers and POS-taggers for many languages, in the middle there is a logjam and questions always arise. The authors indicate that it seems to be undeniable that even though cleaning is a low-level, unglamorous task, it is yet crucial: the better it is done, the better the outcomes. All further layers of linguistic processing depend on the cleanliness of the data. On the other hand, \newcite{pedersen_empiricism_2008} presents the sad tale of the Zigglebottom tagger, a fictional tagger with spectacular results. However, the code is not available and a new implementation does not yield the same results. In the end, the newly implemented Zigglebottom tagger is not used, because it does not lead to the promised results and all effort went to waste. \newcite{fokkens_offspring_2013} go further and actually experiment with what they think may be a real-world case of the Zigglebottom tagger, particularly, with the NER approach by \newcite{freire_2012}. The reimplementation process involved choices about seemingly small details such as rounding to how many decimals, how to tokenize or how much data cleanup to perform. They also tried different parameter combinations for feature generation, but the algorithm never yielded the exact same results. Particularly, their best run of their first reproduction attempt achieved nearly a 20\% drop in F-measure on average. Other authors such as \newcite{dashtipour_multilingual_2016} have worked on the same issue but for the task of sentiment classification, being unable to replicate the results of several papers. Our work is directly related to these since here we also attempt to re-implement other approaches. \section{Empirical Replication Study} As a first step, we first devoted ourselves to creating a friendly environment for experimentation. The goals of developing this framework were the following. (a) To provide a public Python implementation of notable algorithms for aspect extraction in aspect-based opinion mining that to date lack available implementations, (b) To provide an implementation that is easy to extend and thus to allow researchers to build novel approaches based on the routines we provide, and (c) To increase transparency in the field by providing full details about preprocessing steps, parameter setting and model evaluation. We are publicly releasing our code in GitHub\footnote{\url{github.com/epochx/opminreplicability}}, so it will welcome bug fixes, extensions and peer validation of its contents. Our framework is an object-oriented package that is centered on the representation of a sentence as a property-rich object. Likewise, sentences are composed of tokens, which represent words and other punctuation marks with their respective properties such as stems, POS-tags, IOB-tags for chunks and dependency relation tags, among others. We have also developed wrappers for some popular packages for NLP, concretely the Stanford CoreNLP and Senna. This allows us to easily experiment with different tokenizers, stemmers, POS taggers, chunkers and parsers. Our package also includes a module for corpora management, which provides easy access to the set of linguistic resources needed. We include parsers for word lists such as stopwords, opinion lexicons and also for more complex data structures regarding aspect-based opinion mining. In particular, we work with the well-known \textit{Customer Review Dataset} \cite{hu_mining_summarizing_2004,hu_mining_2004} which became the de facto benchmark for evaluation in syntax-based aspect-based opinion mining. This is also a very important part of our environment. We also include a simple module devoted to model evaluation, which makes the evaluation process transparent. We see aspect extraction as an information retrieval problem and thus the evaluation is based on precision, recall and F1-score, using exact matching to define a correctly extracted aspect. On top of the framework we built our implementations of three different aspect extraction techniques, which we selected based on the approach they are based on, their novelty and their importance in the community. As we mentioned earlier, since we limit our study to syntactic approaches, here we explicitly omit algorithms that are intensively based on Web sources ---or other private sources or datasets--- and also approaches that use topic models or supervised learning models for sequence labeling. We selected three different papers, \newcite{hu_mining_2004}, \newcite{qiu_opinion_2011}, \newcite{liu_opinion_2012}. In the subsections below, we proceed to comment on the reasons for each choice and give details on our implementations. \subsection{Frequency-Based Algorithm (FBA)} We first consider the aspect extraction algorithm by \newcite{hu_mining_2004}, which pioneered on the problem of aspect-based opinion mining. This work is still being considered as a baseline for comparison and contrast with new approaches by most of the work on syntactic approaches in the literature. Despite this, there seems to be no available implementation of this technique to the best of our knowledge. These were our main motivations to work with this technique. The aspect extraction procedure is based on frequent itemset mining, which given a database of transactions and a minimum support threshold $min_{sup}$ extracts the set of all the itemsets appearing in at least $min_{sup}$ transactions ---an itemset is just an unordered set of items in a transaction. In this case, each transaction is built using the nouns and words in the noun phrases of a sentence. Later, stopword removal, stemming and fuzzy matching are applied to the transactions in order to reduce the term dimensionality and to deal with word misspellings. Authors do not mention which stemming algorithm they use, so we resort both the well-known Porter stemmer and the Stanford lemmatizer, which can be regarded as the standard choices. Regarding fuzzy matching, the approach uses \newcite{jokinen_two_1991}, but authors simply state that [\textit{... all the occurrences of ``autofocus'' are replaced with ``auto-focus''}]. This description was insufficient to give us a full notion of how the process is carried out, specially since arbitrary word replacements can have an important impact when extracting aspects based on their frequency. Similarly to \newcite{de_amorim_effective_2013}, who proposed a clustering method for spell checking, here we use clustering with the Levenshtein distance ratio as similarity metric to group terms. We tried with different strategies of hierarchical clustering and, based on our exploratory experiments, we decided to use \textit{complete linkage} to extract flat clusters so that the original observations in each flat cluster have a maximum cophenetic distance given by a parameter $min_{sim}$. Finally, we represent each stem as a fixed single stem in its cluster, keeping an index back from each of the original unstemmed words to its cluster, so we are later able to recover the terms as they appeared originally. Authors later proceeded to mine \textit{frequent} occurring phrases by running the association rule miner CBA \cite{liu_integrating_1998}, which is based on the Apriori algorithm. The paper indicates that the Apriori algorithm works in two steps, first finding all frequent itemsets to later generate association rules from the discovered itemsets, so authors state they only needed the first step and use the CBA library for this part. This seems reasonable since it is a known fact that it is very efficient to use frequent itemsets to generate association rules \cite{agrawal_1993}. They limited itemsets to have a maximum of three words as they believed that a product feature contained no more than that number of terms. For minimum support, they defined an itemset as \textit{frequent} if it appeared in more than 1\% of the review sentences. In our case, since the CBA library was never released, we resort to an open-source implementation of the Apriori algorithm for frequent itemset mining \cite{borgelt_frequent_2012,pudi_efficiency_2002,pudi_armor_2003}. After itemset mining, two pruning steps are applied in order to get rid of the incorrect, uninteresting and redundant features. We implemented these pruning techniques closely following the details given in the paper. Finally, extracted aspects are used to extract infrequent features that might also be important. In order to do so, they used terms in a lexicon as pivots to extract those nearby nouns that the terms modify. To generate the list of opinion words, they extracted the nearby adjective that modifies each feature on each of the sentences in which it appears, using stemming and fuzzy matching to take care of word variants and misspellings. The paper states that \textit{``a nearby adjective refers to the adjacent adjective that modifies the noun/noun phrase that is a frequent feature''}. However, it is not clear how they really find these adjectives. In our implementation, we defined a distance window from the aspect position and extract all adjectives that appear within this window. The size of this window became another parameter of the model. Finally, to extract infrequent features, authors checked those sentences that contain no frequent features but one or more opinion words and then extracted the nearest noun/noun phrase. We try to keep parameter setting as close as possible to the values reported by the original paper, but for POS-tagging we use CoreNLP or Senna instead of NLProcessor 2000. To obtain flat noun phrases, we use the Penn Treebank II output generated by the Stanford Constituency Parser and apply the same Perl script\footnote{\url{http://ilk.uvt.nl/team/sabine/homepage/software.html}} used to generate the data for the CoNLL-2000 Shared Task. \subsection{Dependency-Based Algorithm (DBA)} Our second implemented model is Double Propagation \cite{qiu_opinion_2011}, an approach that is fundamentally based on dependency relations between words for both aspect/target and opinion word extraction. This paper pioneered on the usage of dependency grammars to extract terms by iteratively using a set of eight rules based on dep-relations and POS-tags. Basically, the process starts with a set of \textit{seed} opinion words whose orientation is already known. In general, this is a reasonable assumption since several opinion lexicons already exist in the literature. The seeds are firstly used to extract aspects, which are defined as nouns that are modified by the seeds. Aspects are later used to extract more opinion words indicated by adjectives, other aspects and so on. This iterative process that propagates the knowledge with the help of the rules ends when no more opinion words or aspects are extracted. In the original paper, the set of dependency relationships given by the MINIPAR parser \cite{lin_minipar_2003} is used to develop the word extraction rules. We actually could not find the binaries on-line since the official website\footnote{\url{https://webdocs.cs.ualberta.ca/~lindek/minipar.htm}} is down; other binaries found on the Web were corrupted and unusable. This convinced us that MINIPAR can be regarded as a rather outdated model, so we decided to use the Stanford Parser \newcite{manning_stanford_2014} instead, which is among state-of-the-art models in the field. Our choice is supported by the results of \newcite{liu_automated_2015}, who successfully work with Double Propagation based on the Stanford dependency parser. Since the Stanford dep-tags differ from the tagset used by MINIPAR, we use the equivalences defined in the aforementioned paper. After the extraction steps, the approach proceeds to apply a clause pruning phase. For each clause on each sentence, if it has more than one aspect and these are not connected by a conjunction, only the most frequent one is kept. In the paper, authors simply state that they [\textit{``identify the boundary of a clause using MINIPAR'']} and do not explain how to determine if the aspects are connected by the conjunction. We identify clauses by finding the set of non-overlapping parse sub-trees with label ``S''. To determine if the aspects are connected by any existing conjunction in a sentence, we simply check if the conjunction appears between the aspects in the same clause. The next step was to prune aspects that may be names of other products or names of product dealers, which may appear due to comparisons. In this case, the procedure is based on pre-defined patterns which are first matched in the text to later check if nearby nouns had previously been extracted as aspects. These are removed. The definition of \textit{nearby noun} is not given in the paper, so we add it as another parameter for the model, again using the notion of distance windows. Finally, a rule is proposed to identify aspect phrases by combining each aspect with $Q$ consecutive nouns right before and after the aspect and $K$ adjectives before it. After obtaining the aspect phrases, another frequency-based pruning is conducted, removing aspects that appear only once in the dataset. Again, here we tried to set all the parameters as reported by the authors. Based on preliminary experiments, we decided to also eliminate those terms that were extracted by leveraging on aspects that were later pruned, since they may introduce noise. \subsection{Translation-based Algorithm (TBA)} The work of \newcite{liu_opinion_2012} is a novel application of classic statistical translation models and Graph Theory to extract opinion targets. Novelty and the good results obtained by the approach were our main motivations to work with this paper. For target extraction, the authors proposed a technique based on statistical word alignment. Specifically, they used a constrained version of the well-known IBM statistical alignment models \cite{brown_mathematics_1993}. The proposal is directly related to monolingual alignment, as proposed by \newcite{liu_collocation_2009}. For monolingual alignment, the parallel corpora fed to the model is simply two copies of the same corpus. At the same time, the condition that words cannot be aligned to themselves is added. \newcite{liu_opinion_2012} still use a monolingual parallel corpus but set the constraint that nouns and noun phrases can only be aligned to adjectives or vice-versa, meanwhile the rest of the words can be aligned freely. As a result, authors are able to capture noun/noun phrase-adjective relations that have longer spans that direct dependency relations in a sentence. Since the IBM alignment models work at word granularity and then need to receive tokenized sentences as input, here we assume that authors first proceeded to group noun phrases in single tokens. According to the paper, they resorted to the \textit{C-value} technique \cite{frantzi_automatic_2000} for multi-word term extraction, which was originally developed to detect technical terminology in medical documents, but was also previously used in the domain of opinion mining by \newcite{zhu_multi_aspect_2009}. The method firstly generates a list of all possible multi-word terms and later ranks them using statistical features from the corpus. Even though in the original paper candidate multi-word terms are extracted using fixed patterns, authors decided to generate all candidates as simple n-grams (with $max_n=4$). We implemented and experimented with both fixed pattern and the n-gram versions for the \textit{C-value} technique. We also added a simple heuristic that works without ranking, grouping sets of nouns and other related figures that appear on the same parse NP sub-tree. After the most likely constrained alignments are obtained for each sentence, authors estimated noun/noun phrase-adjective pair associations as the harmonic mean between the mutual translation probabilities. Finally, they built a bipartite graph with the words and estimate the confidence of each target candidate being a real target using the mined associations and applying a graph-based algorithm based on random walking. This is basically an iterative algorithm that exploits the mutual reinforcement between terms as given by the associations. Authors set the relevance of each target as the initial value of confidence, defining relevance as the normalized \textit{tf-idf} scores of the candidates, where \textit{tf} is the frequency on each term in the corpus and \textit{idf} is the inverse document frequency obtained using the Google N-gram Corpus. In the paper, authors experimented with IBM1-3 models and showed that fertility parameters introduced by the third model help to improve the performance by a small margin. The estimation of this model is rather complicated, in this case specially since it also includes a constrained version of the hill-climbing heuristic, so in our implementation we only include our versions of the IBM1-2 models. Regarding parameters, we set the proportion of candidate importance $\lambda=0.3$ and the maximum series power parameter $k=100$, as given by the original paper. To compute the initial relevance of each candidate, authors use the Google Ngram corpus to obtain the \textit{idf} of a term. Due to the lack of explanations on what they consider as a document, we resorted to the the English Wikipedia. To calculate the \textit{idf} score of a term, we count the number of articles that contain the queried term and compare it to the total number of articles. When we find no articles for a given term, we simple use a minimum article count of 1. Finally, the authors stated that the targets with higher confidence scores than a certain threshold $t$ are extracted as the opinion targets, but they do not specify the value they use. We let our implementation output the unfiltered list of candidates and their confidences and find the best value of the threshold later. \section{Preliminary Results} As we have shown, the implementation process involved choices about several details that were not clear or not mentioned on the papers. In our experiments we have found that even when trying different parameter combinations we remain unable to yield the exact same results in the original papers. Below we summarize our best results and findings for each algorithm. \begin{table}[h!] \centering \footnotesize \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{\textbf{Corpus}} & \multicolumn{2}{c|}{\textbf{Original}} & \multicolumn{2}{c|}{\textbf{Ours}} \\ \cline{2-5} & \textbf{P} & \textbf{R} & \textbf{P} & \textbf{R} \\ \hline \textbf{Apex DVD Player} & 0.797 & 0.743 & 0.389 & 0.355 \\ \hline \textbf{Creative MP3 Player} & 0.818 & 0.692 & 0.293 & 0.319 \\ \hline \textbf{Nikon Camera} & 0.792 & 0.710 & 0.265 & 0.457 \\ \hline \textbf{Nokia Phone} & 0.761 & 0.718 & 0.328 & 0.489 \\ \hline \textbf{Canon Camera} & 0.822 & 0.747 & 0.352 & 0.286 \\ \hline \textbf{Average} & 0.8 & 0.72 & 0.325 & 0.381 \\ \hline \end{tabular} \caption{Performance comparison for FBA.} \label{table:comparisonFB} \end{table} Table \ref{table:comparisonFB} compares our implementation's best results so far with the values reported by \newcite{hu_mining_2004}. We remain unable to replicate the performance reported by the authors and see a big drop for both precision and recall in all the datasets. In our experiments, we noted that the most sensitive parameter was $min_{sup}$ for itemset mining. We also experimented omitting the pruning steps and observed that precision and recall were not too different from the results we obtained with pruning. We also observed that several parameters configurations conveyed the same final performance for each corpus. Among the 1470 per-corpus parameter configurations we tried, we found 18 optimal settings for both the Apex DVD Player and Canon Camera corpora, 16 for Nikon Camera, 6 for Creative MP3 Player and 3 for Nokia Phone. Differences in preprocessing did not offer consistent differences in performance. For the Apex DVD Player, Creative MP3 Player and Canon Camera corpora we found that processing with SennaConstParser + CoreNLPDepParser conveys the best results. For the Nikon Camera corpus, adding the PorterStemmer to the latter gave us the best performance. For the case of the Nokia Phone corpus, the pipeline CoreNLPDepParser + CoNLL2000Chunker gave us the best results. In the original paper, authors reported the performance of the model at different stages, showing that average values of precision an recall for the itemset mining stage are 0.68 and 0.56 respectively. We were surprised to find out that we could not even replicate these results, specially considering that only two parameters are at play at this level. As shown by the original paper, the final performance achieved is actually mainly due to the output of the itemset mining phase. We believe this is the reason why we observed some parameters have minimum impact on the performance. This means that no matter how good the pruning strategies are, results will not be as good as the original if we remain unable to replicate the output of the itemset mining phase. \begin{table}[h!] \centering \footnotesize \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{\textbf{Corpus}} & \multicolumn{2}{c|}{\textbf{Original}} & \multicolumn{2}{c|}{\textbf{Ours}} \\ \cline{2-5} & \textbf{P} & \textbf{R} & \textbf{P} & \textbf{R} \\ \hline \textbf{Apex DVD Player} & 0.90 & 0.86 & 0.239 & 0.328 \\ \hline \textbf{Creative MP3 Player} & 0.81 & 0.84 & 0.180 & 0.319 \\ \hline \textbf{Nikon Camera} & 0.87 & 0.81 & 0.194 & 0.287 \\ \hline \textbf{Nokia Phone} & 0.92 & 0.86 & 0.287 & 0.359 \\ \hline \textbf{Canon Camera} & 0.90 & 0.81 & 0.201 & 0.356 \\ \hline \textbf{Average} & 0.88 & 0.83 & 0.220 & 0.330 \\ \hline \end{tabular} \caption{Performance comparison for DBA.} \label{table:comparisonDB} \end{table} Regarding DBA, Table \ref{table:comparisonDB} summarizes the results we obtained. Again, we see huge differences between our results and the ones reported by the original paper. Moreover, in this case we observe particularly low values for precision. A detailed review of the extracted aspects showed us that in fact many of the extracted terms do not correspond to aspects but rather to common nouns that are not related to the product. During experimentation, we also added support for different matching strategies ---for example, using word stems and including fuzzy matching as in FBA--- and although we observed improvements on the results, these were marginal. We used different opinion word seeds, firstly based only on the words ``good'' and ``bad'' and later using 9 same-size subsets of the opinion lexicon provided by Liu\footnote{http://www.cs.uic.edu/$\sim$liub/FBS/opinion-lexicon-English.rar}. In all cases, our best performing model uses one of these subsets. As in the previous case, different parameter configurations led to the same performance for each corpus. In this case, among 240 parameter settings for each corpus, we found 12 optimal configurations for the Apex DVD Player corpus and 24 for each the other corpora. Regarding pre-processing, we could not use CoreNLP to transform the constituent trees given by Senna into dep-trees. Constituency trees seemed to be malformed and raised grammar parsing errors, therefore we only experimented using the CoreNLPDepParser + CoNLL2000Chunker pipeline. \begin{table}[h!] \centering \footnotesize \begin{tabular}{|c|c|} \hline \textbf{Corpus} & $t^*$ \\ \hline \textbf{Apex DVD Player} & 160 \\ \hline \textbf{Creative MP3 Player} & 200 \\ \hline \textbf{Nikon Camera} & 100 \\ \hline \textbf{Nokia Phone} & 90 \\ \hline \textbf{Canon Camera} & 110 \\ \hline \end{tabular} \caption{Optimal value of $t$ for each corpus.} \label{table:best_t} \end{table} Table \ref{table:comparisonTB} shows a comparison of the results we have obtained so far using our implementation of TBA and the values provided by \newcite{liu_opinion_2012}. Once more, we remain unable to replicate the performance reported by the paper. On our experiments we tried with all three grouping strategies to generate multi-word terms; namely, our simple heuristic and \textit{C-value} using both n-grams and fixed patterns. We also tried adding a limit for the number of groups generated by the \textit{C-value} technique and used stemming to improve frequency counts. The ``ngram'' technique turned out to be the best performing on each corpus, although the limit parameter varies from case to case. As we mentioned earlier, to evaluate the impact of the $t$ parameter whose value was not reported by \newcite{liu_opinion_2012}, we let the model return the unfiltered aspect candidates and evaluate the performance for $t \in [10, 20, ... ,t_{max}]$. Note that $t_{max}$ might be different each time. Because of this, the number of parameter configurations we tried for each corpora is slightly different. Instead of reporting each value, we rather report the average of per-corpus evaluated parameter settings, which was 1006. As Table \ref{table:best_t} shows, we found that rather than a single cross-corpus optimal value, this parameter needs to be tuned per-corpus. In this sense, when we experimented without setting a threshold we obtained a maximum recall of 0.697 ---for the Nokia Phone corpus--- but at the cost of precision 0.151. When we set $t=10$, we obtained a maximum precision of 0.9 but at the cost of recall being lower than five percent. These results mean the model does not seem to generalize well. Since in our implementation we do not use the IBM3 model, we were aware we could see a difference in the performance. However, based on the results by the original paper, which showed that improvements of IBM3 over IBM2 are small ---about 5\%--- we think it is very unlikely this difference can explain the big drop in performance we have observed. \begin{table}[h!] \centering \footnotesize \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{\textbf{Corpus}} & \multicolumn{2}{c|}{\textbf{Original}} & \multicolumn{2}{c|}{\textbf{Ours}} \\ \cline{2-5} & \textbf{P} & \textbf{R} & \textbf{P} & \textbf{R} \\ \hline \textbf{Apex DVD Player} & 0.89 & 0.87 & 0.362 & 0.389 \\ \hline \textbf{Creative MP3 Player} & 0.81 & 0.85 & 0.400 & 0.327 \\ \hline \textbf{Nikon Camera} & 0.84 & 0.85 & 0.380 & 0.404 \\ \hline \textbf{Nokia Phone} & 0.88 & 0.89 & 0.588 & 0.381 \\ \hline \textbf{Canon Camera} & 0.87 & 0.85 & 0.400 & 0.341 \\ \hline \textbf{Average} & 0.86 & 0.86 & 0.426 & 0.368 \\ \hline \end{tabular} \caption{Performance comparison for TBA.} \label{table:comparisonTB} \end{table} \section{Discussion and further directions} The ongoing empirical study we introduce in this paper has provided concrete cases to help us answer the questions that motivate this paper. As seen, we have so far failed to reproduce the original results in the three studied cases. Even though several reasons may be the cause for this failure, we think further experimentation can allow us to determine the key elements that would explain the differences. In fact, our preliminary experiments have already helped us isolate specific parameters for each model that seem to more strongly improve the performance. Our results show that parameters that are closely related to the core of the extraction methods, such as $min_{sup}$ for FBA and the confidence threshold $t$ for TBA seem in fact to be playing these key roles. We are planning to run controlled experiments in order to isolate as much as possible the effect of each parameter or processing step and understand their interplay. This will enable us to tell where important implementation differences between our version and the original version may be. Given that we do not have access to the original codes, it is only by means of these inferred differences that we can gain real insights on where the keys for replicability lay. We believe the results in this paper already prove that explanations given in the original papers were generally insufficient to correctly replicate the models. The lack of resources ---except for the evaluation datasets--- caused us to navigate in the dark as we could not reverse-engineer many intermediate steps. Certain details of preprocessing and parameter setting are only mentioned superficially or not at all in the original papers. However, many of these seemingly small details did make a big difference in our results. We understand there is often not enough space in the manuscripts to capture all details, specially since they are generally not the core of the research described. However, code releases play a critical role in uncovering these details and making research at least replicable. Regarding pre-processing, in our experiments so far with both Senna and CoreNLP we saw performance differences that are however not consistent, which seems to indicate that there is no optimal preprocessing pipeline for each algorithm. On the other hand, model parameters do not seem to be correlated with pre-processing choices, although we did find a single case in which a special pre-processing step lead to better results in a single corpus. Though we could not replicate the results published in the original papers, we have shown that parameter values as reported by these papers do not necessarily yield the best results. Moreover, parameters that may seem unimportant turned out to cause important performance differences for us. Most parameters indeed had to be heavily tuned in order to achieve the best performance. Finally, the poor results obtained by our implementations also leave us puzzled about how the evaluation is really performed on the original papers. Authors do not give much details on this topic. For example, \cite{hu_mining_2004} use stemming and simply eliminate some words from the text based on their fuzzy matching approach. This means their extracted terms are word stems only. However, we do not know if stemming is also applied to the gold standard to evaluate. We manually examined the \textit{Customer Review Dataset} and discovered that the manually extracted aspects do not seem to be stemmed. Moreover, we noted several inconsistencies in the annotation. This issue raises more questions for our research. \section{Conclusions} We have presented three replication cases in the domain of aspect-based opinion mining and shown that repeating experiments in the field is a complex issue. The experiments we designed and carried out have helped us answer our research questions, also raising some new ones. These answers seem to indicate that explanations on pre-processing, models specifications and parameter setting are generally insufficient to successfully replicate papers in the field. Our observations indicate that sharing data and software play key roles in allowing researchers to completely understand how methods work. Sharing is key to facilitating reuse, even if the code is imperfect and contains hacks and possibly bugs. Having access to such a set-up allows other researchers to validate research and to systematically test the approach in order to learn its limitations and strengths, ultimately allowing to improve on it.
{'timestamp': '2017-01-09T02:03:46', 'yymm': '1701', 'arxiv_id': '1701.01565', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01565'}
arxiv
\section{Introduction} The ubiquitous use of mobile phone cameras in the recent decade has set a very high demand on the image quality these devices are expected to produce. On the other hand, the never-ending pursuit of more pixels at smaller form factors puts stringent constraints on the amount of light each pixel is exposed to and results in noisier images. This puts an increasing weight on computational post-processing techniques, in particular on image denoising. Many image acquisition artifacts such as low-light noise and camera shake \cite{Delbracio15Burst} can be compensated by image enhancemnet techniques. Denoising in the presense of additive white Gaussian noise is one of the key problems studied in this context. While realistic low-light imaging is largely dominated by the Poisson-distributed shot noise, there exist various techniques that allow accurate treatment of non-Gaussian noise sources with a Gaussian denoiser \cite{Makitalo11Optimal, Makitalo14Noise, Rond16Poisson, Sreehari16Plug}. Moreover, it has been shown in \cite{Chan16Plug, Dar16Postprocessing, Romano16Little, Sreehari16Plug, Venkatakrishnan13Plug} that having a good Gaussian denoising algorithm allows to solve efficiently many other image processing problems such as deblurring, inpainting, compression postprocessing and more, without compromising the reconstruction quality or the need to design a new strategy adapted to a new setting. In view of these results, it is evident that a good Gaussian denoiser sets the foundation for solving a variety of image reconstruction and enhancement problems. Numerous methods have been proposed for removing Gaussian noise from images, including $k$-SVD \cite{Aharon06KSVD}, non-local means \cite{Buades05Non}, BM3D \cite{dabov2007image} non-local $k$-SVD \cite{Mairal09Non}, field of experts (FoE) \cite{Schmidt10Generative}, Gaussian mixture models (GMM) \cite{Yu12Solving}, non-local Bayes \cite{Lebrun13Nonlocal}, nonlocally centralized sparse representation (NCSR) \cite{Dong13Nonlocally} and simultaneous sparse coding combined with Gaussian scale mixture (SSC-GSM) \cite{Dong15Image}. These techniques have been designed based on some properties of natural images such as the recurrence of patches at different locations or their sparsity in a certain dictionary. In the past few years, the state-of-the-art in image denoising has been achieved by techniques based on artificial neural networks \cite{burger2012image, Chen16Trainable, vemulapalli2016deep}. Neural networks (NNs) are essentially concatenations of basic units (layers), each comprising a linear operation followed by a simple non-linearity, resulting in an intricate highly non-linear response. Currently, they are among the most popular and powerful tools in machine learning \cite{Bengio09Learning, Deng14Deep, Goodfellow16Deep, LeCun15Deep, Schmidhuber15Deep}. NN-based approaches have led to state-of-the-art results in numerous tasks in computer vision (e.g. for image classification \cite{He16Deep, Krizhevsky12ImageNet}, video classification \cite{Karpathy14Large}, object detection \cite{Szegedy15Going}, face recognition \cite{Schroff15FaceNet}, and handwriting word recognition \cite{Poznanski16CNN}), speech recognition \cite{Sak15Fast} and natural language processing \cite{Bellegarda16State, Hirschberg15Advances, Socher13Recursive, Sutskever14Sequence}, artificial intelligence (e.g., playing videogames \cite{Mnih15Human} or beating the world Go champion \cite{Silver16Mastering}, which is considered to be a very prominent milestone in the AI community), medical imaging \cite{Greenspan16Guest}, image processing (e.g., image decovolution \cite{Schuler13machine}, inpainting \cite{Pathak16Context} and super-resolution \cite{Bruna16Super, Ledig16Photo, Kim16Accurate}), and more \cite{LeCun15Deep}. The first neural network to achieve state-of-the-art performance in image denoising has been proposed in \cite{burger2012image}. It is based on a fully connected architecture and therefore requires more training examples at training and much more memory and arithmetic complexity at inference compared to the more recent solution in \cite{vemulapalli2016deep}, which proposes a neural network based on a deep Gaussian Conditional Random Field (DGCRF) model, or the model-based Trainable Nonlinear Reaction Diffusion (TNRD) network introduced in \cite{Chen16Trainable}. \subsection*{Contribution} One of the main elements we find to be missing in the current denosing techniques (and image enhancement strategies in general) is the awareness of the class of images being processed. Such an approach is much needed as the objects typically photographed by phone camera users belong to a limited number of semantic classes. In this paper, we demonstrate that it is possible to do better image enhancement when the algorithm is \emph{class-aware}. We demonstrate this claim on the Gaussian denoising task, for which we propose a novel convolutional neural network (CNN)-based architecture that obtains performance higher than or comparable to the state-of-the-art. The advantage of our architecture is its simple design and the ease of adaptation to new data. We fine-tune a pretrained network on several popular image classes and demonstrate a further significant improvement in performance compared to the class-agnostic baseline. In light of the high performance achieved by modern image classification schemes, the proposed techniqe may be used to improve the image quality in mobile phone camera. To substantiate this claim, we show that the state-of-the-art image classification networks are resilient to the presence of even large amounts of noise. \section{Class Aware Denoising} The current theory of patch-based image denoising sets a bound on the achievable performance \cite{Chatterjee10Denoising, levin2011natural, Levin12Patch}. In fact, since existing methods have practically converged to that bound, one may be tempted to deem futile the on-going pursuit of better performance. As it turns out, two possibilities to break this barrier still exist. The first is to use larger patches. This has been proved useful in \cite{burger2012image} where the use of $39 \times 39$ patches allowed to outperform BM3D \cite{dabov2007image} that held the record for many years. A second ``loophole'' which allows a further improvement in denoising performance is to use a better image prior, such as narrowing down the space of images to a more specific class. These two possibilities are not mutually exclusive, and indeed we exploit both. First, as detailed in the sequel, our network has a perceptive field of size $41 \times 41$, which is bigger than the existing practice, while the convolutional architecture keeps the network from becoming prohibitively large. Second, we fine-tune our denoiser to best fit a particular class. The class information can be provided manually by the user, for example when choosing face denoising for cleaning a personal photo collection, or automatically, by applying one of the many existing powerful classification algorithms. The idea of combining classification with reconstruction has been previously proposed by \cite{baker2002limits} which also dubbed it \textit{recogstruction}. In their work, the authors set a bound on super-resolution performance and showed it can be broken when a face-prior is used. Several other studies have shown that it is beneficial to design a strategy for a specific class. For example, in \cite{Bryt08Compression} it has been shown that the design of a compression algorithm dedicated to faces improves over generic techniques targeting general images. Specifically for the class of faces, several face hallucination methods have been developed \cite{Wang14Comprehensive}, including face super-resolution and face sketch-photo synthesis techniques. In \cite{Joshi10Personal}, the authors showed that given a collection of photos of the same person it is possible to obtain a more faithful reconstruction of the face from a blury image. In \cite{Iizuka16Let, zhang2016colorful} class labeling at a pixel-level is used for the colorization of gray-scale images. In \cite{Anwar15Class}, the subspaces attenuated by blur kernels for specific classes are learned, thus improving the deblurring performance. Building on the success demonstrated in the aforementioned body of work, in this paper, we propose to use semantic classes as a prior and build class-aware denoisers. Different from previous methods, our model is made class-aware via training and not by design, hence it may be automatically extended to any type and number of classes. While in this paper we focus on Gaussian denoising, our methodology can be easily extended to much broader class-aware image enhancement, rendering it applicable to many low-level computer vision tasks. \section{DenoiseNet} Our network performs additive Gaussian image denoising in a fully convolutional manner. It receives a noisy grayscale image as the input and produces an estimate of the original clean image. The network architecture is shown in Figure \ref{fig_denoiseNet}. The layers at the top row of the diagram calculate features using convolutions of size $3 \times 3$ , stride $1$, and \textit{ReLU} non-linearities. While the layers at the bottom of the diagram can be viewed as negative noise components as their sum cancels out the noise, and are calculated using a single channel convolution of size $3 \times 3$ with stride $1$. In all experiments we used networks with $20$ layers implemented in TensorFlow \cite{abadi2015tensorflow} and trained it for $160K$ mini-batches on a Titan-X GPU with a set of $8000$ images from the PASCAL VOC dataset \cite{everingham2010pascal}. We used mini-batches of $64$ patches of size $128 \times 128$. Images were converted to YCbCr and the Y channel was used as the input grayscale image after being scaled and shifted to the range of $[-0.5,0.5]$. During training, image patches were randomly cropped and flipped about the vertical axis. To avoid convolution artifacts at the borders of the patches caused by the receptive field of pixels in the deepest layer, we used an $\ell_2$ loss on the central part cropping the outer $21$ pixels during training time and padded the image symmetrically during test time by $21$. Training was done using the ADAM optimizer \cite{DBLP:journals/corr/KingmaB14} with a learning rate of $\alpha=10^{-4}$, $\beta_1=0.9$, $\beta_2=0.999$ and $\epsilon=10^{-8}$. Code and pretrained models will be made available\footnote{\url{https://github.com/TalRemez/deep_class_aware_denoising}}. \begin{figure}[tb] \label{fig_denoiseNet} \includegraphics[width=0.97\linewidth]{flow_chart_landscape.png} \caption{\small \textbf{DenoiseNet fully convolutional architecture.} All convolutions are of size $3 \times 3$ and stride $1$. Convolution resulting feature sizes are listed as $Width \times Height \times \# Channels$. The bottom row of outputs can be viewed as a negative noise components as their sum cancels out the noise.} \end{figure} \subsection{Simplicity vs capacity} The choice of network architecture was motivated by the trade off between simplicity and capacity. To best illustrate the concept that class awareness may improve image enhancement algorithms, it was important to incorporate the class via the data, instead of explicitly manipulating the network architecture. This requires an as-simple-as-possible design. A rather straightforward choice would have been the fully connected architecture proposed by Burger \emph{et al.} \cite{burger2012image}; however, the huge amount of parameters this network uses renders it impractical for many applications. Alternatively, a very lightweight architecture was proposed by Chen and Pock \cite{Chen16Trainable}; however their model was specifically tailored to their task and, thus, one should be extremely cautious about generalizing any concept demonstrated on it. These two somewhat conflicting paradigms led us to design a new architecture which is both relatively light-weight while extremely simple to understand and implement. In terms of capacity, we have two orders of magnitude less parameters than the NN proposed by Burger \cite{burger2012image}, but only one order of magnitude more than that introduced by Chen and Pock \cite{Chen16Trainable}. Note that the reduction in the number of parameters does not decrease the receptive field as our model is much deeper. \section{Classification in the presence of noise} The tacit assumption of our class-aware approach is the ability to determine the class of the noisy input image. While the goal of this research is not to improve image classification, we argue that the performance of modern CNN based classification algorithm such as \textit{Inception} \cite{Szegedy15Going, DBLP:journals/corr/SzegedyVISW15} or \textit{resNet} \cite{He16Deep} is relatively resilient to a moderate amount of noise. In addition, since we are interested in canonical semantic classes such as \textit{faces} and \textit{pets} which are far coarser than the $1000$ ImageNet classes \cite{ImageNet15}, the task becomes even easier: confusing two breeds of cats is not considered an error. The aforementioned networks can be further fine-tuned using noisy examples to increase their resilience to noise. Alternatively, one could simply run a class-agnostic denoiser on the image before plugging it into the classification network. To illustrate the noise resilience property we ran the pre-trained \textit{Inception-v3} \cite{DBLP:journals/corr/SzegedyVISW15} network on a few tens of images from the \emph{pets} class. We then gradually added noise to these images and counted the number of images on which the classifier changed its most confident class to a different class, as visualized in Figure \ref{fig:resilience}. Observe that the network classification remains stable even in the presence of large amount of noise. \begin{figure}[t] \label{fig_noise_resilience} \includegraphics[width=0.45\textwidth]{./noise_resilience.pdf} \caption{\textbf{Noise resilience of image classification.} The percentage of images on a pre-trained \textit{inception-v3} classifier remains stable exceeds $85\%$ even in the presence of large amount of noise.} \label{fig:resilience} \end{figure} \section{Experiments} In all experiments in this section our network was trained on $8000$ images from the PASCAL VOC \cite{everingham2010pascal} dataset and was compared to BM3D \cite{dabov2007image}, multilayer perceptrons (MLP) \cite{burger2012image} and TNRD \cite{Chen16Trainable} on the following three test sets: (i) images from PASCAL VOC \cite{pascal-voc-2010}; (ii) a denoising dataset with quantized images from \cite{vemulapalli2016deep}; and (iii) $68$ test images chosen by \cite{roth2009fields} from the Berkeley segmentation dataset \cite{MartinFTM01}. \subsection{Class-agnostic denoising} \paragraph{PASCAL VOC.} In this experiment we tested the denoising algorithms on $1000$ test images from the PASCAL VOC dataset \cite{pascal-voc-2010}. We believe this large and diverse set of images is representative enough to make conclusions about the denoising performance. Table \ref{tab_pascal_results} summarizes performance in terms of average PSNR for all test images contaminated by white Gaussian noise with $\sigma=10$ and up to $\sigma=75$. It is evident that our method outperforms all other methods for both noise levels by over $0.2$ dB. \begin{table}[h!] \centering \small \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline\hline $\sigma$ & $10$ & $15$ & $25$ & $35$ & $50$ & $65$ & $75$ \\ \hline BM3D & $34.26$ & $32.10$ & $29.62$ & $28.14$ & $26.61$ & $25.64$ & $25.12$ \\ MLP \cite{burger2012image} & $34.29$ & $-$ & $29.95$ & $28.49$ & $26.98$ & $26.07$ & $25.54$ \\ TNRD \cite{Chen16Trainable} & $-$ & $32.35$ & $29.90$ & $-$ & $26.91$ & $-$ & $-$ \\ DenoiseNet & $\textbf{34.87}$ & $\textbf{32.79}$ & $\textbf{30.36}$ & $\textbf{28.88}$ & $\textbf{27.32}$ & $\textbf{26.30}$ & $\textbf{25.74}$ \\ \hline \hline \end{tabular} \vspace{2mm} \caption{\small \textbf{Performance on PASCAL VOC.} Average PSNR values on a $1000$ image test set. Our method outperforms all other methods for all noise levels.} \label{tab_pascal_results} \end{table} To examine the statistical significance of the improvement our method achieves, in Figure \ref{pascal_s_curve} we compare the gain in performance with respect to BM3D achieved by our method, MLP and TNRD. Image indices are sorted in ascending order of performance gain. A smaller zero-crossing value affirms our method outperforms BM3D on a larger portion of the dataset than the competitors. The plot visualizes the large and consistent improvement in PSNR achieved by DenoiseNet. A summary of the number of images on which each algorithm performed the best is presented in Figure \ref{pascal_pie}. \begin{figure}[t] \includegraphics[width=0.48\textwidth]{./pascal_s_curve_new.pdf} \caption{\textbf{Comparison of performance profile relative to BM3D.} Image indices are sorted in ascending order of performance gain relative to BM3D. The improvement of our method over two competing algorithms is demonstrated by (i) a noticeable decrease of the zero-crossing point, and (ii) consistently higher values of gain over BM3D. The distribution reveals the statistical significance of the reported improvement. The comparison was made on images from PASCAL VOC.} \label{pascal_s_curve} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.3\textwidth]{pascal_pie.jpg} \caption{\textbf{Top performance distribution on PASCAL VOC test set.} Percentage of images on which a denoising algorithm performed the best. Our method wins on $92.4\%$ of the images, whereas MLP, BM3D, and TNRD win on $6.6\%, 1\%$ and $0\%$ respectively.} \label{pascal_pie} \end{figure} \paragraph{Berkeley segmentation dataset.} In this experiment we tested the performance of our method, trained on PASCAL VOC, on the a set of $68$ images selected by \cite{roth2009fields} from Berkeley segmentation dataset \cite{MartinFTM01}. Even though these test images belong to a different dataset, Figure \ref{tab_bsds_nonquantized_results} shows that our method outperforms previous methods for all sigma values. \begin{table}[h!] \centering \small \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline\hline $\sigma$ & $10$ & $15$ & $25$ & $35$ & $50$ & $65$ & $75$ \\ \hline BM3D & $33.31$ & $31.10$ & $28.57$ & $27.08$ & $25.62$ & $24.68$ & $24.20$ \\ MLP \cite{burger2012image} & $33.50$ & $-$ & $28.97$ & $27.48$ & $26.02$ & $25.10$ & $24.58$ \\ TNRD \cite{Chen16Trainable} & $-$ & $31.41$ & $28.91$ & $-$ & $25.95$ & $-$ & $-$ \\ DenoiseNet & $\textbf{33.58}$ & $\textbf{31.44}$ & $\textbf{29.04}$ & $\textbf{27.56}$ & $\textbf{26.06}$ & $\textbf{25.12}$ & $\textbf{24.61}$ \\ \hline \hline \end{tabular} \vspace{2mm} \caption{\small \textbf{Performance on images from Berkeley segmentation dataset.} Average PSNR values on a test set of $68$ images selected by \cite{roth2009fields}. Our method outperforms all others for all noise levels. \vspace{-4mm}} \label{tab_bsds_nonquantized_results} \end{table} \paragraph{Quantized noise.} Even though our network has not been explicitly trained to treat quantized noisy images, we evaluated its performance on $300$ such images from \cite{vemulapalli2016deep}. Results are reported in Table \ref{tab_public_denoise_results}. The set contains $100$ test images from the Berkeley segmentation dataset and additional $200$ images from the PASCAL VOC 2012 \cite{pascal-voc-2012} dataset. All images have been quantized to $8$ bits in the range $[0,255]$. For the noise level of $\sigma=25$ our methods outperforms previous methods but fails to do so for $\sigma=50$. \begin{table}[h] \centering \begin{tabular}{ l c c } \hline \hline & $\sigma=25$ & $\sigma=50$ \\ \hline BM3D & $28.21$ & $24.43$ \\ MLP \cite{burger2012image} & $28.58$ & $\textbf{25.20}$ \\ TNRD \cite{Chen16Trainable} & $28.46$ & $24.57$ \\ DenoiseNet & $\textbf{28.71}$ & $24.75$ \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{Performance on quantized test images from \cite{vemulapalli2016deep}.} Images have been clipped to a range of $[0,255]$ and quantized to $8$ bits. PSNR values for two different noise levels are reported. } \label{tab_public_denoise_results} \end{table} \subsection{Class-aware denoising} This experiment evaluates the boost in performance resulting from fine-tunning a denoiser on a set of images belonging to a particular class. In order to do so we collected images from ImageNet \cite{ImageNet15} of the following six classes: \emph{face}, \emph{pet}, \emph{flower}, \emph{beach}, \emph{living room}, and \emph{street}. The $1,500$ images per class were split into train ($60\%$), validation ($20\%$) and test ($20\%$) sets. We then trained a separate class-aware denoiser for each of the six classes. This was done by fine-tuning our class-agnostic model, that had been trained on PASCAL VOC, using the images from ImageNet. The performance of the class-aware denoisers was compared to its class-agnostic counterpart as well as to other denoising methods. Average PSNR values summarized in Figure \ref{fig_class_bar} demonstrate that our class-aware models outperforms our class-agnostic network, BM3D \cite{dabov2007image}, multilayer perceptrons (MLP) \cite{burger2012image} and TNRD \cite{Chen16Trainable}. Notice how class-awareness boosts performance by up to $0.4dB$. \begin{figure}[!htb] \includegraphics[width=0.47\textwidth]{./class_bar_graph.eps} \caption{\textbf{Class-aware denoising performance on ImageNet.} Average PSNR values for different methods on images belonging to six different semantic classes. It is evident that the class-specific fine-tuned models outperform all other methods. In addition being class-aware enables to gain up to $0.4$ dB PSNR copared to our class-agnostic network.} \label{fig_class_bar} \end{figure} \subsection{Cross-class denoising} To further demonstrate the effect of refining a denoiser to a particular class, we tested each class-specific denoiser on images belonging to other classes. The outcome of this mismatch is evident both qualitatively and quantitatively. The top row of Figure \ref{fig_using_wrong_denoiser} presents a comparison of class-aware denoisers fine-tuned to the \textit{street} and \textit{face} image classes applied to a noisy image of a face. The denoiser tuned to the street class produces noticeable artifacts around the eye, cheek and hair areas. Moreover, the edges appear too sharp and seem to favor horizontal and vertical edges. This is not very surprising as street images contain mainly man-made rectangle shaped structures. In the second row, strong artifacts appear on the hamster's fur when the image is processed by \textit{living room}-specific denoiser. The \textit{pet}-specific denoiser, on the other hand, produces a much more naturally looking result. Additional examples demonstrating artifacts caused by the mismatch on the canonical images \textit{House} and \textit{Lena} are presented in the bottom two rows. Notice how the \textit{street}-specific denoiser reconstructs sharp boundaries of the building whereas the \textit{face}-specific counterpart smears them. To quantify the effect of mismatching we evaluated the percentage of wins of every fine-tuned denoiser on each type of image class. A win means that a particular denoiser produced the highest PSNR among all the others. A confusion matrix for all combinations of class-specific denoisers and image classes is presented in Figure \ref{fig_confusion}. We conclude that applying a denoiser of the same class as the image results in the best performance. \begin{figure}[] \centering \setlength{\tabcolsep}{0.2em} \begin{tabular}{ c c c c } \footnotesize{Ground truth}& \footnotesize{Noisy image} & \footnotesize{Correct denoiser} & \footnotesize{Wrong denoiser}\smallskip \\ & & \footnotesize{\textit{face}-specific} & \footnotesize{\textit{street}-specific} \\ % \includegraphics[width = 0.11\textwidth]{./cross_girl_gt.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_girl_noisy.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_girl_face.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_girl_street.jpg} \smallskip\\ & & \footnotesize{\textit{pet}-specific} & \footnotesize{\textit{living room}-specific} \\ \includegraphics[width = 0.11\textwidth]{./cross_mouse_gt_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_mouse_noisy_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_mouse_pet_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./cross_mouse_living_zoom.jpg} \smallskip\\ & & \footnotesize{\textit{street}-specific} & \footnotesize{\textit{face}-specific} \\ \includegraphics[width = 0.11\textwidth]{./classic_gt_house_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_input_house_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_using_street_on_house_zoom.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_using_face_on_house_zoom.jpg} \smallskip\\ & & \footnotesize{\textit{face}-specific} & \footnotesize{\textit{street}-specific} \\ \includegraphics[width = 0.11\textwidth]{./classic_gt_Lena512_zoom_2.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_input_Lena512_zoom_2.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_using_face_on_Lena512_zoom_2.jpg} & \includegraphics[width = 0.11\textwidth]{./classic_using_street_on_Lena512_zoom_2.jpg} \smallskip\\ \end{tabular} \\ \caption{\small \textbf{Cross-class denoising.} Representative outputs of DenoiseNet denoisers fine-tuned to the class of the inpuit image (third column from left), and to a mismatched class (rightmost column). The reader is encouraged to zoom in for a better view of the artifacts.} \label{fig_using_wrong_denoiser} \end{figure} \begin{figure}[] \includegraphics[width=0.47\textwidth]{./confusion_new.jpg} \caption{\textbf{Denoiser performance per semantic class.} Each row represents a specific semantic class of images while class-aware denoisers are represented as columns. The $(i,j)$-th element in the confusion matrix shows the probability of the $j$-th class-aware denoiser to outperform all other denoisers on the $i$-th class of images.} \label{fig_confusion} \end{figure} \begin{figure*}[] \centering \begin{tabular}{ c@{\hskip 0.008\textwidth}c@{\hskip 0.008\textwidth}c@{\hskip 0.008\textwidth}c@{\hskip 0.008\textwidth}c} \includegraphics[width = 0.19\textwidth]{./gradual_denoise_0.jpg} & \includegraphics[width = 0.19\textwidth]{./gradual_denoise_5.jpg} & \includegraphics[width = 0.19\textwidth]{./gradual_denoise_10.jpg} & \includegraphics[width = 0.19\textwidth]{./gradual_denoise_15.jpg} & \includegraphics[width = 0.19\textwidth]{./gradual_denoise_20.jpg} \\ Noisy input & & & & Output \\ \includegraphics[width = 0.19\textwidth]{./gradual_denoise_gt.jpg} & \includegraphics[width = 0.19\textwidth]{./noise_estimate_norm_5.jpg} & \includegraphics[width = 0.19\textwidth]{./noise_estimate_norm_10.jpg} & \includegraphics[width = 0.19\textwidth]{./noise_estimate_norm_15.jpg} & \includegraphics[width = 0.19\textwidth]{./noise_estimate_norm_20.jpg} \\ Ground truth & Layer 5 & Layer 10 & Layer 15 & Layer 20 \\ \end{tabular} \\ \smallskip \caption{\small \textbf{Gradual denoising process by \textit{flower}-specific DenoiseNet.} The top row presents the noisy image (left) and the intermediate result obtained by removing the noise estimated up to the respective layer depth. The second row presents the ground truth image (left) and the noise estimates produced by individual layers; the noise images have been scaled for display purposes. We encourage the reader to zoom-in onto the images to best view the fine details and noise.} \label{fig_denoise_flow} \end{figure*} \subsection{Network noise estimation} \label{sec_noise_estimation} This section presents a few examples that we believe give insights about the noise estimation of our class-aware networks. The overall noise estimation of the network is the sum of the estimates produced by all individual layers. These are presented in the bottom row of Figure \ref{fig_denoise_flow}. Interestingly, they differ significantly from one another. The shallow layer estimations appear to handle local noise while the deeper ones seem to focus on object contours. In the top row, we present the input image after it has been denoised by all layers up to a specific depth. To further examine what is happening ''under the hood'' of our class-aware denoisers, in Figure \ref{fig_layer_selection} we show the error after $5, 10, $ and $20$ layers (rows $4-6$). Surprisingly, even thought it has not been explicitly enforced at training, the error monotonically decreases with the layer depth (see plots in row $7$). This non-trivial behavior is consistently produced by the network on all test images. Lastly, to visualize which of the layers was the most dominant in the denoising process, we assign a different color to each layer and color each pixel according to the layer in which its value changed the most. The resulting image is shown in the bottom row of Figure \ref{fig_layer_selection}. It can be observed that the first few layers govern the majority of the pixels while the following ones mainly focus on recovering and enhancing the edges and textures that might have been degraded by the first layers. \section{Discussion} Given the state-of-the-art performance of our network, an important task is to interpret what it has learned and what is the relation between the action of DenoiseNet and the principles governing the previous manually designed state-of-the-art denoising algorithms. One such principle that has been shown to improve denoising in recent years is \emph{gradual denoising}, namely that iteratively removing small portions of the noise is preferable to removing it all at once \cite{Romano15Boosting, Sulam15Expected, Zoran11From}. Interestingly, as can be seen in Figure~\ref{fig_denoise_flow}, our network exhibits such a behavior despite the fact it has not been trained explicitly to have a monotonically decreasing error throughout the layers. Each layer in the network removes part of the noise in the image, where the flat regions are being denoised mainly in the first layers, while the edges in the last ones. This may be explained by the fact that the deeper layers corresponds to a larger receptive field and therefore may recover in a better way global patterns such as edges that may be indistinguishable from noise if viewed just in the context of a small patch. In a certain sense, the present research demonstrates that in some cases the whole is \textit{smaller} than the sum of its parts. That is, splitting the input image to several categories and then building a fine-tuned filter for each is preferable over a universal filter. That said, the decision to split according to a semantic class was made due to the immediate availability of off-the-shelf classifiers and their resilience to noise. Yet, this splitting scheme may very well be sub-optimal. Other choices for data partitioning could be made. In particular, a classifier could be learned automatically, e.g., by incorporating the splitting scheme into a network architecture and training it end-to-end. In such cases, the partitioning would lose its simple interpretation as semantic classes, and would instead yield some abstract classes. We defer this interesting direction to future research. \begin{figure*}[] \begin{centering} \begin{tabular}{c@{\hskip 0.007\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c} \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Ground truth}& \includegraphics[height = 0.15\textwidth]{./5_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./2_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./3_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./4_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./1_gt.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Noisy input}& \includegraphics[height = 0.15\textwidth]{./5_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./2_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./3_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./4_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./1_noisy.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Denoised image}& \includegraphics[height = 0.15\textwidth]{./5_output.jpg} & \includegraphics[height = 0.15\textwidth]{./2_output.jpg} & \includegraphics[height = 0.15\textwidth]{./3_output.jpg} & \includegraphics[height = 0.15\textwidth]{./4_output.jpg} & \includegraphics[height = 0.15\textwidth]{./1_output.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 5 layers}& \includegraphics[height = 0.15\textwidth]{./5_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./1_diff_l_5_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 10 layers}& \includegraphics[height = 0.15\textwidth]{./5_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./1_diff_l_10_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 20 layers (output)}& \includegraphics[height = 0.15\textwidth]{./5_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./1_diff_l_20_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{RMSE at different layers}& \includegraphics[width = 0.15\textwidth]{./5_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./2_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./3_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./4_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./1_rmse_crop.jpg}&\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Layer contributing the most to each pixel}& \includegraphics[height = 0.15\textwidth]{./5_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./2_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./3_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./4_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./1_max_layer_response.jpg} & \hspace{-1.5mm} \includegraphics[width = 0.018\textwidth]{./colorbar.jpg} \\ \end{tabular} \\ \end{centering} \smallskip \caption{\small \textbf{Gradual denoising process. } Images are best viewed electronically, the reader is encouraged to zoom in for a better view. Please refer to Section \ref{sec_noise_estimation} for more details.} \label{fig_layer_selection} \end{figure*} \clearpage {\small \bibliographystyle{ieee}
{'timestamp': '2017-03-01T02:01:11', 'yymm': '1701', 'arxiv_id': '1701.01698', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01698'}
arxiv
\section{Introduction} \begin{figure*}[t] \centering \begin{tabular}{c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c} \includegraphics[width = 0.23\textwidth]{./man512_png_mat_gt.png} & \includegraphics[width = 0.23\textwidth]{./man512_png_mat_noisy.png} & \includegraphics[width = 0.23\textwidth]{./man512_png_mat_bm3d.png} & \includegraphics[width = 0.23\textwidth]{./man512_png_mat_our.png} \\ Ground truth image& Noisy image& I+VST+BM3D \cite{Azzari16Variance} & Proposed DenoiseNet\\ & & $24.45$ dB & $24.77$ dB\\ \end{tabular} \smallskip \label{teaser} \caption{\small \textbf{Perceptual comparison of proposed method.} The proposed denoiser produces visually more pleasant results and avoids artifacts commonly introduced by previous methods. The reader is encouraged to zoom-in to better appreciate the improvement. The presented image has a peak value of $4$. PSNR values are reported below the denoised images. } \end{figure*} Poisson noise, also known as shot noise, appears in many applications in various fields ranging from medical imaging to astronomy. It becomes dominant especially in the case of low photon count, as in the case of photography in low-light conditions. The problem becomes even more severe in modern mobile cameras that have a small form factor which reduces the amount of light that reaches the sensor. In view of the fact that today most of the photos are captured by smartphones, efficient techniques for Poisson noise removal are needed for improving the quality of images captured by these devices in low-light conditions. In the setup of Gaussian noise removal, which was studied much more than the Poisson counterpart but is less realistic especially in the low-light regime, the state-of-the-art performance is achieved using neural network-based strategies \cite{burger2012image, Chen16Trainable, vemulapalli2016deep}. Especially appealing are convolutional neural network (CNN) based solutions, which offer several advantages. First, they are known to have a high representation capability, thus, potentially enabling the learning of complex priors. In addition, they can be easily adapted to a certain data type merely by training on a specific dataset. Moreoever, being highly parallelizable, they lead in many cases to a fast computation on GPUs. \paragraph{Our contribution.} In this paper we propose a novel fully convolutional residual neural network for Poisson noise removal. We demonstrate state-of-the-art results on several datasets compared to previous techniques. The improvements are noticeable both visually and quantitatively. The advantage of our proposed strategy stems from its simplicity. It does not rely on data models such as non-local similarity, sparse representation or Gaussian mixture models (GMM), which have been used in previous strategies \cite{dabov2007image, Giryes14Sparsity, Salmon13Poisson}, and only partially explain the structure of the data. By taking a supervised approach, and using the powerful representation capabilities demonstrated by deep neural networks, our method learns to remove the Poisson noise without explicitly relying on a model. Moreover, its convolutional structure makes it well suited to run on GPUs and other parallel hardware, thus, leading to running time that is of order of magnitude better than the other non convolutional model-based solutions \cite{dabov2007image, Giryes14Sparsity, Salmon13Poisson}. The performance of our method is further improved when trained on a specific class of images. This scenario is particularly important as the vast majority of photos taken by mobile cameras contain a limited set of types of objects such as faces or landscapes. \section{The Poisson Denoising Problem} \label{sec:background} Let $X \in \left(\mathbb N \cup \left\{0 \right\}\right) ^{W \times H}$ denote a noisy image produced by a sensor. The goal of denoising is to recover a latent clean image $Y \in \mathbb R_+^{W \times H}$ observed by the sensor. In low-light imaging, the noise is dominated by shot noise; consequently, given the true value $Y_{ij}$ of the $(i,j)$-th pixel expressed in number of photoelectrons, the corresponding value of the observed pixel $X_{ij}$ is an independent Poisson-distributed random variable with mean and variance $Y_{ij}$, i.e., $X_{ij} \sim \text{Poisson}(Y_{ij})$: \begin{eqnarray} \label{eq:pois_dist} \text{P}(X_{ij} = n\big|Y_{ij} = \lambda) = \left\{ \begin{array}{cc} \frac{\lambda^{n}}{n!}e^{-\lambda} & \lambda >0 \\ \delta_n & \lambda = 0. \end{array} \right. \end{eqnarray} Notice that Poisson noise is neither additive nor stationary, as its strength is dependent on the image intensity. Lower intensity in the image yields a stronger noise as the SNR in each pixel is $\sqrt{Y_{ij}}$. Thus, it is natural to define the noise power in an image by the maximum value of $Y$ (its peak value). This is a good measure under the assumption that the intensity values are spread uniformly across the entire dynamic range, which holds for most natural images. A very popular strategy \cite{Boulanger10Patch, Dupe09Proximal, Makitalo11Optimal, Zhang08Wavelets} for recovering $Y$ relies on variance-stabilizing transforms (VST), such as Anscombe \cite{anscombe48transformation} and Fisz \cite{Fisz55Limiting}, that convert Poisson noise to be approximately white Gaussian with unit variance. Thus, it is possible to solve the Poisson denoising problem using one of the numerous denoisers developed for Gaussian noise (e.g. \cite{burger2012image, Chen16Trainable, dabov2007image, Dong15Image, Dong13Nonlocally, Mairal09Non, Schmidt10Generative, vemulapalli2016deep}). The problem with these approximations is the fact that they cease to hold for very low intensity values \cite{Makitalo11Optimal,Salmon13Poisson}. One strategy that has been used to overcome this deficiency correct the estimated varaince by applying the Gaussian denoiser and the Anscombe transform iteratively \cite{Azzari16Variance}. Another technique that also relies on Gaussian denoisers bypasses the need of using any type of VST by using the ``plug and play'' scheme \cite{Rond16Poisson}. An alternative approach is to develop new methods that are adapted to the Poisson noisy data directly \cite{ Danielyan11Deblurring, Deledalle10Poisson, Feng15Fast, Figueiredo10Restoration, Giryes14Sparsity, Rodrigo11Efficient, Remez15Picture, Salmon13Poisson,Willett03Platelets, Zhang12Novel}. For example, the work in \cite{Salmon13Poisson} proposed the non-local sparse PCA (NLSPCA) technique that relies on GMM \cite{Yu12Solving}. In \cite{Giryes14Sparsity}, a different strategy has been proposed, the sparse Poisson denoising algorithm (SPDA), which relies on sparse coding and dictionary learning. In \cite{Feng15Fast}, a nonlinear diffusion based neural network, previously proposed for Gaussian denosing \cite{Chen16Trainable}, has been adapted to the Poisson noise setting under the name of trained reaction diffusion models for Poisson denoising (TRDPD). A popular strategy improving the performance of many Poisson denoising algorithms is binning \cite{Salmon13Poisson}. Instead of processing the noisy image directly, a low-resolution version of the image with higher SNR is generated by aggregation of nearby pixels. Then, a given Poisson denoising technique is applied followed by simple linear interpolation to get back to the original high resolution image. The binning technique trades off spatial resolution and SNR, and has been shown to be useful in the very low SNR regimes. \section{Denoising by DenoiseNet} \label{sec:poissNet} To recover the clean image $Y$ from its realization $X$, which is contaminated with Poisson noise, we propose a fully convolutional neural network. Our architecture, denoted as DenoiseNet, is inspired by the network suggested in \cite{vemulapalli2016deep} for the purpose of super-resolution as the network estimates the difference between the noisy image and its clean counterpart. It also bares resemblance to the residual network introduced in \cite{He16Deep} since the weight gradients propagate to each layer both through its following layer and directly from the loss function. \subsection{Network architecture} The DenoiseNet architecture is shown in Figure ~\ref{fig_denoiseNet}. The network receives a noisy grayscale image as the input and produces an estimate of the original clean image. At each layer, we convolve the previous layer output with $64$ kernels of size $3 \times 3$ using a stride of $1$. The first $63$ output channels are used for calculating the next steps, whereas the last channel is extracted to be directly combined with the input image to predict the clean output. Thus, these extracted layers can be viewed as negative noise components as their sum cancels out the noise. We build a deep network comprising $20$ convolutional layers, where the first $18$ use the \textit{ReLU} nonlinearity, while the last two are kept entirely linear. \begin{figure}[tb] \includegraphics[width=1\linewidth]{flow_chart_4.png} \caption{DenoiseNet architecture.} \label{fig_denoiseNet} \end{figure} \subsection{Implementation details} \label{sec_implementation_details} We implemented the network in TensorFlow \cite{abadi2015tensorflow} and trained it for $120K$ iterations, which roughly took $72$ hours on a Titan-X GPU on a set of $8000$ images from the PASCAL VOC dataset \cite{everingham2010pascal}. We used mini-batches of $64$ patches of size $128 \times 128$. Images were converted to YCbCr and the Y channel was used as the input grayscale image after being scaled by the peak value and shifted by $-1/2$. For data augmenttion purposes, during training, image patches were randomly cropped from the training images and flipped about the vertical axis. Also, noise realization was randomzied. Training was done using the ADAM optimizer \cite{DBLP:journals/corr/KingmaB14} with the learning rate $\alpha=10^{-4}$, $\beta_1=0.9$, $\beta_2=0.999$ and $\epsilon=10^{-8}$. Separate networks were trained respectively for different peak values. To avoid convolution artifacts at the borders of the patches, during training we used an $\ell_2$ loss on the central part of the patches cropping the outer $21$ pixels. At test time, images were padded with $21$ pixels using symmetric reflection before passing them through the network, and cropped back to their original size afterwards to give the final output. \subsection{Class-aware denoising} \label{sec:class_aware} Having constructed a supervised framework for Poisson denoising, it is natural to seek for additional benefits of its inherent flexibility to fine-tune to specific data. One possibility to exploit this property, which we propose here, is to build class-specific denoisers, that is, to restrict the training data to a specific semantic class in order to boost the performance on it. This assumption is rather unrestrictive, as in many low-light imaging application the data being processed belong to a specific domain. In other settings, the class information can be provided manually by the user. For example, choosing face denoising for cleaning a personal photo collection. Alternatively, one could potentially train, yet, another deep network for automatic classification of the noisy images. The idea of combining classification with reconstruction has been previously proposed by \cite{baker2002limits}, which also dubbed it \textit{recogstruction}. In their work, the authors set a bound on super-resolution performance and showed it can be broken when a face-prior is used. Several other studies have shown that it is beneficial to design a strategy for a specific class. For example, in \cite{Bryt08Compression} it has been shown that the design of a compression algorithm dedicated to faces improves over generic techniques targeting general images. Specifically for the class of faces, several face hallucination methods have been developed \cite{Wang14Comprehensive}, including face super-resolution and face sketch-photo synthesis techniques. In \cite{Joshi10Personal}, the authors showed that given a collection of photos of the same person it is possible to obtain a more faithful reconstruction of the face from a blury image. In \cite{Iizuka16Let, zhang2016colorful} class labeling at a pixel-level is used for the colorization of gray-scale images. In \cite{Anwar15Class}, the subspaces attenuated by blur kernels for specific classes are learned, thus improving the deblurring performance. Building on the success demonstrated in the aforementioned body of work, in this paper, we propose to use semantic classes as a prior and build class-aware denoisers. Different from previous methods, our model is made class-aware via training and not by design, hence it can be automatically extended to any type and number of classes. \section{Experiments} \label{sec:exp} We tested DenoiseNet performance and compared to other methods on the following series of experiments. Whenever code for another technique was not publicly available, we evaluated our method on the same test set and compared with the reported scores. As a first experiment, DenoiseNet was tested on the test set of the dataset it had been trained on, namely PASCAL VOC \cite{pascal-voc-2010}. We then applied it on a commonly used test set of $10$ images and compared against $8$ other methods for $5$ different peak values in the range $[1,30]$. To further appreciate the performance on different data we compared against \cite{Feng15Fast} on $68$ images from the Berkeley segmentation dataset \cite{MartinFTM01}. We proceeded with a short exploration that suggests that applying binning and the Anscombe transform, which are common techniques in the Poisson denoising literature, does not improve our network performance. Lastly, we fine tuned our network using specific classes of images from ImageNet to demonstrate the additional boost obtained in performance provided by such a prior. \subsection{PASCAL VOC images} In this experiment we tested our network on a set of $1000$ images from PASCAL VOC \cite{pascal-voc-2010}. A comparison with the recent iterative Poisson image denoising via VST method (I+VST+BM3D \cite{Azzari16Variance}), {which is considered to be the leading method for Poisson denoising to date,} shows an improvement in PSNR across all tested peak values between $1$ and $30$ of as much as $0.71$ dB (see Table \ref{tab_pascal_psnr}). A different network was trained to handle each of the peak values using images from PASCAL VOC as described in Section \ref{sec_implementation_details}. Interestingly, the gain achieved by our method decays as the peak values decrease. To examine the statistical significance of the improvement our method achieves, in Figure \ref{pascal_s_curve} we compare the gain in performance with respect to I+VST+BM3D achieved by our method. Image indices are sorted in ascending order of performance gain. A small zero-crossing value affirms our method outperforms I+VST+BM3D on the large majority of the images in the dataset. The plot visualizes the significant and consistent improvement in PSNR achieved by our method. An additional summary of the percentage of images from the dataset, on which each method outperformed the other is presented in Table \ref{tab_pascal_wins}. It is evident that with our method, a better reconstruction for peak values greater than $2$ is almost guaranteed. Denoising of several images from the test-set are visualized in Figure \ref{fig_large_pascal}. We encourage the reader to zoom-in to appreciate the significant improvement our method achieves, resulting in much more aesthetically pleasing images. \begin{table}[h] \centering \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline \hline Peak & $1$ & $2$ & $4$ & $8$ & $30$ \\ \hline I+VST+BM3D & $22.71$ & $23.70$ & $24.78$ & $26.08$ & $28.85$ \\ DenoiseNet & $\textbf{22.87}$ & $\textbf{24.09}$ & $\textbf{25.36}$ & $\textbf{26.70}$ & $\textbf{29.56}$ \\ \hline PSNR gain & $0.16$ & $0.39$ & $0.58$ & $0.62$ & $0.71$ \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{PSNR performance on PASCAL VOC \cite{pascal-voc-2010}.} Average PSNR values for different peak values on $1000$ test images and $15$ noise realizations per image. PSNR gain between the proposed method and I+VST+BM3D is presented in the bottom row. } \label{tab_pascal_psnr} \end{table} \begin{table}[h] \centering \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline \hline Peak & $1$ & $2$ & $4$ & $8$ & $30$ \\ \hline I+VST+BM3D & $26.0\%$ & $5.2\%$ & $1.1\%$ & $1\%$ & $0.8\%$ \\ DenoiseNet & $\textbf{74.0\%}$ & $\textbf{94.8\%}$ & $\textbf{98.9\%}$ & $\textbf{99\%}$ & $\textbf{99.2\%}$ \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{Wins on PASCAL VOC \cite{pascal-voc-2010}.} Presented is the percentage of images out of the $1,000$ image test set on which each of the compared algorithms outperformed the others. } \label{tab_pascal_wins} \end{table} \begin{figure}[t] \includegraphics[width=0.48\textwidth]{./pascal_s_curve.eps} \caption{\textbf{Comparison of performance profile relative to I+VST+BM3D \cite{Azzari16Variance}.} Image indices are sorted in ascending order of performance gain relative to I+VST+BM3D. The improvement of our method is demonstrated by (i) small zero-crossing point, and (ii) consistently higher PSNR values. The distribution reveals the statistical significance of the reported improvement. The comparison was made on images from PASCAL VOC and $15$ noise realizations per image.} \label{pascal_s_curve} \end{figure} \subsection{Standard image set} In this experiment we evaluated our method on the standard set of images used by previous works. Evaluation was performed for peak values in the range of $1$ to $30$. PSNR values and running time presented in Table \ref{tab_classic_image_psnr} show that our method outperforms all other methods by a significant margin for the large majority of the images and almost all peak values. In addition, the execution time is orders of magnitude faster on a Titan-X GPU taking only $37$ milliseconds for a $256\times 256$ image, and is comparable to other methods when it runs on an{Intel E5-2630 $2.20$GHz CPU, taking $1.3$ seconds. A qualitative example can be seen in Figure \ref{teaser} showing the \textit{man} image denoised by DenoiseNet and by I+VST+BM3D\cite{Azzari16Variance} for a peak value of $4$. \begin{table*}[h] \centering \begin{tabular}{ l@{\hskip 0.01\textwidth}|c@{\hskip 0.01\textwidth}|c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}|l@{\hskip 0.01\textwidth} } \hline \hline Method & Peak & Flag & House & Cam & Man & Bridge & Saturn & Peppers & Boat & Couple & Hill & Time \\ \hline \hline NLSPCA & & $19.68$ & $21.57$ & $20.25$ & $21.46$ & $19.02$ & $24.75$ & $19.5$ & $21.19$ & $21.14$ & $21.94$ & $86$s \\ NLSPCA bin & & $15.77$ & $20.78$ & $18.4$ & $19.87$ & $18.26$ & $22.83$ & $17.78$ & $20.19$ & $20.11$ & $20.82$ & $16$s \\ SPDA & & $\textbf{22.97}$ & $22.14$ & $20.15$ & - & $19.30$ & $27.05$ & $19.97$ & - & - & - & $5$h \\ SPDA bin & & $18.99$ & $20.99$ & $19.43$ & $21.15$ & $18.84$ & $27.40$ & $18.93$ & $21.19$ & $20.97$ & $21.5$ & $25$min \\ P4IP & $1$ & $19.07$ & $22.67$ & $20.54$ & - & $19.31$ & $27.05$ & $20.07$ & - & - & - & few mins \\ VST+BM3D & & $18.46$ & $21.64$ & $20.19$ & $21.62$ & $19.43$ & $25.82$ & $19.71$ & $21.47$ & $21.14$ & $21.92$ & $0.78$s \\ VST+BM3D bin & & $19.28$ & $22.53$ & $20.69$ & $22.07$ & $19.59$ & $\textbf{27.59}$ & $20.22$ & $21.97$ & $21.81$ & $22.72$ & $0.10$s \\ I+VST+BM3D & & $19.74$ & $\textbf{23.04}$ & $21.07$ & $22.30$ & $\textbf{19.86}$ & $27.27$ & $20.44$ & $22.17$ & $22.08$ & $\textbf{22.85}$ & $0.82$s \\ DenoiseNet & & $19.45$ & $22.87$ & $\textbf{21.59}$ & $\textbf{22.49}$ & $19.83$ & $26.26$ & $\textbf{21.43}$ & $\textbf{22.38}$ & $\textbf{22.11}$ & $22.82$ & $0.04$s/$1.3$s \\ \hline NLSPCA & & $19.70$ & $23.16$ & $20.64$ & $22.37$ & $19.43$ & $26.88$ & $20.48$ & $21.83$ & $21.75$ & $22.68$ & $87$s \\ NLSPCA bin & & $15.52$ & $20.85$ & $18.35$ & $19.87$ & $18.32$ & $21.27$ & $17.78$ & $20.29$ & $20.21$ & $20.98$ & $12$s \\ SPDA & & $\textbf{24.72}$ & $24.37$ & $21.35$ & - & $20.17$ & $29.13$ & $21.18$ & - & - & - & $6h$ \\ SPDA bin & & $19.26$ & $21.12$ & $19.53$ & $21.66$ & $18.87$ & $28.54$ & $19.17$ & $21.43$ & $21.24$ & $21.94$ & $25$min \\ P4IP & $2$ & $21.04$ & $24.65$ & $21.87$ & - & $20.16$ & $28.93$ & $21.33$ & - & - & - & few mins \\ VST+BM3D & & $20.79$ & $23.79$ & $21.97$ & $23.11$ & $20.49$ & $27.95$ & $22.02$ & $22.90$ & $22.65$ & $23.34$ & $0.82$s \\ VST+BM3D bin && $19.91$ & $24.10$ & $21.43$ & $23.03$ & $20.36$ & $\textbf{29.26}$ & $21.45$ & $22.92$ & $22.84$ & $23.75$ & $0.10$s \\ I+VST+BM3D & & $21.18$ & $24.62$ & $22.25$ & $23.40$ & $20.69$ & $28.85$ & $21.93$ & $23.30$ & $23.12$ & $23.88$ & $0.82$s \\ DenoiseNet & & $21.38$ & $\textbf{24.77}$ & $\textbf{23.25}$ & $\textbf{23.64}$ & $\textbf{20.80}$ & $28.37$ & $\textbf{23.19}$ & $\textbf{23.66}$ & $\textbf{23.30}$ & $\textbf{23.95}$ & $0.04$s/$1.3$s \\ \hline NLSPCA & & $20.15$ & $24.26$ & $20.97$ & $22.93$ & $20.21$ & $27.99$ & $21.07$ & $22.49$ & $22.33$ & $23.51$ & $123$s \\ NLSPCA bin & & $15.52$ & $20.94$ & $18.27$ & $19.88$ & $18.32$ & $22.02$ & $17.72$ & $20.29$ & $20.25$ & $20.99$ & $13$s \\ SPDA & & $\textbf{25.76}$ & $25.3$ & $21.72$ & -& $20.53$ & $\textbf{31.13}$ & $22.2$ & - & -& - & $8$h\\ SPDA bin & & $19.42$ & $22.07$ & $19.95$ & $22.18$ & $19.26$ & $29.71$ & $20.19$ & $21.76$ & $21.69$ & $22.82$ & $31$min \\ P4IP & $4$ & $22.49$ & $26.33$ & $23.29$ & $24.66$ & $21.11$ & $30.82$ & $23.88$ & $24.10$ & $23.99$ & $25.28$ & few mins \\ VST+BM3D & & $22.93$ & $25.49$ & $23.82$ & $24.32$ & $21.51$ & $29.41$ & $24.01$ & $24.16$ & $24.10$ & $24.47$ & $0.74$s \\ VST+BM3D bin & & $20.43$ & $25.49$ & $22.22$ & $23.99$ & $21.13$ & $30.87$ & $22.57$ & $23.92$ & $23.84$ & $24.69$ & $0.10$s \\ I+VST+BM3D & & $23.51$ & $26.07$ & $24.10$ & $24.52$ & $21.71$ & $30.38$ & $24.04$ & $24.53$ & $24.34$ & $24.82$ & $1.41$s \\ DenoiseNet & & $23.18$ & $\textbf{26.59}$ & $\textbf{24.87}$ & $\textbf{24.77}$ & $\textbf{21.81}$ & $30.02$ & $\textbf{24.83}$ & $\textbf{24.86}$ & $\textbf{24.60}$ & $\textbf{25.01}$ & $0.04$s/$1.3$s \\ \hline NLSPCA & & $14.87$ & $20.87$ & $18.21$ & $19.76$ & $18.23$ & $21.44$ & $17.67$ & $20.20$ & $20.21$ & $20.93$ & $60$s \\ SPDA & & $\textbf{26.85}$ & $26.36$ & $22.24$ & $24.36$ & $21.05$ & $32.39$ & $22.89$ & $23.50$ & $23.37$ & $24.93$ & days \\ P4IP & $8$ & $23.10$ & $27.36$ & $24.49$ & $24.96$ & $21.68$ & $\textbf{32.88}$ & $24.94$ & $25.03$ & $25.06$ & $24.50$ & $167$s \\ I+VST+BM3D & & $25.54$ & $27.95$ & $25.74$ & $25.81$ & $22.72$ & $32.35$ & $25.90$ & $25.95$ & $25.79$ & $26.06$ & $5.1$s \\ DenoiseNet & & $25.73$ & $\textbf{28.42}$ & $\textbf{26.35}$ & $\textbf{26.10}$ & $\textbf{22.91}$ & $32.28$ & $\textbf{26.45}$ & $\textbf{26.23}$ & $\textbf{26.11}$ & $\textbf{26.26}$ & $0.04$s/$1.3$s \\ \hline NLSPCA & & $14.78$ & $18.83$ & $17.98$ & $19.39$ & $18.03$ & $21.41$ & $17.06$ & $19.92$ & $19.98$ & $20.60$ & $92$s \\ SPDA & & $27.10$ & $27.06$ & $22.47$ & $25.02$ & $21.22$ & $35.08$ & $23.61$ & $24.55$ & $24.06$ & $25.88$ & days \\ P4IP & $30$ & $27.02$ & $29.85$ & $27.28$ & $26.52$ & $23.07$ & $36.03$ & $27.33$ & $26.98$ & $27.22$ & $27.01$ & $149$s\\ I+VST+BM3D & & $\textbf{29.09}$ & $31.35$ & $28.55$ & $28.37$ & $25.08$ & $36.03$ & $29.08$ & $28.79$ & $28.80$ & $28.62$ & $4.5$s \\ DenoiseNet & & $28.94$ & $\textbf{31.67}$ & $\textbf{29.21}$ & $\textbf{28.74}$ & $\textbf{25.42}$ & $\textbf{36.20}$ & $\textbf{29.77}$ & $\textbf{29.06}$ & $\textbf{29.13}$ & $\textbf{28.71}$ & $0.04$s/$1.3$s \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{Performance on standard images.} Numeric values represent PSNR in dB averaged over five noise realizations. Values for prior art algorithms for peak values of $1-4$ were taken from \cite{Azzari16Variance}. For the rest of the peak values we ran the code published by the authors; in the absence of optimal parameter settings, we used those for peak$=4$. Timing values presented are averages for images of size $256\times256$, for DenoiseNet we present the run-time on GPU/CPU. } \label{tab_classic_image_psnr} \end{table*} \subsection{Berkeley segmentation dataset} \label{sec_berkeley} In this experiment we tested our method on $68$ test images from the Berkeley dataset \cite{MartinFTM01} (as selected by \cite{roth2009fields}), and compared it with \cite{Feng15Fast} and I+VST+BM3D \cite{Azzari16Variance}. Note that we did not fine-tune our network to fit this dataset but rather used it after it had been trained on PASCAL VOC. Results are summarized in Table \ref{tab_68_psnr}. The superiority of DenoiseNet over other methods is evident across all peak values. Especially interesting is the improvement compared to \cite{Feng15Fast}, where a trainable nonlinear reaction diffusion network was tuned for Poisson denoising on this data. This suggests that a flexible network architecture may sometimes be preferable to a model-driven one, and especially in the case where training data are practically unlimited. Also note that both networks have similar run time. \begin{table}[h] \centering \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline \hline Peak & $1$ & $2$ & $4$ & $8$ \\ \hline NLSPCA & $20.90$ & $21.60$ & $22.09$ & $22.38$ \\ NLSPCA bin & $19.89$ & $19.95$ & $19.95$ & $19.91$ \\ VST+BM3D & $21.01$ & $22.21$ & $23.54$ & $24.84$ \\ VST+BM3D bin & $21.39$ & $22.14$ & $22.87$ & $23.53$ \\ I+VST+BM3D & $21.66$ & $22.59$ & $23.69$ & $24.93$ \\ TRDPD$^8_{5\times5}$ & $21.49$ & $22.54$ & $23.70$ & $24.96$ \\ TRDPD$^8_{7\times7}$ & $21.60$ & $22.62$ & $23.84$ & $25.14$ \\ DenoiseNet & $\textbf{21.79}$ & $\textbf{22.90}$ & $\textbf{23.99}$ & $\textbf{25.30}$ \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{PSNR performance $68$ images set from \cite{roth2009fields}.} Average PSNR values for different peak values on $68$ image test set from \cite{roth2009fields}. Results reported in \cite{Feng15Fast} were copied as is, and values for our method and for I+VST+BM3D \cite{Azzari16Variance} were added (averaging over $15$ noise realizations per image). Our network was trained on PASCAL VOC images as described in Section~\ref{sec_implementation_details}. } \label{tab_68_psnr} \end{table} \begin{figure*}[] \centering \small \begin{tabular}{c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c} Ground Truth & I+VST+BM3D \cite{Azzari16Variance} & DenoiseNet & Class-specific DenoiseNet\\ \includegraphics[width = 0.2\textwidth]{./n09618957_5909_JPEG_mat_gt_marked.jpg} & \includegraphics[width = 0.2\textwidth]{./n09618957_5909_JPEG_mat_bm3d.jpg} & \includegraphics[width = 0.2\textwidth]{./n09618957_5909_JPEG_mat_our.jpg} & \includegraphics[width = 0.2\textwidth]{./n09618957_5909_JPEG_mat_our_class.jpg} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c} \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_gt_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_gt_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_bm3d_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_bm3d_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_our_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_our_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_our_class_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n09618957_5909_JPEG_mat_our_class_crop_2.png} \\ \multicolumn{2}{c}{\smallskip} & \multicolumn{2}{c}{$25.85$ dB} & \multicolumn{2}{c}{$26.79$ dB} & \multicolumn{2}{c}{$26.96$ dB} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c} \includegraphics[width = 0.2\textwidth]{./n04335209_16743_JPEG_mat_gt_marked.jpg} & \includegraphics[width = 0.2\textwidth]{./n04335209_16743_JPEG_mat_bm3d.jpg} & \includegraphics[width = 0.2\textwidth]{./n04335209_16743_JPEG_mat_our.jpg} & \includegraphics[width = 0.2\textwidth]{./n04335209_16743_JPEG_mat_our_class.jpg} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c} \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_gt_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_gt_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_bm3d_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_bm3d_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_our_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_our_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_our_class_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n04335209_16743_JPEG_mat_our_class_crop_2.png} \\ \multicolumn{2}{c}{\smallskip} & \multicolumn{2}{c}{$25.56$ dB} & \multicolumn{2}{c}{$26.47$ dB} & \multicolumn{2}{c}{$26.75$ dB} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c} \includegraphics[width = 0.2\textwidth]{./n03679712_10889_JPEG_mat_gt_marked.jpg} & \includegraphics[width = 0.2\textwidth]{./n03679712_10889_JPEG_mat_bm3d.jpg} & \includegraphics[width = 0.2\textwidth]{./n03679712_10889_JPEG_mat_our.jpg} & \includegraphics[width = 0.2\textwidth]{./n03679712_10889_JPEG_mat_our_class.jpg}\\ \end{tabular} \begin{tabular}{c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c} \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_gt_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_gt_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_bm3d_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_bm3d_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_our_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_our_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_our_class_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n03679712_10889_JPEG_mat_our_class_crop_2.png} \\ \multicolumn{2}{c}{\smallskip} & \multicolumn{2}{c}{$24.09$ dB} & \multicolumn{2}{c}{$24.96$ dB} & \multicolumn{2}{c}{$25.36$ dB} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.02\textwidth}c} \includegraphics[width = 0.2\textwidth]{./n01318894_17393_JPEG_mat_gt_marked.jpg} & \includegraphics[width = 0.2\textwidth]{./n01318894_17393_JPEG_mat_bm3d.jpg} & \includegraphics[width = 0.2\textwidth]{./n01318894_17393_JPEG_mat_our.jpg} & \includegraphics[width = 0.2\textwidth]{./n01318894_17393_JPEG_mat_our_class.jpg} \\ \end{tabular} \begin{tabular}{c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.02\textwidth}c@{\hskip 0.01\textwidth}c} \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_gt_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_gt_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_bm3d_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_bm3d_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_our_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_our_crop_2.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_our_class_crop_1.png} & \includegraphics[width = 0.095\textwidth]{./n01318894_17393_JPEG_mat_our_class_crop_2.png} \\ \multicolumn{2}{c}{\smallskip} & \multicolumn{2}{c}{$23.53$ dB} & \multicolumn{2}{c}{$24.60$ dB} & \multicolumn{2}{c}{$24.78$ dB} \\ \end{tabular} \vspace{-3mm} \caption{\textbf{Denoising examples from ImageNet.} Presented are images from ImageNet denoised by I+VST+BM3D and our class-agnostic and class-specific denoisers for peak $8$. PSNR values appear below each of the images.} \label{fig_large_imagenet} \end{figure*} \subsection{The influence of binning and VST} Two techniques have been shown in the past to boost reconstruction quality in Poisson denoising: the use of the Anscombe transform (and its inverse), and binning. To check whether these could also improve our proposed network we changed the architecture in the following way. We added a first layer with $4$ channels consisting of constant valued square kernels of sizes $n \times n$, where $n = 1, 3, 5, 7$. This has the effect of binning. This layer's weights were kept fixed at training phase. We further added a second layer realizing the non-linear Anscombe transform. The input was also transformed before adding it to the intermediate residual outputs. Finally, we added the exact inverse transform \cite{Makitalo11Optimal} after summing the residuals and the transformed noisy input image. Interestingly, these modifications had a negligible effect on the network performance. As for the reasons why or whether there would have been an effect for shallower networks, we leave these for future work. \subsection{Class-aware denoising} In order to demonstrate the benefits of having a flexible architecture when an adaptation to a specific data type is required, we selected the following semantic classes: face, flower, street, living-room, and pet. About $1200$ images were collected for each of the $5$ semantic classes from ImageNet \cite{ImageNet15}. Starting from the network that has been trained on PASCAL for peak $8$, we fine-tuned a separate network to each of the classes, thus, making them ''class-specific'' (as opposed to being ''class-agnostic'' before the fine-tunning process). Tuning procedure consisted of $45 \times 10^3$ training iterations with the same parameters used for the initial training. The images of each class were slip into training ($60\%$), validation ($20\%$) and test ($20\%$) sets. % The performance of our class-specific networks compared to the class-agnostic baseline and I+VST+BM3D is summarized in Table \ref{tab_class_aware_psnr}. While the class-agnostic DenoiseNet outperforms I+VST+BM3D by as much as $0.6$ dB, its class-specific version boosts performance by additional $0.15$ to $0.31$ dB. % A visual inspection is presented in Figure~\ref{fig_large_imagenet}, which demonstrates an already large improvement of our proposed class-agnostic method compared to previous methods, and yet an additional non-negligible boost attained by the class-aware network. We encourage the reader to zoom in, e.g., on the person's face, the living-room floor and curtains, the streets curbs and building facades, and the cat's eyes and fur to fully appreciate the improvement in visual quality. % Lastly, in Figure \ref{fig_confusion} we present a confusion matrix calculated for applying different denoiser class on all different image classes. It can be seen that the network has indeed learned distinguishable features per class and has specialized on it yielding higher PSNR with respect to all other class-aware denoisers for the majority of images. \begin{figure}[] \includegraphics[width=0.47\textwidth]{./confusion.png} \caption{\textbf{Denoiser performance per semantic class.} Each row represents a specific semantic class of images while class-aware denoisers are represented as columns. The $(i,j)$-th element in the confusion matrix shows the probability of the $j$-th class-aware denoiser to outperform all other denoisers on the $i$-th class of images. The diagonal dominant structure indicates that each denoiser specializes on a particular class.} \label{fig_confusion} \end{figure} \begin{table}[h] \centering \begin{tabular}{ l@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c@{\hskip 0.01\textwidth}c } \hline \hline % Image class & Face & Flower & Livingroom & Pet & Street \\ \hline I+VST+BM3D & $27.17$ & $26.16$ & $26.39$ & $25.95$ & $24.13$ \\ Class-unaware & $27.70$ & $26.68$ & $26.99$ & $26.39$ & $24.69$ \\ Class-specific & $\textbf{28.01}$ & $\textbf{26.93}$ & $\textbf{27.19}$ & $\textbf{26.54}$ &$\textbf{24.85}$ \\ \hline\hline \end{tabular} \vspace{2mm} \caption{\small \textbf{ Class-aware denoising on ImageNet data.} Presented is the average PSNR performance on specific class images from ImageNet. It is evident that DenoiseNet significantly outperforms I+VST+BM3D \cite{Azzari16Variance} even when it is class-agnostic by as much as $0.6$ dB, while the class-specific approach boosts performance by an additional $0.15$ to $0.31$ dB. We averaged $15$ noise realizations per image and $300$ images per class. } \label{tab_class_aware_psnr} \end{table} \subsection{``Under the hood'' of DenoiseNet} This section presents a few examples that we believe give insights about the noise estimation of DenoiseNet. In Figure \ref{fig_layer_selection} we show several denoised images with peak value $8$ and the error after $5, 10, $ and $20$ layers (rows $4-6$). Surprisingly, even though it has not been explicitly enforced at training, the error monotonically decreases with the layers' depth (see plots in row $7$ in Figure \ref{fig_layer_selection}). This non-trivial behavior is consistently produced by the network on almost all test images. To visualize which of the layers was the most dominant in the denoising process, we assign a different color to each layer and color each pixel according to the layer in which its value changed the most. The resulting image is shown in the bottom row of Figure \ref{fig_layer_selection}. It can be observed that the first few layers govern the majority of the pixels while the following ones mainly focus on recovering and enhancing the edges and textures that might have been degraded by the first layers. \begin{figure*}[] \begin{centering} \begin{tabular}{c@{\hskip 0.007\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c} \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Ground truth}& \includegraphics[height = 0.15\textwidth]{./1_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./5_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./2_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./3_gt.jpg} & \includegraphics[height = 0.15\textwidth]{./4_gt.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Noisy input}& \includegraphics[height = 0.15\textwidth]{./1_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./5_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./2_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./3_noisy.jpg} & \includegraphics[height = 0.15\textwidth]{./4_noisy.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Denoised image}& \includegraphics[height = 0.15\textwidth]{./1_output.jpg} & \includegraphics[height = 0.15\textwidth]{./5_output.jpg} & \includegraphics[height = 0.15\textwidth]{./2_output.jpg} & \includegraphics[height = 0.15\textwidth]{./3_output.jpg} & \includegraphics[height = 0.15\textwidth]{./4_output.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 5 layers}& \includegraphics[height = 0.15\textwidth]{./1_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./5_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_5_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_5_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 10 layers}& \includegraphics[height = 0.15\textwidth]{./1_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./5_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_10_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_10_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Error after 20 layers (output)}& \includegraphics[height = 0.15\textwidth]{./1_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./5_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./2_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./3_diff_l_20_w.jpg} & \includegraphics[height = 0.15\textwidth]{./4_diff_l_20_w.jpg} &\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{RMSE at different layers}& \includegraphics[width = 0.15\textwidth]{./1_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./5_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./2_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./3_rmse_crop.jpg}& \includegraphics[width = 0.15\textwidth]{./4_rmse_crop.jpg}&\\ \hspace{-1mm}\parbox[b][4em][s]{0.16\textwidth}{Layer contributing the most to each pixel}& \includegraphics[height = 0.15\textwidth]{./1_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./5_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./2_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./3_max_layer_response.jpg} & \includegraphics[height = 0.15\textwidth]{./4_max_layer_response.jpg} & \hspace{-1.5mm} \includegraphics[width = 0.018\textwidth]{./colorbar.png} \\ \end{tabular} \\ \end{centering} \smallskip \caption{\small \textbf{Gradual denoising process. } Images are best viewed electronically. The reader is encouraged to zoom in for a better view. Please refer to the text for more details.} \label{fig_layer_selection} \end{figure*} \begin{figure*}[] \centering \begin{tabular}{c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c@{\hskip 0.005\textwidth}c} Ground Truth & Noisy & I+VST+BM3D \cite{Azzari16Variance} & DenoiseNet \\ \includegraphics[width = 0.23\textwidth]{./2009_002131_mat_gt.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_002131_mat_noisy.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_002131_mat_bm3d.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_002131_mat_our.jpg} \\ &\medskip & $24.56$ dB & $25.83$ dB \\ \includegraphics[width = 0.23\textwidth]{./2009_005154_mat_gt.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005154_mat_noisy.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005154_mat_bm3d.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005154_mat_our.jpg} \\ &\medskip & $24.76$ dB & $26.00$ dB \\ \includegraphics[width = 0.23\textwidth]{./2009_005082_mat_gt.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005082_mat_noisy.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005082_mat_bm3d.jpg} & \includegraphics[width = 0.23\textwidth]{./2009_005082_mat_our.jpg} \\ \medskip & & $23.40$ dB & $24.66$ dB \\ \includegraphics[width = 0.23\textwidth]{./2008_007003_mat_gt.jpg} & \includegraphics[width = 0.23\textwidth]{./2008_007003_mat_noisy.jpg} & \includegraphics[width = 0.23\textwidth]{./2008_007003_mat_bm3d.jpg} & \includegraphics[width = 0.23\textwidth]{./2008_007003_mat_our.jpg} \\ & & $30.14$ dB & $31.61$ dB \\ \end{tabular} \caption{\textbf{Denoising examples from PASCAL VOC 2010.} Presented are images from PASCAL VOC denoised by I+VST+BM3D and our class-agnostic denoiser for peak $8$. PSNR values appear below each of the images. See text for more details.} \label{fig_large_pascal} \end{figure*} \section{Conclusion} \label{sec:conc} In this work we have proposed a CNN-based Poisson image denoiser. Interestingly, our network achieves state-of-the-art performance without explicitly taking into consideration the nature of the noise in hand, but rather it is learned implicitly from the data. We further show how additional knowledge of the image class boosts performance both quantitatively and qualitatively. We believe this offers a flexible learning-based alternative to previous heavily engineered solutions, which is both powerful and fast, and thus may also be adopted to more general types of image enhancement such as Poisson-Gaussian denoising, super-resolution, deblurring, etc. {\small \bibliographystyle{ieee}
{'timestamp': '2017-01-09T02:07:20', 'yymm': '1701', 'arxiv_id': '1701.01687', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01687'}
arxiv
\section{Introduction} \label{intro} The brain displays a wealth of complex dynamics across various spatial and temporal scales \cite{betzel2016multi,kopell2014beyond}. From 302 neurons in the nematode worm \emph{C. elegans} \cite{varier2011neural,bentley2016multilayer} to some 86 billion neurons in the adult human \cite{herculano2007cellular,bartheld2016search}, the units that drive brain function are large in their number but even more complicated in their interactions. Far from the canonical models in statistical mechanics stemming from either crystalline or random structure, the brain displays a heterogeneous pattern of interconnections \cite{fraiman2009ising,castellana2014inverse,bassett2016small} that fundamentally constrains the propagation of activity. Understanding these dynamics remains of primary interest in the field of neurophysics \cite{scott1977neurophysics,gao2015simplicity}. An underlying assumption of these investigations is that such dynamics or observed neural activity can contain structure that forms representations about incoming stimuli or underlying neural processes. An emerging and increasingly tractable avenue for understanding the mechanisms of these dynamics lies in the notion of control, or how to effectively guide neural dynamics. How are brain dynamics controlled intrinsically in the awake, behaving animal? Can we harness natural principles of control in neural systems to better guide therapeutic interventions? The increase in available experimental neurotechnologies \cite{nag2016implantable,patil2016implantable,chang2015towards}, as well as more sophisticated computational tools \cite{marblestone2016toward,glaser2016development} and theoretical models \cite{giusti2016twos}, has recently made it possible to tackle these questions from fundamentally new angles. While at present there is no comprehensive theory of control in the brain that we can refer to, the pursuit of such a theory remains critically important, having implications for our understanding of healthy neurophysiological processes, and our ability to intervene when those healthy processes go awry in neurological disease and psychiatric disorders \cite{johnson2013neuromodulation,chen2014harnessing,bassett2017network}. Several recent models propose new ways to control neural activity and neural rhythms, and further provide mechanistic insights into the rules by which brain dynamics are (and can be) guided. Hence, it is timely to discuss these emerging developments, and to seek to tie them together into a meaningful theoretical field that can be used to tackle current open questions in neuroscience and medicine. Motivated by recent progress in understanding brain function from the perspective of interacting networks \cite{bassett2006small,Bassett2009,kaiser2011tutorial,Bullmore2012}, we focus on systems-level control of either local neural circuits or whole-brain connectomes \cite{Sporns2005,fornito2015connectomics}. Here we use the term ``network'' in the sense that is common in network science \cite{newman2010networks}. A \emph{brain network} is a graph whose nodes represent units of the brain that perform a specific function, like vision or audition \cite{bullmore2011brain}. At the large-scale, these units may be several centimeters of tissue, while at the small scale, these units may be individual neurons. In structural brain graphs, the edges can represent structural links such as fiber bundles at the large scale \cite{Hagmann2008,Bassett2011} or synapses at the small scale. In functional brain graphs, the edges represent synchronized dynamics that form functional links \cite{achard2006resilient,stam2004functional} between these units. While both structural and functional links can be measured directly from structural and functional data, respectively, extensive efforts have also sought to address the questions of (i) whether structural topology can be inferred from functional traces (using, for example, structural equation modeling), and (ii) whether functional traces can be inferred from structural linkage patterns (using, for example, neural mass models). Throughout this exposition, we will assume that structural links have been directly measured, rather than inferred. The use of the network formalism to probe brain dynamics has a rich and pervasive heritage in seminal work at the intersection between physics and neuroscience. One particularly impactful contribution was that of Hopfield, who successfully connected dynamical processes to neural representations in an Ising model \cite{Hopfield01041982}. States that minimized the energy function formed dynamical attractors and representations of memory. This early contribution was extended and formalized by \textcite{PhysRevA.32.1007,0295-5075-4-4-016}, clearly demonstrating the power of interacting networks in the modeling of complex neural processes. Here we expand the link between physics and neuroscience in the context of the network formalism by focusing on the control of brain networks, enabling us to build a theoretical understanding regarding biological processes and associated dynamics that occur across spatially distributed neural systems. In addition, strategies for intervention and control targets can be designed through modeling dynamics in networks of neurons or brain regions. Should the reader instead be searching for an excellent treatment of various control methods for single neurons or for ensembles of neurons, we direct them to the recent textbook by \textcite{Schiff2012}, and to references therein. For further details on emerging control technologies in the brain---especially invasive electrical and optical stimulation at rapid timescales (milliseconds or below)---and associated modelling approaches, please see the recent review by \textcite{7171915}. The remainder of this Colloquium is organized as follows. In Sec.~\ref{s:cognitive_control} we draw inspiration for understanding control of brain networks by considering how the brain itself enacts intrinsic control. In particular, we briefly discuss important computational paradigms of cognitive control, a basic ability that each of us has to control our neural activity and by extension our behavior. This discussion motivates the introduction of network control theory in Sec.~\ref{s:network_control}, which offers a useful theoretical framework in which to probe control in brain networks constructed from neuroimaging data. We next turn in Sec.~\ref{s:understanding_healthy} to detailing a few examples of how we can use network control theory, or its extensions, to understand healthy brain function. In Sec.~\ref{s:understanding_disease}, we describe the utility of network control in targeting interventions when healthy brain function goes awry. We next turn in Sec.~\ref{s:trajectories} to modeling the controlled \emph{versus} uncontrolled trajectories of neural dynamics, and we close in Sec.~\ref{s:future} by outlining emerging frontiers at the intersection of dynamical systems theory, control theory, and complex systems. Throughout, we keep neuroscience jargon to a minimum, although some terminology specific to the technique or context remains unavoidable. Our goal is to stimulate discussion through reviewing existing work (rather than presenting new data), in order to encourage further work from physicists, control theorists, practitioners, and others in this exciting and rapidly developing field. \section{How does the brain control itself?} \label{s:cognitive_control} While there may be many ways of tackling the question of how to control brain dynamics, arguably one of the simplest is to ask how the brain controls itself. Perhaps by understanding intrinsic mechanisms of control in the brain, we could harness that knowledge to inform therapeutic interventions for people with mental illness. In considering this idea, it is useful to distinguish between external control, which is enacted on the system from the outside, and internal control, which is a feature of the system itself. In the brain, internal control processes include phenomena as conceptually diverse as homeostasis, which refers to processes that maintain equilibrium of dynamics \cite{nelson2008strength,nelson2015excitatory}, and cognitive control, which refers to processes that exert top-down influence to drive the system between various dynamical states \cite{botvinick2015motivation,heatherton2011cognitive}. Here we focus on cognitive control because it is conceptually akin to the idea of extrinsic control: driving dynamics from one type to another. What can we learn from cognitive control that might help us to develop a theory for external control? To answer that question, we begin by turning to history. An early computational model that explained the production of decisions based on a given set of inputs was the perceptron \cite{rosenblatt1958perceptron,freund1999large}, a simple artificial neural network \cite{mcculloch1943logical,bishop1995neural}. The perceptron and associated notions were developed by proponents of connectionism \cite{medler1998brief}, which suggests that cognition is an emergent process of interconnected networks. The complexity of the connection architecture in these models was thought to support a complexity of brain dynamics, such as the separation of parallel neural processes and distributed neural representations propounded by the parallel distributed processing (PDP) model \cite{rumelhart1986parallel}. The PDP model holds that cognitive processes can be explained by activation flowing through networks that link nodes together. Every new event changes the strength of connections among relevant units by altering the connection weights. Notably, the PDP model offers conceptual explanations for the processes characteristic of cognitive control \cite{COGS:COGS12126}. These ideas are built on the notion that the development of control systems in the brain \cite{chai2017evolution} can be seen as responding to the structure of naturalistic tasks, and therefore that control can be defined as the optimal parameterization of task processing. Within such a parameterization, two specific features of cognitive control appear particularly critical: (i) its remarkable flexibility, which supports diverse behaviors, and (ii) its clear constraints, which limit the number of control-demanding behaviors that can be executed simultaneously. Addressing these two features, models inspired by the PDP approach allow for cognitive control as instantiated in processes of selection from competing inputs or adaptation based on reward (Fig. \ref{fig:cohen}). \begin{figure}[t] \includegraphics[width=0.98\linewidth]{cohen.png} \caption{\textbf{Model for adaptive cognitive control showing distinct mechanisms between different brain regions.} Schematic of a neural network connecting the prefrontal cortex, which executes much of the ``top-down'' control actions, to other brain regions. Another part of the brain -- the anterior cingulate cortex -- serves as a conflict monitoring mechanism that modulates the activity of control representations. Meanwhile, an adaptive gating mechanism regulates the updating of control representations in prefrontal cortex through dopaminergic (DA) projections from the ventral tegmental area (VTA), that can also be facilitated through reinforcement learning (red asterisk). From \textcite{COGS:COGS12126}.}\label{fig:cohen} \end{figure} These and related computational models emphasize the role of specific brain areas in cognitive control, including prefrontal cortex, anterior cingulate, parietal cortex, and brainstem. Yet, studying any of these areas in isolation will likely provide an impoverished undestanding of the system's function. Indeed, \textcite{Eisenreich077685} argue that control in the brain is not localized to small regions or modules, but is instead very broadly distributed, enabling versatility in both information transfer and executive control. Such a distributed -- and even perhaps overlapping -- network architecture can also offer usefully fuzzy boundaries between controllers and processors \cite{Eisenreich077685,6777299}. How exactly information is processed on these distributed systems remains an open question, but some promising modeling approaches include those that use Bayesian inference, sparse-coding, and information entropy to characterize control \cite{6777299}. Specifically, a few recent efforts draw heavily from the idea of probabilistic reasoning to formulate a model for risk control -- posited to be an overarching function of the prefrontal cortex -- characterized by a closed-loop feedback structure describing executive attention. To briefly summarize, previous computational models of cognitive control have included the eclectic notions of neural networks, regional localization, distributed processing, and information theory. Collectively, these notions motivate the construction of a model or theory that explicitly builds on the emerging capability to measure the brain's true network structure to better understand control. In the next section, we will describe recent developments in dynamical systems and control theory as applied to complex networks, whose application to the brain may offer explanatory mechanisms of neural dynamics and provide insights into the distributed nature of cognitive control. \section{Network control theory} \label{s:network_control} Conceptually, it is interesting to ask the question whether and to what degree cognitive control (as defined by neuroscientists) is similar to network control (as defined by physicists, mathematicians, and engineers). To address this interesting question, we must first define what it is that we mean by network control. Controllability of a dynamical system refers to the possibility of driving the current state of the system to a specific target state by means of an external control input, see \textcite{REK-YCH-SKN:63}. Developments in engineering and physics have recently extended these ideas to the control of networks, as we describe in more detail below. \subsection{Control of linear dynamics} \label{s:network} We begin by describing a general framework for the control of linear dynamics on a complex network. Consider a network represented by the directed graph $\mathcal G = (\mathcal V, \mathcal E)$, where $\mathcal V$ and $\mathcal E$ are the vertex and edge sets, respectively. Let $a_{ij}$ be the weight associated with the edge $(i,j) \in \mathcal E$, and define the \emph{weighted adjacency matrix} of $\mathcal G$ as $\mathbf{A} = [a_{ij}]$, where $a_{ij} = 0$ whenever $(i,j) \not\in \mathcal E$. We associate a real valued (\emph{state}) with each node, collect the node states into a vector (\emph{network state}), and define the map $\map{\mathbf{x}}{\mathbb{N}_{\ge 0}}{\mathbb{R}^n}$ to describe the evolution (\emph{network dynamics}) of the network state over time. A simple way to begin is to describe the network dynamics by a discrete time, linear, and time-invariant recursion \begin{align}\label{eq:system} \mathbf{x} (t+1) = \mathbf{A} \mathbf{x}(t). \end{align} Let a subset of nodes $\mathcal K = \{k_1, \dots, k_m \}$ be independently controlled, and let \begin{align}\label{eq: B} \mathbf{B}_{\mathcal K} := \begin{bmatrix} e_{k_1} & \cdots & e_{k_m} \end{bmatrix} \end{align} be the \emph{input matrix}, where $e_i$ denotes the $i$-th canonical vector of dimension $n$. The network with control nodes $\mathcal K$ reads as \begin{align}\label{eq:controlled} \mathbf{x} (t+1) = \mathbf{A} \mathbf{x}(t) + \mathbf{B}_{\mathcal K} \mathbf{u}_{\mathcal K} (t) , \end{align} where $\map{ \mathbf{u}_{\mathcal K}}{\mathbb{N}_{\ge 0}}{\mathbb{R}}$ is the control signal injected into the network via the nodes $\mathcal K$ (see Fig. \ref{fig:liubarabasi}). The network \eqref{eq:controlled} is controllable in $T$ steps by the nodes $\mathcal K$ if, for every state $ \mathbf{x}_f$, there exists a control input $ \mathbf{u}_{\mathcal K}$ such that $ \mathbf{x}(T) = \mathbf{x}_f$ with $ \mathbf{x}(0) = \mathbf{0}$ \cite{kailath1980linear}. Controllability of this type of system can be ensured by different structural conditions \cite{kailath1980linear,KJR:88}. For instance, let $\mathbf{ C}_{\mathcal K,T}$ be the \emph{controllability matrix} defined as \begin{align*} \mathbf{ C}_{\mathcal K,T} := \begin{bmatrix} \mathbf{ B}_{\mathcal K} & \mathbf{A} \mathbf{B}_{\mathcal K} & \cdots & \mathbf{A}^{T-1}\mathbf{ B}_{\mathcal K} \end{bmatrix} . \end{align*} The network \eqref{eq:controlled} is controllable in $T$ steps by the nodes $\mathcal K$ if and only if $\mathbf{ C}_{\mathcal K,T}$ is of full row rank, where $T$ is typically taken to be at least as large as the system size $n$. \subsection{Key driver nodes} Recent work from \textcite{YYL-JJS-ALB:11} demonstrated that the analytical framework described in the previous section could be used to study large, complex networks. In that study, the authors explored common patterns in a wide variety of networks from technology, biological, and social systems. Under certain conditions in these weighted and directed networks, the set of driver nodes capable of guiding the dynamics of the entire system could be directly estimated from the degree distribution. Since that study, others have shown that under other conditions and in other networks, the degree distribution alone may not provide enough information to adequately determine the set of driver nodes. Instead, that knowledge regarding the network's structure must be complemented with considerations of the network's dynamics, or reasonable approximations of those dynamics at each node \cite{10.1371/journal.pone.0038398}. \begin{figure}[t] \includegraphics[width=\linewidth]{liubarabasi} \caption{\textbf{Controlling a simple network.} This small network can be controlled by an input vector $ \mathbf{u}_{\mathcal K}=(u_1(t),u_2(t))^T$ (left), allowing us to move the network within the state space, from its initial state to some desired final state (right). From \textcite{YYL-JJS-ALB:11}.} \label{fig:liubarabasi} \end{figure} In these studies, networks are allowed to contain real-valued weights on each edge. However, for some real-world networks, knowledge of the edge weights is uncertain. For such scenarios, a complementary framework is provided by structural controllability which evaluates the controllability of binary networks \cite{kailath1980linear,KJR:88}. By studying the underlying ``structure'', i.e. distinguishing merely between which edges are absent (zero) \emph{versus} present (non-zero), these methods allow the identification of minimal structures or control points that allow for full controllability of the network. Recent efforts have extended these ideas to large-scale systems, and to the problem of identifying the minimum number of nodes that need to be driven in order to achieve structural controllability \cite{PequitoJ1}. In recent work, \textcite{7526572} extended the notion of structural controllability to situations in which edges evolve dynamically, and they identified the minimum number of driven nodes for full controllability of the system. Their methods would appear particularly relevant in situations like those observed in \textcite{khambhati2015dynamic}, where dynamic functional connectivity in epileptic patients was characterized by edges within seizure-generating areas that were almost constant over time, whereas edges outside these areas in healthy tissue exhibited higher variability over time. An important potential goal of control would then be to steer function on these edges away from pathological regimes \cite{7526572}, i.e. towards dynamics that demonstrate more edge weight variability. While network control and structural controllability are particularly relevant concepts for brain network control, many other key contributions have been made to the study of control in complex networks, which lie outside the scope of this article. We wish to point interested readers to the following reviews that focus entirely on network control tools. For a review of methods to identify control points to affect particular dynamics such as synchrony, see \textcite{Chen2014}. For more general background and detail on network control in complex systems, the recent review by \textcite{RevModPhys.88.035006} provides an excellent summary of the latest developments. \subsection{Control energy and metrics\label{controlmetrics}} Another important area of work lies in the development of metrics that characterize different control strategies for real networks. We define the controllability $\mathbf{W}_{\mathcal K,T}$ as \begin{eqnarray} \mathbf{W}_{\mathcal{K},T} &=& \sum_{\tau =0}^{T-1}\mathbf{A}^\tau \mathbf{B}_{\mathcal{K}}\mathbf{B}_{\mathcal{K}}^\mathsf{T}(\mathbf{A}^\mathsf{T})^\tau\\ &=&\mathbf{C}_{\mathcal{K},T}\mathbf{C}_{\mathcal{K},T}^\mathsf{T} \label{eq:Gramian} \end{eqnarray} which has to be full rank for the network \eqref{eq:controlled} with the set of network nodes $\mathcal K$ to be controllable, equivalent to the condition for the controllability matrix in Section \ref{s:network}. In practical applications, controllable networks featuring small Gramian eigenvalues cannot be steered to certain states because the control energy is limited. This fact motivated \textcite{pasqualetti2014controllability} to propose certain control strategies and associated metrics based on minimizing the control energy; these include average, modal, and boundary controllability. To define these control metrics, we first let the network be controllable in $T$ steps, and let $\mathbf{x}_f=\mathbf{x}(T) $ be the desired final state in time $T$, with $||\mathbf{x}_f||_2 = 1$, where the subscript denotes the Euclidean norm, i.e. $||\mathbf{v}||_2 := \sqrt{\mathbf{v}^\mathsf{T}\mathbf{v}}$. Following from Eq.~\ref {eq:controlled}, where $\mathbf{u}_{\mathcal K}$ is the injected control signal, we can define the energy of the control input $\mathbf{u}_\mathcal{K}$ as \begin{equation} E(\mathbf{u}_\mathcal{K},T) = ||\mathbf{u}_\mathcal{K} ||^2_{2,T} = \sum_{\tau=0}^{T-1}||\mathbf{ u}_\mathcal{K}(\tau)||_2^2, \end{equation} where $T$ is the control horizon. The unique control input that steers the network state from $\mathbf{x}(0)=\mathbf{0}$ to $\mathbf{x}(T)=\mathbf{x}_f$ with minimum energy is \cite{kailath1980linear} \begin{equation} \mathbf{u}_{\mathcal{K}}^*(t) =\mathbf{ B}^\mathsf{T}_{\mathcal{K}}(\mathbf{A}^\mathsf{T})^{T-t-1}\mathbf{W}_{\mathcal{K},T}^{-1}\mathbf{x}_f \end{equation} with $t\in\{0,\dots,T-1\}$. Then it can be seen that \begin{equation} E(\mathbf{u}_{\mathcal{K}^*}, T) = \sum_{\tau=0}^{T-1} ||\mathbf{u}_{\mathcal{K}}^*(\tau)||_2^2 = \mathbf{x}_f^\mathsf{T}\mathbf{W}_{\mathcal{K},T}^{-1}\mathbf{x}_f\leq\lambda_{\min}^{-1}(\mathbf{W}_{\mathcal{K},T}),\label{eq:energy} \end{equation} where $\lambda_{\min}$ is the smallest eigenvalue. Note that equality is achieved whenever $\mathbf{x}_f$ is an eigenvector of $\mathbf{W}_{\mathcal{K},T}$ associated with $\lambda_{\min}(\mathbf{W}_{\mathcal{K},T})$ \cite{pasqualetti2014controllability}. \textit{Average controllability} identifies network nodes that, on average, can steer the system into different states with little effort (i.e., input energy), see Fig. \ref{fig:energy}. The average controllability in a network---formally defined as $\text{Trace} (\mathbf{W}_{\mathcal{K},T}^{-1})$---equals the average input energy from a set of control nodes and over all possible target states \cite{BM-DK-DG:04,hrs-mt:12}. Instead, $\text{Trace}( \mathbf{W}_{\mathcal{K},T} )$ is often adopted as a measure of average controllability, motivated by the relation $\text{Trace} (\mathbf{W}_{\mathcal{K},T}^{-1}) \ge N^2 / \text{Trace} (\mathbf{W}_{\mathcal{K},T})$ \cite{Summers20143784}, and the fact that $\mathbf{W}_{\mathcal{K},T}$ is close to singularity even for networks of small cardinality. Note that the maximization of $\text{Trace}(\mathbf{W}_{\mathcal{K},T})$ does not automatically ensure controllability. However, independent tests to verify the controllability can be made using Eq. (4) and were done for individual regions in brain networks \cite{gu2015controllability} (and more generally in \textcite{menara2017structural}). It should be noticed that $\text{Trace}(\mathbf{W}_{\mathcal{K},T})$ encodes a well-defined control metric, namely the energy of the network impulse response or, equivalently, the network $H_2$ norm \cite{kailath1980linear}. For practical computations, the limit of $T\to\infty$ and $\mathbf{A}$ satisfying Schur stability is used, as this permits a closed-form solution and easier analysis. Intuitively, network nodes with high average controllability are most influential in the control of network dynamics over all possible target states. \begin{figure}[t] \includegraphics[width=0.65\linewidth]{energy} \caption{\textbf{Energetic costs of controllabilitry metrics.} \textcite{pasqualetti2014controllability} propose realistic control strategies that include the energetic costs of control \eqref{eq:energy}. Average controllability describes transitions nearby on an energy landscape, while modal controllability describes transitions distant on this landscape.} \label{fig:energy} \end{figure} \textit{Modal controllability} identifies network nodes that can push the network activity into difficult-to-reach states, which are those that require substantial input energy. To quantify modal controllability, we first note that the behavior of a dynamical system is fully determined by the eigenvalues (modes) and eigenvectors of its system matrix. Regarding controllability, the Popov-Belovich-Hautus test ensures that a system with matrix $\mathbf{A}$ is controllable by an input matrix $\mathbf{B}$ if and only if all its modes are controllable or, equivalently, if and only if there exists no left eigenvector of $\mathbf{A}$ orthogonal to the columns of $\mathbf{B}$ \cite{kailath1980linear}. By extension from this PBH test, if the entry $v_{ij}$ is small, then the $j$-th mode is poorly controllable from node $i$. Hence \textcite{pasqualetti2014controllability} define $\phi_i = \sum_{j} (1 - \xi_j^2 (\mathbf{A})) v_{ij}^2$ as a scaled measure of the modal controllability of all $N$ modes $\xi_0 (\mathbf{A}),\dots, \xi_{N-1} (\mathbf{A})$ from the brain region $i$. Intuitively, network nodes with high modal controllability are able to control all of the dynamic modes of the network, and hence to drive the dynamics towards hard-to-reach configurations. \textit{Boundary controllability} identifies network nodes that lie at the boundaries between network communities, beginning from communities at the largest scale and moving down across consecutive hierarchical levels of community structure -- and thus intuitively measures the ability to control the integration and segregation of network modules. This metric depends on the choice of a method for detecting boundary control points, for which an algorithm is proposed in \textcite{pasqualetti2014controllability}. This algorithm can be altered as needed for the physical system under study, e.g., to enhance the accuracy in estimating an initial partition of the network into communities, and to sharpen or loosen the boundary point criteria. Intuitively, network nodes with high boundary controllability are able to gate information between different communities, across topological scales in the network. Overall, these three metrics provide useful estimates for real systems especially when considering dynamics over the whole network \cite{wuyan2018benchmarking}. Further work could be done to investigate other scenarios such as dynamics in just parts of the network, or how different patterns of community structure change the resulting controllability. These and more general questions about the relationship between network topology and the resulting dynamics remain open areas of study, which we discuss in more detail at the end of this article. \subsection{Application to brain networks} To use these methods to answer questions in neuroscience, we must begin by constructing networks based on our knowledge of brain connectivity. At the large scale, network nodes in the brain are often defined based on regional differences in cellular architecture \cite{brodmann1909verg,glasser2016multi} or local gradients in fine-scale functional connectivity \cite{yeo2011organization,power2011functional}. Connectivity between these nodes can be estimated with emerging neurotechnologies, which we illustrate with the following examples. In humans, one particularly powerful non-invasive probe of connectivity uses magnetic resonance imaging (MRI) to infer structural pathways in the brain \cite{wedeen2012geometric} by exploiting molecular resonances of water molecules as they diffuse along white-matter tracts \cite{makris1997morphometry,basser1994MR}, see Fig. \ref{fig:brainnetworks}. By reconstructing the pathways that exist between brain regions and by estimating the strengths of those pathways, a brain network (weighted, symmetric graph) is obtained where the network edges are given by the inter-regional connection strengths \cite{Hagmann2008,Bassett2011}. Similar techniques can be used in rodents, cats, dogs, and non-human primates by way of a small-bore magnet \cite{duong2010diffusion}. Of course, tract-tracing techniques and other invasive methods are also a powerful way to image structural pathways in non-human animals \cite{okano2015brain,markov2011weight}. \begin{figure}[t] \includegraphics[width=0.85\linewidth]{brainnetwork.pdf} \caption{\textbf{Construction of a human brain structural network. (a)} Diffusion imaging measures the direction of water diffusion in the human brain. \textbf{(b)} From these data, white matter streamlines can be reconstructed that connect brain regions. \textbf{(c)} An adjacency matrix representation of the structural connectivity: entries denote the estimated strength of white matter connectivity between brain regions. \textbf{(d)} The resulting brain network where nodes are brain regions, and where edges are the connection strengths between them.} \label{fig:brainnetworks} \end{figure} Recently, \textcite {gu2015controllability} applied network control theory to such whole-brain structural networks in humans. Using networks composed of between 83 and 1015 nodes, the authors study the three controllability metrics of average, modal, and boundary controllability \cite{pasqualetti2014controllability} discussed in the previous section. Their work and others will be discussed in detail in the next section on understanding healthy brain function. While these techniques have not yet been ubiquitously applied to non-human imaging \cite{badhwar2015control,tang2012identifying}, the mathematics is generalizable to any estimate of structural connectivity in a neural system. Conceptually, this approach supports the general study of the kinds of dynamics predicted by the constraints of structural connectivity, particularly for the scenario in which a given brain region is acting as a control point for the rest of the network. On a methodological note, the results were verified across a range of network sizes. Although the connectivity studied is at a relatively coarse scale, it would be interesting to complement these observations with studies at cellular resolutions. An integral aspect of control theory is that of system observability, which examines how measurable the system is to an observer. It is dual to system controllability; hence limits on the observability of the system will naturally impair efforts to control the system. This fact has important implications in neuroscience, where the lack of complete and constant detection, especially in living, behaving systems, introduces nontrivial uncertainty in both data and models. In non-invasive neuroimaging, systematic biases in data acquisition and processing may hamper accurate predictions built from individual measurements, e.g. that arise from the physical embedding of the brain \cite{MORRIS20081329,YamadaE14}. Common attempts to combat this possibility include verifying the reproducibility of results under a variety of choices made in the estimation of anatomical connectivity and in the construction of brain networks, for instance by comparing the results from multiple brain parcellations or tractography procedures. In time-varying networks, it should be verified that any conclusions hold over several time window lengths, and a minimum length of window should be chosen to ensure statistical signficance. Still, further work should be done to quantify how systematic biases in data acquisition or system observability, such as the effects of the physical embedding of the brain, result in bounds on the possible control predictions. \section{Understanding healthy brain function through control theory} \label{s:understanding_healthy} In this section, we explore the utility of network control theory for offering mechanisms of cognitive control, providing explanations for individual differences in cognitive control across people, and capturing the evolution of control as we grow from children to adults. We close this section by discussing open questions in cognitive neuroscience that appear particularly amenable to extensions of network control theory. \subsection{Network control as a partial mechanism for cognitive control} \begin{figure*}[t] \includegraphics[width=0.72\linewidth]{ncomms9414-f4.jpeg} \caption{\textbf{Cognitive control hubs are differentially located across cognitive systems. (a)} Hubs of average controllability are preferentially located in the default mode system. \textbf{(b)} Hubs of modal controllability are predominantly located in cognitive control systems, including both the frontoparietal and cingulo-opercular systems. \textbf{(c)} Hubs of boundary controllability are distributed throughout all systems, with the two predominant systems being ventral and dorsal attention systems \cite{gu2015controllability}. } \label{fig:gu} \end{figure*} A simple question to ask about any theory is whether or not it offers predictions of observed processes. One particularly straightforward and testable hypothesis is that the common control strategies studied in control and dynamical systems theory are strategies that the brain uses to control its own intrinsic dynamics. In a recent study, \textcite{gu2015controllability} addressed this hypothesis by first calculating the controllability strengths for each brain region, and then by identifying the preferences of each brain region for different types of control. The authors found that strong average controllers, strong modal controllers, and strong boundary controllers were located in quite different areas of the brain, see Fig. \ref{fig:gu}. Notably, the different sorts of controllers appeared to map on to the types of function that each brain region is thought to perform. For example, strong average controllers were disproportionately located in the default mode system, which is a spatially distributed set of brain regions that are markedly active when a person is simply resting \cite{raichle2015brains}. This is particularly interesting because it suggests that areas of the brain that are active in the ``ground state'' are also areas that are structurally predicted to optimally push the system into many local easily-reachable states, close by on the underlying energy landscape. Furthermore, strong modal controllers were disproportionately located in cognitive control systems, including both the frontoparietal and cingulo-opercular systems. This is particularly interesting because it suggests that the areas of the brain that are active during tasks that demand high levels of cognitive control or task switching \cite{botvinick2015motivation} are structurally predicted to optimally push the system into distant states, far away on the underlying energy landscape. Lastly, strong boundary controllers were disproportionately located in regions implicated in attention \cite{corbetta2002control}, supporting their predicted role in gating \cite{womelsdorf2015long,eldar2013effects} information between network communities. This study offers a possible mechanistic explanation for how the brain might move between cognitive states that depends fundamentally on white matter microstructure. The work suggests that structural network differences between the default mode, cognitive control, and attentional control systems dictate their distinct roles in brain network function. While the results need to be validated in other species and data sets, the broad trends indicate the relevance of control theory for capturing canonical concepts in cognitive control. \subsection{Network control and cognitive performance} In the previous section, we reviewed evidence that notions from network control applied to neuroimaging data can provide insight into the roles that brain regions may play in the control of neural dynamics. Here we ask the more specific question of whether the brain in one person (or animal) might be optimized for a different type of control than the brain in another person \cite{kim2018role}. That is, can controllability metrics explain why cognitive performance differs across individuals \cite{cornblath2018sex}? While still a very open question, two recent studies suggest that indeed each brain displays a different profile of control, and differences across people are correlated with differences in their cognitive capacities. In one study in healthy adult humans, \textcite{1606.09185} compare the predictions from network control theory applied to individual brain images to the performance of these same individuals on traditional cognitive control tasks. More specifically, the authors calculate modal and boundary controllability (see \ref{controlmetrics}) on brain networks obtained from diffusion imaging, and they also test the performance of subjects in cognitive control tasks that measure the inhibition of behavior, the shifting of attention, vigilance, and working memory capacity. The study reports key regional controllers in the brain whose controllability strength is correlated with task performance measures across individuals, thus providing a second line of evidence that network control may be a partial mechanism for cognitive control in humans. Turning from adults to children, \textcite{Tang2017} evaluated the controllability strength of brain regions as well as more general cognitive performance (not specific to cognitive control) in a community-based sample of healthy youth. The authors found that the relative strength of average controllers in subcortical \textit{versus} cortical regions (which are the earliest evolving and latest evolving brain areas, respectively) is an important predictor of improved cognitive performance. This relationship held true even when accounting for differences in age across the cohort, suggesting that it is a fundamental characteristic of human brain structure and dynamics. A follow-up study further tied these differences to individual differences in cognitive control specifically \cite{cornblath2018sex}. \subsection{Evolution of network control in development\label{dev}} The identification of age-invariant relationships between controllability metrics and cognitive function begs the question of whether controllability metrics of brain networks change with age, either in their magnitude or in their spatial distribution. To address this question, \textcite{Tang2017} studied the controllability metrics of average controllability and modal controllability in 882 healthy youth from 8 to 22 years of age, and quantified a single value of controllability for a person as given by the average of controllability strengths across all brain regions. This coarse-graining of the data enabled the authors to study how brain networks facilitate energetically easy transitions (average controllability) as well as energetically costly ones (modal controllability). They found that brain networks are highly optimized to support a diverse range of possible dynamics (as compared with randomized versions of the networks) and that this range of supported dynamics increases with age, see Fig. \ref{fig:dev}. Seeking to investigate structural mechanisms that support these changes, the authors simulate network evolution with a set of growth rules, to find that all brain networks -- from child to adult -- become increasingly structured in a manner highly optimized for network control. These results suggest key neurophysiological changes that may be occuring during development, driving the system towards an increasing capability to traverse a larger surface of the energy landscape. It would be interesting in the future to assess whether these metrics are altered in youth with neuropsychiatric disorders, or whether they could be used to predict transition to psychosis. \begin{figure}[t] \includegraphics[width=0.98\linewidth]{dev.pdf} \caption{\textbf{Controllability metrics are positively correlated with age, with older youth displaying greater average and modal controllability than younger youth.} Each data point represents the average strength of controllability metrics calculated on the brain network of a single individual, in a cohort of 882 healthy youth from ages 8 to 22 years. Brain networks were found to be optimized to support energetically easy transitions (average controllability) as well as energetically costly ones (modal controllability). There is a significant correlation between age and the ability to support this diverse range of dynamics: see inset or color (online) that denotes the age of the subjects. Note that modal controllability being a weighted sum of normalized eigenvectors is always capped at 1, hence its smaller range as compared to average controllability is not meaningful; rather, the relative differences between the values are meaningful here. From \cite{Tang2017}.} \label{fig:dev} \end{figure} \subsection{Open questions in control and cognition} It is important to note that linear models of neural dynamics \cite{galan2008how,honey2009predicting} for use in network control theory have both advantages and disadvantages. Their advantage is that one has access to a wide array of theoretical observations that can offer intuition about the system's (controlled) dynamics, particularly around an operating point \cite{gu2015controllability}. The disadvantage is that they cannot speak to neural processes that transition from one dynamical regime (limit cycles, fixed points, attractors) to another \cite{deco2012ongoing,golos2015multistability,muldoon2016stimulation}. In these cases, developing additional methods for control of nonlinear systems may be necessary. One simple scenario in which limit cycles -- or transitions between them -- may be particularly important for the processes of cognitive control is that of human decision-making \cite{chand2016salience,chand2016face}. For example, oscillatory activity in specific brain regions has been linked to rational \emph{versus} irrational decision-making in a task that requires financial judgements (akin to gambling). \textcite{7591459} studied a group of human subjects in which multiple depth electrodes were implanted in deep brain structures as a part of routine presurgical evaluation for medically refractory epilepsy. By recording the local field potentials at each of these electrodes, the authors were able to monitor the activity of neuronal ensembles in the precuneus and show that high-frequency activity (70-100 Hz) increased when irrational decisions were made. Further, transitions between various mental states such as rational or irrational decision making could be described using a state space model of activity from these electrodes, illustrating the network aspect of concerted activity between regions. This and similar studies in other areas of higher-order cognitive function that depend upon synchronized oscillatory activity in neuronal ensembles \cite{kopell2000gamma,bassett2009cognitive} suggest the possibility that control strategies could be devised that use brain stimulation to alter the frequency of neuronal synchrony to modulate cognitive processes. Such a possibility will depend on accurately extending linear control models to nonlinear ones, isolating the dynamics relevant for the cognitive process of interest, and localizing the region that is most impacted. These studies cover a range of experimental probes from non-invasive neuroimaging to implanted electrodes, and computational models from linear models to nonlinear models. Together, they illustrate the breadth of scenarios in healthy cognitive function available for further investigation, and invite further work that identifies connections or common themes within these studies. \section{Targeting therapeutic interventions to maximize beneficial outcomes to patients} \label{s:understanding_disease} In this section, we broaden our focus from linear models of network control in order to more generally discuss emerging engineering approaches for the control of brain dynamics in the context of clinical medicine. We separate our discussion into methods for modulating consciousness via anesthesia administration, methods for ongoing monitoring and treatment of Parkinson's disease, methods for non-invasive stimulation, and methods for the control of transient epileptic seizures. These topics are in no way meant to be comprehensive of the field, but simply to highlight important directions of clinical relevance. Examples are chosen based on their focus on distributed control and analysis over many brain regions, in view of the system as an interacting whole, where network models are often explicitly employed. \subsection{Anesthesia titration} Anesthesia is used in medical institutions to modulate consciousness through drugs during surgery, potentially by altering distributed circuitry \cite{crone2016testing}. Accurately titrating the levels of anesthetic for each person, and at each time point during the surgery, is critically important for the comfort, health, and survival of the patient. Recent efforts seek to optimize this titration using a closed-loop system \cite{doi:10.1097/ALN.0b013e31829d4ab4}, where the challenge is to maintain a medically-induced coma by delivering propofol via an intravenous catheter or pump. Using a computer to control this delivery system, precise amounts of anesthetic can be chosen, administered, and adapted in a time-dependent manner, potentially reducing the incidence of propofol overdose which is accompanied by debilitating side effects. \begin{figure}[t] \includegraphics[width=\linewidth]{burstsuppression} \caption{\textbf{Burst suppression phenomenology. (a)} A typical recording of burst suppression from a human subject anesthetized with propofol -- a type of general anesthesia. The bursts manifest concurrently across the scalp (here, shown for left and right frontal electrodes). \textbf{(b)} Spectrogram for a frontal electrode during deep, but not burst-suppression, general anesthesia. \textbf{(c)} At a deeper level of general anesthesia, burst suppression is achieved (the spectrogram clearly displays epochs of quiescence). From \textcite{ching2012neurophysiological}.} \label{fig:bursts} \end{figure} Building on their earlier biophysical model, \textcite{doi:10.1097/ALN.0b013e31829d4ab4} demonstrate the real-time monitoring and control of the brain's burst suppression state from the electroencephalogram (see Fig. \ref{fig:bursts}), which indicates a state of highly reduced electrical and metabolic activity \cite{ching2012neurophysiological} and allows tracking of the level of consciousness. This state is illustrated via small model networks of two principal cell types (cortical pyramidal cells and inhibitory interneurons). Control of this state can then be done using an on-line parameter estimation procedure and proportional-integral controller. The technique has already been validated in rodents, where it can be used to successfully monitor and control the burst suppression state. Translating this work into humans will require more extensive computational estimation of model parameters and empirical validation over periods of several hours. \subsection{Deep-brain stimulation for Parkinson's disease} High-frequency deep brain stimulation (DBS), commonly used to treat Parkinson's disease, is one of the oldest examples of successful dynamical manipulation of brain function to alleviate clinical symptoms. Yet, it remains unclear exactly how and why it works so well. Control and systems theory approaches are useful for modelling the underlying circuitry to understand the mechanisms by which deep-brain stimulation affects behavioral phenotypes \cite{Santaniello10022015,PhysRevLett.81.3291,10.1371/journal.pcbi.1004673}. Recent work has highlighted the network-level mechanisms of the diseased dynamics, and the control necessary to treat them. For example, \textcite{Santaniello10022015} move from localized functions to the relevant circuitry, positing that DBS increases the regularity of firing patterns in the basal ganglia, thereby decreasing symptoms of Parkinson's disease \cite{chiken2014disrupting}. The authors suggest that high-frequency stimulation of 130 Hz in DBS is effective because it is a resonant frequency of the overall cortico-basal ganglia-thalamo-cortical loop. The authors explore the effects of different stimulation conditions by simulating hundreds of biophysically realistic neurons from different regions of the circuitry that are thought to have very different functions. Their results suggest a loop-based reinforcement model, where DBS proximally or distally does not individually account for resulting pattern changes, but instead relies on a combined impact across the circuit. This observation could inform the choice of stimulation frequency and location when using DBS clinically \cite{johnson2013neuromodulation}. While identifying the resonant frequency of a critical circuit may provide a useful target for control, other mechanisms may also exist, and it is possible that interventions targeting more than one mechanism could be more effective than targeting one mechanism alone. Other candidate mechanisms include coupling between peripheral tremor rhythms, and the phase locking of the activity of primary and secondary motor areas. For example, \textcite{PhysRevLett.81.3291} propose two techniques to identify the relative phase locking between two MEG signals, thereby detecting synchronization of neuronal activity and mapping its relationship to peripheral tremors. Other attempts to uncover mechanisms include the investigation of entrainment and desynchronization dynamics, both seen in populations of neurons, as a result of DBS. \textcite{10.1371/journal.pcbi.1004673} study a population of model neurons and the effects of stimulation, to observe underlying low-dimensional patterns that can illuminate collective processes in spiking neurons. The simplicity of that particular model affords theoretical insight into a potential mechanism that governs DBS. Once the optimal mechanism(s) have been identified, a key goal is the use of control theory to create a closed-loop system for more effective treament. \textcite{Holt2014} identify their goal for DBS as the suppression of pathological frequencies that occur during Parkinson's disease. They simulate the physiology of the basal ganglia using a network model to create a mean-field description of the closed-loop system, which allows for the tuning of stimulation parameters based on patient physiology. This setup provides significant advantages over the current method of trial-and-error tuning, which is based on the clinician's past experience. If such a model can be empirically validated, it would be an important step towards improving the efficacy of DBS for patients with Parkinson's disease. \subsection{Non-invasive transcranial stimulation} While such invasive monitoring and stimulation paradigms are not accessible to most humans, other non-invasive methods of brain stimulation are becoming increasingly feasible. The most common is that of transcranial magnetic (electric) stimulation, which is the application of a magnetic (electric) field through the scalp for a short period of time \cite{bikson2016safety}. While the effects of transcranial stimulation tend to be diffuse, they have demonstrated utility in treating depression and other neurological and psychiatric disorders \cite{kedzior2016cognitive}. In healthy subjects, transcranial electric stimulation has been shown to differentially affect endogenous versus exogenous attention in human subjects \cite{flavio}. These and similar effects can be understood to some degree by employing computational models of oscillatory and state-dependent dynamics \cite{10.1371/journal.pbio.1002424}. Computational work has also begun to directly bridge mathematical models of nonlinear neural dynamics with the predictions of network control theory in the context of such exogeneous stimulation \cite{muldoon2016stimulation}. The tractability of computational studies and the pervasive empirical use of non-invasive stimulation opens the possibility of building mechanistic models that provide a deeper understanding of stimulation's effects on the brain \cite{johnson2013neuromodulation}, and of the rules by which stimulation parameters and location can be optimized to enhance brain function. One study directly bridges mathematical models of nonlinear neural dynamics and the predictions of network control theory in the context of such exogeneous stimulation. \textcite{muldoon2016stimulation} consider the effects of electrical stimulation to a specific brain region using a model of nonlinear oscillators connected by a coupling matrix estimated from measured diffusion imaging data (Fig. \ref{fig:brainnetworks}). By simulating dynamics in this network of Wilson-Cowan oscillators, they can test for different regimes of desired functional outcomes supported by the network---if the effects of stimulation remain focal or spread globally---and compare these with the predictions from network control theory using the controllability metrics described in \ref{controlmetrics}. Importantly, their results validate linear network control predictions over eight subjects and more generally provide a model that can be used or tested in clinical settings, in order to strengthen the connection between theory and clinical practice. \subsection{Seizure suppression in epilepsy} \begin{figure}[t] \includegraphics[width=\linewidth]{berenyi} \caption{\textbf{Closed-loop stimulation for seizure suppression in a rat.} Recordings from channels $a, b$ and $c$ in the cortex are filtered for spike detection, where signals exceeding the predetermined amplitude threshold are detected. These thresholded signals are used to trigger transcranial electric stimulation, which is applied through the scalp. From \textcite{Berenyi735}.} \label{fig:berenyi} \end{figure} Both invasive and non-invasive stimulation methods have been considered for the treatment of medically intractable epilepsy. This multiplicity of methods is due in part to the difficulties inherent in localizing the regions involved in seizures: different brain regions can play diverse roles in the production and propagation of epileptiform dynamics \cite{EPI:EPI13791}. Both types of interventions would seem to be preferable to the current clinical practice of resecting large sections of neural tissue thought to cause the seizure, although of course this statement is speculative \cite{stacey2008technology}. Instead, stimulation may have the potential to suppress seizures \cite{Ching2012,Berenyi735}, particularly if tailored to the underlying brain connectivity \cite{taylorruths}, and/or its associated dynamics \cite{Khambhati20161170}. In a recent practical demonstration, work from the group of \textcite{Berenyi735} shows the efficacy of brain stimulation in seizure suppression, in a rat model for epilepsy (see Fig. \ref{fig:berenyi}). Their application of transcranial electrical stimulation using a closed-loop system reduces seizure duration, on average, by 60\%. These results show great promise for the development of closed-loop stimulation that leaves other aspects of brain function unaffected, and paves the way for the use of such therapies in humans. For seizure suppression, some techniques appear to be effective for distributed control and others appear to be effective for local control. Theoretical modelling of the former case was done by \textcite{Ching2012}, who employ a grid of stimulating electrodes that act as actuators to help stem and direct the propagation of electrical activity. To model mesoscale cortical dynamics, they use a network of Wilson-Cowan oscillators, with both diffusive and synaptic coupling. By modelling the placement of several actuators, they demonstrate the ability to limit pathological activity (the spreading of electrical activity across a patch). By slowing the spread of activity, their method can be used in conjuction with pharmacological agents, or allow time for other self-correcting mechanisms in the brain. Naturally, their method would depend on how well the actuators contact and target the underlying tissue, as well as on accurate monitoring of seizure activity and the ability to control the system in real time. An alternative approach is put forth by \textcite{taylorruths}, whose model covers a larger spatial area and uses connectivity derived from patient MRI to facilitate personalization of stimulation. A simple dynamical model describes regional activity including epileptic spike wave dynamics, and a pseudospectral method generates time-varying stimuli to halt simulated seizures. \begin{figure}[t] \includegraphics[width=\linewidth]{ankit} \caption{\textbf{Schematics of patient electrophysiology and epileptic model.} \textit{Left:} Intracranial electrophysiology of patients with neocortical epilepsy. Each sensor (red dot) can be treated as a node within a functional network that uses magnitude squared coherence between sensors as network edges. \textit{Right:} A model of the epileptic network, comprised of a seizure-generating system and a hypothesized regulatory system that controls the spread of pathologic seizure activity. From \cite{Khambhati20161170}.} \label{fig:ankit} \end{figure} When considering translating some of these techniques to the clinic, it is useful to contrast them with existing clinical procedures. Generally speaking, clinical interventions for epilepsy can come in the form of (i) carefully modifying neural structure and dynamics, (ii) entirely quieting dynamics over short periods of time, or (iii) removing tissue to ensure silence over a lifetime. \textcite{Khambhati20161170} study methods to treat epilepsy via either short term ``lesioning'' (meaning quieting dynamics using stimulation) or long term ``resection'' (actually surgically removing the tissue). They develop methods for the identification of suitable lesion points, that affect the ability of the network to sustain synchronous activity associated with the occurence of a seizure (see Fig. \ref{fig:ankit}). These inferences are based on a measure of synchronizability of the network -- the ratio of the largest and smallest eigenvalues of the graph Laplacian \cite{barahona2002synchronization}. Virtual resection of individual brain regions \emph{in silico} can pinpoint control regions that strongly synchronize or desynchronize network dynamics, while revealing a principle of push-pull antagonism that provides a possible explanation for why seizures spread. Still, fully synchronized states only occur in a subset of seizure types, and it is therefore very likely that different sorts of control will be required for different sorts of seizure etiologies. Hence, the mapping from control type to seizure type will need to be validated experimentally, and further work is needed to clarify the translational applicability of this approach. Considering the large variability of epileptic synods and seizures (focal and generalized), these methods could add to the suite of possible interventions that include local control. The range of models in this section illustrates many possible direct applications of control theory to important medical questions, and the potential gains that could be made through the successful control of aberrant dynamics. This possibility for clinical impact is perhaps the most immediate motivation to study the control of brain dynamics, and we hope these examples will encourage new efforts in these areas. \section{Control of specific neural dynamics or pathways} \label{s:trajectories} The example contexts in clinical medicine that we discuss in the previous sections highlight the great diversity of neural network dynamics in both health and disease. In this section, we focus on two specific types of network dynamics for which simple mathematical models can be studied, and for which control strategies can be examined analytically. The first context is that of neural synchrony, or rhythmic oscillations of neural ensembles. The second context is state transitions, where the activation profile of the brain moves from one pattern to another. We conclude the section by describing a few empirical tools that can be used to modulate these dynamics, and to test predictions from network control theory. \subsection{Synchrony of neural populations} \begin{figure*}[t] \includegraphics[width=0.71\linewidth]{Fig22_control_copy} \caption{\textbf{Synchronizability of structural brain networks and a negative correlation with age. (a)} Schematic of a master stability function (MSF) for a generic network of oscillators, which gives the perturbative stability of a globally synchronous state \cite{PhysRevLett.80.2109}. Such a state is stable when the MSF is negative for all positive eigenvalues of the graph Laplacian, hence the inverse spread of the Laplacian eigenvalues $1/\sigma^2(\{\lambda_{i}\})$ provides an estimate of synchronizability (or stability under synchrony), see \textcite{Nishikawa08062010}. \textbf{(b)} Synchronizability in structural brain networks estimated from diffusion imaging in a large cohort of 882 youth is found to be anti-correlated with mean average controllability, as well as with age (see inset, or color online). From \cite{Tang2017}.} \label{fig:sync} \end{figure*} \subsubsection{Dynamical characteristics and clinical relevance} When considering the control of specific dynamics, a natural place to start in neural systems is synchrony, which occurs when populations of neurons or brain regions exhibit the same dynamics $\mathbf{s} (t)$, i.e. $x_1 (t) = ... = x_n (t) =s (t)$ (see Fig. \ref{fig:sync}a). In many organisms, synchrony manifests as strong time-locked patterns, such as circadian rhythms and gait regularity. Moreover, the transition between synchrony and desynchrony has implications for treating epilepsy \cite{jirsa2014nature}, Parkinson's disease, or other pathological conditions. Hence the propensity towards synchrony or the ease of transitioning in and out of a synchronous state is of great interest -- both in local neuronal ensembles \cite{1741-2552-8-6-065008,lizdavison} and in distributed whole-brain networks \cite{Tang2017}. While this field is too large to do justice to in this small space, we highlight the work of \textcite{1741-2552-8-6-065008} as an excellent example describing the process of desynchronization in two models of coupled units (Kuramoto and a reduced phase Hodgkin-Huxley with electrotonic coupling), through the dynamic programming of inputs to a single neuron in the population. This work offers a possible mechanism for deep-brain stimulation in Parkinson's disease, where stimulation represents a single input that can affect desynchronization. Importantly, the model includes global (all-to-all) coupling between neurons, and therefore the use of more heterogeneous couplings that are characteristic of empirically measured brain networks could be an interesting future direction. While understanding desynchronization processes is critically important, another relevant question pertains to the conditions under which synchrony can occur. While some efforts seek to address this question through the analysis of Lyapunov functions \cite{lizdavison}, the bounds are often of limited value as they are far from the regime in which we expect neural dynamics to take place. Alternatively, transient regimes toward synchrony and perturbative methods on synchronizability can be used to describe more realistic regimes. \subsubsection{Structural drivers of synchrony: Graph architecture and symmetries} One framework to study the perturbative stability of a synchronous state or transients toward synchrony takes an explicitly structural approach. For instance, \textcite{PhysRevLett.80.2109} proposed the master stability function (MSF) to analyze the stability of this state on a network of oscillators. A schematic of this function for a generic network of identical oscillators is given in Fig. \ref{fig:sync}a. Within this framework, linear stability depends on the positive eigenvalues $\{\lambda_{i}\}, i=1, ... ,N-1$ of the graph Laplacian $\mathbf{L}$ defined by $L_{ij}=\delta_{ij}\sum_{k}A_{ik}-A_{ij}$, where $\mathbf{A}$ is the network adjacency matrix defined in \ref{s:network}. More specifically, stability under perturbations exists when this function is negative for all positive eigenvalues of the Laplacian matrix. Without a detailed specification of the properties of the dynamical units, a larger spread of Laplacian eigenvalues will typically make the system more difficult to synchronize than a smaller spread. Therefore, one natural measure of global synchronizability is the inverse variance $1/\sigma^2{(\{\lambda_{i}\})}$, as proposed by \textcite{Nishikawa08062010}: \begin{equation} \sigma^2=\frac{\sum_{i=1}^{N-1}|\lambda_i-\bar{\lambda}|^2}{d^2(N-1)}\textrm{,\quad where } \bar{\lambda}:=\frac{1}{N-1}\sum_{i=1}^{N-1}\lambda_i \end{equation} and $d:=\frac{1}{N}\sum_{i}\sum_{j\neq i}A_{ij}$, the average coupling strength per node, which effectively normalizes the overall network strength. \textcite{Tang2017} used this metric of global synchronizability to study the brain networks of 882 typically developing youth from the ages of 8 to 22 years. They found that brain networks that are more synchronizable tend to display lower average controllability (Fig.~\ref{fig:sync}b) as well as lower modal controllability. While no known relationship between synchronizability and controllability exists, the correlation is intuitive in that it suggests that individuals who are theoretically predicted to more easily transition into a variety of dynamical states are less susceptible to having many regions locked in synchrony. Interestingly, the relationship between synchronizability and controllability is partially explained by age: synchronizability decreases as children age (inset of Fig.~\ref{fig:sync}b). These results suggest that as the brain matures, its network architecture supports a larger range of dynamics (from nearby to distant states) perhaps necessary for the adult repertoire of cognitive functions, and is less able to support globally synchronized states which are instead characteristic of pathological conditions such as epilepsy. The emergence of local patterns of synchronization can follow different paths depending on the graph architecture, and hence suggest the existence of particular control strategies that may enact the desired path. \textcite{PhysRevLett.98.034101} probe this dependence on the network coupling strength and topology, as well as patterns in the transition to synchrony in a network representing structural measurements from cat cerebral cortex \cite{10.1371/journal.pone.0012313}. Such considerations that move beyond the linear stability of the synchronized state can provide insights into the design of real-world networks that often display small-world topologies. The concept of basin stability that can describe nonlocal and nonlinear systems is a powerful example, successfully describing features of neural networks such as the macaque or cat cortex \cite{Menck2013}. The control of synchrony hence has strong connections with nonlinear control, also exemplified when considering the role of structural symmetries. Indeed, critical work from \textcite{PhysRevX.5.011005} demonstrates that symmetries and motifs in the network structure have a nontrivial impact on the potential to control the system's dynamics. Their work addressing three-node motifs (see Fig. \ref{fig:motifs}) explores the possibility of introducing a group-theoretic component to the existing algebra of control theory. They conduct simulations of the motifs using biophysical neuronal models characterized by nonlinear dynamics as described by the Fitzhugh-Nagumo equations, which comprise a general representation of excitable neuronal membranes. They explore several dynamical regimes including chaotic, pulsed limit-cycle, and constant input limit-cycle, to see how different types of symmetries (such as rotational or mirror) affect the resulting controllability. Further work is needed to determine whether these effects on controllability generalize to scenarios in which the same 3-node motifs are embedded in a larger network, or in which the model of dynamics is changed from a cellular-level model to a macro-scale model of neuronal activity. In addition, other factors besides anatomical connectivity or network coupling strength (such as local dynamics or neurotransmitter levels) could also contribute to synchony and dynamics, and provide interesting directions for future investigation. \begin{figure}[t] \includegraphics[width=0.7\linewidth]{medium} \caption{\textbf{Motif structures that occur within networks.} The motif structures studied by \textcite{PhysRevX.5.011005}, through simulations of nonlinear biophysical neuronal models and their resulting controllability.} \label{fig:motifs} \end{figure} \subsection{The cost of controlling specific trajectories} While the control metrics defined earlier (\ref{controlmetrics}) consider the cost of control, they necessarily coarse-grain over many different state transitions: average controllability measures the ability to move the system to (all) local states on the energy landscape, while modal controllability measures the ability to move the system to (all) distant states on the energy landscape. However, there are circumstances in real world networks -- and particularly in brain networks -- in which we would like to understand how to move the system from a specified initial state to a specified target state. In this general scenario, we might like to be able to compare the shape of different trajectories within state space, thereby providing intuitions regarding the feasibility of a specific transition and the accessibility of certain final states. \begin{figure}[b] \includegraphics[width=0.7\linewidth]{trajectories} \caption{\textbf{Example trajectory through state space.} With external input (control signals), the system at state $\mathbf{x}_0$ is driven into the desired target state $\mathbf{x}_T$; without input the system's passive dynamics leads to another state $\mathbf{x}_T$ where random brain regions are more active than others. From \cite{Betzel2016}.} \label{fig:trajectories} \end{figure} In the context of the linear network system described earlier (Eq.~\ref{eq:controlled}), one proposed solution to this problem considers the trajectory from an initial state $\mathbf{x}_0$ (one pattern of regional activation) to a target state $\mathbf{x}_T$ (another pattern of regional activation), see Fig. \ref{fig:trajectories}. Our goal is to infer a control input function $\mathbf{u(t)}$ that minimizes the energy of the transition and the distance of the current state from the target (final) state: \begin{equation} \label{eqn_opt1} \begin{aligned} \min_\mathbf{u} & & \int_{0}^T\left((\mathbf{x}_T-\mathbf{x}(t))^T(\mathbf{x}_T-\mathbf{x}(t)) + \rho \mathbf{u}(t)^T \mathbf{u}(t)\right) dt,\\ s.t. & & \dot{\mathbf{x}}(t) = \mathbf{A} \mathbf{x}(t) + \mathbf{B} \mathbf{u}(t),\\ & & \mathbf{x}(0) = \mathbf{x}_0,\\ & & \mathbf{x}(T) = \mathbf{x}_T, \end{aligned} \end{equation} where $T$ is the control horizon, $\rho\in\mathbb{R}_{> 0}$, and $(x_T - x(t))$ is the distance between the state at time $t$ and the target state. Using this formulation, \textcite{1607.01706} study the energy landscape of finite-time control trajectories from the brain's baseline activation state to states with heightened activity in cortex devoted to vision, audition, and motor function. Interestingly, they observe that the most efficient drivers of these transitions were nodes in the network (or regions of the brain) with high communicability to the target state. Communicability examines the weighted sum of walks of all lengths, i.e. $G_{ij} = \sum_{k=0}^\infty (\frac{\mathbf{A}^k}{k!})_{ij} = (e^\mathbf{A})_{ij}$ in a binary network. The generalization to weighted networks is $G_{ij}^{w} = e^{\mathbf{A}'}_{ij}$, where $\mathbf{A}' = \mathbf{D}^{-\frac{1}{2}} \mathbf{A} \mathbf{D}^{-\frac{1}{2}}$ and $\mathbf{D}$ is the diagonal matrix with $D_{ii} = \sum_j A_{ij}$. Their results indicate the importance of long-distance walks on the network for efficient control. Moreover, by studying changes in the energetic impact of nodes on certain control actions, they also find that patients with mild traumatic brain injury show a loss of specificity in the putative control processes that their brain networks support. This work sheds light on the mechanisms that drive brain state transitions in healthy cognition and their alteration following injury. Similarly, \textcite{Betzel2016} simulate control trajectories among states characterized by the activation of various cognitive systems in the brain: systems devoted to visual, auditory, motor, baseline, cognitive control, salience, and attention-related functions. The goal was to compare energetic costs of these transition and to determine how this cost depends on the number of controllers used. The authors identify the brain regions that contribute most strongly to changes in energetic cost, and compare these with predictions from network control theory. In particular, they identify a group of control regions that are located in the rich club: a set of high-degree nodes that tend to also connect to one another \cite{colizza2006detecting}. Notably, these rich-club hubs acting as control regions most altered energetic outcomes when the brain's rich club organization was destroyed by simulated lesioning, an increasingly common model of neurodegenerative disease \cite{alstott2009modeling}. Within this modeling framework, a choice of which trajectories to be simulated has to be made. Further work remains to identify the most useful trajectories for simulation that can reveal actual brain dynamics, thereby increasing biophysical relevance. \subsection{Empirical tools for control of specific neural dynamics or pathways} In the previous few subsections, we outlined theoretical frameworks and computational methods to model and interrogate the control of neural synchrony and brain state transitions. In each of these cases, it is and will remain important to inform and validate theories and models with empirical data, using experimental tools for control. Earlier in this report, we highlighted several of these tools in the form of brain stimulation, which have proven especially relevant for therapeutic interventions. However, in addition to these relatively large-scale tools, that are already being linked to control theory, there also exist fine-scale tools for the manipulation of single neuronal cell types \cite{lee2010global}, which could benefit from additional theoretical work. Arguably one of the most powerful recently-developed tools for the manipulation of single cell types is optogenetics. Optogenetics offers millisecond-scale optical control of neural activity in defined cell types during animal behavior \cite{ref1}. Its marked precision, in some cases at single-cell resolution, allows the possibility to guide activity in awake animals and provide a causal investigation of neural circuitry, see Fig. \ref{fig:opto}. While mostly used in rodents, these techniques are increasingly being used in primates as well to probe basic principles of neural function, and to test strategies for therapeutic interventions such as the interruption of seizures; for further details we point readers to the recent review by \textcite{ref1}. \begin{figure}[t] \includegraphics[width=\linewidth]{gr4} \caption{\textbf{Setup for optogenetic control in a rat.} \textit{Left}: Fiber photometry setup showing light path for fluorescence excitation and emission through a single 400 micron fiber optic implanted in the ventral tegmental area (VTA). \textit{Right}: Recombinase-dependent viral targeting of GCaMP5 to VTA dopamine neurons. From \textcite{ref1}.}\label{fig:opto} \end{figure} Meanwhile, technologies for simultaneously recording cell activity and targeting stimulation are constantly improving, and hence now allow the possibility for closed-loop control in animals. The very specificity of the stimulation and the targeted cells, means that at present specific design choices about intended outcomes have to be made. For instance, the same stimulation that evokes gamma oscillations ($>60$ Hz) at the circuit level using a relatively slow opsin variant ChR2(H134R) cannot always reliably drive individual pyramidal cells at such frequencies. Still, the ability to use such stimulation to direct behavior in animals, suggests tremendous potential for closed-loop optogenetics to reveal mechanisms for cognition. These examples demonstrate new insights obtained through the modelling and probing of specific pathways and circuits in brain networks, and provide a controlled study of their role and contribution to the overall function of the brain. Further work could investigate how these pathways and circuits work in a concerted manner to affect cognitive function, as well as underlying principles in the design and use of these circuits. \section{Emerging control methods with potential utility in neuroscience} \label{s:future} \begin{figure*}[t] \includegraphics[width=0.98\linewidth]{scfvs} \caption{\textbf{Comparison between structural controllability and control using feedback vertex sets. (a)} In structural controllability, the objective is to drive the network from an arbitrary initial state to any desired final state by acting on the network with an external signal $\mathbf{u} (t)$. The dynamics are considered to be well-approximated by linear dynamics. \textbf{(b)} In feedback vertex set control the objective is to drive the network from an arbitrary initial state to any desired dynamical attractor (e.g., a fixed point) by overriding the state of certain nodes. From \textcite{1605.08415}.}\label{fvs} \end{figure*} Many of these recently introduced theoretical frameworks to model the control of brain activity rest on linear or simplified models of dynamics. While they already provide useful conceptual insights and analytical descriptions for controlling neural activity, the large repertoire of dynamics in the brain requires more flexible models to capture its complexity. To close this review, we focus on two broad directions of advances in network control theory that appear particularly relevant for addressing this gap. The first is the extension of network control theory to describe a broader range of dynamical regimes -- such as nonlinear dynamics or time-dependent control -- or the study of control metrics to estimate the feasibility of control trajectories. The second examines new approaches in network control theory that exploit specific properties of the problem to better achieve desired targets, which may well differ based on the problem at hand. These include the use of perturbations, stochasticity in the system, or aspects of the network topology, to design control strategies. \subsection{Broader control regimes} \subsubsection{Nonlinear dynamics} Brain activity is highly nonlinear, which can be seen especially at the level of single neurons or small groups of neurons. A recent analytical development that is mathematically exact for a broad range of nonlinear dynamics is that of feedback vertex sets (FVS) \cite{Fiedler2013}. It only requires a few conditions (e.g. continuous, dissipative, and decaying) that are typically satisfied by many real systems. This formalism identifies the set of nodes in a directed network that can control all the dynamics of the network and can steer it to the desired trajectories. Open-loop control applied to the nodes of an FVS allow for switching the dynamics of the whole system from one attractor to some other attractor. \textcite{1605.08415} provide an instructive discussion of the differences between structural controllability and control using FVS, as illustrated in Fig. \ref{fvs}. The authors use the FVS formalism to study several real networks. By comparing its predictions to those of classical structural controllability, they identify the topological characteristics that underlie the observed differences. In addition, they apply the FVS formalism to study dynamic models of gene regulation, in which directed networks can be used to model gene interactions. In cases where both the function and structure of the network are known, one can use simplified dynamical models such as logical dynamics (on/off states similar to the Ising model) to identify stable motifs that can control the dynamics of the network. Indeed, \textcite{10.1371/journal.pcbi.1004193} demonstrate that such an approach need only be applied transiently for the network to reach and remain in the desired state. The authors illustrate this method using a leukemia signaling network and a network for cell differentiation, giving rise to several predicted interventions that are supported by experiments. \subsubsection{Time-dependent control} Given a possible lack of full information about the network, which is usually the case when one is estimating a brain network from empirical data, it is possible to identify strategies based on available data to define an uncertainty set containing all networks that are coherent with empirical observations. Indeed, \textcite{victorconical} propose a method to control the spread of a viral epidemic, taking place in a directed contact network with unknown contact rates. They assume that they have access to time series data describing the evolution of the spreading process, and propose a data-driven optimization framework to find the optimal allocation of protection resources. This method is illustrated using partial data about the dynamics of a hypothetical epidemic outbreak over a finite period of time---paving the way for inferring control strategies based on limited observational data over finite periods of time. These or similar methods may be particularly relevant for the control of seizure spread in the human brain given that the ``resource'' of brain stimulation is limited by the fact that too much stimulation causes heating of the tissue and eventual cell death. Indeed, the question of cost and limited resources is futher investigated by \textcite{1607.06168}, who point out the possibility to take advantage of dynamically changing edges in a network to inform time-dependent control strategies, that may actually reach controllability faster than time-independent control strategies. This idea is based on the premise of energy savings in such strategies, by exploiting the changing topology to avoid energetically costly directions. For instance, they exert control towards the desired final state when the topology renders the energy cost acceptable, and pause when the topology makes the cost prohibitive. While suggestive of new designs for time-dependent control strategies that may prove more effective than static strategies, further work is needed to examine their relevance and feasibility in real neural systems. \subsubsection{Realistic control trajectories} \textcite{PhysRevLett.110.208701} investigate the control of dynamical trajectories in practice and what determines their energetics or feasibility. In particular, they point to the condition number of the controllability Gramian \eqref{eq:Gramian} as crucial for understanding control in practice, even if the corresponding Kalman's controllability matrix is well conditioned. Furthermore, they point out that numerical control fails even for linear systems if the Gramian is ill conditioned, and that control trajectories are generally nonlocal in the phase space (see Fig. \ref{fig:nonlocal}). Futher, they provide a condition for the numerical success rate of control strategies that depends on the number of control inputs, which they term the numerical controllability transition. Their work points towards additional criteria that would be relevant when considering the practicality of various control strategies in real systems. \subsection{Exploiting system properties} \begin{figure}[t] \includegraphics[width=0.7\linewidth]{sunmotter} \caption{\textbf{Two-dimensional example of nonlocal trajectories.} Example system $\dot{x}_1=x_1 + u_1(t),\dot{x}_2=x_1$, where the curves indicate minimal-energy control trajectories for the given initial state (open symbol) and target states (solid symbols). Background arrows indicate the vector field in the absence of control. From \textcite{PhysRevLett.110.208701}.}\label{fig:nonlocal} \end{figure} \subsubsection{Compensatory perturbations or noise} It is important to note that the study of control of brain network dynamics could also benefit from other methods that target neither nodes nor edges but instead identify effective parameters to design new strategies for control. The advantage of such approaches is their applicability for realistic regimes including nonlinear dynamics or stochastic systems. One such method proposed by \textcite{Cornelius2013} uses compensatory perturbations to steer the system to desired states: that is, perturbations to state variables that bring the system to the basin of attraction of the desired target state. The authors present methods to iteratively identify such compensatory perturbations, through consideration of the physically admissible perturbations, and through nonlinear optimization on this space of possible changes. Their approach is effective in bringing the system to a desired target state even when this state is not directly accessible, as they demonstrated through the mitigation of cascading failures in a power grid and the identification of drug targets in a cancer signaling network. Another such method identifies interventions that can reshape the topography of the underlying quasipotential in a desired way \cite{PhysRevX.5.031036}. This is achieved by determining the minimum action paths---those followed by the likely noise-induced transition trajectories---and the corresponding transition rates between all pairs of stable states. By optimizing these transition rates, the authors effectively alter quasipotential barriers between different stable states, which could be achieved biologically through, for example, a genome editing approach. This proposal exploits the response of biological systems to noise to induce a desired cell state, and thereby to predict and control noise-induced switching in genetic networks. While this method is demonstrated on models of cell differentiation, it is potentially useful for control in other classes of noisy complex networks. \subsubsection{Network topology} Finally, understanding control in brain networks could benefit greatly from a better understanding of which topological features and symmetries determine the controllability of a network. Recent work on this front has been pioneered by \textcite{GB-FP-SZ:15}, who study the controllability degree of complex networks as a function of the network diameter and the weights. By examining the energy required by a group of nodes to control the network to a desired state, the authors find that networks with a long diameter and anisotropic weights are easier to control than networks with a short diameter or isotropic weights. Here weights are defined to be isotropic if they allow a (control) signal to propagate equally in all directions, and to be anisotropic otherwise. Separately, \textcite{Ruths1373} discuss control profiles in real networks, by identifying topological features of the network (such as sources and sinks) that correlate with control properties. Building on these ideas, \textcite{Campbell2015} show that the number of source and sink nodes, the form of the in- and out-degree distributions, and local complexity (e.g., cycles) shape the control profile in empirical networks. Other work by \textcite{Posfai2013} examines the effects of clustering, modularity, and degree correlations on the minimal number of driver nodes required to control a network (similar to the problem posed by \textcite{YYL-JJS-ALB:11}). They find that under certain conditions, only degree correlations have a discernible effect. Lastly, \textcite{1303.3907} investigate analytical relationships between network modularity or symmetries, and the resulting dynamics. They show that continuous time network dynamics can be decomposed into collections of interacting local control systems --- and that a class of maps called \textit{graph fibrations} give rise to conjugate dynamical systems. Their work provides a robust mathematical formalism to generalize existing understanding such as the relationship between symmetries and synchrony, through the broad notion of modularity. \section{Conclusion} We have discussed many new developments in the exciting field of controlling brain network dynamics and more importantly, attempted to highlight some of the many remaining open questions. This is an exciting time that has seen rapid theoretical and technological progress in methods of brain network control, or innovations that could be useful for brain network control. By outlining the potential in this young and emerging field, we hope to entice new practioners and further efforts towards this important goal of controlling brain network dynamics, that has great implications for the bettering of our health and cognitive function. \begin{acknowledgments} We thank Sergio Pequito, Ankit N. Khambhati, and Richard Betzel for helpful comments on earlier versions of this manuscript. D.S.B. and E.T. would also like to acknowledge support from the John D. and Catherine T. MacArthur Foundation, the Alfred P. Sloan Foundation, the Army Research Laboratory and the Army Research Office through contract numbers W911NF-10-2-0022 and W911NF-14-1-0679, the National Institute of Health (2-R01-DC-009209-11, 1R01HD086888-01, R01-MH107235, R01-MH107703, R01MH109520, 1R01NS099348 and R21-M MH-106799), the Office of Naval Research, and the National Science Foundation (BCS-1441502, CAREER PHY-1554488, BCS-1631550, and CNS-1626008).The content is solely the responsibility of the authors and does not necessarily represent the official views of any of the funding agencies. \end{acknowledgments}
{'timestamp': '2018-05-16T02:04:01', 'yymm': '1701', 'arxiv_id': '1701.01531', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01531'}
arxiv
\section{Introduction} In a recent paper with M.~Bucci~\cite{BuDelFi13}, the first two authors dealt with trapezoidal words (a generalization of finite Sturmian words), also with respect to the property of being closed or open. Let $\Sigma$ be a finite nonempty set (the alphabet). A (finite) word $w=w[1]w[2]\cdots w[n]$ with $w[i] \in \Sigma$ is \emph{closed} (also known as \emph{periodic-like}~\cite{CaDel01a}) if it contains a factor that occurs both as a prefix and as a suffix but does not have internal occurrences, otherwise it is \emph{open}. For example, the words $abca$, $ababa$ and $aabaab$ are closed --- any word of length $1$ is closed, the empty word being a factor that occurs both as a prefix and as a suffix but does not have internal occurrences; the words $ab$, $aab$ and $aaba$, instead, are open. Given a finite or infinite word $w=w[1]w[2]\cdots$, the sequence $\mathrm{oc}(w)$ of open/closed prefixes of $w$, that we refer to as the \emph{oc-sequence} of $w$, is the binary sequence $c(1)c(2)\cdots$ whose $n$-th element is $1$ if the prefix of $w$ of length $n$ is closed, $0$ if it is open. For example, if $w=abcab$, then $\mathrm{oc}(w)=10011$. A question that arises naturally is whether it is possible to reconstruct a word (up to renaming letters) from its oc-sequence. This is not true in general, even when the alphabet is binary. For example, the words $aaba$ and $aabb$ are not isomorphic (i.e., one cannot be obtained from the other by renaming letters), yet they have the same oc-sequence $1100$. As a first result of this paper, we show that if a word is known to be Sturmian, then it can be reconstructed (up to renaming letters) from its oc-sequence. That is, Sturmian words are characterized by their oc-sequences. Moreover, we prove that the class of finite Sturmian words is a maximal element with this property in the class of binary factorial languages. In~\cite{BuDelFi13}, the authors investigated the structure of the sequence $\mathrm{oc}(F)$ of the Fibonacci word $F$. They proved that the lengths of the runs (maximal subsequences of consecutive equal elements) in $\mathrm{oc}(F)$ form the doubled Fibonacci sequence. We prove in this paper that this doubling property holds for every standard Sturmian word, and describe the sequence $\mathrm{oc}(w)$ of a standard Sturmian word $w$ in terms of the \emph{semicentral} prefixes of $w$, which are the prefixes of the form $u_{n}xyu_{n}$, where $x,y$ are letters and $u_{n}xy$ is an element of the standard sequence of $w$. As a consequence, we show that the word $ba^{-1}w$, obtained from a standard Sturmian word $w$ starting with letter $a$ by replacing the first letter with a $b$, can be written as the infinite product of the words $(u_{n}^{-1}u_{n+1})^{2}$, $n\ge 0$. Since the words $u_{n}^{-1}u_{n+1}$ are reversals of standard words, this induces an infinite factorization of $ba^{-1}w$ in squares of reversed standard words. We then show how the oc-sequence of a standard Sturmian word of slope $\alpha$ is related to the continued fraction expansion of $\alpha$, both in terms of the convergents and of the continuants of $\alpha$. Finally, we provide a linear-time algorithm that computes the oc-sequence of a finite word, and a linear-time algorithm that reconstructs a finite Sturmian word from its oc-sequence. \section{Open and closed words} Let us begin with some notation and basic definitions; for those not included below, we refer the reader to~\cite{BuDelFi13} and~\cite{LothaireAlg}. Let $\Sigma$ be a finite alphabet. Let $\Sigma^{*}$ and $\widehat{\Sigma}^{*}$ stand respectively for the free monoid and the free group generated by $\Sigma$. Their elements are called \emph{words} over $\Sigma$. The \emph{length} of a word $w$ is denoted by $|w|$. The \emph{empty word}, denoted by $\epsilon$, is the unique word of length zero and is the neutral element of $\Sigma^{*}$ and $\widehat{\Sigma}^{*}$. If $x\in \Sigma$ and $w\in \Sigma^*$, we let $|w|_x$ denote the number of occurrences of $x$ in $w$. A \emph{prefix} (resp.~a \emph{suffix}) of a word $w$ is any word $u$ such that $w=uz$ (resp.~$w=zu$) for some word $z$. A \emph{factor} of $w$ is a prefix of a suffix (or, equivalently, a suffix of a prefix) of $w$. A prefix/suffix/factor of a word is \emph{proper} if it is nonempty and does not coincide with the word itself. The set of prefixes, suffixes and factors of the word $w$ are denoted by $\Pref(w)$, $\Suff(w)$ and $\Fact(w)$, respectively. From the definitions, we have that $\epsilon$ is a prefix, a suffix and a factor of any word. A \emph{border} of a word $w$ is any word in $\Pref(w)\cap \Suff(w)$ different from $w$. An \emph{occurrence} of a factor $u$ in $w$ is a factorization $w=vuz$. An occurrence of $u$ is \emph{internal} if both $v$ and $z$ are nonempty. A \emph{period} of a nonempty word $w$ is an integer of the form $|w|-|u|$, where $u$ is a border of $w$. We call \emph{the} period of $w$ the least of its periods, that is the difference between the length of $w$ and the length of its longest border. Conventionally, the period of $\varepsilon$ is 1. The ratio between the length and the period of a word $w$ is called the \emph{exponent} of $w$. A factor $v$ of a word $w$ is \emph{left special in $w$} (resp.~\emph{right special in $w$}) if there exist $a,b\in\Sigma$ such that $av$ and $bv$ are factors of $w$ (resp.~$va$ and $vb$ are factors of $w$). A \emph{bispecial factor} of $w$ is a factor that is both left and right special. The word $\widetilde{w}$ obtained by reading $w$ from right to left is called the \emph{reversal} (or \emph{mirror image}) of $w$. A \emph{palindrome} is a word $w$ such that $\widetilde{w}=w$. In particular, the empty word is a palindrome. An \emph{infinite word} $w$ over $\Sigma$ is a sequence $w:\mathbb N_+\to\Sigma$, written as $w=w[1]w[2]\dotsm w[n]\dotsm$. Prefixes and factors of infinite words are naturally defined, as is the product $uw$ of a finite word $u$ and an infinite word $w$. Let $\Sigma^{\omega}$ denote the set of infinite words over $\Sigma$. If $u$ is a finite nonempty word, $u^\omega$ denotes the periodic word $uuu\dotsm\in \Sigma^{\omega}$. An infinite word $w$ is said to be \emph{ultimately periodic} if there exist two finite words $v$ and $u$ such that $w=vu^\omega$; an \emph{aperiodic} word is an infinite word that is not ultimately periodic. An infinite word $w$ is \emph{recurrent} if every factor of $w$ occurs infinitely often; equivalently, $w$ is recurrent if and only if every prefix of $w$ has a second occurrence in $w$. We recall the definitions of open and closed words given in \cite{Fi11}: \begin{definition}\label{def:closed} A finite word $w$ is \emph{closed} if it is empty or has a factor $v\neq w$ occurring exactly twice in $w$, as a prefix and as a suffix of $w$ (with no internal occurrences). A word that is not closed is called \emph{open}. \end{definition} For any letter $a\in \Sigma$ and for any $n>0$, the word $a^{n}$ is closed, $a^{n-1}$ being a factor occurring only as a prefix and as a suffix in it (this includes the special case of single letters, for which $n=1$ and $a^{n-1}=\epsilon$). More generally, every word whose exponent is at least $2$ is closed \cite[Proposition~4]{BaFiLi15}. \begin{remark} The notion of closed word is equivalent to that of \emph{periodic-like} word \cite{CaDel01a}. A word $w$ is periodic-like if its longest repeated prefix is not right special. The notion of closed word is also closely related to the concept of \emph{complete return} to a factor, as considered in \cite{GlJuWiZa09}. A complete return to the factor $u$ in a word $w$ is any factor of $w$ having exactly two occurrences of $u$, one as a prefix and one as a suffix. Hence, $w$ is closed if and only if it is a complete return to one of its factors; such a factor is clearly both the longest repeated prefix and the longest repeated suffix of $w$ (i.e., the longest border of $w$). \end{remark} \begin{remark}\label{obs} Let $w$ be a nonempty word over $\Sigma$. The following characterizations of closed words follow easily from the definition: \begin{enumerate} \item the longest repeated prefix (resp.~suffix) of $w$ does not have internal occurrences in $w$, i.e., occurs in $w$ only as a prefix and as a suffix; \item the longest repeated prefix (resp.~suffix) of $w$ is not a right (resp.~left) special factor of $w$; \item $w$ has a border that does not have internal occurrences in $w$; \item the longest border of $w$ does not have internal occurrences in $w$. \end{enumerate} Obviously, the negations of the previous properties characterize open words. In the rest of the paper we will use these characterizations freely and without explicit mention to this remark. \end{remark} We conclude this section with some results on right extensions. \begin{lemma}\label{lem:nbo} Let $w$ be a nonempty word over $\Sigma$, and $x\in\Sigma$ be such that $wx$ is closed. Then $wx$ has the same period as $w$. \end{lemma} \begin{proof} Let $vx$ be the longest border of $wx$, and $v'$ be the longest border of $w$. By contradiction, suppose $|v'|>|v|$. Then $vx$ is a prefix of $v'$, and therefore has an internal occurrence in $wx$, contradicting the hypothesis that $wx$ is closed. Hence, $v$ is the longest border of $w$, so that $w$ and $wx$ have the same period $|w|-|v|$. \end{proof} \begin{lemma}\label{cor:nbo} For all nonempty $w\in\Sigma^{*}$, there exists at most one letter $x\in\Sigma$ such that $wx$ is closed. \end{lemma} \begin{proof} Straightforward after Lemma~\ref{lem:nbo}. \end{proof} If $w$ is closed, then exactly one such extension is closed. More precisely, we have the following result (see also~\cite[Prop.~4]{CaDel01a}). \begin{lemma}\label{lem:ce} Let $w$ be a closed word. Then $wx$, $x\in \Sigma$, is closed if and only if $wx$ has the same period as $w$. \end{lemma} \begin{proof} The case $w=\varepsilon$ is trivially verified, so let $w$ be a nonempty closed word and $v$ be its longest borde . Let $x$ be the letter such that $wx$ is has the same period as $w$, i.e., such that $vx$ is a prefix of $w$. Then $wx$ is closed, as its border $vx$ cannot have internal occurrences. The converse follows from Lemma~\ref{lem:nbo}. \end{proof} For more details on open and closed words and related results the reader can see~\cite{CaDel01a,BuDelDel09,Fi11,BuDelFi13,Ba+16}. \section{The oc-sequence of a word} We now define the oc-sequence of a word. \begin{definition} Let $w=w[1]w[2]\dotsm w[n]\dotsm$ be a finite or infinite word over $\Sigma$. We define $\mathrm{oc}(w)=c(1)c(2)\dotsm c(n)\dotsm$, called the \emph{oc-sequence} of $w$, as the binary sequence whose $n$-th element is $0$ if the prefix of length $n$ of $w$ is open, or $1$ if it is closed. \end{definition} For example, if $w=abaaab$, then $\mathrm{oc}(w)=101001$. \begin{remark} \label{rem:nth1} By definition of closed word, for each integer $n\geq 1$, the $(n+1)$-st occurrence of 1 in $\mathrm{oc}(w)$ is at the position corresponding to the end of the second occurrence of the prefix of length $n$ in $w$. Hence, if a finite word $w$ admits a border of length $\ell$, then $|\mathrm{oc}(w)|_1\geq \ell+1.$ In particular, a closed word $w$ is a complete return to its prefix of length $|\mathrm{oc}(w)|_1-1$; equivalently, the period of a closed word $w$ is equal to $1+|\mathrm{oc}(w)|_0$. \end{remark} In the following two propositions we relate recurrence and periodicity of an infinite word with analogous properties of its oc-sequence. \begin{proposition} \label{prop:arrayric} Let $w\in\Sigma^\omega$. The following are equivalent: \begin{enumerate} \item\label{arrayric} $\mathrm{oc}(w)$ is recurrent; \item\label{costante} $w=x^\omega$ for a letter $x\in \Sigma$; \item\label{arraycost} $\mathrm{oc}(w)=1^\omega$. \end{enumerate} \end{proposition} \begin{proof} Clearly, $\ref{costante}\Leftrightarrow\ref{arraycost}\Rightarrow\ref{arrayric}$. To complete the proof, we show that $\ref{arrayric}\Rightarrow\ref{arraycost}$. Let then $\mathrm{oc}(w)$ be recurrent, and suppose by contradiction that $0$ occurs in it. Thus, there exists a positive integer $t$ such that $10^t1$ occurs infinitely often in $\mathrm{oc}(w)$. Hence, for every $n\geq t$, there exists $P$ such that $P10^t1$ is a prefix of $\mathrm{oc}(w)$ and $|P|_1=:m\geq n$. Let $u$ be the prefix of length $m$ of $w$; by Remark~\ref{rem:nth1}, we obtain that the prefixes of $w$ of length $|P1|$ and $|P10^t|$ both have $u$ as a suffix. We have found two occurrences of $u$ at distance $t$ from each other, so that $u$ must have $t$ as a period. Since $n$ is arbitrary and $|u|=m\geq n$, it follows that $w$ has period $t$, so that $\mathrm{oc}(w)$ ends in $1^\omega$ as a consequence of Lemma~\ref{lem:ce}. This contradicts the hypothesis that $\mathrm{oc}(w)$ is recurrent and contains $0$. \end{proof} \begin{proposition} Let $w\in\Sigma^\omega$. The sequence $\mathrm{oc}(w)$ is ultimately periodic if and only if $w$ is either periodic or not recurrent. In the first case, $\mathrm{oc}(w)$ ends in $1^\omega$, while in the latter case it ends in $0^\omega$. \end{proposition} \begin{proof} The ``if'' part is immediate. Let us then prove the ``only if'' part; let $\mathrm{oc}(w)=UV^\omega$. Suppose first that $1$ does not occur in $V$. Then $\mathrm{oc}(w)$ ends in $0^\omega$, so that $w$ has prefixes that have no other occurrences in $w$; hence, $w$ is not recurrent. If $0$ does not occur in $V$, then $\mathrm{oc}(w)$ ends in $1^\omega$ so that $w$ is periodic as a consequence of Lemma~\ref{lem:ce}. Finally, suppose that both $1$ and $0$ occur in $V$. Then there exists a positive integer $t$ such that $10^t1$ occurs infinitely often in $\mathrm{oc}(w)$; as we have seen in the proof of Proposition~\ref{prop:arrayric}, this leads to a contradiction. \end{proof} The following lemma shows that in the sequence $\mathrm{oc}(w)$ any run of $0$s is at least as long as the previous run of $1$s. It will be useful in what follows. \begin{lemma} \label{lem:ts} Given positive integers $s$ and $t$, if $1^t0^s1$ is a factor of $\mathrm{oc}(w)$ then $t\leq s$. \end{lemma} \begin{proof} Let $w=w[1]w[2]w[3]\cdots$ with $w[i]\in\Sigma$, and let $c=\mathrm{oc}(w)=c(1)c(2)\cdots$ with $c(i)\in\{0,1\}$ for all integers $i\geq 1$. Let $a\in\Sigma$ be the letter such that $w[1]=a$. The result is clear in the case when $1^t0^s1$ is a prefix of $\mathrm{oc}(w)$, for this implies that $w$ begins in $a^tb$, where $b$ is a letter in $\Sigma$ different from $a$. Since the longest border of $a^tb$ is the empty word, it follows that the next occurrence of $a^t$ must occur within the suffix $w[t+2]w[t+3]\cdots $ of $w$, so that $c(t+1)\cdots c(2t)=0^t$ whence $t\leq s$. We may now assume that $1^t0^s1$ occurs in $c$ at some later position. Fix a positive integer $r$ such that $1^t0^s1$ is a suffix of $c(1)\cdots c(r+s+1)$. Let $n=|c(1)\cdots c(r)|_1$ and $u$ be the prefix of $w$ of length $n-1$. We note that since $1^t0^s1$ occurs in $c$ and not just as a prefix, we have $t<n$ and $n\geq 2$ (hence $u$ is nonempty). It follows that there exist distinct letters $x,y\in \Sigma$ such that $w$ begins in $ux$ and $w[1]\cdots w[r+1]$ terminates in $uy$. Hence, the second occurrence of $u$ in $w$ terminates in position $r$, while the second occurrence of $ux$ in $w$ terminates in position $r+s+1$. If the second occurrence of $ux$ in $w$ does not overlap the second occurrence of $u$ in $w$, then $s\geq |u|=n-1 \geq t$. If the second occurrence of $ux$ in $w$ overlaps the second occurrence of $u$ in $w$ by an amount $s'\geq 1$, then we have that $s+s'=|u|=n-1$ and $u$ has a border of length $s'$. Let $v$ denote the longest border of $u$. Thus $|v|\geq s'$. First suppose that either $c(|u|)=0$ or $c(|u|)=1$ but $c(|u|)$ and $c(r)$ do not belong to the same run. Then, since $|c(1)\cdots c(|u|)|_1=|(u)|_{1}\geq s'+1$ by Remark~\ref{rem:nth1}, we deduce that \[t\leq |c(|u|+1)\cdots c(r)|_{1}\leq n-(s'+1)=s,\] as required. Finally, suppose $c(|u|)=1$ with $c(|u|)$ and $c(r)$ belonging to the same run. In this case, $u$ and $ux$ are both closed, so that $vx$ is a prefix of $u$. Therefore $|v|>s'$, since $w[1]\cdots w[s']y$ is a prefix of $u$ as well, and hence $v$ has a border of length $s'$. Now, let $px$ be the prefix of $w$ (and of $vx$) that terminates with the first occurrence of $w[1]\cdots w[s']x$; then $px$ is necessarily open, and $|\mathrm{oc}(p)|_{1}\geq s'+1$ by Remark~\ref{rem:nth1}. It follows that if $1^i$ is a suffix of $c(1)\cdots c(|u|)$, hence $i\leq |v|-s'$. Thus, $t\leq |v|-s' + |u|-|v|=|u|-s'=s$. \end{proof} \subsection{Sturmian words} We let $\Sigma=\{a,b\}$ be a fixed binary alphabet from now on, unless otherwise specified. An element of $\Sigma^{\omega}$ is a \emph{Sturmian word} if it contains exactly $n+1$ distinct factors of length $n$, for every $n\ge 0$. A famous example of Sturmian word is the Fibonacci word \[F=abaababaabaababaababa\cdots\] that is the limit, as $n\to \infty$, of the sequence of words $(f_n)$, called the sequence of \emph{finite Fibonacci words}, defined by $f_{-1}=b$, $f_0=a$ and, for every $n\geq 1$, $f_n=f_{n-1}f_{n-2}$. It is well known that if $w$ is a Sturmian word then at least one of $aw$ and $bw$ is also a Sturmian word. A Sturmian word $w$ is called \emph{standard} (or \emph{characteristic}) if $aw$ and $bw$ are both Sturmian words. The Fibonacci word is an example of standard Sturmian word. In the next section, we will deal specifically with standard Sturmian words. Here, we focus on finite factors of Sturmian words, called \emph{finite Sturmian words}. Actually, finite Sturmian words are precisely the elements of $\Sigma^{*}$ verifying the following balance property: for any $u,v\in \Fact(w)$ such that $|u|=|v|$ one has $||u|_{a}-|v|_{a}|\le 1$ (or, equivalently, $||u|_{b}-|v|_{b}|\le 1$). We let $\mathit{St}$ denote the set of finite Sturmian words. The language $\mathit{St}$ is factorial (i.e., if $w=uv\in \mathit{St}$, then $u,v\in \mathit{St}$) and extendible (i.e., for every $w\in \mathit{St}$ there exist letters $x,y\in \Sigma$ such that $xwy\in \mathit{St}$). We recall the following definitions given in \cite{DelMi94}. \begin{definition} A word $w\in \Sigma^{*}$ is a left special (resp.~right special) Sturmian word if $aw,bw\in \mathit{St}$ (resp.~if $wa,wb\in \mathit{St}$). A bispecial Sturmian word is a Sturmian word that is both left special and right special. Moreover, a bispecial Sturmian word is strictly bispecial if $awa,awb,bwa,$ and $bwb$ are all Sturmian words; otherwise it is non-strictly bispecial. \end{definition} For example, the word $w=ab$ is a bispecial Sturmian word, since $aw$, $bw$, $wa$ and $wb$ are all Sturmian. This example also shows that a bispecial Sturmian word is not necessarily a bispecial factor of some Sturmian word (which must be a palindrome); in fact, bispecial factors of Sturmian words coincide with \emph{strictly} bispecial Sturmian words (see \cite{Fi14} for more details on bispecial Sturmian words). \begin{remark}\label{rem:rsp} It is known that if $w$ is a left special Sturmian word, then $w$ is a prefix of some standard Sturmian word, and the left special factors of $w$ are prefixes of $w$. Symmetrically, if $w$ is a right special Sturmian word, then the right special factors of $w$ are suffixes of $w$. \end{remark} Regarding open and closed prefixes of Sturmian words, we prove the following result. \begin{theorem}\label{theor:main} Every (finite or infinite) Sturmian word $w$ is uniquely determined, up to isomorphisms of the alphabet $\Sigma$, by its oc-sequence $\mathrm{oc}(w)$. \end{theorem} We need some intermediate lemmas. \begin{lemma}\label{lem:lsp} Let $w$ be a right special Sturmian word and let $u$ be its longest repeated prefix. Then $u$ is a suffix of $w$. \end{lemma} \begin{proof} If $w$ is closed, the claim follows from the definition of closed word. If $w$ is open, then $u$ is right special in $w$, and by Remark~\ref{rem:rsp} $u$ is a suffix of $w$. \end{proof} \begin{lemma}\label{lem:speclo} Let $w$ be a right special Sturmian word. Then $wa$ or $wb$ is closed. \end{lemma} \begin{proof} Let $u$ be the longest repeated prefix of $w$ and $x$ be the letter following the occurrence of $u$ as a prefix of $w$. By Lemma \ref{lem:lsp}, $u$ is a suffix of $w$. Clearly, the longest repeated prefix of $wx$ is $ux$, which is also a suffix of $wx$ and cannot have internal occurrences in $wx$, otherwise the longest repeated prefix of $w$ would not be $u$. Therefore, $wx$ is closed. \end{proof} So, by Lemmas~\ref{cor:nbo} and~\ref{lem:speclo}, if $w$ is a right special Sturmian word, then one of $wa$ and $wb$ is closed and the other is open. This implies that the oc-sequence of a (finite or infinite) Sturmian word characterizes it up to exchange of letters. The proof of Theorem \ref{theor:main} is therefore complete. We now prove that $St$ is maximal in the class of factorial languages over $\Sigma$ verifying the condition of Theorem~\ref{theor:main}, i.e., such that their members are determined by their $\mathrm{oc}$ sequences. Let us write $u\sim v$ when two words $u,v\in\Sigma^{*}$ are isomorphic, and let \[\mathcal{C}=\{A\subseteq \Sigma^*\mid \forall u\in A, \Fact(u)\subseteq A \,\wedge\, \forall u,v \in A: \mathrm{oc}(u)=\mathrm{oc}(v)\Rightarrow u\sim v\}.\] We note that $\mathcal{C}$ is nonempty (e.g., $A=\{\varepsilon,0\}\in\mathcal{C}$), partially ordered with respect to inclusion, and such that every increasing chain \[A_1\subseteq A_2 \subseteq A_3\subseteq \cdots\] with all $A_i\in \mathcal{C}$ has an upper bound in $\mathcal{C}$ given by $\bigcup_{i\geq 1}A_i.$ Thus, by Zorn's lemma, $\mathcal{C}$ admits at least one maximal element. \begin{theorem} \label{thm:C} $St$ is a maximal element of $\mathcal{C}.$ \end{theorem} Again we need to recall two lemmas. The first is a well-known result about balanced words (cf.~\cite[Proposition~2.1.3]{LothaireAlg}): \begin{lemma} \label{thm:unbal} A word $s\in\Sigma^{*}$ is not balanced if and only if there exists a palindrome $v$ such that $ava,bvb\in\Fact(s)$. \end{lemma} Next is an immediate consequence of known properties of Christoffel words (cf.~\cite{Fi14}). \begin{lemma} \label{thm:bispCF} A word $u\in\Sigma^{*}$ is a non-strictly bispecial Sturmian word if and only if there exists a strictly bispecial Sturmian word $w$ and an integer $n>1$ such that \[\text{\emph{either} }\;aub=(awb)^{n}\in St\; \text{ \emph{or} }\; bua=(bwa)^{n}\in St\,.\] \end{lemma} \begin{proof}[Proof of Theorem~\ref{thm:C}] It follows from Theorem~\ref{theor:main} that $St \in \mathcal{C}.$ To see that $St$ is a maximal element of $\mathcal{C}$ we show that no element of $\mathcal{C}$ properly contains $St$. Suppose to the contrary that there exists an element $A\in \mathcal{C}$ such that $St\subsetneq A$. Let $s$ be an element of minimal length of $A$ not belonging to $St$. By Lemma~\ref{thm:unbal}, there exists a word $v$ such that $ava,bvb\in\Fact(s)$. Since all proper factors of $s$ are balanced, without loss of generality we can assume that $ava$ is a prefix of $s$ and $bvb$ is a suffix. Hence we can write $s=aub$ for some $u\in \Sigma^+$. Let $r$ be a border of $s$. Since $r$ is balanced, we have $|r|<|ava|=|bvb|$. Writing $ava=r\alpha$ and $bvb=\beta r$, it follows that $|\alpha|=|\beta|$ and $|\alpha|_{a}-|\beta|_{a}=2$, whence $r=\varepsilon$ by our minimality assumption on $s$. Therefore $s$ is open, so that $\mathrm{oc}(s)$ terminates in $0$. We will show that $aua\in St$ and $\mathrm{oc}(aua)$ terminates in $0$. It follows then that $aua, s\in A$ and that $\mathrm{oc}(aua)=\mathrm{oc}(s)$, a contradiction since $aua\not\sim s$. By definition of $\mathcal{C}$ it follows that $au, ub\in A$. By minimality of the length of $s$ we have $au, ub \in St$. Thus $aua$ and $bub\in St$, so that $ua, ub, au, bu \in St$; in other words, $u$ is a bispecial Sturmian word. On the other hand, as $s=aub\notin St$, we have that $u$ is non-strictly bispecial. Thus, by Lemma~\ref{thm:bispCF}, there exists a word $w$ such that $bua=(bwa)^n$ for some $n>1$. Hence $aua=awa(bwa)^{n-1}$. Clearly, $awa$ occurs only once in $aua$, as all other factors of the same length have one less occurrence of the letter $a$. Thus, if $z$ is a border of $aua$, then $|z|<|awa|$. It follows that $z$ is a proper suffix of $bwa$ and so it has an internal occurrence in $aua$ (as a proper suffix of $awa$). Therefore $aua$ is open, so that $\mathrm{oc}(aua)$ terminates in $0$, as required. \end{proof} \subsection{Standard Sturmian words} In this section, we deal with the oc-sequence of standard Sturmian words. In \cite{BuDelFi13} a characterization of the oc-sequence of the Fibonacci word $F$ was given. Let us begin by recalling some definitions and basic results about standard Sturmian words. For more details, the reader can see \cite{Be07} or \cite{LothaireAlg}. Let $\alpha$ be an irrational number such that $0<\alpha<1$, and let $\left[0;d_{0}+1,d_{1},\ldots\right]$ be the continued fraction expansion of $\alpha$. The sequence of words defined by $s_{-1}=b$, $s_{0}=a$ and $s_{n+1}=s_{n}^{d_{n}}s_{n-1}$ for $n\ge 0$, converges to the infinite word $w_{\alpha}$, called the \emph{standard Sturmian word of slope $\alpha$}. The sequence of words $s_{n}$ is called the \emph{standard sequence} of $w_{\alpha}$. Note that $w_{\alpha}$ starts with letter $b$ if and only if $\alpha>1/2$, i.e., if and only if $d_{0}=0$. In this case, $\left[0;d_{1}+1,d_{2},\ldots\right]$ is the continued fraction expansion of $1-\alpha$, and $w_{1-\alpha}$ is the word obtained from $w_{\alpha}$ by exchanging $a$'s and $b$'s. Hence, without loss of generality, we will suppose in the rest of the paper that $w$ starts with letter $a$, i.e., that $d_{0}>0$. For every $n\ge -1$, one has \begin{equation}\label{eq:su} s_{n}=u_{n}xy, \end{equation} for $x,y$ letters such that $xy=ab$ if $n$ is odd or $ba$ if $n$ is even. Indeed, the sequence $(u_{n})_{n\ge -1}$ can be defined by: $u_{-1}=a^{-1}$, $u_0=b^{-1}$, and, for every $n\ge 1$, \begin{equation}\label{eq:un+1} u_{n+1}=(u_{n}xy)^{d_{n}}u_{n-1}\,, \end{equation} where $x,y$ are as in \eqref{eq:su}. \begin{example} The Fibonacci word $F$ is the standard Sturmian word of slope $1/\varphi^2=(3-\sqrt{5})/2$, whose continued fraction expansion is $[0;2,1,1,1,\ldots]$, so that $d_{n}=1$ for every $n\ge 0$. Therefore, the standard sequence of the Fibonacci word $F$ is the sequence $(f_n)$ defined by: $f_{-1}=b$, $f_{0}=a$, $f_{n+1}=f_{n}f_{n-1}$ for $n\ge 0$. This sequence is the sequence of finite Fibonacci words. \end{example} \begin{definition} A \emph{standard word} is a finite word belonging to some standard sequence. A \emph{central word} is a word $u\in\Sigma^*$ such that $uxy$ is a standard word, for letters $x,y\in \Sigma$. \end{definition} It is known that every central word is a palindrome% . Actually, central words play a central role in the combinatorics of Sturmian words and have several combinatorial characterizations (see \cite{Be07} for a survey). We summarize some of these properties in the following proposition. \begin{proposition} \label{prop:PER} Let $v$ be a word over $\Sigma$. The following are equivalent: \begin{enumerate} \item $v$ is a central word; \item $v$ is a palindromic bispecial Sturmian word; \item $v$ is a power of a single letter or it can be written as \[v=pxyq=qyxp\] for some words $p$ and $q$ and distinct letters $x,y$. \end{enumerate} Moreover, in this latter case, $p$ and $q$ are central words themselves, and $v$ is a complete return to the longest between $p$ and $q$. In particular, central words are closed. \end{proposition} In fact, all Sturmian palindromes (and more generally, all \emph{rich} palindromes~\cite{GlJuWiZa09}) are closed; however, in general there do exist open palindromes, such as $aabbabaaababbaa$ (cf.~\cite[Remark 4.13]{BuDelFi13}). \begin{remark} Let $(s_{n})_{n\ge -1}$ be a standard sequence. It follows by the definition that for every $k\ge 0$ and $n\ge -1$, the word $s_{n+1}^{k}s_{n}$ is a standard word. In particular, for every $n\ge -1$, the word $s_{n+1}s_n=u_{n+1}yxu_nxy$ is a standard word. Therefore, for every $n\ge -1$, we have that \begin{equation}\label{eq:u} u_nxyu_{n+1}=u_{n+1}yxu_n \end{equation} is a central word. \end{remark} The following lemma is a well-known result (cf.~\cite{fisch}). \begin{lemma}\label{lem:pref} Let $w$ be a standard Sturmian word and let $(s_{n})_{n\ge -1}$ be its standard sequence. Then: \begin{enumerate} \item A standard word $v$ is a prefix of $w$ if and only if $v=s_{n}^{k}s_{n-1}$, for some $n\ge 0$ and $k\le d_{n}$. \item A central word $u$ is a prefix of $w$ if and only if $u=(u_{n}xy)^{k}u_{n-1}$, for some $n\ge 0$, $0<k\le d_{n}$, and distinct letters $x,y\in \Sigma$ such that $xy=ab$ if $n$ is odd or $ba$ if $n$ is even. \end{enumerate} \end{lemma} Note that $(u_{n}xy)^{d_{n}+1}u_{n-1}$ is a central prefix of $w$, but this does not contradict the previous lemma since, by~\eqref{eq:un+1}, $(u_nxy)^{d_n+1}u_{n-1}=u_{n+1}yxu_n$. Recall that a \emph{semicentral word} (see~\cite{BuDelFi13}) is a word in which the longest repeated prefix, the longest repeated suffix, the longest left special factor and the longest right special factor all coincide. The following proposition summarizes some properties of semicentral words proved in~\cite{BuDelFi13}. \begin{proposition} \label{prop:qxyq} A word $v$ is semicentral if and only if $v=uxyu$ for a central word $u$ and distinct letters $x,y\in \Sigma$. Moreover, $u$ has exactly one internal occurrence in $v=uxyu$, and this occurrence is preceded by $x$ and followed by $y$. In particular, semicentral words are open (whereas central words are closed). \end{proposition} \begin{proposition}\label{prop:semi} The semicentral prefixes of $w$ are precisely the words of the form $u_nxyu_n$, $n\ge 1$, where $x,y$ and $u_{n}$ are as in \eqref{eq:su}. \end{proposition} \begin{proof} Since $u_{n}$ is a central word, the word $u_nxyu_n$ is a semicentral word by definition, and it is a prefix of $u_nxyu_{n+1}=u_{n+1}yxu_{n}$, which in turn is a prefix of $w$ by Lemma \ref{lem:pref}. Conversely, assume that $w$ has a prefix of the form $u\xi\eta u$ for a central word $u$ and distinct letters $\xi,\eta\in \Sigma$. From Lemma \ref{lem:pref} and \eqref{eq:su}, we have that \[u\xi\eta u=(u_{n}xy)^{k}u_{n-1}\cdot \xi\eta \cdot (u_{n}xy)^{k}u_{n-1},\] for some $n\ge 1$, $k\le d_{n}$, and distinct letters $x,y\in \Sigma$ such that $xy=ab$ if $n$ is odd or $ba$ if $n$ is even. In particular, this implies that $\xi\eta=yx$. If $k=d_{n}$, then $u=u_{n+1}yx u_{n+1}$, and we are done. So, suppose by contradiction that $k<d_{n}$. Now, on the one hand we have that $(u_{n}xy)^{k+1}u_{n-1}yx$ is a prefix of $w$ by Lemma \ref{lem:pref}, and so $(u_{n}xy)^{k+1}u_{n-1}$ is followed by $yx$ as a prefix of $w$; on the other hand we have \begin{eqnarray*} u\xi\eta u &=& (u_{n}xy)^{k}u_{n-1}\cdot yx \cdot (u_{n}xy)^{k}u_{n-1} \\ &=& (u_{n}xy)^{k} \cdot u_{n-1}yxu_{n} xy \cdot(u_{n}xy)^{k-1}u_{n-1} \\ &=& (u_{n}xy)^{k} \cdot u_{n}xyu_{n-1} xy \cdot(u_{n}xy)^{k-1}u_{n-1} \\ &=& (u_{n}xy)^{k+1} \cdot u_{n-1}xy \cdot(u_{n}xy)^{k-1}u_{n-1}, \end{eqnarray*} so that $(u_{n}xy)^{k+1}u_{n-1}$ is followed by $xy$ as a prefix of $w$, a contradiction. \end{proof} The next theorem shows the behavior of the runs in $\mathrm{oc}(w)$ by determining the structure of the last elements of the runs. \begin{theorem} \label{thm:bdaries} Let $vx$, $x\in \Sigma$, be a prefix of $w$. Then: \begin{enumerate} \item $v$ is open and $vx$ is closed if and only if there exists $n\ge 1$ such that $v=u_{n}xyu_{n}$; \item $v$ is closed and $vx$ is open if and only if there exists $n\ge 0$ such that $v=u_{n}xyu_{n+1}=u_{n+1}yxu_{n}$. \end{enumerate} \end{theorem} \begin{proof} 1. If $v=u_{n}xyu_{n}$, then $v$ is semicentral and therefore open. The word $vx$ is closed since its longest repeated prefix $u_{n}x$ occurs only as a prefix and as a suffix in it. Conversely, let $vx$ be a closed prefix of $w$ such that $v$ is open, and let $ux$ be the longest repeated suffix of $vx$. Since $vx$ is closed, $ux$ does not have internal occurrences in $vx$. Since $u$ is the longest repeated prefix of $v$ (suppose the longest repeated prefix of $v$ is a $z$ longer than $u$, then $vx$, which is a prefix of $z$, would be repeated in $v$ and hence in $vx$, contradiction) and $v$ is open, $u$ must have an internal occurrence in $v$ followed by a letter $y\neq x$. Symmetrically, if $\xi$ is the letter preceding the occurrence of $u$ as a suffix of $v$, since $u$ is the longest repeated suffix of $v$ one has that $u$ has an internal occurrence in $v$ preceded by a letter $\eta \neq \xi$. Thus $u$ is left and right special in $w$. Moreover, $u$ is the longest special factor in $v$. Indeed, if $u'$ is a left special factor of $v$, then $u$ must be a prefix of $u'$. But $ux$ cannot appear in $v$ since $vx$ is closed, and if $uy$ was a left special factor of $v$, it would be a prefix of $v$. Symmetrically, $u$ is the longest right special factor in $v$. Thus $v$ is semicentral, and the claim follows from Proposition \ref{prop:semi}. 2. If $v=u_{n}xyu_{n+1}=u_{n+1}yxu_{n}$, then $v$ is a central word and therefore it is closed. Its longest repeated prefix is $u_{n+1}$. The longest repeated prefix of $vx$ is either $a^{d_0-1}$ (if $n=0$) or $u_{n}x$ (if $n>0$); in both cases, it has an internal occurrence as a prefix of the suffix $u_{n+1}x$. Therefore, $vx$ is open. Conversely, suppose that $vx$ is any open prefix of $w$ such that $v$ is closed. If $vx=a^{d_0}b$, then $v=u_0xyu_1=u_1yxu_0$ and we are done. Otherwise, by 1), there exists $n\geq 1$ such that $|u_n\xi y u_n|<|v|<|u_{n+1}y\xi u_{n+1}|$, where $\{\xi,y\}=\{a,b\}$. We know that $u_n\xi y u_{n+1}$ is closed and $u_n\xi y u_{n+1}\xi$ is open; it follows $v=u_n\xi y u_{n+1}=u_nxyu_{n+1}$, as otherwise there should be in $w$ a semicentral prefix strictly between $u_nxyu_n$ and $u_{n+1}yxu_{n+1}$. \end{proof} Note that, for every $n\ge 1$, one has: \begin{eqnarray*} u_{n+1}yxu_{n+1}&=&u_{n+1}yxu_{n}(u_{n}^{-1}u_{n+1})\\ &=&u_{n}xyu_{n+1}(u_{n}^{-1}u_{n+1})\\ &=&u_{n}xyu_{n}(u_{n}^{-1}u_{n+1})^{2}. \end{eqnarray*} Therefore, starting from an (open) semi-central prefix $u_{n}xyu_{n}$, one has a run of closed prefixes, up to the prefix $u_{n}xyu_{n+1}=u_{n+1}yxu_{n}=u_{n}xyu_{n}(u_{n}^{-1}u_{n+1})$, followed by a run of the same length of open prefixes, up to the prefix $u_{n+1}yxu_{n+1}=u_{n+1}yxu_{n}(u_{n}^{-1}u_{n+1})=u_{n}xyu_{n}(u_{n}^{-1}u_{n+1})^{2}$. See Table \ref{tab:example} for an illustration. \begin{table}[ht] \setlength{\tabcolsep}{10pt} \begin{center} \begin{tabular}{ l c l } prefix of $w$ & open/closed & example \\ \hline $u_{n}xyu_{n}$ & open & $aaba$ \\ $u_{n}xyu_{n}x$ & closed & $aabaa$ \\ $u_{n}xyu_{n}xy$ & closed & $aabaab$ \\ \ldots & \ldots & \ldots \\ $u_{n}xyu_{n+1}=u_{n+1}yxu_n$ & closed & $aabaabaa$ \\ $u_{n+1}yxu_{n}y$ & open & $aabaabaaa$ \\ $u_{n+1}yxu_{n}yx$ & open & $aabaabaaab$ \\ \ldots & \ldots & \ldots \\ $u_{n+1}yxu_{n+1}$ & open & $aabaabaaabaa$ \\ $u_{n+1}yxu_{n+1}y$ & closed & $aabaabaaabaab$ \\ \hline \\ \end{tabular} \end{center} \caption{The structure of the prefixes of the standard Sturmian word $w=aabaabaaabaabaa\cdots$ with respect to the $u_{n}$ prefixes. Here $d_{0}=d_{1}=2$ and $d_{2}=1$.\label{tab:example}} \end{table} In Table \ref{tab:oc}, we show the first few elements of the sequence $\mathrm{oc}(w)$ for the standard Sturmian word $w=aabaabaaabaabaa\cdots$ of slope $\alpha=(9+\sqrt{5})/38=\left[0;3,2,\bar{1}\right]$, i.e., with $d_{0}=d_{1}=2$ and $d_{i}=1$ for every $i>1$. One can notice that the runs of closed prefixes are followed by runs of the same length of open prefixes. \begin{table}[ht] \begin{small} \begin{center} \begin{tabular}{r*{15}{@{\hspace{1.4em}}c}} $n$ & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline\\[-1ex] $w$ & $a$ & $a$ & $b$ & $a$ & $a$ & $b$ & $a$ & $a$ & $a$ & $b$ & $a$ & $a$ & $b$ & $a$ & $a$ \\ \hline \\[-1ex] $\mathrm{oc}(w)$ & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 1\\[0.5ex] \hline \\ \end{tabular} \end{center} \end{small} \caption{\label{tab:oc}The oc-sequence of the word $w= aabaabaaabaabaa\cdots$} \end{table} The words $u_{n}^{-1}u_{n+1}$ are reversals of standard words, for every $n\ge 1$. Indeed, let $r_n=\widetilde{s_n}$ for every $n\geq -1$, so that $r_{-1}=b$, $r_0=a$, and $r_{n+1}=r_{n-1}r_n^{d_n}$ for $n\geq 0$. Since by \eqref{eq:su} $s_{n}=u_{n}xy$ and $s_{n+1}=u_{n+1}yx$, one has $r_n=yxu_{n}$ and $r_{n+1}=xyu_{n+1}$, and therefore, by \eqref{eq:u}, \begin{equation}\label{eq:ur} u_{n}r_{n+1}=u_{n+1}r_{n}. \end{equation} Multiplying \eqref{eq:ur} on the left by $u_{n}^{-1}$ and on the right by $r_{n}^{-1}$, one obtains \begin{equation}\label{eq:prop} r_{n+1}r_n^{-1}=u_n^{-1}u_{n+1}. \end{equation} Since $r_{n+1}=r_{n-1}r_{n}^{d_{n}}$, one has that $r_{n+1}r_{n}^{-1}=r_{n-1}r_{n}^{d_{n}-1}$, and therefore $r_{n+1}r_{n}^{-1}$ is the reversal of a standard word. By \eqref{eq:prop}, $u_n^{-1}u_{n+1}$ is the reversal of a standard word. Now, note that for $n=0$, one has $u_{0}xyu_{1}=u_{1}yxu_{0}=a^{d_{0}}$ and $(u_{0}^{-1}u_{1})=ba^{d_{0}-1}$. Thus, we have the following: \begin{theorem} \label{theor:decomp} Let $w$ be the standard Sturmian word of slope $\alpha$, with $0<\alpha<1/2$, and let $[0;d_{0}+1,d_{1},\ldots]$, with $d_{0}>0$, be the continued fraction expansion of $\alpha$. The word $ba^{-1}w$, obtained from $w$ by replacing the first letter $a$ with the letter $b$, can be written as an infinite product of squares of reversed standard words in the following way: \[ba^{-1}w=\prod_{n\ge 0}(u_{n}^{-1}u_{n+1})^{2},\] where $(u_{n})_{n\ge -1}$ is the sequence defined in \eqref{eq:su}. In other words, one can write \[w=a^{d_{0}}ba^{d_{0}-1}\prod_{n\ge 1}(u_{n}^{-1}u_{n+1})^{2}.\] \end{theorem} \begin{example} Take the Fibonacci word. Then, $u_{1}=\epsilon$, $u_{2}=a$, $u_{3}=aba$, $u_{4}=abaaba$, $u_{5}=abaababaaba$, etc. So, $u_{1}^{-1}u_{2}=a$, $u_{2}^{-1}u_{3}=ba$, $u_{3}^{-1}u_{4}=aba$, $u_{4}^{-1}u_{5}=baaba$, etc. Indeed, $u_{n}^{-1}u_{n+1}$ is the reversal of the Fibonacci finite word $f_{n-1}$. By Theorem \ref{theor:decomp}, we have: \begin{eqnarray*} F &=& ab\prod_{n\ge 1}(u_{n}^{-1}u_{n+1})^{2}\\ &=& ab\prod_{n\ge 0}(\widetilde{f_{n}})^{2}\\ &=& ab\cdot (a\cdot a)(ba \cdot ba)(aba \cdot aba)(baaba\cdot baaba)\cdots \end{eqnarray*} i.e., $F$ can be obtained by concatenating $ab$ and the squares of the reversals of the finite Fibonacci words $f_n$ starting from $n=0$. Note that $F$ can also be obtained by concatenating the reversals of the finite Fibonacci words $f_n$ starting from $n=0$: \begin{eqnarray*} F &=& \prod_{n\ge 0} \widetilde{f_{n}}\\ &=& a \cdot ba \cdot aba \cdot baaba \cdot ababaaba \cdots \end{eqnarray*} and also by concatenating $ab$ and the finite Fibonacci words $f_n$ starting from $n=0$: \begin{eqnarray*} F &=& ab\prod_{n\ge 0} f_{n}\\ &=& ab \cdot a \cdot ab \cdot aba \cdot abaab \cdot abaababa \cdots \end{eqnarray*} For a survey on various factorizations of the Fibonacci infinite word that make use of finite Fibonacci words the reader can see \cite{Fi15}. \end{example} One can also characterize the oc-sequence of a standard Sturmian word $w$ in terms of the directive sequence of $w$. Recall that the \emph{continuants} of an integer sequence $(a_n)_{n\geq 0}$ are defined as $K\left[\ \, \right]=1$, $K\left[a_0\right]=a_0$, and, for every $n\geq 1$, \[K\left[a_0,\ldots,a_n\right]=a_nK\left[a_0,\ldots,a_{n-1}\right]+K\left[a_0,\ldots,a_{n-2}\right].\] Continuants are related to continued fractions, as the $n$-th convergent of $[a_0; a_1,a_2,\ldots]$ is equal to $K\left[a_0,\ldots, a_n\right]/K\left[a_1,\ldots, a_n\right]$. Let $w$ be a standard Sturmian word and $(s_n)_{n\ge -1}$ its standard sequence. Since $|s_{-1}|=|s_0|=1$ and, for every $n\ge 1$, $|s_{n+1}|=d_n|s_n|+|s_{n-1}|,$ then one has, by definition, that for every $n\geq 0$ \[|s_n|=K\left[1,d_0,\ldots, d_{n-1}\right].\] For more details on the relationships between continuants and Sturmian words the reader can see \cite{dL13}. By Theorems~\ref{thm:bdaries} and~\ref{theor:decomp}, all prefixes up to $a^{d_0}$ are closed; then all prefixes from $a^{d_0}b$ till $a^{d_0}ba^{d_0-1}$ are open, then closed up to $a^{d_0}ba^{d_0-1}\cdot u_1^{-1}u_2$, open again up to $a^{d_0}ba_{d_0-1}\cdot (u_1^{-1}u_2)^2$, and so on. Thus, the lengths of the successive runs of closed and open prefixes are: $d_0$, $d_0$, $|u_2|-|u_1|$, $|u_2|-|u_1|$, $|u_3|-|u_2|$, $|u_3|-|u_2|$, etc. Since $d_0=K\left[1,d_0-1\right]$ and, for every $n\geq 1$, \[ |u_{n+1}|-|u_n|= |s_{n+1}|-|s_n|=(d_n-1)|s_n|+|s_{n-1}| =K\left[1,d_0,\ldots,d_{n-1},d_n-1\right], \] we have the following: \begin{corollary}\label{cor:formula} Let $w$ be a standard Sturmian word of slope $\alpha=[0;d_0+1,d_1,\ldots]$ and let $k_n=K\left[1,d_0,\ldots,d_{n-1},d_n-1\right]$ for every $n\geq 0$. Then \[oc(w)=\prod_{n\geq 0}1^{k_n}0^{k_n}.\] \end{corollary} We now give a characterization of the prefixes of a standard Sturmian words in terms of the oc-sequence. \begin{theorem} \label{thm:ocst} Let $\mathrm{oc}(w)=1^{k_0}0^{k'_0}1^{k_1}0^{k'_1}\cdots 1^{k_{n}}0^{k'_{n}}1$. Then $w$ is a prefix of a standard Sturmian word if and only if $k_j=k'_j$ for every $0\leq j\leq n$. \end{theorem} We need the following lemma. \begin{lemma} \label{lem:qocc} Let $q$ be a central word and $\{x,y\}=\Sigma$. The word $(qxy)^\omega$ has infinitely many prefixes ending in $xq$, and each of them is a central word of the form $(qxy)^np=p(yxq)^n$ for some $n>0$ and a central word $p$. \end{lemma} \begin{proof} Let us consider the semicentral word $v=qxyq$. By Proposition~\ref{prop:qxyq}, $xq$ has exactly one (internal) occurrence in $v$. Therefore, the prefix $u$ of $v$ ending in $xq$ is a complete return to $q$ and hence it is closed, whereas the next prefix $uy$ of $v$ is open since $qy$ is not a prefix of $uy$. By Theorem~\ref{thm:bdaries}, it follows that $u$ is central, so that by Proposition~\ref{prop:PER} there exists a central word $p$ (shorter than $q$) such that $v=qxyp=pyxq$. Thus, since every occurrence of $xq$ within $(qxy)^\omega$ is contained in a factor $qxyq$, it follows that any prefix of $(qxy)^\omega$ ending in $xq$ can be written as \[(qxy)^np=(qxy)^{n-1}pyxq=\cdots=p(yxq)^n\,.\] for some integer $n>0$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:ocst}] The ``only if'' part follows from Corollary~\ref{cor:formula}. Let us prove the ``if'' part by induction on $n$. For $n=0$, the statement is easily verified. Let $\mathrm{oc}(w)=1^{k_0}0^{k_0}1^{k_1}0^{k_1}\cdots 1^{k_{n-1}}0^{k_{n-1}}1^{k_{n}}0^{k_{n}}1$ with $n>0$. By induction, we can suppose that the word $w'$ such that $\mathrm{oc}(w')=1^{k_0}0^{k_0}\cdots 1^{k_{n-1}}0^{k_{n-1}}1$ is a prefix of a standard Sturmian word. By Theorem \ref{thm:bdaries}, we can write $w'=qxyqx$, for a central word $q$ and distinct letters $x,y$. By Remark~\ref{rem:nth1}, any word $\hat w$ such that $\mathrm{oc}(\hat w)=\mathrm{oc}(w)$ is a complete return to its prefix $u$ of length $\sum_{i=0}^{n}k_i$. Since $|\hat w|=|w|=2\sum_{i=0}^{n}k_i+1$, it follows that $\hat w=u\xi u$ for some letter $\xi$. As $|qxyqx|=|w'|=2\sum_{i=0}^{n-1}k_i+1$, we have $|q|=\sum_{i=0}^{n-1}k_i-1$, so that $q$ is a prefix of $u$. Now, $\mathrm{oc}(u\xi q)=1^{k_0}0^{k_0}\dotsm 1^{k_{n-1}}0^{k_{n-1}}1^{k_n}$, so that by Lemma~\ref{lem:ce} the word $u\xi q$ has the same period as $w'$ and hence is uniquely determined. This shows that $\hat w=u\xi u=w$. Since $qx$ is a prefix of $u$, $u\xi qx$ is a prefix of $u\xi u$. As $\mathrm{oc}(u\xi qx)=1^{k_0}0^{k_0}\dotsm 1^{k_{n-1}}0^{k_{n-1}}1^{k_n}0$, by Lemma~\ref{lem:ce} the period of $u\xi qx$ is different from the one of $u\xi q$, i.e., $|qxy|$. This implies that $\xi=x$, since otherwise $yqx$ would be a suffix of $u\xi qx$, so that $u\xi qx$ would still have period $|qxy|$. By Lemma~\ref{lem:qocc}, $uxq$ is a central word that can be written as $uxq=(qxy)^jp=p(yxq)^j$ for some $j>0$ and a central word $p$. Hence we obtain $u=p(yxq)^{j-1}y$, so that \[w=uxu=p(yxq)^{j-1}yxp(yxq)^{j-1}y\,.\] Thus, $p(yxq)^{j-1}=(qxy)^{j-1}p$ is a central word $r$, and $w=ryxry$ is a prefix of the infinite word $(ryx)^\omega$. Therefore, by Lemma~\ref{lem:qocc}, $w$ is a prefix of a central word and hence a prefix of a standard Sturmian word. The proof is therefore complete. \end{proof} \section{Algorithms for the oc-sequence} In this section, we show a simple linear-time algorithm that, given a word $w$ over a finite alphabet $\Sigma$, computes its sequence $\mathrm{oc}(w)$, and a linear-time algorithm that, given the sequence $\mathrm{oc}(w)$ of a Sturmian word $w$, reconstructs $w$. Recall that the \emph{border array} $B(w)$ of the word $w$ is the sequence whose $i$-th entry is the length of the longest border of the prefix of length $i$ of $w$. For example, if $w=abcaacab$, then $B(w)=00011012$. We also define the array $B'(w)$ by $B'(w)[i]=\max_{j\leq i}B(w)[j]$. \begin{proposition}\label{prop:algo} Let $w$ be a nonempty word. Then $\mathrm{oc}(w)[1]=1$ and for every $i>0$, $\mathrm{oc}(w)[i]=B'(w)[i]-B'(w)[i-1]$. \end{proposition} \begin{proof} By definition of a closed word, $\mathrm{oc}(w)[i]=1$ if and only if the longest border of the prefix of $w$ of length $i$ is longer than the border of any shorter prefix. \end{proof} \noindent As an example, for the word $w=abcaacab$ over the alphabet $\{a,b,c\}$, we have $B'(w)=00011112$, and indeed $\mathrm{oc}(w)=10010001$. Since the border array of a word $w$ can be computed in linear time with respect to the length of $w$ \cite{MoPr70}, Proposition~\ref{prop:algo} gives a linear-time algorithm to compute $\mathrm{oc}(w)$. \medskip Suppose now that $w$ is a finite Sturmian word. By Theorem~\ref{theor:main}, it is possible to reconstruct $w$ from $\mathrm{oc}(w)$, up to isomorphisms of the alphabet $\Sigma=\{a,b\}$. In the following, we describe a linear-time algorithm (see Algorithm~\vref{alg:oc2s}) to do this. Without loss of generality, assume $w[1]=a$. In order to obtain the whole of $w$, it is then sufficient to calculate the border array $B$, as $B[i]<i$ and $w[i]=w[B[i]]$ hold for $i=2,\ldots,|w|$, provided that we extend $w$ to the left by setting $w[0]=b$ (see lines 6 and 21 in the algorithm). Now let $2\leq i\leq |w|$. \begin{itemize} \item If $\mathrm{oc}[i]=1$, by Proposition~\ref{prop:algo} it follows that $B[i]=B[i-1]+1$, i.e., the $i$-th letter is the one that keeps the minimal period fixed (lines 11--12). \item If $\mathrm{oc}[i]=0$ and $\mathrm{oc}[i-1]=1$, let $x=w[B[i-1]+1]$ and $\Sigma=\{x,y\}$. We must have $w[i]=y$ since otherwise $w[1\ldots i]$ would be a complete return to $vx$, with $v=w[1\ldots B[i-1]]$. We can then recover $B[i]$ by the standard procedure~\cite{MoPr70}; this amounts to searching for the longest border $u$ of $v$ that is followed by $y$ and then taking $B[i]=|uy|$, or choosing $B[i]=|\varepsilon|=0$ if no such $u$ exists (lines 14--20). \item For the next $0$s in a run, that is, when $\mathrm{oc}[i-1]=0$, we know that $v$ is a right special factor of $w[1\ldots i-1]$, and no other factor of length $|v|$ is right special. Therefore, up to the next occurrence of $v$, there is a unique letter $\xi$ that extends $w[1\ldots i-1]$ to a Sturmian word. It is well known that extending a Sturmian word by keeping the same period results in a Sturmian word (see for instance~\cite[Theorem~10]{DelDel06}); hence, if $v$ is not a suffix of $w[1\ldots i-1]$, i.e., when $B[i-1]<|v|$, the letter $\xi$ is obtained by letting $B[i]=B[i-1]+1$ (lines 11--12 again). When $B[i-1]=|v|$ and $\mathrm{oc}[i]=0$, the letter $\xi$ is necessarily $y$, so that the longest border of $w[1\ldots i]$ is again $uy$ or $\varepsilon$ (line 20). \end{itemize} \lstset{language=Pascal,columns=flexible,mathescape=true,morekeywords={return},% texcl,escapechar=`,commentstyle=\itshape\sffamil ,numbers=left,numberstyle=\scriptsize,xleftmargin=24pt} \begin{lstlisting}[float={bth},caption={Function ReconstructSturmianWord.},label=alg:oc2s,% belowcaptionskip=\medskipamount] function ReconstructSturmianWord($\mathrm{oc}$) {Input: array $\mathrm{oc}=\mathrm{oc}[1\ldots n]$ of some Sturmian word Output: the corresponding Sturmian word $w=w[1\ldots n]$ starting with $a$} begin $B$[0] := -1 ; $w$[0] := $b$ ; $B$[1] := 0 ; $w$[1] := $a$ ; ones := 0 ; for $i$ := 2 to $n$ do if $\mathrm{oc}[i]=1$ or $B[i-1]$ < ones then $B[i]$ := $B[i-1]+1$ ; else if $\mathrm{oc}[i-1]=1$ then ones := $B[i-1]$ ; $x$ := $w$[ones + 1] ; $j$ := $B$[ones] ; while $j\geq 0$ and $w[j+1] = x$ do $j$ := $B[j]$ ; $B[i]$ := $j+1$ ; $w[i]$ := $w[B[i]]$ ; return $w:=w[1\ldots n]$ ; end \end{lstlisting} \section{Conclusion and open problems} In this paper we focused on the oc-sequence of a word and exhibited results showing connections between this sequence and the combinatorics of the word. We mostly focused on Sturmian words, since these are characterized by their oc-sequence. Nevertheless, we believe that it may be interesting to also look at other classes of words. For example, in the case of the Tribonacci word $T=abacabaabacababacabaabac\cdots$, the sequence of the lengths of the runs of $1$ in $\mathrm{oc}(T)$ is exactly the Tribonacci sequence. We observed several regularities also in the oc-sequence of the Thue-Morse word, as well as in that of the regular paperfolding word. Another interesting problem is to understand, given a binary array $A$, whether there exists a word $w$ such that $\mathrm{oc}(w)=A.$ Some of the results in this paper provide necessary conditions, but the problem in general remains open.
{'timestamp': '2017-06-02T02:04:40', 'yymm': '1701', 'arxiv_id': '1701.01580', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01580'}
arxiv
\section{Introduction} Networks that describe real-world relationships often have different types of links that connect their nodes. For example, links in a social network may represent friendships, marriages, or collaborations, while links in a transportation network may represent planes, trains, or automobiles. Such networks are called multitype or multilayer networks since each type of link can be separated into its own layer, thereby connecting the same set of nodes in multiple ways. However, understanding the large-scale structure of multilayer networks is made difficult by the fact that the patterns of one type of link may be similar to, uncorrelated with, or different from the patterns of another type of link. These differences from layer to layer may exist at the level of individual links, connectivity patterns among groups of nodes, or even the hidden groups themselves to which each node belongs. Therefore, finding community structure in multilayer networks requires simultaneously considering three related problems: (i) the \emph{multilayer community detection problem}, in which we seek a description of the network that divides the nodes according to groups hidden in the link patterns of multiple layers; (ii) the \emph{layer interdependence problem}, in which we seek a description of the relationships between the layers containing different types of links; and (iii) the \emph{link prediction problem}, in which we seek to accurately predict missing link data by making use of all relevant layers of the network. These three problems are fundamentally intertwined. Multilayer community detection requires knowing which layers have related structure and which layers are unrelated, since redundant information across layers may provide stronger evidence for clear communities than each layer would on its own. However, measuring layer interdependence requires a working definition of interdependence and a method to measure it. The performance of a model or algorithm on the link prediction task provides exactly such a measure: specifically, whether it is possible to integrate information across layers, using links of one type to help predict those of another type. Thus, in settings where data are well-represented as a multilayer network, as is relevant in inferring genetic and protein-protein interactions in cells~\cite{costanzo2010}, characterizing interdependent infrastructures~\cite{rinaldi2001} and understanding the impact of different social ties in human relationships~\cite{verbrugge1979,wasserman1994}, we desire a model capable of recognizing interdependencies between layers, integrating and merging information between them, and using this information both to classify nodes and to predict links. In this paper we propose an approach that performs all three of these tasks. We define a generative model for multilayer community detection that is applicable to both directed and undirected networks, as well as networks with integer-weighted links. We provide a highly-scalable expectation-maximization algorithm that fits this model to data, taking as its input a multilayer network and yielding a ``mixed-membership'' partition: nodes are divided into communities or groups, but each node may belong to some extent to multiple groups. While this partition is shared by all the layers, the model allows for different connectivity patterns in each layer, including arbitrary mixtures of assortative, disassortative, and directed structure. In addition to classifying nodes, our model also makes link prediction possible: given an incomplete dataset where not all links are known, it assigns probabilities to each pair of nodes that they have an unobserved link of each type. Finally, by sequentially fitting the model to single layers and multiple layers, we show how to determine whether the information provided by additional layers improves link prediction performance, thereby quantifying layer interdependence. We show how to use this method to identify which layers of the network are redundant, and which provide independent information. For instance, we can identify small sets of layers which together capture most of the information about the network. This may be useful in contexts where gathering layers requires an investment of limited resources in the laboratory or the field---for instance, if a social scientist can ask their subjects a limited number of questions, identifying a limited number of types of social relationships. Community detection is a fundamental element of network science, yet most community detection algorithms have been developed for single-layer networks. We can use these methods to analyze multilayer networks, either by aggregating all layers to create a single-layer network~\cite{taylor2016,taylor2016enhanced} or by analyzing each layer independently. Multilayer-specific methods that maximize community quality functions such as modularity~\cite{mucha2010} provide non-overlapping partitions, but inherit the issues of their single-layer counterparts, namely a dependence on proper choice of a null model~\cite{bazzi2016,paul2016}. Moreover, these methods do not typically provide a framework to perform link prediction, since without additional assumptions they do not assign probabilities to the presence or absence of a link. More recent methods for multilayer community detection are based on fitting various generative models via Bayesian inference or maximum likelihood estimation~\cite{paul2015,peixoto2015,schein2014,schein2015,schein2016bayesian,valles2016multilayer}. Our algorithm falls into this category, but differs from most of these models by not assuming \textit{a priori} any specific network structure. Many network models assume \emph{assortative} or \emph{homophilic} community structure, meaning that nodes are more likely to be connected to others in the same community. This assumption is often incorrect in food webs, technological networks, and social networks where links consist of nominations, for instance, of a trustworthy or powerful person that they might ask for advice, help or work. Our model avoids this assumption: while it looks for an (overlapping) community structure that is consistent with every layer, it deals happily with networks where some layers are assortative, others are disassortative, yet others have core-periphery or directed structure, and so on. In the case of directed links, it also recognizes that nodes might play different roles, and thus effectively belong to different groups, when forming incoming or outgoing links. By measuring the extent to which one layer helps us predict links in another layer, our method also gives a mathematically principled way to measure the relationships between the layers of a multilayer network, including identifying layers which are redundant with others or highly independent from them. This problem arises even in naive algorithms that aggregate layers into a single-layer network. For instance, the multilayer versions of eigenvector centrality or modularity~\cite{mucha2010,sola2013} use weighted averages over layers, requiring them to infer or choose a weight for each layer. A number of recent works have taken a compression approach, aggregating layers with similar structure~\cite{de2015,stanley2015}; in particular, Ref.~\cite{stanley2015} uses a generative model that jointly assigns community memberships to nodes and groups of layers, which they call \emph{strata}. This is similar in spirit to our approach, but our model handles overlapping communities, directed networks, and weighted networks in a unified way. In Section~\ref{sec:model} we describe our model and in Section~\ref{sec:em} give an efficient algorithm that fits its parameters to network data. In Section \ref{sec:synthetic}, we provide performance results on synthetic benchmarks and compare with other algorithms, and in Section \ref{sec:linkpr} we discuss how to perform link prediction and measure layer interdependencies. We then apply these concepts to two real world networks, drawn from anthropology and biology, and discuss the results in Section \ref{sec:results} before concluding. \section{The multilayer mixed-membership stochastic block model} \label{sec:model} In this section we describe our model and fix our notation. The network consists of $N$ nodes and has $L$ layers. Each layer has an adjacency matrix $A^{(\alpha)}$, where $A_{ij}^{(\alpha)}$ is the number of edges from $i$ to $j$ of type $\alpha$; alternatively, we can think of $A$ as an $N \times N \times L$ tensor. Our model generates these networks probabilistically, assuming an underlying structure consisting of $K$ overlapping groups. Each node belongs to each group to an extent described by a $K$-dimensional vector. Since we are interested in directed networks, we give each node $i$ two membership vectors, $\vec{u}_i$ and $\vec{v}_i$, which determine how $i$ forms outgoing and incoming links respectively. (When modeling undirected networks, we set $\vec{u}=\vec{v}$.) Each layer $\alpha$ has a $K \times K$ affinity matrix $w^{(\alpha)}$ describing the density of edges between each pair of groups. The expected number of edges in layer $\alpha$ from $i$ to $j$ is then given by a bilinear form, \be M_{ij}^{(\alpha)} = \sum_{k,\ell=1}^K u_{ik} \,v_{j\ell} \,w_{k\ell}^{(\alpha)} \, . \ee Finally, for each $i, j$ and $\alpha$, we choose $A_{ij}^{(\alpha)}$ independently from the Poisson distribution with mean $M_{ij}^{(\alpha)}$. Note that while we assume that the membership vectors have nonnegative entries, we do not normalize them. This allows us to account easily for heterogeneous degree distributions, since multiplying $\vec{u}_i$ or $\vec{v}_i$ by a constant increases the expected out- or in-degree without changing the distribution of neighbors to which a given one of $i$'s edges connects. Note also that while this model supposes that nodes have the same group membership in all layers, it allows the structure of each layer to vary arbitrarily with respect to these groups. For instance, some layers could be assortative and others disassortative, with affinity matrices $w^{(\alpha)}$ which are large on or off the diagonal; other layers could have strongly directed structure, with asymmetric $w^{(\alpha)}$, or core-periphery structure, where $w^{(\alpha)}$ has one large entry on the diagonal. For a single layer, our model is similar to existing mixed-membership block models~\cite{newman2007,airoldi2008,ramasco2008,ball2011,gopalan2013,yang2014,zhou2015}. Some of these use mixtures of Bernoulli random variables; we follow~\cite{ball2011} in using the Poisson distribution since it leads to a tractable and efficient expectation-maximization algorithm. The Poisson distribution also allows us to model multigraphs or integer-weighted networks. However, in our applications here we will focus on the sparse case where $M_{ij}^{(\alpha)}$ is small, and assume for simplicity that $A_{ij}^{(\alpha)}$ is $0$ or $1$. Our model also bears a close mathematical relationship to topic models~\cite{PLSA,LDA}, which generate bipartite weighted graphs of documents and words based on their relevance to mixtures of topics. More generally, it can be viewed as a variant of non-negative tensor factorization (see e.g.~\cite{Kolda2009} for a review) and in particular of Poisson tensor factorization~\cite{lee1999,canny2004,dunson2005,cemgil2009,gopalan-rec,schein2014,schein2015,chi2012tensors}. However, the affinity matrices $w^{(\alpha)}$, which allow different layers to be assortative or disassortative, correspond to a kind of Tucker decomposition~\cite{TUCKER2} of tensor rank $K^2$. This is more general than the PARAFAC/CANDECOMP decomposition~\cite{PARAFAC,CANDECOMP}, which corresponds to the special case of our model where $w^{(\alpha)}$ is diagonal for each $\alpha$. In the undirected case where $\vec{u}=\vec{v}$, PARAFAC thus assumes a purely assortative structure, where a link between two nodes can only exist if their membership vectors overlap. Various kinds of Poisson Tucker decomposition for dynamic and multilayer networks have also been proposed very recently in the machine learning community, particularly in~\cite{schein2014,schein2015,schein2016bayesian}. Indeed, our model is very nearly a special case of that of~\cite{schein2016bayesian}, which has additional parameters intended to model datasets with both multiple types of links and multiple time steps. The main difference between these works and our approach is that they impose priors on the ``core tensor'' parameters [analogous to $w^{(\alpha)}_{k\ell}$] and they use Monte Carlo sampling for Bayesian inference. In contrast, we find point estimates of these parameters using an expectation-maximization algorithm, detailed in the next section. Below we compare our results to the algorithm of~\cite{schein2015}, which is designed for the same kinds of datasets as ours. \section{The Expectation-Maximization algorithm} \label{sec:em} Given an observed multilayer network with adjacency tensor $A$, our goal is to simultaneously infer the nodes' membership vectors and the affinity matrices for each layer. In this section, we describe an efficient algorithm which does this by the method of maximum likelihood. Let $\Theta$ be shorthand for all $2NK+K^2 L$ model parameters, i.e., the $u_{ik}$, $v_{i\ell}$, and $w_{k\ell}^{(\alpha)}$. Assuming that all $\Theta$ are equally likely \textit{a priori}, the probability of $\Theta$ given $A$ is proportional to the probability of $A$ given $\Theta$. Using the Poisson distribution function gives \be P(\Theta \mid A) \propto P(A \mid \Theta) = \prod_{i,j=1}^{N} \prod_{\alpha=1}^L \frac{\mathrm{e}^{-M_{ij}^{(\alpha)}} (M_{ij}^{(\alpha)})^{A_{ij}^{(\alpha)}}}{A_{ij}^{\alpha}!} \label{eq:likelihood} \ee (One could also impose a prior $P(\Theta)$ and perform maximum \textit{a posteriori} inference~\cite{dunson2005,cemgil2009,schein2015}, but we have not done this here.) The log-likelihood is then \be \L(\Theta) = \sum_{i,j,\alpha} \left[ A_{ij}^{(\alpha)} \log \sum_{k\ell} u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} - \sum_{k\ell} u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} \right] \label{logL} \ee where we omit the terms $\log A_{ij}^{(\alpha)}!$ since they depend only on the data. We wish to find the $\Theta$ that maximizes Eq.~\eqref{logL}. This is computationally difficult, but we can make it more tractable with a classic variational approach. For each $i,j,\alpha$ with $A_{ij}^{(\alpha)} = 1$, consider a probability distribution $\rho_{ijk\ell}^{(\alpha)}$ over pairs of groups $k,\ell$: this is our estimate of the probability that that edge exists due to $i$ and $j$ belonging to groups $k$ and $\ell$ respectively. (If the network is a multigraph and $i,j$ have multiple links of the same type, we give each one its own distribution $\rho$; below we assume for simplicity that this does not occur.) Jensen's inequality $\log \overline{x} \ge \overline{\log x}$ then gives \begin{align} \log \sum_{k\ell} &u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} = \log \sum_{k\ell} \rho_{ijk\ell}^{(\alpha)} \frac{u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)}}{\rho_{ijk\ell}^{(\alpha)}} \nonumber \\ &\ge \sum_{k\ell} \rho_{ijk\ell}^{(\alpha)} \log \frac{u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)}}{\rho_{ijk\ell}^{(\alpha)}} \nonumber \\ &= \sum_{k\ell} \rho_{ijk\ell}^{(\alpha)} \log u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} - \sum_{k\ell} \rho_{ijk\ell}^{(\alpha)} \log \rho_{ijk\ell}^{(\alpha)} \, . \label{eq:variational} \end{align} Moreover, this holds with equality when \begin{equation} \label{eq:boltzmann} \rho_{ijk\ell}^{(\alpha)} = \frac{u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} }{\sum_{k'\ell'} u_{ik'} v_{j\ell'} w_{k'\ell'}^{(\alpha)} } \, . \end{equation} Thus maximizing $\L(\Theta)$ is equivalent to maximizing \begin{align} \L(\Theta,\rho) &= \sum_{i,j,\alpha,k,\ell} \Big[ A_{ij}^{(\alpha)} \left( \rho_{ijk\ell}^{(\alpha)} \log u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} - \rho_{ijk\ell}^{(\alpha)} \log \rho_{ijk\ell}^{(\alpha)} \right) \nonumber \\ & \quad - u_{ik} v_{j\ell} w_{k\ell}^{(\alpha)} \Big] \end{align} with respect to both $\Theta$ and $\rho$. The expert reader will recognize that this variational argument is simply classical thermodynamics in disguise. Fix the parameters $\Theta$ and consider a spin system where each edge, i.e., each triple $(i,j,\alpha)$ with $A_{ij}^{(\alpha)} = 1$, has a state consisting of a pair of groups $(k,\ell)$. Define the Hamiltonian as \begin{align*} H &= - \sum_{(i,j,\alpha): A_{ij}^{(\alpha)}=1} \log u_{ik(i,j,\alpha)} v_{j\ell(i,j,\alpha)} w_{k(i,j,\alpha),\ell(i,j,\alpha)}^{(\alpha)} \\ & \quad - \sum_{i,j,\alpha,k',\ell'} u_{ik'} v_{j\ell'} w_{k'\ell'}^{(\alpha)} \end{align*} (note that the second term is constant). Then the Boltzmann distribution is a product distribution of the distributions $\rho_{ij}^{(\alpha)}$ given by Eq.~\eqref{eq:boltzmann} on each edge. Moreover, $-\L(\Theta,\rho)$ is the free energy $E-TS$ where $T=1$, and we recover the familiar fact that this is minimized by the Boltzmann distribution. In this context, finding the maximum-likelihood estimate of the parameters $\Theta$ corresponds to minimizing the free energy of this spin system. We can maximize $\L(\Theta,\rho)$ by alternatively updating $\rho$ and $\Theta$. This general approach is called an expectation-maximization (EM) algorithm: the expectation step computes the marginals of the Boltzmann distribution for the current estimate of the parameters, and the maximization step finds the most-likely value of the parameters given those marginals. The fact that the Boltzmann distribution takes a simple product form makes the expectation step especially simple, making the algorithm highly efficient. The update equations for $\Theta$ in the maximization step can be can be derived by computing the partial derivative of $\L(\Theta,\rho)$ with respect to the various parameters. For instance, \be \frac{\partial \L(A,\rho)}{\partial u_{ik}} = \sum_{j,\ell,\alpha} \left[ \frac{A_{ij}^{(\alpha)}\, \rho_{ijk\ell}^{(\alpha)}}{u_{ik}} - v_{j\ell} w_{k\ell}^{(\alpha)} \right] \, . \ee Setting this to zero, and doing the same for the partial derivatives with respect to $v_{j\ell}$ and $w_{k\ell}^{(\alpha)}$, gives \begin{gather} {u}_{ik} = \frac{\sum_{j,\alpha} A_{ij}^{(\alpha)} \sum_\ell \rho_{ijk\ell}^{(\alpha)}} {\sum_\ell \left( \sum_{j} v_{j\ell} \right) \left( \sum_{\alpha} w_{k\ell}^{(\alpha)} \right)} \label{uik_dis} \\ {v}_{j\ell} = \frac{\sum_{i,\alpha} A_{ij}^{(\alpha)} \sum_k \rho_{ijk\ell}^{(\alpha)}} {\sum_k \left( \sum_i u_{ik} \right) \left( \sum_{\alpha} w_{k\ell}^{(\alpha)} \right)} \label{vjk_dis} \\ {w}_{k\ell}^{(\alpha)}= \f{\sum_{ij}A_{ij}^{(\alpha)} \rho_{ijk\ell}^{(\alpha)}}{\left(\sum_i u_{ik} \right) \left( \sum_j v_{j\ell} \right)} \label{omegaka_dis} \, . \end{gather} The EM algorithm thus consists of randomly initializing the parameters $\Theta$, and then repeatedly alternating between updating $\rho$ using Eq.~\eqref{eq:boltzmann} and updating $\Theta$ using Eqs.~\eqref{uik_dis}-\eqref{omegaka_dis} until it reaches a fixed point. This fixed point is a local maximum of $\L(\Theta,\rho)$, but it is not guaranteed to be the global maximum. Therefore, we perform multiple runs of the algorithm with different random initializations for $\Theta$, taking the fixed point with the largest value of $\L(\Theta,\rho)$. The computational complexity per iteration scales as $O(MK^2)$ where $M$ is the total number of edges summed over all layers and $K$ is the number of groups. In practice we find that our algorithm converges within a fairly small number of iterations. Thus it is highly scalable, with a total running time roughly linear in the size of the dataset. Once we converge to a fixed point, we can assign nodes to communities by normalizing the membership vectors to $\b{u}_i = u_i / \sum_k u_{ik}$, so that for each $i$ we have $\sum_k \b{u}_{ik} = 1$. This approach was used in~\cite{ball2011} as an method for classifying nodes in overlapping communities; however, since we allow $\vec{u}_i$ and $\vec{v}_i$ to be distinct, the ``outgoing'' and ``incoming'' assignments of a node might differ. These are \emph{soft} assignments, meaning that nodes can belong to more than one community. If one wishes to obtain a \emph{hard} assignment, one can assign each node to the single community corresponding to the maximum entry of $\vec{u}$ or $\vec{v}$, but the overlapping character of the community structure is then lost. We call our model and its associated algorithm \mbox{{\small MULTITENSOR}}. A numerical implementation is available for use under an open source license \footnote{Code available at \href{https://github.com/cdebacco/{\small MULTITENSOR}}{github.com/cdebacco/{\small MULTITENSOR}}}. \section{Results on synthetic networks} \label{sec:synthetic} We tested {\small {\small MULTITENSOR}}'s ability to detect community structure synthetic networks using the multilayer benchmark proposed in Ref.~\cite{bazzi2016}. This model is somewhat different from ours: rather than having mixed-membership vectors that are the same in every layer, they use hard partitions where each node belongs to a single group, but they allow these partitions to vary from layer to layer. The partitions in different layers are correlated by a so-called layer interdependence tensor. For simplicity, we use a one-parameter version of this tensor with dependency $p \in [0,1]$: when $p=0$ the partitions between layers are independent, and when $p=1$ they are identical. Once these partitions are chosen, they generate edges in each layer according to a degree-corrected block model~\cite{karrer2011}, with a user-specified degree distribution and affinity matrix. We used this benchmark to generate synthetic networks with $N=300$ nodes, $L=4$ layers, and $K=5$ communities. For each layer we used a truncated power-law degree distribution with exponent $\gamma =-3$, minimum degree $k_{min}=3$ and maximum degree $k_{max}=30$. We varied the affinity matrix of the block model according to a mixing parameter $\mu$: if $\mu=0$ all edges lie within communities, and if $\mu=1$ edges are assigned regardless of the community structure. We define our algorithm's accuracy on these benchmarks in terms of how well the inferred membership vectors match the ground-truth distribution of memberships across layers. That is, we hope that, after normalizing so that $\sum_k \b{u}_{ik}=1$, each $u_{ik}$ is close to the fraction of layers in which node $i$ belongs to group $k$, which we denote $\b{u}^0_{ik}$. We quantify the similarity between these two distributions using two measures. The first is their inner product, often called the \emph{cosine similarity} (CS), averaged over all the nodes: \be\label{CS} \mathrm{\mathrm{CS}} = \frac{1}{N} \sum_{i=1}^{N} \frac{\b{u}^0_i \cdot \b{u}_i}{| \b{u}^0_i | | \b{u}_i |} \, , \ee where in the denominator $| \b{u} |$ denotes the Euclidean norm. Here $\mathrm{CS}=1$ corresponds to perfect accuracy. The second is the $L_1$ error between the two distributions, also known as their statistical distance or total variation distance, averaged over all the nodes: \be\label{L1} L_1 = \frac{1}{2N} \sum_{i=1}^{N} \left\| \b{u}^0_i - \b{u}_i \right\|_1 = \frac{1}{2N} \sum_{i=1}^{N} \sum_{k=1}^{K} \left| \b{u}^0_{ik} - \b{u}_{ik} \right| \, . \ee The factor of $1/2$ is used so that this distance ranges from $0$ for identical distributions to $1$ for distributions with disjoint support. In both measures, we give ourselves the freedom to permute the groups, so that the inferred groups of our model correspond to the groups of the benchmark. Thus we maximize the cosine similarity $\mathrm{CS}$, and minimize the $L_1$ error, over all $K!$ permutations of the $K$ groups. For comparison, we use two other algorithms that infer overlapping multilayer partitions. The first is the restricted diagonal version of our model, which only allows diagonal affinity matrices $w^{(\alpha)}$; as discussed above, this is equivalent to the Poisson version of PARAFAC tensor factorization~\cite{chi2012tensors} and in the undirected case $\vec{u}=\vec{v}$ this corresponds to assume an assortative network structure. The second algorithm is a fully Bayesian Poisson tensor factorization (BPTF)~\cite{schein2015}. The main differences between these two models are the prior information and the optimization approach. The former considers a uniform prior and calculates point estimates of the parameters using an iterative algorithm similar to ours. The BPTF algorithm instead assumes Gamma-distributed parameters and updates the parameters of these distributions instead of the point estimates; in the end it uses the geometric mean of these distributions as its estimate of the parameters. \begin{table*}[ht] \begin{tabular}{lccccccccccccccccccccccc} \toprule \multirow{2}{4em}{$\mu=0.0$ } & \multicolumn{4}{c}{$p=0.5$} && \multicolumn{4}{c}{$p=0.8$} && \multicolumn{4}{c}{$p=0.9$} \\ \cmidrule(l){2-5} \cmidrule(l){7-10} \cmidrule(l){12-15} & CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ \\ \hline {\footnotesize MULTITENSOR} & \bf{ 0.66} & 0.06 & 0.58 & 0.07 && \bf{ 0.93} & 0.07 & \bf{ 0.19} & 0.09 && \bf{ 0.99} & 0.01 & \bf{ 0.07} & 0.01 \\ Diagonal & 0.65 & 0.05 & 0.60 & 0.06 && 0.84 & 0.06 & 0.31 & 0.08 && 0.97 & 0.04 & 0.10 & 0.05\\ BPTF & \bf{ 0.66} & 0.06 & \bf{ 0.57} & 0.06 && 0.89 & 0.07 & 0.24 & 0.08 && 0.96 & 0.03 & 0.10 & 0.04 \\ \end{tabular} \vspace{0.01in} \begin{tabular}{lccccccccccccccccccccccc} \toprule \multirow{2}{4em}{$\mu=0.1$ } & \multicolumn{4}{c}{$p=0.5$} && \multicolumn{4}{c}{$p=0.8$} && \multicolumn{4}{c}{$p=0.9$} \\ \cmidrule(l){2-5} \cmidrule(l){7-10} \cmidrule(l){12-15} & CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ \\ \hline {\footnotesize MULTITENSOR} &\bf{ 0.63} & 0.05 & 0.62 & 0.05 && \bf{ 0.92} & 0.06 & \bf{ 0.22} & 0.08 && \bf{ 0.98} & 0.01 & \bf{ 0.11} & 0.01 \\ Diagonal & \bf{ 0.63} & 0.04 & 0.62 & 0.04 && 0.87 & 0.06 & 0.29 & 0.07 && 0.94 & 0.07 & 0.17 & 0.08\\ BPTF & 0.62 & 0.06 &\bf{ 0.61} & 0.05 && 0.84 & 0.07 & 0.32 & 0.08 && 0.93 & 0.06 & 0.18 & 0.07 \\ \end{tabular} \vspace{0.01in} \begin{tabular}{lccccccccccccccccccccccc} \toprule \multirow{2}{4em}{$\mu=0.5$ } & \multicolumn{4}{c}{$p=0.5$} && \multicolumn{4}{c}{$p=0.8$} && \multicolumn{4}{c}{$p=0.9$} \\ \cmidrule(l){2-5} \cmidrule(l){7-10} \cmidrule(l){12-15} & CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ \\ \hline {\footnotesize MULTITENSOR} &\bf{ 0.55} & 0.03 & 0.70 & 0.02 && \bf{ 0.55} & 0.05 & \bf{ 0.67} & 0.04 && \bf{ 0.59} & 0.07 & 0.59 & 0.07 \\ Diagonal & \bf{ 0.55} & 0.03 & 0.71 & 0.02 && 0.53 & 0.03 & 0.69 & 0.03 && 0.58 & 0.07 & 0.63 & 0.06 \\ BPTF & 0.52 & 0.03 & \bf{ 0.69 }& 0.03 && 0.49 & 0.05 & 0.68 & 0.04 && \bf{ 0.59} & 0.07 & \bf{ 0.58} & 0.06 \\ \bottomrule \end{tabular} \caption{Performance in detecting overlapping partitions on synthetic networks, using our {\small MULTITENSOR} algorithm, the diagonal special case which corresponds to the Poisson version of PARAFAC tensor decomposition~\cite{chi2012tensors}, and Bayesian Poisson Tensor Factorization~\cite{schein2015}. Benchmark networks were generated with the model of~\cite{bazzi2016} with interdependence $p$ and mixing parameter $\mu$: the community structure is stronger when $p$ is large and $\mu$ is small. For each $(\mu,p)$ pair we measure the cosine similarity (CS) and the average $L_1$ error between the planted and inferred structure averaged over $50$ independently generated benchmark networks. For each network, we run each network $50$ times with independently random initializations, and use the parameters given by the highest-likelihood fixed point. Good performance corresponds to high cosine similarly and low $L_1$ error, and the best performance for each pair of parameter values is indicated by boldface. The errors $\sigma$ are the standard deviation over the 50 benchmarks.} \label{table:sim} \end{table*} In Table~\ref{table:sim} we report the best results in terms of cosine similarity and $L_1$ error obtained by three algorithms: {\small MULTITENSOR}, its diagonal special case (or Poisson PARAFAC), and BPTF. By varying the layer interdependence $p$ and the mixing parameter $\mu$, we range over cases where the community structure is relatively easy to infer to those where it is much harder. Specifically, inference is easier when $p$ is large, so that the layers are strongly correlated, and $\mu$ is small, so that most links are within communities. For each pair $(\mu,p)$ we generated $50$ independent benchmark networks, and for each network and each algorithm we performed 50 independent runs with independently random initial conditions, taking the fixed point with highest likelihood. We defined convergence numerically by testing whether $\L(\Theta,\rho)$ has not improved by more than $0.1$ for $10$ iterations. In every case our algorithm achieves the highest cosine similarity, and in the majority of the cases the smallest $L_1$ error, indicated in boldface. All three algorithms perform poorly in the hard regime where one of the two parameters introduces a high level of stochasticity in the network, i.e. when either $\mu=0.5$ or $p=0.5$. In the other cases our algorithm is significantly better according to both measures. The benchmarks of~\cite{bazzi2016} are assortative in every layer, and the diagonal and BPTF algorithms work fairly well. To illustrate the greater flexibility of our algorithm, we also generated synthetic networks with different kinds of structure in different layers.. Specifically, we generated layers whose structures are assortative ($w_{11} = w_{22} > w_{12} = w_{21}$), disassortative ($w_{11} = w_{22} < w_{12} = w_{21}$), core-periphery ($w_{11} > w_{12} = w_{21} > w_{22}$), and directed with a bias from the first group to the second one ($w_{12} > w_{11} = w_{22} > w_{21}$). We considered three types of networks, all having $K=2$ groups and $N=300$ nodes, but with different numbers and kinds of layers (see Table \ref{table:AucSynthetic}). In each one the groups are of equal size, with un-mixed group memberships (i.e., $u_i = v_i = (0,1)$ or $(1,0)$). The first type of network has $L=2$ layers, one assortative and one disassortative; the second network has $L=4$, with two assortative and two disassortative layers; the last one has $L=4$, with one layer each with assortative, disassortative, core-periphery, and biased directed structure. We generated $10$ independent samples of each of these types of network and calculated the CS and the $L_{1}$ norm between the inferred membership and the ground truth using the maximum-likelihood fixed point over $10$ runs of each algorithm with different random initial conditions. As shown in Table \ref{table:synCSL1}, {\small MULTITENSOR} achieves significantly greater performance than the diagonal or BPTF algorithms in all three cases, due to its flexibility in modeling mixtures of these different types of structure. \begin{table}[htbp] \resizebox{1.0\linewidth}{!}{ \begin{tabular}{lccccc} \toprule G & K & L & $\langle E \rangle$ & Structure \\ \hline 1 & 2 & 2 & 1980 & \{assort, disassort\} \\ 2 & 2 & 4 & 3960,2250 & \{assort, disassort, core-per, dir. disassort\} \\ 3 & 2 & 4 & 1980 & \{2 assort, 2 disassort\} \\ \bottomrule \end{tabular} } \caption{ Description of synthetic network structures. $\langle E \rangle$ is the average number of edges per layer, all networks have $N=300$ nodes. For networks $G=1,3$ we used affinity matrices $W^{a}$ and $W^{d}$ for the assortative and disassortative layers respectively, with entries $w_{11}^{a}=w_{22}^{a}=w_{12}^{d}=w_{21}^{d}= 0.04$, $w_{12}^{a}=w_{21}^{a}=w_{11}^{d}=w_{22}^{d}=0.004$ so that $\langle E \rangle=1980$; for $G=2$ the first two layers (1 assortative and 1 disassortative) have affinity matrices $W^{a}$ and $W^{b}$ with entries $w_{11}^{a}=w_{22}^{a}=w_{12}^{b}=w_{21}^{b}= 0.08$, $w_{12}^{a}=w_{21}^{a}=w_{11}^{b}=w_{22}^{b}=0.008$ so that $\langle E \rangle=3960$; the third and fourth (1 core-periphery and 1 directed disassortative) have affinity matrices $W^{c}$ and $W^{d}$ with entries $w_{11}^{c}=w_{12}^{d}=0.08$, $w_{12}^{c}=w_{21}^{c}=w_{11}^{d}=w_{22}^{d}=0.008$ and $w_{22}^{c}=w_{21}^{d}=0.004$ so that $\langle E \rangle=2250$.} \label{table:AucSynthetic} \end{table} \begin{table*}[ht] \begin{tabular}{lcccccccccccccccccccccccc} \toprule \multirow{2}{4em}{ } & \multicolumn{4}{c}{$G=1$} && \multicolumn{4}{c}{$G=2$} && \multicolumn{4}{c}{$G=3$} \\ \cmidrule(l){2-5} \cmidrule(l){7-10} \cmidrule(l){12-15} & CS & $\sigma$ &$L_{1}$ &$\sigma$ && CS & $\sigma$ &$L_{1}$ &$\sigma$ &&CS & $\sigma$ &$L_{1}$ &$\sigma$ \\ \hline {\footnotesize MULTITENSOR} & \textbf{0.984} & 0.008 & \textbf{0.06} & 0.01 && \textbf{0.990} & 0.001 & \textbf{0.058} & 0.003 && \textbf{0.989} & 0.001 & \textbf{0.056} & 0.002 \\ Diagonal & 0.61 & 0.01 & 0.49 & 0.01 && 0.91 & 0.01 & 0.22 & 0.01 && 0.63 & 0.02 & 0.48 & 0.01 \\ BPTF & 0.60 & 0.02 & 0.48 & 0.01&& 0.90 & 0.03 & 0.21 & 0.05 && 0.63 & 0.03 & 0.48 & 0.01 \\ \bottomrule \end{tabular} \caption{Cosine similarity and $L_{1}$ norm for mixed structure synthetic networks. CS as in Eq. (\ref{CS}) and $L_{1}$ norm as in Eq. (\ref{L1}) are calculated between membership vectors $\b{u}$, $\b{v}$ of the inferred partitions and the ground truth [$\b{u}_{0}=\b{v}_{0}=(1,0),\,(0,1)$ for nodes in group 1 and 2, respectively]. Results are averages and standard deviations of the results on the two memberships over 10 networks sampled from each network type $G$, as described in Table \ref{table:AucSynthetic}. The best performance is indicated in boldface. } \label{table:synCSL1} \end{table*} \section{Learning layer interdependence via link prediction} \label{sec:linkpr} Despite the fact that a network may have multiple layers, there is no guarantee that the structure of one layer is related to the structure of any other. In fact, depending on the context, it may even be desirable that two layers are entirely uncorrelated, since then they reveal different kinds of information about the underlying structure. The \emph{layer interdependence problem} consists of identifying which sets of layers are structurally related, and quantifying the strengths of those interrelationships. We are not the first to provide a solution to the layer interdependence problem. One intuitive approach is to independently infer the community structure of each layer and then simply compute pairwise correlations between the community partitions of each layer~\cite{larremore2013}. While this approach is straightforward, it is unable to use the information in some layers to assist with inference of structure in other layers, since every layer is treated independently. Another approach has been to cluster the inferred affinity matrices, analogous to our $w^{(\alpha)}$, during the parameter inference and estimation procedures, thus gathering layers into ``strata''~\cite{stanley2015}. However, while we also explore clustering the $w^{(\alpha)}$ below, neither of these methods captures the general kind of independence we are interested in. For instance, if two layers use the same group labels for the vertices, but one layer is assortative while the other is disassortative, then knowing one of them is very helpful in predicting the other. In this sense they are closely related, even though they are statistically very different, and indeed anticorrelated with each other. Our proposal to capture this more general kind of interdependence is based on the idea that two layers are interdependent if and only if the structure of one layer provides meaningful knowledge about the structure of the other. Specifically, by performing link prediction in one layer with or without information about another layer, we quantify the extent to which these two layers are related. Since our model is generative, it naturally includes a framework to predict links given partially-observed data: simply use the known data to estimate the parameters, and then use these estimated parameters to compute $M_{ij}^{(\alpha)}$, i.e., the expected number of links of type $\alpha$ between each pair of nodes $i,j$. We then rank each missing entry in the adjacency tensor according to $M_{ij}^{(\alpha)}$. The method succeeds to the extent that true missing links are given a higher estimate of $M_{ij}^{(\alpha)}$ than false ones. We follow~\cite{Clauset2008} in defining the accuracy as the area under the receiver-operator curve or AUC~\cite{hanley1982}. This is the probability that a random true positive is ranked above a random true negative; thus the AUC is $1$ for perfect prediction, and $1/2$ for chance. To test our ability to predict layer $\alpha$, we perform experiments with $5$-fold cross validation. That is, we hold out $20\%$ of its adjacency matrix $A^{(\alpha)}$, hiding those entries from the algorithm. We infer the model parameters using the remaining $80\%$ as a training dataset, with or without knowledge of other layers of the network, and measure the inferred model's accuracy on the held-out entries in $A^{(\alpha)}$. The independence of the training and test datasets makes cross-validation a robust method against overfitting. Note that holding out $20\%$ of a layer does not mean removing 20\% of the nodes or 20\% of the links, but rather hiding 20\% of the entries of its adjacency matrix, including both zeros and ones. This means that we just the accuracy of our link prediction algorithm on both links and non-links. The final AUC is the average obtained over the $5$ folds, each of which holds out a different subset of $20\%$. Clearly this AUC depends both on the layer $\alpha$ we are trying to predict, and on what set of other layers we give the algorithm access to. Given this framework, we can define the pairwise interdependence between two layers $\alpha, \beta$ as follows. We perform link prediction on layer $\alpha$, with $20\%$ of the entries of $A^{(\alpha)}$ hidden; but we do this first by giving the algorithm access only to the rest of $A^{(\alpha)}$, and then by giving it access to all of $A^{(\beta)}$ as well. We then measure the difference in the AUC between these two experiments, determining how much knowledge about layer $\beta$ helps us predict layer $\alpha$. We call this the \emph{two-layer AUC}. Similarly, the \textit{three-layer AUC} tells us how much knowledge about two layers $\beta$ and $\gamma$ help us predict $\alpha$, and so on. Notice that if different layers have independent structure, without common underlying communities, then including one in the training set much actually decreases our ability to predict the other, causing the AUC to go down. Computing all \textit{$\ell$-layer AUCs} would require us to try ${L \choose \ell}$ subsets of the layers, which becomes computationally expensive as $\ell$ increases. To avoid this computational bottleneck, we use a greedy bottom-up procedure in which we add one layer at a time to the training dataset, whichever one most increases the AUC, until as many layers as desired have been added. This allows us to find a small set of layers which together make it possible to predict links accurately. While this greedy procedure is not guaranteed to find the best possible subset of a given size, it is computationally efficient. Alternatively, if the goal is to decide which layers are less informative in predicting the others, in order for instance to compress information by discarding less informative layers, we can use a top-down procedure which starts with all $L$ layers, then iteratively removes whichever one decreases the AUC the least, until a small informative subset of layers remains. We did not pursue this here. In addition to this link prediction approach, we also cluster the affinity matrices $w^{(\alpha)}$ in a way similar to~\cite{stanley2015}. That is, we treat the inferred $w^{(\alpha)}$ as $K^2$-dimensional vectors, and cluster them in $K^2$-dimensional space using the $k$-means algorithm. Results for both notions of layer interdependence are shown in the following section. \begin{table}[htbp] \begin{tabular}{lcccccccccc} \toprule Network & K & {\small MULTITENSOR} & Diagonal & BPTF \\ \hline Te\underbar npa\d t\d ti Village & 4 & \textbf{0.89}& 0.88 & 0.87\\ A\underbar lak\= apuram Vill. & 6 & \textbf{0.93} & 0.92 & 0.91 \\ Malaria & 3 & \textbf{0.83} & 0.82 & 0.82 \\ Malaria & 5 & \textbf{0.86}& 0.85 & 0.85 \\ Malaria & 8 & \textbf{0.88}& \textbf{0.88} & \textbf{0.88} \\ \bottomrule \end{tabular} \caption{AUC for link prediction on real networks using our {\small MULTITENSOR} model, the diagonal/PARAFAC algorithm and Bayesian Poisson Tensor Factorization (BPTF)~\cite{schein2015}. Here we look at the entire dataset at once, and define the AUC as the probability a random link is ranked above a random non-link. Results correspond to the maximum likelihood fixed point over 100 runs of each algorithm with random initial conditions. The best performance for each network is indicated by boldface. All three algorithms perform quite well when shown all layers at once, although {\small MULTITENSOR}'s performance is the best by a small margin.} \label{table:AllAuc} \end{table} \begin{figure*}[ht]% \centering \subfloat{{\includegraphics[width=4cm]{caste_full_1} }}% \subfloat{{\includegraphics[width=0.19\linewidth]{K4_1_c0_dis} }}% \subfloat{{\includegraphics[width=0.19\linewidth]{K4_1_c1_dis} }}% \subfloat{{\includegraphics[width=0.19\linewidth]{K4_1_c2_dis} }}% \subfloat{{\includegraphics[width=0.19\linewidth]{K4_1_c3_dis} }}% \caption{Te\underbar npa\d t\d ti Village community partition. On the left we show the division by caste membership. To the right we show the membership in each of the 4 communities for each node (each figure represents one community), with color ranging from white if the normalized out-going membership $u_{ik}=0$ to black if $u_{ik}=1$. Values in between denote overlapping membership (grey). The fact that caste membership partially overlaps with the communities identified by our algorithm suggests a relationship between topological structure and caste, a topic that will be investigated in a future paper.} % \label{fig:partition1}% \end{figure*} \begin{figure}[htbp] \centering \includegraphics[width=1.0\linewidth]{AUC_DL.pdf} \caption{Layer interdependence in the Indian social support networks. On the $x$-axis are the layers' labels used in the test dataset, and the $y$-axis shows the AUC obtained through the cross-validation schemes for measuring layer interdependence. Bold lines are for Te\underbar npa\d t\d ti Village, dashed for A\underbar lak\= apuram Village. $L=1$ refers to single-layer AUC, where the algorithm is only given access to that layer. $L=2, 3, 12$ show the increase in the AUC for that layer when the algorithm is given access to $L$ layers; for $L=2$ and $L=3$ we choose the best set of $L-1$ additional layers using the greedy procedure described in the previous section.} \label{fig:ellylayers} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=\linewidth]{AUC_malaria_DL.pdf} \caption{Layer interdependence in the malaria network. Each of the 9 layers corresponds to a so-called ``highly variable region'' (HVR) of the malaria parasite genes, indicated on the $x$-axis, and the $y$-axis shows the AUC obtained through the cross-validation schemes for measuring layer interdependence. $L=1$ refers to single-layer AUC, where the algorithm is only given access to that layer. $L=2, 3, 9$ show the increase in the AUC for that layer when the algorithm is given access to $L$ layers; for $L=2$ and $L=3$ we choose the best set of $L-1$ additional layers using the greedy procedure described in the previous section. Points and error bars are the average and standard deviation over the $5$ folds of cross-validation. Unlike the social support networks, we see that the accuracy of predicting one layer actually decreases when we include others in the training set, indicating that the different layers have independent structure.} \label{fig:malarialayers} \end{figure} \begin{figure}[htbp]% \centering \includegraphics[width=0.48\linewidth]{pca1a} \includegraphics[width=0.48\linewidth]{pca2a} \caption{Clusters of the affinity matrices in the layers of the Indian village networks, for Te\underbar npa\d t\d ti on the left and A\underbar lak\= apuram on the right. Cluster labels were obtained using the $k$-means algorithm, treating each $w^{(\alpha)}$ as a $K^2$-dimensional vector, and we use PCA to visualize them in two dimensions.} \label{fig:ellypca} \end{figure} \section{Link prediction and layer interdependence in real networks} \label{sec:results} To demonstrate our {\small MULTITENSOR} model and algorithm beyond synthetic data, we apply it to two real-world multilayer networks. In one network, the {\small MULTITENSOR} model finds that many layers are interdependent, revealing a shared community structure among them. However, in the other network, the models finds the layers to be independent, concluding that there exists no shared structure among them. Together, these two different scenarios illustrate the concrete use of our method in both positive result and negative result scenarios, both of which are likely to arise when analyzing real-world data. First, we analyze social support networks from two villages in the Indian state of Tamil Nadu, which we call by the pseudonyms~\footnote{Pseudonyms for villages are used for privacy reasons.} ``Te\underbar npa\d t\d ti'' and ``A\underbar lak\= apuram''~\cite{power2015, power2017}. As part of a survey questionnaire, village residents were asked to name those individuals who provided them with 12 different types of support, ranging from lending them household items to helping them navigate government bureaucracy. The resulting directed networks have $N=362$ and $N=420$ nodes, respectively. Each type of support corresponds to a layer in these networks, giving each of them $L=12$ layers, with average degrees ranging from $2.0$ to $4.4$. Second, we analyze the patterns of shared genetic substrings among a set of malaria parasite virulence genes~\cite{larremore2013}. Each of the $N=307$ nodes represents a single gene, and an edge connects two genes if they share a substring of significant length. Due to the fact that the same set of genes was analyzed at nine different genetic loci (i.e., locations on the genes themselves) which are called ``highly variable regions'' (HVRs), this undirected network has $L=9$ layers, with average degrees ranging from $5.1$ to $76.4$. The scientifically interesting questions for both networks revolve around the mechanisms driving edge formation. Hypothesized factors include kinship and caste in the Indian social support networks, and upstream promotor sequence or parasite origin in the malaria genetic networks. However, addressing these questions is beyond the scope of this paper, where we instead wish to evaluate the effectiveness of our algorithm. One option would be to use our algorithm to cluster the nodes, and compare the resulting group assignments with metadata such as gender, caste, or geographical location. Indeed, in Figure~\ref{fig:partition1} we show the community assignment for Te\underbar npa\d t\d ti predicted by our model, and compare it with the division of individuals into castes. Although the figure suggests that the partition might be correlated with caste membership, we do not expect this to be the only type of metadata correlated with the community structure, and we do not consider this correlation to be a good measure of accuracy. Here we focus instead on link prediction, and in particular on the extent to which knowledge of some layers helps us predict links in others, as described in the previous section. As for the synthetic networks, our {\small MULTITENSOR} algorithm, the Diagonal/PARAFAC algorithm, and the BPTF algorithm each provide a framework for link prediction. Table~\ref{table:AllAuc} reports the AUC over each entire network and for each algorithm. The algorithms' performance are roughly similar, although our algorithm has slightly higher performance. This suggests that these networks are primarily assortative; this is certainly true of the malaria network, since it is defined in terms of similarity. To measure layer interdependence we implemented the method described in the previous section, where we attempt to predict the adjacency matrix of a given layer with 20\% of its entries held out, and give the algorithm access to a subset of other layers as part of its training dataset. Interestingly, we obtain opposite results in these two cases. For the social networks, we find that increasing the number of layers in the training dataset does indeed improve link prediction, with a performance that increases monotonically with the number of additional layers. In Figure~\ref{fig:ellylayers} we show that the AUC for each layer as a function of the number of layers the algorithm is given access to. We found that the best number of groups for link prediction was $K=4$ for the first village and $K=6$ for the second one. Many layers viewed on their own ($L=1$) are difficult to predict, with AUCs just above $0.5$, i.e., only slightly better than chance. By giving the algorithm access to one more layer ($L=2$) the AUC typically improves by only about $0.05$. However, if we give it access to two additional layers ($L=3$) the AUC improves significantly for almost all of the layers, and this is even more true when we give it access to the entire dataset. (For $L=2, 3$ we use the greedy procedure to choose which $L-1$ layers to add to the training dataset.) Thus in these social networks, the {\small MULTITENSOR} algorithm is able to usefully apply knowledge from some layers to others. Interestingly, we also see consistency between the two villages with regard to which layers are the hardest to predict, and which layers are the most helpful to include in the training dataset. In particular, the ImpIss layer (``Who do you discuss important matters with?'') is helpful in predicting many layers, while Position, Work, Loan, and Babysit are much less so, and in some cases even decrease the AUC. We can compare this with the clustering of the $L$ affinity matrices we obtained using standard clustering algorithms, in a spirit similar to~\cite{stanley2015}. In Figure~\ref{fig:ellypca} we use Principal Component Analysis~\cite{jolliffe2002} to visualize the $L$ matrices $w^{(\alpha)}$, projecting them along two principal directions in $K^2$-dimensional space, and we give them cluster labels using the $k$-means algorithm~\cite{macqueen1967}. Indeed we see that Position, Work, Loan, and Babysit are farther from the others, suggesting that these layers are structurally quite different from the others; note also in Figure~\ref{fig:ellylayers} that these layers are among the hardest to predict. In contrast, ImpIss is closer to the other layers, at least for the second village, consistent with the fact that it often helps predict other layers. We also find for $L=2$, that the Borrow layer is the most helpful when predicting the Talk layer in both villages, which is consistent with the fact that these two layers are clustered close together. In contrast, for the malaria network we find that the best performance is obtained when no other layer is added to the dataset, meaning that prediction actually worsens monotonically as we increase the number of added layers, as shown in Figure~\ref{fig:malarialayers}. This seems to corroborate past findings~\cite{larremore2013} in an important way. Specifically, the standing hypothesis about these genes is that they are maximally diverse in order to most effectively evade the immune system. If there were correlations between loci, which we would see here as the ability of one layer to help in the link prediction of another layer, then this would diminish these genes' overall diversity. This would diminish the amount of ``immune evasion space'' that is spanned by the parasites, and would therefore result in an overall fitness decrease for the parasites. \section{Conclusions} \label{sec:conclusion} We have proposed a generative model for multilayer networks that extends and generalizes the mixed-membership stochastic block model. It assumes that the layers share a common community structure, but allows links in different layers to be correlated with the community memberships in different ways, such as assortative, disassortative, core-periphery, or hierarchical structure, or arbitrary mixtures thereof. It explicitly allows the communities to overlap, and can be applied to networks with directed, undirected, or integer-weighted links. We showed that it can be fit to large datasets using a scalable expectation-maximization algorithm, whose running time per iteration is linear in the total size of the dataset and which converges quickly in practice. Due to its ability to describe a wide variety of graph structures, it performs well on synthetic and real data, in terms of both community detection and link prediction. In addition to performing community detection, the methods in this paper naturally incorporate a framework for link prediction, which we use as a quantitative definition of interdependency between the network's layers. Namely, we measure how much knowledge of one layer, or a set of layers, improves the accuracy of link prediction in another layer. This measure is quite general, and goes beyond approaches that cluster layers into strata with similar parameters (e.g.~\cite{stanley2015}); for instance, if two layers both depend strongly on the underlying communities, they will be interdependent in this sense even if one is assortative and the other is disassortative, making their affinity matrices very different. In addition to providing hints about causal or structural relationships between the layers, this notion of interdependence may be useful to choosing weights for multilayer versions of common network measures, such as eigenvector centrality~\cite{sola2013} and modularity~\cite{mucha2010}. The same link prediction and cross-validation framework used to quantify layer interdependence can also be used to identify and avoid overfitting. Beyond establishing high performance on synthetic datasets, we also applied our methods to two real-world datasets. We found patterns of interdependence between layers of social networks from two Indian villages, indicating correlations between different kinds of social ties, and confirmed that these patterns are largely consistent between the two villages. In contrast, when we applied our methods to a multilayer network of sequence sharing among malaria's virulence genes, we found that the layers were essentially unrelated. This suggests that similarities at different loci of the amino acid sequences are evolving under uncorrelated constraints, rigorously confirming a result based on independent analyses of each layer~\cite{larremore2013}. In both cases, our {\small MULTITENSOR} approach provided information not revealed in previous studies of these datasets, and proved to be useful in identifying not only the presence of meaningful structure, but its absence as well. The solution we provide for the layer interdependence problem may find application beyond the analysis of extant datasets. Because our method can be used to aggregate layers into clusters, or to compress a dataset by identifying especially relevant or redundant layers, it can direct experimentalists or field researchers in learning which data to collect or prioritize. For example, if two layers of a social network are found by our methods to be redundant during a pilot study, the redundant layer need not be collected at scale. Particularly in cases where data collection is labor intensive, expensive, or generally difficult, robust solutions to the layer interdependence problem can help maximize the impact of studies constrained by limited resources in the laboratory or the field. On the other hand, when layers are found to be independent of each other, our methods provide justification for comprehensive data collection of the relevant layers. \section*{Acknowledgements} This work was supported by the John Templeton Foundation (CDB, CM), the Army Research Office under grant W911NF-12-R-0012 (CM), a National Science Foundation Doctoral Dissertation Improvement grant (BCS-1121326), a Fulbright-Nehru Student Researcher Award, the Stanford Center for South Asia, and Stanford University (EAP), and the Santa Fe Institute Omidyar Fellowship (DBL, EAP). We are grateful to Hanna Wallach and Aaron Schein for helpful discussions. \bibliographystyle{apsrev4-1}
{'timestamp': '2018-08-21T02:13:02', 'yymm': '1701', 'arxiv_id': '1701.01369', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01369'}
arxiv
\section{Introduction} Motion prediction is important for finding the middle ground between pure teleoperation and autonomous control of robotic systems. It allows the robot to anticipate the future motions of the users and, consequently, their intention, and assist them in performing a given task. To improve the performance of motion prediction algorithms, it is beneficial to ground the prediction in experimentally-validated computational models of human movement \cite{wolpert2000}. Optimal control is used extensively in computational motor control, and provides a powerful framework for explaining a wide range of empirical phenomena associated with human motion \cite{Flash1985, Flash2013, Todorov2004}. In this view, it is hypothesized that human motion is driven by well-defined rewards or cost functions. The complimentary Inverse Optimal Control (IOC) framework attempts to identify the structure and parameters of these cost functions from a set of observed trajectories \cite{todorov_inverse}. Thus, IOC allows for the transition from modeling of human motion to motion prediction in a particular task \cite{mainprice_ioc}. However, the accuracy of the model that is used for a particular problem is critical to the success of IOC-based approaches. While many studies considered optimal control for modeling reaching trajectories in free space \cite{Flash1985, Todorov2004, Scott2004, Diedrichsen2010}, there has been much less effort towards modeling reaching in the presence of obstacles using optimal control \cite{wolpert_obstacle}. This in turn, hinders the development of efficient IOC based approaches for prediction. In the current paper, we propose a stochastic optimal control framework for modeling human reaching trajectories in the presence of obstacles. This framework is designed to be incorporated in motion prediction for a variety of applications of teleoperation in cluttered spaces. Our proposed framework is built on experimental studies that suggest that reaching movements amongst obstacles are optimized considering the likelihood of collision \cite{chapman1, chapman2, mon-williams}, and that obstacle avoidance is sensitive to human perception of free space \cite{chapman2}. In line with these findings, the proposed optimal control model incorporates probabilistic collision avoidance constraints to ensure that the likelihood of collision is below a specified threshold. We also consider signal-dependent noise in human movement control \cite{Harris98}, and the uncertainty in the perception of the size of the obstacle to model the error in estimation of free space. \noindent \textbf{Contributions:} Our main result is a reformulation of the optimal control problem proposed in \cite{wolpert_obstacle} which was shown to be effective in modeling reaching movements in the presence of obstacles. The proposed reformulations approximate a difficult non-linear and non-convex optimal control problem by a parametric quadratic optimization problem. We use substitution of chance constraints with a family of surrogate constraints \cite{bharath_iros15}. Satisfaction of each member of the family of surrogate constraints can be mapped to a lower bound probability with which the original chance constraints would be satisfied. Further, we show that the parameters of the reformulated quadratic optimization problem can be tuned to generate a diverse class of trajectories. To make the optimal control computationally tractable, we adapt \cite{Flash1985} and approximate the hand dynamics as a stochastic triple integrator system. Thus, our formulation does not address all the features of human reaching. Instead, we focus on capturing how parameters of our optimal control model that represent risk seeking behavior of human can explain the trade-off between movement velocity and obstacle clearance in the vicinity of an obstacle. The rest of the paper is organized as follows. Section \ref{rel} reviews the previous studies which considered collision avoidance within the context of optimal control. Section \ref{foc} presents the optimal control problem followed by a series of reformulations to convert it into a tractable parametric quadratic optimization problem. Section \ref{sim} presents simulation results that demonstrate how the parameters of the reformulated problem result in a diverse set of trajectories and control costs. In section \ref{disc} we discuss the results of our simulations in light of the existing experimental findings on reaching movements among obstacles and present future directions. \section{Related Work}\label{rel} \noindent \textbf{Optimal Control or Optimization based Obstacle Avoidance in Robotics} Optimal control or optimization are used extensively to plan collision-avoiding trajectories that also optimize a specified cost function \cite{chomp}, \cite{stomp}. In \cite{stomp}, optimal control is applied to stochastic systems with additive noise, and collision avoidance is ensured by introducing a penalty on trajectories that come close to the obstacles. An expectation over the cost is taken which suggests that the optimization is risk neutral; that is, it does not model the probability of collision avoidance. Trajectory optimizers like \cite{traj_opt}, \cite{muller2014risk} incorporates a penalty on the probability of collision avoidance. Some studies like \cite{chance_avoid1}, \cite{chance_avoid2} put hard constraints on probability of collision avoidance . However, \cite{chance_avoid1}, \cite{chance_avoid2} assumed an additive noise model. We aim at planning trajectories for a human hand which is assumed to be modeled as a stochastic system with signal dependent noise \cite{Harris98}. An optimal control based framework presented in \cite{vandenberg} presents collision avoidance under signal dependent noise, but for single integrator systems. In contrast, our formulation incorporates a higher order dynamics. \noindent \textbf{Obstacle Avoidance in Computational Motor Control} Optimal control or optimization has been an important tool for studying arm movements in computational motor control community. These works include both deterministic \cite{Flash1985}, \cite{soechting}, \cite{kang}, \cite{uno} as wells as stochastic models \cite{Todorov2004}, \cite{Harris98}, \cite{tops},\cite{todorov_feedback}. Works like \cite{soechting}, \cite{kang}, \cite{uno} consider the full arm motion in their analysis. However, the arm dynamics are highly non-linear and its integration with probabilistic collision avoidance constraints would result in a computationally intractable optimal control problem. Thus, in contrast to these works, we focus solely on the hand trajectories. Reaching trajectories in the presence of obstacles were studied in computational motor control for understanding movement coordination. Experimental studies \cite{chapman1}, \cite{chapman2}, \cite{mon-williams}, \cite{Tressilian} investigated the effects of obstacle position and size on obstacle avoidance. In particular, \cite{Tressilian} observed that the obstacle avoidance strategy exhibited by human subject during reach to grasp movements, consisted of two basic but coupled components namely moving around the obstacle or slowing down near them. An optimal control model for a single-obstacle avoidance was proposed in \cite{wolpert_obstacle}. They solved the optimal control problem using simulated annealing. Simple obstacle configurations, predominantly with a single obstacle were considered. Our proposed approach differs from \cite{wolpert_obstacle} in terms of the technical approach followed to solve the optimal control problem. In particular, we exploit some efficient structures in the problem. Moreover, we consider complex obstacle configurations to highlight the interaction between parameters, control cost and probability of collision avoidance. Our proposed approach also differs from \cite{todorov_obstacle} wherein obstacle avoidance is included as a cost function and consequently do not model the probability of collision avoidance. Although, \cite{todorov_flexible} analyzes collision avoidance behavior in the presence of obstacles, the presented optimal control formulation do not explicitly include collision avoidance constraints or costs. Rather, collision avoidance is used as a test case to study variability of reaching movements as explained by stochastic optimal control as compared to other models. \section{Proposed Forward Optimal Control (FOC)}\label{foc} \subsection{Dynamics and Task Description} We consider the task of reaching movements in a 2D cluttered environment. We chose a simple linear model for the movement of the end point of the hand - a triple integrator -- system. We denote the state of the hand at time instant $t$ by $\textbf{X}^t = (x^t, y^t, \dot{x}^t, \dot{y}^t, \ddot{x}^t, \ddot{y}^t)$, where the individual state variables are defined as the Gaussian distributions. The parameters of the distributions, i.e. their means and variances are obtained from the following discrete time dynamics with jerk $U =(u_x,u_y)=(\dddot{x},\dddot{y})$ as the control input. \small \begin{equation} X^{t+1} = \textbf{A} X^{t}+\textbf{B}(U^{t}+\varepsilon_{U}^t), \label{linear} \end{equation} \normalsize \noindent where $\textbf{A}$ and $\textbf{B}$ represent state transition and control scaling matrices of dimensions conforming to that of the state, and \small \begin{equation} \varepsilon_U^t= \sum_{i=1}^{2}\phi_i \textbf{M}_iU \label{varepsidef} \end{equation} \begin{equation} \textbf{M}_1= \begin{bmatrix} c_x & 0 \\ 0 & 0 \\ \end{bmatrix}, \textbf{M}_2 = \begin{bmatrix} 0 & 0 \\ 0 & c_y \\ \end{bmatrix}. \end{equation} \normalsize The term $\varepsilon^{t}_U$ in (\ref{varepsidef}) represents the time varying signal-dependent noise, and is formulated in terms of constant scaling matrices $\textbf{M}_i$ and $\phi_i$ which are a set of zero-mean unit-variance normal random variables. This form of (\ref{varepsidef}) ensures that indeed the standard deviation of the noise grows linearly with the magnitude of the control signal \cite{Todorov2004}, and the constants $c_x,c_y$ determine the magnitude of noise as a fraction of the control input. \subsection{Optimal Control} \noindent The discrete time optimal control can be represented by the following set of equations. \small \begin{eqnarray}\label{opt1} \min J_{opt} = J_{U^t}+J_{X^t} \\\nonumber Pr(C_j^t(x^{t},y^{t},x_j,y_j, R_j)\leq 0 )\geq \eta , j = {1,2..n},\nonumber \end{eqnarray} \normalsize \vspace{-0.4cm} \small \begin{equation} J_{U^t} = \Vert U \Vert ^{2}, J_{X^t} = \sum_{t=t_0}^{t=t_f}E[L(X^{t},U^{t})], \label{cont_statecost} \end{equation} \normalsize \vspace{-0.3cm} \small \begin{equation} L(X^{t},U^{t}) = \sum_{i=1}^{6}w_i(X_i^t-X^{t_f})^2, \end{equation} \vspace{-0.3cm} \begin{equation} R_j \approx N(\mu_{R_j}, \sigma_{R_j}^2). \label{pernoise} \end{equation} \normalsize \noindent The objective function in (\ref{opt1}) consists of a control effort term and a state-dependent term which penalizes the end point variance of the trajectory. The term $w_i$ determines the relative weighting between the components of the state-dependent cost term. The constraints $C_j(.)\leq 0$ in (\ref{opt1}) represent the collision avoidance requirement in a deterministic setting. Thus, the set of inequalities in (\ref{opt1}) signify constraints that the collision avoidance requirement is satisfied with a particular lower bound probability $\eta$. The terms $x_j$, $y_j$ and $R_j$ denote the position and size of the $j^{th}$ obstacle. To model the uncertainty in the estimation of obstacle size, $R_j$ is defined as normally-distributed random variable. The optimization (\ref{opt1}) is difficult to solve due to the constraints on probability of collision avoidance, also known as chance constraints, and are computationally intractable \cite{chance1}. Hence, we next reformulate these chance constraints into a tractable form and show that the reformulation naturally leads to an efficient optimization structure. \noindent \textbf{Reformulating Chance Constraints:} We follow \cite{bharath_iros15}, and substitute of $Pr(C_i^t(.))$ with: \vspace{-0.2cm} \small \begin{eqnarray}\label{meanvar} Pr(C_j^t(x^{t},y^{t},x_j,y_j, R_j)\leq 0 )\geq \eta\\\nonumber \Rightarrow E[C_j^t(.)]+k\sqrt(Var[C_j^t(.)]\leq 0, \eta \geq \frac{k^2}{1+k^2}. \end{eqnarray} \normalsize \noindent where $E[C_j^t(.)]$ and $Var[C_j^t(.)]$ represent the expectation and variance of the constraints $C_j^t(.)$ with respect to the random variables $x^t,y^t$. This suggests that satisfaction of the deterministic surrogate in \ref{meanvar} ensures satisfaction of the original probabilistic constraints with at least a probability $\frac{k^2}{1+k^2}$. In \cite{bharath_iros15}, it is shown that computing an analytical expression for $E[C_j^t(.)]$ and $Var[C_j^t(.)]$ in terms of random variable arguments $x^t,y^t,R_j$ etc. is simpler compared to computing that for $Pr(C_j^t(.))$. We can further simplify (\ref{meanvar}) by approximating obstacle regions in 2D as circles. This simplifies the collision avoidance inequality $C_j^t(.)$: \small \begin{equation} C_j^t: -(x^t-x_j)^2-(y^t-y_j)^2 +R_j^2\leq 0. \label{C_i} \end{equation} \normalsize \noindent Because (\ref{C_i}) is purely concave in terms of hand position variables $x^t$ and $y^t$, an affine upper bound can by obtained by linearizing $C_i^t$ around an initial trajectory guess $(x_*^t,y_*^t)$ \cite{sqp}: \vspace{-0.3cm} \small \begin{equation} C_j^t\approx ^*C_j^t+\bigtriangledown_{x^t} C_j^t(x^t-x_*^t)+\bigtriangledown_{y^t} C_j^t(y^t-y_*^t)\leq 0, \label{affine} \end{equation} \normalsize \noindent Where, $^*C_j^t$ is obtained by evaluating (\ref{C_i}) at $(x_*^t,y_*^t)$. Similarly, $\bigtriangledown_{x^t} C_j^t $ and $\bigtriangledown_{y^t} C_j^t$ represent the partial derivative of $C_j^t(.)$ with respect to $x^t$ and $y^t$, evaluated at $(x_*^t,y_*^t)$. The affine approximation (\ref{affine}) can be further improved by updating $(x_*^t,y_*^t)$, during the course of the optimization. This sequential linearization of concave constraints forms the basis of the \emph{convex concave procedure} \cite{sqp}. \noindent In light of (\ref{affine}), $E[C_j^t(.)]$ and $Var[C_j^t(.)]$ take the form \small \begin{eqnarray}\label{expec} E[C_j^t(.)] = \sigma^2_{R_j}\\\nonumber+h_1(\mu_{x^t},x^t_*,\mu_{y^t},,y^t_*,\sigma_{x^t}^2, \sigma_{y_t}^2\mu_{x_j},\mu_{y_j},\mu_{R_j}) \end{eqnarray} \normalsize \vspace{-0.4cm} \small \begin{eqnarray}\label{var} Var[C_j^t(.)] = C_{R_j}\sigma_{R_j}^2+2\sigma_{R_j}^4\\\nonumber +h_2(\mu_{x^t},x^t_*,\mu_{y^t},y^t_*,\sigma_{x^t}^2,\sigma_{y^t}^2,\mu_{x_j},\mu_{y_j},\mu_{R_j}), \end{eqnarray} \normalsize \noindent where the terms $(\mu_{x^t},\mu_{y^t})$ and $(\sigma_{x^t}^2,\sigma_{y^t}^2)$ represent the mean and variance of the hand position $(x^t,y^t)$. The term $C_{R_j}$ and functions $h_1(.)$ and $h_2(.)$ are given in (\ref{cri})-(\ref{h2}). It can be noted that $h_2(.)$ can be represented as sum of squares and thus, is non-negative. \small \begin{eqnarray} C_{R_i} = 4\mu_{R_i}^2\label{cri}\\ h_1 = \mu_{R_i}^2+2\mu_{x^t}\mu_{x_i}-\mu_{x_i}^2+2\mu_{y^t}\mu_{y_i}-\mu_{y_i}^2-2\mu_{x^t} x^t_*\\\nonumber-2\mu_{y^t}y^t_*+(x^t_*)^2+(y^t_*)^2\label{h1}\\ h_2 = 2(2\mu_{x_i}^2\sigma_{x^t}^2+2\mu_{y_i}^2\sigma_{y^t}^2-4\mu_{x_i}\sigma_{x^t} ^2(x^t_*)^2-4\mu_{y_i}\sigma_{y^t}^2(y^t_*)^2\label{h2}\\\nonumber + 2\sigma_{x^t}^2(x^t_*)^2+2\sigma_{y^t}^2(y^t_*)^2) \end{eqnarray} \normalsize \noindent \textbf{Reformulated Optimal Control Problem:} To arrive at the final reformulated version of (\ref{opt1}), we make the following sequence of observations. The second term of the surrogate constraints proposed in (\ref{meanvar}) is non-negative. Thus, for a given $k$, the surrogate constraints (\ref{meanvar}) are satisfied when the first term, $E[C_j^t(.)]$ is sufficiently negative and the second term, $\sqrt(Var[C_j^t(.)]$ is sufficiently small in magnitude. Due to (\ref{var}) and (\ref{h2}) we note that $\sqrt(Var[C_j^t(.)]$ is a non-decreasing function of the positional variance at each point of the trajectory $(\sigma^2_{x^t},\sigma^2_{y^t})$. Thus, making $\sqrt(Var[C_j^t(.)]$ small is equivalent to minimizing the positional variance at each point of the trajectory. In light of all these arguments, FOC (\ref{opt1}) can be replaced with the following simpler problem. \vspace{-0.3cm} \small \begin{eqnarray}\label{opt2} J_{aug}= \Vert U \Vert ^{2}+\sum_{t=t_0}^{t=t_f}E[L(X^{t},U^{t})]+\lambda\sum_{t= t_0}^{t_f}(\sigma^2_{x^t}+\sigma^2_{y^t})\\\nonumber E[C_j^t(.)]+\tau \leq 0 \end{eqnarray} \normalsize The original trajectory optimization (\ref{opt1}) has been converted to the new formulation (\ref{opt2}) by substituting the parameter $\eta$ which represented probability of avoidance in (\ref{opt1}) with two new sets of variables $\tau$ and $\lambda$. The positive constant $\tau$ can be manipulated to make $E[C_j^t(.)]$ as negative as required and consequently control the clearance from a given set of obstacles. Similarly, $\lambda$ is a positive constant which can be manipulated to minimize the positional variance at each point along the trajectory. Hence, we can manipulate $\tau$ and $\lambda$ to achieve a particular probability of avoidance $\eta$. Moreover, each $\eta$ can be mapped to various choices of $\tau$ and $\lambda$ leading to a diverse set of collision avoidance behaviors. Within this diverse set, $\tau$ determines the geometry of the path, and $\lambda$ determines the velocity profile along the path. The reformulated FOC (\ref{opt2}) is very different from those typically used in the context of human motion modeling. A central hypothesis in current frameworks is that relative weighting of each term in the cost function can be tuned to produce a diverse set of trajectories. The FOC (\ref{opt2}) takes on a different approach -- its parameters appear not only in the cost function but also in the constraints. The reformulated FOC (\ref{opt2}) can be solved in one shot if the right set of $\tau$ and $\lambda$ are given. For the cases where such set is not available, we can derive a framework for mapping a probability of collision avoidance $\eta$ to $\tau$ and $\lambda$ and solving (\ref{opt2}) in the process. \noindent \textbf{Solutions in Different Homotopies:} The linearization of collision avoidance constraints (\ref{C_i}) to obtain affine inequalities (\ref{affine}) inherently limits the solution trajectories of (\ref{opt2}) to be locally optimal. The physical interpretation of this is that FOC, (\ref{opt2}) cannot search over the solution trajectories belonging to different homotopies. Existing optimal control approaches capable of searching over different homotopies either reformulate collision avoidance constraints, (\ref{C_i}) through use of binary variables \cite{milp1} or introduce additional constraints which model the topological information about the different possible homotopies \cite{homotopy1}, \cite{homotopy2}, \cite{homotopy3}. However, adopting such approaches would significantly increased the complexity of our optimization, (\ref{opt2}). Instead, we opt for an approximate solution. We vary the initial trajectory guess to produce optimal trajectories in different homotopies. In particular, an initial guess for each homotopy is pre-computed and stored and recalled as and when required. This initial guess could be computed from even sampling based planners. Some existing works on stochastic optimal control based collision avoidance also adopt similar approach \cite{vandenberg_coll}. Our approximate approach is also motivated by our eventual future goal of using the proposed formulation for learning reaching movements. In that context, a data set of initial guesses in different homotopies can be obtained from the user demonstration. \noindent \textbf{Efficiently Solving the Proposed FOC:} \noindent Algorithm 1 summarizes a sequential quadratic programming (SQP) routine for solving FOC (\ref{opt2}). The optimization starts with an initial guess trajectory $(x^t_*,y^t_*)$ and initialization of an index counter $i$ and two non-negative variables $\tau$ and $\lambda$. The outermost loop checks whether the constraints are satisfied and reduction in the cost function between two consecutive iterations is within a specified threshold, $\xi$. If either of these checks are violated, then the algorithm proceeds to the inner loop where we check whether the surrogate constraints (\ref{meanvar}) are satisfied. If not, then we increment the value of the $\tau$ by $\delta$ and $\lambda$ by a factor of $\Delta$. Thereafter (\ref{opt2}) is solved with the current values of $\tau$ and $\lambda$ and the solution obtained is used to update the initial guess trajectory, which in turn is used to obtain a better estimate of $C_j^i(.)$ through (\ref{affine}) for the next iteration. Algorithm 1 has two important features. Firstly, $E[C_j^t(.)]$ is affine and $J_{aug}$ is convex quadratic in terms of control variables. Thus, solving (\ref{opt2}) for a given $\tau$ and $\lambda$ amounts to solving a quadratic programming (QP) problem. This is turn can be accomplished efficiently through open source solvers like CVX \cite{CVX}. Secondly, algorithm 1 is different from the standard SQP routines used to solve general non-convex problems in the sense that it does not require a trust region update. This, in turn, is because the affine approximation of $C_j^t$ in (\ref{affine}) acts as a global upper bound for the original collision constraints (\ref{C_i}) Each $\eta$ can be mapped to numerous combinations of $\tau$ and $\lambda$. This redundancy is captured in algorithm \ref{algo1} by manipulating the update rates of $\tau$ and $\lambda$. We discuss this in more detail in Section \ref{sim} with the help of specific examples. \begin{algorithm} \caption{Sequential Quadratic Programming for solving FOC }\label{algo1} \begin{algorithmic} \small \State \textbf{Initialization}: Initial guess for optimal trajectory $x^t_*,y^t_*$. \State $i =0$ ,$\tau = 0$, $\lambda = 1$ \State \While $\vert J^{i+1}_{opt}-J^i_{opt}\vert<\xi$ and $E[C_j^t(.)]+k\sqrt(Var[C_j^t(.)]\leq 0$ \If{$E[C_j^t(.)]+k\sqrt(Var[C_j^t(.)]>0$}\\ $\tau \leftarrow \tau+\delta$\\ $\Delta \leftarrow \Delta\lambda$\\ \EndIf\\ $U$ $\leftarrow$ $ \arg\min J_{aug}$ \\\hspace{0.4cm} $E[C_j^t(.)]+\tau\leq 0$ \State Update $x^t_*,y^t_*$ through $U$\\ $i \leftarrow i+1$ \EndWhile \normalsize \end{algorithmic} \end{algorithm} \section{Simulation Results}\label{sim} \subsection{Collision Avoidance Strategies} To ensure collision avoidance, humans can choose to maintain high clearance from the obstacles resulting in a large deviation from straight line paths. Alternatively, they can choose to reduce the deviation but compensate for it by moving with high precision near the obstacles (reduce positional variance). In light of the the signal dependent noise (\ref{varepsidef}), moving with precision near the obstacle requires moving with low velocities. For the ease of exposition, from hereon, we will refer to the slowing down strategy as "Low Velocity" or \textbf{LV} and strategy of maintaining large clearance from the obstacles as "High Clearance" or \textbf{HC}. Both these strategies can be modeled through (\ref{opt2}) by using appropriate values for parameters $\tau$ and $\lambda$. For example, Fig.~\ref{plotcomp_config1} shows two solution trajectories of (\ref{opt2}) between the same start and goal configurations. The probability of avoidance, $\eta$ for both trajectories is $0.94$. However, both trajectories achieve this probability of collision avoidance through different combinations of $\tau$ and $\lambda$. The trajectory resulting from strategy \textbf{LV} was obtained with $\tau=0.0009, \lambda = 2.28*10^6$, while that resulting from strategy \textbf{HC} was obtained with $\tau=0.0012, \lambda = 0.9*10^6$. These values of $\tau$ and $\lambda$ were obtained using different update rates of of $\tau$ and $\lambda$ in algorithm \ref{algo1}. For simulating strategy \textbf{LV} we used $\delta = 0.00005$, $\Delta = 10$ in the update rule of $\tau$ and $\lambda$, and for simulating strategy \textbf{HC} we used $\delta = 0.0001$, $\Delta = 10$. Since, $\tau$ controls the clearance from the obstacles, setting higher update rates for $\tau$ resulted in trajectories belonging to strategy \textbf{HC}. On the other hand, a lower update rate for $\tau$ puts a higher emphasis on $\lambda$ and consequently manipulation of positional variance through velocity control for collision avoidance, thus, resulting in trajectories belonging to strategy \textbf{LV}. The velocity profiles shown in Fig.~\ref{plotcomp_dev_vel_config1} demonstrate that a higher $\lambda$ forces the velocity magnitude along the trajectory closer to the obstacle (strategy \textbf{LV}) to be small during the initial stages, i.e, while the trajectory is near the obstacles. Consequently, the positional variance is reduced and desired probability of collision avoidance is maintained. In contrast, the trajectory with higher clearance from the obstacle (strategy \textbf{HC}) has the liberty to move with faster velocity and let the variance of the movement grow. The velocity magnitude along trajectory resulting from strategy \textbf{LV} increases eventually, but this happens towards the end of the movement, after crossing the obstacles. \begin{figure}[!h] \centering \subfigure[]{ \includegraphics[width= 4.3cm, height=3.2cm] {strat_comp_config1.eps} \label{plotcomp_dev_config1} }\hspace{-0.6cm} \subfigure[]{ \includegraphics[width= 4.3cm, height=3.2cm] {strat_comp_vel_config1.eps} \label{plotcomp_dev_vel_config1} }\hspace{-0.8cm} \caption{Demonstration of the effect of the choice of $\tau$ and $\lambda$ on the collision avoidance strategies. Two sets of trajectories between same start and goal locations and having same probability of avoidance, $\eta$ were computed. However, to generate these two trajectories we used a different set of $\tau$ and $\lambda$ to achieve the specified probability of avoidance. The trajectories shown in green were computed using $\tau=0.0012, \lambda = 0.9*10^6$, while trajectories shown in red were computed using $\tau=0.0009, \lambda = 2.28*10^6$.} \label{plotcomp_config1} \end{figure} \subsection{Mapping Avoidance Strategies to Control Cost} If we would derive a variant of the optimization (\ref{opt2}) for a system with an additive constant-variance noise, the probability of collision avoidance, $\eta$ would solely depend on the clearance from the obstacles. Thus, increase in $\eta$ would directly lead to an increase in arc lengths, and consequently, control costs. However, to develop a framework that is suitable for modeling human arm movements, we incorporated signal dependent noise \cite{Harris98}. In the presence of signal-dependent noise, control cost of trajectories depends on the probability of avoidance $\eta$, and more importantly, on the combination of $\tau$ and $\lambda$ that is used in the optimization (\ref{opt2}) to achieve this $\eta$. In other words, the control cost depends on the strategy that is used to achieve a particular probability of collision avoidance. In Fig. \ref{strat_comp_traj1}-\ref{strat_comp_traj2_vel} we present simulated trajectories that correspond to both strategy \textbf{LV} and \textbf{HC} for probabilities of collision avoidance $\eta=0.86$ and $\eta=0.95$. The paths that resulted from strategy \textbf{HC} indeed has higher clearance from the obstacles. In contrast, the paths that resulted from strategy \textbf{LV} have lower clearance and thus, heavily rely on modifying the velocity magnitudes and consequently positional variance for collision avoidance. Consequently, paths resulting from strategy \textbf{HC} have higher arc lengths as compared to paths resulting from strategy \textbf{LV}. In Fig.~ (\ref{cost_inter_hom}) the ratio of control costs for trajectories resulting from both the strategies is presented as a function of $\eta$. For low $\eta$, paths resulting from strategy \textbf{LV} which have lower arc lengths are less costly. But, as $\eta$ increases, the higher arc length paths resulting from strategy \textbf{HC} become less costly. The observations discussed above are apparent from the structure of the optimization (\ref{opt2}). Increasing either $\tau$, $\lambda$, or both, leads to an increase in the control cost. At low values of $\eta$, there is very little restriction on the growth of positional variance and thus the control cost is dictated by $\tau$ which controls the arc length. But as $\eta$ increases, the effect of $\lambda$ becomes prominent. This is consistent with the significant reduction in positional variance that is depicted in Fig.~ \ref{strat_comp_traj2} and the corresponding skewed velocity profile shown in Fig.~ \ref{strat_comp_traj2_vel}. Since trajectories resulting from strategy \textbf{LV} has lesser clearance from the obstacles, they require a higher value of $\lambda$ to achieve the same $\eta$ (similar to the result shown in previous section). Thus, at higher probabilities trajectories resulting from strategy \textbf{LV} become more costly in spite of having lower arc lengths. \begin{figure}[!h] \centering \subfigure[]{ \includegraphics[width= 4.4cm, height=3.2cm] {strat_comp_traj1.eps} \label{strat_comp_traj1} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.4cm, height=3.2cm] {strat_comp_traj1_vel.eps} \label{strat_comp_traj1_vel} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 4.4cm, height=3.2cm] {strat_comp_traj2.eps} \label{strat_comp_traj2} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.4cm, height=3.2cm] {strat_comp_traj2_vel.eps} \label{strat_comp_traj2_vel} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 8.3cm, height=4.3cm] {cost_intra_hom.eps} \label{cost_intra_hom} } \caption{Control costs vary with probability of avoidance. (a)- (d) Movements with different strategies between the same start and goal locations, the same obstacle configurations, and with noise level $c_x, c_y=0.15$. (a), (c) present the paths with standard deviation ellipses of the two strategies. The obstacles are represented as blue filled circles and grey shaded region around them represent uncertainty about the size of the obstacle. (b), (d) present the velocity profiles. (e) the ratio of the control costs between the two strategies, $\frac{J_U^{LV}}{J_U^{HC}}$, as a function of $\eta$.} \vspace{-0.5cm} \end{figure} The results presented above, were obtained with $c_x=c_y=0.15$ in (\ref{varepsidef}). That is, the noise was $15\%$ of the control input. Next, we examined how the cost shown in Fig.~ \ref{cost_intra_hom} changes with a reduction in noise. Fig.~\ref{cost_lessnoise} depicts the ratio of control costs for trajectories resulting from strategy \textbf{LV} and \textbf{HC} for $c_x=c_y=0.05$. With lower noise, strategy \textbf{LV} becomes less costly even for higher probabilities. This result agrees with the common intuition. With a lesser noise there is no need to ensure high clearance from the obstacles, thereby making strategy \textbf{HC} redundant. In fact, for a zero noise system, the trajectory with least control cost would just graze the obstacle. We would like to highlight that Fig.~ \ref{cost_intra_hom} and Fig.~\ref{cost_lessnoise} are intended to demonstrate the general trend in ratio of control costs. An in depth analysis of the exact values and their dependence on the initial conditions of the optimization are beyond the scope of this current study. \begin{figure}[!h] \centering \includegraphics[width= 8.3cm, height=3.7cm] {cost_inter_hom_loewnoise.eps} \caption{ The ratio of the control costs between the two strategies, $\frac{J_U^{LV}}{J_U^{HC}}$, as a function of $\eta$ for noise level of $c_x, c_y=0.05$. } \label{cost_lessnoise} \vspace{-0.4cm} \end{figure} \subsection{Modeling Choice of Homotopies} In this section, we discuss how choice of strategy of collision avoidance or in other words, choice of $\tau$ and $\lambda$ for a given $\eta$ affects control cost of trajectories in different homotopies. \subsubsection{Strategy \textbf{LV}} In Fig.~\ref{plot1comp_config1} and \ref{plot2comp_config1} solution trajectories of (\ref{opt2}) having same start and goal positions, but belonging to different homotopies and having different probability of avoidance, $\eta$, are depicted. The trajectories in both the homotopies were generated by choosing such values for $\tau$ and $\lambda$ that ensure collision avoidance by slowing down near the obstacles and reducing positional variance (strategy \textbf{LV}) rather than taking a large deviation from them. Thus, as $\eta$ increases from 0.9 (figure \ref{plot1comp_config1}) to 0.965 (figure \ref{plot2comp_config1}), we observe only a small change in arc length, but a significant change in the positional variance along the trajectories. Moreover, since trajectories of homotopy 2 move through a more cluttered environment, the reduction of positional variance along it is higher than that along trajectories of homotopy 1. It is possible to relate the change in positional variance as $\eta$ increases to the change in the control costs through the velocity profiles. Firstly, in contrast to Fig.~ \ref{plot1comp_vel_config1}, velocity profiles shown in Fig.~ \ref{plot2comp_vel_config1} are skewed; i.e, they have low magnitudes during the initial phases and a peak which is shifted towards the right. This is to ensure that velocity magnitudes (and thus positional variance) are low near the obstacles and reach peak only after crossing the obstacles. Since trajectories in homotopy 2 require a larger reduction in positional variance, the skewness observed in their velocity profile is also higher. Finally, the skewness in velocity profiles is accompanied with higher peak velocities. This is because of the fixed final time paradigm of the optimization, (\ref{opt2}). Since, magnitudes are low during initial phases of the trajectories, it needs to be compensated by moving faster in obstacle free space to ensure that the goal position is reached in specified time. Now, it is easy to deduce that a skewed velocity profile with higher peaks would mean higher accelerations and jerks and thus, consequently higher control costs. To summarize, for collision avoidance strategy \textbf{LV}, maintaining high $\eta$ requires larger reduction in positional variance leading to larger skewness in velocity profiles and consequently higher control costs. However, since trajectories in homotopy 2 require a larger reduction in positional variance, the control costs along it would increase at a higher rate than that along trajectories in homotopy 1. We demonstrate this last observation in Fig.~ \ref{cost_inter_hom} which shows the ratio of control costs along homotopy 1 and homotopy 2 for the various values of $\eta$. For lower values (till $\eta =0.9$), the cost along homotopy 1 and homotopy 2 are similar owing to their similar velocity profiles. However, for higher $\eta$, cost along homotopy 1 is significantly lower than that along homotopy 2. \begin{figure}[!h] \centering \subfigure[]{ \includegraphics[width= 4.6cm, height=3.5cm] {plot1comp_config11.eps} \label{plot1comp_config1} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.1cm, height=3.5cm] {plot1comp_vel_config11.eps} \label{plot1comp_vel_config1} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 4.6cm, height=3.5cm] {plot2comp_config11.eps} \label{plot2comp_config1} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.1cm, height=3.5cm] {plot2comp_vel_config11.eps} \label{plot2comp_vel_config1} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 8.3cm, height=3.7cm] {cost_inter_hom.eps} \label{cost_inter_hom} } \caption{Movements between the same start and goal locations and obstacle configurations but with different probability of avoidance. (a), (c) present the paths with standard deviation ellipses of the two homotopies. The obstacles are represented as blue filled circles and grey shaded region around them represent uncertainty about the size of the obstacle. (b), (d) present the velocity profiles. (e) the ratio of the control costs between the two homotopies, $\frac{J_U^{H_1}}{J_U^{H_2}}$, as a function of $\eta$. For the chosen avoidance strategy \textbf{LV}, the control cost along the homotopies is similar for low $\eta$. For higher $\eta$, the control cost along homotopy 1 is significantly less.} \end{figure} \begin{figure}[!h] \centering \subfigure[]{ \includegraphics[width= 4.6cm, height=3.5cm] {hom_comp_traj1.eps} \label{hom_comp_traj1} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.1cm, height=3.5cm] {hom_comp_vel_traj1.eps} \label{hom_comp_traj1_vel} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 4.6cm, height=3.5cm] {hom_comp_traj2.eps} \label{hom_comp_traj2} }\hspace{-0.8cm} \subfigure[]{ \includegraphics[width= 4.1cm, height=3.5cm] {hom_comp_vel_traj2.eps} \label{hom_comp_traj2_vel} }\vspace{-0.7cm} \subfigure[]{ \includegraphics[width= 8.3cm, height=3.7cm] {cost_inter_hom_strat1.eps} \label{cost_inter_hom_strat1} } \caption{Movements between the same start and goal locations and obstacle configurations but with different probability of avoidance, $\eta$ . The results are similar to that shown in Fig. 4, but trajectories are now computed with respect to strategy \textbf{HC}, which gives higher emphasis on clearance from obstacles for obstacle avoidance. (e): Ratio of control cost along the two homotopies,$\frac{J_U^{H_1}}{J_U^{H_2}}$ with respect to strategy \textbf{HC}. } \end{figure} \subsubsection{Strategy \textbf{HC}} Here we re-analyze the cost along homotopies for the same configuration as shown in Fig.~4, but with respect to strategy \textbf{HC} where there is a bigger reliance on clearance from the obstacles for collision avoidance. The trajectories along both the homotopies are shown in Fig.~ \ref{hom_comp_traj1} and \ref{hom_comp_traj2}. Comparing these trajectories with Fig.~\ref{plot1comp_config1} and \ref{plot2comp_config1}, demonstrates that there is a significant increase in clearance from the obstacles with increase in $\eta$. Thus, a lesser restriction is required on the growth of positional variance and consequently, the velocity profiles along trajectories in both the homotopy become very similar even at higher $\eta$ (figure \ref{hom_comp_traj2_vel}). This is very different from the comparisons shown in Fig.~ \ref{plot2comp_vel_config1}. The similarity in velocity trajectories in turn results in similar control costs along both the homotopies (figure \ref{cost_inter_hom_strat1}). In particular, the control cost along homotopies 1 and 2 are similar for a larger range of $\eta$. The lowest ratio of cost is $0.67$ in figure \ref{cost_inter_hom_strat1} for $\eta = 0.9615$. In comparison, the ratio was $0.33$ in figure \ref{cost_inter_hom} for the same $\eta$. \section{Discussion and Future Work} \label{disc} In this paper, we presented a stochastic optimal control problem with signal dependent noise and probabilistic collision avoidance constraints as a model of human reaching among obstacles. We then reformulated it into a parameter optimization problem. The parameters $\tau$ and $\lambda$ which appeared in the reformulated optimization problem, (\ref{opt2}) served as a mapping between the probability of collision avoidance, $\eta$, and possible collision avoidance strategies. The parameter $\tau$ models the clearance from the obstacles, and the parameter $\lambda$ models the effect of slowing down near the obstacles. In our simulations, we demonstrate that effect of these two parameters on movement paths and velocity profiles is in agreement with the experimental findings reported in \cite{Tressilian} for reach to grasp movements around obstacles. Specifically, they discussed two basic but coupled strategies of collision avoidance which consists of moving around the obstacle and slowing down. We showed how each avoidance strategy results in a unique variation of control costs with respect to $\eta$ both within and across homotopies. These variation in control costs can be used as a basis for predicting user behavior between a given start and goal position and for a given obstacle environment. For example, in Fig.~\ref{strat_comp_traj1}-\ref{strat_comp_traj2}, \ref{cost_intra_hom}, we showed that a risk-seeking behavior (low $\eta$) is more likely to use strategy \textbf{LV} for collision avoidance as it requires less control effort. In contrast, a risk-averse behavior (high $\eta$) would likely choose strategy \textbf{HC}. We also showed how control cost along different homotopies is dictated by the choice of avoidance strategy. This variation in control cost can be used to predict the homotopy selection by the human. In particular, if two competing homotopies have similar control costs, then the human would have equal affinity towards either of it, thus leading to a random behavior. However, as the ratio of control costs departs from unity, the possibility of selection would incline towards the lesser control costs, thus leading to more well defined pattern. Our proposed framework has the following limitations. Firstly, we used a very simple dynamic model, and thus, we necessarily do not capture every aspect of the motion of the human arm. A second order linear mechanical system or a non-linear model of a serial link robotic manipulator are a better alternative. The second order mechanical system can be easily incorporated because as long as the system is linear, the structure of the optimization (\ref{opt2}) would not change. In contrast, incorporating even a simple planar two-link manipulator model is more challenging, and may require methods similar to that proposed in \cite{todorov_obstacle}. Secondly, the fixed final time paradigm of optimization (\ref{opt2}) is not equipped to capture the effect of increase in traversal time of reaching motions due to presence of obstacles. A possible solution to this could be developed using the time scaling concepts \cite{bharath_iros15}. Our current study is limited to developing and approximating an efficient solution for the computational framework, and demonstrating the homotopies and strategies that can be explained within this framework, and we do not test our predictions against real reaching data. From our simulation study, we conclude that if the parameters $\tau$ and $\lambda$ are known, the possible choice of homotopy as well as choice of trajectory within that homotopy can be predicted. Thus, currently our efforts are focused towards developing an inverse optimization framework which can automatically recover these parameters from example trajectories demonstrated by the human. \bibliographystyle{IEEEtran}
{'timestamp': '2018-03-28T02:24:43', 'yymm': '1701', 'arxiv_id': '1701.01547', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01547'}
arxiv
\section{Introduction} According to the study of Prof. Webb~\cite{Webb2007Wireless,LopezPerez15Towards}, the wireless capacity has increased about 1 million fold from 1950 to 2000. Data shows that around $2700\times$ improvement was achieved by cell splitting and network densification, while the rest of the gain, was mainly obtained from the use of a wider spectrum, better coding techniques, and modulation schemes. In this context, \emph{network densification} has been and will still be the main force to achieve the $1000\times$ fold increase of data rates in the future fifth generation (5G) wireless networks~\cite{Andrews14What,Cisco16Visual}, due to its large spectrum reuse as well as its easy management. In this paper, we focus on the analysis of transitional behaviors for small cell networks (SCNs) using an orthogonal deployment with the existing macrocells, i.e., small cells and macrocells are operating on different frequency spectrum~\cite{Ge165G,Ge15Energy,Yang16Coverage,Yang15A}. Regarding the network performance of SCNs, a fundamental question is: \emph{What is the performance trend of SCNs as the base station (BS) density increases?} In this paper, we answer this question and identify four performance regimes based on BS density with considerations of non-line-of-sight (NLoS) and line-of-sight (LoS) transmissions. These four performance regimes are: (i) the noise-limited regime, (ii) the signal NLoS-to-LoS-transition regime, (iii) the interference NLoS-to-LoS-transition regime, and (iv) the dense interference-limited regime. To characterize the performance regime, we propose a unified framework analyzing the future 5G wireless networks over generalized shadowing/fading channels. % \begin{comment} Different from most previous work where the propagation path LoSs between the base staions (BSs) and the mobile users (MUs) is assumed to follow the same power-law model, irrespective of their distance, in this paper we consider both non-line-of-sight (NLoS) and line-of-sight (LoS) transmissions, which frequently occur in \emph{urban areas}. More specifically, BSs deployed according to a homogeneous Poisson point process (PPP) are divided into two categories, i.e., NLoS BSs and LoS BSs, depending on the distance between the BSs and the interested MU. As the density of the BSs grows continually, we consider the following two extreme cases. 1) When the wireless network is extremely sparse, the typical MU is likely to be connected to a \textbf{NLoS BS} and the majority of interference are from \textbf{NLoS BSs} as well; 2) When the wireless network is ultra dense, the typical MU will be associated with a \textbf{LoS BS} with a great probability and the interference are mainly from \textbf{LoS BSs}, too. NLoS-to-LoS-transitions of useful signal as well as interference exist when the network becomes denser and denser. These transitions will have a major impact on the network performance, particularly for the coverage probability. In this work, we will study the performance impact of NLoS-to-LoS transition in dense SCNs in urban areas with a generalized shadowing/fading model. \end{comment} The main contributions of this paper are summarized as follows: \begin{itemize} \item We reveal the transitional behaviors from noise-limited regime to dense interference-limited regime in SCNs and analyze in detail the factors that affect the performance trend. The analysis results will benefit the design and management of SCNs in urban and rural areas with different BS deployment densities. \item We identify four performance regimes based on BS density. For the discovered regimes, we present tractable definitions for the regime boundaries. More specifically, \begin{itemize} \item The boundary between the noise-limited regime and the signal NLoS-to-LoS-transition regime; \item The boundary between the signal-dominated regime and the interference NLoS-to-LoS-transition regime; \item The boundary between the interference-dominated regime and the interference-limited regime. \end{itemize} \item An accurate SCN model and generalized theoretical analysis: For characterizing the NLoS-to-LoS transitional behaviors in SCNs, we propose a unified framework, in which the user association strategies based on the strongest instantaneous received power (SIRP) and the strongest average received power (SARP) can be studied, assuming generalized shadowing/fading channels, multi-slop path loss model and incorporating both NLoS and LoS transmissions. \end{itemize} \begin{comment} Placeholder \end{comment} The remainder of this paper is organized as follows. In Section \ref{sec:Motivation-and-Related}, motivations and some recent work closely related to ours are presented. Section \ref{sec:System-Model} introduces the system model and network assumptions. An important theorem used in the analysis on transforming the original network into an equivalent distance-dependent network, i.e., the Equivalence Theorem, is presented and proven in Section \ref{sec:Equivalence-Theorem-and}. Section \ref{sec:SINR-Coverage-Probability} studies the coverage probability and the ASE of SCNs, more specifically, several special cases are also investigated. In Section \ref{sec:Simulations}, the analytical results are validated via Monte Carlo simulations. Besides, the transitional behaviors are elaborated and tractable definitions for the regime boundaries are presented. Finally, Section \ref{sec:Conclusions-and-Future} concludes this paper and discusses possible future work. \section{\label{sec:Motivation-and-Related}Motivations and Related Work} The modeling of the spatial distribution of SCNs using stochastic geometry has resulted in significant progress in understanding the performance of cellular networks \cite{Andrews11A,Blaszczyszyn13Using,Dhillon14Downlink}. Random spatial point processes, especially the homogeneous Poisson point process (PPP), have now been widely used to model the locations of small cell BSs in various scenarios. Existing results are likely to analyze the performance assuming that the networks operate in the noise-limited regime or the interference-limited regime. However, the transitional behaviors from noise-limited regime to interference-limited regime were rarely mentioned in their work. Some assumptions in the system model were even conflicted with each other, e.g., in \cite{Singh15Tractable} and \cite{Bai15Coverage}, the millimeter wave networks were assumed to be noise-limited and interference-limited, respectively. Besides, most work is usually based on certain simplified assumptions, e.g., Rayleigh fading, a single path loss exponent with no thermal noise, etc, for analytical tractability, which may not hold in a more realistic scenario. For instance, consider a SCN in urban areas, the path loss model may not follow a single power law relationship in the near-filed and thus non-singular \cite{Liu17Effect,Khamesi16Energy} or multiple-slop path loss model \cite{Zhang15Downlink} should be applied. Besides, signal transmissions between BSs and MUs are frequently affected by reflection, diffraction, and even blockage due to high-rise buildings in urban areas, and thus NLoS/LoS transmissions should also be considered \cite{Bai15Coverage}. As a consequence, the detailed analysis of transitional behaviors are needed, with considerations of a more generalized propagation model incorporating both NLoS and LoS transmissions, to cope with these new characteristics in SCNs. A number of more recent work had a new look at dense SCNs considering more practical propagation models. The closest system model to the one in this paper are in \cite{ShokriGhadikolaei16The,Ding16Performance,Bai15Coverage,DiRenzo15StochasticJ,Singh15Tractable,Arnau16Impact,Liu17Effect,DiRenzo16The,Renzo13Average}. In \cite{ShokriGhadikolaei16The}, the transitional behaviors of interference in millimeter wave networks was analyzed, but it focused on the medium access control. In \cite{Bai15Coverage} and \cite{Ding16Performance}, the coverage probability and capacity were calculated based on the smallest path loss cell association model assuming multi-path fading modeled as Rayleigh fading and Nakagami-$m$ fading, respectively. However, shadowing was ignored in their models, which may not be very practical for a SCN. The authors of \cite{Singh15Tractable} and \cite{DiRenzo15StochasticJ} analyzed the coverage and capacity performance in millimeter wave cellular networks. In \cite{Singh15Tractable}, self-backhauled millimeter wave cellular networks were analyzed assuming a cell association scheme based on the smallest path loss. In \cite{DiRenzo15StochasticJ}, a three-state statistical model for each link was assumed, in which a link can either be in a NLoS, LoS or an outage state. Besides, both \cite{Singh15Tractable} and \cite{DiRenzo15StochasticJ} assumed a noise-limited network ignoring inter-cell interference, which may not be very practical since modern wireless networks generally work in an interference-limited region. In \cite{Arnau16Impact}, the authors assumed Rayleigh fading for NLoS transmissions and Nakagami-$m$ fading for LoS transmissions which is more practical than work in \cite{Ding16Performance}. However, the cell association scheme in \cite{Arnau16Impact} is only applicable to the scenario where the SINR threshold is greater than 0 dB. Besides, the ASE performance was not analyzed in \cite{Arnau16Impact}. In \cite{Liu17Effect}, a near-filed path loss model with bounded path loss was studied. In \cite{DiRenzo16The}, a tractable performance evaluation method, i.e., the intensity matching, was proposed to model and optimize the networks. Renzo \emph{et al.} \cite{Renzo13Average} also introduced an analytical framework based on the strongest average received signal power associations scheme which is applicable to general fading distributions, including composite fading channels, to analyze the average rate of heterogeneous networks using a single-slope path loss model. To summarize, in this paper, we propose a more generalized framework to analyze the \emph{transitional behaviors} for SCNs compared with the work in \cite{ShokriGhadikolaei16The,Ding16Performance,Bai15Coverage,DiRenzo15StochasticJ,Singh15Tractable,Arnau16Impact,Liu17Effect,DiRenzo16The}. Our framework takes into account a cell association scheme based on the strongest received signal power, probabilistic NLoS and LoS transmissions, multi-slop path loss model, multi-path fading and/or shadowing. Furthermore, the proposed framework can also be applied to analyze dense SCNs, where BSs are distributed according to non-homogeneous PPPs, i.e., the BS density is spatially varying. \section{\label{sec:System-Model}System Model} We consider a homogeneous SCN in urban areas and focus on the analysis of downlink performance. We assume that BSs are spatially distributed on an infinite plane and the locations of BSs $\boldsymbol{X}_{i}$ follow a homogeneous PPP denoted by $\Phi=\left\{ \boldsymbol{X}_{i}\right\} $ with an density of $\lambda$, where $i$ is the BS index \cite{Ge14Performance}. MUs are deployed according to another independent homogeneous PPP denoted by $\Phi_{\textrm{u}}$ with an density of $\lambda_{\textrm{u}}$. All BSs in the network operate at the same power $P_{\textrm{t}}$ and share the same bandwidth. Within a cell, MUs use orthogonal frequencies for downlink transmissions and therefore \emph{intra-cell interference} is not considered in our analysis. However, adjacent BSs may generate \emph{inter-cell interference} to MUs, which is the primary focus of our work. \subsection{\label{subsec:Signal-Propagation-Model}Path Loss Model} In a downlink SCN, the long-distance signal attenuation is modeled by a monotone, non-increasing and continuous path loss function $l\left(R_{i}\right):\left[0,\infty\right]\mapsto\left[0,\infty\right]$ and $l\left(R_{i}\right)$ decays to zero asymptotically, where $R_{i}=\left\Vert \boldsymbol{X}_{i}\right\Vert $ denotes the Euclidean distance between a BS at $\boldsymbol{X}_{i}$ and the typical MU (aka the probe MU or the tagged MU) located at the origin $o$. Specifically, a multi-slop path loss function \cite{Zhang15Downlink,Ding16Performance} is utilized in which the distance $R_{i}$ is segmented into $N$ pieces. Compared with the single-slope path loss model, the multi-slope path loss model is more flexible and can characterize the future networks instead of only depending on the existing cellular works. Besides, the standard path loss model does not accurately capture the dependence of the path loss exponent $\alpha$ on the link distance in many important situations \cite{Zhang15Downlink,Ding16Performance}. The multi-slop path loss function is written as \begin{equation} l\left(R_{i}\right)=\begin{cases} l_{1}\left(R_{i}\right), & \textrm{when }0\leqslant R_{i}\leqslant d_{1}\\ l_{2}\left(R_{i}\right), & \textrm{when }d_{1}<R_{i}\leqslant d_{2}\\ \vdots & \vdots\\ l_{N}\left(R_{i}\right), & \textrm{when }R_{i}>d_{N-1} \end{cases},\label{eq:prop_PL_model} \end{equation} where each piece $l_{n}\left(R_{i}\right),n\in\left\{ 1,2,\ldots,N\right\} \triangleq\mathcal{N}$ incorporates both NLoS and LoS transmissions, whose performance impact is attracting growing interest among researchers recently. In reality, the occurrence of NLoS or LoS transmissions depends on various environmental factors, including geographical structure, distance, and clusters, etc. Note that the corresponding points in each region form independent point processes denoted by $\Phi_{n},n\in\mathcal{N}$, i.e., \begin{equation} \begin{cases} \Phi_{1}\triangleq\left\{ \boldsymbol{X}_{i}\left|\left\Vert \boldsymbol{X}_{i}\right\Vert \in\left[0,d_{1}\right]\right.\right\} , & \textrm{when }n=1\\ \Phi_{n}\triangleq\left\{ \boldsymbol{X}_{i}\left|\left\Vert \boldsymbol{X}_{i}\right\Vert \in\left(d_{n-1},d_{n}\right]\right.\right\} , & \textrm{when }n\notin\left\{ 1,N\right\} \\ \Phi_{N}\triangleq\left\{ \boldsymbol{X}_{i}\left|\left\Vert \boldsymbol{X}_{i}\right\Vert \in\left(d_{N-1},\infty\right]\right.\right\} , & \textrm{when }n=N \end{cases}. \end{equation} In the following, we give a simplified one-parameter model of NLoS and LoS transmissions. The occurrence of NLoS and LoS transmissions in each piece $l_{n}\left(R_{i}\right)$ can be modeled using probabilities $p_{n}^{\textrm{NL}}\left(R_{i}\right)$ and $p_{n}^{\textrm{L}}\left(R_{i}\right)$, respectively, i.e., \begin{equation} l\left(R_{i}\right)\hspace{-0.1cm}=\hspace{-0.1cm}\begin{cases} \hspace{-0.2cm}\begin{array}{l} l_{n}^{\textrm{NL}}\left(R_{i}\right),\\ l_{n}^{\textrm{L}}\left(R_{i}\right), \end{array} & \hspace{-0.2cm}\hspace{-0.3cm}\begin{array}{l} \textrm{with probability:}~p_{n}^{\textrm{NL}}\left(R_{i}\right)\\ \textrm{with probability:}~p_{n}^{\textrm{L}}\left(R_{i}\right) \end{array}\hspace{-0.1cm},\end{cases}\label{eq:PL_BS2UE} \end{equation} where $l_{n}^{\textrm{NL}}\left(R_{i}\right)$ and $l_{n}^{\textrm{L}}\left(R_{i}\right)$ are the $n$-th piece path loss functions for the NLoS transmission and the LoS transmission, respectively, $p_{n}^{\textrm{NL}}\left(R_{i}\right)$ and $p_{n}^{\textrm{NL}}\left(R_{i}\right)$ are the probabilities that the transmissions are NLoS and LoS, respectively, moreover, $p_{n}^{\textrm{NL}}\left(R_{i}\right)$+$p_{n}^{\textrm{L}}\left(R_{i}\right)=1$. Regarding the mathematical form of $p_{n}^{\textrm{L}}\left(R_{i}\right)$ (or $p_{n}^{\textrm{NL}}\left(R_{i}\right)$), N. Blaunstein~\cite{Blaunstein98Parametric} formulated $p_{n}^{\textrm{L}}\left(R_{i}\right)$ as a negative exponential function, i.e., $p_{n}^{\textrm{L}}\left(R_{i}\right)=e^{-\kappa R_{i}}$, where $\kappa$ is a parameter determined by the density and the mean length of the blockages lying in the visual path between the typical MU and BSs. Bai~\cite{Bai14Analysis} extended N. Blaunstein's work by using random shape theory which shows that $\kappa$ is not only determined by the mean length but also the mean width of the blockages. The authors of~\cite{DiRenzo15StochasticJ} and~\cite{Bai14Analysis} approximated $p_{n}^{\textrm{L}}\left(R_{i}\right)$ by piece-wise functions and step functions, respectively. Ming \emph{et al.}~\cite{Ding16Performance} considered $p_{n}^{\textrm{L}}\left(R_{i}\right)$ as a linear function and a two-piece exponential function, respectively, both recommended by the 3GPP \cite{3GPP36828,3GPPSpatial2003}. It should be noted that the occurrence of NLoS (or LoS) transmissions is assumed to be independent for different BS-MU pairs. Though such assumption might not be entirely realistic, e.g., NLoS transmissions for nearby MUs caused by a large obstacle may be spatially correlated, the authors of~\cite{Bai14Analysis} showed that the impact of the independence assumption on the SINR analysis is negligible. In general, NLoS and LoS transmissions incur different path losses, which are formulated by\footnote{As the derivations in scenarios with log-normal shadowing is much more complicated than that with Rayleigh fading, we choose to take the former as an example. It is found in Eq. (\ref{eq:Power_N}) and Eq. (\ref{eq:Power_L}) that the model can also be applied to Rayleigh fading and other generalized shadowing/fading models.} \begin{equation} PL_{\textrm{dB},n}^{\textrm{NL}}=A_{\textrm{dB},n}^{\textrm{NL}}+\alpha_{n}^{\textrm{NL}}10\log_{10}R_{i}+\xi_{\textrm{dB},n}^{\textrm{NL}}, \end{equation} and \begin{equation} PL_{\textrm{dB},n}^{\textrm{L}}=A_{\textrm{dB},n}^{\textrm{L}}+\alpha_{n}^{\textrm{L}}10\log_{10}R_{i}+\xi_{\textrm{dB},n}^{\textrm{L}}, \end{equation} where the path loss is expressed in dB unit, $A_{\textrm{dB},n}^{\textrm{NL}}$ and $A_{\textrm{dB},n}^{\textrm{L}}$ are the $n$-th piece path losses at the reference distance (usually at 1 meter), $\alpha_{n}^{\textrm{NL}}$ and $\alpha_{n}^{\textrm{L}}$ are respectively the $n$-th piece path loss exponents for NLoS and LoS transmissions, $\xi_{\textrm{dB},n}^{\textrm{NL}}$ and $\xi_{\textrm{dB},n}^{\textrm{L}}$ are independent Gaussian random variables with zero means, i.e., $\xi_{\textrm{dB},n}^{\textrm{NL}}\sim\mathcal{N}\left(0,\left(\sigma_{n}^{\textrm{NL}}\right)^{2}\right)$ and $\xi_{\textrm{dB},n}^{\textrm{L}}\sim\mathcal{N}\left(0,\left(\sigma_{n}^{\textrm{L}}\right)^{2}\right)$, reflecting the signal attenuation caused by shadow fading. The corresponding model parameters can be found in~\cite{3GPP36828,Mao06Online,Mao09Graph,Mao13Road}. Accordingly, the $n$-th piece received signal power for NLoS and LoS transmissions in W (watt) can be respectively expressed by \begin{equation} P_{i,n}^{\textrm{NL}}=P_{\textrm{t}}\cdot10^{-A_{\textrm{dB},n}^{\textrm{NL}}/10}\mathcal{H}_{i,n}^{\textrm{NL}}\left(R_{i}\right)^{-\alpha_{n}^{\textrm{NL}}}=B_{n}^{\textrm{NL}}\mathcal{H}_{i,n}^{\textrm{NL}}l_{n}^{\textrm{NL}}\left(R_{i}\right),\label{eq:Power_N} \end{equation} and \begin{equation} P_{i,n}^{\textrm{L}}=P_{\textrm{t}}\cdot10^{-A_{\textrm{dB},n}^{\textrm{L}}/10}\mathcal{H}_{i,n}^{\textrm{L}}\left(R_{i}\right)^{-\alpha_{n}^{\textrm{L}}}=B_{n}^{\textrm{L}}\mathcal{H}_{i,n}^{\textrm{L}}l_{n}^{\textrm{L}}\left(R_{i}\right),\label{eq:Power_L} \end{equation} where $\mathcal{H}_{i,n}^{\textrm{NL}}=\exp\left(\beta\xi_{\textrm{dB},n}^{\textrm{NL}}\right)$ (or $\mathcal{H}_{i,n}^{\textrm{L}}=\exp\left(\beta\xi_{\textrm{dB},n}^{\textrm{L}}\right)$ ) denotes log-normal shadowing for NLoS (or LoS) transmission, and $B_{n}^{\textrm{NL}}=P_{\textrm{t}}\cdot10^{-A_{\textrm{dB},n}^{\textrm{NL}}/10}$, $B_{n}^{\textrm{L}}=P_{\textrm{t}}\cdot10^{-A_{\textrm{dB},n}^{\textrm{L}}/10}$ and $\beta=-\ln10/10$ are all constants. Note that usually it is assumed that shadowing among different BS-MU pairs are mutually independent and identically distributed (i.i.d.) and also independent of BS locations \cite{Dhillon14Downlink,Andrews11A}, thus $\mathcal{H}_{i,n}^{\textrm{NL}}$ and $\mathcal{H}_{i,n}^{\textrm{L}}$ can be denoted as $\mathcal{H}_{n}^{\textrm{NL}}$ and $\mathcal{H}_{n}^{\textrm{L}}$, respectively, for the the convenience of expression. Moreover, if we replace $\mathcal{H}_{n}^{\textrm{NL}}$ (or $\mathcal{H}_{n}^{\textrm{L}}$ ) by multi-path fading, i.e., $h_{n}^{\textrm{NL}}$ (or $h_{n}^{\textrm{L}}$ ) the model can also be applied. Therefore, the received power by the typical MU from BS $\boldsymbol{X}_{i}$ is given by Eq. (\ref{eq:P_received}): \begin{algorithm*} \begin{singlespace} \noindent \begin{equation} P_{i}\left(R_{i}\right)=\begin{cases} P_{i,1}\left(R_{i}\right)=\begin{cases} \begin{array}{l} P_{i,1}^{\textrm{NL}}\left(R_{i}\right)=B_{1}^{\textrm{NL}}\mathcal{H}_{i,1}^{\textrm{NL}}l_{1}^{\textrm{NL}}\left(R_{i}\right),\\ P_{i,1}^{\textrm{L}}\left(R_{i}\right)=B_{1}^{\textrm{L}}\mathcal{H}_{i,1}^{\textrm{L}}l_{1}^{\textrm{L}}\left(R_{i}\right), \end{array} & \hspace{-0.3cm}\begin{array}{l} \textrm{with probability: }p_{1}^{\textrm{NL}}\left(R_{i}\right)\\ \textrm{with probability: }p_{1}^{\textrm{L}}\left(R_{i}\right) \end{array}\end{cases}\hspace{-0.3cm}, & \hspace{-0.3cm}\textrm{when }0\leqslant R_{i}\leqslant d_{1}\\ P_{i,2}\left(R_{i}\right)=\begin{cases} \begin{array}{l} P_{i,2}^{\textrm{NL}}\left(R_{i}\right)=B_{2}^{\textrm{NL}}\mathcal{H}_{i,2}^{\textrm{NL}}l_{2}^{\textrm{NL}}\left(R_{i}\right),\\ P_{i,2}^{\textrm{L}}\left(R_{i}\right)=B_{2}^{\textrm{L}}\mathcal{H}_{i,2}^{\textrm{L}}l_{2}^{\textrm{L}}\left(R_{i}\right), \end{array} & \hspace{-0.3cm}\begin{array}{l} \textrm{with probability: }p_{2}^{\textrm{NL}}\left(R_{i}\right)\\ \textrm{with probability: }p_{2}^{\textrm{L}}\left(R_{i}\right) \end{array}\end{cases}\hspace{-0.3cm}, & \hspace{-0.3cm}\textrm{when }d_{1}<R_{i}\leqslant d_{2}\\ \vdots & \vdots\\ P_{i,N}\left(R_{i}\right)=\begin{cases} \begin{array}{l} P_{i,N}^{\textrm{NL}}\left(R_{i}\right)=B_{N}^{\textrm{NL}}\mathcal{H}_{i,N}^{\textrm{NL}}l_{N}^{\textrm{NL}}\left(R_{i}\right),\\ P_{i,N}^{\textrm{L}}\left(R_{i}\right)=B_{N}^{\textrm{L}}\mathcal{H}_{i,N}^{\textrm{L}}l_{N}^{\textrm{L}}\left(R_{i}\right), \end{array} & \hspace{-0.3cm}\begin{array}{l} \textrm{with probability: }p_{N}^{\textrm{NL}}\left(R_{i}\right)\\ \textrm{with probability: }p_{N}^{\textrm{L}}\left(R_{i}\right) \end{array}\end{cases}\hspace{-0.3cm}, & \hspace{-0.3cm}\textrm{when }R_{i}>d_{N-1} \end{cases}.\label{eq:P_received} \end{equation} \end{singlespace} \end{algorithm*} Based on the path loss model discussed above, for downlink transmissions, the SINR experienced by the typical MU associated with BS $\boldsymbol{X}_{i}$ can be written as \begin{align} \textrm{SINR}_{i} & =\frac{S}{I+\eta}=\frac{P_{i}\left(R_{i}\right)}{\underset{\boldsymbol{X}_{z}\in\Phi\setminus\boldsymbol{X}_{i}}{\sum}P_{z}\left(R_{z}\right)+\eta},\label{eq:SINR} \end{align} where $\Phi\setminus\boldsymbol{X}_{i}$ is the Palm point process~\cite{Chiu13Stochastic} representing the set of interfering BSs in the network to the typical MU and $\eta$ denotes the noise power at the MU side, which is assumed to be the additive white Gaussian noise (AWGN). For clarity, we summarize the notation used in Table \ref{tab:Notation-Summary} for quick access. \begin{table} \caption{\label{tab:Notation-Summary}Notation and Simulation Parameters Summary} \begin{tabular}{|l|>{\raggedright}m{4.5cm}|>{\raggedright}m{1.6cm}|} \hline Notation & Explanation & Value (if applicable)\tabularnewline \hline \hline $\Phi$, $\lambda$ & Homogeneous BS PPP and its density & \tabularnewline \hline $\Phi_{n}^{\textrm{NL}}$, $\Phi_{n}^{\textrm{L}}$ & NLoS BS PPP and LoS BS PPP, $\Phi_{n}=\Phi_{n}^{\textrm{NL}}\cup\Phi_{n}^{\textrm{L}}$ & \tabularnewline \hline $\overline{\Phi_{n}^{\textrm{NL}}}$, $\overline{\Phi_{n}^{\textrm{L}}}$ & Equivalent NLoS BS PPP and equivalent LoS BS PPP & \tabularnewline \hline $P_{t}$ & BS transmission power & 30 dBm\tabularnewline \hline $\mathcal{H}_{n}^{\textrm{NL}}$, $\mathcal{H}_{n}^{\textrm{L}}$ & Log-normal shadowing for NLOS and LOS transmissions & \tabularnewline \hline $A_{n}^{\textrm{NL}}$ , $A_{n}^{\textrm{L}}$ & Path loss at the the reference distance (1m) & 30.8, 2.7 \cite{3GPP36828}\tabularnewline \hline $\sigma_{n}^{\textrm{NL}}$, $\sigma_{n}^{\textrm{L}}$ & Standard deviation of shadowing for NLoS and LoS transmissions & 4 dB, 3 dB \cite{3GPP36828}\tabularnewline \hline $\mu_{n}^{\textrm{NL}}$, $\mu_{n}^{\textrm{L}}$ & Rate of Rayleigh fading for NLoS and LoS transmissions & 1, 1\tabularnewline \hline $\alpha_{n}^{\textrm{NL}}$, $\alpha_{n}^{\textrm{L}}$ & Path loss exponents for NLoS and LoS transmissions & 4.28, 2.42 \cite{3GPP36828}\tabularnewline \hline $\eta$ & Noise power & -95 dBm \cite{3GPP36828}\tabularnewline \hline $\overline{R_{i,n}^{\textrm{NL}}}$, $\overline{R_{i,n}^{\textrm{L}}}$ & Equivalent distance for NLoS and LoS transmissions & \tabularnewline \hline $\Lambda_{n}^{\textrm{NL}}$, $\Lambda_{n}^{\textrm{L}}$ & Intensity measure of $\overline{\Phi^{\textrm{NL}}}$ and $\overline{\Phi^{\textrm{L}}}$ & \tabularnewline \hline $\lambda_{n}^{\textrm{NL}}$, $\lambda_{n}^{\textrm{L}}$ & Intensity of $\overline{\Phi^{\textrm{NL}}}$ and $\overline{\Phi^{\textrm{L}}}$ & \tabularnewline \hline $d$ & Radius of LoS region & 250 m \cite{Bai15Coverage,Singh15Tractable}\tabularnewline \hline $T$ & SINR (or SIR) threshold & 0 dB\tabularnewline \hline $I$, $I^{\textrm{NL}}$, $I^{\textrm{L}}$ & Aggregate interference, aggregate interference from NLoS and LoS transmissions & \tabularnewline \hline \end{tabular} \end{table} \subsection{Cell Association Scheme} Considering NLoS and LoS transmissions, two cell association schemes can be studied, based on the strongest average received power and the strongest instantaneous SINR, respectively. As for the strongest instantaneous SINR association, the typical MU associates itself to the BS $\boldsymbol{X}_{i}^{*}$ given by \begin{align} \boldsymbol{X}_{i}^{*} & =\arg\underset{\boldsymbol{X}_{i}\in\Phi}{\max}\left\{ \textrm{SINR}_{i}\right\} .\label{eq:maxSINR} \end{align} Intuitively, the strongest instantaneous SINR association is equivalent to the strongest instantaneous received signal power association. Such intuition is formally presented and proved in Lemma~\ref{lem: lem1}. \begin{lem} \label{lem: lem1}For a non-negative set $\Xi=\left\{ a_{q}\right\} $, $q\in\mathbb{N}$, $\frac{a_{m}}{\underset{q\neq m}{\sum}a_{q}+W}>\frac{a_{n}}{\underset{q\neq n}{\sum}a_{q}+W}$ if and only if $a_{m}>a_{n}$, $\forall a_{m},a_{n}\in\Xi$. \end{lem} \begin{IEEEproof} For a non-negative set $\Xi=\left\{ a_{q}\right\} $, $q\in\mathbb{N}$, $\frac{a_{m}}{\underset{q}{\sum}a_{q}+W}>\frac{a_{n}}{\underset{q}{\sum}a_{q}+W}$ if and only if $a_{m}>a_{n}$, thus $\frac{a_{m}}{\underset{q}{\sum}a_{q}+W-a_{m}}>\frac{a_{n}}{\underset{q}{\sum}a_{q}+W-a_{n}}$ if and only if $a_{m}>a_{n}$, which completes the proof. \end{IEEEproof} Lemma \ref{lem: lem1} states that providing the strongest instantaneous SINR is equivalent to providing the strongest instantaneous received power to the typical MU. It follows from Eq. (\ref{eq:maxSINR}) and Lemma \ref{lem: lem1} that the BS associated with the typical MU can also be written as \begin{align} \left(\boldsymbol{X}_{i},\textrm{U},\mathcal{N}\right)^{*} & =\arg\underset{(\boldsymbol{X}_{i},\textrm{U},\mathcal{N})\in\mathbb{S}}{\max}\left\{ B_{n}^{\textrm{U}}h_{n}^{\textrm{U}}\left(R_{i}\right)^{-\alpha_{n}^{\textrm{U}}}\right\} ,\label{eq:inspower} \end{align} where $\boldsymbol{X}_{i}\in\Phi$, $\textrm{U}\in\left\{ \textrm{NL},\textrm{L}\right\} $ and the set $\mathbb{S}=\Phi\times\left\{ \textrm{NL},\textrm{L}\right\} \times\mathcal{N}$. Note that under SIRP, we ignore shadowing, i.e., $\mathcal{H}_{n}^{\textrm{U}}$, for the sake of simplicity. As for the SARP, the typical MU associates itself to the BS $\left(\boldsymbol{X}_{i},\textrm{U},\mathcal{N}\right)^{*}$ given by \begin{align} \left(\boldsymbol{X}_{i},\textrm{U},\mathcal{N}\right)^{*} & =\arg\underset{(\boldsymbol{X}_{i},\textrm{U},\mathcal{N})\in\mathbb{S}}{\max}\left\{ B_{n}^{\textrm{U}}\mathcal{H}_{n}^{\textrm{NL}}\left(R_{i}\right)^{-\alpha_{n}^{\textrm{U}}}\right\} .\label{eq:avepower} \end{align} Note that under SARP, we ignore multi-path fading, i.e., $h_{n}^{\textrm{U}}$, for the sake of simplicity. In the following, both cell association schemes will be studied to characterize the network performance. \section{\label{sec:Equivalence-Theorem-and}The Equivalence of SCNs } Before presenting our main analytical results, firstly we introduce the Equivalence Theorem which will be used throughout the paper. The purpose of introducing the Equivalence Theorem is to unify the analysis considering different multi-path fading and/or shadowing, and to reduce the complexity of our theoretical analysis. Then based on this theorem, we derive the cumulative distribution function (CDF) of the strongest received signal power. \subsection{The Equivalence of SCNs} In this subsection, an equivalent SCN to the one being analyzed will be introduced, which specifies how the intensity measure and the intensity are changed after a transformation of original PPPs. Under SARP, denoting by \begin{equation} \overline{R_{i,n}^{\textrm{NL}}}=R_{i}\cdot\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{-1/\alpha_{n}^{\textrm{NL}}}\label{eq:R_N} \end{equation} and \begin{equation} \overline{R_{i,n}^{\textrm{L}}}=R_{i}\cdot\left(B_{n}^{\textrm{L}}\mathcal{H}_{n}^{\textrm{L}}\right)^{-1/\alpha_{n}^{\textrm{L}}},\label{eq:R_L} \end{equation} the received signal power in Eq. (\ref{eq:Power_N}) and Eq. (\ref{eq:Power_L}) can be written as \begin{align} P_{i,n}^{\textrm{NL}} & =\left(\overline{R_{i,n}^{\textrm{NL}}}\right)^{-\alpha_{n}^{\textrm{NL}}}\label{eq:P_rec_N} \end{align} and \begin{align} P_{i,n}^{\textrm{L}} & =\left(\overline{R_{i,n}^{\textrm{L}}}\right)^{-\alpha_{n}^{\textrm{L}}}.\label{eq:P_rec_L} \end{align} Note that from the viewpoint of the typical MU, each BS in the infinite plane $\mathbb{R}^{2}$ is either a NLoS BS or a LoS BS. Accordingly, we perform a thinning procedure on points in the PPP $\Phi_{n}$ to model the distributions of NLoS BSs and LoS BSs, respectively. That is, each BS in $\Phi_{n}$ will be kept if a BS has a NLoS transmission with the typical MU, thus forming a new point process denoted by $\Phi_{n}^{\textrm{NL}}$ . While BSs in $\Phi_{n}\setminus\Phi_{n}^{\textrm{NL}}$ form another point process denoted by $\Phi_{n}^{\textrm{L}}$, representing the set of BSs with LoS path to the typical MU. As a consequence of the independence assumption between LoS and NLoS transmissions mentioned above, $\Phi_{n}^{\textrm{NL}}$ and $\Phi_{n}^{\textrm{L}}$ are two independent non-homogeneous PPPs with intensity\footnote{In this article, density and intensity have the same meaning.} $\lambda p_{n}^{\textrm{NL}}\left(R_{i}\right)$ and $\lambda p_{n}^{\textrm{L}}\left(R_{i}\right)$, respectively. Through the above transformation which scales the distances between the typical MU and all other BSs using Eq. (\ref{eq:R_N}) and (\ref{eq:R_L}), the scaled point process for NLoS BSs (or LoS BSs) still remains a PPP denoted by $\overline{\Phi_{n}^{\textrm{NL}}}$ (or $\overline{\Phi_{n}^{\textrm{L}}}$ ) according to the displacement theorem \cite[Theorem 1.3.9]{Baccelli09Stochastic}. In other words, $\overline{\Phi_{n}^{\textrm{NL}}}$ (or $\overline{\Phi_{n}^{\textrm{L}}}$ ) is obtained by randomly and independently displacing each point of $\Phi_{n}^{\textrm{NL}}$(or $\Phi_{n}^{\textrm{L}}$ ) to some new location according to the kernel $p=\Pr\left[\overline{R_{i,n}^{\textrm{NL}}}\in b\left(0,t\right)\right]$ (or $p=\Pr\left[\overline{R_{i,n}^{\textrm{L}}}\in b\left(0,t\right)\right]$ ). As the transformation is mutually independent, the new point process is still a PPP. The detailed proof can be obtained in \cite[Lemma 1]{Blaszczyszyn13Using} and we omitted it for space limitation. The intuition is that in the equivalent networks, the received signal power and cell association scheme are only dependent on the new equivalent distance $\overline{R_{i,n}^{\textrm{NL}}}$ (or $\overline{R_{i,n}^{\textrm{L}}}$ ) between the BSs and the typical MU, while the effects of transmit power, multi-path fading and shadowing are incorporated into the equivalent intensity (or the equivalent intensity measure) of the transformed point process. Besides, $\overline{\Phi_{n}^{\textrm{NL}}}$ and $\overline{\Phi_{n}^{\textrm{L}}}$ are mutually independent because of the independence between $\Phi_{n}^{\textrm{NL}}$ and $\Phi_{n}^{\textrm{L}}$. As a result, the performance analysis involving path loss, multi-path fading, shadowing, etc, can be handled in a unified framework, which motivates the following theorem. \begin{thm}[The Equivalence Theorem] \label{thm: Equivalence theorem} Assume that a general fading or shadowing satisfy $\mathbb{E}_{\mathcal{H}_{n}^{\textrm{U}}}\left[\left(\mathcal{H}_{n}^{\textrm{U}}\right)^{2/\alpha_{n}^{\textrm{U}}}\right]<\infty$. The system which consists of two non-homogeneous PPPs with intensities $\lambda p_{n}^{\textrm{NL}}\left(R_{i}\right)$ and $\lambda p_{n}^{\textrm{L}}\left(R_{i}\right)$ respectively, representing the sets of NLoS and LoS BSs, and in which each MU is associated with the BS providing the strongest received signal power is equivalent, in terms of performance to the typical MU located at the origin, to another system consisting of two non-homogeneous PPPs with intensities (functions) $\lambda_{n}^{\textrm{NL}}\left(\cdot\right)$ and $\lambda_{n}^{\textrm{L}}\left(\cdot\right)$ respectively, representing the sets of NLoS and LoS BSs, and in which the typical MU is associated with the nearest BS. Moreover, intensities (functions) $\lambda_{n}^{\textrm{NL}}\left(\cdot\right)$ and $\lambda_{n}^{\textrm{L}}\left(\cdot\right)$ are respectively given by \begin{equation} \lambda_{n}^{\textrm{NL}}\left(t\right)=\frac{\textrm{d}}{\textrm{d}t}\Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right)\label{eq:Lambda_N} \end{equation} and \begin{equation} \lambda_{n}^{\textrm{L}}\left(t\right)=\frac{\textrm{d}}{\textrm{d}t}\Lambda_{n}^{\textrm{L}}\left(\left[0,t\right]\right),\label{eq:Lambda_L} \end{equation} where \begin{equation} \Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right)=\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[2\pi\lambda\int_{R_{i}=d_{n-1}}^{R_{i,\max}^{\textrm{NL}}}p_{n}^{\textrm{NL}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right]\label{eq:Measure_N} \end{equation} and \begin{equation} \Lambda_{n}^{\textrm{L}}\left(\left[0,t\right]\right)=\mathbb{E}_{\mathcal{H}_{n}^{\textrm{L}}}\left[2\pi\lambda\int_{R_{i}=d_{n-1}}^{R_{i,\max}^{\textrm{L}}}p_{n}^{\textrm{L}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right],\label{eq:Measure_L} \end{equation} where $R_{i,\max}^{\textrm{NL}}=\min\left\{ d_{n},t\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{1/\alpha_{n}^{\textrm{NL}}}\right\} $ and $R_{i,\max}^{\textrm{L}}=\min\left\{ d_{n},t\left(B_{n}^{\textrm{L}}\mathcal{H}_{n}^{\textrm{L}}\right)^{1/\alpha_{n}^{\textrm{L}}}\right\} $. \end{thm} \begin{IEEEproof} See Appendix A. \end{IEEEproof} In \cite{Liu16Optimal}, a similar theorem which was also extended from Blaszczyszyn's work \cite{Blaszczyszyn13Using,Blaszczyszyn15Studying} was proposed to analyze a $n$-dimensional network, in which NLoS and LoS transmissions are not considered. By utilizing the Equivalence theorem above, the transformed cellular network has the exactly same performance for the typical MU with respect to the coverage probability and the ASE compared with the original network, which is proved in Appendix A and validated by Monte Carlo simulations in Section \ref{sec:Simulations}. After transformation, the received signal power and cell association scheme are only dependent on the equivalent distance between the BSs and the typical MU, i.e., $\overline{R_{i,n}^{\textrm{NL}}}$ and $\overline{R_{i,n}^{\textrm{L}}}$ , while the effects of transmit power, multi-path fading (under SIRP) and shadowing (under SARP) are incorporated into the equivalent intensity shown in Eq. (\ref{eq:Lambda_N}) and Eq. (\ref{eq:Lambda_L}). Therefore, the complexity of theoretical analysis can be significantly reduced. \begin{rem} From Lemma \ref{lem: lem1} and Theorem \ref{thm: Equivalence theorem}, any cell association scheme without considering the status of BSs and MUs, e.g., traffic load, spectrum usage of BSs and the battery capacity of MUs, is equivalent to or can be transformed to the nearest BS cell association scheme. \end{rem} \begin{rem} For log-normal shadowing, the condition of $\mathbb{E}_{\mathcal{H}_{n}^{\textrm{U}}}\left[\left(\mathcal{H}_{n}^{\textrm{U}}\right)^{2/\alpha_{n}^{\textrm{U}}}\right]<\infty$ is satisfied. While for a general case of shadowing or multi-path fading model, $\mathbb{E}_{\mathcal{H}_{n}^{\textrm{U}}}\left[\left(\mathcal{H}_{n}^{\textrm{U}}\right)^{2/\alpha_{n}^{\textrm{U}}}\right]<\infty$ can also be easily met due to the bounded fading in practice. \end{rem} In the next subsection, we will provide an application of the Equivalence theorem, i.e., using the equivalence theorem to derive the distribution of the strongest received signal power. \subsection{The Distribution of the Strongest Received Signal Power} In this subsection, we use stochastic geometry and Theorem \ref{thm: Equivalence theorem} to obtain the distribution of the strongest received signal power. Then we will use simulation results to validate our theoretical analysis. \begin{lem} \label{lem:CDF_strongest}Denote the strongest received signal power as $\mathcal{P}$, i.e., $\mathcal{P}=\max\left(P_{i}\right)$, the distribution of the strongest received signal power by the typical MU can be given by \begin{equation} \Pr\left[\mathcal{P}\leqslant\gamma\right]=\exp\left[-\Lambda^{\textrm{NL}}\left(\left[0,\gamma^{-1/\alpha^{\textrm{NL}}}\right]\right)-\Lambda^{\textrm{L}}\left(\left[0,\gamma^{-1/\alpha^{\textrm{L}}}\right]\right)\right],\label{eq:CDF_power} \end{equation} where $\Lambda^{\textrm{NL}}\left(\left[0,t\right]\right)$ and $\Lambda^{\textrm{L}}\left(\left[0,t\right]\right)$ are defined in Eq. (\ref{eq:Measure_N}) and Eq. (\ref{eq:Measure_L}), respectively. \end{lem} \begin{IEEEproof} See Appendix B. \end{IEEEproof} If a specific NLoS/LoS transmission model is given, the distribution of the strongest received signal power can be easily derived using Lemma \ref{lem:CDF_strongest}. The following is an example assuming that the LoS transmission probability follows a negative exponential distribution. Let's consider a special case which assumes that $N=2$, $l_{1}^{\textrm{NL}}\left(R_{i}\right)=l_{2}^{\textrm{NL}}\left(R_{i}\right)=B^{\textrm{NL}}\left(R_{i}\right)^{-\alpha^{\textrm{NL}}}$, $l_{1}^{\textrm{L}}\left(R_{i}\right)=l_{2}^{\textrm{L}}\left(R_{i}\right)=B^{\textrm{L}}\left(R_{i}\right)^{-\alpha^{\textrm{L}}}$ and $p_{1}^{\textrm{L}}\left(R_{i}\right)=p_{2}^{\textrm{L}}\left(R_{i}\right)=e^{-\kappa R_{i}}$, where $\kappa$ is a constant determined by the density and the mean length of blockages lying in the visual path between the typical MU and the connected BS \cite{Bai15Coverage}, then the CDF of the strongest received signal power is given by Eq. (\ref{eq:CDF_power}). Fig. \ref{fig:CDF-of-strongest} illustrates the CDF of the strongest received signal power and it can be seen that the simulation results perfectly match the analytical results. From Fig. \ref{fig:CDF-of-strongest}, we can find that over 50\% of the strongest received signal power is larger than -51 dBm when $\lambda=10\textrm{ BSs/k\ensuremath{m^{2}}}$ and this value increases by approximately 16 dB when $\lambda=10\textrm{0 BSs/k\ensuremath{m^{2}}}$, which indicates that the strongest received signal power improves as the BS density increases. \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig1} \par\end{centering} \caption{\label{fig:CDF-of-strongest}CDF of the strongest received signal power, $P_{t}=1$ W (30 dBm), log-normal shadowing with zero means, $\sigma^{\textrm{NL}}=4$ dB and $\sigma^{\textrm{L}}=3$ dB, simulation and analytical results.} \end{figure} \section{\label{sec:SINR-Coverage-Probability}The Coverage Probability and ASE Analysis} In downlink performance evaluation, for networks where BSs are random distributed according to a homogeneous PPP, it is sufficient to study the performance of the typical MU located at the origin $o$ to characterize the performance of a SCN using the Palm theory \cite[Eq. (4.71)]{Chiu13Stochastic}. In this section, the coverage probability and ASE are first investigated and then several special cases will be studied. \subsection{General Case and Main Result} The coverage probability is generally defined as the probability that the typical MU's measured SINR is greater than a designated threshold $T$, i.e., \begin{equation} p_{c}\left(\lambda,T\right)=\Pr\left[\textrm{SINR}>T\right], \end{equation} where the definition of SINR is given by Eq. (\ref{eq:SINR}) and the subscript $i$ is omitted here for simplicity. Now, we present a main result in this section on the coverage probability as follows. \begin{thm}[Coverage Probability] \label{thm:Pcoverage } Given that the signal propagation model follows Eq. (\ref{eq:P_received}) and the typical MU selects the serving BS according to Eq. (\ref{eq:inspower}) or Eq. (\ref{eq:avepower}), then the coverage probability $p_{c}\left(\lambda,T\right)$ can be evaluated by \begin{equation} p_{c}\left(\lambda,T\right)=\stackrel[n=1]{N}{\sum}p_{c,n}^{\textrm{L}}\left(\lambda,T\right)+\stackrel[n=1]{N}{\sum}p_{c,n}^{\textrm{NL}}\left(\lambda,T\right),\label{eq:theorem_pc} \end{equation} where \begin{align} & p_{c,n}^{\textrm{L}}\left(\lambda,T\right)=\int_{y=0}^{\infty}\int_{\omega=-\infty}^{\infty}\left[\frac{1-e^{-j\omega/T}}{2\pi j\omega}\right]\lambda_{n}^{\textrm{L}}\left(y\right)\nonumber \\ & \quad\,\times\exp\biggl\{-\Lambda_{n}^{\textrm{NL}}\left(\left[0,y^{\alpha_{n}^{\textrm{L}}/\alpha_{n}^{\textrm{NL}}}\right]\right)-\Lambda_{n}^{\textrm{L}}\left(\left[0,y\right]\right)+j\omega\eta y^{\alpha_{n}^{\textrm{L}}}\nonumber \\ & \quad\,+\int_{t=y^{\alpha_{n}^{\textrm{L}}/\alpha_{n}^{\textrm{NL}}}}^{\infty}\left[e^{j\omega y^{\alpha_{n}^{\textrm{L}}}t^{-\alpha_{n}^{\textrm{NL}}}}-1\right]\lambda_{n}^{\textrm{NL}}\left(t\right)\textrm{d}t\nonumber \\ & \quad\,+\int_{t=y}^{\infty}\left[e^{j\omega\left(y/t\right)^{\alpha_{n}^{\textrm{L}}}}-1\right]\lambda_{n}^{\textrm{L}}\left(t\right)\textrm{d}t\biggr\}\textrm{d}\omega\textrm{d}y\label{eq:theorem_pcL} \end{align} and \begin{align} & p_{c,n}^{\textrm{NL}}\left(\lambda,T\right)=\int_{y=0}^{\infty}\int_{\omega=-\infty}^{\infty}\left[\frac{1-e^{-j\omega/T}}{2\pi j\omega}\right]\lambda_{n}^{\textrm{NL}}\left(y\right)\nonumber \\ & \quad\,\times\exp\biggl\{-\Lambda_{n}^{\textrm{L}}\left(\left[0,y^{\alpha_{n}^{\textrm{NL}}/\alpha_{n}^{\textrm{L}}}\right]\right)-\Lambda_{n}^{\textrm{NL}}\left(\left[0,y\right]\right)+j\omega\eta y^{\alpha_{n}^{\textrm{NL}}}\nonumber \\ & \quad\,+\int_{t=y^{\alpha_{n}^{\textrm{NL}}/\alpha_{n}^{\textrm{L}}}}^{\infty}\left[e^{j\omega y^{\alpha_{n}^{\textrm{NL}}}t^{-\alpha_{n}^{\textrm{L}}}}-1\right]\lambda_{n}^{\textrm{L}}\left(t\right)\textrm{d}t\nonumber \\ & \quad\,+\int_{t=y}^{\infty}\left[e^{j\omega\left(y/t\right)^{\alpha_{n}^{\textrm{NL}}}}-1\right]\lambda_{n}^{\textrm{NL}}\left(t\right)\textrm{d}t\biggr\}\textrm{d}\omega\textrm{d}y,\label{eq:theorem_pcN} \end{align} where $j=\sqrt{-1}$ denotes the imaginary unit, $\lambda_{n}^{\textrm{NL}}\left(\cdot\right)$ and $\lambda_{n}^{\textrm{L}}\left(\cdot\right)$ are defined in Theorem \ref{thm: Equivalence theorem}. \end{thm} \begin{IEEEproof} See Appendix C. \end{IEEEproof} The coverage probability evaluated by Eq. (\ref{eq:theorem_pc}) in Theorem \ref{thm:Pcoverage } is at least a 3-fold integral which is somehow complicated for numerical computation. However, Theorem \ref{thm:Pcoverage } gives general results that can be applied to various multi-path fading or shadowing models, e.g., Rayleigh fading, Nakagami-$m$ fading, etc, and various NLoS/LoS transmission models as well. In the following, we turn our attention to a few relevant special cases where \begin{enumerate} \item NLoS transmissions and LoS transmissions are concatenated with different shadowing, which will be studied in Subsection \ref{subsec:NLOS-transmissions-and}; \item NLoS transmissions and LoS transmissions are concatenated with Nakagami-$m$ fading of different parameters, which will be studied in Subsection \ref{subsec:NLOS-and-LOS}; \item NLoS transmissions and LoS transmissions are concatenated with Rayleigh fading and Rician fading, respectively, which will be studied in Subsection \ref{subsec:NLOS-Transmission-+}. \item Composite Rayleigh fading, Rician fading and log-normal shadowing are considered in Subsection \ref{subsec:Composite-Rayleigh-Fading}. \end{enumerate} \subsection{\label{subsec:NLOS-transmissions-and}NLoS transmissions and LoS transmissions are concatenated with different shadowing} In the subsection, we assume that NLoS transmission and LoS transmission are concatenated with different log-normal shadowing. The association scheme is based on the SARP. Moreover, a simplified NLoS/LoS transmission model is used for a specific analysis, which is expressed by \begin{equation} p^{\textrm{L}}\left(R_{i}\right)=\begin{cases} 1, & \hspace{-0.3cm}R_{i}\in\left(0,d\right]\\ 0, & \hspace{-0.3cm}R_{i}\in\left(d,\infty\right] \end{cases}, \end{equation} where $d$ is a constant distance below which all BSs connect with the typical MU with LoS transmissions. This model has been used in some recent work \cite{Bai15Coverage,Singh15Tractable}. With assumptions above, the intensity measure for NLoS transmissions, i.e., $\Lambda_{\log}^{\textrm{NL}}\left(\cdot\right)$, is expressed as follows \begin{align} & \quad\,\Lambda_{\log}^{\textrm{NL}}\left(\left[0,t\right]\right)=\mathbb{E}_{\mathcal{H}^{\textrm{NL}}}\left[2\pi\lambda\int_{R_{i}=0}^{t\left(B^{\textrm{NL}}\mathcal{H}^{\textrm{NL}}\right)^{1/\alpha^{\textrm{NL}}}}p^{\textrm{NL}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right]\nonumber \\ & =\frac{1}{2}\pi\lambda t^{2}\left(B^{\textrm{NL}}\right)^{2/\alpha^{\textrm{NL}}}e^{1/M_{\textrm{NL}}^{2}}\textrm{erfc}\left[M_{\textrm{NL}}\ln t+Q_{\textrm{NL}}\right]\nonumber \\ & \quad\,-\frac{1}{2}\pi\lambda d^{2}\textrm{erfc}\left[M_{\textrm{NL}}\ln t+V_{\textrm{NL}}\right],\label{eq:Measure_N_lonormal} \end{align} where $\textrm{erfc}\left(\cdot\right)$ is the complementary error function, $M_{\textrm{NL}}=-\frac{\alpha^{\textrm{NL}}}{\sqrt{2}\sigma^{\textrm{NL}}}$, $Q_{\textrm{NL}}=\frac{\alpha^{\textrm{NL}}\ln d-\ln B^{\textrm{NL}}}{\sqrt{2}\sigma^{\textrm{NL}}}-\frac{1}{M_{\textrm{NL}}}$ and $V_{\textrm{NL}}=\frac{\alpha^{\textrm{NL}}\ln d-\ln B^{\textrm{NL}}}{\sqrt{2}\sigma^{\textrm{NL}}}$ are all constants. After obtaining $\Lambda_{\log}^{\textrm{NL}}\left(\cdot\right)$, the density of NLoS BSs, i.e., $\lambda_{\log}^{\textrm{NL}}\left(\cdot\right)$, can be readily derived as follows \begin{align} & \quad\,\lambda_{\log}^{\textrm{NL}}\left(t\right)=\frac{\textrm{d}}{\textrm{d}t}\Lambda^{\textrm{NL}}\left(\left[0,t\right]\right)\nonumber \\ & =\pi\lambda t\left(B^{\textrm{NL}}\right)^{2/\alpha^{\textrm{NL}}}e^{1/M_{\textrm{NL}}^{2}}\textrm{erfc}\left[M_{\textrm{NL}}\ln t+Q_{\textrm{NL}}\right]\nonumber \\ & \quad\,+\frac{M_{\textrm{NL}}\lambda\sqrt{\pi}d^{2}}{t}e^{-\left(M_{\textrm{NL}}\ln t+V_{\textrm{NL}}\right)^{2}}\nonumber \\ & \quad\,-M_{\textrm{NL}}\lambda t\sqrt{\pi}\left(B^{\textrm{NL}}\right)^{2/\alpha^{\textrm{NL}}}e^{1/M_{\textrm{NL}}^{2}-\left(M_{\textrm{NL}}\ln t+Q_{\textrm{NL}}\right)^{2}}.\label{eq:Intensity_N_lonormal} \end{align} Similarly, the intensity measure and density for LoS BSs are \begin{align} \Lambda_{\log}^{\textrm{L}}\left(\left[0,t\right]\right) & =\frac{1}{2}\pi\lambda t^{2}\left(B^{\textrm{L}}\right)^{2/\alpha^{\textrm{L}}}e^{1/M_{\textrm{L}}^{2}}\textrm{erfc}\left[M_{\textrm{L}}\ln t+Q_{\textrm{L}}\right]\nonumber \\ & \quad\,+\frac{1}{2}\pi\lambda d^{2}\textrm{erfc}\left[-M_{\textrm{L}}\ln t+V_{\textrm{L}}\right],\label{eq:Measure_L_lonormal} \end{align} \begin{align} \lambda_{\log}^{\textrm{L}}\left(t\right) & =\pi\lambda t\left(B^{\textrm{L}}\right)^{2/\alpha^{\textrm{L}}}e^{1/M_{\textrm{L}}^{2}}\textrm{erfc}\left[M_{\textrm{L}}\ln t+Q_{\textrm{L}}\right]\nonumber \\ & \quad\,+\frac{M_{\textrm{L}}\lambda\sqrt{\pi}d^{2}}{t}e^{-\left(-M_{\textrm{L}}\ln t+V_{\textrm{L}}\right)^{2}}\nonumber \\ & \quad\,-M_{\textrm{L}}\lambda t\sqrt{\pi}\left(B^{\textrm{L}}\right)^{2/\alpha^{\textrm{L}}}e^{1/M_{\textrm{L}}^{2}-\left(M_{\textrm{L}}\ln t+Q_{\textrm{L}}\right)^{2}},\label{eq:Intensity_L_lonormal} \end{align} respectively, where $M_{\textrm{L}}=\frac{\alpha^{\textrm{L}}}{\sqrt{2}\sigma^{\textrm{L}}}$, $Q_{\textrm{L}}=\frac{\ln B^{\textrm{L}}-\alpha^{\textrm{L}}\ln d}{\sqrt{2}\sigma^{\textrm{L}}}+\frac{1}{M_{\textrm{L}}}$ and $V_{\textrm{L}}=\frac{\alpha^{\textrm{L}}\ln d-\ln B^{\textrm{L}}}{\sqrt{2}\sigma^{\textrm{L}}}$ are all constants. By substituting $\lambda_{\log}^{\textrm{NL}}\left(\cdot\right)$ and $\lambda_{\log}^{\textrm{L}}\left(\cdot\right)$ above into Eq. (\ref{eq:theorem_pcL}) and Eq. (\ref{eq:theorem_pcN}), the coverage probability can be obtained in this specific scenario, followed by results in Section \ref{sec:Simulations}. In the above scenario, the shadowing follows log-normal distributions. However, Theorem \ref{thm:Pcoverage } can also be applied to a generalized fading model and the coverage probability will be derived in the next two sections. \subsection{\label{subsec:NLOS-and-LOS}NLoS and LoS Transmissions are Concatenated with Nakagami-$m$ Fading} Note that if we replace $\mathcal{H}^{\textrm{U}}$ by multi-path fading, i.e., $h^{\textrm{U}}$, Theorem \ref{thm:Pcoverage } also works for the scenario where the SIRP association is applied. In this subsection, we assume that both NLoS and LoS transmissions are concatenated with Nakagami-$m$ fading of different parameters, e.g., $m^{\textrm{NL}}$ and $m^{\textrm{L}}$, then the channel power gains are distributed according to Gamma distributions. That is, \begin{equation} f_{h^{\textrm{U}}}\left(h\right)=\frac{\left(m^{\textrm{U}}\right)^{m^{\textrm{U}}}}{\Gamma\left(m^{\textrm{U}}\right)}h^{m^{\textrm{U}}-1}e^{-m^{\textrm{U}}h}. \end{equation} By substituting the PDF of $h^{\textrm{U}}$ into Eq. (\ref{eq:Lambda_N}) \textendash{} Eq. (\ref{eq:Measure_L}), the intensity measures and intensities of $\overline{\Phi^{\textrm{NL}}}$ and $\overline{\Phi^{\textrm{L}}}$ can be readily obtained as follows \begin{align} & \Lambda_{\textrm{Naka}}^{\textrm{NL}}\left(\left[0,t\right]\right)=-\frac{\pi\lambda d^{2}}{\Gamma\left(m^{\textrm{NL}}\right)}\Gamma\left(m^{\textrm{NL}},\frac{m^{\textrm{NL}}}{B^{\textrm{NL}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{NL}}}\right)\nonumber \\ & +\frac{\pi\lambda t^{2}}{\Gamma\left(m^{\textrm{NL}}\right)}\left(\frac{B^{\textrm{NL}}}{m^{\textrm{NL}}}\right)^{\frac{2}{\alpha^{\textrm{NL}}}}\Gamma\left(\frac{2}{\alpha^{\textrm{NL}}}+m^{\textrm{NL}},\frac{m^{\textrm{NL}}}{B^{\textrm{NL}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{NL}}}\right),\label{eq:Measure_N_Nakagami} \end{align} \begin{align} & \Lambda_{\textrm{Naka}}^{\textrm{L}}\left(\left[0,t\right]\right)=\frac{\pi\lambda d^{2}}{\Gamma\left(m^{\textrm{L}}\right)}\Gamma\left(m^{\textrm{L}},\frac{m^{\textrm{L}}}{B^{\textrm{L}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{L}}}\right)\nonumber \\ & +\frac{\pi\lambda t^{2}}{\Gamma\left(m^{\textrm{L}}\right)}\left(\frac{B^{\textrm{L}}}{m^{\textrm{L}}}\right)^{\frac{2}{\alpha^{\textrm{L}}}}\gamma\left(\frac{2}{\alpha^{\textrm{L}}}+m^{\textrm{L}},\frac{m^{\textrm{L}}}{B^{\textrm{L}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{L}}}\right),\label{eq:Measure_L_Nakagami} \end{align} \begin{align} \lambda_{\textrm{Naka}}^{\textrm{NL}}\left(t\right) & =\frac{2\pi\lambda t}{\Gamma\left(m^{\textrm{NL}}\right)}\left(\frac{B^{\textrm{NL}}}{m^{\textrm{NL}}}\right)^{\frac{2}{\alpha^{\textrm{NL}}}}\nonumber \\ & \quad\,\times\Gamma\left(\frac{2}{\alpha^{\textrm{NL}}}+m^{\textrm{NL}},\frac{m^{\textrm{NL}}}{B^{\textrm{NL}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{NL}}}\right),\label{eq:Intensity_N_Nakagami} \end{align} and \begin{equation} \lambda_{\textrm{Naka}}^{\textrm{L}}\left(t\right)=\frac{2\pi\lambda t}{\Gamma\left(m^{\textrm{L}}\right)}\left(\frac{B^{\textrm{L}}}{m^{\textrm{L}}}\right)^{\frac{2}{\alpha^{\textrm{L}}}}\gamma\left(\frac{2}{\alpha^{\textrm{L}}}+m^{\textrm{L}},\frac{m^{\textrm{L}}}{B^{\textrm{L}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{L}}}\right),\label{eq:Intensity_L_Nakagami} \end{equation} respectively, where $\Gamma\left(s,x\right)=\int_{x}^{\infty}v^{s-1}e^{-v}\textrm{d}v$ and $\gamma\left(s,x\right)=\int_{0}^{x}v^{s-1}e^{-v}\textrm{d}v$ denote the upper and the lower incomplete gamma functions, respectively, $\Gamma\left(s\right)=\int_{0}^{\infty}v^{s-1}e^{-v}\textrm{d}v$ is the gamma function. The intermediate steps are easy to derive and thus omitted here. By incorporating Eq. (\ref{eq:Measure_N_Nakagami}) - (\ref{eq:Intensity_L_Nakagami}) into Eq. (\ref{eq:theorem_pcL}) and Eq. (\ref{eq:theorem_pcN}), the coverage probability of a SCN experiencing Nakagami-$m$ fading can be calculated. \subsection{\label{subsec:NLOS-Transmission-+}NLoS Transmission + Rayleigh Fading and LoS Transmission + Rician Fading} In this part, we consider a more common case in which NLoS transmission and LoS transmission are concatenated with Rayleigh fading and Rician fading, respectively, i.e., $h^{\textrm{NL}}$ follows an exponential distribution and $h^{\textrm{L}}$ follows a non-central Chi-squared distribution. With $m=\left(K+1\right)^{2}/2K+1$, Rician fading can be approximated by a Nakagami-$m$ distribution~\cite{Goldsmith05Wireless}, where $K$ is the Rician $K$-factor representing the ratio between the power of the direct path and that of the scattered paths. Without loss of generality, we assume $f_{h^{\textrm{NL}}}\left(h\right)=e^{-h}$ and $f_{h^{\textrm{L}}}\left(h\right)=\frac{m^{m}}{\Gamma\left(m\right)}h^{m-1}e^{-mh}$ for NLoS and LoS transmissions, respectively. As we have provided the intensity measure and intensity of $\overline{\Phi^{\textrm{L}}}$ experiencing Nakagami-$m$ fading in the previous subsection, in this part we just provide the intensity measures and intensities of $\overline{\Phi^{\textrm{NL}}}$. By substituting the PDF of $h^{\textrm{NL}}$ into Eq. (\ref{eq:Measure_N}) and Eq. (\ref{eq:Lambda_N}), $\Lambda_{\textrm{Ray}}^{\textrm{NL}}\left(\left[0,t\right]\right)$ and $\lambda_{\textrm{Ray}}^{\textrm{NL}}\left(t\right)$ can be easily evaluated by \begin{align} \Lambda_{\textrm{Ray}}^{\textrm{NL}}\left(\left[0,t\right]\right) & =\pi\lambda t^{2}\left(B^{\textrm{NL}}\right)^{\frac{2}{\alpha^{\textrm{NL}}}}\Gamma\left(\frac{2}{\alpha^{\textrm{NL}}}+1,\frac{1}{B^{\textrm{NL}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{NL}}}\right)\nonumber \\ & -\pi\lambda d^{2}\exp\left[-\frac{\left(d/t\right)^{\alpha^{\textrm{NL}}}}{B^{\textrm{NL}}}\right],\label{eq:Measure_N_Rayleigh} \end{align} and \begin{equation} \lambda_{\textrm{Ray}}^{\textrm{NL}}\left(t\right)=2\pi\lambda t\left(B^{\textrm{NL}}\right)^{\frac{2}{\alpha^{\textrm{NL}}}}\Gamma\left(\frac{2}{\alpha^{\textrm{NL}}}+1,\frac{1}{B^{\textrm{NL}}}\left(\frac{d}{t}\right)^{\alpha^{\textrm{NL}}}\right),\label{eq:Intensity_N_Rayleigh} \end{equation} respectively. After substituting the intensity measures and intensities of $\overline{\Phi^{\textrm{NL}}}$ and $\overline{\Phi^{\textrm{L}}}$ into Eq. (\ref{eq:theorem_pcN}) and Eq. (\ref{eq:theorem_pcL}), the coverage probability can be obtained and we omit the rest derivations. \subsection{\label{subsec:Composite-Rayleigh-Fading}Composite Rayleigh Fading, Rician Fading and Log-normal Shadowing} Inspired by \cite{Renzo13Average} which takes composite fading into consideration, in this subsection both fading and shadowing will be considered simultaneously. In \cite{Liu16Optimal}, a channel gain PDF which characterizes the composite effect of Rayleigh fading and log-normal shadowing is given by \begin{equation} f_{H}\left(h\right)=\frac{1}{\sqrt{2\pi\sigma_{s}^{2}}}\int_{x=0}^{\infty}\frac{1}{x^{2}}e^{-\frac{h}{x}-\frac{\left(\ln x-\mu_{s}\right)^{2}}{2\sigma_{s}^{2}}}\textrm{d}x,\label{eq:pdf_composite_Rayleigh_lognormal} \end{equation} where $\mu_{s}$ and $\sigma_{s}^{2}$ are the mean and variance of log-normal shadowing, respectively. By substituting the PDF of $H$ into Eq. (\ref{eq:Measure_N}) and Eq. (\ref{eq:Lambda_N}), $\Lambda^{\textrm{NL}}\left(\left[0,t\right]\right)$ and $\lambda^{\textrm{NL}}\left(t\right)$ can be obtained, which however are non-closed forms. As for the channel model with composite Rician fading and log-normal shadowing, no such PDF could be found like Eq. (\ref{eq:pdf_composite_Rayleigh_lognormal}). In this context, we utilize a simplified composite fading and shadowing channel model in which the desired signal experiences Rayleigh fading or Rician fading and the interference signal experiences log-normal shadowing \cite{Andrews11A,Ge15Spatial}. For example, assume that the desired NLoS transmission is concatenated with Rayleigh fading, the desired LoS transmission is concatenated with Rician fading and the aggregate interference is concatenated with log-normal shadowing. The coverage probability can be readily obtained by substituting $\lambda_{\log}^{\textrm{NL}}\left(t\right)$ into Eq. (\ref{eq:proof_E_N}), $\lambda_{\log}^{\textrm{NL}}\left(t\right)$ into Eq. (\ref{eq:proof_E_L}) and $\lambda_{\textrm{Ray}}^{\textrm{U}}\left(t\right)$, $\Lambda_{\textrm{Ray}}^{\textrm{U}}\left(\left[0,t\right]\right)$ into Eq. (\ref{eq:pdf_y_N}), respectively. \subsection{The Asymptotic Analysis} In the following, an asymptotic analysis will be given for the situation where BS deployment becomes ultra-dense, i.e., $\lambda\rightarrow\infty$, which helps to analyze the performance with a concise form. \begin{cor} \label{cor: Pc_asymptotic}If $T\geqslant1$, the coverage probability of $p_{c}\left(\lambda,T\right)$ considering a single-slope path loss model in Eq. (\ref{eq:theorem_pc}) when $\lambda\rightarrow\infty$ converges as follows \begin{align} \underset{\lambda\rightarrow\infty}{\lim}p_{c}\left(\lambda,T\right) & =\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SINR}>T\right]\nonumber \\ & \overset{\left(a\right)}{=}\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SIR}>T\right]\nonumber \\ & \overset{\left(b\right)}{=}\frac{\alpha^{\textrm{L}}\sin\left(2\pi/\alpha^{\textrm{L}}\right)}{2\pi T^{2/\alpha^{\textrm{L}}}}.\label{eq:Pc corollary} \end{align} \end{cor} \begin{IEEEproof} A sketch of the proof of Corollary \ref{cor: Pc_asymptotic} is given here. In Eq. (\ref{eq:Pc corollary}), $\left(a\right)$ is due to the reason that when $\lambda\rightarrow\infty$, the network is interference-limited and noise can be ignored compared with the aggregate interference, which is also validated by results in Section \ref{sec:Simulations}. The proof of $\left(b\right)$ can be found in \cite[Remark 9]{Blaszczyszyn13Using} and \cite[Theorem 4]{Bai15Coverage} and are omitted here. \end{IEEEproof} From Corollary \ref{cor: Pc_asymptotic}, it can be concluded that for dense SCNs the coverage probability is invariant with respect to BS density $\lambda$ and even the distribution of shadowing/fading. However, when the BS density is not dense enough, the coverage probability reveals an interesting performance, which will be fully studied in Section \ref{sec:Simulations}. Moreover, when considering a multi-slope path model, when $\lambda\rightarrow\infty$, the noise power can be ignored compared with the interference and the typical MU will connected to a LoS BS almost for sure due the blockage probability model in Eq. (\ref{eq:PL_BS2UE}). In this context, \begin{align} \underset{\lambda\rightarrow\infty}{\lim}p_{c}\left(\lambda,T\right) & =\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SIR}>T\right]\nonumber \\ & =\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SIR}\left(\left\{ l_{n},\alpha_{n}^{\textrm{L}}\right\} \right)>T\right], \end{align} where $\Pr\left[\textrm{SIR}\left(\left\{ l_{n},\alpha_{n}^{\textrm{L}}\right\} \right)>T\right]$ denotes the coverage probability with multi-slope path loss model ($N$ piece-wise function) but only LoS transmissions being considered. From \cite[Lemma 3]{Zhang15Downlink} and assuming that $0\leqslant\alpha_{1}^{\textrm{L}}\leqslant\alpha_{2}^{\textrm{L}}\leqslant\cdots\leqslant\alpha_{N}^{\textrm{L}}$, when $\lambda\rightarrow\infty$, the coverage probability approaches to \begin{align} \underset{\lambda\rightarrow\infty}{\lim}p_{c}\left(\lambda,T\right) & =\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SIR}\left(\left\{ l_{n},\alpha_{n}^{\textrm{L}}\right\} \right)>T\right]\nonumber \\ & =\underset{\lambda\rightarrow\infty}{\lim}\Pr\left[\textrm{SIR}\left(\left\{ l_{1},\alpha_{1}^{\textrm{L}}\right\} \right)>T\right], \end{align} which is only determined by the first piece single-slope path loss function. As for the ASE scaling law against $\lambda$, the readers may refer to \cite{Zhang15Downlink,Nguyen17Performance}. \subsection{The ASE Upper Bound} Finally, the upper bound of ASE in units of $\textrm{bps/Hz/k\ensuremath{m^{2}}}$ for a given BS density $\lambda$ can be derived as follows \cite{Ding16Performance} \begin{align} \textrm{ASE}\left(\lambda\right) & =\lambda\mathbb{E}_{\textrm{SINR}}\left[\log_{2}\left(1+\textrm{SINR}\right)\right]\nonumber \\ & =\lambda\int_{u=T}^{\infty}\log_{2}\left(1+u\right)f_{\textrm{SINR}}\left(\lambda,u\right)\textrm{d}u\nonumber \\ & \leqslant\lambda\int_{u=0}^{\infty}\log_{2}\left(1+u\right)f_{\textrm{SINR}}\left(\lambda,u\right)\textrm{d}u\nonumber \\ & =\frac{\lambda}{\ln2}\int_{u=0}^{\infty}\frac{p_{c}\left(\lambda,T\right)}{u+1}\textrm{d}u,\label{eq:ASE} \end{align} where the integral in Eq. (\ref{eq:ASE}) can be numerically obtained \cite[Eq. (10)]{Yilmaz12AUnified}. Note that in \cite{Renzo13Average}, the proposed MGF\textendash based approach can efficiently compute the ASE instead of obtaining the coverage probability in advance. While in our work, the coverage probability and the ASE can be analyzed simultaneously at the expense of increased complexity of computation. \section{\label{sec:Simulations}Simulations and Discussions} This section presents numerical results to validate our analysis, followed by discussions to shed new light on the performance of SCNs. We use the following parameter values, $P_{t}=30\textrm{ dBm}$, $A^{\textrm{NL}}=30.8\textrm{ dB}$ , $A^{\textrm{L}}=2.7\textrm{ dB}$, $\alpha^{\textrm{NL}}=4.28$, $\alpha^{\textrm{L}}=2.42$, $\sigma^{\textrm{NL}}=4\textrm{ dB}$, $\sigma^{\textrm{L}}=3\textrm{ dB}$, $T=0\textrm{ dB}$ and $d=250\textrm{ m}$ \cite{Bai15Coverage,Singh15Tractable,3GPP36828,Yang16Coverage,Yang17PerformanceC,Ge13Modeling}. \subsection{\label{subsec:Validation-of-the}Validation of the Analytical Results of $p_{c}\left(\lambda,T\right)$ with Monte Carlo Simulations} \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig2} \par\end{centering} \caption{\label{fig:SINR-Coverage-Probability-density1}Coverage probability vs. BS density $\lambda$, $\eta=-95\textrm{ dBm}$, $\mu^{\textrm{NL}}=\mu^{\textrm{L}}=1$, simulation and analytical results.} \end{figure} The results of $p_{c}\left(\lambda,T\right)$ configured with $T=0\textrm{ dB}$ are plotted in Fig. \ref{fig:SINR-Coverage-Probability-density1} and Fig. \ref{fig:SINR-Coverage-Probability-density}, which illustrate the coverage performance of networks using SIRP and SARP, respectively. As can be observed from Fig. \ref{fig:SINR-Coverage-Probability-density1} and Fig. \ref{fig:SINR-Coverage-Probability-density}, the analytical results match the simulation results well, which validate the accuracy of our theoretical analysis. Note that in the case where both NLoS and LoS transmissions are concatenated with Rayleigh fading, the coverage probability is the highest among the interested cases. By contrast, in the case where NLoS transmission is concatenated with Rayleigh fading and LoS transmission is concatenated with Rician fading with $K=10\textrm{ dB}$, the coverage probability is the lowest, which suggests that Rayleigh fading model exaggerates network performance. Meanwhile, we should notice that the gap between the plotted curves is small, which means that multi-path fading has a minor impact on the coverage probability performance. In Fig. \ref{fig:SINR-Coverage-Probability-density}, the coverage probability with composite fading and shadowing channel model is also illustrated, which shows a similar tendency compared with others. With the assistance of Fig. \ref{fig:NLOS_LOS_Probability}, we conclude that the performance of small cell networks can be divided into four different regimes according to the density of small cell BSs, where in each regime, the performance is dominated by different factors. That is, \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig3} \par\end{centering} \caption{\label{fig:SINR-Coverage-Probability-density}Coverage probability vs. BS density $\lambda$, $\mu^{\textrm{NL}}=\frac{1}{23.45}$, $\mu^{\textrm{L}}=\frac{1}{7.32}$ \cite{Singh15Tractable}, simulation and analytical results.} \end{figure} \begin{itemize} \item \textbf{N}oise-\textbf{L}imited \textbf{R}egime (NLR): ($\lambda\leqslant1\textrm{ BSs/k\ensuremath{m^{2}}}$ in Fig. \ref{fig:SINR-Coverage-Probability-density}, Fig. \ref{fig:NLOS_LOS_Probability} and Fig. \ref{fig:Comparison-of-different}). In this regime, the typical MU is likely to have a NLoS path with the serving BS, see Fig. \ref{fig:NLOS_LOS_Probability} . The network in the NLR regime is very sparse and thus the interference can be ignored compared with the thermal noise if we use \textbf{SINR} for performance metric. In this case, $\textrm{SINR}=\frac{S}{\eta}$ and the coverage probability will increase with the increase of $\lambda$ as the strongest received power ($S$) will grow and noise power ($\eta$) will remain the same. While if we use \textbf{SIR} for performance metric, the SIR coverage probability remain almost stable in this regime as $\lambda$ increases. This is because the increase in the received signal power is counterbalanced by the increase in the aggregate interference power. Besides, as the aggregate interference power is smaller than noise power, the SIR coverage probability is larger than the SINR coverage probability. \item \textbf{S}ignal\textbf{-D}ominated \textbf{R}egime (SDR): ($\lambda\in(1,10]\textrm{ BSs/k\ensuremath{m^{2}}}$ in Fig. \ref{fig:SINR-Coverage-Probability-density}, Fig. \ref{fig:NLOS_LOS_Probability} and Fig. \ref{fig:Comparison-of-different}). In this regime, when $\lambda$ is small, the typical MU has a higher probability to connect to a NLoS BS; while when $\lambda$ becomes larger, the typical MU has an increasingly higher probability to connect to a LoS BS. That is to say, with the increase of $\lambda$, the typical MU is more likely to be in LoS with the associated BS, i.e., the received signal transforms from NLoS to LoS path. Even though the associated BS is LoS, the majority of interfering BSs are still NLoS in this regime and thus the SINR (or SIR) coverage probability keeps growing. From this regime on, noise power has a negligible impact on coverage performance, i.e., the SCN is interference-limited. Besides, if ignoring noise power, from the NLR to the SDR, the coverage probability from NLoS BSs decreases to almost zero and the coverage probability contributed by LoS BSs increases. It is because when the network is sparse, almost all MUs are associated with NLoS BSs and when the network goes denser, MUs shift from NLoS BSs to LoS BSs. \item \textbf{I}nterference\textbf{-D}ominated \textbf{R}egime (IDR): ($\lambda\in(10,250]\textrm{ BSs/k\ensuremath{m^{2}}}$ in Fig. \ref{fig:SINR-Coverage-Probability-density}, Fig. \ref{fig:NLOS_LOS_Probability} and Fig. \ref{fig:Comparison-of-different}). In this regime, the typical MU is connected to a LoS BS with a high probability. However, different from the situation in the SDR, the majority of interfering BSs experience transitions from NLoS to LoS path, which causes much more severe interference to the typical MU compared with interfering BSs with NLoS paths. As a result, the SINR (or SIR) coverage probability decreases with the increase of $\lambda$ because the transition of interference from NLoS path to LoS path causes a larger increase in interference compared with that in signal. Note that in this regime the coverage probability performance in our model exhibits a huge difference from that of the analysis in \cite{Andrews11A}, which are indicated as ``NLoS only'' and ``LoS only'' in Fig. \ref{fig:Comparison-of-different}. \item \textbf{I}nterference-\textbf{L}imited \textbf{R}egime (ILR): ($\lambda>250\textrm{ BSs/k\ensuremath{m^{2}}}$ in Fig. \ref{fig:SINR-Coverage-Probability-density}, Fig. \ref{fig:NLOS_LOS_Probability} and Fig. \ref{fig:Comparison-of-different}). In this regime, the network is extremely dense and grow close to the LoS-BS-only scenario as the increase of $\lambda$. The SINR (or SIR) coverage probability will become stable with the increase in BS density as any increase in the received LoS BS signal power is counterbalanced by the increase in the aggregate LoS BS interference power, which is also illuminated by Corollary \ref{cor: Pc_asymptotic}. \end{itemize} \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig4} \par\end{centering} \caption{\label{fig:NLOS_LOS_Probability}NLoS/LoS association coverage probability vs. BS density $\lambda$, $\mu^{\textrm{NL}}=\frac{1}{23.45}$, $\mu^{\textrm{L}}=\frac{1}{7.32}$ \cite{Singh15Tractable}.} \end{figure} \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig5} \par\end{centering} \caption{\label{fig:Comparison-of-different}Coverage probability vs. BS density $\lambda$, $\mu^{\textrm{NL}}=\mu^{\textrm{L}}=1$.} \end{figure} To validate the four performance regimes still exist in the networks employing actual building topology. Followed by \cite{Singh15Tractable}, we present the coverage probability of Chicago in Fig. \ref{fig:Pc Chicigo} whose topology is shown in Fig. \ref{fig:Building-topology}. Note that the NLoS transmissions and LoS transmissions are not determined by the one-parameter distance-based statistic model which is used in our work. Instead, they are determined by whether the transmission links are blocked by buildings or not. It is found that the four performance regimes still exist especially when the noise power is considered with a real building topology. The only difference is that the BS density at which the coverage probability peaks shifts from around $10\textrm{ BSs/k\ensuremath{m^{2}}}$ to around $100\textrm{ BSs/k\ensuremath{m^{2}}}$. In our work, the probability function of blockage is a piece-wise function which can be adjusted according to the real scenario. \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig6} \par\end{centering} \caption{\label{fig:Building-topology}Building topology of Chicago.} \end{figure} \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig7} \par\end{centering} \caption{\label{fig:Pc Chicigo}Coverage probability vs. BS density in Chicago.} \end{figure} \subsection{Boundary Definitions } Based on the qualitative results above, it is interesting to develop a qualitative definition of the boundaries among adjacent regimes. In this subsection, we propose the following definition to characterize three BS density boundaries, which makes the analysis of SCNS more formal. \begin{defn} The boundary between NLR and SDR is $\lambda_{\textrm{SDR}}^{\textrm{NLR}}$ which is defined as follows \begin{equation} \lambda_{\textrm{SDR}}^{\textrm{NLR}}=\underset{\lambda}{\arg}\left\{ \mathbb{E}\left[I\right]=\eta\right\} .\label{eq:NLR-SDR} \end{equation} \end{defn} The intuition of this definition is when $\lambda>\lambda_{\textrm{SN2LTR}}^{\textrm{NLR}}$, the aggregate interference has a greater impact on network performance than that caused by noise. \begin{defn} The boundary between SDR and IDR is $\lambda_{\textrm{IDR}}^{\textrm{SDR}}$, which is defined as the BS density that the coverage probability achieves the highest, i.e., \begin{equation} p_{c}^{\max}=p_{c}\left(\lambda_{\textrm{IDR}}^{\textrm{SDR}},T\right),\label{eq:SDR-IDR} \end{equation} \end{defn} which is equivalent to $\lambda_{\textrm{IDR}}^{\textrm{SDR}}=\underset{\lambda}{\arg\max}\left\{ p_{c}\left(\lambda,T\right)\right\} $. The definition above reveals that $p_{c}\left(\lambda_{\textrm{IDR}}^{\textrm{SDR}},T\right)$ is the maximum coverage probability if other parameters are fixed. From discussions above, the performance in the SDR is dominated by the desired signal, while in the IDR, the performance is dominated by the interference. When $\lambda>\lambda_{\textrm{IDR}}^{\textrm{SDR}}$, LoS interference will degrade the coverage performance. \begin{defn} The boundary between IDR and ILR is $\lambda_{\textrm{ILR}}^{\textrm{IDR}}$, which is defined as $\forall\lambda>\lambda_{\textrm{ILR}}^{\textrm{IDR}}$ \begin{equation} \mathbb{E}\left[I\right]\gg\eta,\label{eq:IDR-ILR} \end{equation} \end{defn} which is equivalent to $\lambda_{\textrm{ILR}}^{\textrm{IDR}}=\underset{\lambda}{\arg}\left\{ \mathbb{E}\left[I\right]=\epsilon\eta\right\} ,$ where $\epsilon\gg1$. When $\lambda$ becomes larger and larger, the SCNs fall into the ILR, i.e., the aggregate interference might be extremely large compared with the noise power $\eta$, which is shown by Eq. (\ref{eq:IDR-ILR}). When $\lambda>\lambda_{\textrm{ILR}}^{\textrm{IDR}}$, the coverage changes slowly and approaches the asymptotic value. In the following, we will analyze the ASE performance in the four defined regimes. \subsection{\label{subsec:Discussion-on-the}Discussion on the Analytical Results of the Upper Bound $\textrm{ASE}\left(\lambda\right)$} \begin{figure} \begin{centering} \includegraphics[width=9cm]{Fig8} \par\end{centering} \caption{\label{fig:ASE-1}ASE vs. BS density $\lambda$, $\eta=-95\textrm{ dBm}$, $\mu^{\textrm{NL}}=\mu^{\textrm{L}}=1$.} \end{figure} In this part, the upper bound of ASE with $T=0\textrm{ dB}$ is evaluated analytically only, as the upper bound is a function of $p_{c}\left(\lambda,T\right)$ shown in Eq. (\ref{eq:ASE}). Fig. \ref{fig:ASE-1} illustrates the upper bound with different fading models vs. $\lambda$. It is found that the upper bound of the SCN incorporating both NLoS and LoS transmissions reveal a deviation from that of the analysis considering NLoS (or LoS) transmissions only \cite{Andrews11A}. Specifically, when the SCN is sparse and thus in the NLR or the SDR, the upper bound quickly increases with $\lambda$ because the network is generally noise-limited, and thus adding more small cells immensely benefits the ASE. When the network becomes dense, i.e., $\lambda$ enters the IDR, which is the practical range of $\lambda$ for the existing 4G networks and the future 5G networks, the trend of the upper bound is very interesting. First, when $\lambda\in(10,50]\textrm{ BSs/k\ensuremath{m^{2}}}$, the upper bound exhibits a slowing-down in the rate of growth due to the fast decrease of the coverage probability at $\lambda\in(10,50]\textrm{ BSs/k\ensuremath{m^{2}}}$, as shown in Fig. \ref{fig:SINR-Coverage-Probability-density1} and Fig. \ref{fig:SINR-Coverage-Probability-density}. Second, when $\lambda>50\textrm{ BSs/k\ensuremath{m^{2}}}$, the upper bound will pick up the growth rate since the decrease of the coverage probability becomes a minor factor compared with the increase of $\lambda$. When the SCN is extremely dense, e.g., $\lambda$ is in the ILR, the upper bound exhibits a nearly linear trajectory with respect to $\lambda$ because both the signal power and the interference power are now LoS dominated, and thus statistically stable as explained before. Moreover, it can be observed that the change of the multi-path fading model has a minor impact on the upper bound compared with the change of the path loss model. \subsection{Discussion on the Value of Theoretical Analysis } Simulation is time consuming for $\lambda\geqslant10^{3}\textrm{ BSs/k\ensuremath{m^{2}}}$ and almost infeasible for $\lambda\geqslant10^{5}\textrm{ BSs/k\ensuremath{m^{2}}}$. For example, simulation for networks with $\lambda=10^{5}\textrm{ BSs/k\ensuremath{m^{2}}}$ needs at least $4\times10^{5}$ BSs to get a smooth curve, which consumes almost 2 weeks for a 8 core PC. On the other hand, the computational complexity for theoretical analysis is stable for all BS densities. In this context, the theoretical analysis is useful when you want to analyze an ultra-dense network, i.e., $\lambda\geqslant10^{5}\textrm{ BSs/k\ensuremath{m^{2}}}$. Based on the findings of NLoS-to-LoS-transition, next we will introduce some guidance on how to design and manage the cellular networks in order to optimize the network performance as we evolve into dense SCNs. As described in section \ref{subsec:Validation-of-the} and \ref{subsec:Discussion-on-the}, the ASE increases almost for sure as SCNs becomes denser due to the gain of frequency reuse. In contrast, the coverage probability of SCNs will firstly increase and then decrease with the increase of BS density $\lambda$. In this context, there is a trade off between the coverage probability and the ASE in the future 5G SCNs incorporating both NLoS and LoS transmissions. While in \cite{Andrews11A}, denser SCNs always provide better network performance with respect to the ASE as well as the coverage probability. It is noted that compared with the existing work \cite{Andrews11A,Singh15Tractable} which assume the network works either in the NLR or the ILR, our findings with more elaborate working regimes partition provide guidance for network design and optimization. A rough working regimes partition may not give useful suggestions on network performance enhancement especially in the transitional regimes between the NLR and the ILR. For example, increasing BS transmit power can improve the coverage probability in the NLR but fails in the ILR \cite{Andrews11A}. In the transitional regimes between the NLR and the ILR, we may imagine that this technique transforms form being useful to being useless. However, due to the lack of detailed features in the transitional regimes, we are still not sure whether to use this technique or not. Regarding the four performance regimes, in the following, we try to provide different techniques which can be used to enhance the network performance. \begin{enumerate} \item NLR: When the network works in the NLR, e.g., most mmWave network, the interference is not the dominate factor and the desired signal strength could be enhanced by utilizing BS power control, and directional antennas, etc. \item SDR: In this regime, the desired signal strength is still the dominate factor. Thus the techniques used in the NLR to enhance the performance are valid as well. However, some techniques will not as useful as that in the NLR. For example, directional antenna technique may work efficiently, but BS power control technique may be not so efficient as in this regime increasing the transmit power may cause interference to other users. \item IDR: According to the data, the current 4G network is operating in the SDR. As we deploy more and more BSs in the future to meet the skyrocketing demands on wireless data, the network will fall into the IDR. In this regime, we need elaborately design the network system including transmission techniques, medium access control (MAC) protocols and coding techniques, etc, to compensate the impair of network coverage caused by strong LoS interference. The most common MAC protocols are interference cancellation, interference avoidance, and interference control. By jointly utilizing advanced transmission techniques like beamforming techniques, multiple-input-multiple-output (MIMO), multi-antenna, coordinated multi-point (CoMP) transmissions and better coding techniques, the interference will be mitigated to an acceptable level, which benefits both the coverage probability and the ASE a lot. \item ILR: In this regime, the coverage performance is so poor even though the ASE increases with the BS density. Techniques mentioned for IDR should be already utilized in advance to avoid entering this regime. \end{enumerate} \section{\label{sec:Conclusions-and-Future}Conclusions and Future Work} In this paper, we illustrated the transition behaviors in SCNs incorporating both NLoS and LoS transmissions. Based on our analysis, the network can be divided into four regimes, i.e., the NLR, the SDR, the IDR and the ILR, where in each regime the performance is dominated by different factors. The analysis helps to understand as the BS density grows continually, which dominant factor that determines the cellular network performance and therefore provide guidance on the design and management of the cellular networks as we evolve into dense SCNs. Moreover, our work adopt a generalized shadowing/fading model, in which log-normal shadowing and/or Rayleigh fading can be treated in a unified framework. It is noted that constant transmit power is assumed in our work, however, when the BS density, i.e., $\lambda$ is large, the BS transmit power usually decreases to reduce the inter-cell interference. In our on-going work, i.e., \cite{Ding17Performance,Yang17On}, density-dependent transmit power is considered and the coverage probability and the ASE reveal a different tendency. In our future work, shadowing and multi-path fading model will be considered simultaneously which is more practical for the real network. Furthermore, heterogeneous networks (HetNets) incorporating both NLoS and LoS transmissions will also be investigated. \section*{Appendix A: Proof of Theorem \ref{thm: Equivalence theorem}} Firstly, we will obtain the intensity measure $\Lambda_{n}^{\textrm{NL}}$ of $\overline{\Phi_{n}^{\textrm{NL}}}$; and then the intensity $\lambda_{n}^{\textrm{NL}}$ will be easily acquired by taking a derivation of $\Lambda_{n}^{\textrm{NL}}$. By using displacement theorem \cite{Blaszczyszyn13Using,Baccelli09Stochastic}, the point process $\overline{\Phi_{n}^{\textrm{NL}}}$ is Poisson with intensity measure \begin{align} & \quad\,\Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right)=\mathbb{E}_{\overline{\Phi_{n}^{\textrm{NL}}}}\left[\overline{\Phi_{n}^{\textrm{NL}}}\left[b\left(0,t\right)\right]\right]\nonumber \\ & =\int_{\mathbb{R}^{2}}\Pr\left[\overline{R_{i,n}^{\textrm{NL}}}<t\right]p^{\textrm{NL}}\left(R_{i}\right)\lambda\textrm{d}\boldsymbol{X}_{i}\nonumber \\ & =\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left\{ \int_{\mathbb{R}^{2}}\Pr\left[R_{i}<t\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{1/\alpha_{n}^{\textrm{NL}}}\right]p_{n}^{\textrm{NL}}\left(R_{i}\right)\lambda\textrm{d}\boldsymbol{X}_{i}\right\} \nonumber \\ & \overset{\left(a\right)}{=}\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[\int_{\theta=0}^{2\pi}\int_{R_{i}=0}^{t\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{1/\alpha_{n}^{\textrm{NL}}}}p_{n}^{\textrm{NL}}\left(R_{i}\right)\lambda R_{i}\textrm{d}R_{i}\textrm{d}\theta\right]\nonumber \\ & =\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[2\pi\lambda\int_{R_{i}=0}^{t\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{1/\alpha_{n}^{\textrm{NL}}}}p_{n}^{\textrm{NL}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right],\label{eq:Lambda_N proof-1} \end{align} where $b\left(0,t\right)$ is a ball centered at the origin $o$ with radius $t$ and $\left(a\right)$ results by converting from Cartesian to polar coordinates. Considering the distance range of $d_{n-1}<R_{i}\leqslant d_{n}$ (define $d_{0}$ and $d_{N}$ as 0 and $\infty$, respectively), the equation above should be revised as follows \begin{align} \Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right) & =\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[2\pi\lambda\int_{R_{i}=d_{n-1}}^{R_{i,\max}^{\textrm{NL}}}p_{n}^{\textrm{NL}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right],\label{eq:Lambda_N proof} \end{align} where we define $R_{i,\max}^{\textrm{NL}}=\min\left\{ d_{n},t\left(B_{n}^{\textrm{NL}}\mathcal{H}_{n}^{\textrm{NL}}\right)^{1/\alpha_{n}^{\textrm{NL}}}\right\} $. Then the intensity of $\overline{\Phi_{n}^{\textrm{NL}}}$ denoted by $\lambda_{n}^{\textrm{NL}}\left(\cdot\right)$ can be given by \begin{equation} \lambda_{n}^{\textrm{NL}}\left(t\right)=\frac{\textrm{d}}{\textrm{d}t}\Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right). \end{equation} Note that to ensure the intensity measure is finite for any bounded set (a set is bounded if it can be contained in a ball with a finite radius), $\mathcal{H}_{n}^{\textrm{NL}}$ has to satisfy a certain condition. As $p_{n}^{\textrm{NL}}\left(R_{i}\right)\leqslant1$, from Eq. (\ref{eq:Lambda_N proof}), we get an inequality as follows \begin{align} & \quad\,\Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right)=\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[2\pi\lambda\int_{d_{n-1}}^{R_{i,\max}^{\textrm{NL}}}p_{n}^{\textrm{NL}}\left(R_{i}\right)R_{i}\textrm{d}R_{i}\right]\nonumber \\ & \leqslant\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[2\pi\lambda\int_{0}^{R_{i,\max}^{\textrm{NL}}}R_{i}\textrm{d}R_{i}\right]\nonumber \\ & =\pi\lambda\min\left\{ d_{n}^{2},t^{2}\left(B_{n}^{\textrm{NL}}\right)^{2/\alpha_{n}^{\textrm{NL}}}\mathbb{E}_{\mathcal{H}_{n}^{NL}}\left[\left(\mathcal{H}_{n}^{\textrm{NL}}\right)^{2/\alpha_{n}^{\textrm{NL}}}\right]\right\} . \end{align} If the expectation $\mathbb{E}_{\mathcal{H}_{n}^{\textrm{NL}}}\left[\left(\mathcal{H}_{n}^{\textrm{NL}}\right)^{2/\alpha_{n}^{\textrm{NL}}}\right]<\infty$, then $\Lambda_{n}^{\textrm{NL}}\left(\left[0,t\right]\right)<\infty$. Using similar approach, the intensity measure and intensity of the PPP $\overline{\Phi_{n}^{\textrm{L}}}$ are obtained by Eq. (\ref{eq:Measure_L}) and Eq. (\ref{eq:Lambda_L}), respectively. As for the cell association scheme, it is obvious that the original scheme $\left(\boldsymbol{X}_{i},\textrm{U},\mathcal{N}\right)^{*}=\arg\underset{(\boldsymbol{X}_{i},\textrm{U},\mathcal{N})\in\mathbb{S}}{\max}B_{n}^{\textrm{U}}\mathcal{H}_{n}^{\textrm{U}}\left(R_{i}\right)^{-\alpha_{n}^{\textrm{U}}}$ is equivalent to the scheme $\left(\boldsymbol{X}_{i},\textrm{U},\mathcal{N}\right)^{*}=\arg\underset{(\boldsymbol{X}_{i},\textrm{U},\mathcal{N})\in\mathbb{S}}{\max}\left(\overline{R_{i,n}}\right)^{-\alpha_{n}^{\textrm{U}}}$ which actually corresponds to the nearest BS association scheme. Thus the proof is completed. \section*{Appendix B: Proof of Lemma \ref{lem:CDF_strongest}} Denote the strongest NLoS received signal power and the strongest LoS received signal power by $\mathcal{P}^{\textrm{NL}}$ and $\mathcal{P}^{\textrm{L}}$, respectively. Note that we drop subscript $n$ under this special case for simplicity. That is, $\mathcal{P}^{\textrm{NL}}=\max\left(P_{i}^{\textrm{NL}}\right)$ and $\mathcal{P}^{\textrm{L}}=\max\left(P_{i}^{\textrm{L}}\right)$. Then the probability $\Pr\left[\mathcal{P}\leqslant\gamma\right]$ can be derived as \begin{align} & \quad\,\Pr\left[\mathcal{P}\leqslant\gamma\right]\nonumber \\ & =\Pr\left[\max\left(\overline{R_{i}^{\textrm{NL}}}^{-\alpha^{\textrm{NL}}}\right)\leqslant\gamma\cap\max\left(\overline{R_{i}^{\textrm{L}}}^{-\alpha^{\textrm{L}}}\right)\leqslant\gamma\right]\nonumber \\ & =\Pr\left[\min\left(\overline{R_{i}^{\textrm{NL}}}\right)\geqslant\gamma^{-1/\alpha^{\textrm{NL}}}\cap\min\left(\overline{R_{i}^{\textrm{L}}}\right)\geqslant\gamma^{-1/\alpha^{\textrm{L}}}\right]\nonumber \\ & =\Pr\left[\textrm{no nodes within }\gamma^{-1/\alpha^{\textrm{NL}}}\cap\textrm{no nodes within }\gamma^{-1/\alpha^{\textrm{L}}}\right]\nonumber \\ & =\Pr\left[\overline{\Phi^{\textrm{NL}}}\left(b\left(0,\gamma^{-1/\alpha^{\textrm{NL}}}\right)\right)=0\cap\overline{\Phi^{\textrm{L}}}\left(b\left(0,\gamma^{-1/\alpha^{\textrm{L}}}\right)\right)=0\right]\nonumber \\ & \overset{\left(a\right)}{=}\Pr\left[\overline{\Phi^{\textrm{NL}}}\left(b\left(0,\gamma^{-1/\alpha^{\textrm{NL}}}\right)\right)=0\right]\nonumber \\ & \quad\,\times\Pr\left[\overline{\Phi^{\textrm{L}}}\left(b\left(0,\gamma^{-1/\alpha^{\textrm{L}}}\right)\right)=0\right]\nonumber \\ & \overset{\left(b\right)}{=}\exp\left[-\Lambda^{\textrm{NL}}\left(\left[0,\gamma^{-1/\alpha^{\textrm{NL}}}\right]\right)\right]\cdot\exp\left[-\Lambda^{\textrm{L}}\left(\left[0,\gamma^{-1/\alpha^{\textrm{L}}}\right]\right)\right],\label{eq:CDF_strongest power} \end{align} where the notation $\overline{\Phi^{\textrm{U}}}\left(\Xi\right)$ refers to the number of points $x\in\overline{\Phi^{\textrm{U}}}$ contained in the set $\Xi$, while equality $\left(a\right)$ follows from the independence of PPP $\overline{\Phi^{\textrm{NL}}}$ and PPP $\overline{\Phi^{\textrm{L}}}$ , and $\left(b\right)$ comes from the fact that the void probability $\Pr\left[\overline{\Phi^{\textrm{U}}}\left(b\left(0,r\right)\right)=0\right]=\exp\left[-\Lambda^{\textrm{U}}\left(\left[0,r\right]\right)\right]$ for a non-homogeneous PPP. Then the rest of the proof is straightforward. \section*{Appendix C: Proof of Theorem \ref{thm:Pcoverage }} By invoking the law of total probability and considering the independence between $\overline{\Phi_{n}^{\textrm{NL}}}$ and $\overline{\Phi_{n}^{\textrm{L}}}$, the coverage probability can be divided into two parts in each segment, i.e., $p_{c,n}^{\textrm{NL}}\left(\lambda,T\right)$ and $p_{c,n}^{\textrm{L}}\left(\lambda,T\right)$, which denotes the conditional coverage probability given that the typical MU is associated with a BS in $\Phi_{n}^{\textrm{NL}}$ and $\Phi_{n}^{\textrm{L}}$, respectively. Moreover, denote by $\mathcal{P}_{n}^{\textrm{NL}}$ and $\mathcal{P}_{n}^{\textrm{L}}$ the strongest received signal power from BS in $\Phi_{n}^{\textrm{NL}}$ and $\Phi_{n}^{\textrm{L}}$, i.e., $\mathcal{P}_{n}^{\textrm{NL}}=\max\left(P_{i,n}^{\textrm{NL}}\right)$ and $\mathcal{P}_{n}^{\textrm{L}}=\max\left(P_{i,n}^{\textrm{L}}\right)$, respectively. Then by applying the law of total probability, $p_{c,n}^{\textrm{L}}\left(\lambda,T\right)$ can be computed by \begin{align} p_{c,n}^{\textrm{L}}\left(\lambda,T\right) & =\Pr\left[\left(\textrm{SINR}_{n}^{\textrm{L}}>T\right)\cap\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & =\mathbb{E}_{\mathcal{Y}_{n}^{\textrm{L}}}\biggl\{\underset{\textrm{II}}{\underbrace{\Pr\left[\left.\textrm{SINR}_{n}^{\textrm{L}}>T\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]}}\nonumber \\ & \quad\,\times\underset{\textrm{I}}{\underbrace{\Pr\left[\left.\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right|\mathcal{Y}_{n}^{\textrm{L}}\right]}}\biggr\},\label{eq:proof_pcL} \end{align} where $\mathcal{Y}_{n}^{\textrm{L}}$ is the equivalent distance between the typical MU and the BS providing the strongest received signal power to the typical MU in $\Phi_{n}^{\textrm{L}}$, i.e., $\mathcal{Y}_{n}^{\textrm{L}}=\underset{\overline{R_{i,n}^{\textrm{L}}}\in\overline{\Phi_{n}^{\textrm{L}}}}{\arg\max}\left(\overline{R_{i,n}^{\textrm{L}}}\right)^{-\alpha_{n}^{\textrm{L}}}$, and also note that $\mathcal{P}_{n}^{\textrm{L}}=\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{-\alpha_{n}^{\textrm{L}}}$. Besides, Part I guarantees that the typical MU is connected to a LoS BS and Part II denotes the coverage probability conditioned on the proposed cell association scheme in Eq. (\ref{eq:inspower}). Next, Part I and Part II will be respectively derived as follows. For Part I, \begin{align} & \quad\,\Pr\left[\left.\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right|\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & =\Pr\left[\left.\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{-\alpha_{n}^{\textrm{L}}}>\left(\mathcal{Y}_{n}^{\textrm{NL}}\right)^{-\alpha_{n}^{\textrm{NL}}}\right|\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & \overset{\left(a\right)}{=}\exp\left[-\Lambda_{n}^{\textrm{NL}}\left(\left[0,\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}/\alpha_{n}^{\textrm{NL}}}\right]\right)\right],\label{eq:proof_PL_g_PN} \end{align} where $\mathcal{Y}_{n}^{\textrm{NL}}$, similar to the definition of $\mathcal{Y}_{n}^{\textrm{L}}$, is the equivalent distance between the typical MU and the BS providing the strongest received signal power to the typical MU in $\Phi_{n}^{\textrm{NL}}$, i.e., $\mathcal{Y}_{n}^{\textrm{NL}}=\underset{\overline{R_{i,n}^{\textrm{NL}}}\in\overline{\Phi_{n}^{\textrm{NL}}}}{\arg\max}\left(\overline{R_{i,n}^{\textrm{NL}}}\right)^{-\alpha_{n}^{\textrm{NL}}}$, and also note that $\mathcal{P}_{n}^{\textrm{NL}}=\left(\mathcal{Y}_{n}^{\textrm{NL}}\right)^{-\alpha_{n}^{\textrm{NL}}}$, and $\left(a\right)$ follows from the void probability of a PPP. For Part II, we know that $\textrm{SINR}=\frac{\mathcal{P}}{I+\eta}=\frac{\mathcal{P}}{I^{\textrm{NL}}+I^{\textrm{L}}+\eta},$ where $I^{\textrm{NL}}$ and $I^{\textrm{L}}$ denote the aggregate interference from NLoS BSs and LoS BSs, respectively. The conditional coverage probability is derived as follows \begin{align} & \quad\,\Pr\left[\left.\textrm{SINR}_{n}^{\textrm{L}}>T\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & =\Pr\left[\left.\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}<\frac{1}{T}\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & \overset{\left(a\right)}{=}\underset{\textrm{PDF}}{\int_{x=0}^{1/T}\underbrace{\int_{\omega=-\infty}^{\infty}\frac{e^{-j\omega x}}{2\pi}\mathcal{F}_{\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}}\left(\omega\right)\textrm{d}\omega}\textrm{d}x}\nonumber \\ & =\int_{\omega=-\infty}^{\infty}\left[\frac{1-e^{-j\omega/T}}{2\pi j\omega}\right]\mathcal{F}_{\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}}\left(\omega\right)\textrm{d}\omega,\label{eq:proof_SINR} \end{align} where $\textrm{SINR}_{n}^{\textrm{L}}$ denotes the SINR when the typical MU is associated with a LoS BS, the inner integral in $\left(a\right)$, i.e., $\int_{\omega=-\infty}^{\infty}\frac{e^{-j\omega x}}{2\pi}\mathcal{F}_{\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}}\left(\omega\right)\textrm{d}\omega$ is the conditional PDF of $\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}$ due to the definition of the inverse characteristic function, i.e., $f_{X}\left(x\right)=F_{X}^{'}\left(x\right)=\frac{1}{2\pi}\int_{\mathrm{R}}e^{-j\omega x}\varphi_{X}\left(\omega\right)\textrm{d}\omega$, and $\mathcal{F}_{\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}}\left(\omega\right)$ denotes the conditional characteristic function of $\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}$ which is given by \begin{align} & \mathcal{F}_{\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}}\left(\omega\right)=\mathbb{E}_{\Phi_{n}}\left[\left.\exp\left(j\omega\frac{1}{\textrm{SINR}_{n}^{\textrm{L}}}\right)\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & =\mathbb{E}_{\Phi_{n}}\left[\left.\exp\left(j\omega\frac{I^{\textrm{NL}}+I^{\textrm{L}}+\eta}{\mathcal{P}_{n}^{\textrm{L}}}\right)\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right]\nonumber \\ & =\mathbb{E}_{\Phi_{n}}\left\{ \left.\exp\left[j\omega\left(I^{\textrm{NL}}+I^{\textrm{L}}+\eta\right)\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right\} \nonumber \\ & \overset{\left(a\right)}{=}\underset{\textrm{III}}{\underbrace{\mathbb{E}_{\Phi_{n}^{\textrm{NL}}}\left\{ \left.\exp\left[j\omega I^{\textrm{NL}}\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right\} }}\nonumber \\ & \quad\,\times\underset{\textrm{IV}}{\underbrace{\mathbb{E}_{\Phi_{n}^{\textrm{L}}}\left\{ \left.\exp\left[j\omega I^{\textrm{L}}\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right\} }}\nonumber \\ & \quad\,\times e^{j\omega\eta\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}},\label{eq:Characteristic_1/SINR} \end{align} where $\left(a\right)$ comes from the facts that $\Phi_{n}=\Phi_{n}^{\textrm{NL}}\cup\Phi_{n}^{\textrm{L}}$ and the mutual independence of $\Phi_{n}^{\textrm{NL}}$ and $\Phi_{n}^{\textrm{L}}$. Now by applying stochastic geometry, we will derive the term III in Eq. (\ref{eq:Characteristic_1/SINR}) as follows \begin{align} & \quad\,\mathbb{E}_{\Phi_{n}^{\textrm{NL}}}\left\{ \left.\exp\left[j\omega I^{\textrm{NL}}\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right\} \nonumber \\ & \overset{\left(a\right)}{=}\mathbb{E}_{\overline{\Phi_{n}^{\textrm{NL}}}}\Biggl\{\left.\exp\left[j\omega\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\underset{i:\overline{R_{i,n}^{\textrm{NL}}}\in\overline{\Phi_{n}^{\textrm{NL}}}'}{\sum}\left(\overline{R_{i,n}^{\textrm{NL}}}\right)^{-\alpha_{n}^{\textrm{NL}}}\right]\right|\bigl(\mathcal{P}_{n}^{\textrm{L}}\nonumber \\ & \quad\,>\mathcal{P}_{n}^{\textrm{NL}}\bigr)\cap\mathcal{Y}_{n}^{\textrm{L}}\Biggr\}\nonumber \\ & \overset{\left(b\right)}{=}\mathbb{E}_{\overline{\Phi_{n}^{\textrm{NL}}}}\Biggl\{\left.\underset{i:\overline{R_{i,n}^{\textrm{NL}}}\in\overline{\Phi_{n}^{\textrm{NL}}}'}{\prod}\exp\left[j\omega\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\left(\overline{R_{i,n}^{\textrm{NL}}}\right)^{-\alpha_{n}^{\textrm{NL}}}\right]\right|\bigl(\mathcal{P}_{n}^{\textrm{L}}\nonumber \\ & \quad\,>\mathcal{P}_{n}^{\textrm{NL}}\bigr)\cap\mathcal{Y}_{n}^{\textrm{L}}\Biggr\}\nonumber \\ & \overset{\left(c\right)}{=}\exp\left\{ \int_{t=\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}/\alpha_{n}^{\textrm{NL}}}}^{\infty}\left[e^{j\omega\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}t^{-\alpha_{n}^{\textrm{NL}}}}-1\right]\lambda_{n}^{\textrm{NL}}\left(t\right)\textrm{d}t\right\} ,\label{eq:proof_E_N} \end{align} where in $\left(a\right)$, $\overline{\Phi_{n}^{\textrm{NL}}}'=\overline{\Phi_{n}^{\textrm{NL}}}\setminus b\left(0,\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}/\alpha_{n}^{\textrm{NL}}}\right)$ and $\overline{R_{i,n}^{\textrm{NL}}}\in\overline{\Phi_{n}^{\textrm{NL}}}'$ can guarantee the condition that $\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}$, $\left(b\right)$ follows from rewriting the exponential of summation as a product of several exponential functions, and $\left(c\right)$ is obtained by applying the probability generating functional (PGFL) \cite[Eq. (3)]{Andrews11A} of the PPP. Similarly, the term IV in Eq. (\ref{eq:Characteristic_1/SINR}) is given by \begin{align} & \quad\,\mathbb{E}_{\Phi_{n}^{\textrm{L}}}\left\{ \left.\exp\left[j\omega I^{\textrm{L}}\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\left(\mathcal{P}_{n}^{\textrm{L}}>\mathcal{P}_{n}^{\textrm{NL}}\right)\cap\mathcal{Y}_{n}^{\textrm{L}}\right\} \nonumber \\ & \overset{\left(a\right)}{=}\mathbb{E}_{\overline{\Phi_{n}^{\textrm{L}}}}\Biggl\{\left.\exp\left[j\omega\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}\right)^{\alpha_{n}^{\textrm{L}}}\underset{i:\overline{R_{i,n}^{\textrm{L}}}\in\overline{\Phi_{n}^{\textrm{L}}}'}{\sum}\left(\overline{R_{i,n}^{\textrm{L}}}\right)^{-\alpha_{n}^{\textrm{L}}}\right]\right|\bigl(\mathcal{P}_{n}^{\textrm{L}}\nonumber \\ & \quad\,>\mathcal{P}_{n}^{\textrm{NL}}\bigr)\cap\mathcal{Y}_{n}^{\textrm{L}}\Biggr\}\nonumber \\ & =\mathbb{E}_{\overline{\Phi_{n}^{\textrm{NL}}}}\Biggl\{\left.\underset{i:\overline{R_{i,n}^{\textrm{L}}}\in\overline{\Phi_{n}^{\textrm{L}}}'}{\prod}\exp\left[j\omega\cdot\left(\mathcal{Y}_{n}^{\textrm{L}}/\overline{R_{i,n}^{\textrm{L}}}\right)^{\alpha_{n}^{\textrm{L}}}\right]\right|\bigl(\mathcal{P}_{n}^{\textrm{L}}\nonumber \\ & \quad\,>\mathcal{P}_{n}^{\textrm{NL}}\bigr)\cap\mathcal{Y}_{n}^{\textrm{L}}\Biggr\}\nonumber \\ & =\exp\left\{ \int_{t=\mathcal{Y}_{n}^{\textrm{L}}}^{\infty}\left[e^{j\omega\left(\mathcal{Y}_{n}^{\textrm{L}}/t\right)^{\alpha_{n}^{\textrm{L}}}}-1\right]\lambda_{n}^{\textrm{L}}\left(t\right)\textrm{d}t\right\} ,\label{eq:proof_E_L} \end{align} where in $\left(a\right)$, $\overline{\Phi_{n}^{\textrm{L}}}'=\overline{\Phi_{n}^{\textrm{L}}}\setminus b\left(0,\mathcal{Y}_{n}^{\textrm{L}}\right)$ and $\overline{R_{i,n}^{\textrm{L}}}\in\overline{\Phi_{n}^{\textrm{L}}}'$ can guarantee that the typical MU is associated with a LoS BS providing the strongest received signal power. Then the product of Part I and Part II in Eq. (\ref{eq:proof_pcL}) can be obtained by substituting them with Eq. (\ref{eq:proof_PL_g_PN}) \textendash{} (\ref{eq:proof_E_L}). Finally, note that the value of $p_{c,n}^{\textrm{L}}\left(\lambda,T\right)$ in Eq. (\ref{eq:proof_pcL}) should be calculated by taking the expectation with respect to $\mathcal{Y}_{n}^{\textrm{L}}$ in terms of its PDF, which is given as follows \begin{align} f_{\mathcal{Y}_{n}^{\textrm{L}}}\left(y\right)=\frac{\textrm{d}}{\textrm{d}y}\left[1-\Pr\left(\mathcal{Y}_{n}^{\textrm{L}}>y\right)\right] & =\lambda_{n}^{\textrm{L}}\left(y\right)\exp\left[-\Lambda_{n}^{\textrm{L}}\left(\left[0,y\right]\right)\right].\label{eq:pdf_y_N} \end{align} Given that the typical MU is connected to a NLoS BS, the conditional coverage probability $p_{c,n}^{\textrm{NL}}\left(\lambda,T\right)$ can be derived in a similar way as the above. In this way, the coverage probability is obtained by $p_{c}\left(\lambda,T\right)=\stackrel[n=1]{N}{\sum}p_{c,n}^{\textrm{L}}\left(\lambda,T\right)+\stackrel[n=1]{N}{\sum}p_{c,n}^{\textrm{NL}}\left(\lambda,T\right)$. Thus the proof is completed. \bibliographystyle{IEEEtran}
{'timestamp': '2018-01-16T02:11:47', 'yymm': '1701', 'arxiv_id': '1701.01544', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01544'}
arxiv
\section{Introduction} Since their introduction by \cite{Chipman2010} Bayesian additive regression trees (BART) have been applied to nonparametric regression and classification problems in a wide range of settings. To date these have been limited to models for Gaussian data, perhaps after data augmentation (as in probit BART for binary classification). Although many useful models are naturally cast in terms of latent Gaussian variables, many others are not or have other, more convenient latent variable representations. This paper extends BART to a much wider range of models via a novel log-linear formulation that is easily incorporated into regression models for categorical and count responses. Adapting BART to the log-linear setting while maintaining the computational efficiency of the original BART MCMC algorithm requires careful consideration of prior distributions, one of the main contributions of this paper. { The paper proceeds as follows: The remainder of this section reviews BART, including elements of the MCMC algorithm used for posterior inference. In Section \ref{sec:log-linear} we introduce new log-linear BART models for categorical and count responses. In Section \ref{sec:liks} we describe data augmentation and MCMC algorithms for these models. In Section \ref{sec:priors} we introduce new prior distributions and give details of posterior computation. In Section \ref{sec:examples} we present a large simulation study and an application to previously published data. In Section \ref{sec:conclusion} we conclude with discussion of extensions and areas for future work. } \subsection{Bayesian Additive Regression Trees (BART)}\label{sec:bart} BART was introduced by \cite{Chipman2010} (henceforth CGM) as a nonparametric prior over a regression function $f(\cdot)$ designed to capture complex, nonlinear relationships and interactions. Our exposition in this section closely follows CGM. For observed data pairs $\{(y_i, \mathbf{x}_i); 1\leq i\leq n\}$ CGM consider the regression model \begin{equation} y_i = f(\mathbf{x}_i) + \epsilon_i,\quad \epsilon_i\iid N(0,\sigma^2)\label{eq:meanbart}, \end{equation} where $f$ is represented as the sum of many regression trees. Each tree $T_h$ (for $1\leq h\leq m$) consists of a set of interior decision nodes with splitting rules of the form $x_{ij}<c$, and a set of $b_h$ terminal nodes. Each terminal node has an associated parameter, collected in the vector $M_h = (\mu_{h1},\mu_{h2},\dots \mu_{hb_h})'$. We use $T = \{T_h:1\leq h \leq m\}$ and $M = \{M_h:1\leq h \leq m\}$ to refer to the collections of trees/parameters. A tree and its associated decision rules induce a partition of the covariate space $\{\mathcal{A}_{h1},\dots,\mathcal{A}_{hb_h}\}$, where each element of the partition corresponds to a terminal node in the tree. Each pair $(T_h, M_h)$ parameterizes a step function $g$: \begin{equation} g(\mathbf{x}, T_h, M_h) = \mu_{ht}\text{ if }\mathbf{x}\in\mathcal{A}_{ht} \text{ (for $1\leq t\leq b_h$)}.\label{eq:partdef} \end{equation} An example tree and its corresponding step function are given in Figure \ref{fig:treestep}. In BART a large number of these step functions are additively combined to obtain $f$: \begin{equation} f(\mathbf{x}) = \sum_{h=1}^m g(\mathbf{x}, T_h, M_h).\label{eq-bartf} \end{equation} \begin{figure}[ht] \begin{center} \begin{tikzpicture}[ scale=0.9, node/.style={% draw, rectangle, }, node2/.style={% draw, circle, }, ] \node [node] (A) {$x_1<0.9$}; \path (A) ++(-135:\nodeDist) node [node2] (B) {$\mu_{h1}$}; \path (A) ++(-45:\nodeDist) node [node] (C) {$x_2<0.4$}; \path (C) ++(-135:\nodeDist) node [node2] (D) {$\mu_{h2}$}; \path (C) ++(-45:\nodeDist) node [node2] (E) {$\mu_{h3}$}; \draw (A) -- (B) node [left,pos=0.25] {no}(A); \draw (A) -- (C) node [right,pos=0.25] {yes}(A); \draw (C) -- (D) node [left,pos=0.25] {no}(A); \draw (C) -- (E) node [right,pos=0.25] {yes}(A); \end{tikzpicture} \hspace{0.05\linewidth} \begin{tikzpicture}[scale=3.3] \draw [thick, -] (0,1) -- (0,0) -- (1,0) -- (1,1)--(0,1); \draw [thin, -] (0.8, 1) -- (0.8, 0); \draw [thin, -] (0.0, 0.4) -- (0.8, 0.4); \node at (-0.1,0.4) {0.4}; \node at (0.8,-0.1) {0.9}; \node at (0.5,-0.2) {$x_1$}; \node at (-0.3,0.5) {$x_2$}; \node at (0.9,0.5) {$\mu_{h1}$}; \node at (0.4,0.7) {$\mu_{h2}$}; \node at (0.4,0.2) {$\mu_{h3}$}; \end{tikzpicture} \end{center} \caption{(Left) An example binary tree, with internal nodes labeled by their splitting rules and terminal nodes labeled with the corresponding parameters $\mu_{ht}$ (Right) The corresponding partition of the sample space and the step function $g(\mathbf{x}, T_h, M_h)$.} \label{fig:treestep} \end{figure} The prior on $(T_h, M_h)$ strongly favors small trees and leaf parameters that are near zero, constraining each term in the sum to be a ``weak learner''. Each tree is assigned an independent prior introduced by \cite{Chipman1998}, where trees are grown iteratively: Starting from the root node, the probability that a node at depth $d$ splits (is not terminal) is given by \begin{equation} \alpha (1+d)^{-\beta},\;\;\alpha\in (0,1),\;\beta\in [0,\infty). \end{equation} CGM propose $\alpha=0.95$ and $\beta=2$ as default values, which strongly favors small trees (of depth 2-3). A variable to split on is then selected uniformly at random, and given the selected variable a value to split at is selected according to a prior distribution defined over a grid. If the $j^{th}$ variable is continuous the grid for variable $j$ is either uniformly spaced or given by a collection of observed quantiles of $\{x_{ij}: 1\leq i\leq n\}$. % For binary or ordinal variables, the cutpoints can be defined as the collection of all possible values. Unordered categorical variables with $q$ levels are generally expanded as $q$ binary variables indicating each level, although alternative coding schemes could be used instead. % To set shrinkage priors on $M$ and avoid overfitting, CGM suggest scaling the data to lie in $\pm 0.5$ and assigning the leaf parameters independent priors: \begin{equation} \mu_{ht}\iid N(0,\sigma^2_\mu)\;\;\textrm{ where }\sigma_\mu=0.5/(k\sqrt{m}).\label{eq:cgmnode} \end{equation} CGM recommend $1\leq k\leq 3$, with $k=2$ as a reasonable default choice. This prior shrinks the individual basis functions strongly toward zero and yields a $N(0, m\sigma^2_\mu)$ marginal prior for $f(\mathbf{x})$ at any covariate value. Since $\sqrt{m}\sigma_\mu=0.5/k$ this prior assigns approximately 95\% probability to the range of the transformed data ($\pm 0.5$) when $k=2$, so $\sigma_\mu$ (through $k$) can be used to calibrate the prior. % \subsection{MCMC for BART: ``Bayesian backfitting''}\label{sec:bayesianbackfit} A key ingredient in the MCMC sampler for BART is the ``Bayesian backfitting'' step, which we describe briefly here. (The Bayesian backfitting label is due to \cite{Hastie2000-oc}, who proposed a similar algorithm for MCMC sampling in additive models.) Let $T_{(h)}\equiv\{T_l: 1\leq l \leq m,\ l\neq h\}$ denote all but the $h^{th}$ tree with $M_{(h)}$ defined similarly. CGM's MCMC algorithm updates $(T_h, M_h\mid T_{(h)}, M_{(h)}, -)$ in a block. This is simplified by the observation that \begin{equation} R_{hi} = \left( y_i - \sum_{l\neq h}^m \ghxi{l}{i}\right) \sim N(\ghxi{h}{i}, \sigma^2),\label{eq:backfit} \end{equation} so that $(T_h, M_h)$ only depends on the data through the vector of current partial residuals $R_h = (R_{h1}, R_{h2},\dots R_{hn})$. The partial residuals follow the Bayesian regression tree model described in \cite{Chipman1998}, so the Metropolis-Hastings update given there can be can be adopted to sample from $(T_h, M_h\mid -)$ directly, treating $R_h$ as the observations. Jointly updating the $(T_h, M_h)$ pairs obviates the need for transdimensional MCMC algorithms (to cope with the fact that the length of $M_h$ changes with the depth of $T_h$), which can be delicate to construct \citep{Green1995-ey}. In addition, block updating parameters often accelerates the mixing of MCMC algorithms \citep{Liu1994-qm, Roberts1997-jg}. The efficiency of this blocked MCMC sampler is a key feature of BART, and one of the contributions of this paper is to generalize this sampler to a wider range of models where backfitting is infeasible. \section{Log-linear BART Models}\label{sec:log-linear} Extensions of the BART model in \eqref{eq:meanbart} have previously been limited to Gaussian models. CGM utilized BART for binary classification using a probit link and \cite{AlbertChib}'s data augmentation. \cite{Kindo2013} similarly extended BART to unordered categorical responses with latent Gaussian random variables in a multinomial probit regression model. \cite{Sparapani2016-cf} use a clever reparameterization to adapt probit BART to survival analysis. The focus on Gaussian models seems to be motivated by the desire to utilize the Bayesian backfitting MCMC algorithm. However, many models either lack a natural representation in terms of observed or latent Gaussian random variables or have a different, more convenient latent variable formulation. We consider several such models below. These models include one or more regression functions with positivity constraints. The natural extension of BART to this setting is obtained by expanding the log of the regression function into a sum of trees: \begin{equation} \log[f(\mathbf{x})] = \sum_{h=1}^m g(\mathbf{x}, T_h, M_h), \end{equation} yielding log-linear Bayesian additive regression trees. We introduce log-linear BART models for categorical and count responses in the following subsections. \subsection{Multinomial logistic regression models} Suppose that for each covariate value $\mathbf{x}_i$ we observe $n_i$ observations falling into one of $1\leq j\leq c$ categories. Often $n_i=1$ for all $i$, as in the case with continuous covariates. Let $y_{ij}$ be the number of observations with covariate value $\mathbf{x}_i$ in category $j$ (so that $\sum_{j=1}^c y_{ij} = n_i$). We assume that the probability of observing category $j$ at a given covariate level is \begin{equation} \pi_{j}(\mathbf{x}_i) = \frac{ f^{(j)}(\mathbf{x}_i) }{ \sum_{l=1}^c f^{(l)}(\mathbf{x}_i) }, \end{equation} or equivalently that the log odds in favor of category $j'$ over $j$ are given by \begin{equation} \log[f^{(j')}(\mathbf{x}_i)] - \log[f^{(j)}(\mathbf{x}_i)]\label{eq:unidlogodds} \end{equation} for any $j\neq j'$. Assuming $\log[f^{(j)}(\mathbf{x}_i)] = \sum_{h=1}^m g(\mathbf{x}, T^{(j)}, M^{(j)})$ induces a log-linear form for each of the log odds functions in \eqref{eq:unidlogodds}, defining a multinomial logistic BART model: \begin{equation} \pi_{j}(\mathbf{x}_i) = \frac{ \exp\left[ \sum_{h=1}^m g(\mathbf{x}, T^{(j)}, M^{(j)}) \right] }{ \sum_{l=1}^c \exp\left[ \sum_{h=1}^m g(\mathbf{x}, T^{(l)}, M^{(l)}) \right] }. \end{equation} % As written this model is unidentified. Identification could be obtained by fixing some $f^{(l)}(\cdot):= 1$, in which case $f^{(l)}(\mathbf{x})$ gives the odds of category $l$ against category $j$ at covariate value $\mathbf{x}$. However, this prior depends on the arbitrary choice of a reference category. Instead, we use proper priors for each $f^{(j)}$ and work in the unidentified space. This avoids asymmetries in the prior arising from the arbitrary choice of the reference category, and has some computational benefits as well (see Section~\ref{sec:lr-ex} in the supplemental material). Post-processing MCMC samples yields estimates of identified quantities like predicted probabilities or odds ratios. \subsection{Count regression models, with overdispersion and zero-inflation}\label{sec:poissonmodel} For count responses we begin with Poisson or negative binomial models with mean function $\mathrm{E}(y_i\mid \mathbf{x}_i) = \mu_{0i}f(\mathbf{x}_i)$. Here $\mu_{0i}$ is a fixed offset such as an adjustment for unit-level exposure, or we may take $\mu_{i0}\equiv \mu_0$ to center the prior for the regression function at $\mu_0$. We induce a log-linear model for the mean function by assuming \begin{equation} \log[f(\mathbf{x})] = \sum_{h=1}^m g(\mathbf{x}, T_h, M_h). \end{equation} The Poisson model is completely specified by the mean function. The negative binomial regression model has an additional parameter $\kappa$, which controls the degree of overdispersion relative to the Poisson. Under the negative binomial model, \begin{equation} \mathrm{Var}(y_i\mid \mathbf{x}_i) = \mathrm{E}(y_i\mid \mathbf{x}_i)\left(1 + \frac{\mathrm{E}(y_i\mid \mathbf{x}_i)}{\kappa}\right). \end{equation} As $\kappa\rightarrow\infty$, the negative binomial model converges to the Poisson. The probability mass function under the Poisson model is \begin{equation} p_{\mathit{P}}(y_i\mid \mathbf{x}_i, f) = \poislik{y_i}{\mu_{0i}f(\mathbf{x}_i)}\label{eq:poislik}. \end{equation} For the negative binomial model we have \begin{equation} p_{\mathit{NB}}(y_i\mid \mathbf{x}_i, f, \kappa) = \frac{\Gamma(\kappa + y_i)}{\Gamma(\kappa)y_i!} \left( \frac{ \kappa% }{ \kappa + \mu_{0i}f(\mathbf{x}_i) } \right)^\kappa \left( \frac{ \mu_{0i}f(\mathbf{x}_i)% }{ \kappa + \mu_{0i}f(\mathbf{x}_i) } \right)^{y_i}. \end{equation} Many datasets exhibit an excess of zero values. Zero inflated variants of Poisson or negative binomial regression models accommodate the extra zeros by adding a point mass component: \begin{equation} \Pr(Y_i=y\mid \mathbf{x}_i)= \begin{cases} (1-\omega(\mathbf{x}_i)) + \omega(\mathbf{x}_i)p(y\mid \mathbf{x}_i, f, \kappa) & \text{if } y = 0 \\ \omega(\mathbf{x}_i)p(y\mid \mathbf{x}_i, f, \kappa) & \text{if } y > 0 \end{cases}\label{eq:zip0} \end{equation} where $p(y\mid \mathbf{x}_i, f, \kappa)$ is the probability mass function of a Poisson or negative binomial with mean $\mu_{0i}f(\mathbf{x})$ and dispersion $\kappa$ and $1-\omega(\mathbf{x}_i)$ is the probability that a zero is due to the point mass component. We assume that \begin{equation} \mathrm{logit}[1-\omega(\mathbf{x})] = \log[1-\omega(\mathbf{x})] - \log[\omega(\mathbf{x})] % \end{equation} has a log-linear expansion, which will be induced through the redundant parameterization \begin{equation} \omega(\mathbf{x}_i) = \frac{f^{(1)}(\mathbf{x}_i)}{f^{(0)}(\mathbf{x}_i) + f^{(0)}(\mathbf{x}_i)}, \end{equation} where $f^{(0)}$ and $f^{(1)}$ have independent log-linear BART priors as in the multinomial logistic regression model. \section{MCMC and Data Augmentation for Log-linear BART}\label{sec:liks} Fitting the models in Section~\ref{sec:log-linear} is nontrivial: Some of the models lack a Gaussian representation, so CGM's Bayesian backfitting approach does not apply directly. However, the key element in CGM's MCMC sampler is actually a blocked MCMC update for each tree and its parameters, holding the other trees and parameters fixed. CGM derive this update via Bayesian backfitting, but this is not strictly necessary. The general form of the update is summarized in Algorithm \ref{alg:backfit}, using the following notation for the log-linear case: We have one or more functions that have a sum-of-trees representation on the log scale, so that $\log[f(\mathbf{x})] = \sum_{h=1}^m g(\mathbf{x}, T_h, M_h)$. It will be convenient to work with $f$ directly, so we define the following transformed parameters: \begin{align} \lambda_{ht} &= \exp(\mu_{ht}),\quad \Lambda_h = (\lambda_{h1},\lambda_{h2},\dots \lambda_{hb_h})', \end{align} and note that $g(\mathbf{x}, T_h, \Lambda_h) = \exp[g(\mathbf{x}, T_h, M_h)] = \lambda_{ht}\text{ if }\mathbf{x}\in\mathcal{A}_{ht} \text{ (for $1\leq t\leq b_h$)}$, so \begin{equation} f(\mathbf{x}) = \exp\left[\sum_{h=1}^m g(\mathbf{x}, T_h, M_h)\right] = \prod_{h=1}^m g(\mathbf{x}, T_h, \Lambda_h). \end{equation} Additional parameters or latent variables are collected in a vector $\theta$. In models with more than one regression function we consider MCMC updates for each regression function conditional on the others, which we also collect in $\theta$. \begin{algorithm} \caption{One step of the MCMC algorithm for updating a log-linear BART function parameterized by $T=\{T_h\}$ and $\Lambda=\{\Lambda_h\}$ ($1\leq h\leq m$)} \label{alg:backfit} \begin{algorithmic} \INPUT{Data and current values for $T$, $\Lambda$, and other parameters/latent variables (in $\theta$)} \OUTPUT{New values of $T$, $\Lambda$} \For{$1\leq h \leq m$}\\ \begin{enumerate} % % \item Propose $T^*_h\sim q(T^*_h;\ T_h)$ \item Set $a\gets \frac{L(T^*_h;\ T_{(h)}, \Lambda_{(h)}, \theta, y)p(T^*_h)}{L(T_h;\ T_{(h)}, \Lambda_{(h)}, \theta, y)p(T_h)} \frac{q(T_h;\ T^*_h)}{q(T^*_h;\ T_h)}$ \item Set $T_h\gets T^*_h$ with probability $\min(1, a)$ \item Sample $\Lambda_h\sim p(\Lambda_h\mid T_h, -)$ % \end{enumerate} \EndFor \end{algorithmic} \end{algorithm} Computing the conditional integrated likelihood function \begin{equation} L(T_h;\ T_{(h)}, \Lambda_{(h)}, \theta, y) = \int L(T_h, \Lambda_h;\ T_{(h)}, \Lambda_{(h)}, \theta, y)p(\Lambda_h)d\Lambda_h \end{equation} is a key step in Algorithm 1. This is trivial in Gaussian BART models because CGM's normal prior is conjugate to the distribution of the observed or latent data. Efficiently computing this integral under CGM's original prior in log-linear BART models is not as simple, since the prior is no longer conjugate. In particular, we will be concerned with likelihoods of the form \begin{equation} L(T, \Lambda; \Theta, y) = \prod_{i=1}^n w_if(\mathbf{x}_i)^{u_i}\exp[v_if(\mathbf{x}_i)]\label{eq:poissontype} \end{equation} where $w_i$, $u_i$,and $v_i$ are some functions of $\theta$ and $y_i$ that will vary depending on the model under consideration. To derive the corresponding conditional likelihood for $(T_h, \Lambda_h)$, define $\f_{(h)}(\mathbf{x}) = \prod_{l\neq h} g(\mathbf{x}, T_h, \Lambda_h) $. This is the fit from all but the $h^{th}$ tree, and does not vary with $(T_h, \Lambda_h)$. Then we have \begin{align} L((T_h, \Lambda_h); T_{(h)}, \Lambda_{(h)}, y)&=\prod_{i=1}^n w_i f(\mathbf{x}_i)^{u_i}\exp[v_if(\mathbf{x}_i)]\\ &=\prod_{i=1}^n w_i[\f_{(h)}(\mathbf{x}_i)g(\mathbf{x}_i, T_h, \Lambda_h)]^{u_i}\exp[v_i\f_{(h)}(\mathbf{x}_i)g(\mathbf{x}_i, T_h, \Lambda_h)]\\ &=\prod_{t=1}^{b_h} \prod_{i: \mathbf{x}_i\in \mathcal{A}_{ht}} w_i [\f_{(h)}(\mathbf{x}_i)\lambda_{ht}]^{u_i}\exp[v_i\f_{(h)}(\mathbf{x}_i)\lambda_{ht}]\label{eq:leaflik}\\ &= c_h \prod_{t=1}^{b_h} \lambda_{ht}^{r_{ht}} \exp\left[- s_{ht}\lambda_{ht}\right],\label{eq:genclik} \end{align} where the outer product in \eqref{eq:leaflik} runs over the end nodes of $T_h$ and the inner product is over the observations with covariate values in the corresponding element of the partition (as defined in \eqref{eq:partdef}), and \begin{align} c_h = \prod_{i=1}^n w_i\f_{(h)}(\mathbf{x}_i)^{v_i},\quad r_{ht} = \sum_{i: \mathbf{x}_i\in A_{ht}} u_i,\quad s_{ht} = \sum_{i: \mathbf{x}_i\in A_{ht}} \f_{(h)}(\mathbf{x}_i)v_i, \end{align} with $r_{ht}$ and $s_{ht}$ playing the role of conditional ``sufficient'' statistics. To implement Algorithm 1, we need to compute the conditional integrated likelihood \begin{equation} L(T_h;\ T_{(h)}, \Lambda_{(h)}, y) = \int c_h \prod_{t=1}^{b_h} \lambda_{ht}^{r_{ht}} \exp\left[- \lambda_{ht}s_{ht}\right] p(\Lambda_h) d\Lambda_h\label{eq:cilik} \end{equation} in step 2. The original BART prior for $M_h$ induces independent lognormal priors for $\lambda_{ht}$, and the integral \eqref{eq:cilik} is unavailable under this prior. Before introducing a new conjugate prior in Section \ref{sec:priors}, we show how all the models in Section~\ref{sec:log-linear} admit simple data augmentation schemes that result in likelihood functions with multiple factors of the form \eqref{eq:poissontype}. This will allow us to use one algorithm to fit all the models in Section 2. \subsection{Data Augmentation for Multinomial Logistic Models}\label{sec:damultinom} The likelihood contribution for each distinct covariate value is \begin{equation} p_{MN}(y_i) = \binom{n_i}{y_{i1}y_{i2}\dots y_{ic}} \frac{ \prod_{j=1}^c f^{(j)}(\mathbf{x}_i)^{y_{ij}} }{ (\sum_{l=1}^c f^{(l)}(\mathbf{x}_i))^{n_i}\label{eq:multi} }. \end{equation} We augment the likelihood function by introducing a new latent variable $\phi_i$, and defining a joint model for $(\phi_i, y_i)$ where the marginal probability mass function of $y_i$ is \eqref{eq:multi} and $(\phi_i\mid y_i, -)\sim Gamma(n_i, \sum_{j=1}^c f^{(j)}(\mathbf{x}_i))$ (recall that $n_i = \sum_{j=1}^c y_{ij}$). This yields the following augmented likelihood: \begin{align} p_{MN}(y_i, \phi_i) &= \binom{n_i}{y_{i1}y_{i2}\dots y_{ic}} \left(\prod_{j=1}^c f^{(j)}(\mathbf{x}_i)^{y_{ij}}\right)\frac{\phi_i^{n_i-1}}{\Gamma(n_i)}\exp\left[-\phi_i\sum_{j=1}^c f^{(j)}(\mathbf{x}_i)\right]\\ &= \binom{n_i}{y_{i1}y_{i2}\dots y_{ic}} \frac{\phi_i^{n_i-1}}{\Gamma(n_i)}\prod_{j=1}^c f^{(j)}(\mathbf{x}_i)^{y_{ij}}\exp\left[-\phi_i f^{(j)}(\mathbf{x}_i)\right].\label{eq:augmulti} \end{align} Note that given $\phi_i$ the augmented model \eqref{eq:augmulti} factors into separate terms for each $f^{(j)}(\cdot)$, with each taking the form of \eqref{eq:poissontype}. The ``gamma trick'' as a tool for dealing with sums or integrals in the denominator has appeared in other settings as well (e.g. \citep{Nieto-Barajas2004-kg,Walker2011-to, Caron2012-nd}). The same likelihood (up to an irrelevant constant) can also be derived via the Poisson-multinomial transformation \citep{Baker1994,Forster2010}, which adds an artificial Poisson distribution for the cell total $n_i$ parameterized by $\phi_i$ and $\sum_{j=1}^c f^{(j)}(\mathbf{x}_i)$ (with a further prior on $\phi_i$, $p(\phi_i)\propto \phi_i^{-1}$). Since $n_i$ is often fixed by design, in our view casting the augmented model directly in terms of a proper joint probability model for $(y_i,\phi_i)$ is more transparent and removes any questions about the propriety of the posterior. Our data augmentation has some advantages over alternatives for logistic models: There is a single latent variable with a simple distribution for each distinct covariate value (not necessarily each observation). Additionally, the functions $f^{(j)}$ are conditionally independent given $\phi$ allowing for parallel updates to speed up the most computationally intensive step during MCMC. No other augmentation for logistic models has all these features. In addition to proposing the current state-of-the-art Polya-Gamma data augmentation for logistic likelihoods, \cite{Polson2013-ym} give a recent review and comparison of several choices (including e.g. \cite{Holmes2006-ol,Fruhwirth-Schnatter2010-zz}). While these augmentations yield Gaussian models, they either require multiple latent variables per observation or latent variables with non-standard distributions. None yield conditional independence of the $f^{(j)}$'s. In related work \cite{Kindo2013} proposed a multinomial probit BART model using \cite{AlbertChib}'s data augmentation, which requires sampling from a truncated multivariate normal latent variable for each observation. It also requires the specification of a reference category and a prior for the covariance matrix over the latent Gaussian random variables, neither of which is easy or inconsequential (see \cite{burgette2010symmetric} for discussion about reference categories, and \cite{burgette2012trace} on covariance matrix priors in linear regression settings). It also does not result in conditional independence of the $f^{(j)}$'s. \subsection{Data Augmentation for Count Models}\label{sec:dacount} The Poisson model requires no data augmentation. The negative binomial and zero-inflated Poisson data augmentation schemes can be obtained via restrictions of the data augmentation for the zero-inflated negative binomial (ZINB) model, which we describe below. The likelihood contribution of a single observation under the ZINB model is \begin{align} p_{ZINB}(y_i\mid \mathbf{x}_i, f, f^{(0)}, f^{(1)}, \kappa) =& \frac{f^{(1)}(\mathbf{x}_i)}{f^{(0)}(\mathbf{x}_i) + f^{(1)}(\mathbf{x}_i)} p_{\mathit{NB}}(y_i\mid \mathbf{x}_i, f, \kappa)\\ &+\left(\frac{f^{(0)}(\mathbf{x}_i)}{f^{(0)}(\mathbf{x}_i) + f^{(1)}(\mathbf{x}_i)}\right){\ind{y_i=0}}\label{eq:likzinb} \end{align} Introducing $\xi_i,\phi_i\in (0, \infty)$ and $Z_i\in \{0,1\}$ we can define the data augmented likelihood: \begin{align} p_{ZINB}(y_i, Z_i, \phi_i, \xi_i \mid f^{(0)}, f_i, \kappa, f)= &f^{(0)}(\mathbf{x}_i)^{1-Z_i}\exp[-\phi_if^{(0)}(\mathbf{x}_i)]\label{eq:nbf1}\\ &\timesf^{(1)}(\mathbf{x}_i)^{Z_i}\exp[-\phi_if^{(1)}(\mathbf{x}_i)]\label{eq:nbf2}\\ & \timesf(\mathbf{x}_i)^{Z_iy_i}% \exp\left[-Z_i\xi_i\mu_{0i}f(\mathbf{x}_i)\right]\label{eq:nbf3}\\ &\times\left\{ \frac{1}{\Gamma(\kappa)y_i!} \kappa^\kappa% \mu_{0i}^{y_i}% \xi_i^{\kappa+y_i-1}\exp\left[-\xi_i\kappa\right] \right\}^{Z_i}\\ &\times\ind{Z_i=1\text{ if }y_i>0} .\label{eq:zipaug} \end{align} \begin{prop} \label{prop:zinbaug} Integrating over $\xi_i, \phi_i,$ and $Z_i$ in \eqref{eq:nbf1}-\eqref{eq:zipaug} yields \eqref{eq:likzinb}. \end{prop} Note that given values for all the latent variables, the likelihood factors into terms of the form \eqref{eq:poissontype} for each of the log-linear functions (Eq. \eqref{eq:nbf1}-\eqref{eq:nbf3}). The augmented likelihood function for the negative binomial model {\em without} zero-inflation is obtained by fixing $Z_i=1$ for all $i$ and removing terms \eqref{eq:nbf1} and \eqref{eq:nbf2}. An augmented likelihood for the zero-inflated Poisson model is recovered by setting $\xi_i=1$ for all $i$ and dropping the remaining terms involving $\kappa$. Applying both restrictions leads to the Poisson likelihood function. \section{Prior choice and posterior computation} \label{sec:priors} Given the conditional likelihood \begin{equation} L((T_h, \Lambda_h); T_{(h)}, \Lambda_{(h)}, \Theta, y) = c_h \prod_{t=1}^{b_h} \lambda_{ht}^{r_{ht}} \exp\left[- \lambda_{ht}s_{ht}\right],\label{eq:condlikgen} \end{equation} from the previous section we would prefer a prior for $\lambda_{ht}$ that is \begin{enumerate} \item Symmetric about $0$ on the log scale, since \begin{equation} \log[f(\mathbf{x})] = \sum_{h=1}^m\log[g(\mathbf{x}, T_h, \Lambda_h) ] = \sum_{h=1}^m \sum_{t=1}^{b_h} \log(\lambda_{ht})\ind{\mathbf{x}\in \mathcal{A}_{ht}}. \end{equation} Each term in the sum should contribute a small amount to the overall fit, in either direction with equal prior probability, in the same spirit as the original CGM prior. % \item Conjugate to \eqref{eq:condlikgen}, so we can compute the integrated likelihood \eqref{eq:cilik} in closed form and easily sample the end node parameters from their full conditional $p(\Lambda_h\mid T_h, -)$. \end{enumerate} Independent lognormal priors on $\lambda_{ht}$ satisfy 1, but not 2. Independent Gamma priors satisfy 2, but not 1 - they are asymmetric on the log scale. Exact symmetry and conditional conjugacy requires a new prior, which we introduce below. \subsection{A symmetric, conditionally conjugate prior}\label{sec:mixleaf} Our strategy for deriving the new prior on $\lambda_{ht}$ is to ensure that in addition to symmetry and conjugacy, we have $\log[f(\mathbf{x})]\approxsim N(0, a^2_0)$ marginally at any covariate value $\mathbf{x}$. This allows us to use $a_0$ to calibrate the log-linear prior the same way that $\sigma_\mu$ parameter calibrates the original CGM prior. (Nonzero means for the log-linear regression function are handled via multiplicative offsets.) So with independent priors for $\lambda_{ht}$, we require that $\mathrm{E}(\log[\lambda_{ht}])=0$ and $\mathrm{Var}(\log[\lambda_{ht}])=a_0^2/m$. Typically $m$ is large, so the normal approximation to the marginal distribution of $\log[f(\mathbf{x})]$ will be accurate by the central limit theorem. The specific prior below is somewhat complex, but the end result is very similar to CGM's leaf prior and has a single, interpretable tuning parameter (for a fixed $m$). Our proposed leaf prior is a mixture of generalized inverse Gaussian (GIG) distributions. GIG distributions are characterized by their density function \begin{equation} p_{GIG}(\lambda\mid \eta, \chi, \psi) = \frac{\lambda^{\eta-1} \exp\left[{-\frac{1}{2}} \left( \chi/\lambda + \psi\lambda \right) \right]}{Z(\eta, \chi, \psi)}, \end{equation} with normalizing constant \begin{equation} Z(\eta, \chi, \psi) = \begin{cases} \Gamma(\eta)\left(\frac{2}{\psi}\right)^{\eta} & \text{if } \eta>0,\ \chi=0,\ \psi > 0\\ \Gamma(-\eta)\left(\frac{2}{\chi}\right)^{-\eta} & \text{if } \eta<0,\ \chi>0,\ \psi = 0\\ \frac{2K_\eta(\sqrt{\psi\chi})}{(\psi/\chi)^{(\eta/2)}} & \text{if } \chi > 0,\ \psi>0, \label{eq:nc} \end{cases} \end{equation} where $K_\eta(x)$ is the modified Bessel function of the second kind. The gamma and inverse gamma distributions are recovered when $\chi=0$ and $\psi=0$, respectively. This distribution is also conjugate to \eqref{eq:condlikgen}. Our mixture prior is given by \begin{align} p_\lambda(\lambda_{ht}\mid c,d) % =\frac{1}{2} p_{GIG}(\lambda_{ht}\mid -c, 2d, 0) +\frac{1}{2}p_{GIG}(\lambda_{ht}\mid c, 0, 2d). \label{eq:ptaugig} \end{align} where $c$ and $d$ are parameters that will be determined by $a_0$. As a mixture of GIG distributions this prior is also conjugate to \eqref{eq:condlikgen}. We refer to this as the $P_\lambda(c, d)$ distribution. The $P_{\lambda}(c,d)$ distribution has the following simple stochastic representation: \begin{align} W_{ht}&\sim Gamma(c, d)\\ U_{ht}&\sim Bernoulli(1/2)\\ \lambda_{ht} &= U_{ht}W_{ht} + (1-U_{ht})(1/W_{ht}), \end{align} (The $W$ and $U$ random variables are never instantiated and only introduced here for exposition.) By construction the implied prior on $\mu_{ht}$ is symmetric about $0$ since $\mu_{ht} = \log(W_{ht})$ or $-\log(W_{ht})$ with equal probability. The parameters $c,d$ can be set from user-supplied values of $a_0$ and $m$. The optimal values are not available in closed form (although they are easy to obtain numerically) but for a large number of trees and/or a small value of $a_0$, the values of $c$, $d$ also have simple approximate values. These results are summarized in Propositions~\ref{prop:pars} and~\ref{prop:parsapprox}. \begin{prop} \label{prop:pars} If $\lambda\sim P_\lambda(c, d)$, $\mathrm{Var}(\lambda) = a_0^2/m$ when $\psi''(c) = a_0^2/m$ and $d = \exp(\psi'(c))$, where $\psi(c) = \log[\Gamma(c)]$. The function $\psi''(c)$ is monotone decreasing and hence invertible on $\mathbb{R}^+$, so the solutions to these equations are unique. \end{prop} \begin{prop} \label{prop:parsapprox} For small values of $a_0^2/m$, the values of $c$ and $d$ from Proposition~\ref{prop:pars} are approximately $c\approx m/a_0^2 +0.5$ and $d\approx m/a_0^2$. \end{prop} One could calibrate a gamma prior similarly, and in fact the shape and rate parameters will be the same as $c$ and $d$ in Proposition~\ref{prop:pars} (respectively). Figure~\ref{fig:nodeprior} compares the calibrated $P_\lambda$ and log-gamma priors to CGM's normal priors for $m=25$ and $a_0=3.5/\sqrt{2}$, which are actual parameter settings we will use later. The log-gamma prior is asymmetric, compared to the log-$P_\lambda$ prior which is symmetric and has slightly heavier tails than the normal. The log-gamma and log-$P_\lambda$ priors both become increasingly close to the normal distribution as $a_0^2/m\rightarrow 0$, but the asymmetry in the log-gamma prior for small values of $m$ is undesirable. The $P_\lambda$ prior is a more reasonable default choice for the entire range of $a_0$ and $m$ values. \begin{figure}[ht] \begin{center} { \includegraphics[width=0.8\linewidth]{fig/nodeprior-m-20-a0-35} } \end{center} \caption{The proposed $P_\lambda$ node-parameter prior (green dashed line) compared to CGM's log-normal prior on $\lambda_{ht}$ (solid black) and a Gamma prior calibrated to have the same moments on the log scale (dashed orange). Here $m=25$ and $a_0=3.5/\sqrt{2}$} \label{fig:nodeprior} \end{figure} \subsection{Posterior computation} \label{sec:mcmc} With the prior specified we can now fill in the details of Algorithm \ref{alg:backfit}: \begin{enumerate} \item[1-3.] We utilize the grow, prune, change and swap proposal moves described by CGM (originally introduced in \cite{Chipman1998}) but any proposals could be used (see e.g. \cite{Denison1998-hl,Wu2007,Pratola2013} for other possibilities). The integrated likelihood function that appears in the acceptance ratio is \begin{align} L(T_h; T_{(h)}, \Lambda_{(h)}, \Theta, y) &= c_h \prod_{t=1}^{b_h} \int \lambda_{ht}^{r_{ht}} \exp\left[- \lambda_{ht}s_{ht}\right] p_\lambda(\lambda_{ht}\mid c, d) d\lambda_{ht}\\ &=c_h \prod_{t=1}^{b_h}\frac{Z(-c + r_{ht}, 2d, 2s_{ht}) + Z(c + r_{ht}, 0, 2[d+s_{ht}])} {2Z(c, 0, 2d)}\label{eq:intlikexp} \end{align} using the fact that $Z(c, 0, 2d) = Z(-c, 2d, 0)$. The leading term $c_h$ cancels in the Metropolis-Hastings acceptance ratio, but the denominator in \eqref{eq:intlikexp} does not when the proposal changes the dimension of the partition (e.g. grow/prune moves). \item[4.] Sample $(\Lambda_h\mid T_h, T_{(h)}, \Lambda_{(h)})$ from its full conditional. The components of $\Lambda_h$ are conditionally independent with full conditional distributions \begin{align} p(\lambda_{ht}\mid -) \propto\ &\lambda_{ht}^{(-c + r_{ht})} \exp\left[{-\frac{1}{2}} \left( 2d/\lambda_{ht} + 2s_{ht}\lambda_{ht} \right) \right] &+\lambda_{ht}^{(c + r_{ht})} \exp\left[{-\frac{1}{2}} \left( 2d+ 2s_{ht} \right)\lambda_{ht} \right]. \end{align} This distribution is a mixture of GIG distributions: \begin{equation} p(\lambda_{ht}\mid -) = \pi_{ht}p_{GIG}(-c + r_{ht}, 2d, 2s_{ht}) + (1-\pi_{ht})p_{GIG}(c + r_{ht}, 0, 2[d+s_{ht}]) \end{equation} where \begin{equation} \pi_{ht} = \frac{Z(-c + r_{ht}, 2d, 2s_{ht})}{Z(-c + r_{ht}, 2d, 2s_{ht}) + Z(c + r_{ht}, 0, 2[d+s_{ht}])}. \end{equation} \end{enumerate} Algorithm 1 forms the backbone of MCMC in log-linear BART models, with additional parameters or latent variables sampled from their conditional distributions in further MCMC steps. In the following subsections we describe how to calibrate the $P_\lambda$ prior for the models in Section 2 and outline posterior sampling. \subsection{Prior choice and posterior computation for multinomial logistic models} In the multinomial logistic BART model, for any two outcome categories $j\neq j'$ the log odds in favor of $j'$ are given by \begin{equation} \log[f^{(j')}(\mathbf{x}_i)] - \log[f^{(j)}(\mathbf{x}_i)],\label{eq:unidlogodds2} \end{equation} and each function $f^{(l)}(\cdot)$ has an independent log-linear BART prior parameterized by $(T^{(l)}, \Lambda^{(l)})$ (for $1\leq l\leq c$). We assume that the prior on each $f^{(l)}(\cdot)$ uses the same number of trees $m$ and parameter $a_0$ in the $P_\lambda$ prior. Then the induced prior on \eqref{eq:unidlogodds2} is approximately $N(0, 2a_0^2)$, so $a_0$ can be chosen to reflect prior beliefs about the plausible range of the log odds functions. Since the log-odds lie within $(-2\sqrt{2}a_0, 2\sqrt{2}a_0)$ at any covariate value with probability approximately 0.95 under the prior, $a_0 = 3.5/\sqrt{2}$ is a reasonable default choice. A single step of the MCMC sampler proceeds as follows: \begin{enumerate} \item For $1\leq i \leq n$, draw $\phi_i\sim Gamma(n_i, \sum_{j=1}^c f^{(j)}(\mathbf{x}_i))$. This is a direct consequence of the data augmentation, which was conditional on $y_i$ and the regression functions. \item For $1\leq j \leq c$, \emph{independently} update the parameters of $f^{(j)}$ using Algorithm \ref{alg:backfit} and the expressions in Section \ref{sec:mcmc} with \begin{equation*} r_{ht} = \sum_{i: \mathbf{x}_i\in A^{(j)}_{ht}} y_{ij},\quad s_{ht} = \sum_{i: \mathbf{x}_i\in A^{(j)}_{ht}} \phi_{i} \f_{(h)}^{(j)}(\mathbf{x}_i) \end{equation*} where $\f_{(h)}^{(j)}(\mathbf{x}_i) = \prod_{l\neq h} g(\mathbf{x}, T^{(j)}_h, \Lambda^{(j)}_h)$ is the fit from all but the $h^{th}$ tree. \end{enumerate} The augmentation in \eqref{eq:augmulti} yields a very convenient MCMC algorithm: There is a \emph{single} augmented variable for each covariate value, regardless of the number of categories or observations, and it has a standard, untruncated distribution. Further, the $c$ regression functions are conditionally independent given the latent variable. % \subsection{Prior choice and posterior computation for count models} We describe prior specification and MCMC sampling for the most complex case, the zero-inflated negative binomial. Prior specification is similar in negative binomial or zero-inflated Poisson models. Specializations of the MCMC algorithm to the negative binomial or zero-inflated Poisson follow from the discussion at the end of Section \ref{sec:dacount}. Recall that the probability of observing an ``excess'' zero is \begin{equation} 1-\omega(\mathbf{x}_i) = \frac{f^{(0)}(\mathbf{x}_i)}{f^{(0)}(\mathbf{x}_i) + f^{(1)}(\mathbf{x}_i)}. \end{equation} Similar to the previous subsection, independent log-linear BART priors on $f^{(0)}$ and $f^{(1)}$ with common values of the concentration parameter and number of trees (say $a_{z0}$ and $m_z$) induce a log-linear BART logistic regression model: \begin{equation} \mathrm{logit}[1-\omega(\mathbf{x})] = \log[f^{(0)}(\mathbf{x})] - \log[f^{(1)}(\mathbf{x})] % \label{eq:logistic-omega} \end{equation} The log-odds of observing an excess zero at any covariate value \eqref{eq:logistic-omega} is approximately distributed $N\left(0, 2a_{z0}^2\right)$ marginally, so $a_{z0}$ may be chosen based on plausible values for the odds function. As defaults we suggest $m_z=100$ and $a_0 = 3.5/\sqrt{2}$. In the zero-inflated model, $\mu_{0i}f(\mathbf{x}_i)$ is the mean of the non-point mass component of the zero-inflated model and $f(\cdot)$ has a log-linear BART prior with $m$ trees and concentration parameter $a_0$. Assuming $\mu_{0i}=\mu_0$, a reasonable default prior is obtained by positing a near-maximum value for $y$, say $y^*$, and setting $a_0 = 0.5[\log(y^*)-\mu_0]$. Then $\Pr(f(\mathbf{x}_i)\leq y^*) \approx 0.95$ marginally, since $\log[f(\mathbf{x}_i)]\approxsim N(0, a_0^2)$. For large values of $\mu_0$ it may also be necessary to specify a near-minimum as well. % For $\kappa$, we use beta prime priors: $p(\kappa)\propto \kappa^{a_\kappa-1}(1+\kappa)^{-a_\kappa+b_\kappa}$. This is a heavy-tailed prior which is equivalent to a $Beta(a_\kappa, b_\kappa)$ prior on $\kappa/(1+\kappa)$. Gamma priors are another reasonable choice (e.g. \cite{zhou2012lognormal}). % Posterior sampling for the ZINB model has many more steps than the multinomial logistic regression model, and is outlined in Section~\ref{sec:zinb-mcmc} of the supplemental material. The primary innovation is three applications of Algorithm~\ref{alg:backfit} that can be run in parallel, with all the remaining parameters updated in a single block for efficiency. \section{Illustrations and applications}\label{sec:examples} \subsection{Simulation: Multinomial Logistic Regression} We compared default and cross-validated multinomial logistic BART models (BART-default and BART-CV, respectively) with several classification methods using 20 datasets taken from the UCI repository and processed as in \cite{doweneed}. The primary purpose of this exercise is to establish multinomial logistic BART as having reasonable classification performance. We do not expect BART to necessarily outperform other machine learning methods designed and tuned for classification accuracy. We would also like to compare the performance of default and CV BART models, as default variants require less computation and yield valid posterior inference. For our comparison we selected datasets with 3-6 outcome categories and between 100 and 3,000 observations. We consider two variants of BART-default: one that sets the number of trees per category to 100, so that the log-odds functions involve $200$ trees, and one that sets the number of trees per category such that the {\em total} number of trees is as close to 200 as possible. Both set $a_0 = 3.5/\sqrt{2}$. BART-CV was cross validated over range of $m$ that included both default rules for the number of trees and $25$ trees per category. Possible values for $a_0$ included $2/\sqrt{2}, 3.5/\sqrt{2}$ (the default choice) and $6/\sqrt{2}$. Competing methods included random forests, gradient boosted models, penalized multinomial probit regression, a support vector machine using radial basis functions, and a single layer neural net\footnote{We tried to include \cite{Kindo2013}'s multinomial probit BART, but the accompanying R package routinely crashed during simulations. We expect that it would perform similar to multinomial logistic BART in cross-validation, at substantially increased computational cost due to the need to update several latent Gaussian variables per covariate value as well as a latent covariance matrix, and to cross-validate the choice of reference category in addition to $m$ and the parameters of the covariance matrix prior. (\cite{Kindo2013} propose no default settings for reference category or prior on the covariance matrix.)}. Each method was cross-validated over its default parameter grid in the R package \texttt{caret}. Classifiers were compared on the basis of a 10-fold CV estimate of classification accuracy. \begin{figure}[ht] \begin{center} { \includegraphics[width=0.98\linewidth]{fig/loglinear_relAcc.pdf} } \end{center} \caption{Relative accuracy over the 10 folds for each dataset in the classification simulation.} \label{fig:log-linear_relAcc} \end{figure} \begin{figure}[ht] \begin{center} { \includegraphics[width=0.4\linewidth]{fig/loglinear_defaults.pdf} } \end{center} \caption{Relative accuracy of the two BART-default variants versus BART-CV.} \label{fig:loglinear_defaults} \end{figure} Table ~\ref{tab:classification} gives CV estimates of out of sample classification accuracy, along with its standard deviation. BART-CV is generally competitive and has the best accuracy in 5 of the 20 examples, although the differences in accuracy are typically small relative to the standard deviation. To get a better sense of the variability across splits, Figure \ref{fig:log-linear_relAcc} shows the relative out-of-sample accuracy of each method against the best performer across the 10 folds for each of the 20 datasets. Once again, for most problems no single method clearly dominates. BART-CV is not only competitive, but its out of sample accuracy tends to be stable across the different splits. The cross-validated BART models were generally not default choices: Two out of twenty datasets yielded a cross-validated model that was also one of the defaults. In ten cases cross-validation selected a smaller set of trees (25 per level). In four cases cross-validation yielded lower values of $a_0$ ($2/\sqrt{2}$), and in twelve cases larger values of $a_0$ ($6/\sqrt{2}$) were selected. There was no clear relationship between the cross-validated parameters and the number of outcome categories, covariates, or the difficulty of the problem. However, the differences in classification accuracy where generally mild: Figure \ref{fig:loglinear_defaults} compares the relative accuracy of the two default BART prior settings against BART-CV. The default choices were nearly as accurate as the CV model at a fraction of the computational cost, and also maintain their Bayesian validity. The default prior with 100 trees per category tended to have a slight edge over the prior with 200 total trees, at some computational cost. In summary, default versions of BART have competitive predictive performance. More importantly, these are proper, fully Bayesian models that give valid posterior inference and may be incorporated into more complex models where cross-validation would be difficult even if it were desirable. An immediate example of this is the logistic BART model incorporated into the zero-inflated count regression model. \subsection{Example: Patent Citations} When applying for new patents inventors must cite related existing patents, so the number of citations a patent receives is a (crude) measure of the invention's influence. We consider predicting citation counts using data from the European Patent Office (EPO), as presented in \cite{Klein2015}. Several covariates are available; these are summarized in Table \ref{ta:patent-vars}. \cite{Klein2015} provide compelling evidence that these data cannot be adequately modeled without zero inflation and overdispersion, so we compare the ZINB-BART regression model to the semiparametric Bayesian ZINB regression models introduced in that paper. \begin{table} \centering \caption{Summary of variables in the patent citation dataset.} \label{ta:patent-vars} \resizebox{\textwidth}{!}{% \begin{tabular}{llllll} Variable & \multicolumn{1}{c}{Description} & \multicolumn{1}{c}{Mean} & \multicolumn{1}{c}{SD} & \multicolumn{1}{c}{Min} & \multicolumn{1}{c}{Max} \\ \hline opp & Patent was opposed (1=yes, 0=no) & 0.41 & - & 0 & 1 \\ \hline biopharm & Patent from biopharmaceutical sector (1=yes, 0=no) & 0.44 & - & 0 & 1 \\ \hline ustwin & U.S. ``twin'' patent exists (1=yes, 0=no) & 0.61 & - & 0 & 1 \\ \hline patus & Patent holder is from U.S (1=yes, 0=no) & 0.33 & - & 0 & 1 \\ \hline patgsgr & Patent holder is from Germany, Switzerland, & 0.24 & - & 0 & 1 \\ & or Great Britain (1=yes, 0=no) & & & & \\ \hline year & Grant year & - & - & 1980 & 1997 \\ \hline ncountry & Number of designated states for the patent & 7.8 & 4.12 & 1 & 17 \\ \hline nclaims & Number of claims against the patent & 12.3 & 8.13 & 1 & 50 \\ \hline ncit & Number of citations of the patent & 1.6 & 2.71 & 0 & 40 \\ \hline \end{tabular} } \end{table} \cite{Klein2015} select a model based on stepwise selection using DIC under semiparametric regression models for the dispersion, zero-inflation, and mean parameters. Their selected model (StAR-1) is as follows: \begin{align} \log[f(x)] =&\ \beta_0^{\mu}+ \beta_1^{\mu}\text{opp} + \beta_2^{\mu}\text{biopharm} + \beta_3^{\mu}\text{patus} + \beta_4^{\mu}\text{patsgr}\label{eq:klein0}\\ &+ f_1^{\mu}(\text{ncountry}) + f_2^{\mu}(\text{year}) + f_3^{\mu}(\text{nclaims})\\ \mathrm{logit}[1-\omega(x)] =&\ \beta_0^{\omega}% + \beta_1^{\omega}\text{biopharm} + \beta_2^{\omega}\text{(year-1991)} % % + f_1^{\omega}(\text{ncountry})\\ % % \log[\kappa(x)] =&\ \beta_0^{\kappa} + \beta_1^{\kappa}\text{patus} + \beta_2^{\kappa}\text{patgsgr}.\label{eq:klein1} \end{align} The functions $f_1^{\mu},f_2^{\mu},f_3^{\mu},$ and $f_1^{\omega}$ are modeled via cubic B-spline expansions using 20 knots, with shrinkage priors on the coefficients \citep{Klein2015}. We also consider two other specifications: A model that has the same specifications for $f(\mathbf{x})$ and $\omega(\mathbf{x})$ as above but a constant $\kappa$ (StAR-2), and a ``saturated'' model that has a constant $\kappa$, and additive models for $f(\mathbf{x})$ and $\omega(\mathbf{x})$ that include main effects for all categorical covariates and univariate B-spline basis expansions for each of the three continuous variables (StAR-3). We consider constant $\kappa$ models to compare results with ZINB-BART, which also uses a single dispersion parameter, and the ``saturated'' model is included to give some indication of the necessity of selection in this class of models. Prior distributions for the nonparametric components are the same as in \cite{Klein2015}. Posterior sampling was carried out via MCMC using the BayesX software package \citep{belitz2009bayesx}. As an alternative we consider a single ZINB-BART model with reasonable defaults - $f(\mathbf{x})$ has a log-linear BART prior with 200 trees and $a_0 = 2$, so that the marginal prior on $\mu(\mathbf{x})$ puts approximately 95\% probability over the range $(0.02, 50)$. The excess zero probability $1-\omega(\mathbf{x})$ has a logistic BART prior with 200 total trees and $a_0=3.5\sqrt{2}$, so that $\Pr(|\mathrm{logit}[1-\omega(\mathbf{x})]|<7)\approx 0.95$. The dispersion parameter $\kappa$ has a beta-prime prior with $a_\kappa=5,\ b_\kappa=3$, yielding a prior mode of 1, $E(\kappa)=2.5$, and $Var(\kappa) = 8.75$. \subsubsection{Results} We apply the same outlier removal rule as \cite{Klein2015}, deleting observations with over 50 claims against them. (B-spline models are sensitive to outliers; ZINB-BART's tree-based basis functions are not and ZINB-BART's fits are essentially unchanged when including these points.) The models are evaluated based on the Watanabe-Akaike/``widely applicable'' information criterion (WAIC) \citep{Watanabe2010-dd,Watanabe2013-fa}, defined as \begin{equation} WAIC = -2\sum_{i=1}^n \log\left( \mathrm{E}[p(y_i\mid \mathbf{x}_i, \Theta)]\right) +2\sum_{i=1}^n \mathrm{Var}[\log\{p(y_i\mid \mathbf{x}_i, \Theta)\}], \end{equation} where the expectations and variances are with respect to the posterior over $\Theta$ (overloading $\Theta$ for the moment to represent {\em all} the parameters, including any trees and their parameters). The first term is the log of the predictive density at each data point (LPD), and the second term is a measure of the effective number of parameters ($p_{waic}$). The WAIC has a number of desirable features over other information criteria: As noted by \cite{Gelman2014-kj}, it averages over the posterior rather than conditioning on a point estimate, is invariant to reparameterization, and is more readily justified outside of regular parametric models. Table \ref{ta:waic} shows that ZINB-BART has the lowest WAIC of all models considered, despite StAR-1 being chosen via stepwise selection and being somewhat more flexible in allowing the dispersion parameter $\kappa$ to vary with covariates. The estimated values of $p_{waic}$ show that all three StAR\ models have similar complexity, with the saturated model having approximately 11 additional effective parameters due to the additional nonlinear partial effects. However, this saturated model underperforms all the others -- the extra complexity swamps the mild increase in estimated predictive log likelihood. ZINB-BART has significantly more effective parameters (about 132 compared to 43-54) but a much higher predictive likelihood. The effective number of parameters is also far fewer than the actual number of parameters - a total of 400 regression trees and their associated leaf parameters, plus $\kappa$, due to the strong regularizing priors. \begin{table} \centering \caption{Comparison of the four competing models of the patent citation data.} \label{ta:waic} \begin{tabular}{l|l|l|l|} \cline{2-4} & LPD & $p_{waic}$ & WAIC \\ \hline \multicolumn{1}{|l|}{StAR-1 (stepwise DIC)} & -7783.5 & 43.6 & 15654.24 \\ \hline \multicolumn{1}{|l|}{StAR-2 (stepwise DIC, constant $\kappa$)} & -7801.7 & 43.9 & 15691.14 \\ \hline \multicolumn{1}{|l|}{StAR-3 (saturated additive model, constant $\kappa$)} & -7793.6 & 54.2 & 15695.48 \\ \hline \multicolumn{1}{|l|}{ZINB-BART} & -7688.2 & 131.5 & \textbf{15639.47} \\ \hline \end{tabular} \end{table} It is difficult to pinpoint exactly why ZINB-BART outperforms the other models, since summarizing the posterior distribution of nonparametric regression models like ZINB-BART is challenging. However, there are some interactions that may be important and are sensible based on subject matter considerations. For example, there seems to be an interaction effect between biopharm and year. This is supported by the existing literature; due to regulatory hurdles, biopharmaceutical innovations take more time to reach the market and be generally recognized \citep{jaffe1996flows}. Therefore we would expect to see a higher probability of an excess zero in recent years for biopharmaceutical patents. \begin{figure}[ht] \begin{center} { % \includegraphics[width=0.8\linewidth]{fig/biopharm.pdf} } { % \includegraphics[width=0.8\linewidth]{fig/biopharm_mu.pdf} } \end{center} \caption{Log-odds functions $\mathrm{logit}[1-\omega(\mathbf{x})]$ are given in the top row, log mean functions $\log[f(\mathbf{x})]$ are in the bottom row. (Left) Partial dependence function (solid line) and a 10\% sample of the functions as year varies. (Center) The same as the right panel, except all curves are centered at their value in 1980. (Right) Partial dependence functions computed in the entire sample (dashed gray) and in biopharm/non-biopharm subgroups separately} \label{fig:patent-logodds} \end{figure} This effect is captured in the ZINB-BART fit. The first row of Figure~\ref{fig:patent-logodds} displays summaries of the posterior over $\mathrm{logit}[1-\omega(\mathbf{x})]$. In the leftmost plot the solid center line is the {\em partial dependence} (PD) function \citep{Friedman2001-vb} defined as \begin{equation} \hat{f_j}(t) = \frac{1}{n}\sum_{i=1}^n {\mathrm{logit}[1-\omega(\tilde \mathbf{x}_i)]}, \end{equation} where $\tilde x_{ik} = x_{ik}$ for $k\neq j$ and $x_{ij}=t$. Here the $j^{th}$covariate is year. As suggested by \cite{Goldstein2015-cj}, we also plot a 10\% sample of the individual response functions $f(\tilde\mathbf{x}_i)$, with dots indicating the actual year (PD plots alone can be misleading in the presence of interactions). The middle plot centers each of the curves at their 1980 value, which makes the interaction apparent: Recent biopharm patents are more likely to have excess zeros than non-biopharm patents. The rightmost plot displays mean-centered PD functions computed across the sample (in gray) and separately for biopharm/non-biopharm patents. On average, older biopharm patents are {\em less} likely to have excess zeros than contemporaneous non-biopharm patents. The pattern is reversed for recent patents. The second row of Figure~\ref{fig:patent-logodds} shows the same set of plots for $\log[\mu(\mathbf{x}_i)]$, where no such pattern is apparent. In summary, the ZINB-BART model fits much better than additive semiparametric alternatives. This comes at some cost in summarizing and interpreting the fit, which would seem to be an advantage of the additive model. However, the results proposed by \cite{Klein2015} utilize stepwise selection on the entire dataset to select a model. Subsequent inferences are not strictly valid from a Bayesian perspective due to the double use of the data, and we should not expect them to have frequentist validity either (see e.g. \cite{Berk2013-vn}). Fitting a single nonparametric model like ZINB-BART avoids this issue, and despite the challenge of summarizing the posterior distribution we have seen that ZINB-BART can detect meaningful, interpretable interactions and nonlinearities that were not specified {\em a priori} without relying on explicit model selection. In this example the computational costs for each method are similar; MCMC for ZINB BART took approximately 8 minutes, while fitting a single StAR model took about 4 minutes to obtain similar effective sample sizes for the linear predictors (not accounting for the stepwise model selection). \section{Conclusion}\label{sec:conclusion} We have introduced a novel prior and MCMC sampler that allow us to efficiently extend BART to log-linear models for unordered categorical and count responses. We expect that these models will be useful in a variety of settings, given the range of applied problems where the original BART model and its extensions have been successfully deployed. Like the original BART model, log-linear BART is highly modular and amenable to embedding within larger models for more complex applications. The use of a logistic regression BART model in the context of zero-inflated count data is just the one step in this direction. These priors and algorithms can be used to fit a wide range of models including ordinal models like the continuation ratio logit, as well as hurdle versions of the Poisson and negative binomial models, with different data augmentation techniques. As another concrete example, in the supplemental material (Section~\ref{sec:hetmodel}) we describe how to fit models for continuous data with covariate-dependent heteroscedasticity using the methods in this paper. (This model using a different prior distribution was presented by \cite{barthet}, concurrently with a preliminary presentation of this paper.) There are a some important areas for future work: Summarizing the fit of complicated nonparametric models like BART is difficult. Other authors -- beginning with CGM -- have proposed variable selection procedures for BART that could be applied in log-linear BART directly \citep{Bleich2014-lg}. Additionally, \cite{Linero} recently introduced a modification of CGM's tree prior that is more suitable for high-dimensional settings and provides a measure of variable importance. This prior is immediately applicable to log-linear BART models. However, detecting and summarizing interesting features like interactions and nonlinearities from a BART fit remains an open problem. \bibliographystyle{./plainnat}
{'timestamp': '2017-01-09T02:02:04', 'yymm': '1701', 'arxiv_id': '1701.01503', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01503'}
arxiv
\section{Introduction} Chemistry is the language of nature. Chemists speak it fluently and have made their discipline one of the true contributors to human well-being, which has \textit{``change[d] the way you live and die''}.\cite{whitesides2015reinventing} This is particularly true for medicinal chemistry. However, creating novel drugs is an extraordinarily hard and complex problem.\cite{schneider2016novo} One of the many challenges in drug design is the sheer size of the search space for novel molecules. It has been estimated that $10^{60}$ drug-like molecules could possibly be synthetically accessible.\cite{reymond2012enumeration} Chemists have to select and examine molecules from this large space to find molecules that are active towards a biological target. Active means for example that a molecule binds to a biomolecule, which causes an effect in the living organism, or inhibits replication of bacteria. Modern high-throughput screening techniques allow to test molecules in the order of 10$^6$ in the lab.\cite{schneider2008molecular} However, larger experiments will get prohibitively expensive. Given this practical limitation of \textit{in vitro} experiments, it is desirable to have computational tools to narrow down the enormous search space. \textit{Virtual screening} is a commonly used strategy to search for promising molecules amongst millions of existing or billions of virtual molecules.\cite{stumpfe2011similarity} Searching can be carried out using similarity-based metrics, which provides a quantifiable numerical indicator of closeness between molecules. In contrast, in \textit{de-novo} drug design, one aims to directly create novel molecules that are active towards the desired biological target.\cite{schneider2005computer,hartenfeller2011enabling} Here, like in any molecular design task, the computer has to \begin{enumerate} \item[i] create molecules, \item[ii] score and filter them, and \item[iii] search for better molecules, building on the knowledge gained in the previous steps. \end{enumerate} Task i, the generation of novel molecules, is usually solved with one of two different protocols.\cite{hartenfeller2011enabling} One strategy is to build molecules from predefined groups of atoms or fragments. Unfortunately, these approaches often lead to molecules that are very hard to synthesise.\cite{hartenfeller2012dogs} Therefore, another established approach is to conduct virtual chemical reactions based on expert coded rules, with the hope that these reactions could then also be applied in practice to make the molecules in the laboratory.\cite{hartenfeller2011collection} These systems give reasonable drug-like molecules, and are considered as ``the solution'' to the structure generation problem.\cite{schneider2016novo} We generally share this view. However, we have recently shown that the predicted reactions from these rule-based expert systems can sometimes fail.\cite{neural-symbolic} Also, focussing on a small set of robust reactions can unnecessarily restrict the possibly accessible chemical space. Task ii, scoring molecules and filtering out undesired structures, can be solved with substructure filters for undesirable reactive groups in conjunction with established approaches such as docking\cite{kitchen2004docking} or machine-learning (ML) approaches.\cite{hartenfeller2011enabling,varnek2012machine,mitchell2014machine} The ML approaches are split into two branches: Target prediction classifies molecules into active and inactive, and quantitative structure-activity relationships (QSAR) seek to quantitatively predict a real-valued measure for the effectiveness of a substance (as a regression problem). As molecular descriptors, Signature Fingerprints, Extended-Connectivity (ECFP) and atom pair (APFP) fingerprints and their fuzzy variants are the \textit{de-facto} standard today.\cite{riniker2013open,rogers2010extended,alvarsson2014ligand} Convolutional Networks on Graphs are a recent addition to the field of molecular descriptors.\cite{duvenaud2015convolutional,kearnes2016molecular} Random Forests and Neural Networks are currently the most widely used machine learning models for target prediction.\cite{zupan1991neural,gasteiger1993neural,zupan1999neural,lusci2013deep,unterthiner2014deep,unterthiner2015toxicity,schneider2016hybrid,gawehn2016deep,ramsundar2015massively,kearnes2016modeling,behler2015constructing,behler2007generalized,ma2015deep} This leads to task iii, the search for molecules with the right binding affinity combined with optimal molecular properties. In earlier work, this was performed (among others) with classical global optimisation techniques, for example genetic algorithms or ant-colony optimisation.\cite{hartenfeller2011enabling,reutlinger2014multi} Furthermore, \textit{de novo} design is related to inverse QSAR.\cite{miyao2010exhaustive,miyao2016inverse,takeda2016chemical,mishima2014development} While in \textit{de novo} design design, a \textit{regular} QSAR mapping $X \rightarrow y$ from molecular descriptor space $X$ to properties $y$ is used as the scoring function for the global optimizer, in \textit{inverse} QSAR one aims to find an explicit inverse mapping $y \rightarrow X$, and then maps back from optimal points in descriptor space $X$ to valid molecules. However, this is not well defined, because molecules are inherently discrete. Several protocols have been developed to address this, for example enumerating all structures within the constraints of hyper-rectangles in the descriptor space.\cite{white2010generative,miyao2010exhaustive,miyao2016inverse,takeda2016chemical,mishima2014development,patel2009knowledge} G\'omez-Bombarelli \textit{et al.} proposed to learn continuous representations of molecules with variational auto-encoders, based on the model by Bowman \textit{et al.},\cite{bowman2015generating} and to perform Bayesian optimisation in this vector space to optimise molecular properties.\cite{gomez2016automatic} Nevertheless, this approach was not applied to create active drug molecules, and did not succeed in optimising more complex molecular properties, such as emission color and delayed fluorescence decay rate ($k_\text{TADF}$).\cite{gomez2016automatic} In this work, we suggest a novel, completely data-driven \textit{de novo} drug design approach. It relies only on a generative model for molecular structures, based on a recurrent neural network, that is trained on large sets of molecules. Generative models learn a probability distribution over the training examples; sampling from this distribution generates new examples similar to the training data. Intuitively, a generative model for molecules trained on drug molecules would "know" how valid and reasonable drug-like molecules look like, and could be used to generate more drug-like molecules. However, for molecules, these models have been studied rarely, and rigorously only with traditional models such as Gaussian mixture models (GMM).\cite{voss,white2010generative} Recently, recurrent neural networks (RNNs) have emerged as powerful generative models in very different domains, such as natural language processing,\cite{jozefowicz2016exploring} speech,\cite{graves2004biologically} images,\cite{van2016pixel} video,\cite{srivastava2015unsupervised} formal languages,\cite{gers2001lstm} computer code generation,\cite{bhoopchand2016learning} and music scores.\cite{eck2002finding} In this work, we highlight the analogy of language and chemistry, and show that RNNs can also generate reasonable molecules. Furthermore, we demonstrate that RNNs can also transfer their learned knowledge from large molecule sets to directly produce novel molecules that are biologically active by retraining the models on small sets of already known actives. We test our models by reproducing hold-out test sets of known biologically active molecules. \section{Methods} \subsection{Representing Molecules} To connect chemistry with language, it is important to understand how molecules are represented. Usually, they are modeled by molecular graphs, also called Lewis structures in chemistry. In molecular graphs, atoms are labeled nodes. The edges are the bonds between atoms, which are labeled with the bond order (e.g. single, double or triple). One could therefore envision having a model that reads and outputs graphs. Several common chemistry formats store molecules in such a manner. However, in models for natural language processing, the input and output of the model are usually sequences of single letters, strings or words. We therefore employ the \textsc{Smiles} format, which encodes molecular graphs compactly as human-readable strings. \textsc{Smiles} is a formal grammar which describes molecules with an alphabet of characters, for example \texttt{c} and \texttt{C} for aromatic and aliphatic carbon atoms, \texttt{O} for oxygen, \texttt{-}, \texttt{=} and \texttt{\#} for single, double and triple bonds (see Figure \ref{fig:smiles}).\cite{weininger1988smiles} To indicate rings, a number is introduced at the two atoms where the ring is closed. For example, benzene in aromatic \textsc{Smiles} notation would be \texttt{c1ccccc1}. Side chains are denoted by round brackets. To generate valid \textsc{Smiles}, the generative model would have to learn the \textsc{Smiles} grammar, which includes keeping track of rings and brackets to eventually close them. In morphine, a complex natural product, the number of steps between the first \texttt{1} and the second \texttt{1}, indicating a ring, is 32. Having established a link between molecules and (formal) language, we can now discuss language models. \begin{figure}[htbp] \begin{center} [width=0.9\linewidth]{smiles-scheme.eps} \caption{Examples of molecules and their \textsc{Smiles} representation. To correctly create smiles, the model has to learn long term dependencies, for example to close rings (indicated by numbers) and brackets.} \label{fig:smiles} \end{center} \end{figure} \subsection{Language Models and Recurrent Neural Networks} Given a sequence of words $(w_1,...,w_i)$, language models predict the distribution of the $(i+1)$th word $w_{i+1}$.\cite{yoav} For example, if a language model receives the sequence \texttt{"Chemistry is"}, it would assign different probabilities to possible next words. \texttt{"fascinating"}, \texttt{"important"}, or \texttt{"challenging"} would receive high probabilities, while \texttt{"runs"} or \texttt{"potato"} would receive very low probabilities. Language models can both capture the grammatical correctness ("runs" in this sentence is wrong) and the meaning ("potato" does not make sense). Language models are implemented for example in message autocorrection in many modern smartphones. Interestingly, language models do not have to use words. They can also be based on characters or letters.\cite{yoav} In that case, when receiving the sequence of characters \texttt{chemistr}, it would assign a high probability to \texttt{y}, but a low probability to \texttt{q}. To model molecules instead of language, we simply swap words or letters with atoms, or, more practically, characters in the \textsc{Smiles} alphabet, which form a (formal) language. For example, if the model receives the sequence \texttt{c1ccccc}, there is a high probability that the next symbol would be a \texttt{"1"}, which closes the ring, and yields benzene. More formally, to a sequence $S$ of symbols $s_i$ at steps $t_i \in T$, the language model assigns a probability of \begin{equation} P_\theta(S) = P_\theta(s_1) \cdot \prod^T_{t=2}P_\theta(s_t|s_{t-1},...,s_1) \label{eq:prod} \end{equation} where the parameters $\theta$ are learned from the training set.\cite{yoav} In this work, we use a recurrent neural network (RNN) to estimate the probabilities of Equation \ref{eq:prod}. In contrast to regular feedforward neural networks, RNNs maintain state, which is needed to keep track of the symbols seen earlier in the sequence. In abstract terms, an RNN takes a sequence of input vectors $\mathbf{x}_{1:n} = (\mathbf{x}_1,...,\mathbf{x}_n)$ and an initial state vector $\mathbf{h}_0$, and returns a sequence of state vectors $\mathbf{h}_{1:n} = (\mathbf{h}_1,...,\mathbf{h}_n)$ and a sequence of output vectors $\mathbf{y}_{1:n} = (\mathbf{y}_1,...,\mathbf{y}_n)$. The RNN consists of a recursively defined function $R$, which takes a state vector $\mathbf{h}_{i}$ and input vector $\mathbf{x}_{i+1}$ and returns a new state vector $\mathbf{h}_{i+1}$. Another function $O$ maps a state vector $\mathbf{h}_{i}$ to an output vector $\mathbf{y}_{i}$.\cite{yoav} \begin{align} \text{RNN}(\mathbf{h}_0, \mathbf{x}_{1:n}) &= \mathbf{h}_{1:n}, \mathbf{y}_{1:n}\\ \mathbf{h}_i &= R(\mathbf{h}_{i-1},\mathbf{x}_i)\\ \mathbf{y}_i &= O(\mathbf{h}_{i}) \end{align} The state vector $\mathbf{h}_{i}$ stores a representation of the information about all symbols seen in the sequence so far. \begin{figure}[htbp] \begin{center} [width=0.9\linewidth]{rnn.eps} \caption{a) Recursively defined RNN b) The same RNN, unrolled. The parameters $\theta$ (the weight matrices of the neural network) are shared over all time steps.} \label{fig:rnn} \end{center} \end{figure} As an alternative to the recursive definition, the recurrent network can also be \textit{unrolled} for finite sequences (see Figure \ref{fig:rnn}). An unrolled RNN can be seen as a very deep neural network, in which the parameters $\theta$ are shared among the layers, and the hidden state $\mathbf{h}_t$ is passed as an additional input to the next layer. Training the unrolled RNN to fit the parameters $\theta$ can then simply be done by using backpropagation to compute the gradients with respect to the loss function, which is categorical cross-entropy in this work.\cite{yoav} As the specific RNN function, in this work, we use the Long Short Term Memory (LSTM), which was introduced by Hochreiter and Schmidhuber.\cite{hochreiter1997long} It has been used successfully in many natural language processing tasks,\cite{jozefowicz2016exploring} for example in Google's Neural Machine Translation system.\cite{johnson2016google} For excellent in-depth discussions of the LSTM, we refer to the articles by Goldberg,\cite{yoav} Graves,\cite{graves2013generating} Olah,\cite{colah} and Greff \textit{et al}.\cite{greff2015lstm} To encode the \textsc{Smiles} symbols as input vectors $\mathbf{x}_t$ , we employ the "one-hot" representation.\cite{graves2013generating} This means if there are $K$ symbols, and $k$ is the symbol to be input at step $t$, then we can construct an input vector $\mathbf{x}_t$ with length $K$, whose entries are all zero except the $k$-th entry, which is one. If we assume a very restricted set of symbols \{\texttt{c}, \texttt{1}, \texttt{\textbackslash n}\}, input \texttt{c} would correspond to $\mathbf{x}_t=(1,0,0)$, \texttt{1} to $\mathbf{x}_t=(0,1,0)$ and \texttt{\textbackslash n} to $\mathbf{x}_t=(0,0,1)$. \begin{figure*}[htb] \begin{center} [width=0.7\textwidth]{lstm.eps} \caption{The Symbol Generation and Sampling Process. We start with a random seed symbol $\mathbf{s}_1$, here \texttt{c}, which gets converted into a one-hot vector $\mathbf{x}_1$ and input into the model. The model then updates its internal state $\mathbf{h}_0$ to $\mathbf{h}_1$ and outputs $\mathbf{y}_1$, which is the probability distribution over the next symbols. Here, sampling yields $\mathbf{s}_2=$\texttt{1}. Converting $\mathbf{s}_2$ to $\mathbf{x}_2$, and feeding it to the model leads to updated hidden state $\mathbf{h}_2$ and output $\mathbf{y}_2$, from which can sample again. This iterative symbol-by-symbol procedure can be continued as long as desired. In this example, we stop it after observing an EOL (\texttt{\textbackslash n}) symbol, and obtain the \textsc{Smiles} for benzene. The hidden state $\mathbf{h}_i$ allows the model to keep track of opened brackets and rings, to ensure that they will be closed again later.} \label{fig:gentext} \end{center} \end{figure*} The probability distribution $P_\theta(s_{t+1}| s_{t},...,s_1)$ of the next symbol given the already seen sequence is thus a multinomial distribution, which is estimated using the output vector $\mathbf{y}_t$ of the recurrent neural network at time step $t$ by \begin{equation} P_\theta(s_{t+1} = k | s_{t},...,s_1) = \frac{\exp( y^k_t ) }{\sum^K_{k^\prime=1} \exp(y^{k^\prime}_t)}\label{eq:softmax} \end{equation} where $y^k_t$ corresponds to the $k$-th element of vector $\mathbf{y}_t$.\cite{graves2013generating} Sampling from this distribution would then allow generating novel molecules: After sampling a \textsc{Smiles} symbol $s_{t+1}$ for the next time step $t+1$, we can construct a new input vector $\mathbf{x}_{t+1}$, which is fed into the model, and via $\mathbf{y}_{t+1}$ and Equation \ref{eq:softmax} yields $P_\theta(s_{t+2}| s_{t+1},...,s_1)$. Sampling from the latter generates $s_{t+2}$, which serves again also as the model's input for the next step (see Figure \ref{fig:gentext}). This symbol-by-symbol sampling procedure is repeated until the desired number of characters has been generated.\cite{graves2013generating} To indicate that a molecule is "completed", each molecule in our training data finishes with an ``end of line'' (EOL) symbol, in our case the single character \texttt{\textbackslash n} (which means the training data is just a simple \textsc{Smiles} file). Thus, when the system outputs an EOL, a generated molecule is finished. However, we simply continue sampling, thus generating a regular \textsc{Smiles} file that contains one molecule per line. In this work, we used a network with three stacked LSTM layers, using the keras library.\cite{chollet2015keras} The model was trained with back propagation through time,\cite{graves2013generating} using the ADAM optimizer at standard settings.\cite{kingma2014adam} To mitigate the problem of exploding gradients during training, a gradient norm clipping of 5 is applied.\cite{graves2013generating} \subsection{Transfer Learning} For many machine learning tasks, only small datasets are available, which might lead to overfitting with powerful models such as neural networks. In this situation, \textit{transfer learning} can help.\cite{cirecsan2012transfer} Here, a model is first trained on a large dataset for a different task. Then, the model is retrained on the smaller dataset, which is also called \textit{fine-tuning}. The aim of transfer learning is to learn general features on the bigger data set, which also might be useful for the second task in the smaller data regime. To generate focussed molecule libraries, we first train on a large, general set of molecules, then perform fine-tuning on a smaller set of specific molecules, and after that start the sampling procedure. \subsection{Target Prediction} To verify whether the generated molecules are active on the desired targets, standard target prediction was employed. Machine learning-based target prediction aims to learn a classifier $c:M\rightarrow \{1,0\}$ to decide whether a molecule $m \in$ molecular descriptor space $M$ is active or not against a target.\cite{mitchell2014machine,varnek2012machine} The molecules are split into actives and inactives using a threshold on a measure for the substance effectiveness. \textit{p}IC$_{50} = -\log_{10}$(IC$_{50}$) is one of the most widely used metrics for this purpose. IC$_{50}$ is the \textit{half maximal inhibitory concentration}, that is the concentration of drug that is required to inhibit 50\% of a biological target's function \textit{in vitro}. To predict whether the generated molecules are active towards the biological target of interest, target prediction models (TPMs) were trained for all the tested targets (5-HT$_{\text{2A}}$, \textit{Plasmodium falciparum} and \textit{Staphylococcus aureus}). We evaluated Random Forest, Logistic Regression, (Deep) Neural Networks and Gradient Boosting Trees (GBT) as models with ECFP4 (Extended Connectivity Fingerprint with a diameter of 4) as the molecular descriptor.\cite{riniker2013open,rogers2010extended} We found that GBTs slightly outperformed all other models, and used these as our virtual assay in all studies (see Supporting Information for details). ECFP4 fingerprints were generated with CDK version 1.5.13.\cite{steinbeck2006recent,steinbeck2003chemistry} Scikit-Learn,\cite{scikit-learn} xgBoost\cite{chen2016xgboost} and keras\cite{chollet2015keras} were used as the machine learning libraries. For 5-HT$_{\text{2A}}$ and \textit{Plasmodium}, molecules are considered as active for the TPM if their IC$_{50}$ reported in ChEMBL is < 100 n\textsc{m}, which translates to a \textit{p}IC$_{50}$ > 7, whereas for \textit{Staphylococcus}, we used \textit{p}MIC > 3. \subsection{Data} The chemical language model was trained on a \textsc{Smiles} file containing 1.4 million molecules from the ChEMBL database, which contains molecules and measured biological activity data. The \textsc{Smiles} strings of the molecules were canonicalized (which means finding a unique representation that is the same for isomorphic molecular graphs)\cite{weininger1989smiles,canon1} before training with the CDK chemoinformatics library, yielding a \textsc{Smiles} file that contained one molecule per line.\cite{steinbeck2006recent,steinbeck2003chemistry} It has to be noted that ChEMBL contains many peptides, natural products with complex scaffolds, Michael acceptors, benzoquinones, hydroxylamines, hydrazines etc. which is reflected in the generated structures (see below). This corresponds to 72 million individual characters, with a vocabulary size of 51 unique characters. 51 characters is only a subset of all \textsc{Smiles} symbols, since the molecules in ChEMBL do not contain many of the heavy elements. As we have to set the number of symbols as a hyperparameter during model construction, and the model can only learn the distribution over the symbols present in the training data, this implies that only molecules with these 51 \textsc{Smiles} symbols seen during training can be generated during sampling. The 5-HT$_{\text{2A}}$, the \textit{Plasmodium falciparum} and the \textit{Staphylococcus aureus} dataset were also obtained from ChEMBL. The molecules for the hold-out test sets were removed from the training data. \subsection{Model Evaluation} To evaluate the models for a test set $T$, and a set of molecules $G_N$ generated from the model by sampling, we report the ratio of reproduced molecules $\frac{|G_N \cap T|}{|T|}$, and enrichment over random (EOR), which is defined as, \begin{gather} EOR = \frac{\frac{n}{|G_N|}}{\frac{m}{|R_M|}} \end{gather} where $n = |G_N \cap T|$ is the number of reproduced molecules from $T$ by sampling a set $G_N$ of $|G_N|=N$ molecules from the fine-tuned generative model, and $m = |R_M \cap T|$ is the number of reproduced molecules from $T$ by sampling a set $R_M$ of $|R_M|=M$ molecules from the generic, unbiased generative model trained only on the large dataset. Intuitively, EOR indicates how much better the fine-tuned models work when compared to the general model. \section{Results and Discussion} In this work, we address two points: First, we want to generate large sets of diverse molecules for virtual screening campaigns. Second, we want to generate smaller, focussed libraries enriched with possibly active molecules for a specific target. For the first task, we can train a model on a large, general set of molecules to learn the \textsc{Smiles} grammar. Sampling from this model would generate sets of diverse, but unfocused molecules. To address the second task, and to obtain novel active drug molecules for a target of interest, we perform transfer learning: We select a small set of known actives for that target and we refit our pre-trained chemical language model with this small data-set. After each epoch, we sample from the model to generate novel actives. Furthermore, we investigate if the model actually benefits from transfer learning, by comparing it to a model trained from scratch on the small sets without pre-training. \subsection{Training the recurrent network} We employed a recurrent neural network with three stacked LSTM layers, each with 1024 dimensions, and each one followed by a dropout\cite{srivastava2014dropout} layer, with a dropout ratio of 0.2, to regularise the neural network. The model was trained until convergence, using a batch size of 128. The RNN was unrolled for 64 steps. It had $21.3 \times 10^6$ parameters. \begin{table*}[htb] \caption{Molecules sampled during training.} \begin{center} \begin{tabular}{rcr} \toprule Batch & Generated Example & valid\\ \midrule 0 & \texttt{Oc.BK5i\%ur+7oAFc7L3T=F8B5e=n)CS6RCTAR((OVCp1CApb)} & no\\ 1000 & \texttt{OF=CCC2OCCCC)C2)C1CNC2CCCCCCCCCCCCCCCCCCCCCCC} & no\\ 2000 & \texttt{O=C(N)C(=O)N(c1occc1OC)c2ccccc2OC} & yes\\ 3000 & \texttt{O=C1C=2N(c3cc(ccc3OC2CCC1)CCCc4cn(c5c(Cl)cccc54)C)C} & yes\\ \bottomrule \end{tabular} \end{center} \label{tab:gib} \end{table*}% During training, we sampled a few molecules from the model every 1000 mini-batches to inspect progress. Within a few 1000 steps, the model starts to output valid molecules (see Table \ref{tab:gib}). \subsection{Generating Novel Molecules} \label{sec:general} To generate novel molecules, 50,000,000 \textsc{Smiles} symbols were sampled from the model symbol-by-symbol. This corresponded to 976,327 lines, from which 97.7\% were valid molecules after parsing with the CDK toolkit. Removing all molecules already seen during training yielded 864,880 structures. After filtering out duplicates, we obtained 847,955 novel molecules. A few generated molecules were randomly selected and depicted in Figure \ref{fig:gentext}. The Supporting Information contains more structures. The created structures are not just formally valid, but are also mostly chemically reasonable. \begin{figure}[htbp] \begin{center} [width=0.9\linewidth]{generated-examples.eps} \caption{A few randomly selected, generated molecules. Ad = Adamantyl} \label{fig:gentext} \end{center} \end{figure} In order to check if the \textit{de novo} compounds could be considered as valid starting points for a drug discovery program, we applied the internal AstraZeneca filters.\cite{cumming2013chemical} At AstraZeneca, this flagging system is used to determine if a compound is suitable to be part of the high-throughput screening collection (if flagged as ``core'' or ``backup'') or should be restricted for particular use (flagged as ``undesirable'' since it contains one or several unwanted substructures, e.g. undesired reactive functional groups). The filters were applied to the generated set of 848 k molecules and they flagged most of them, 640 k (75\%), are either core or backup. Since the same ratio (75\%) of core and backup compounds has been observed for the ChEMBL collection, we therefore conclude that the algorithm generates preponderantly valid screening molecules and faithfully reproduces the distribution of the training data. To determine whether the properties of the generated molecules match the properties of the training data from ChEMBL, we followed the procedure of Kolb:\cite{chevillard2015scubidoo} We computed several molecular properties, namely molecular weight, BertzCT, the number of H-donors, H-acceptors, and rotatable bonds, logP and total polar surface area for randomly selected subsets from both sets with the RDKit\cite{rdkit} library version 2016.03.1. Then, we performed dimensionality reduction to 2D with t-SNE (t-Distributed Stochastic Neighbor Embedding, a technique analogous to PCA), which is shown in Figure \ref{fig:tsne}.\cite{maaten2008visualizing} Both sets overlap almost completely, which indicates that the generated molecules very well recreate the properties of the training molecules. \begin{figure}[htbp] \begin{center} [width=0.95\linewidth]{chembl-sampl-tnse.eps} \caption{t-SNE projection of 7 physicochemical descriptors of random molecules from ChEMBL (blue) and molecules generated with the neural network trained on ChEMBL (green), to two unitless dimensions. The distributions of both sets overlap significantly.} \label{fig:tsne} \end{center} \end{figure} Furthermore, we analysed the Bemis-Murcko scaffolds of the training molecules and the sampled molecules.\cite{bemis1996properties} Bemis-Murcko scaffolds contain the ring systems of a molecule and the moieties that link these ring systems, while removing any side chains. They represent the scaffold, or ``core'' of a molecule, which series of drug molecules often have in common. The number of common scaffolds in both sets, divided by the union of all scaffolds in both sets (Jaccard index) is 0.12, which indicates that the language model does not just modify side chain substituents, but also introduces modifications at the molecular core. \subsection{Generating Active Drug Molecules and Focused Libraries} \subsubsection{Targeting the 5-HT$_{\mathbf{2A}}$ receptor} To generate novel ligands for the 5-HT$_{\text{2A}}$ receptor, we first selected all molecules with \textit{p}IC$_{50}$ > 7 which were tested on 5-HT$_{\text{2A}}$ from ChEMBL (732 molecules), and then fine-tuned our pre-trained chemical language model on this set. After each epoch, we sampled 100,000 chars, canonicalised the molecules, and removed any sampled molecules that were already contained in the training set. Following this, we evaluated the generated molecules of each round of retraining with our 5-HT$_{\text{2A}}$ target prediction model (TPM). In Figure 4, the ratio of molecules predicted to be active by the TPM after each round of fine-tuning is shown. Before fine-tuning (corresponding to epoch 0), the model generates almost exclusively inactive molecules. Already after 4 epochs of fine-tuning the model produced a set in which 50\% of the molecules are predicted to be active. \begin{figure}[htbp] \begin{center} [width=\linewidth]{targetpred.eps} \caption{Epochs of fine-tuning vs ratio of actives.} \label{fig:5thpred} \end{center} \end{figure} \paragraph{Diversity Analysis} In order to assess the novelty of the \textit{de novo} molecules generated with the fine-tuned model, a nearest neighbor similarity/diversity analysis has been conducted using a commonly used 2D fingerprint (ECFP4) based similarity method (Tanimoto index).\cite{chevillard2015scubidoo} Figure \ref{fig:histo} shows the distribution of the nearest neighbor Tanimoto index generated by comparing all the novel molecules and the training molecules before and after $n$ epochs of fine-tuning. For each bin, the white bars indicate the molecules generated from the unbiased, general model, while the darker bars indicate the molecules after several epochs of fine-tuning. Within the bins corresponding to lower similarity, the number of molecules decreases, while the bins of higher similarity get populated with increasing numbers of molecules. The plot thus shows that the model starts to output more and more similar molecules to the target-specific training set. Notably, after a few rounds of training not only highly similar molecules are produced, but also molecules covering the whole range of similarity, indicating that our method could not only deliver close analogs but new chemotypes or scaffold ideas to a drug discovery project.\cite{stumpfe2011similarity} To have the best of both worlds, that is diverse and focussed molecules, we therefore suggest to sample after each epoch of retraining and not just after the final epoch. \begin{figure*}[htbp] \begin{center} [width=0.95\textwidth]{histogram.eps} \caption{Nearest-neighbour Tanimoto similarity distribution of the generated molecules for 5-HT$_{\text{2A}}$ after $n$ epochs of fine-tuning against the known actives. The generated molecules are distributed over the whole similarity range. Generated molecules with a medium similarity can be interesting for scaffold-hopping.\cite{stumpfe2011similarity}} \label{fig:histo} \end{center} \end{figure*} \subsubsection{Targeting Plasmodium falciparum (Malaria)} \textit{Plasmodium falciparum} is a parasite that causes the most dangerous form of Malaria.\cite{williamson2016open} To probe our model on this important target, we used a more challenging validation strategy. We wanted to investigate whether the model could also propose the same molecules that medicinal chemists chose to evaluate in published studies. To test this, first, the known actives against Plasmodium falciparum with a \textit{p}IC$_{50}$ > 8 were selected from ChEMBL. Then, this set was split randomly into a training (1239 molecules) and a test set (1240 molecules). The chemical language model was then fine-tuned on the training set. 7500 molecules were sampled after each of the 20 epochs of refitting. \begin{table}[htb] \caption{Reproducting known actives in the \textit{Plasmodium} test set. EOR: Enrichment over random.} \begin{center} \begin{tabular}{lrrrrrrr} \toprule \# & \textit{p}IC$_{50}$ & Train.& Test & Gen. mols. & Reprod. & EOR\\ \midrule 1 & > 8 & 1239 & 1240 & 128,256 & 28\% & 66.9\\ 2 & > 8 & 100 & 1240 & 93,721 & 7\% & 19.0 \\ 3 & > 9 & 100 & 1022 & 91,034 & 11\% & 35.7\\ \bottomrule \end{tabular} \end{center} \label{tab:malaria} \end{table}% This yielded 128,256 unique molecules. Interestingly, we found that our model was able to "redesign" 28\% of the unseen molecules of the test set. In comparison to molecules sampled from the unspecific, untuned model, an Enrichment over Random (EOR) of 66.9 is obtained. With a smaller training set of 100 molecules, the model can still reproduce 7\% of the test set, with an EOR of 19.0. To test the reliance on \textit{p}IC$_{50}$ we chose to use another cut-off of \textit{p}IC$_{50}$ > 9, and took 100 molecules in the training set and 1022 in the test set. 11\% of the test set could be recreated, with an EOR of 35.7. To visually explore how the model populates chemical space, Figure \ref{fig:tsnemalaria} shows a t-SNE plot of the ECFP4 fingerprints of the test molecules and 2000 generated molecules that were predicted to be active by the target prediction model for \textit{Plasmodium falciparum}. It indicates that the model has generated many similar molecules around the test examples. \begin{figure}[htb] \begin{center} [width=0.95\linewidth]{tnse-plmf.eps} \caption{t-SNE plot of the \textit{p}IC$_{50}$>9 test set (blue) and the \textit{de novo} molecules predicted to be active (green). The language model populates chemical space around the test molecules.} \label{fig:tsnemalaria} \end{center} \end{figure} \subsubsection{Targeting Staphylococcus aureus (Golden Staph)} \begin{table*}[htb] \caption{Reproducting known actives in the \textit{Staphylococcus} test set. EOR: Enrichment over random.} \begin{center} \begin{tabular}{lrrrrrr} \toprule Entry & \textit{p}MIC & Train.& Test & Gen. mols. & Reprod. & EOR\\ \midrule 1 & > 3 & 1000 & 6051 & 51,052 & 14\% & 155.9 \\ 2 & > 3 & 50 & 7001 & 70,891 & 2.5\% & 21.6 \\ 3$^a$ & > 3 &50 & 7001& 85,755 & 1.8\% &6.3 \\ 4$^b$ & > 3 &50 & 7001& 285 & 0\% & --- \\ 5$^c$ & > 3 &0 & 7001& 60,988 & 6\% & 59.6 \\ \bottomrule \end{tabular} \\ $^a$Fine-tuning learning rate = $10^{-4}$. $^b$No Pretraining. $^c$8 Generate-Test cycles. \end{center} \label{tab:aureus} \end{table*}% To evaluate a different target, we furthermore conducted a series of experiments to reproduce known active molecules against \textit{Staphylococcus aureus}. Here, we used actives with a \textit{p}MIC > 3. MIC is the Mean Inhibitory Concentration, the lowest concentration of a compound that prevents visible growth of a microorganism. As above, the actives were split into a training and a test set. However, here, the availability of the data allows larger test sets to be used. After fine-tuning on the training set of 1000 molecules (Table \ref{tab:aureus}, Entry 1), our model could retrieve 14\% of the 6051 test molecules. When scaling down to a smaller training set of 50 molecules (the model gets trained on less than 1\% of the data!), it can still reproduce 2.5\% of the test set, and performs 21.6 times better than the unbiased model (Table \ref{tab:aureus}, Entry 2). Using a lower learning rate (0.0001, Entry 3) for fine-tuning, which is often done in transfer learning, does not work as well as the standard learning rate (0.001, Entry 2). We additionally examined whether the model benefits from transfer learning. When trained from scratch, the model performs much worse than the pretrained and subsequently fine-tuned model (see Figure \ref{fig:pretraining} and Table \ref{tab:aureus}, Entry 4). Pretraining on the large dataset is thus crucial to achieve good performance against \textit{Staphylococcus aureus}. \begin{figure}[htbp] \begin{center} [width=\linewidth]{pretraining.eps} \caption{Different training strategies on the \textit{Staphylococcus aureus} dataset with 1000 training and 6051 test examples. Fine-tuning the pretrained model performs better than training from scratch (lower test loss [cross entropy] is better).} \label{fig:pretraining} \end{center} \end{figure} \subsection{Simulating Design-Synthesis-Test Cycles} The experiments we conducted so far are applicable if one already knows several actives. However, in drug discovery, one often does not have such a set to start with. Therefore, high throughput screenings are conducted to identify a few hits, which serve as a starting point for the typical cyclical drug discovery process: Molecules get designed, synthesised, and then tested in assays. Then, the best molecules are selected, and based on the gained knowledge new molecules are designed, which closes the cycle. Therefore, as a final challenge for our model, we simulated this cycle by iterating molecule generation ("synthesis"), selection of the best molecules with the machine learning-based target prediction ("virtual assay") and retraining the language model with the best molecules ("design") with \textit{Staphylococcus aureus} as the target. We thus do not use a set of known actives to start the structure generation procedure (see Figure \ref{fig:designcycle}). \begin{figure}[htbp] \begin{center} [width=0.95\linewidth]{cycle.eps} \caption{Scheme of our \textit{de novo} design cycle. Molecules are generated by the chemical language model and then scored with the target prediction model (TPM). The inactives are filtered out, and the RNN is retrained. Here, the TPM is a machine learning model, but it could also be a robot conducting synthesis and biological assays, or a docking program.} \label{fig:designcycle} \end{center} \end{figure} We started with 100,000 sampled molecules from the unbiased chemical language model. Then, using our target prediction model, we extracted the molecules classified as actives. After that, the RNN was fine-tuned for 5 epochs on the actives, sampling $\approx$10,000 molecules after each epoch. The resulting molecules were filtered with the target prediction model, and the new actives appended to the actives from the previous round, closing the loop. Already after 8 iterations, the model reproduced 416 of the 7001 test molecules from the previous task, which is 6\% (Table \ref{tab:aureus}, Entry 5), and exhibits and EOR of 59.6. This EOR is higher than if the model is retrained directly on a set of 50 actives (Entry 2). Additionally, we obtained 60,988 unique molecules that the target prediction model classified as active. This demonstrates that in combination with a target prediction or scoring model, our model can also perform the complete \textit{de novo}-design cycle. \subsection{Why does the model work?} Our results presented in Section \ref{sec:general} show that the general model trained on a large molecule set has learned the \textsc{Smiles} rules and can output valid, drug-like molecules, which resemble the training data. However, sampling from this model does not help much if we want to generate actives for a specific target: We would have to generate very large sets to find actives for that target among the diverse range of molecules the model creates, which is indicated by the high EOR scores in our experiments. \begin{figure}[htbp] \begin{center} [width=\linewidth]{levenshtein.eps} \caption{Histogram of Levenshtein (String edit) distances of the \textsc{Smiles} of the reproduced molecules to their nearest neighbour in the training set (Staphylococcus aureus, model retrained on 50 actives). While in many cases the model makes changes of a few symbols in the \textsc{Smiles}, resembling the typical modifications applied when exploring series of compounds, the distribution of the distances indicates that the RNN also performs more complex changes by introducing larger moieties or generating molecules that are structurally different, but isofunctional to the training set.} \label{fig:levenshtein} \end{center} \end{figure} When fine-tuned to a set of actives, the probability distribution over the molecules captured by our model is shifted towards molecules active towards our target. To study this, we compare the Levenshtein (String edit) distance of the generated \textsc{Smiles} to their nearest neighbours in the training set in Figure \ref{fig:levenshtein}. The Levenshtein distance of e.g. benzene \texttt{c1ccccc1} and pyridine \texttt{c1ccncc1} would be 1. Figure \ref{fig:levenshtein} shows that while the model often seems to have made small replacements in the underlying \textsc{Smiles}, in many cases it also made more complex modifications or even generated completely different \textsc{Smiles}. This is supported also by the distribution of the nearest neighbour fingerprint similarities of training and rediscovered molecules (ECFP4, Tanimoto, Figure \ref{fig:repr-train-nn}). Many rediscovered molecules are in the medium similarity regime. Because we perform transfer learning, during fine-tuning, the model does not "forget" what it has learned. A plausible explanation why the model works is therefore that it can transfer the modifications that are regularly applied when series of molecules are studied, to the molecules it has seen during fine-tuning. \begin{figure}[htbp] \begin{center} [width=\linewidth]{repr-train-nn.eps} \caption{Violin plot of the nearest-neighbour ECFP4-Tanimoto similarity distribution of the 50 training molecules against the rediscovered molecules in Table \ref{tab:aureus}, Entry 2. The distribution suggests the model has learned to make typical small functional group replacements, but can also reproduce molecules which are not too similar to the training data.} \label{fig:repr-train-nn} \end{center} \end{figure} \section{Conclusion} In this work, we have shown that recurrent neural networks based on the Long Short Term Memory (LSTM) can be applied to learn a statistical chemical language model. The model can generate large sets of novel molecules with similar physico-chemical properties to the training molecules. This can be used to generate libraries for virtual screening. Furthermore, we demonstrated that the model performs transfer learning when fine-tuned to smaller sets of molecules active towards a specific biological target, which enables the creation of novel molecules with the desired activity. By iterating cycles of structure generation with the language model, scoring with a target prediction model (TPM) and retraining of the model with increasingly larger sets of highly scored molecules, we showed that we do not even need a set of active known active molecules to start our procedure with, as the TPM could also be a docking program, or a robot conducting synthesis\cite{ley2015organic} and biological testing. We see three main advantages of our method. First, it is conceptually orthogonal to established molecule generation approaches, as it learns a generative model for molecular structures. Second, our method is very simple to setup, train and to use, and can be adapted to different datasets without any modifications to the model architecture, and does not depend on hand-encoded expert knowledge. Furthermore, it merges structure generation and optimisation in one model. A weakness of our model is interpretability. In contrast, existing de-novo design methods settled on virtual reactions to generate molecules, which has advantages as it minimises the chance of obtaining "overfit", weird molecules, and increases the chances to find synthesizable compounds.\cite{hartenfeller2011enabling,schneider2016novo} To extend our work, it is just a small step to cast molecule generation as a reinforcement learning problem, where the pre-trained LSTM generator could be seen as a policy, which can be encouraged to create better molecules with a reward signal obtained from a target prediction model.\cite{sutton1998reinforcement} In addition, different approaches for target prediction, for example docking, could be evaluated.\cite{kitchen2004docking,hartenfeller2011enabling} Deep Learning is not a panacea, and we join Gawehn et al. in expressing ``some healthy skepticism'' regarding its application in drug discovery.\cite{gawehn2016deep} Generating molecules that are almost right is not enough, because in Chemistry, a miss is as good as a mile, and drug discovery is a ``needle in the haystack'' problem -- in which also the needle looks like hay. Nevertheless, given that we have shown in this work that our model can rediscover those needles, and other recent developments,\cite{gawehn2016deep,schmidhuber2015deep,altae2016low,graves2016hybrid} we believe that deep neural networks can be complimentary to established approaches in drug discovery. The complexity of the problem certainly warrants the investigation of novel approaches. Eventually, success in the wet lab will determine if the new wave\cite{zupan1999neural} of neural networks will prevail. \begin{backmatter} \section*{Competing interests} The authors declare that they have no competing interests. \section*{Acknowledgements} The project was conducted during a research stay of M.S. at AstraZeneca R\&D Gothenburg. We thank H. Chen and O. Engkvist for valuable discussions and feedback on the manuscript, and G. Klambauer for helpful suggestions. \bibliographystyle{achemso}
{'timestamp': '2017-01-06T02:05:00', 'yymm': '1701', 'arxiv_id': '1701.01329', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01329'}
arxiv
\section{Introduction} Social insects such as a colony of ants excavating a network of tunnels or swarms of termites building towering cathedral mounds with internal heating and cooling shafts \cite{bristow} show the potential of multi-agent systems in building robust structures. These social insects, without any centralized coordination produce emergent collective behaviors used to build these robust structures. Multiple individuals working in a decentralized manner offers some inherent advantages, including fault tolerance, parallelism, reliability, scalability and simplicity in robot design \cite{cao}. Using this bio-inspired method, teams of autonomous robots can construct key elements of a human habitat on the moon (Figure~\ref{fig:lunar_mine}). They can work continuously in harsh environments making them very productive, are fault tolerant to the failure of individual robots and are scalable depending on the task complexity and schedule. Robots do not require life-support infrastructure that would otherwise be required for a team of astronaut workers. Furthermore, robots may be required for certain tasks due to concerns of health and safety of the astronauts. Combining these factors, our studies show use of teams of autonomous robots instead of astronauts can reduce launch cost by 50\% \cite{nader2} for lunar base construction. This can free ground operators from constantly tending to the multirobot team. In this architecture it will be possible for operators on the ground to have total oversight over the activities of the robot team and intervene and recover from mishaps or unexpected events. Constructing mounds around landing pads will provide physical shielding from debris during launch/landing. Burying a human habitat modules that under 0.5 m of lunar regolith is expected to provide both radiation shielding and maintain comfortable temperatures of -25 $^{o}$C (based Apollo 17 manual excavation experiments)\cite{heiken}. \begin{figure} [h] \centering \includegraphics[width=4in]{mining_lg} \caption{Artist Impression of a Lunar Base and Mining Facility (courtesy NASA).} \label{fig:lunar_mine} \end{figure} Earth-based teleoperation systems have been proposed for control of robots on the moon \cite{spong}. Such systems have been demonstrated successfully with the Lunakhod 1 and 2 rover missions; however latency (time delay) induced prolonged fatigue was a concern for the Lunakhod missions. Latency induced operator fatigue is still a concern when coordinating actions with teams of robots over extended time \cite{miller}. Advancements have been made coordination and control of multiple robots using teleoperation \cite{lu,khad}. However these techniques have yet to be tested for spacecraft or robots at the Moon. The proposed ANT architecture allows ground control oversight and frees ground operators from mundane tasks while reserving all but the most delicate and mission critical tasks for human intervention thus reducing the chance of fatigue and human error. These factors make an autonomous robotic system with teleoperation capability more appealing than teleoperation alone. This approach permits having a base deployed and operational in time for astronauts to arrive from Earth. Major approaches to developing autonomous control systems utilize human knowledge, machine learning techniques or a combination of both. Human knowledge-based control strategies rely on human input in the form of ad-hoc control rules, physical model based planners, task-specific assumptions, and human knowledge \cite{bernd,xid}. In many tasks that use multiple robots, it is often unclear of how best to plan the task, organize the group and determine the best interaction behaviors to complete the task. In lunar and planetary environments, task-specific assumptions may not be valid in-situ. The surface properties and material may vary from crater to crater. One or more robots may be disabled unexpectedly or need to perform tasks that have not been envisioned during mission planning and modeling stages. These factors make an adaptive, decentralized controls approach to reorganize and control a group of robots more appealing. A novel, robotic learning controls approach is presented here that addresses these challenges. This approach requires much less human knowledge than conventional approaches. The controllers are homogenous (i.e., a single controller is replicated for use on each robot), decentralized and make use of local sensor data. Hardware implementations of the system utilize a shared resource such as an overhead camera for localization or TriDAR for 3D mapping and hence the system is not truly decentralized but the system can be made decentralized by utilizing multiple shared resource. The approach learns to solve tasks through a process of trial and error and is given a global objective function, a generic set of basis behaviors, sensory input and a simplified training environment without detailed physical models of the system. The proposed approach requires an accurate localization system. This is possible by mounting cameras and lighting on a tower over the work area. Other options include use of radio beacons that are located from the main landing craft or structure. These two approaches can enable rover localization without requiring a Lunar GPS system. This approach called the Artificial Neural Tissue (ANT) \cite{Thangav2005,Thangav2008} combines a standard neural network with a novel coarse-coding mechanism inspired by the work of Albus and Hinton \cite{albus,hinton}. In ANT, coarse coding is used to perform regulatory control of networks \cite{Thangav2005,Thangav2008,Thangav2010}. The process occurs through simulated chemical diffusion \cite{garth,montague} and enables segmentation of a network, through activation and inhibition of neuronal groups. This allows for modules of neurons to be added, removed and rewired during training facilitating self-organized task decomposition and task-allocation \cite{Thangav2010}. This method is shown to solve the sign-following task found to be intractable with conventional fixed and variable topology neural network architectures \cite{Thangav2005,Thangav2010}. Here the capabilities of ANT are shown for multirobot excavation \cite{thangavstaif,ThangavCIRA2009}, a difficult task, with a large, high-dimensional task space. Learning to solve the excavation task, enables the robots to build berms, landing pads and excavate holes for burying the lunar habitat modules. The excavation task combines features of a typical foraging, grazing or cleaning task with ability to plan, interpret blueprints and perform coordinated excavation. Since little pre-programmed knowledge is given, ANT may discover creative solutions producing controllers that can interpret excavation blueprints, can successfully avoid obstacles, perform layered digging, leveling and avoid burying or trapping other robots. These innovative behaviors are discovered during training and are similar to behaviors used by social insects to perform group coordination. In this work expanded from \cite{thangavstaif}, ANT is found to evolve superior solutions to the excavation task in fewer genetic evaluations than hand-coded and conventional neural networks solutions. The ANT solutions are found to be scalable and can be applied to unforseen real world scenarios where one or more robots may become disabled or unavailable. Hand-coded solutions are found to work in single robot scenarios and show poor performance, and robustness for increased number of robots thus lacking adaptivity. The required cooperative behaviors for all but the simplest of tasks are unintuitive and pose difficulty for humans programmers. Conventional neural networks can do better than hand coded solutions but require an experimenter manually decompose a complex task, determine a suitable network topology and activation function to make training tractable. ANT requires even less experimenter input and is useful for multirobot excavation tasks, where there is limited domain knowledge available. The controllers can generalize (interpolate) from limited training scenarios to handle unforseen situations. ANT through a process of coarse-coding can segment high dimensional tasks space more efficiently, performing automated task decomposition and simultaneously finding the required controller network topology, selecting optimal number of robots and coordination behaviors to complete the task. Neuronal activity and behavioral analysis of the controllers suggests solutions emerge through a process of trial and error discovery, fine tuning and incremental assembly of `building-block' behaviors to solve tasks. Using this approach we show the feasibility of using multirobot excavation for site preparations tasks. The approach shows improved performance and scalability than conventional neural networks and hand coded solutions. This facilitates finding creative behaviors that are not specified or encouraged by an experimenter. These creative behaviors verified in hardware include correctly interpreting blueprints, performing layered digging, obstacle avoidance and rocking behaviors to avoid getting stuck. This approach is shown to produce controllers that have improved scalability compared to conventional neural networks and hand-coded solutions. Furthermore, ANT can simultaneously evolve the desired controller and select for optimal number of robots for the task. This approach is shown as a possible solution to the problem of antagonism in decentralized multirobot control. The evolved solutions have been analyzed in simulation and the best solutions have been ported onto real robots. Hardware experiments were performed on 3 different robotic platforms, including in the laboratory and under controlled field conditions. These experiments were used to validate individuals behaviors seen in simulation to verifying the overall excavation performance of the controllers. Laboratory hardware experiments and controlled field experiments produced promising results that show a promising pathway towards full implementation and demonstration in the field. This article is organized as follows. Section 2 presents related work. Section 3 presents the Artificial Neural Tissue approach. Section 4 presents the excavation task used to demonstrate ANT's capabilities. This is followed by results and discussion in Section 5 and proof-of-concept experiments in Section 6. \section{Related Work} \label{ch3:related_work} Previous work in autonomous excavation \cite{stentz} has been limited to a single robot and separate loading/unloading vehicles. Digging is performed using hand coded scripts that simplify repetitive excavation/truck loading cycles. These controllers are used to position and unload an excavator bucket relative to a dump truck using a suite of sensors onboard the vehicles. These scripts are developed with input from an expert human operator and model vehicle specific limitations such as load handling capacity and latency. These systems incorporate adaptive coarse and refined planners to sequence digging operations \cite{Rowe1997}. Other works used coarse and refined planner containing a neural network approach to learn soil conditions and excavator capabilities during operation \cite{Cannon1999}. Such systems are comparable in efficiency to human operators. Other approaches are devoted to modeling kinematics and/or dynamics of the excavation vehicles and simulating their performance \cite{dunbabin}. These techniques are designed for specific vehicle platforms and do not include scripts for every possible scenario in the task space thus requiring close monitoring and intervention by a human operator. This makes the approach unsuitable for fully autonomous operation of multiple robots on the moon. Control systems such as LUCIE are more sophisticated and incorporate long-term planning \cite{bradley}. Apart from identifying and automating excavation cycles, the system incorporates a whole sequence of intermediate goals that need to be achieved to complete a trench digging task. However, the system lacks autonomy because the task is decomposed and prioritized by a human operator. Other techniques closely mimic insect in there ability to build road ways and ramps using amorphous construction. A laboratory robot is used to heat, melt and deposit foam to produce a ramp and other complex structures \cite{napp}. More recent work by Halbach et al. \cite{halbach} have performed simulations of multiple robots to perform excavation on Mars. The intent is to setup a permanent human base and utilize Martian resources for construction and in-situ resource utilization. The work has focused on human assisted high level planning required to locate a base and key facilities and the process of resource extraction. Human assistance is utilized in planning the high level tasks and giving execution orders to the multiple robots. It is presumed human astronauts are already located on Mars and can perform tele-operation on site (from a safe distance). Recent work by \cite{skon} have show bucket wheels to be the most effective excavation platform for low gravity on the Moon. As will be shown later, our results also show bucket wheels to be most efficient for excavation. The construction of a human habitat on the moon will require multiple excavation robots working towards a given goal. Collective robotics is well suited because it incorporates multiple autonomous robots that work cooperatively towards a global goal. Some collective robotic controllers mimic mechanisms used by social insects to perform group coordination. These include the use of self-organization, templates and stigmergy. \emph{Self-organization} describes how macroscopic behavior emerge solely from numerous interactions among lower level components of the system that use only local information~\cite{Bonabeau1997} and is the basis for the bio-inspired control approach presented here. Templates are environmental features perceptible to individuals within the collective~\cite{Bonabeau1999}. In robotic applications, template-based approaches include use of light fields to direct the creation of linear \cite{Stewart2003} and circular walls \cite{Wawerla2002} and planar annulus structures \cite{Wilson2004}. Spatiotemporally varying templates (\emph{e.g.}, adjusting or moving a light gradient over time) have been used to produce more complex structures \cite{Stewart2004}. Stigmergy is a form of indirect communication mediated through the environment~\cite{Grasse1959}. Stigmergy has been used extensively in collective-robotic construction, including blind bulldozing \cite{Parker2003}, box pushing \cite{Mataric1995}, heap formation \cite{Beckers1994} and tiling pattern formation \cite{Thangav2003}. However conventional collective robotics control approaches have two limitations. First, they rely on either user-defined deterministic ``if-then'' rules or on stochastic behaviors. It is difficult to design controllers by hand with cooperation in mind, as we show later in the paper, because there exists no formalisms to predict or control the global behaviors that will result from local interactions. Designing successful controllers by hand can devolve into a process of trial and error. The second limitation is that these approaches can suffer from an emergent feature called \emph{antagonism}~\cite{chante} when multiple agents trying to perform the same task interfere with one another, reducing the overall efficiency of the group or worse, result in gridlock. This limits scalability of the solution to number of robots and size of the task area. Because the approach presented here is evolutionary in nature, it ``learns'' to exploit the mechanisms described earlier to find creative solutions to a task. As with other evolutionary algorithms, the approach is stochastic and cannot guarantee a solution in finite time. However, as will be presented later, the controllers converge to solution with a probability of 93\% at the optimal training settings. The presented method is able to mitigate the effects of antagonism, which is difficult to do with conventional approaches due to lack of domain knowledge of a task at hand. A means of reducing the effort required in designing controllers by hand is to encode controllers as behavioral look-up tables and allow a genetic algorithm to evolve the table entries. This approach is used to solve a heap formation task in \cite{Barfoot1999} and a $2 \times 2$ tiling formation task in \cite{Thangav2003}. A limitation with look-up tables is that they have poor sensor scalability, as the size of the look-up table is exponential in the number of inputs. Look-up tables also have poor generalization. Neural network controllers perform better generalization since they effectively encode a compressed representation of the table. Neural networks have been successfully applied on multirobot systems and have been used to build walls, corridors, and briar patches \cite{Crabbe1999} and for tasks that require communication and coordination \cite{Trianni2006}. Neural network controllers have been also been used to solve $3 \times 3$ tiling task \cite{Thangav2004}. Going from the $2 \times 2$ to the $3 \times 3$ tiling formation task, results in a search space of $10^{145}$ to $10^{1300}$ respectively. This very large increase in search space prevents a lookup table from finding a suitable solution. However because a neural network can generalize better it finds a desired solution. In standard neural networks, communication between neurons is modeled as synaptic connection (wires) that enable electrical signalling. Other fixed topology networks such as Gasnet model both electrical and chemical signalling between neurons \cite{husband}. However, when using fixed-topology networks, the size of the network must be specified ahead of time. Choosing the wrong topology may lead to a network that is difficult to train or is intractable \cite{jordan:jacob,Thangav2005}. Variable length neural network methodologies such as NEAT (NeuroEvolution of Augmenting Topologies) show the potential advantage of evolving both the neuron weights and topology concurrently \cite{kstanley}. It is argued that growing the network incrementally through (`complexification') helps minimize the dimensional search space and thus improve evolutionary performance \cite{kstanley}. This requires starting with a small topology and growing it incrementally through evolutionary training which can be slow. The ANT framework presented here is a bio-inspired approach that simultaneously addresses both the problems in designing rule-based systems by hand and the limitations inherent in previous fixed and variable topology neural networks. Unlike previous models like Gasnet \cite{husband}, chemical communication within ANT enables it to dynamically add, remove and modify modules of neurons through coarse coding. This facilitates segmentation of the search space to perform self-organized task decomposition \cite{Thangav2010}. This also provides good scalability and generalization of sensory input \cite{Thangav2005}. ANT is more flexible than NEAT. It can be initialized with a large number of neurons without the need for incremental `complexification' \cite{Thangav2010}. As will be shown later, ANT does not rely on detailed task-specific knowledge or detailed physical models of the system. It evolves controllers to optimize a user-specified global objective (fitness) function. The evolutionary selection process is able to discover for itself and exploit templates, stigmergy and mitigate the effects of antagonism. \section{Artificial Neural Tissue} ANT \cite{Thangav2005,Thangav2008,Thangav2010} is a neural networks approach trained using evolutionary algorithms. ANT is applied in this paper as the controller for the robot exacavator(s). It consists of a developmental program encoded into an artificial \emph{genome} composed of a set of genes to construct a three-dimensional artificial neural tissue. Inspired by neurobiology, ANT models chemical communication in addition to electrical communication along axons. Some neurons release chemicals that travel by diffusion and are read by other neurons, in essence serving as a `wireless' communication system to complement the `wired' one. This chemical communication scheme is used to dynamically activate and inhibit network of neurons. The tissue consists of two types of neural units, \emph{decision neurons} and \emph{motor-control neurons}, or simply motor neurons. Assume a randomly generated set of motor neurons in a tissue connected by wires (Figure~\ref{fig:overall}a). Chances are most of these neurons will produce incoherent/noisy output, while a few may produce desired functions. If the signal from all of these neurons are summed, then these ``noisy'' neurons would drown out the output signal (Figure~\ref{fig:overall}b) due to spatial crosstalk \cite{jordan:jacob}. \begin{figure} [h] \centering \includegraphics[width=6.25in,keepaspectratio,clip]{illustration} \caption{In a randomly generated tissue, most motor neurons would produce spurious/incoherent output (a) that would `drown out' signals from a few desired motor neurons due to spatial crosstalk \cite{jordan:jacob} (b). This can make training intractable for difficult tasks. Neurotransmitter (chemicals) emitted by decision neurons (c) selectively activate networks of desired motor neurons in shaded regions (i) and (ii) by coarse-coding overlapping diffusion fields as shown (d). This inhibits noisy motor neurons and eliminates spatial crosstalk (e).} \label{fig:overall} \end{figure} Within ANT, decision neurons emit chemicals that diffuse omnidirectionally shown shaded (Figure~\ref{fig:overall}d). Coarse coding is a distributed representation that uses multiple overlapping coarse fields to encode a finer field \cite{albus,hinton}. By coarse-coding multiple overlapping diffusion fields, the desired motor neurons can be selected and spurious motor neurons inhibited. With multiple overlapping diffusion fields (Figure~\ref{fig:overall}d) shown in shaded region (ii), there is redundancy and when one decision neuron is modified (i.e. due to a deleterious mutation) the desired motor neurons are still selected. In the following section, the computational mechanisms within the tissue is described first, followed by description of how the tissue is created. \subsection{Motor Neurons} \label{subsec:motor_neurons} Motor neuron, $N_{\boldsymbol\lambda}$ occupies the position $\boldsymbol\lambda = (l, m, n) \in \mathbb{Z}^3$ (Figure~\ref{fig:neurons.synaptic}) and is arranged in a lattice structure. Depending on the activation functions used, the state $s_{\boldsymbol\lambda} \in \mathbb{S}$ of the neuron is either binary, i.e., $\mathbb{S}_{bin} = \{0, 1\}$ or can be real, $\mathbb{S}_p = [0, 1]$ or $\mathbb{S}_r = [-1, 1]$. \begin{figure} [h] \centering \includegraphics[width=2.0in]{synaptic} \caption{Synaptic connections between ANT motor neurons from layer $l+1$ to $l$.} \label{fig:neurons.synaptic} \end{figure} Each motor neuron $N_{\boldsymbol\lambda}$ receives input from neurons $N_{\boldsymbol\kappa}$ where $\boldsymbol\kappa \in\, \Uparrow\!\!(\boldsymbol\lambda)$, the nominal input set. These nominal inputs are the $3 \times 3$ neurons centered one layer below $N_{\boldsymbol\lambda}$; in other terms, $\Uparrow\!\!(\boldsymbol\lambda) = \{(i,j,k)\,|\,i = l-1, l, l+1; \,j=m-1, m, m+1; \,k=n-1\}$. The sensor data are represented by the activation (state) of the sensor input neurons $N_{\boldsymbol\alpha_i}, i=1 \ldots m$, summarized as $A = \{s_{\boldsymbol\alpha_1}, s_{\boldsymbol\alpha_2} \ldots s_{\boldsymbol\alpha_m}\}$. The network output is represented by the activation (state) of the output neurons $N_{\boldsymbol\omega_j}, j=1 \ldots n$, summarized as $\Omega = \{s_{\boldsymbol\omega_1^1}, s_{\boldsymbol\omega_2^1},s_{\boldsymbol\omega_3^2} \ldots s_{\boldsymbol\omega_n^b}\}$, where $q=1 \ldots b$ specifies the output behavior. Each output neuron commands one behavior of the robot. (In the case of a robot, a typical behavior may be to move forward a given distance. This may require the coordinated action of several actuators. Alternatively, the behavior may be more primitive such as augmenting the current of a given actuator.) If $s_{\boldsymbol\omega_j^q}=1$, output neuron $\boldsymbol\omega_j$ votes to activate behavior $q$; if $s_{\boldsymbol\omega_j^q}=0$, it does not. Since multiple neurons can have access to a behavior, an arbitration scheme is imposed to ensure the controller is deterministic where $p(q) = \sum_{j=1}^{n} {\gamma(s_{\boldsymbol\omega_j^i},q)s_{\boldsymbol\omega_j^i}}/ n_q$ and $n_q=\sum_{j=1}^{n}{\gamma(s_{\boldsymbol\omega_j^i},q)}$ is the number of output neurons connected to output behavior $q$ where $\gamma(s_{\boldsymbol\omega_j^i},q)$ is evaluated as follows: \begin{equation}\label{eq:check} \gamma (s_{\boldsymbol\omega_j^i} ,q) = \left\{ {\begin{array}{*{20}c} {1,\;\;{\mbox{if}\;\;}i = q{\;\;\;\;}} \\ {0,\;\;{\mbox{otherwise}\;\;}} \\ \end{array}} \right. \end{equation} and resulting in behavior $q$ being activated if $p(q) \geq 0.5$. Once the behaviors are activated they are executed in a \emph{a priori} sequence. \subsection{The Decision Neuron} \label{ch3:decision_neuron} Decision neurons occupy nodes in the lattice as established by their genetic parameters (Figure~\ref{fig:neurons.coarsecoding}). These neurons excite into operation or inhibit the motor control neurons (shown as spheres) by excreting an activation chemical. Once a motor control neuron is excited into operation, the computation outlined in (\ref{eq:neuron}) is performed. \begin{figure*} [h] \centering {\includegraphics[width=5.75in]{coarsecodediag}} \caption{Coarse coding regulation being performed by two decision neurons (shown as squares) that diffuse a chemical, in turn activating a motor neuron column located at the center (right).} \label{fig:neurons.coarsecoding} \end{figure*} Each decision neuron can be in one of two states, diffuse a neurotransmitter chemical or remain dormant. The state of a decision neuron $T_{\boldsymbol\mu}$, $s_{\boldsymbol\mu}$, is binary and determined by one of the activation functions (see Section 3.3). The inputs to $T_{\boldsymbol\mu}$ are all the input sensor neurons $N_{\boldsymbol\alpha}$; \emph{i.e.}, $s_{\boldsymbol\mu} = \psi_{\boldsymbol\mu} (s_{\boldsymbol\alpha_1} \ldots s_{\boldsymbol\alpha_m})$ where $\sigma_{\boldsymbol\mu} = \sum_{\boldsymbol\alpha} v_{\boldsymbol\alpha}^{\boldsymbol\mu} s_{\boldsymbol\alpha} / \sum_{\boldsymbol\alpha} s_{\boldsymbol\alpha}$ and $v_{\boldsymbol\alpha}^{\boldsymbol\mu}$ are the weights. The decision neuron is dormant if $s_{\boldsymbol\mu} = 0$ and releases a neurotransmitter chemical of uniform concentration $c_{\boldsymbol\mu}$ over a prescribed field of influence if $s_{\boldsymbol\mu} = 1$. The decision neuron's field of influence is taken to be a rectangular box extending $\pm d_{\boldsymbol\mu}^r$, where $r=1, 2, 3,...$, from $\boldsymbol\mu$ in the three perpendicular directions. These three dimensions along with $\boldsymbol\mu$ and $c_{\boldsymbol\mu}$, the concentration level of the virtual chemical emitted by $T_{\boldsymbol\mu}$, are encoded in the genome. Motor control neurons within the highest chemical concentration field are excited into operation by the decision neurons, while all others remain dormant. Owing to the coarse coding effect, the sums used in the weighted input of (\ref{eq:activation}) are over only the set $\overline{\Uparrow}(\boldsymbol\lambda) \subseteq\, \Uparrow\!\!(\boldsymbol\lambda)$ of active inputs to $N_{\boldsymbol\lambda}$. Likewise the output of ANT is $\overline{\Omega} \subseteq \Omega$. \subsection{Activation Function} \label{ch3:activation_functions} Each neuron, motor and decision uses a modular activation function. This allows selection among four possible threshold functions of the weighted input $\sigma$. The use of two threshold parameters allows for a single neuron to compute the XOR function, in addition to the AND and OR functions. For this activation function, \begin{equation}\label{eq:activation} \begin{array}{rl} \psi_\text{down}(\sigma) & = \left\{ \begin{array}{rl} 0, & \mbox{if}\; \sigma \geq \theta_1 \\ 1, & \mbox{otherwise} \end{array} \right. \\[4mm] \psi_\text{up}(\sigma) &= \left\{ \begin{array}{rl} 0, & \mbox{if}\; \sigma \leq \theta_2 \\ 1, & \mbox{otherwise} \end{array} \right. \\[4mm] \psi_\text{ditch}(\sigma) &= \left\{ \begin{array}{rl} 0, & \min(\theta_1, \theta_2) \leq \sigma < \max(\theta_1, \theta_2) \\ 1, & \mbox{otherwise} \end{array} \right. \\[4mm] \psi_\text{mound}(\sigma) &= \left\{ \begin{array}{rl} 0, & \sigma \leq \min(\theta_1, \theta_2) \mbox{~or~} \sigma > \max(\theta_1, \theta_2) \\ 1, & \mbox{otherwise} \end{array} \right. \end{array} \end{equation} where $\theta_1, \theta_2$ are threshold parameters and $\theta_1, \theta_2 \in \mathbb{R}.$ \noindent The weighted input $\sigma_{\boldsymbol\lambda}$ for neuron $N_{\boldsymbol\lambda}$ is nominally taken as \begin{equation}\label{eq:neuron} \sigma_{\boldsymbol\lambda} = \frac{ \sum_{\boldsymbol\kappa \in \Uparrow(\boldsymbol\lambda)} w_{\boldsymbol\lambda}^{\boldsymbol\kappa} s_{\boldsymbol\kappa} }{ \sum_{\boldsymbol\kappa \in \Uparrow(\boldsymbol\lambda)} s_{\boldsymbol\kappa} } \end{equation} \noindent with the proviso that $\sigma = 0$ if the numerator and denominator are zero. Also, $w_{\boldsymbol\lambda}^{\boldsymbol\kappa} \in \mathbb{R}$ is the weight connecting $N_{\boldsymbol\kappa}$ to $N_{\boldsymbol\lambda}$. These threshold functions are summarized as \begin{multline}\label{eq:multactivation} \psi = (1-k_1) [ (1-k_2) \psi_\text{down} + k_2 \psi_\text{up}] + k_1 [(1-k_2)\psi_\text{ditch} + k_2 \psi_\text{mound}] \end{multline} \noindent where $k1,k2 \in {0,1}$. The activation function is thus encoded in the genome by $k_1, k_2$ the threshold parameters $\theta_1$ and $\theta_2$. \subsection{Evolution and Development} \label{ch3:evolution_and_development} \begin{figure*} [h] \centering { \includegraphics[width=6.25in]{gene_map2}} \caption{ANT gene map showing tissue, motor neuron and decision neuron genes.} \label{fig:genes} \end{figure*} A population of artificial neural tissues are evolved in an artificial Darwinian manner. The `genome' for a tissue contains a `gene' for each cell with a specifier $D$ used to distinguish between motor control neuron, decision neuron and tissue. A constructor protein (an autonomous program) interprets the information encoded in the gene (Figure~\ref{fig:genes}) and translates this into a cell descriptor protein. The gene `activation' parameter is a binary flag resident in all the cell genes and is used to either express or repress the contents of the gene. When repressed, a descriptor protein of the gene content is not created. Otherwise, the constructor protein `grows' a cell. Each cell position is specified in reference to a seed-parent address. A cell-death flag determines whether the cell commits suicide after being grown. Once again, this feature in the genome helps in the evolutionary process with a cell committing suicide still occupying a volume in the lattice although it is dormant. Evolution can decide to reinstate the cell by merely toggling a bit through mutation. In turn mutation (manipulation of gene parameters with a uniform random distribution) to the growth program results in new cells being formed through cell division. The rate of mutation occurring on the growth program is specified for each tissue and is dependent on the cell replication probability parameter $T_r$. This probability parameter is used to determine whether a new cell is inserted. Cell division requires a parent cell (selected with highest replication probability relative to the rest of the cells within the tissue) and copying $m\%$ of the original cell contents to a daughter cell (where $m$ is determined based on uniform random distribution). This models a gene duplication process with the first $m\%$ being a redundant copy of an existing gene and the remaining contents being malformed in which a daughter gene adopts some functions from its parent. The tissue gene specifies parameters that govern the overall description of the tissue. This includes ``neuron replication probability'', a parameter that govern the probability additional cell genes are created through mutation and the ``Neuron Replication Ratio'', that determines the ratio of decision neuron genes to motor neurons genes in the tissue. The ``Cell Type'' of each new cell is determined based on the ratio of motor control neurons to decision neurons, a parameter specified in the tissue gene. The new neuron can be located in one of six neighboring locations (top, bottom, north, south, east, west) chosen at random and sharing a common side with the parent and not occupied by another neuron. Furthermore a seed address is specified, that identifies the seed cell gene which will be used to construct the first cell in the tissue. \subsection{Crossover and Mutation} \label{ch3:crossover} Within ANT, the genome is modular, with each gene defining each neuron's characteristics. Crossover is the exchange of genes between two parents to form a child. Before crossover, a parent affinity parameter, $\varpi \in \{0, 1\}$ is chosen at random for each child genome. The affinity parameter is used to establish if each child genome has closer `affinity' to one of its parents (either parent A or parent B). Thus if $\varpi=0$ then the genome has closer `affinity' to parent $A$ and $\varpi=1$ if it has affinity with parent $B$. Each neuron has a unique position $\boldsymbol\lambda = (l, m, n)$ and a crossover is performed by drawing a plane (with a normal vector parallel to the {\it x} or {\it y}-axis) separating the tissue. Cell genes on the parent genome located on the side of the plane closer to the origin is copied directly onto the child genome with the associated `affinity' parameter and the remaining genes are exchanged between the parents based on a `compatibility criterion' (Figure~\ref{fig:gene crossover}). Crossover operation does not result in arbitrary separation and exchange of gene contents. The `compatibility criterion' imposes the following condition, that the gene for neuron $N_{\boldsymbol\lambda_1}$ from parent $A$ and $N_{\boldsymbol\lambda_2}$ from parent $B$ could be exchanged if $\boldsymbol\lambda_1 = \boldsymbol\lambda_2$, i.e., have the same position after development and only when \emph{both} genes are expressed or repressed during development. Thus child 1 with $\varpi =0$ (affinity to parent $A$) assumes the gene for ${}^{B}N_{\boldsymbol\lambda_2}$ and child 2 with $\varpi =1$ (affinity to parent $B$) assumes ${}^{A}N_{\boldsymbol\lambda_1}$. If the compatibility criterion is not met, then no exchange occurs, and thus ${}^{A}N_{\boldsymbol\lambda_1}$ is passed onto child 1 and ${}^{B}N_{\boldsymbol\lambda_2}$ is passed onto child 2. If ${}^{A}N_{\boldsymbol\lambda_1}$ is not expressed in parent $A$ and ${}^{B}N_{\boldsymbol\lambda_1}$ is expressed in parent $B$, then this pair of genes fail the `compatibility criterion.' \begin{figure} [h] \centering \includegraphics[width=3.50in,keepaspectratio,clip]{crossover_colour} \vspace{-12pt} \caption{A crossover operation between two ANT parents. `Compatible' neuron genes are interchanged as shown resulting in two offspring.} \label{fig:gene crossover} \vspace{-8pt} \end{figure} A detailed description and analysis of how this evolutionary approach utilizing coarse coding leads to task decomposition of complex task and discovery of novel behavior is presented in Section 5.2. \section{Excavation Task} \label{sec:simulation} The excavation task is intended to demonstrate the feasibility of autonomous teams of robots digging pits and clearing landing pads for lunar base construction. In these experiments teams of robots are equipped with bulldozer blades that are used to push regolith. Self-organized task decomposition may be needed to accomplish the task given a global fitness function that does not give instructions on how to solve the task or bias for a particular solution strategy. A typical training environment is shown in Figure~\ref{fig:explain}. The workspace is modeled as a two-dimensional grid with each robot occupying four grid squares. For this task, the controller needs to possess several capabilities to complete the task, including interpreting excavation blueprints, performing layered digging and avoid burying or trapping other robots. The blueprint defines the location of the dumping area and target depth of the excavation area (Figure~\ref{fig:explain}). Each robot controller has access only to a local zone within the excavation blueprint at a time. Much like how insects have hard coded genes to sense templates in their environment, the robots have pre-programmed capability (similar to hard coded genes) to sense the various states of the goal map. However this is insufficient in completing an excavation task and these various states need to be correctly interpreted to perform the correct actions. The fitness function $f$ for the task is given as follows: \begin{equation}\label{eq:excavation_fitness} f = \frac{{\sum\nolimits_{j = 1}^J {\sum\nolimits_{i = 1}^I {\vartheta_{i,j} \cdot e^{ - 2\left| {g_{i,j} - z_{i,j} } \right|} } } }}{{\sum\nolimits_{j = 1}^J {\sum\nolimits_{i = 1}^I {\vartheta _{i,j} } } }} \end{equation} \noindent where $I$ and $J$ are the dimensions of the entire area and $\sum\nolimits_{j = 1}^J {\sum\nolimits_{i = 1}^I {\vartheta _{i,j} } } > 0$ and $\vartheta _{i,j} = 1$ if grid square $(i,j)$ is to be excavated and 0 otherwise; $g_{i,j}$ is the target depth and $z_{i,j}$ is the current depth. This objective function is used to train the robot controllers for the task at hand. The function produces a real value typically that can range from 0 to 1, where 1 indicates the current excavation area matches the blue print topology and 0 when it doesn't match the topology. This fitness function maybe used as a quantitative metric to compare the performance of various excavation systems. \begin{figure*} [h] \centering \includegraphics[width=6.25in]{overhead2} \caption{A typical workspace for the excavation task (left). A corresponding excavation blueprint consisting of an excavation area surrounded by a dumping area (right). The blue print is compared against the current workspace topology to compute a fitness that range from 0 to 1, where 1 corresponds to the desired topology as specified by the blueprint. } \label{fig:explain} \end{figure*} \subsection{Robot Model} \label{sec:robot_model} For these experiments, the inputs to controllers evolved using the ANT methodology (referred to as ANT controllers) are shown in Table~\ref{tbl:sensor_inputs_digging} and their location is shown in Figure~\ref{fig:input_map}. The robots have access to current position $(x,y)$ from localization scans performed in simulation. The variable $z$ is computed through estimated integration of changes in depth values. The discretized $x$ and $y$ coordinates are used to look up the goal depth $g_{x,y}$ from the excavation blueprint of each grid square region in front of the robot. All raw sensory input data are discretized and fed to the controller. $Z_1$\ldots$Z_4$ and $E_1$\ldots$E_2$ are obtained using simulated ground scans of the grid squares shown. For practical implementation these ground scans would be obtained from a LIDAR or TRIDAR system. $E_1$\ldots$E_2$ are obtained by comparing the soil depth in front of the rover to the wheel depth. A simulated sensor, $S_1$ is used to detect obstacles at the front. Robot tilt, heading of nearest robot, distance of nearest robot and whether a robot is stuck or not are represented using $R_1$, $H_1$, $D_1$ and $U_1$ respectively. The heading and distance to the nearest robot are used because front obstacle detection alone may not sufficient to detect obstacle due to inherent blind spots. It is also important for the robot to determine whether it is stuck or not after executing its move behavior. This can be due to any number of reasons and provides the opportunity for the controller to react. In addition, the state of the attached bulldozer blade is provided. The bulldozer blade can be in one of 4 positions, above ground, level, below ground and home position. This enables a robot to fill, push, dig or traverse over the soil respectively. In addition, simulated force sensors are mounted to the blade and measures the net axial force against the blade. The robots can push a maximum of 24 units of soil and this is rescaled to between 0 and 4 for the blade force load, $L_1$. The robots also have access to one memory bit ($M_1$) that can be manipulated using several basis behaviors. Together there are $5^4 \times 3^2 \times 4 \times 5 \times 2 \times 4 \times 4 \times 2^3=8.6 \times 10^7$ possible combination of sensor inputs. \begin{table*}[t!] \caption{Excavation: Sensor Inputs} \label{tbl:sensor_inputs_digging} \centering \footnotesize{ \begin{tabular}{c l l} \hline {\bf Sensor Variables}& {\bf Function} & {\bf Description} \\ \hline\hline $Z_1 \ldots Z_4$ & Depth Sensing Relative to Goal Depth & Level, Above, Below, Don't Care, Dump \\ $E_1, E_2$ & Depth Sensing Relative to Ground & Above, Below or Level \\ $B_1$ & Blade Position & Below, Level, Above, Home \\ $L_1$ & Blade Force Sensor & $0-4$ \\ $S_1$ & Front Obstacle Detection & Obstacle, No Obstacle \\ $D_1$ & Separation Distance From Nearest Robot & $0-3$ \\ $H_1$ & Heading From Nearest Robot & North, East, West, South \\ $R_1$ & Robot Tilted Downwards & True, False \\ $U_1$ & Robot Stuck & True, False \\ $M_1$ & Memory Variable & 0, 1 \\ \hline \end{tabular}} \end{table*} \begin{figure*} [h] \centering \includegraphics[width=6.25in]{robot_layout} \caption{Robot input sensor mapping for the simulation model.} \label{fig:input_map} \end{figure*} Table~\ref{tb:excavate_behaviors} lists the basis behaviors the robot can perform sequentially according to the given order within a single timestep. These basis behaviors are generic and can be used for many different tasks. It is up to the ANT controller to determine when to execute these basis behaviors (using sensory input) to solve the overall task. Furthermore, the excavation behaviors allow for actuation of a bulldozer blade. The blade can be raised or lowered to one of four positions as stated earlier. \begin{table*}[t!] \caption{Excavation Basis Behaviors} \label{tb:excavate_behaviors} \vspace{2pt} \centering \footnotesize{ \begin{tabular}{c l l} \hline {\bf Order} & {\bf Behavior} & {\bf Description} \\ \hline\hline 1 & Throttle Up & Set drive system to high power mode from default. \\ 2 & Move Forward & Move one grid square forward \\ 3 & Move Backward & Move one grid square backward \\ 4 & Random Turn & Randomly turn $90\ensuremath {}^{\circ}$ right or left. \\ 5 & Turn Right & Turn $90\ensuremath {}^{\circ}$ right \\ 6 & Turn Left & Turn $90\ensuremath {}^{\circ}$ left \\ 7 & Blade Above & Set blade above ground $d$ cm \\ 8 & Blade Below & Set blade below ground $d$ cm \\ 9 & Blade Level & Set blade level to ground $d$ cm \\ 10 & Blade Home & Retract blade to home position (no contact with regolith). \\ 11 & Bit Set & Set memory bit $1$ to 1 \\ 12 & Bit Clear & Set memory bit $1$ to 0 \\ \hline \end{tabular}} \end{table*} \subsection{Robot Excavation Model} The workspace is discretized into a two-dimensional grid world, with each grid square having dimensions $l_x \times l_y$. In this model the robots are equipped with a bulldozer blade which is used to dig and push regolith. The robot as explained earlier can only move forward and backward along cardinal directions and the new position after these behaviors is $(x_i + \Delta x,y_i + \Delta y)$ at time $t + \Delta t$ where $\Delta x,\Delta y \in \mathbb{Z}$ and $\Delta t$ is the timestep required to execute the behavior. In addition, $\left| {\Delta x} \right| + \left| {\Delta y} \right| = 1$. A simplified soil interaction model is used to simulate excavation in the controller training environment. The simulation environment is used to track the soil height for each grid square, where $h(i,j,t)$ is the soil height at grid square $(i,j)$ at time $t$. In the training environment, the robot occupies four grid squares. The digging apparatus, which is a bulldozer blade occupies two grid squares next to each other and are at location $(x_1,y_1)$ and $(x_2,y_2)$. The soil interaction model assumes the soil is incompressible and evenly distributed within each grid square. It is further assumed that the interaction between the soil is through a bulldozer blade that is used to push or fill soil according to the behaviors in Table~\ref{tb:excavate_behaviors}. The bulldozer blade, $B_1$ can interact with the soil when its in one of three states, Below, Level and Above ground. This interaction with the soil is computed as follows: \begin{multline}\label{eq:excavation_fitness} h({x_i},{y_i},t + \Delta t) = h({{\tilde x}_i} + \Delta x,{{\tilde y}_i} + \Delta y,t) + h({{\tilde x}_i},{{\tilde y}_i},t) - {z_{wi}} - {b_h} \cdot \varepsilon ({V_{blade},b_h}) \end{multline} \noindent where, $i= [1,2]$, $({x_i},{y_i})$ are the current positions and $({\tilde x_i},{\tilde y_i})$ are the old positions of the blade. $z_{wi}$ is the depth of front wheel $i$ and $b_h$ is blade position, where $b_h \in {-1,0,1} $ and $V_{blade} \geq 0$ and is the volume of soil in front of the blade. After the soil height against the blade is updated, the soil height underneath the front wheel (old position of the blade) is updated as follows: \begin{equation}\label{eq:excavation_fitness} h({{\tilde x}_i},{{\tilde y}_i},t + \Delta t) = {z_{wi}} + {b_h} \cdot \varepsilon ({V_{blade},b_h}) \end{equation} \noindent where $\varepsilon ({V_{blade},b_h})$ is given as follows: \begin{equation}\label{eq:excavation_fitness} \varepsilon = \left\{ {\begin{array}{*{20}{c}} {0,\;{\rm{ if }}\;{V_{blade}} = 0\;{\rm{ and }}\;{b_h} \ge 0}\\ {1,\;{\rm{ otherwise\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;}}} \end{array}} \right. \end{equation} \noindent The volume of soil in front of the blade, $V_{blade}$ is given as follows: \begin{equation}\label{eq:excavation_fitness} {V_{blade}} = \sum\limits_{i = 1}^2 {\left[ {h({x_i},{y_i}) - {z_{wi}} - {b_h}} \right] \cdot {l_x} \cdot {l_y}} \end{equation} where $l_x$ and $l_y$ are the length and width of each grid square. When the blade is positioned below wheel depth, this results in scraping and accumulation of soil in front of the blade. When the blade is level, this results in pushing of already accumulated soil along the terrain and when the blade is positioned above ground, the accumulated soil is dislodged. \subsection{Training} Noting that each behavior in Table~\ref{tb:excavate_behaviors} can be triggered or not for any one of $8.6 \times 10^7$ possible combination of sensor inputs, there is a total of $2^{12\times 8.6 \times 10^7} \approx 10^{3\times 10^8}$ possible states in the search space! Task decomposition is often necessary to tackle very large search spaces and find desired solutions. ANT using its coarse-coding scheme described earlier is shown to perform task decomposition \cite{Thangav2010} and is a good candidate to tackle this excavation task with its large task space. ANT controllers are first trained (evolved) in this simplified training environment. The genome for ANT is shown in Figure~\ref{fig:genes}. Darwinian selection is performed using the given fitness function averaged over 100 different scenarios \cite{goldberg}. The population is randomly generated with an initial number of neurons ranging from 40 to 120 neurons. The neurons are feed forward and the second layer of neurons is fully connected to all the sensory input neurons. Furthermore, the ANT growth program is restricted to a maximum of four layers in total. The tissue however can grow in area. The fitness $f$ for each controller is calculated for an excavation area, dug to a goal depth of $d$ below ground and area spanning $l \times w $ squares. The worksite area is $8 \times 8$ squares and a goal depth of $d =$ 1, 2 or 3 units below ground. The robots are initialized at random positions on the worksite.The population size for training is $P=100$, with crossover probability $p_c=0.7$, mutation probability $p_m=0.025$ and a tournament size of $0.06P$. The fitness of the fittest individual from the population during each generation is taken to be the system fitness. Each training runs lasts 5,000 generations and is repeated 30 times to obtain the average system fitness. \section{Simulation Results} Figure~\ref{fig:ex_evo} shows the population best fitness of the system evaluated at each generation of the artificial evolutionary run. The system performance is affected by the number of robots per digging area ($8 \times 8$ squares). A single robot is not as efficient as 4 robots working in parallel with each robot having a smaller area to cover. As will be shown later in Section 5.3, with more than 4 robots for a $8 \times 8$ area, the problem of antagonism arises when multiple robots trying to perform the same task interfere with one another and reduce the overall efficiency of the group. \begin{figure} [h] \centering \includegraphics[width=4in]{excavation_evo} \vspace{-12pt} \caption{Fitness comparison of ANT based solutions during training, for between 1 and 5 robots averaged over 30 runs.} \label{fig:ex_evo} \vspace{-5pt} \end{figure} \begin{figure} [h] \centering \includegraphics[width=4in]{fitness_antcomp} \vspace{-12pt} \caption{Maximum fitness averaged over 30 training runs for ANT, NEAT and standard neural networks.} \label{fig:neural_net_comparison} \vspace{-5pt} \end{figure} First we consider the effect of topology on controller training performance. The performance of standard fixed topology neural networks and NEAT \cite{kstanley}, a variable topology neural network methodology is compared in Figure~\ref{fig:neural_net_comparison}. For this comparison, topologies for NEAT and standard neural networks are randomly generated and contain between 40 and 120 neurons. For the fixed neural networks, the neurons are feed forward and like ANT, restricted to a maximum of four layers that includes the sensor input layer and output layer. The transfer function used is the modular activation function. \begin{figure} [h] \centering \includegraphics[width=4in]{solution_antcomp} \caption{Probability of finding a solution (fitness $\geq 0.9$) averaged over 30 training runs for ANT, NEAT and standard neural networks.} \label{fig:neural_net_comparison2} \end{figure} ANT shows nearly a 30\% improvement in fitness performance over the best of these conventional approaches. Importantly, ANT obtains a fit solution (fitness 0.9 or higher) with nearly a two-folds advantage over NEAT \cite{kstanley} (Figure~\ref{fig:neural_net_comparison2}). In both cases, ANT shows a substantial improvement over standard neural networks. Further analysis of the robustness and scalability of conventional neural networks and ANT is presented in Section 5.3. These results show that ANT performs substantially better in terms of scalability and robustness than conventional neural networks. \begin{figure} [h] \centering \includegraphics[width=4in]{ant_coarsecodingcomp} \caption{Maximum fitness of ANT with and without-coarse coding for between 1 and 5 robots.} \label{fig:coarse_coding_comp} \end{figure} In conventional fixed and variable topology networks there tends to be more `active' synaptic connections present (since all neurons are active), and thus takes longer for each neuron to tune these connections to the sensory inputs. ANT is an improvement as the topology is evolved and decision neurons learn to mask out spurious neurons. The net result is that ANT produces fitter solutions in fewer genetic evaluations compared to conventional neural networks. Further comparisons are performed to determine the key features within ANT that contribute to its improved performance over conventional neural networks. In this study, the coarse-coding functionality is turned off, to determine its contribution to ANT's overall performance. The results show a significant drop in performance (Figure~\ref{fig:coarse_coding_comp}). The overall performance without coarse-coding is comparable to a variable topology architecture such as NEAT. This confirms that it is the coarse-coding functionality that provides ANT its advantage over conventional neural networks. \subsection{Evolution of Behaviors through Task Decomposition} In this section we present evidence suggesting how self-organized task decomposition occurs in ANT controllers. With human devised task decomposition, the first step is to devise the task objective and then figure out the necessary subtasks, followed by further partitioning of the subtasks until all components of the task are identified and readily solvable. With self-organized task decomposition, there is no supervisor to break up the objective function into the necessary subtasks. Instead modules form that without any central coordination and using local information learn to solve certain subtasks through a process of trial and error as will be shown here. These modules in turn interact and cooperate to solve the overall task. Figure~\ref{fig:task_evo} shows a typical ANT training run for the excavation task. Statistics are obtained of key sensor-behavior combinations listed in Table~\ref{tbl:detect} during a typical training run. In this scenario, 4 robots are used, using the standard environment described in Section 4.3. Figure~\ref{fig:task_evo}a shows the controllers converge to a solution through a series of punctuated rises in several identified behaviors. These results give insight into how ANT solves the excavation task. The results suggests that the controllers evolve certain critical behaviors such as simple obstacle avoidance early during evolutionary training (Figure~\ref{fig:task_evo}b). This is followed by related behaviors, such as stuck avoidance (Figure~\ref{fig:task_evo}e) (i.e. avoiding getting stuck in soil). These behaviors are a requirement for the controllers to effectively move around the experiment area to perform excavation. Next, the controllers evolve to steadily improve the accuracy of performing correct dumping behaviors (Figure~\ref{fig:task_evo}d). \begin{figure} [h] \centering \includegraphics[width=6.25in]{behaviours_evolution} \vspace{-12pt} \caption{(a) Fitness (b)-(f) Evolution of important behaviors for the excavation task during a typical evolutionary training run of ANT. At generation 3,100 new behaviors are discovered foreshadowing a rapid rise in fitness and convergence to a solution.} \label{fig:task_evo} \vspace{-5pt} \end{figure} At around 3,100 generation, a sharp rise in fitness is observed (Figure~\ref{fig:task_evo}a), rapidly converging towards a fitness of 0.9 (solution to the task). The controllers evolve to find critical behaviors to solve the task through a process of trial and error, after evolving prerequisite behaviors such as obstacle avoidance \cite{Thangav2010}. This evidence of performing trial and error to improve fitness can be seen through increased activity of cut-dig which enables the controllers to randomly obtain a fitness advantage over rest of the population (Figure~\ref{fig:task_evo}c). Cut-dig requires the blade be positioned below ground to perform a sharp incision cut into the soil. As the robot continues moving forward, a discretized sloped cut is obtained instead of the required level cut. Therefore a series of these cut-dig behaviors and back-fill behaviours are switched on and off for short distances to approximate a level cut. This combined with improved dumping performance foreshadows improvement in fitness (Figure~\ref{fig:task_evo} a,c,d). Although this digging approach is not every efficient, it increases fitness pressure to find more efficient ways. This results in the appearance of fine tuned digging behaviors that require fewer, inefficient incision cut-dig behaviors and more level digging. Level digging requires the robot first perform an incision cut and then continue pushing soil at a level depth. Thus with this improvement, the cut-dig behavior doesn't have to be used as often and can match blueprints with better accuracy (Figure~\ref{fig:task_evo}c). The cut-dig behavior acts as a scaffolding mechanism, that is used at a critical time to evolve efficient digging behaviors. However for the controllers to achieve a high fitness several other behaviors are acquired. Once the controllers achieve a high accuracy in following the excavation blueprint and performing digging and correct dumping behavior, this results in a significant improvement in fitness. Further refinement occurs with the appearance of leveling behaviors (Figure~\ref{fig:task_evo}f) that enables the robots to wander and correct small mistakes. This process of wandering and correcting mistakes enables even less accurate controllers that miss an area to achieve high fitness through a process of feedback. This is increasingly utilized because more time is available to perform these behaviors with increased digging accuracy. The net result is further improvement in fitness. \subsection{Neuronal Analysis} Several different methods have been used to analyze ANT solutions to identify emergent behaviors that solve the excavation task. First we analyze neuronal and behavioral activity of a evolved tissue solution with a fitness of 0.99. It is difficult to discern what the controllers are doing based solely on output behaviors unlike previous task such as sign following and resource gathering \cite{Thangav2008,Thangav2010}. Hence we have used sensor-behavior combinations (Table~\ref{tbl:detect}) to detect instances of complex behaviors that have evolved to solve the task. Further we identify the location and activity of these behaviors in the tissue topology. Figure~\ref{fig:behave_analysis} shows an ANT tissue with the location and activity of major behavioral centers. As with other tasks evolved using ANT \cite{Thangav2008,Thangav2010}, the behaviors evolved as neurons modules are distributed within the tissue. Interestingly, most decision and motor neurons remain dormant and don't encode for any identified behaviors. This further suggests that these neurons remain neutral. This is beneficial in evolution, where the right combination of mutations can first encode a function neutrally followed by a trigger mutation that unlocks this behavior. The neutral neurons act as scaffolding for this transition. With so many neurons remaining dormant, this permits the process to occur in parallel throughout the tissue. Once a new behavior is turned on in a trial and error, explorative process, there is no guarantee that this behavior will provide a fitness advantage. If it doesn't, this individual has reduced chance of survival through selection. However if this change results in a behavioral innovation that provides a significant fitness advantage, then the progeny multiplies and may then dominate the evolving population. This repeated process of trial and error continues, with innovations being accumulated much like building blocks until a high fitness is reached \cite{Thangav2010}. \begin{figure*} [h] \centering \includegraphics[width=5.25in]{behaviours_analysis} \caption{ANT topology and neuronal activity identifying important behaviors evolved for the excavation task. Shaded columns highlight correlation in neuronal and behavioral activity during a typical simulation run. The controller was evolved using 4 robots in a $8 \times 8$ excavation area and has a fitness of 0.99. } \label{fig:behave_analysis} \end{figure*} These identified neurons modules have acquired specialized traits that are use to perform incision cuts (cut dig), scout, level, dump, obstacle avoidance and perform stuck avoidance behaviors (Figure ~\ref{fig:behave_analysis}). Analysis of decision neuron activity with sensor input and behavior output combination show correlations. This suggests the behaviors are distributed among one or more decision and motor neuron modules. These modules work cooperatively to encode tissue behavior. This has a significant advantage. For one, if a module is perturbed due to deleterious mutations, then another module that partly encodes for the behavior can recover some of this functionality. Further, if multiple modules encode for the exact same functionality, then deleterious mutations have minimal effect. At the bottom of Figure~\ref{fig:behave_analysis}, key events in a typical run lasting 250 timesteps are shaded. Observing the move forward behavior as with the other 12 behaviors from Table~\ref{tb:excavate_behaviors}, it is difficult to ascertain what is occurring due to the complex interactions of multiple robots and their behaviors. Instead we obtain statistics of sensor-behavior output combinations from Table~\ref{tbl:detect} to better understand the solutions. Several correlations are identified here, including between stuck avoidance and decision neuron 6, leveling and decision neuron 31, obstacle avoidance and decision neuron 48, cut-dig and decision neuron 55. Interestingly, decision neuron 2 behaves like a clock oscillating between its two binary states. This oscillator behavior has been observed in other ANT solutions for different tasks \cite{Thangav2008,Thangav2010}. It is hypothesized that this is used to synchronize the various behavior modules distributed within the tissue. \subsection{Behavioral Analysis} In a second approach, we analyze evolved solutions by observing robot controller behavior in the simulation environment (Figure \ref{fig:ex_digging_screen}). The robots scan the area in front at each timestep to determine whether its above or below the goal depth. Once it is found to be above the goal depth it starts digging. Because the robots are randomly positioned at the start, the excavated areas appear randomly throughout the work site. The robot start digging by lowering their blades one level below ground and move forward one grid square forward. Immediately afterwards, the controllers raise the blade to level and continue pushing soil at a level height until reaching a dumping area. Once the robots detects a dumping area in front it pushes the soil forward, followed by a reverse and turn. This results in the accumulation of piles of soil (berms) at the dumping area. The controllers learn to perform layered digging (Figure~\ref{fig:ex_digging_screen}). The controllers do not lower the blade immediately to reach the goal depth, instead they perform an incision cut and then push soil layer by layer until the target depth is reached. As one robot removes one layer, another cooperates and pickups where the last one left off. This process continues until the goal depth is reached. Multiple robots also cooperate by detecting one another through obstacle sensing and avoid getting in the way. Once another robot is sensed in front, the robot makes a turn. With sufficient number of these interaction, many of the robots end up being in parallel tracks which minimizes obstructions from other robots. The dug areas that appear randomly scattered through the worksite at the beginning merge into one large area at the end. The process of self-organization occurs with individual robots controllers sensing and manipulating the environment using local information. The controllers can only sense local information. Although a global goal map may be present, each controller can only sense a localized region of the map at a time. The initial appearance of excavated areas randomly throughout the work site, followed by their merger into one excavated area that meets the goal depth specifications is an example of the self organization. This self-organization occurs due to cooperative behavior of multiple robots using local sensor input and performing only local actions. The work done by one robot is not undone by another. Analysis of the solutions suggests that the controllers exploit templates by learning to correctly interpret dumping zones, ''don't care'' regions, depth relative to the specified excavation blueprint. These controllers perform interpretation by taking the discernable sensor input and determining the proper action to perform, such as move forward or backward and whether to lower, level or raise the blade (Figure \ref{fig:ex_digging_screen}). With the goal map, if the goal depth is lower than the current soil depth, then the interpreted action is to dig by lowering the blade below ground and pushing. \begin{figure*} [h] \centering \includegraphics[width=6.25in]{digging_screen} \caption{Simulation snapshots of an excavation task simulation (4 robots) after 0,50,75,100,170 timesteps.} \label{fig:ex_digging_screen} \end{figure*} Communication between robots occurs through manipulation of the environment in the form of stigmergy. Manipulation of the environment occurs by excavating a region or dumping excavated material. Each robot interprets the blueprint and determines whether to deeper, back-fill or move to the next location. However these robots can't typically dig to the goal depth all at once and hence have to dig material layer by layer. By this robots can only remove part of the soil at a time before having to dump at the dumping locations. It is up to another robot to determine that the goal depth has not been reached and pickup where the last robot left off, which is a form of implicit communication mediated through the environment. Furthermore once the goal depth is reached at a grid square, any other robot that comes and sense the grid square interprets that the goal depth is reached. Through this implicit communications, cooperative actions also occur. That is the excavation work done by one robot is not undone by another. Initially small digging areas form, but in time through cooperative actions these digging areas merge into one region that matches the goal depth. In addition, the ANT controllers exploit the ability to sense the depth of soil relative to wheel depth (Figure~\ref{fig:ex_digging_screen}). This enables each robot controller to sense whether it is excavating deeper or backfilling at the current depth. The ability to backfill while useful, can also undo the effort of other robots excavating at different depths. Sensing and avoiding this scenario is a form of cooperation. The robots also have the ability to sense the relative position of a nearby robot much like radar. This feature is exploited to to avoid collisions confirmed from Figure~\ref{fig:task_evo}b, when a series of output behaviors such as `move forward' and `turn left' is applied in sequence. Although obstacles can be detected using front sonars, there exists blind spots to the extreme right and left making it difficult to detect and react to obstacles when a sequences of behaviors are executed. \subsection{Summary on How the Controller Works} We used different techniques to analyze how complex behaviours emerge within the ANT controllers using neuronal analysis of controller that attains a fitness of 0.99. Within this tissue, we identify portions of the tissue that are active and find different specialized modules emerge to perform the required subtasks required to perform the overall task. We are also able to trace the evolution of these behaviours to a series of critical events, when the controllers discover new capabilities leading to substantial improvement in fitness performance. Here we summarize our finding in Figure~\ref{fig:works} in the form of a finite state machine. \begin{figure*} [h] \centering \includegraphics[width=6.25in]{behave_state} \caption{Representation of Major Behavior States Evolved by the ANT Solution Controllers. Shading indicates the order in which these complex behaviours are evolved.} \label{fig:works} \end{figure*} The controller during typical operation (1) scout (moves around) to find regions that are above the goal depth. Once found the blade is lowered to (2) cut/dig into the soil, moving forward and then transitioning into (3) ``level digging.'' As the bucket is filled or if the robot nears a dumping area, the soil is dumped (4). Along the way, robots perform collision avoidance (5). This in fact appears to be a series of behaviours that minimizes robot to robot interaction, enabling the robots to work in parallel and to maximize area coverage. This ability to minimize direct robot to robot interactions influences the scouting behaviour state and decision of where to perform cut-dig. Along the way the robot may also need to avoid getting stuck (6) when pushing too much regolith. As will be shown later, they take a non-greedy approach to excavation, where it is more efficient for individuals to temporarily give up when stuck (by unloading the pile of regolith being pushed) and resume later. We also summarize how these behaviours have evolved. The ability to scout and perform basic collision avoidance is evolved first. This is followed by incision cuts. Initially the incision cuts are performed randomly through trial and error, in addition to dumping the regolith. In turn controllers evolve to interpret the signs correctly to dump at the designated locations. However this process is still inefficient, limiting the amount of regolith being excavated or causing to dig below the designated goal depth. With controllers evolving to excavate more regolith, they can get stuck pushing too much. The controllers in turn evolve stuck avoidance behaviours used to abort excavation when stuck and start over from a different direction. A critical step is reached when the controllers ``discover'' the level dig behaviour that allows pushing of regolith over longer distances and enables excavation and transport of significantly more regolith to dumping area resulting in a significant leap in fitness. \subsection{Scalability} First we consider performance of an intuitive hand-coded robot controller (see Appendix 8.1 for program description) for varying number of robots. The hand-coded controller shows the best performance for a single robot scenarios, but steadily decreases in performance for increasing number of robots. For this controller it is assumed that robot need to avoid one another and hence obstacle avoidance behaviors are included. The results show this assumption is not optimal and results in poor performance for increased number of robots. The controller is not effective in exploiting parallelism. This suggests, cooperative behaviors are necessary to exploit increased number of robots, and do not just involve intuitive obstacle avoidance procedures. \begin{figure} [h] \centering \includegraphics[width=4.5in]{rescaled2} \caption{Excavation performance of ANT based solutions evolved using 1 to 5 robots $(8 \times 8$ excavation area) applied to scenarios using 1 to 10 robots.} \label{fig:ex_scaleup} \vspace{-5pt} \end{figure} The fittest ANT solutions from the simulation runs shown in Figure~\ref{fig:ex_evo} are applied to this new setting, by varying the number of robots while holding the digging area constant (Figure~\ref{fig:ex_scaleup}). Taking the controller evolved for a single robot and running it on a multirobot system shows a steep degradation in performance. This is expected since the single-robot controller lacks the cooperative behavior necessary to function well within a multirobot setting. For example, these controllers fail to develop `collision avoidance' behaviors. Similarly, a multirobot system scaled down to a single robot setting also shows a degradation in system performance. With the multirobot system, controllers have evolved to exploit and depend on cooperative actions to complete the task; thus when the environment is abruptly changed the controllers perform poorly. With more than 4 robots for a $8 \times 8$ area, the problem of antagonism arises when multiple robots trying to perform the same task interfere with one another and reduce the overall efficiency of the group. The key here is number of robots selected during training. Proper selection of robots better enables the controllers to be scalable. Further we extend the comparison by mixing number of robots scenarios during training. For example mixing training scenarios of 1 and 4 robots shows better scalability performance than one and four robot solutions. In addition this approach shows better performance than the intuitive hand-coded solution when using a single robot. This effect of antagonism on performance is further supported in Figure~\ref{fig:antagonism_confirm} by varying excavation area and applying an ANT solution evolved using 4 robots on a $8 \times 8$ area to the $6 \times 6$ and $10 \times 10$ digging area. For the $6 \times 6$ area, peak performance is achieved using only 2 robots, but show a larger drop in performance for increased number of robots, showing the increased effect of antagonism for a smaller area. In addition, increasing the area results in the peak performance reached with 7 robots and performance drops in smaller increments. These two experiments confirm the problem of antagonism with these multirobot systems. Furthermore, the ANT solution show higher fitness than during training for the large digging area with increased number of robots \begin{figure} [h] \centering \includegraphics[width=4.5in]{antagonism_confirm} \caption{Excavation performance ANT based solutions evolved using 4 $(8 \times 8$ excavation area) applied to resized excavation area and number of robots.} \label{fig:antagonism_confirm} \vspace{-5pt} \end{figure} As noted earlier, a key factor in developing adaptive controllers is scalability. Scalability is critical, because in real world scenarios, one or more robots may be disabled or unavailable and the approach needs to effectively complete the task. Taking the evolved standard neural network controllers and applying them on $n$ robots is shown in Figure~\ref{fig:rescaled_std}. Comparing the results with Figure~\ref{fig:ex_scaleup}, standard neural networks controllers show poor scalability performance. In comparison, ANT shows a two-folds performance advantage. Controllers evolved for 4 robots, shows highest fitness for a 4-robot scenario. In addition, controllers evolved for a single robot show poor scalability applied on increased number of robots. Alternately, controllers evolved with 4 robots show relatively better performance on average than other training scenarios. This indicates that in a real world scenario, ANT controllers are more robust to handle uncertainties in the number of active robots towards completing a task. \begin{figure} [h] \centering \includegraphics[width=3.25in]{rescaled_standardnn} \caption{Excavation performance of the fittest standard neural networks evolved using between 1 and 5 robots applied to scenarios using 1 to 10 robots.} \label{fig:rescaled_std} \vspace{-5pt} \end{figure} Focusing on the ANT controllers, it is interesting to note that the controllers trained with 4 robots for an $8 \times 8$ digging area perform considerably better on average than solutions trained for other number of robots. It is evident that this solution perform better for increased goal depth (Figure~\ref{fig:ex_depth}) and show better performance than other solutions for increased excavation area. The optimal ratio of robots to digging area using solution trained with 4 robots is shown in Figure~\ref{fig:ex_scale}. \begin{figure} [H] \centering \includegraphics[width=4.0in]{fig_comb2} \caption{Excavation performance of ANT solutions evolved using 4 robots on a $8 \times 8$ excavation area for varying excavation area.} \label{fig:ex_scale} \end{figure} These simulation experiments suggest that there exists an optimal set of training conditions that enables controllers to evolve improved scalability. Although the controllers may be better adapted to antagonism under higher training densities with improved obstacle avoidance techniques, these behaviors may not be well tuned to completing the overall objectives effectively. This optimal condition is dependent on task duration. Furthermore, the optimal density is beneficial when the task is time limited. Given enough time, the suboptimal solution can attain the same fitness but consumes more energy. \begin{figure} [H] \centering \includegraphics[width=4.0in]{fig_comb1} \caption{Excavation performance of ANT based solutions for varying depth taken after 10,000 Timesteps} \label{fig:ex_depth} \end{figure} \subsection{Selection for Multirobot Behavior} Based on Figures~\ref{fig:ex_scaleup} and~\ref{fig:ex_scale}, the ANT controllers trained for a 4-robot solution produces solutions that show better rescalability than other initial conditions for a $8 \times 8$ excavation area. Can evolutionary techniques be used to determine both a multirobot controller and optimal system parameters (such as number of robots) simultaneously? For this experiment, the number of robots, $N$, is introduced as an evolvable variable within ANT. This is akin to a population reproduction rate, where certain species have more children at a time than others. A histogram in Figure~\ref{fig:ex_sel} shows the distribution of $N$ among the population best averaged over 30 runs. If there were no selection pressure on $N$, then the histogram should be a uniform distribution. The results suggests evolutionary selection tends towards the observed optimal number of robots (Figure~\ref{fig:ex_scaleup}). \begin{figure} [h] \centering \includegraphics[width=4in]{histogram} \caption{Histogram of number of robots selected, where $N$ the number of robots is evolved as parameter (right).} \label{fig:ex_sel} \end{figure} The question then is why is the system tending toward the optimal number of robots per given area? It is not obvious that controllers gravitate towards an optimal setting and stay there. For one, if the optimal solution is sensitive to damaging mutations, then the population may gravitate to a more stable suboptimal solution. However, solutions evolved under the optimized condition rescale better. Both traits provide an advantage, helping to gravitate solutions toward this setting and remaining there. An individual having adapted under this optimal setting is better adept at handling a deleterious mutation of $N$ robots that could either result in increased or decreased number of robots. This technique of evolving a controller and other system parameters concurrently reduces the need to analyze the rescalability performance and antagonism. Because the system tends towards the optimal number of robots, the problem of antagonism is limited. However owing to the stochastic nature of the search process, the optimal number of robots can only be obtained with statistical certainty after repeated evolutionary runs. \section{Proof-of-Concept Experiments} \subsection{High Fidelity Lunar Simulator} This section describes work on porting ANT controllers onto excavation robots in the Digital Spaces$^{\text{TM}}$ simulator. Digital Spaces$^{\text{TM}}$ is an off-the-shelf, commercial, high-fidelity 3-D simulator that simulates the low gravity lunar surface. The Balovnev Soil Interaction Model~\cite{balovnev,nader} is used to simulate the deformable terrain. Deformable terrain modeling allows for accurate regolith-tool and wheel-terrain interactions. This virtual approach facilitates prototyping and testing of alternative digging concepts and can potentially reduce hardware experiment costs especially of off-world environments. The simulated robots are equipped with a front loader, are holonomic and deliver 300 W average power. The robot model shown in Section~\ref{sec:robot_model} is ported to the Digital Space environment. Details of the approach are found in \cite{nader}. The $(x,y)$ position, depth ($z$), tilt ($R_1$) are built in variables. Using a discretized mesh of the surface terrain and $(x,y,z)$ of the robots, $Z_1$\ldots$Z_4$ and $E_1$\ldots$E_2$ are computed. Relative position of the robots are used to compute the state of the front obstacle avoidance sensors ($S_1$), heading of nearest robot $H_1$ and distance to nearest robot, $D_1$. The blade positions are simulated on the front loader by defining four set positions to match the bull dozer blade settings, including above, level, below ground and home position. The blade load, $L_1$ is computed using the soil interaction model~\cite{balovnev,nader}. \begin{figure} [h] \centering \includegraphics[width=6.25in]{high_low_res_goal_figure} \caption{Excavation blueprint of a landing pad. Low fidelity training simulator (top). High fidelity Digital Spaces$^{\text{TM}}$ simulator (bottom).} \label{fig:digi_goalmap} \end{figure} To ensure consistency between the training simulations and the Digital Spaces virtual world, fitness is monitored for 1, 2, 3, and 4 robots applied to an excavation blueprint of a landing pad shown in Figure~\ref{fig:digi_goalmap}. The results are shown in Figure~\ref{fig:digi_fitness} right. The excavation blueprint consists of a landing pad $9 \times 10.5 \times 2.0$ m deep connected by a $5.0 \times 3.5 \times 1.0$ m deep region for a ramp to exit/enter the landing pad. Comparison with the training simulator (Figure~\ref{fig:digi_fitness}) shows that the results correlate well. After reaching a peak fitness at about 200 timesteps for all except the single robot scenario, the fitness drops gradually in the Digital Spaces simulations. The training simulator results (Figure~\ref{fig:digi_fitness}) level off within 200 timesteps (except for the single robot scenario). In Digital Spaces simulations, the fitness then gradually drops after the final goal depth is reached. In this case, the robots continue to move around the work area with blade height set to level. Theoretically, this means the robots do not dig any regolith, but in reality, they skim off small amounts of material, going slightly below the goal depth over time. Video snapshots of a typical simulation is shown in Figure~\ref{fig:ex_nader}). \begin{figure} [H] \centering \includegraphics[width=5.0in]{new_fig} \caption{Fitness comparison of ANT controllers in the low-fidelity training simulator and high-fidelity Digital Spaces$^{\text{TM}}$ simulator. } \label{fig:digi_fitness} \end{figure} \begin{figure} [H] \centering \includegraphics[width=6.2in]{nader_excavation2} \caption{Digital Spaces$^{\text{TM}}$ simulation of three robots using a four-robot ANT controller solution to perform excavation on simulated lunar terrain. The robots unlike under training conditions use a front-loader bucket instead of a two-way bulldozer blade. The excavation blue print includes a hole and a ramp for the robot to enter/exit surrounded by the dumping area.} \label{fig:ex_nader} \end{figure} \subsection{Controlled Field Experiments} This section describes work performed to test the ANT excavation controllers on real robots. The robots were tested inside a 50 m dome, containing loose sand. The robots were tested under low lighting conditions representative of a lunar region shadowed due to cratering. In addition the ambient temperature was between -5 $^{o}$C and -10 $^{o}$C. The robot model shown in Section~\ref{sec:robot_model} is ported onto a team of UTIAS Argo class robots (Figure~\ref{fig:argo_excavator}). The robots are approximately 15-kg, non-holonomic and are four wheel drive. Each robot is equipped with a 1-DoF servo actuated bulldozer blade system, a PC-104 Intel 80386 computer, an assortment of sensors and actuators. The drive and actuation system is powered by two 8V, 4500 mAh lithium ion batteries. The electronics and computers are powered by four 7.5V lithium ion batteries. \begin{figure} [H] \centering \includegraphics[width=4in]{excavation_argo} \caption{An Argo robot equipped with a 1 DoF bulldozer blade, a laser range finder,a pair of Logitech$^{\circledR}$ Quickcams$^{\text{TM}}$ affixed to the pan-tilt unit and an assortments of other sensors. } \label{fig:argo_excavator} \end{figure} An overhead camera is used to determine the $(x,y)$ location of the robots by tracking LED light beacons (Figure~\ref{fig:overhead}). The variable $z$ is estimated using an overhead laser range finder that performs periodic scans of the worksite. Using the estimated $z$ value, the robot equipped with a Leica laser range finder is used to compute $Z_1$\ldots$Z_4$ and $E_1$\ldots$E_2$. The onboard laser range finder and sonars are used to detect obstacles at the front ($S_1$). Heading and distance of nearest robot, $H_1$ and $D_1$ respectively are computed using the overhead camera. $R_1$, the robot tilt is measured using an onboard 2-axis accelerometer. A webcam is used to determine $U_1$, i.e. whether the robot is stuck or not by simple comparison of consecutive images. On the robot, fine blade adjustments are made using PID control to ensure a constant force is met. The robot can handle a maximum of 10 N push force and this is rescaled to integer values between 0 and 4 for the blade load, $L_1$. The excavation blueprint used in shown in Figure~\ref{fig:explain} (right). \begin{figure} [h] \centering \includegraphics[width=4in]{overhead_system} \caption{Layout of the experimental system, showing excavation robots mounted with light beacons localized using an overhead camera system.} \label{fig:overhead} \end{figure} Figure~\ref{fig:dig_progress} shows 3-D laser scans of the soil moved from a 5-hour excavation experiment with 2 robots. Comparison of the laser scans show an estimated 0.7m$^3$ of soil volume was displaced in the test area. This estimate is performed by averaging the regolith dug and dumped in the vicinity. This measurement is typically an underestimate, because the regolith at the start of the experiment is uncompressed and after the experiment, with multiple rover traversal around the regolith becomes quite packed. The robots start excavating holes randomly in the digging area. These holes in turn merge to form one big pit. In this excavation run, three sides of the pit wall have formed and are clearly visible from ground photographs and overhead 3-D laser scan (Figure~\ref{fig:ground_photo}). Ground truth measurements show that the maximum depth reached is between the height of the berm and lowest point of the dig area to be 15 and 20 cm. At the target depth, the regolith is quite packed. This is despite the fact that the robots are underpowered for the task resulting in the robots frequently getting stuck, backing out and attempt to restart digging, thus slowing the overall excavation process. On most occasions the robots correctly interpret the excavation blueprints and dump dirt in the specified dumping areas as shown from the 3-D laser scans (Figure~\ref{fig:dig_progress}). Fitness comparison between the low-fidelity training simulator and hardware experiments for the two-robot scenario is shown in Figure~\ref{fig:hardware_sim}. In the training simulator, the steady state fitness is reached in shorter time than the hardware experiments. This is because factors that reduce the efficiency of the real robots digging (due primarily to their design) such as side spillage of soil while pushing or frequently getting stuck while pushing results in less soil being transferred to the intended destination. Furthermore, other in-situ factors may further reduce excavation efficiency of each robot on the lunar surface. As a result, each robot requires more time to reach a steady state fitness. One solution would be to supply the optimal number of robots for the given work area as described earlier. This would further parallelize the task and enable task completion in shorter time despite any limitations in design. Given higher power rovers, the robots could conceivably achieved the required goal map in shorter time. Nevertheless our results show that a simple simulation environment, with low-cost proof of concept vision hardware is sufficient to demonstrate the critical behaviors. Table~\ref{tb:excavate_metric} shows nearly 70\% of the area is excavated towards the goal depth or material dumped to correct regions according to the goal map, while nearly 24\% had material accumulated incorrectly (either regolith dumped at locations where it is suppose to be dug out or regolith dug out where it is to dumped). These results were achieved with low cost vision hardware, principally webcams and single-pixel laser rangers. The results suggest that the robot controllers correctly interpret and follow the goal map on most occasions. However a series of real world conditions imparts some error to the results particularly in dumping regolith off away from the dumping areas due to drift errors. This provides 1-3 cm error in position of the dumping areas. This accounts for a significant portion of the error. These drift errors while lowering fitness metrics are actually not a major concern for field applications. These field experiments would suggest we introduce some margin distance between critical boundaries that can be easily included into the blueprints. Other factors that contributed to errors in the experiments, include the overhead system at times loosing track of robot position. \begin{table*}[t!] \caption{Field Experiment Metrics } \label{tb:excavate_metric} \vspace{2pt} \centering \footnotesize{ \begin{tabular}{c l } \hline {\bf Area} & {\bf System Response} \\ \hline\hline 72\% & Correctly Excavated towards Goal Depth \\ 24\% & Above Goal Depth \\ 4\% & Indeterminate \\ \hline \end{tabular}} \end{table*} The field experiments show several creative behaviors discovered by the controllers in solving the task. This includes correctly reading templates and cues in the environment such as the excavation blueprint, rocking and obstacle avoidance behaviors. The controllers evolve rocking behavior to get unstuck, a method of going back and forth to dislodge itself from sand traps and deep `pot holes.' In this scenario, the controller learns to stop repeated excavation moves and `back out' when it is unfruitful to dig or when the robot is stuck moving forward (Figure~\ref{fig:stuck_impressive}). This is accomplished using the memory variable to represent the `stuck state' and prevent repeated attempts at digging. In addition, the controllers evolve obstacle avoidance/negotiation behavior. Figure~\ref{fig:obstacle_avoidance} shows video snapshots of this behavior. Two robots are attempting to excavate and push dirt towards the dumping area. In frame 1, the robot in front (b) makes a left turn but is in the way of robot (a). Robot (b) backs out and scans in front (frame 2). It detects robot (a) and backs up further (frame 3). In frame 4, robot (b) attempts to move forward assuming the path is clear and stops having detected robot (a). In frame 5, robot (b) backs up again, makes a right turn and moves forward facing the dumping area as originally intended. The obstacle avoidance behaviours from high-fidelity simulations and hardware experiments show that the robots avoid dumping soil on or next to each other preventing the robots from getting stuck. This suggests the controllers use proximity sensing to avoid such actions. \begin{figure} [H] \centering \includegraphics[width=3.25in]{hardware_sim} \caption{Fitness during a typical excavation run of an ANT controller evolved using 4 robots ($8 \times 8$ area) applied to 2 robots on the training simulator and real robots.} \label{fig:hardware_sim} \end{figure} \begin{figure} [H] \centering \includegraphics[width=6.2in]{digging_progress} \caption{An overhead laser scan showing the difference in soil height before and after the excavation experiment.} \label{fig:dig_progress} \end{figure} \begin{figure} [H] \centering \includegraphics[width=6.2in]{ground_map_new} \caption{Photo of the work site after excavation (left). Mounds of dirt (berms) highlighted. 3-D Laser scan of worksite with berms highlighted (right).} \label{fig:ground_photo} \end{figure} \begin{figure} [H] \centering \includegraphics[width=4.0in]{stuck_impressive} \caption{Video snapshots of the stuck avoidance behavior, including a rocking behavior followed by a `backout' behavior triggered after the robot gets stuck trying to push the blade forward.} \label{fig:stuck_impressive} \end{figure} \begin{figure} [H] \centering \includegraphics[width=6.2in]{obstacle_avoidance} \caption{ANT controllers evolve obstacle avoidance/negotation behaviors.} \label{fig:obstacle_avoidance} \end{figure} These field experiments demonstrate proof-of-concept feasibility of applying ANT on multirobot excavation for lunar applications using low-cost vision hardware consisting of webcams and laser range finder. However significant work remains, particularly in demonstrating large-scale excavation. Work is underway in developing a team of large excavation robots for a field demonstration. Another solution is to use other excavation implements such as a bucket wheel or front loaders and is being actively explored using this approach. \section{Conclusion} The ``Artificial Neural Tissue'' (ANT) framework, a neural network approach to robotic control has been applied to multirobot excavation. Using this approach we show the feasibility of using multirobot excavation for site preparations tasks. The approach shows improved performance and scalability than conventional neural networks and hand coded solutions. This facilitates finding creative behaviors that are not specified or encouraged by an experimenter. These creative behaviors verified in hardware include correctly interpreting blueprints, performing layered digging, obstacle avoidance and rocking behaviors to avoid getting stuck. This approach is shown to produce controllers that have improved scalability compared to conventional neural networks and hand-coded solutions.Furthermore, ANT can simultaneously evolve the desired controller and select for optimal number of robots for the task. This approach is shown as a possible solution to the problem of antagonism in decentralized multirobot control. This approach shows that a machine learning method such as ANT is a machine driven process to develop creative yet effective deterministic methods for multirobot excavation. ANT evolves efficient excavation methods such as slot dozing that would otherwise require experts. This is important in space operations, where the space system operational engineer may not be a excavation expert. It is fair to say ANT is unlikely to outperform a trained excavation vehicle operator in the field. But the ability for the an autonomous algorithm to approach that capability is significant for off world excavation, where it is prohibitively expensive to send a full team of astronauts to perform excavation. The proposed approach would rely on combination of teleoperation and autonomous control to perform excavation. The proposed approach would automate mundane excavation and regolith moving tasks. There would however be an important need for oversight, where a teleoperator monitors the excavation process and intervenes when there is unexpected failures in the field. Thanks to the use of the proposed autonomous control approach to perform most of the time consuming and mundane tasks, this can reduce the number of teleoperators and also reduce fatigue due to communication latency. However significant work is required in infusing teleoperation based control with autonomous control. Future work is planned for full field excavation experiments using multiple robots. This work will combine both teleoperation and autonomous control. The proposed approach requires effective methods of surveying and localization to position the excavator and achieve correct dimensions of features in the work site. Our experiments demonstrate use of overhead cameras to perform localization. Use of overhead cameras is a viable approach on the moon. In addition, radio beacons may also be used for localization. Overall, the proposed approach shows a credible pathway towards lunar excavation, ISRU and base construction. Further work is needed in fusing teloperation with proposed autonomous controls approach. Challenges remain in scaling up the rovers and localization system to an appropriate size for a representative field demonstration. \subsection{Acknowledgements} This research has been supported by Natural Science and Engineering Research Council of Canada, NORCAT and EVC. The authors would gratefully acknowledge the contribution of Dale Boucher of NORCAT and Jim Richards of EVC. The authors would like to thank the reviewers for helping better identify the strengths and weaknesses in the proposed approach. \bibliographystyle{apalike}
{'timestamp': '2017-01-09T02:06:35', 'yymm': '1701', 'arxiv_id': '1701.01657', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01657'}
arxiv
\section{Introduction} Information retrieval deals with the task of \textit{retrieving}, or in simple words, obtaining relevant and necessary information resources from a huge collection of documents. The information obtained is considered relevant according to a piece of information asked about (also known as \textit{query}) \cite{zhai2016text}. The use of information retrieval has been fundamental for developing search engines. But there are many other interesting applications such as recommendation systems, spam filtering, plagiarism detection and so on \cite{Manning:2008:IIR:1394399}. Ranked information retrieval use ranking functions which determine the decreasing order of the documents in relevance to the query. \newcite{zhai2016text} lay down the in-depth analysis of variety of ranking functions used in information retrieval. Common features used in the information retrieval are term frequency, inverse document frequency and length normalization. TF-IDF (Term Frequency and Inverse Document Frequency) is a prevalent vector-space information retrieval technique. It balances the similarity of the query and the document, and penalizes the common terms \cite{tfidf}. Pivoted document length normalization with TF-IDF helps to reward shorter documents \cite{pl}. Okapi BM25 is a complex version of pivoted length normalization and it is the prevailing state-of-the-art retrieval method \cite{bm25}. PL2 is a retrieval model based on divergence from randomness of the query term frequency \cite{PL2}. Dirichlet Prior based retrieval is based on language modeling where the smoothing function is derived from Dirichlet distribution \cite{dirich}. MPtf2ln and MDtf2ln are improvements on previous methods and more elaborate ranking functions which balances the extremities of normalization effects \cite{Fang}. \newcite{Fang} also lay down certain guidelines to evaluate the behavior of the ranking functions. This paper analyses the feature engineering concepts in the information retrieval, especially length normalization. The objective of this paper are: \begin{itemize} \item to give general guidelines of general structure and nature of feature which can be included in the ranking function. (Section 2) \item to study the existing work which use information retrieval in recommendation systems. (Section 3) \item to prepare an unstructured textual dataset for penpal recommendation system. (Section 4) \item to analyze the dataset and apply the general guidelines to construct the feature for penpal recommendation system. (Section 5) \item to test and compare the constructed function against other ranking functions. (Section 6) \end{itemize} \section{Guidelines for Feature Engineering in Ranking Functions} The main idea of the information retrieval systems is to include a proximity score in conjunction to the ranking function. A proximity score is an application-dependent score, like page-rank metrics, contextual similarity and so on. The function should have well engineered feature embedded in itself and it should be able to generalize other results. The objectives of the ranking function are: \begin{itemize} \item The score should be higher if the constituents of proximity score (real numbers or vectors) are similar. \item The proximity score should be below certain cut-off scores. These cut-off scores or limiting parameters can be determined through machine learning. \item The function should behave similar and able to generalize the behavior and working of the existing ranking functions in IR. \end{itemize} The assumption is taken that modeled function is bi-modal (as one has to consider extremities of the cut-off scores). Let $f(\mathbf{x}, \mathbf{y})$ be the modeled function, where $\mathbf{x}$ and $\mathbf{y}$ be the constituent vectors. In other words, this function determines similarity between $\mathbf{x}$ and $\mathbf{y}$ and it is a function of $d(\mathbf{x})$ and $d(\mathbf{y})$ where $d(\cdot)$ is the distance metric. Length normalization functions, especially in the BM25 or pivoted length function are inversely proportional to the to the TF-IDF score. Thus, the model would be $f(\mathbf{x}, \mathbf{y})$ inversely proportional to the TF-IDF score. \begin{equation*} TF-IDF(q, d) \propto \frac{1}{f(\mathbf{x}, \mathbf{y})} \end{equation*} \subsection{Nature of the Function Curve} \begin{figure}[h] \centering \includegraphics[width=0.43\textwidth]{Graph1.png} \caption{Rough Sketch of Feature Curve} \label{sketch} \end{figure} Since the function has to be bi-modal distribution, distribution function would be modeled in the form asymmetrical inverted bell curve. Thus the trough of the curve should occur when distances of $\mathbf{x}$ and $\mathbf{y}$ are similar. In other words, \begin{equation} \label{c1} \frac{\partial f(\mathbf{x}, \mathbf{y})}{\partial ( d(\mathbf{x}) )} = 0 \text{ if } d(\mathbf{x}) \approx d(\mathbf{y}) \end{equation} Similarly it can be shown that, \begin{equation*} \frac{\partial f(\mathbf{x}, \mathbf{y})}{\partial (d(\mathbf{y}))} = 0 \text{ if } d(\mathbf{x}) \approx d(\mathbf{y}) \end{equation*} From here onwards, arguments would be taken from the $d(\mathbf{x})$ perspective, as $d(\mathbf{y})$ would have similar arguments. The function should decrease monotonically if $d(\mathbf{x}) < d(\mathbf{y})$. In other words, \begin{equation} \label{c2} \frac{\partial f(\mathbf{x}, \mathbf{y})}{\partial ( d(\mathbf{x}) )} < 0 \text{ if } d(\mathbf{x}) < d(\mathbf{y}) \end{equation} The function should increase monotonically if $d(\mathbf{x}) > d(\mathbf{y})$. In other words, \begin{equation} \label{c3} \frac{\partial f(\mathbf{x}, \mathbf{y})}{\partial ( d(\mathbf{x}) )} > 0 \text{ if } d(\mathbf{x}) > d(\mathbf{y}) \end{equation} \subsection{Nature of the Limits of the Curve} Here the left extremity of the curve could be bounded to the parameter $b_1$. \begin{equation} \label{c4} \lim_{d(\mathbf{x})\to 0} f(\mathbf{x}, \mathbf{y}) = b_1 \end{equation} Similarly, the right extremity of the curve could be bounded to the parameter $b_2$. \begin{equation} \label{c5} \lim_{d(\mathbf{x})\to \infty} f(\mathbf{x}, \mathbf{y}) = b_2 \end{equation} The trough of the curve exists when $\frac{\partial f(\mathbf{x}, \mathbf{y})}{\partial ( d(\mathbf{x}) )} = 0$. Thus the limit is set to 1. It can not be set it to 0, because $f(\mathbf{x}, \mathbf{y})$ lies in the denominator of the scoring function. \begin{equation} \label{c6} \lim_{d(\mathbf{x})\to d(\mathbf{y})} f(\mathbf{x}, \mathbf{y}) = 1 \end{equation} The specific case of these guidelines can be applied to the recommendation systems. \section{Information Retrieval in Recommendation Systems} Not many efforts have been carried out which use ranking functions in recommendation systems. Most of the recommendation systems use latent Dirichlet allocation (LDA) or collaborative filtering. \newcite{nextgen} give a more comprehensive study of existing research work on recommendation systems. Some recommendation systems have experimented with ranking functions. However, all of them did not tune the parameters correctly. The systems which deploy IR functions, have generally used extremely well-structured data like tags \cite{course} or contextual variables \cite{Kwon}. \textbf{Tag-based systems :} These systems have concatenated the tags of an user into a single \textit{document}. Relevant proximity is determined through similarity between \textit{query} and tags. This idea has used to develop music-recommendation systems \cite{Cantador,Bellogin}. The cosine similarity between BM25 value of user profile tags and item profile tags produced the best results. This leads to conclusion that BM25 outperforms other functions because BM25 penalizes common tags and focuses on rare terms \cite{Cantador}. The effects of length normalization are not discussed. More evaluation metrics have been introduced to evaluate the ranking functions \cite{Bellogin}. Results concluded that collaborative filtering methods have more novel and diverse recommendations and ranking functions have more coverage and better accuracy. TF-IDF outperforms BM25 but the parameters of BM25 have not been tuned. \textbf{Publication-recommendation systems :} Some publication-recommendation systems have used ranking functions \cite{twitter}. Concept Frequency Inverse Document Frequency (CF-IDF) and Hierarchical CF-IDF (HCF-IDF) have been utilized which generally assign weights on certain pre-determined words in the documents. The results showed that CF-IDF combined with sliding window produced the best results. Surprisingly, it outperforms the popular LDA method. Another publication-recommender system have used information retrieval elements \cite{Totti}. Here citation context (TF-IDF similarity between two papers), query similarity (TF-IDF similarity between query and article) and age decay (to penalize older articles) have been considered as parameters. This experiment also showed that it surpasses the system that uses page-rank like metrics. \textbf{Recommendation systems that use unstructured data:} \newcite{Suchal} and \newcite{Esparza} have used unstructured textual data in the recommendation system designs. Users' choices have been concatenated into a single query which is used to recommend articles \cite{Suchal}. Movie recommendation has also been evaluated with ranking functions \cite{Esparza}. Tags and reviews of movies are served as an TF-IDF component. Reviews tend to have better performance than tags because unstructured nature of reviews provide some noise and undiscovered information as opposed to structured data like tags. This results high IDF values. Thus unstructured textual data is a suitable advantage. According to the results, BM25 underperformed against TF-IDF algorithm. This happened because parameters have not been tuned according to the dataset. \newcite{Esparza} also demonstrated that ranking functions perform better than collaborative filtering algorithms. The main conclusions from this literature survey are: \begin{enumerate} \item Ranking functions tend to perform better than well-known recommendation system algorithms like LDA and collaborative filtering. \item Unstructured data provides certain amount of noise which is helpful for ranking function parameters. \item Effects of length normalization on recommendation system have not been studied. \end{enumerate} \section{Penpal Recommendation System and Dataset Preparation} Penpal (online friends) recommendation system was set up from the online users. 630 users were asked about their interests, likes and relationships. Few volunteers helped in assessing in the matching of the penpals. Since every respondent was exclusively assigned one penpal, thus it gave 315 pairs as a result. The response of the user was concatenated into a single sample or \textit{document}. Hence the recommendation system situation was there for textual data for 630 users. MeTA \cite{massung2016meta} toolkit was employed in the codebase of this project. Preprocessing on the data was done with the stopword removal, tokenization and lemmatization. The dataset was divided into two parts: \begin{itemize} \item \textbf{Training set} : Text data of 504 samples (252 pairs) \item \textbf{Testing set} : Text data of 126 samples (63 pairs) \end{itemize} Average document length of the training set is 131 words. The observations followed that assessors paired up users whose response contained fewer words and similar interests (Table \ref{table}). Similar process was carried out for users having lengthy responses and similar interests. This may be due to the reason that user who is writing lesser words in the response form is less interested in having a penpal. Thus text similarity and length similarity plays a major role in penpal recommendation. \begin{table}[h] \begin{tabu} to 0.5\textwidth { | X[l] | X[c] | } \hline \bf Description & \bf Number of Pairs \\ \hline Total Pairs in Training Dataset & 252 \\ \hline Pairs matched with both document's length less than the average document length & 62\\ \hline Pairs matched with both document's length than the average document length & 131\\ \hline Others matches & 53\\ \hline \end{tabu} \caption{\label{table} Document length characteristics in the training dataset } \end{table} \section{Feature Engineering} Here, the function would be modeled using Richard's curve. The curve is defined by, \begin{equation} g(x) = l + \frac{u - l}{(A + e^{{-B(x-M)}})^{{1/\nu }}} \end{equation} Here, $l$ is lower limit, $u$ is upper limit and $M, \nu, A, B$ are free parameters The distance metrics are taken to be just real numbers. Thus, $d(\mathbf{x}) = x$ and $d(\mathbf{y}) = y$. The trough of the curve should occur when, $d(\mathbf{x}) = d(\mathbf{y})$ or $x = y$. The function can be partitioned into three parts: \begin{itemize} \item monotonically decreasing Richard's curve, $g(x)$ when $x < y$ \item monotonically increasing Richard's curve, $g(x)$ when $x > y$ \item Value of heuristic function, $h(x, y) = 1$ when $x = y$ \end{itemize} The definition of the function now looks like: \begin{equation} h(x, y) = \begin{cases} g(x_1) & \quad \text{if } x < y\\ 1 & \quad \text{if } x = y\\ g(x_2) & \quad \text{if } x > y\\ \end{cases} \end{equation} where $x_1 \in [0, y]$, $x_2 \in [y, \infty]$ and $x_1, x_2 \subset x$ Applying equation (\ref{c1}), the constraint obtained is: \begin{equation*} \frac{\partial h(x, y)}{\partial x}\at[\bigg]{x=y} = 0 \end{equation*} From equation (\ref{c2}), the constraint obtained is: \begin{equation*} \frac{\partial g(x_1)}{\partial x_1} < 0 \end{equation*} From equation (\ref{c3}), the constraint obtained is: \begin{equation*} \frac{\partial g(x_2)}{\partial x_2} > 0 \end{equation*} From limiting condition (\ref{c4}), the constraint obtained is: \begin{align*} \lim_{x_1 \to 0} g(x_1) &= b_1 \\ \frac{\partial g(x_1)}{\partial x_1}\at[\bigg]{x_1 = 0} &\approx 0 \end{align*} From the limiting condition (\ref{c5}), the constraint obtained is: \begin{align*} \lim_{x_2 \to \infty} g(x_2) &= b_2 \\ \frac{\partial g(x_2)}{\partial x_2}\at[\bigg]{x_2 = \infty} &\approx 0 \end{align*} From the limiting condition (\ref{c6}), the constraint obtained are: \begin{align*} \frac{\partial g(x_1)}{\partial x_1}\at[\bigg]{x_1 = y} &\approx \frac{\partial g(x_2)}{\partial x_2}\at[\bigg]{x_2 = y} &\approx 0 \\ \lim_{x_1 \to y} g(x_1) &= \lim_{x_2 \to y} g(x_2) &= 1 \end{align*} After solving the constraints, and using the binomial approximation for small $\nu$, the solutions obtained are: \begin{equation} h(x, y) = \begin{cases} 1 + \frac{b_1 - 1}{1 + e^{B_1(x - cy)}} & \quad \text{if } x < y\\ 1 & \quad \text{if } x = y\\ 1 + \frac{b_2 - 1}{1 + e^{-B_2(x - (1 + c)y)}} & \quad \text{if } x > y\\ \end{cases} \end{equation} where, \begin{itemize} \item $B_1$ and $B_2$ are growth parameters, can be typically set to 1 \item $c$ is the trough curvature, where $c \in (0, 1)$ \end{itemize} According to the requirements, length similarity would be rewarded between query and document lengths. In that case, $x = |d|$ and $y = |q|$. Intuitively, that means the value of the scoring function will be higher if $|d| \approx |y|$. Substituting the values, we get: \begin{equation} h(|d|, |q|) = \begin{cases} 1 + \frac{b_1 - 1}{1 + e^{B_1(|d| - c|q|)}} & \text{if } |d| < |q|\\ 1 & \text{if } |d| = |q|\\ 1 + \frac{b_2 - 1}{1 + e^{-B_2(|d| - (1 + c)|q|)}} & \text{if } |d| > |q|\\ \end{cases} \end{equation} The nature of this feature can be plotted as shown against various parameters (Figure \ref{nature}). It can be seen that it closely resembles the desired graph. \begin{figure}[h] \centering \includegraphics[width=0.48\textwidth]{test.pdf} \caption{The nature of $h(|d|, |q|)$ with $B_1 = 1$, $B_2 = 1$ and $c = 0.5$} \label{nature} \end{figure} This feature can now be substituted in the ranking function in place of length normalization function. For example, the original BM25 function is: \begin{align*} score(q, d) = & \sum_{t \in d \cap q} f(t, q) \log \frac{M + 1}{df(t)} \times \\ & \frac{ (k + 1) f (t, d) }{f(t, d) + k \left( 1 - b + b \frac{|d|}{avgdl} \right)} \end{align*} The normalization feature $\left( 1 - b + b \frac{|d|}{avgdl} \right)$ in the BM25 formula can be replaced with $h(|d|, |q|)$ to get our desired ranking function: \begin{equation} \label{heuris} \begin{aligned} score(q, d) = & \sum_{t \in d \cap q} f(t, q) \log \frac{M + 1}{df(t)} \times \\ & \frac{ (k + 1) f (t, d) }{f(t, d) + k \left( h(|d|, |q|) \right)} \\ \end{aligned} \end{equation} \section{Results and Conclusions} The relevant feedback of the dataset is limited. The human assessors have provided only one relevant document for one query. Thus, only MRR (Mean Reciprocal Rank) is used to assess the models. \begin{equation} MRR = \frac{1}{s} \sum_{i = 1}^s \frac{1}{rank_i} \end{equation} Here $s$ is the size of the dataset and $rank_i$ is the position of the rank for the first relevant document of the $i^{th}$ query. The parameters of the baseline algorithms were tuned according to the training dataset and tested on the test set using MRR. \begin{table}[H] \begin{center} \begin{tabular}{ | m{2.56cm} | m{1.5cm}| m{1.5cm} | } \hline \textbf{Model} & \textbf{Training Set MRR} & \textbf{Testing Set MRR} \\ \hline Length Similarity Heuristic with BM25 & 0.34 & 0.29 \\ \hline BM25 & 0.24 & 0.19 \\ \hline Pivoted Length Normalization & 0.22 & 0.18 \\ \hline MPtf2ln & 0.21 & 0.18 \\ \hline MDtf2ln & 0.19 & 0.16 \\ \hline PL2 & 0.17 & 0.15 \\ \hline Dirichlet Prior & 0.16 & 0.13 \\ \hline \end{tabular} \caption{Mean reciprocal rank (MRR) values on the data-set using various retrieval methods} \label{results} \end{center} \end{table} The obtained MRR values have been given in (Table \ref{results}). The proximity feature has outperformed by 52 \% from regular BM25. It can be observed that query-document length similarity, not document length normalization has helped in this situation. \begin{table}[H] \centering \begin{tabular}{|c|c|} \hline \multicolumn{1}{|c|}{\textbf{Parameter}} & \multicolumn{1}{c|}{\textbf{Value}} \\ \hline k (BM25 parameter) & 2.8 \\ \hline $b_1$ (Left Bound) & 2.9 \\ \hline $b_2$ (Right Bound) & 3.7 \\ \hline $B_1$ (Growth parameter) & 1 \\ \hline $B_2$ (Growth parameter) & 1 \\ \hline c (Trough curvature) & 0.5 \\ \hline \end{tabular} \caption{Parameters used in similarity feature in BM25} \label{my-label} \end{table} The parameters used in similarity feature (Table \ref{my-label}) with BM25 show that $b_1$ and $b_2$ are tuned around 3 and 4. This means that the magnitude of TF-IDF value is penalize around 3 or 4 times when the lengths are dissimilar. Further work is to be carried out by using more evaluation tests, creating a better dataset, giving proofs for generalization and applying the algorithm into more applications like spelling correction.
{'timestamp': '2017-01-06T02:07:00', 'yymm': '1701', 'arxiv_id': '1701.01417', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01417'}
arxiv
\section{Introduction}\label{section:introduction} \input{sections/introduction} \section{Model}\label{section:model} \input{sections/model} \section{Cross-lingual parsing}\label{section:multilingual} \input{sections/multilingual} \section{Experiments}\label{section:experiments} \input{sections/experiments} \subsection{Results}\label{section:results} \input{sections/results} \section{Discussion}\label{section:discussion} \input{sections/discussion} \section{Related Work}\label{section:related} \input{sections/related} \section{Conclusion} \input{sections/conclusion} \section*{Acknowledgments} The second author was supported by ERC Starting Grant No. 313695. \bibliographystyle{eacl2017} \subsection{Model selection and training} Our features consist of $500$-dimensional word embeddings trained on translations of the Bible. The word embeddings were trained using skipgram with negative sampling on a word-by-sentence PMI matrix induced from the Edinburgh Bible Corpus, following \cite{DBLP:journals/corr/LevySG16}. Our embeddings are not trainable, but fixed representations throughout the learning process. Unknown tokens were represented by zero-vectors. We combined the word embeddings with one-hot-encodings of POS-tags, projected across word alignments following the method of \newcite{agic2016parsing}. To verify the value of the POS-features, we conducted preliminary experiments on English development data. When including POS-tags, we found small, non-significant improvements for monolingual parsing, but significant improvements for cross-lingual parsing. The weights were initialized using the normalized values suggested in \newcite{glorot2010understanding}. Following \newcite{jozefowicz2015empirical}, we add $1$ to the initial forget gate bias. We trained the network using RMSprop \cite{tieleman2012lecture} with hyperparameters $\alpha = 0.1$ and $\gamma = 0.9$, using minibatches of 64 sentences. Following \newcite{neelakantan2015adding}, we added a noise factor $n \sim \mathcal{N}(0,\frac{1}{(1 + t)^{0.55}})$ to the gradient in each update. We applied dropouts after each LSTM-layer with a dropout probability $p=0.5$, and between the input layer and the first LSTM-layer with a dropout probability of $p=0.2$ \cite{bluche2015apply}. As proposed in \newcite{pascanu2012difficulty}, we employed a gradient clipping factor of $15$. In the monolingual setting, we used early stopping on the development set. We experimented with 10, 50, 100, and 200 hidden units per layer, and with up to 6 layers. Using greedy search on monolingual parsing and evaluating on the English development data, we determined the optimal network shape to contain $100$ units per direction per hidden layer, and a total of $4$ layers. \begin{figure} \centering \begin{tikzpicture}[scale=0.85] \begin{axis}[ xlabel=Epochs, ylabel=UAS, legend style={at={(0.29,0.05)},anchor=south west} ] \addplot[color=blue,mark=square] table[x=Iteration,y=Xent-5] {Data/5v10.dat}; \addplot[color=red,mark=triangle] table[x=Iteration,y=L2-5] {Data/5v10.dat}; \addplot[color=green,mark=x] table[x=Iteration,y=Xent-10] {Data/5v10.dat}; \addplot[color=cyan,mark=*] table[x=Iteration,y=L2-10] {Data/5v10.dat}; \legend{Cross entropy at 5000, Mean squared at 5000, Cross entropy at 10000, Mean squared at 10000} \end{axis} \end{tikzpicture} \caption{UAS per epoch on German development data training from 5000 or 10000 randomly sampled sentences with projected annotations.} \label{figure:5000-vs-10000} \end{figure} For the cross-lingual setting, we used two additional hyper-parameters. We used the development data from one of our target languages (German) to determine the optimal number of epochs before stopping. Furthermore, we trained only on a subset of the projected sentences, choosing the size of the subset using the development data. We experimented with either $5000$ or $10000$ randomly sampled sentences. There are two motivating factors behind this subsampling. First, while the Bible in general consists of about $30000$ sentences, for many low-resource languages we do not have access to annotation projections for the full Bible, because parts were never translated, and because of varying projection quality. Second, subsampling speeds up the training, which was necessary to make our experiments practical: At $10000$ sentences and on a single GPU, each epoch takes approximately $2.5$ hours. As such, training for a single language could be completed in less than a day. We plot the results in Figure \ref{figure:5000-vs-10000}. We see that the best performance is achieved at $10000$ sentences, and with respectively $6$ and $5$ epochs for cross entropy and mean squared loss.
{'timestamp': '2017-01-09T02:05:34', 'yymm': '1701', 'arxiv_id': '1701.01623', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01623'}
arxiv
\section{Introduction} With the rapid growth of video data, there is an increasing need not only for recognition of objects and their behaviour, but in particular for detecting the rare, interesting occurrences of unusual objects or suspicious behaviour in the large body of ordinary data. Finding such abnormalities in videos is crucial for applications ranging from automatic quality control to visual surveillance. Meaningful events that are of interest in long video sequences, such as surveillance footage, often have an extremely low probability of occurring. As such, manually detecting such events, or anomalies, is a very meticulous job that often requires more manpower than is generally available. This has prompted the need for automated detection and segmentation of sequences of interest. However, present technology requires an enormous amount of configuration efforts on each video stream prior to the deployment of the video analysis process, even with that, those events are based on some predefined heuristics, which makes the detection model difficult to generalize to different surveillance scenes. Video data is challenging to represent and model due to its high dimensionality, noise, and a huge variety of events and interactions. Anomalies are also highly contextual, for example, running in a restaurant would be an anomaly, but running at a park would be normal. Moreover, the definition of anomaly can be ambiguous and often vaguely defined. A person may think walking around on a subway platform is normal, but some may think it should be flagged as an anomaly since it could be suspicious. These challenges have made it difficult for machine learning methods to identify video patterns that produce anomalies in real-world applications. There are many successful cases in the related field of action recognition \cite{tran2016,jia2014,ji2013,oneata2013}. However, these methods only applicable to labelled video footages where events of interest are clearly defined and does not involve highly occluded scenes, such as crowded scenes. Furthermore, the cost of labelling every type of event is extremely high. Even so, it is not guaranteed to cover every past and future events. The recorded video footage is likely not long enough to capture all types of activities, especially abnormal activities which rarely or never occurred. Recent effort on detecting anomalies by treating the task as a binary classification problem (normal and abnormal) \cite{zhou2016} proved it being effective and accurate, but the practicality of such method is limited since footages of abnormal events are difficult to obtain due to its rarity. Therefore, many researchers have turned to models that can be trained using little to no supervision, including spatiotemporal features \cite{lu2013,zhao2011}, dictionary learning \cite{yen2013} and autoencoders \cite{sabokrou2015}. Unlike supervised methods, these methods only require unlabelled video footages which contain little or no abnormal event, which are easy to obtain in real-world applications. A description of these methodologies and their limitations are discussed in the next section. This paper presents a novel framework to represent video data by a set of general features, which are inferred automatically from a long video footage through a deep learning approach. Specifically, a deep neural network composed of a stack of convolutional autoencoders was used to process video frames in an unsupervised manner that captured spatial structures in the data, which, grouped together, compose the video representation. Then, this representation is fed into a stack of convolutional temporal autoencoders to learn the regular temporal patterns. Our proposed method is domain free (i.e., not related to any specific task, no domain expert required), does not require any additional human effort, and can be easily applied to different scenes. To prove the effectiveness of the proposed method we apply the method to real-world datasets and show that our method consistently outperforms similar methods while maintaining a short running time. \subsection{Our Contributions} The main characteristics of our approach and also the contributions of this research are as follows: \begin{itemize} \item We wish to reduce the labor-intensive effort in feature engineering that results in a representation of the data that can support effective machine learning. This can be done by replacing low-level handcrafted features with learned hierarchical features. With the help of autoencoders, we are able to find representative features by learning from data instead of forming suitable features based on our knowledge.\\ \item We replace traditional sparse coding methods with autoencoders. Unlike existing methods, there is no separation between extracting feature representation of videos and learning a model of features. In addition, by having multiple layers of hidden units in autoencoder, hierarchical feature learning can be achieved. \end{itemize} \section{Related Work} Most of these abnormal instances are beforehand unknown, as this would require predicting all the ways something could happen out of the norm. It is therefore simply impossible to learn a model for all that is abnormal or irregular. But how can we find an anomaly without what to look for? Since it is easier to get video data where the scene is normal in contrast to obtaining what is abnormal, we could focus on a setting where the training data contains only normal visual patterns. A popular approach adopted by researchers in this area is to first learn the normal patterns from the training videos, then anomalies are detected as events deviated from the normal patterns \cite{lu2013,cong2011,zhao2011,li2011}. The majority of the work on anomaly detection relies on the extraction of local features from videos, that are then used to train a normalcy model. Trajectories have long been popular in video analysis and anomaly detection \cite{zhou2015,li2011,piciarelli2008,mo2014}. A common characteristic of trajectory-based approaches is the deviation of nominal classes of object trajectories in a training phase, and the comparison of new test trajectories against the nominal classes in an evaluation phase. A statistically significant deviation from all classes indicates an anomaly. However, the accuracy of trajectory analysis relies heavily on tracking, which precise tracking still remains a significant challenge in computer vision, particularly in complex situations. Tracking-based approaches are suitable for scenes with few objects but are impractical for detecting abnormal patterns in a crowded or complex scene. Non-tracking approaches that focus on spatiotemporal anomalies in videos also exist. These rely mainly on extracting and analyzing local low-level visual features, such as the histogram of oriented gradients \cite{xiao2015}, the histogram of oriented flows \cite{laptev2008} and optical flow \cite{reddy2011}, by employing spatiotemporal video volumes (dense sampling or interest point selection) \cite{dollar2005}. These local features are then grouped in clusters, i.e., bags of visual words (BOV), according to similarity metrics. Their popularity is due to their low computational cost, as well as their ability to focus on abnormal behaviour, even in extremely crowded scenes \cite{kratz2009}. Another similar technique is sparse reconstruction \cite{cong2011,zhao2011}. The fundamental underlying assumption of these methods is that any new feature representation of a normal/anomalous event can be approximately modeled as a (sparse) linear combination of feature representations (of previously observed events) in a trained dictionary. This assumes that all previously observed events are normal events. However, since classical BOV approaches group similar volumes (summarize), they destroy all compositional information in the process of grouping visual words. It is also required to pre-determine the number of clusters, which can only be found through trial-and-error during testing time. In addition, codebook models require searching over a large space \cite{roshtkhari2013} even during the time of testing, making it impractical for real-time anomaly detection. The success of deep learning methods in various applications consequently caused the rise of such methods in anomaly detection. The term deep learning refers to learning a hierarchical set of features through multiple layers of hidden nodes in an artificial neural network. Unlike previously stated methods, there is no need to define a specific set of features to extract from the dataset -- deep learning methods learn the useful features directly from the data with minimal preprocessing. Specifically, convolutional neural networks (ConvNet) have proved its effectiveness in a wide range of applications such as object recognition \cite{simonyan2014obj}, person detection \cite{vu2016}, and action recognition \cite{tran2016,simonyan2014vid}. ConvNet consists of a stack of convolutional layers with a fully-connected layer and a softmax classifier, and convolutional autoencoder is essentially a ConvNet with its fully-connected layer and classifier replaced by a mirrored stack of convolutional layers. The authors of \cite{zhou2016} applied a 3D ConvNet on classifying anomalies, whereas \cite{hasan2016} used an end-to-end convolutional autoencoder to detect anomalies in surveillance videos. Their reported result proves the usefulness of learned representation on videos through a stack of convolutional layers. On the other hand, long short term memory (LSTM) model is well-known for learning temporal patterns and predicting time series data. \cite{medel2016} has recently proposed to apply convolutional LSTMs for learning the regular temporal patterns in videos and his findings show great promise of what deep neural network can learn. Despite its simplicity, some limitations remain in these recently proposed methods. Though 3D ConvNet performed excellently in learning discriminative features between the anomalies and the normal events, it is impractical to apply in real-world scenarios due to the absence of video segments containing abnormal events. Meanwhile, in the convolutional autoencoder proposed by \cite{hasan2016}, convolution and pooling operations are performed only spatially, even though the proposed network takes multiple frames as input, because of the 2D convolutions, after the first convolution layer, temporal information is collapsed completely \cite{tran2016}. Besides, convolutional LSTM layers applied by \cite{medel2016} are memory-intensive -- the training will need to be executed on very small mini-batches, which results in slow training and testing time. \section{Methodology} The method described here is based on the principle that when an abnormal event occurs, the most recent frames of video will be significantly different than the older frames. Inspired by \cite{hasan2016}, we train an end-to-end model that consists of a spatial feature extractor and a temporal encoder-decoder which together learns the temporal patterns of the input volume of frames. The model is trained with video volumes consists of only normal scenes, with the objective to minimize the reconstruction error between the input video volume and the output video volume reconstructed by the learned model. After the model is properly trained, normal video volume is expected to have low reconstruction error, whereas video volume consisting of abnormal scenes is expected to have high reconstruction error. By thresholding on the error produced by each testing input volumes, our system will be able to detect when an abnormal event occurs. Our approach consists of three main stages: \subsection{Preprocessing} The task of this stage is to convert raw data to the aligned and acceptable input for the model. Each frame is extracted from the raw videos and resized to $227\times227$. To ensure that the input images are all on the same scale, the pixel values are scaled between 0 and 1 and subtracted every frame from its global mean image for normalization. The mean image is calculated by averaging the pixel values at each location of every frame in the training dataset. After that, the images are converted to grayscale to reduce dimensionality. The processed images are then normalized to have zero mean and unit variance. The input to the model is video volumes, where each volume consists of 10 consecutive frames with various skipping strides. As the number of parameters in this model is large, large amount of training data is needed. Following \cite{hasan2016}’s practice, we perform data augmentation in the temporal dimension to increase the size of the training dataset. To generate these volumes, we concatenate frames with stride-1, stride-2, and stride-3. For example, the first stride-1 sequence is made up of frame \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}, whereas the first stride-2 sequence contains frame number \{1, 3, 5, 7, 9, 11, 13, 15, 17, 19\}, and stride-3 sequence would contain frame number \{1, 4, 7, 10, 13, 16, 19, 22, 25, 28\}. Now the input is ready for model training. \subsection{Feature Learning} We propose a convolutional spatiotemporal autoencoder to learn the regular patterns in the training videos. Our proposed architecture consists of two parts --- spatial autoencoder for learning spatial structures of each video frame, and temporal encoder-decoder for learning temporal patterns of the encoded spatial structures. As illustrated in Figure \ref{fig:ours_spatial} and \ref{fig:ours_temporal}, the spatial encoder and decoder have two convolutional and deconvolutional layers respectively, while the temporal encoder is a three-layer convolutional long short term memory (LSTM) model. Convolutional layers are well-known for its superb performance in object recognition, while LSTM model is widely used for sequence learning and time-series modelling and has proved its performance in applications such as speech translation and handwriting recognition. \begin{figure} \centering \includegraphics[width=\textwidth]{ours_spatial} \caption{Our proposed network architecture. It takes a sequence of length T as input, and output a reconstruction of the input sequence. The numbers at the rightmost denote the output size of each layer. The spatial encoder takes one frame at a time as input, after which $T=10$ frames have been processed, the encoded features of 10 frames are concatenated and fed into temporal encoder for motion encoding. The decoders mirror the encoders to reconstruct the video volume.} \label{fig:ours_spatial} \end{figure} \begin{figure} \centering \includegraphics[width=4.5cm]{ours_temporal} \caption{The zoomed-in architecture at time $t$, where $t$ is the input vector at this time step. The temporal encoder-decoder model has 3 convolutional LSTM (ConvLSTM) layers. } \label{fig:ours_temporal} \end{figure} \subsubsection{Autoencoder} Autoencoders, as the name suggests, consist of two stages: encoding and decoding. It was first used to reduce dimensionality by setting the number of encoder output units less than the input. The model is usually trained using back-propagation in an unsupervised manner, by minimizing the reconstruction error of the decoding results from the original inputs. With the activation function chosen to be nonlinear, an autoencoder can extract more useful features than some common linear transformation methods such as PCA. \subsubsection{Spatial Convolution} The primary purpose of convolution in case of a convolutional network is to extract features from the input image. Convolution preserves the spatial relationship between pixels by learning image features using small squares of input data. Mathematically, convolution operation performs dot products between the filters and local regions of the input. Suppose that we have some $n \times n$ square input layer which is followed by the convolutional layer. If we use an $m \times m$ filter $W$, the convolutional layer output will be of size $(n-m+1) \times (n-m+1)$. A convolutional network learns the values of these filters on its own during the training process, although we still need to specify parameters such as the number of filters, filter size, the number of layers before training. With more number of filters we have, more image features get extracted and the better the network becomes at recognizing patterns in unseen images. However, more filters would add to computational time and exhaust memory faster, so we need to find balance by not setting the number of filters too large. \subsubsection{Recurrent Neural Network (RNN)} In a traditional feedforward neural network, we assume that all inputs (and outputs) are independent of each other. However, learning temporal dependencies between inputs are important in tasks involving sequences, for example, a word predictor model should be able to derive information from the past inputs. RNN works just like a feedforward network, except that the values of its output vector are influenced not only by the input vector but also on the entire history of inputs. In theory, RNNs can make use of information in arbitrarily long sequences, but in practice, they are limited to looking back only a few steps due to vanishing gradients. \subsubsection{Long Short Term Memory (LSTM)} To overcome this problem, a variant of RNN is introduced: long short term memory (LSTM) model which incorporates a recurrent gate called forget gate. With the new structure, LSTMs prevent backpropagated errors from vanishing or exploding, thus can work on long sequences and they can be stacked together to capture higher level information. The formulation of a typical LSTM unit is summarized with Figure \ref{fig:lstm} and equations (1) through (6). \begin{equation} f_t = \sigma(W_f \otimes [h_{t-1}, x_t] + b_f) \end{equation} \begin{equation} i_t = \sigma(W_i \otimes [h_{t-1}, x_t] + b_i) \end{equation} \begin{equation} \hat{C_t} = tanh(W_C \otimes [h_{t-1}, x_t] + b_C) \end{equation} \begin{equation} C_t = f_t \otimes C_{t-1} + i_t \otimes \hat{C_t} \end{equation} \begin{equation} o_t = \sigma(W_o \otimes [h_{t-1}, x_t] + b_o) \end{equation} \begin{equation} h_t = o_t \otimes tanh(C_t) \end{equation} Equation (1) represents the forget layer, (2) and (3) are where new information is added, (4) combines old and new information, whereas (5) and (6) output what has been learned so far to the LSTM unit at the next timestep. The variable $x_t$ denotes the input vector, $h_t$ denotes the hidden state, and $C_t$ denotes the cell state at time $t$. $W$ are the trainable weight matrices, $b$ are the bias vectors, and the symbol $\otimes$ denotes the Hadamard product. \begin{figure} \centering \includegraphics[height=6.2cm]{lstm_peephole} \caption{The structure of a typical LSTM unit. The blue line represents an optional ‘peephole’ structure, which allows the internal state to look back (‘peep’) at the previous cell state $C_{t-1}$ for a better decision. Best viewed in colour.} \label{fig:lstm} \end{figure} \subsubsection{Convolutional LSTM} A variant of the LSTM architecture, namely Convolutional Long Short-term Memory (ConvLSTM) model was introduced by Shi et al. in \cite{shi2015} and has been recently utilized by Patraucean et al. in \cite{patraucean2016} for video frame prediction. Compared to the usual fully connected LSTM (FC-LSTM), ConvLSTM has its matrix operations replaced with convolutions. By using convolution for both input-to-hidden and hidden-to-hidden connections, ConvLSTM requires fewer weights and yield better spatial feature maps. The formulation of the ConvLSTM unit can be summarized with (7) through (12). \begin{equation} f_t = \sigma(W_f \ast [h_{t-1}, x_t, C_{t-1}] + b_f) \end{equation} \begin{equation} i_t = \sigma(W_i \ast [h_{t-1}, x_t, C_{t-1}] + b_i) \end{equation} \begin{equation} \hat{C_t} = tanh(W_C \ast [h_{t-1}, x_t] + b_C) \end{equation} \begin{equation} C_t = f_t \otimes C_{t-1} + i_t \otimes \hat{C_t} \end{equation} \begin{equation} o_t = \sigma(W_o \ast [h_{t-1}, x_t, C_{t-1}] + b_o) \end{equation} \begin{equation} h_t = o_t \otimes tanh(C_t) \end{equation} While the equations are similar in nature to (1) through (6), the input is fed in as images, while the set of weights for every connection is replaced by convolutional filters (the symbol $\ast$ denotes a convolution operation). This allows ConvLSTM work better with images than the FC-LSTM due to its ability to propagate spatial characteristics temporally through each ConvLSTM state. Note that this convolutional variant also adds an optional 'peephole' connections to allow the unit to derive past information better. \subsection{Regularity Score} Once the model is trained, we can evaluate our model’s performance by feeding in testing data and check whether it is capable of detecting abnormal events while keeping false alarm rate low. To better compare with \cite{hasan2016}, we used the same formula to calculate the regularity score for all frames, the only difference being the learned model is of a different kind. The reconstruction error of all pixel values I in frame t of the video sequence is taken as the Euclidean distance between the input frame and the reconstructed frame: \begin{equation} e(t) = ||x(t) - f_W(x(t))||_2 \end{equation} where $f_W$ is the learned weights by the spatiotemporal model. We then compute the abnormality score $s_a(t)$ by scaling between 0 and 1. Subsequently, regularity score $s_r(t)$ can be simply derived by subtracting abnormality score from 1: \begin{equation} s_a(t) = \frac{e(t) - e(t)_{min}}{e(t)_{max}} \end{equation} \begin{equation} s_r(t) = 1 - s_a(t) \end{equation} \subsection{Anomaly Detection} \subsubsection{Thresholding} It is straightforward to determine whether a video frame is normal or anomalous. The reconstruction error of each frame determines whether the frame is classified as anomalous. The threshold determines how sensitive we wish the detection system to behave --- for example, setting a low threshold makes the system become sensitive to the happenings in the scene, where more alarms would be triggered. We obtain the true positive and false positive rate by setting at different error threshold in order to calculate the area under the receiver operating characteristic (ROC) curve (AUC). The equal error rate (EER) is obtained when false positive rate equals to the false negative rate. \subsubsection{Event count} Following the practice in \cite{hasan2016}, to reduce the noisy and unmeaningful minima in the regularity score, we applied Persistence1D \cite{pers1d} algorithm to group local minima with a fixed temporal window of 50 frames. We assume local minima within 50 frames belong to the same abnormal event. This is a reasonable length of the temporal window as an abnormal event should be at least 2-3 seconds long to be meaningful (videos are captured at 24-25 fps). \section{Experiments} \subsection{Datasets} We train our model on five most commonly used benchmarking datasets: Avenue \cite{lu2013}, UCSD Ped1 and Ped2 \cite{mahadevan2010}, Subway entrance and exit datasets \cite{adam2008}. All videos are taken from a fixed position for each dataset. All training videos contain only normal events. Testing videos have both normal and abnormal events. In Avenue dataset, there are total 16 training and 21 testing video clips. Each clip’s duration vary between less than a minute to two minutes long. The normal scenes consist of people walking between staircase and subway entrance, whereas the abnormal events are people running, walking in opposite direction, loitering and etc. The challenges of this dataset include camera shakes and a few outliers in the training data. Also, some normal pattern seldom appears in the training data. UCSD Ped1 dataset has 34 training and 36 testing video clips, where each clip contains 200 frames. The videos consist of groups of people walking towards and away from the camera. UCSD Ped2 dataset has 16 training and 12 testing video clips, where the number of frames of each clip varies. The videos consist of walking pedestrians parallel to the camera plane. Anomalies of the two datasets include bikers, skaters, carts, wheelchairs and people walking in the grass area. Subway entrance dataset is 1 hour 36 minutes long with 66 unusual events of five different types: walking in the wrong direction (WD), no payment (NP), loitering (LT), irregular interactions between people (II), and miscellaneous (e.g. sudden stop, running fast). First 20 minutes of the video is used for training. Subway exit dataset is 43 minutes long with 19 unusual events of three types: walking in the wrong direction (WD), loitering (LT), and miscellaneous (e.g. sudden stop, looking around, a janitor cleaning the wall, gets off the train and gets on the train again quickly. First 5 minutes of the video is used for training. \subsection{Model Parameters} We train the model by minimizing the reconstruction error of the input volume. We use Adam optimizer to allow it taking the role of setting the learning rate automatically based on the model’s weight update history. We use mini-batches of size 64 and each training volume is trained for a maximum of 50 epochs or until the reconstruction loss of validation data stop decreasing after 10 consecutive epochs. Hyperbolic tangent is chosen as the activation function of spatial encoder and decoder. To ensure the symmetry of the encoding and decoding function, we did not use rectified linear unit (ReLU) despite its regularization ability because activated values from ReLU have no upper bound. \subsection{Results and Analysis} \subsubsection{Quantitative Analysis: ROC and Anomalous Event Count} \begin{table}[] \centering \caption{Comparison of area under ROC curve (AUC) and Equal Error Rate (EER) of different methods. Higher AUC and lower EER are better. Most papers did not publish their AUC/EER for avenue, subway entrance and exit dataset.} \label{table:auc_eer} \begin{tabular}{M{2.3cm}M{1.8cm}M{1.8cm}M{1.8cm}M{1.8cm}M{1.8cm}} \hline \multirow{2}{*}{Method} & \multicolumn{5}{c}{AUC/EER (\%)} \\ \cline{2-6} & Ped1 & Ped2 & Avenue & \begin{tabular}[c]{@{}c@{}}Subway \\ Entrance\end{tabular} & \begin{tabular}[c]{@{}c@{}}Subway \\ Exit\end{tabular} \\ \cline{1-6} Adam \cite{adam2008} & 77.1/38.0 & -/42.0 & \multicolumn{3}{c}{\multirow{4}{*}{N/A}} \\ SF \cite{mehran2009} & 67.5/31.0 & 55.6/42.0 & \multicolumn{3}{c}{} \\ MPPCA \cite{mahadevan2010} & 66.8/40.0 & 69.3/30.0 & \multicolumn{3}{c}{} \\ MPPCA+SF \cite{mahadevan2010} & 74.2/32.0 & 61.3/36.0 & \multicolumn{3}{c}{} \\ HOFME \cite{wang2013} & 72.7/33.1 & 87.5/20.0 & N/A & 81.6/\textbf{22.8} & 84.9/17.8 \\ ConvAE \cite{hasan2016} & 81.0/27.9 & \textbf{90.0}/21.7 & 70.2/25.1 & \textbf{94.3}/26.0 & 80.7/9.9 \\ Ours & \textbf{89.9}/\textbf{12.5} & 87.4/\textbf{12.0} & \textbf{80.3}/\textbf{20.7} & 84.7/23.7 & \textbf{94.0}/\textbf{9.5} \\ \hline \end{tabular \end{table} Table \ref{table:auc_eer} shows the frame-level AUC and EER of our and of other methods on all five datasets. We outperform all other considered methods in respect to frame-level EER. We also provide the event count comparison for Avenue dataset and the entrance and exit scenes in the Subway dataset in Table 2. For the entrance scenes, we are better than \cite{hasan2016} since we detect the same number of anomalies with less false alarms. For the exit scenes, we detected more abnormal events compared to \cite{hasan2016} but at the expense of higher false alarm rate. \begin{table}[] \centering \caption{Anomalous event and false alarm count detected by different methods. GT denotes groundtruth values of event count.} \label{table:event_count} \begin{tabular}{@{}M{3.2cm}M{3cm}M{2.5cm}M{2.5cm}@{}} \toprule \multirow{2}{*}{Method} & \multicolumn{3}{c}{Anomalous Event Detected / False Alarm} \\ \cline{2-4} & \begin{tabular}[c]{@{}c@{}}Avenue \\ (GT: 47, \\ smaller set \\ GT: 14)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Subway \\ Entrance \\ (GT: 66)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Subway Exit \\ (GT: 19)\end{tabular} \\ \midrule Sparse combination \cite{lu2013} & 12/1 (smaller set) & 57/4 & 19/2 \\ Space-time MRF \cite{kim2009} & N/A & 56/3 & 18/0 \\ Online \cite{dutta2015} & N/A & 60/5 & 19/2 \\ ConvAE \cite{hasan2016} & 45/4 & 61/15 & 17/5 \\ Ours & 44/6 & 61/9 & 18/10 \\ \bottomrule \end{tabular} \end{table} The event count breakdown according to type of event is presented in Table \ref{table:avenue_count}, \ref{table:enter_count} and \ref{table:exit_count} for Avenue dataset, Subway entrance and exit datasets respectively. All throwing, loitering (LT) and irregular interaction (II) events are well captured by our proposed system. These are strong abnormalities that are significantly different from what was captured in the normal scenes. However, our system does have difficulties in detecting certain types of event. Missed detection of running and walking in opposite direction events are due to (1) the crowded activities where multiple foreground events take place; and (2) the object of interest is far away from the camera. Meanwhile, in Subway entrance and exit scenes, some wrong direction events are missed. On the other hand, some no payment (NP) events in Subway entrance scene are difficult to detect due to their similar motion compared to others walking through the barrier. \begin{table}[] \centering \caption{Anomalous event and false alarm count detected by different methods on various event type in Avenue dataset.} \label{table:avenue_count} \begin{tabular}{@{}M{2cm}M{1.3cm}M{1.3cm}M{1.3cm}M{1.5cm}M{1.5cm}@{}} \toprule & Run & Loiter & Throw & Opposite Direction & False Alarm \\ \midrule Groundtruth & 12 & 8 & 19 & 8 & 0 \\ Ours & 10 & 8 & 19 & 7 & 12 \\ \bottomrule \end{tabular \end{table} \begin{table}[] \centering \caption{Anomalous event and false alarm count detected by different methods on various event type in Subway Entrance dataset. WD: wrong direction; NP: no payment; LT: loitering; II: irregular interaction; Misc.: miscellaneous.} \label{table:enter_count} \begin{tabular}{@{}M{2cm}M{1cm}M{1cm}M{1cm}M{1cm}M{1cm}M{1.5cm}@{}} \toprule & WD & NP & LT & II & Misc. & False Alarm \\ \midrule Groundtruth & 26 & 13 & 14 & 4 & 9 & 0 \\ Ours & 24 & 10 & 14 & 4 & 9 & 9 \\ \bottomrule \end{tabular \end{table} \begin{table}[] \centering \caption{Anomalous event and false alarm count detected by different methods on various event type in Subway Exit dataset. WD: wrong direction; LT: loitering; Misc.: miscellaneous.} \label{table:exit_count} \begin{tabular}{@{}M{2cm}M{1.5cm}M{1.5cm}M{1.5cm}M{1.5cm}@{}} \toprule & WD & LT & Misc. & False Alarm \\ \midrule Groundtruth & 9 & 3 & 7 & 0 \\ Ours & 8 & 3 & 7 & 10 \\ \bottomrule \end{tabular \end{table} We also present a run-time analysis on our proposed abnormal event detection system, on CPU (Intel Xeon E5-2620) and GPU (NVIDIA Maxwell Titan X) respectively, in Table \ref{table:time}. The total time taken is well less than a quarter second per frame for both CPU and GPU configuration. Due to computational intensive multiplication operations when feeding the input through the convolutional autoencoders, it is recommended to run on GPU for a better speed of nearly 30 times faster than CPU. \begin{table}[] \centering \caption{Details of run-time during testing (second/frame).} \label{table:time} \begin{tabular}{@{}M{1.5cm}M{2.2cm}M{2.2cm}M{2.2cm}M{2.5cm}@{}} \toprule & \multicolumn{4}{c}{Time (in sec)}\\ & Preprocessing & Representation & Classifying & Total \\ \midrule CPU & 0.0010 & 0.2015 & 0.0002 & 0.2027 ($\sim$5fps) \\ GPU & 0.0010 & 0.0058 & 0.0002 & 0.0070 ($\sim$143fps) \\ \bottomrule \end{tabular \end{table} \subsubsection{Qualitative Analysis: Visualising Frame Regularity} \begin{figure} \centering \includegraphics[width=\textwidth]{avenue_vid_5_15} \caption{Regularity score of video \#5 (top) and \#15 (bottom) from the Avenue dataset.} \label{fig:avenue_show} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{subway_entrance_100000_120000} \caption{Regularity score of frames 115000-120000 from the Subway Entrance video.} \label{fig:enter_show} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{subway_exit_22500_37500} \caption{Regularity score of frames 22500-37500 from the Subway Entrance video.} \label{fig:exit_show} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{ped1_show} \caption{Regularity score of video \#1, \#8, \#24 and \#32 (from top to bottom) from UCSD Ped1 dataset.} \label{fig:ped1_show} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{ped2_show} \caption{Regularity score of video \#2, \#4, \#5 and \#7 (from top to bottom) from UCSD Ped2 dataset.} \label{fig:ped2_show} \end{figure} Figure \ref{fig:avenue_show}, \ref{fig:enter_show}, and \ref{fig:exit_show} illustrate the output of the proposed system on samples of the Avenue dataset, Subway entrance and exit scenes respectively; our method detects anomalies correctly in these cases even in crowded scenes. Almost all anomalies produce strong downward spikes which indicate a low regularity score, including a difficult-to-detect skateboarding activity as illustrated in Figure \ref{fig:ped1_show}. \subsubsection{Comparing Our Method with 2D Convolutional Autoencoder (ConvAE)} \begin{figure} \centering \includegraphics[width=\textwidth]{avenue_vid_7_8} \caption{Comparing our method with ConvAE \cite{hasan2016} on Avenue dataset video \#7 (top) and \#8 (bottom). Best viewed in colour.} \label{fig:avenue_compare} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{scores_exit_video_04_comparison} \caption{Comparing our method with ConvAE \cite{hasan2016} on Subway Exit video frames 10000-22500. Best viewed in colour.} \label{fig:exit_compare} \end{figure} \begin{figure} \centering \includegraphics[width=\textwidth]{scores_enter_video_06_comparison} \caption{Comparing our method with ConvAE \cite{hasan2016} on Subway Entrance video frames 120000-144000. Best viewed in colour.} \label{fig:enter_compare} \end{figure} From Figure \ref{fig:avenue_compare} and \ref{fig:exit_compare}, it is easy to see that our method has detected more abnormal events with fewer false alarms compared to \cite{hasan2016}. As observed in Figure \ref{fig:enter_compare}, our method is able to produce higher regularity score during normal activities and lower scores when there are abnormalities. \section{Conclusion} In this research, we have successfully applied deep learning to the challenging video anomaly detection problem. We formulate anomaly detection as a spatiotemporal sequence outlier detection problem and applied a combination of spatial feature extractor and temporal sequencer ConvLSTM to tackle the problem. The ConvLSTM layer not only preserves the advantages of FC-LSTM but is also suitable for spatiotemporal data due to its inherent convolutional structure. By incorporating convolutional feature extractor in both spatial and temporal space into the encoding-decoding structure, we build an end-to-end trainable model for video anomaly detection. The advantage of our model is that it is semi-supervised -- the only ingredient required is a long video segment containing only normal events in a fixed view. Despite the model’s ability to detect abnormal events and its robustness to noise, depending on the activity complexity in the scene, it may produce more false alarms compared to other methods. For future work, we will investigate how to improve the result of video anomaly detection by active learning -- having human feedback to update the learned model for better detection and reduced false alarms. One idea is to add a supervised module to the current system, which the supervised module works only on the video segments filtered by our proposed method, then train a discriminative model to classify anomalies when enough video data has been acquired. \bibliographystyle{splncs03}
{'timestamp': '2017-01-09T02:03:05', 'yymm': '1701', 'arxiv_id': '1701.01546', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01546'}
arxiv
\section{Introduction} Multimodal data represents multiple aspects of a phenomenon of interest (PoI) observed using different acquisition methods or different types of sensors \cite{Lahat_Proc2015}. Due to the diversity of information, multimodal data enhances inference performance compared to that with unimodal data. Multimodal data fusion has attracted much attention in different application scenarios such as biometric score fusion \cite{Nandakumar_PAMI08,Adall_MM13}, multi-media analysis \cite{Atrey_MS10}, automatic target recognition \cite{Zhang_AES12}, and footstep detection \cite{Jin_Fusion11} to name a few. To obtain a unified picture of the PoI to perform a given inference task, multimodal data needs to be fused in an efficient manner. This is a challenging problem in many applications due to complex inter- and intra- modal dependencies and high dimensionality of data. When the goal is to solve a detection problem in a parametric framework, performing likelihood ratio (LR) based fusion is challenging since the computation of the joint likelihood functions is difficult in the presence of many unknown parameters and complex inter- and intra- modal dependencies. Different techniques have been proposed to estimate the probability density functions (pdfs) such as histograms, and kernel based methods \cite{Nandakumar_PAMI08}. In addition to LR based methods, some feature based techniques for multimodal data fusion are discussed in \cite{Lahat_Proc2015}. When the marginal pdfs of data of each modality are available (or can be estimated), which can be disparate due to the heterogeneous nature of multimodal data, copula theory has been used to model inter-modal complex dependencies in \cite{Mercier_2007,iyengar_tsp11,ashok_tsp11,ashok_taes11,Iyengar2011,Subramanian_2011,He_tsp2015}. While there are several copula density functions developed in the literature, finding the best copula function that fits a given set of data is computationally challenging. This is because different copula functions may characterize different types of dependence behaviors among random variables \cite{Nelsen2006,Mari_B1}. Finding multivariate copula density functions with more than two modalities is another challenge since most of the existing copula functions are derived considering the bivariate case. Thus, the benefits of the use of copula theory for likelihood ratio based fusion with multimodal dependent data come at a higher computational price. One of the commonly used suboptimal methods is to neglect inter-modal dependence and compute the likelihood functions based on the disparate marginal pdfs of each modality; we call this 'the product approach' in the rest of the paper. The product approach leads to poor performance when the first order statistics of uncompressed data under two hypotheses are not significantly different from each other and/or the inter-modal dependence is strong. In this paper, we treat the detection problem with heterogeneous dependent data in a compressed domain. In the proposed framework, each node compresses its time samples via low dimensional random projections as proposed in compressive sensing (CS) \cite{candes1,candes2,donoho1,Eldar_B1} and transmits the compressed observation vector to the fusion center. Thus, the communication cost is greatly reduced compared to transmitting all the high dimensional observation vectors to the fusion center. While CS theory has mostly been exploited for sparse signal reconstruction, its potential for solving detection problems has also been investigated in several recent works \cite{duarte_ICASSP06, haupt_ICASSP07,davenport_JSTSP10,Wimalajeewa_asilomar10, Gang_globalsip14,Bhavya_cscps14,Bhavya_asilomar14, Rao_icassp2012,Cao_Info2014,Kailkhura_WCL16,Kailkhura_TSP16,Wimalajeewa_tsipn16}. Some of the works, such as \cite{duarte_ICASSP06,haupt_ICASSP07,Gang_globalsip14,Rao_icassp2012,Cao_Info2014,Wimalajeewa_tsipn16} focused on constructing decision statistics in the compressed domain exploiting the sparsity prior, some other works \cite{davenport_JSTSP10,Wimalajeewa_asilomar10,Bhavya_cscps14,Bhavya_asilomar14,Kailkhura_WCL16,Kailkhura_TSP16} considered the detection problem when the signals are not necessarily sparse. When the signal to be detected is known and deterministic, a performance loss is expected in terms of the probabilities of detection and false alarm when performing likelihood ratio based detection in the compressed domain compared to that with uncompressed data \cite{davenport_JSTSP10}. However, when the signal-to-noise ratio (SNR) is sufficiently large, this loss is not significant and the compressed detector is capable of providing a similar performance as the uncompressed detector. In \cite{Kailkhura_TSP16}, the authors have extended the known signal detection problem with CS to the multiple sensor case considering Gaussian measurements. While intra-signal (temporal) dependence was considered with Gaussian measurements, inter-sensor (spatial) dependence was ignored in \cite{Kailkhura_TSP16}. As mentioned before, with heterogeneous multimodal data, handling inter-modal dependence is one of the key issues in developing efficient fusion strategies. To the best of authors' knowledge, the ability of CS in capturing the dependence properties of uncompressed data to solve detection problems has not been well investigated in the literature. In this paper, our goal is to exploit the potential of CS to capture dependence structures of high dimensional data focusing on detection problems. We propose a parametric as well as a nonparametric approach for detection with compressed data. In the first approach, we treat the detection problem completely in the compressed domain. With arbitrary disparate marginal pdfs for (temporally independent) uncompressed data of each modality, we employ a Gaussian approximation in the compressed domain and the joint likelihood function of spatially dependent (over modalities) is computed based on multivariate Gaussian pdfs. With this approach, dependence is captured via a compressed version of the covariance matrix of the concatenated (over all the modalities) uncompressed data vector. We show that, under certain conditions, using a small number of compressive measurements (compared to the original signal dimension), better or similar performance can be achieved in the compressed domain compared to performing fusion (i). using the product approach with uncompressed data where inter-modal dependence is completely ignored and (ii). when widely available copula functions are used to model dependence of highly dependent uncompressed data. We further discuss as to how to decide when it is beneficial to perform compressed detection over suboptimal detection with uncompressed dependent data in terms of the Bhattacharya distance measure. In the second approach, we exploit the potential of CS to capture statistical information of uncompressed data in the compressed domain to compute a test statistic for detection. When uncompressed data is dependent and highly correlated \footnote{Throughout the paper, by 'dependent and correlated', we mean that the data is dependent and has a non-diagonal covariance matrix. When the data is dependent but uncorrelated, i.e., when the dependent data has a diagonal covariance matrix, we use the term 'dependent and uncorrelated'.} in the presence of the random phenomenon being observed (alternate hypothesis), the covariance matrix of the concatenated data vector (over modalities) is likely to have a different structure compared to the case where the phenomenon is absent (null hypothesis). Thus, a decision statistic can be computed based on the covariance information. Estimation of the covariance matrix of uncompressed data is computationally expensive when the signal dimension is large. Compressive covariance sensing has been discussed in \cite{Romero_SPM16} in which the covariance matrix of uncompressed data is estimated using compressed samples. It is noted that estimation of the complete covariance matrix is not necessary to construct a reliable test statistic for detection. Covariance based test statistics have been proposed for spectrum sensing in \cite{Zeng_C2007,Zeng_VT09} without considering any compression. In this paper, depending on the structure of the covariance matrix of uncompressed data, efficient test statistics for detection are computed in the compressed domain, in contrast to the work in \cite{Zeng_C2007,Zeng_VT09}. When the difference in second order statistics under two hypotheses is more significant than that with the first order statistics, this approach provides better performance than the first approach with some extra computational complexity. Further, under the same conditions, this approach outperforms the energy detector with compressed as well as with uncompressed data, which is the widely considered nonparametric detector. Moreover, in contrast to the energy detector, the proposed approach is robust, with respect to the threshold setting, against the uncertainties of the signal parameters under the null hypothesis. The paper is organized as follows. In Section \ref{sec_formulation}, background on the detection problem with uncompressed dependent data is discussed. LR based detection with compressed dependent data is considered in Section \ref{sec_likelihood}. We also discuss when it is beneficial to perform LR based detection with compressed data compared to detection using suboptimal techniques with uncompressed data considering numerical examples. In Section \ref{sec_covariance}, we discuss how to exploit the CS measurement scheme to construct a decision statistic based on the covariance information of uncompressed data. In Section \ref{sec_simulation}, CS based detection performance is investigated with real experimental data. Section \ref{sec_conclusion} concludes the paper. \subsection*{Notation} The following notation and terminology are used throughout the paper. Scalars are denoted by lower case letters; e.g., $x$. Lower (upper) case boldface letters are used to denote vectors (matrices); e.g., $\mathbf x$ ($\mathbf A$). Matrix transpose is denoted by $\mathbf A^T$. The $n$-th element of the vector $\mathbf x_j$ is denoted by both $\mathbf x_j[n]$ and $x_{nj}$ while the $(m,n)$-th element of the matrix $\mathbf A$ is denoted by $\mathbf A[m,n]$. The $j$-th column vector and the $i$-th row vector of $\mathbf A$ are denoted by $\mathbf a_j$, and $\mathbf a^i$, respectively. The trace operator is denoted by $\mathrm{tr}(\cdot)$. The $l_p$ norm of a vector $\mathbf x$ is denoted by $||\mathbf x||_p$ while the Frobenius norm of a matrix $\mathbf A$ is denoted by $||\mathbf A||_F$. Calligraphic letters are used to denote sets; e.g., $\mathcal U$. We use the notation $|.|$ to denote the absolute value of a scalar, and determinant of a matrix. We use $\mathbf I_N$ to denote the identity matrix of dimension $N$ (we avoid using subscript when there is no ambiguity). The vectors of all zeros and ones with an appropriate dimension are denoted by $\mathbf 0$ and $\mathbf 1$, respectively. The notation $\mathbf x \sim \mathcal N(\boldsymbol\mu, \boldsymbol\Sigma)$ denotes that the random vector $\mathbf x$ has a multivariate Gaussian pdf with mean vector $\boldsymbol\mu$ and covariance matrix $\boldsymbol\Sigma$. \section{Problem Formulation and Background}\label{sec_formulation} Let there be $L$ sensor nodes in a network deployed to solve a binary hypothesis testing problem where the two hypotheses are denoted by $\mathcal H_1$ and $\mathcal H_0$, respectively. The observation vector at each node is denoted by $\mathbf x_j\in \mathbb R^N$ for $j=1,\cdots,L$. The goal is to decide as to which hypothesis is true based on $\mathbf x=[\mathbf x_1^T, \cdots,\mathbf x_L^T]^T$. \subsection{Likelihood Ratio Based Detection} Consider the detection problem in a parametric framework where the marginal pdf of $\mathbf x_j$ is available under both hypotheses. Let $\mathbf x_j$ be distributed under $\mathcal H_1$ and $\mathcal H_0$ as \begin{eqnarray} \mathcal H_1&:& \mathbf x_j \sim f_1(\mathbf x_j)\nonumber\\ \mathcal H_0&:& \mathbf x_j \sim f_0(\mathbf x_j), j=1,\cdots,L\label{obs_0} \end{eqnarray} respectively, where $f_i(\mathbf x_j)$ denotes the joint pdf of $\mathbf x_j$ under $\mathcal H_i$ for $i=0,1$ and $j=1,\cdots,L$. The optimal test which minimizes the average probability of error based on \eqref{obs_0} is the LR test \cite{poor1} which is given by \begin{eqnarray} \delta = \left\{ \begin{array}{ccc} 1 ~ &~\mathrm{if} & \frac{f_1(\mathbf x)}{f_0(\mathbf x)} > \tau\\ 0 ~& \mathrm{otherwise} ~& \end{array}\right.\label{LLR_test_uncompressed} \end{eqnarray} where $\tau$ is the threshold. To perform the test in \eqref{LLR_test_uncompressed}, it is required to compute the joint pdfs $f_1(\mathbf x)$ and $f_0(\mathbf x)$. The optimality of the LR test is guaranteed only when the underlying joint pdfs are known. When $\mathbf x_1, \cdots, \mathbf x_L$ are independent under $\mathcal H_i$ for $i=0,1$, $f_i(\mathbf x)$ can be written as $ f_i(\mathbf x) = \prod_{j=1}^L f_i(\mathbf x_j) $ for $i=0,1$. However, this assumption may not be realistic in practical applications. For example, consider the problem of detection of the presence of a common random phenomenon in a heterogenous signal processing application where there are multiple sensors of different modalities. The data at different nodes may follow disparate marginal pdfs due to the differences in the physics that govern each modality. The presence of the common random phenomenon can change the statistics of the heterogeneous data and make the observations at different modalities dependent \cite{iyengar_tsp11}. Thus, to detect the presence of the random phenomenon in the LR framework, computation of the joint pdf of data collected at the multiple nodes in the presence of inter-modal dependencies is required. There are several approaches proposed in the literature to perform LR based detection when the exact pdf of $\mathbf x$ is not available. These techniques are commonly categorized as parametric, nonparametric, and semi-parametric approaches. \subsection{Copula Theory} In a parametric framework, copulas are used to construct a valid joint distribution describing an arbitrary and possibly nonlinear dependence structure \cite{Nelsen2006,Mercier_2007,iyengar_tsp11,ashok_tsp11,ashok_taes11,Iyengar2011,Subramanian_2011,He_tsp2015}. According to copula theory, the pdf of $\mathbf x$ under $\mathcal H_i$ can be written as \cite{Nelsen2006}, \begin{eqnarray*} f_i(\mathbf x) = \prod_{n=1}^N \prod_{l=1}^L f_i( \mathbf x_l[n]) c_{ni}(u^i_{n1},\cdots,u_{nL}^i) \end{eqnarray*} for $i=0,1$ where $c_{ni}(\cdot)$ denotes the copula density function, $u_{nl}^{i}= F(\mathbf x_l[n] | \mathcal H_i)$ with $F(x|\mathcal H_i)$ denoting the marginal cdf of $x$ under $\mathcal H_i$. Then, the log LR (LLR) can be written in the following form: \begin{eqnarray} \Lambda_{\mathrm{LLR}}(\mathbf x) &=& \log \frac{f_1(\mathbf x)}{f_0(\mathbf x)} = \sum_{l=1}^L \sum_{n=1}^N \log \frac{f_1(\mathbf x_l[n])}{f_0(\mathbf x_l[n])} \nonumber \\ &+& \sum_{n=1}^N \log \frac{c_{n1} (u_{n1}^1, \cdots, u_{nL}^1 | \phi_{n1})}{c_{n0} (u_{n1}^0, \cdots, u_{nL}^0 | \phi_{n0})}\label{eq_copula_uncomp} \end{eqnarray} where $\phi_{n1}$ and $\phi_{n0}$ are copula parameters under $\mathcal H_1$ and $\mathcal H_0$, respectively, for $n=1,\cdots,N$. In this case, in general, $N$ copulas where each one is $L$-variate are selected to model dependence. Readers may refer to \cite{Nelsen2006,Mercier_2007,iyengar_tsp11,ashok_tsp11,ashok_taes11,Iyengar2011,Subramanian_2011,He_tsp2015} to learn more about copula theory as applicable for binary hypothesis testing problems. One of the fundamental challenges in copula theory is to find the copula density function that will best fit the given data set. Further, most of the copula density functions proposed in the literature consider the bivariate case. In order to model the dependence of multimodal data with more than two modalities, several approaches have been proposed in the literature \cite{Subramanian_2011}, which are in general computationally complex. Thus, in order to better utilize copula theory for multimodal data fusion, these challenges need to be overcome. In the following, we consider an alternate computationally efficient approach for multimodal data fusion in which dependence among data is modeled in a low dimensional transformed domain obtained via CS. We also discuss the advantages/disadvantages of modeling dependence in the compressed domain via Gaussian approximation over the copula based approach with uncompressed data. \section{Fusion of Spatially Dependent Data in the Compressed Domain via Likelihood Ratio Test }\label{sec_likelihood} Let $\mathbf A_j$ be specified by a set of unique sampling vectors $\{\mathbf a^m_{j}\}_{m=1}^{M}$ with $M < N$ for $j=1, \cdots, L$. We assume that the $j$-th node compresses its observations using $\mathbf A_j$ so that the compressed measurement vector is given by, \begin{eqnarray} \mathbf y_j = \mathbf A_j \mathbf x_j \label{obs_1} \end{eqnarray} for $j=1,\cdots,L$ where the $m$-th element of the vector $\mathbf A_j\mathbf x_j$ is given by $\langle \mathbf a^m_{j} , \mathbf x_j\rangle$ for $m=1,\cdots, M$ where $\langle., .\rangle$ denotes the inner product. In CS theory, the mapping $\mathbf A_j$ is usually selected to be a random matrix. In the rest of the paper, we make the following assumptions: (i) $\mathbf y_j$'s are available at the fusion center without an error, (ii). $\mathbf A_j$ is an orthoprojector so that $\mathbf A_j\mathbf A_j^T=\mathbf I$, and (iii) the elements of $\mathbf x_j$ are independent of each other for given $j$ under both hypotheses while there is (spatial) dependence among $\mathbf x_1,\cdots,\mathbf x_L$ under $\mathcal H_1$ (i.e., there is spatial and temporal independence under $\mathcal H_0$ and temporal independence and spatial dependence under $\mathcal H_1$). \subsection{Likelihood Ratio Based Fusion With Compressed Data} In order to perform LR based fusion based on (\ref{obs_1}), the computation of the joint pdf of $\{\mathbf y_1, \cdots, \mathbf y_L\}$ is required. When the marginal pdf of each $\mathbf x_j$ is available, the marginal pdf of each element in $\mathbf y_j$ can be computed as in the following. The $m$-th element of $\mathbf y_j$, $\mathbf y_j[m]$, can be written as, \begin{eqnarray} \mathbf y_j[m] = \sum_{n=1}^N \mathbf A_j[m,n] \mathbf x_{j}[n]\label{y_jm} \end{eqnarray} for $j=1,\cdots,L$. Having the marginal pdfs of $\mathbf x_j[n]$ and using the independence assumption of $\mathbf x_j[n]$ for $n=1,\cdots,N$, the pdf of $z= \mathbf y_j[m]$ can be found after computing the characteristic function of $z$. Once the marginal pdfs of the elements in $\mathbf y_j$ for $j=1,\cdots,L$ are found, copula theory can be used in order to find the joint pdf of the compressive measurement vectors $\mathbf y_1, \cdots, \mathbf y_L$. Letting $u_j = F_j( \mathbf y_{p}[q])$ for $j=M(p-1)+q$ where $p=1,\cdots, L$, $q=1, \cdots, M$, the LLR based on copula functions can be expressed as, \begin{eqnarray} &~&T_{LLR}(\mathbf y)\nonumber\\ &=&\sum_{l=1}^L \sum_{k=1}^M \log \frac{f_1( \mathbf y_{l}[k])}{f_0( \mathbf y_{l}[k])} + \log \frac{c_1 (u_1, \cdots, u_{ML} | \phi_1^*)}{c_0 (u_1, \cdots, u_{ML} | \phi_0^*)}. \label{copula_2} \end{eqnarray} The second term on the right hand side of (\ref{copula_2}) requires one to find copula density functions of $ML$ variables which is computationally very difficult. Since we assume that the elements in $\mathbf x_j$ are independent under any given hypothesis, each element in $\mathbf y_j$ can be approximated by a Gaussian random variable (via Lindeberg-Feller central limit theorem assuming that the required conditions are satisfied \cite{cramer_1946,thakshilaj5}) when $N$ is sufficiently large. \subsection{Likelihood Ratio Based Fusion with Compressed Data via Gaussian Approximation} Assume that first and second order statistics of the concatenated data vector $\mathbf x = [\mathbf x_1^T, \dots, \mathbf x_L^T]^T$ are available. We define additional notation here. Let \begin{eqnarray} \boldsymbol\beta^i= [{\boldsymbol\beta_1^i}^T \cdots {\boldsymbol\beta_L^i}^T]^T \label{uncompressed_mean} \end{eqnarray} and \begin{eqnarray} \mathbf D^i =\left[ \begin{array}{cccc} \mathbf D^i_1 & \mathbf D^i_{12} & \cdots & \mathbf D^i_{1L} \\ \mathbf D^i_{21} & \mathbf D^i_2 & \cdots & \mathbf D^i_{2L}\\ \cdots & \cdots & \cdots & \cdots\\ \mathbf D^i_{L1} & \mathbf D^i_{L2} & \cdots & \mathbf D^i_{L}. \end{array}\right]\label{uncompressed_cov} \end{eqnarray} denote the $NL\times 1$ mean vector and the $NL\times NL$ covariance matrix of $\mathbf x$ under $\mathcal H_i$ for $i=0,1$ where $\boldsymbol\beta_j^i = \mathbb E\{\mathbf x_j | \mathcal H_i\}$, $\mathbf D^i_j = \mathbb E\{(\mathbf x_j - \boldsymbol\beta_j^i)(\mathbf x_j - \boldsymbol\beta_j^i)^T | \mathcal H_i\}$ and $\mathbf D^i_{jk} = \mathbb E\{(\mathbf x_j - \boldsymbol\beta_j^i)(\mathbf x_k - \boldsymbol\beta_k^i)^T | \mathcal H_i\}$ for $j\neq k$ $k=1,\cdots,L$ and $j=1,\cdots,L$. With Gaussian approximation, the joint pdf of $\mathbf y = [\mathbf y_1^T \cdots \mathbf y_L^T]^T$ is given by $\mathbf y|\mathcal H_i \sim \mathcal N (\boldsymbol\mu^i, \mathbf C^i)$ where $\boldsymbol\mu^i$ and $ \mathbf C^i$ are the notations used to define the mean vector and the covariance matrix of $\mathbf y$ which are analogous to the definitions in \eqref{uncompressed_mean} and \eqref{uncompressed_cov}, respectively, with $\boldsymbol\mu_j^i = \mathbb E\{\mathbf y_j | \mathcal H_i\}$, $\mathbf C^i_j = \mathbb E\{(\mathbf y_j - \mathbb E\{\mathbf y_j\})(\mathbf y_j - \mathbb E\{\mathbf y_j\})^T | \mathcal H_i\}$, $\mathbf C^i_{jk} = \mathbb E\{(\mathbf y_j - \mathbb E\{\mathbf y_j\})(\mathbf y_k - \mathbb E\{\mathbf y_k\})^T | \mathcal H_i\}$ with $j\neq k$, $k=1,\cdots,L$ and $j=1,\cdots,L$ for $i=0,1$. We further denote by $\mathbf D_x$ ($\mathbf C_y$) the covariance matrix of $\mathbf x$ ($\mathbf y$) where $\mathbf D_x=\mathbf D^1$ ($\mathbf C_y=\mathbf C^1$ ) under $\mathcal H_1$ and $\mathbf D_x=\mathbf D^0$ ($\mathbf C_y=\mathbf C^0$ ) under $\mathcal H_0$. First and second order statistics of the compressed data are related to that of uncompressed data via \begin{eqnarray*} \boldsymbol\mu_j^i = \mathbf A_j \boldsymbol\beta_j^i, \mathbf C^i_j = \mathbf A_j \mathbf D^i_j \mathbf A_j^T, \mathrm{and~} \mathbf C^i_{jk} = \mathbf A_j \mathbf D^i_{jk} \mathbf A_k^T \end{eqnarray*} for $j,k=1,\cdots, L$ and $i=0,1$. Then, we can write, \begin{eqnarray*} \boldsymbol\mu^i = \mathbf A \boldsymbol \beta^i \mathrm{~and~} \mathbf C^i = \mathbf A \mathbf D^i \mathbf A^T \end{eqnarray*} where \begin{eqnarray} \mathbf A = \left( \begin{array}{ccccc} \mathbf A_1 & \mathbf 0 & \cdot & \cdot &\mathbf 0\\ \mathbf 0 & \mathbf A_2 & \cdot & \cdot &\mathbf 0\\ \cdot & \cdot & \cdot & \cdot & \cdot \\ \mathbf 0 & \mathbf 0 & \cdot & \cdot & \mathbf A_L\\ \end{array}\right)\label{eq_A} \end{eqnarray} is a $ML \times NL$ matrix. With the assumption that $\mathbf A_j \mathbf A_j^T = \mathbf I_M$ for $j=1,\cdots,L$, the decision statistic of the LLR based detector is given by \cite{poor1}, \begin{eqnarray} \Lambda_{\mathrm{LLR}} (\mathbf y) &=& \frac{1}{2}\mathbf y^T ({\mathbf C^0}^{-1} - {\mathbf C^1}^{-1})\mathbf y \nonumber\\ &+& ({\boldsymbol\mu^1}^T {\mathbf C^1}^{-1} - {\boldsymbol\mu^0}^T {\mathbf C^0}^{-1}) \mathbf y + \tau_0 \label{stat_Gaussian} \end{eqnarray} where $\tau_0 = \frac{1}{2}\left(\log \left(\frac{|\mathbf C^0|}{|\mathbf C^1|}\right) + {\boldsymbol\mu^0}^T {\mathbf C^0}^{-1}\boldsymbol\mu^0 - {\boldsymbol\mu^1}^T {\mathbf C^1}^{-1}\boldsymbol\mu^1 \right)$. To compute the threshold so that the probability of false alarm is kept under a desired value, computation of the pdf of $\Lambda_{\mathrm{LLR}}$ under $\mathcal H_0$ is required. This is in general computationally intractable, but is possible under certain assumptions on $\mathbf x$. For example, when $\boldsymbol\beta^i=\mathbf 0$ for $i=0,1$ and the elements of $\mathbf x$ are identical under $\mathcal H_0$ (in addition to independence), we have $\boldsymbol\mu^i=\mathbf 0$ and $\mathbf C^0= \sigma_0^2 \mathbf I$ where $\sigma_0^2$ denotes the variance of $\mathbf x$ under $\mathcal H_0$. In this case, the threshold can be computed as considered in \cite{poor1} (pages 73-75). When such assumptions on $\mathbf x$ cannot be made, we propose to compute the threshold via simulations. \subsubsection{Impact of compression on inter-modal dependence}\label{sec_impact_dependence} With the Gaussian approximation after compression, the inter-modal dependence is captured only through the covariance matrix. Higher order dependencies of data are not taken into account in the compressed domain. In particular, $\mathbf D_x$ is compressed via $\mathbf C_y = \mathbf A \mathbf D_x \mathbf A^T$. To quantify the distortion of $\mathbf D_x$ due to compression, one measure is to consider the Frobenius norm of the covariance matrix. We have \begin{eqnarray} ||\mathbf C_y||_F^2 &=& ||\mathbf A\mathbf D_x\mathbf A^T||_F^2= \mathrm{tr}(\mathbf A \mathbf D_x^T \mathbf A^T \mathbf A \mathbf D_x \mathbf A^T )\nonumber\\ &=&\mathrm{tr}(\mathbf A^T \mathbf A \mathbf D_x^T \mathbf A^T \mathbf A \mathbf D_x )\approx \frac{M^2}{N^2}||\mathbf D_x||_F^2 \end{eqnarray}where the last approximation is due to $\mathbf A^T \mathbf A \approx \frac{M}{N} \mathbf I$. Thus, the Frobenius norm of the covariance matrix after compression is reduced by a factor of $c_r= \frac{M}{N}$ compared to that with uncompressed data. In other words, the Gaussian approximation in the compressed domain can capture a compressed version of the covariance matrix of uncompressed data. Compared to other approaches with uncompressed data, the product approach does not capture any form of dependence. With respect to copula based approaches, it is not very clear how much dependence can be captured with a given copula function. Since the covariance matrix is not a direct measure of detection performance, in the following subsection we compare the detection performance of different approaches in terms of the average probability of error. \subsection{Detection Performance Comparison Between Compressed and Uncompressed Data via Average Probability of Error}\label{sec_Bhatt} In order to quantify the detection performance of different approaches with both uncompressed and compressed data, we consider the Bhattacharya bound (which is a special case of the \emph{Chernoff} bound) which bounds the average probability of error of LR based detectors. We use the notation 'u:product', and 'u:copula-name' for the product approach and the copula based approach with a given copula function stated under 'name', respectively, with uncompressed data. The notation 'c:GA' is used to represent the LR based approach with compressed data using the Gaussian approximation. The Bhattacharya distance between the two hypotheses with the copula based approach with uncompressed data is given by, \begin{eqnarray} \mathcal D_{B}^{\mathrm{u:copula}} (f_1 || f_0) &=& -\log \int f_1^{1/2}(\mathbf x)f_0^{1/2}(\mathbf x) d \mathbf x\nonumber\\ &=& -\log \mathbb E_{f_0} \left\{\prod_{n=1}^N\prod_{l=1}^L\left( \frac{f_1^m(\mathbf x_l[n])}{f_0^m(\mathbf x_l[n])} \right)^{1/2} \right.\nonumber\\ &~& \left.c_{n1}^{1/2} (u_{n1}^1, \cdots, u_{nL}^1 | \phi_{n1})\right\} \label{DBt_1} \end{eqnarray} where $f_i^m$ denotes the marginal pdf under $\mathcal H_i$ and we have $f_0(\mathbf x) = \underset{l,n}{\prod} f_0^m(\mathbf x_l[n])$ since we assume $\mathbf x_1, \cdots, \mathbf x_L$ to be independent of each other under $\mathcal H_0$. With the product approach, we have $c_{n1}(\cdot)=1$ and \eqref{DBt_1} reduces to, \begin{eqnarray} &~&\mathcal D_{B}^{\mathrm{u:product}} ( (f_1 || f_0)\nonumber\\ &=& -\log \mathbb E_{f_0} \left\{\prod_{n=1}^N\prod_{l=1}^L\left( \frac{f_1^m(\mathbf x_l[n])}{f_0^m(\mathbf x_l[n])} \right)^{1/2} \right\}. \label{DBt_product} \end{eqnarray} On the other hand, the Bhattacharya distance between the two hypotheses with compressed data under Gaussian approximation can be computed as \cite{Moustafa_12} \begin{eqnarray} \mathcal D_{B}^{\mathrm{c:GA}} (f_1 || f_0)& =& \frac{1}{8} (\boldsymbol\beta_1 - \boldsymbol\beta_0)^T \Gamma^{\dagger} \boldsymbol\beta_1 - \boldsymbol\beta_0) \nonumber\\ &+& \frac{1}{2} \log \{|\Gamma| |\mathbf A\mathbf D^1\mathbf A^T|^{-1/2}|\mathbf A\mathbf D^0\mathbf A^T|^{-1/2} \}\label{BD_Gaussian} \end{eqnarray} where $\Gamma^{\dagger} = \mathbf A^T \Gamma^{-1} \mathbf A$ and $\Gamma = \frac{1}{2}(\mathbf A\mathbf D^1\mathbf A^T+\mathbf A\mathbf D^0\mathbf A^T)$. Using the Bhattacharya distance, the average probability of error with compressed data, $P_e^c$, is upper bounded by \cite{poor1}, \begin{eqnarray*} P_e^c \leq \frac{1}{2} e^{-\mathcal D_{B}^{\mathrm{c:GA}}} \triangleq P_{ub}^{\mathrm{c:GA}}. \end{eqnarray*} Let $\mathcal D_{B}^{\mathrm{u: gvn}}$, and $P_{ub}^{\mathrm{u:gvn}}$ be the Bhattacharya distance, and the upper bound namely the Bhattacharya bound on the probability of error, respectively, with uncompressed data computed using a given suboptimal approach (e.g., product or copula with a given copula function). Then, we have \begin{eqnarray} P_{ub}^{\mathrm{c:GA}} &\leq& P_{ub}^{\mathrm{u:gvn}} ~~\mathrm{if} ~~\mathcal \mathcal \mathcal D_{B}^{\mathrm{c:GA}} \geq \mathcal D_{B}^{\mathrm{u:gvn}} \label{Pe_bounds} \end{eqnarray} where $\mathcal D_{B}^{\mathrm{u:gvn}}$ and $\mathcal D_{B}^{\mathrm{c:GA}}$ are computed as in \eqref{DBt_1} and \eqref{BD_Gaussian}, respectively. In the case where uncompressed data is dependent and uncorrelated, (\ref{Pe_bounds}) can be further simplified as stated in Proposition \ref{prop1}. \begin{proposition}\label{prop1} Let uncompressed data be dependent and uncorrelated so that $\mathbf D^1$ is diagonal. Further, let $\mathbf D_j^i = \sigma_{j,i}^2 \mathbf I$ and $\boldsymbol\beta_j^i=\beta_{j,i}\mathbf 1$ for $i=0,1$ and $j=1,\cdots,L$. Then, we have \begin{eqnarray} P_{ub}^{\mathrm{c:GA}} &\leq& P_{ub}^{\mathrm{u:gvn}} ~~\mathrm{if} ~~\mathcal D_{B}^{\mathrm{u:gvn}} \leq c_r\rho_B ~\mathrm{and}\nonumber\\ \end{eqnarray} where \begin{eqnarray} \rho_B &=&\frac{N}{2}\left\{\sum_{j=1}^L \log(\sigma_{j,1}^2 + \sigma_{j,0}^2) - \log (\sigma_{j,1}^2 \sigma_{j,0}^2) \right.\nonumber\\ &+&\left. \frac{(\beta_{j,1} - \beta_{j,0})^2}{2(\sigma_{j,1}^2 + \sigma_{j,0}^2)} \right\}\label{rho_B} \end{eqnarray} which is determined by the statistics of the uncompressed data and $c_r=\frac{M}{N}$ is the compression ratio. \end{proposition} \begin{proof} The proof follows from the fact that when uncompressed data is uncorrelated under $\mathcal H_1$, $\mathcal D_{B}^{c,G} $ in \eqref{BD_Gaussian} reduces to, \begin{eqnarray} \mathcal D_{B}^{c,G}(f_0||f_1) = \frac{M}{N} \rho_B \end{eqnarray} where $\rho_B$, are as defined in \eqref{rho_B}. \end{proof} Thus, whenever $\mathcal D_{B}^{\mathrm{c:GA}} > \mathcal D_{B}^{\mathrm{u:gvn}}$ `c:GA' performs better than any given suboptimal approach with uncompressed data. Even though $\mathcal D_{B}^{\mathrm{c:GA}} < \mathcal D_{B}^{\mathrm{u:gvn}}$, `c:GA' can still be promising if the desired performance level in terms of the upper bound on the probability of error is reached. Let $\epsilon_B$ be the desired upper bound on the probability of error. When $\mathcal D_{B}^{\mathrm{c:GA}} \geq -\log(2\epsilon_B)$, `c:GA' provides the desired performance even if $\mathcal D_{B}^{\mathrm{c:GA}} < \mathcal D_{B}^{\mathrm{u:gvn}}$. \subsection{Illustrative Examples}\label{example} In the following, we consider example scenarios to illustrate the detection performance with `c:GA' compared to that with uncompressed data using different suboptimal approaches. In the two examples, two types of detection problems are considered. In the first example, we consider a problem of detection of changes in statistics of data collected at heterogeneous sensors. In the second example, detection of a random source by heterogeneous sensors in the presence of noise is considered. \subsubsection{Example 1} In the first example, we consider $L=3$ and a common random phenomenon causes a change in the statistics of heterogeneous data at the three sensors. The uncompressed data at the three nodes have the following marginal pdfs: \cite{iyengar_tsp11}: \begin{eqnarray} x_{n1} | \mathcal H_i \sim \mathcal N(0,\sigma_i^2), ~ x_{n2} | \mathcal H_i \sim \mathrm{Exp} (\lambda_i) \nonumber\\ ~\mathrm{and} ~x_{n3} | \mathcal H_i \sim \mathrm{Beta}(a_i, b_i=1) \end{eqnarray} for $i=0,1$. It is noted that $x\sim \mathrm{Exp} (\lambda)$ denotes that $x$ has an exponential distribution with $f(x) = \lambda e^{-\lambda x}$ for $x\geq 0$ and $0$ otherwise, and $x\sim \mathrm{Beta}(a, b)$ denotes that $x$ has a beta distribution with pdf $f(x) = \frac{1}{\mathcal B(a,b)}x^{a-1} (1-x)^{b-1}$ and $\mathcal B(a,b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$ is the beta function. The data under $\mathcal H_1$ is assumed to be dependent and the following operations are used to generate dependent data. For the data at the second node, we use $ x_{n2} =x_{n1}^2+w^2 $ for $n=1,\cdots, N$ where $w\sim \mathcal N(0, \sigma_1^2)$. Then, we have $x_{n2}\sim \mathrm{Exp} (\lambda_1)$ with $\lambda_1=\frac{1}{2\sigma_1^2}$. For the third node, the data under $\mathcal H_1$ is generated as \begin{eqnarray*} x_{n3} =\frac{u}{u+x_{n2}} \end{eqnarray*} for $n=1,\cdots, N$ where $u\sim \mathrm{Gamma}(\alpha_1, \beta_1=1/\lambda_1)$. Then $x_{n3} | \mathcal H_1 \sim \mathrm{Beta}(a_1, b_1=1)$ with $a_1=\alpha_1$. It is noted that $x\sim \mathrm{Gamma}(\alpha, \beta)$ denotes that $x$ has Gamma pdf with $f(x) = \frac{1}{\beta^{\alpha}\Gamma(\alpha)} x^{\alpha-1} e^{-x / \beta}$ for $x\geq 0$ and $\alpha, \beta > 0$. Under $\mathcal H_0$, $x_{n1}$, $x_{n2}$ and $x_{n3}$ are generated independently using the assumed marginal pdfs. In this example, we consider three cases. \subsubsection*{Case I} In Case I, the data at the first and second sensors are fused. In this case, the covariance matrices of $\mathbf x = [\mathbf x_1^T~\mathbf x_2^T]^T$ under the two hypotheses, $\mathbf D^0$ and $\mathbf D^1$, are composed of $\mathbf D_1^0 = \sigma_0^2 \mathbf I$, $\mathbf D_{12}^0=\mathbf D_{21}^0=\mathbf 0$, $\mathbf D_2^0 = \frac{1}{\lambda_0^2}\mathbf I$ under $\mathcal H_0$ and $\mathbf D_1^1 = \sigma_1^2 \mathbf I$, $\mathbf D_{12}^1=\mathbf D_{21}^1=\mathbf 0$, $\mathbf D_2^1 = \frac{1}{\lambda_1^2}\mathbf I$ under $\mathcal H_1$, respectively. It is worth noting that $\mathbf D^1$ is diagonal in this case. Thus, although $\mathbf x_1$ are $\mathbf x_2$ are spatially dependent under $\mathcal H_1$ (by construction), they are uncorrelated, , i. e., higher-order statistics exhibit dependence while the second-order correlation is zero. \subsubsection*{Case II }\label{example2} For Case II, we consider the fusion of data at the second and third sensors where $\mathbf x=[\mathbf x_2^T ~ \mathbf x_3^T]^T$. In this case, we have $\mathbf D_2^0 = \frac{1}{\lambda_0^2} \mathbf I$, $\mathbf D_{23}^0=\mathbf D_{32}^0=\mathbf 0$, $\mathbf D_3^0 = \frac{a_0}{(a_0+1)^2(a_0+2)}\mathbf I$ under $\mathcal H_0$ and $\mathbf D_2^1 = \frac{1}{\lambda_1^2}\mathbf I$, $\mathbf D_{23}^1=\mathbf D_{32}^1=\left(\mathbb E_{x_{n1}u}\{\frac{x_{n1}u}{u+x_{n1}}\} - \frac{a_1}{\lambda_1(a_1+1)}\right)\mathbf I$, $\mathbf D_3^1 = \frac{a_1}{(a_1+1)^2(a_1+2)}\mathbf I$ under $\mathcal H_1$, respectively. It is noted that $\mathbf D^1$ is not diagonal in this case. \subsubsection*{Case III }\label{example3} In Case III, we consider the fusion of data at all three senors. Also $\mathbf D^1$ is not diagonal in this case as well. \begin{figure}[h!] \centerline{\epsfig{figure=scatter_x1_x2_2casesH1,width=7.50cm}} \caption{Scatter plots of uncompressed and compressed data under $\mathcal H_1$ in Example 1; $N=1000$, $M=200$, $L=2$}\label{fig:scatter_L2} \end{figure} \subsubsection*{Scatter plots of uncompressed and compressed data} First, we illustrate how the dependence structure of data changes going from the uncompressed domain to the compressed domain. In Fig. \ref{fig:scatter_L2}, we show the scatter plots for both compressed and uncompressed data at the two sensors under $\mathcal H_1$ for Cases I and II. In Fig. \ref{fig:scatter_L2}, the top and bottom subplots are for Case I and Case II, respectively while the left and right subplots are for uncompressed and compressed data, respectively. It can be observed that while uncompressed data at the two sensors are strongly dependent, compressed data appears to be weakly dependent. This change of the dependence structure due to compression was addressed in Section \ref{sec_impact_dependence}. In this example, the scatter plots of compressed data look more circular (Case I) or elliptical (Case II). In Case 1, even though $x_{n1}$ and $x_{n2}$ for given $n$ are dependent under $\mathcal H_1$, they are uncorrelated. This leads to a circular and independent scatter plot for compressed data for Case I. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{Fig_Gauss_Exp_N1000_v6_ProdCop} \caption{ Case I} \label{fig:N100} \end{subfigure} ~ \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{Fig_Exp_Beta_N1000_v4_ProdCop} \caption{ Case II} \label{fig:N1000} \end{subfigure} ~ \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{ROC_L3_Comp_GaussExpBeta_ProfCop} \caption{ Case III} \label{fig:N1000} \end{subfigure} \caption{Performance of dependent data fusion for detection in Example 1: product/copula based approach with uncompressed data vs Gaussian approximation with compressed data: $N=1000$}\label{fig:ROC_case_I_II} \end{figure} \subsubsection*{Detection With uncompressed data vs. detection with compressed data via Gaussian approximation } We compare the detection performance of LR based detection with compressed and uncompressed data. The compressed detector with Gaussian approximation, `c:GA' is compared with the product approach (where dependence is ignored), `u:product', and the copula based approach, `u:copula-name', with uncompressed data. For the copula based approach, we consider Gaussian, t, Gumbel and Clayton copula functions as described in \cite{iyengar_tsp11,He_tsp2015} for the bivariate case (Cases I and II) and Gaussian and t copula for the tri-variate case (Case III). Fig. \ref{fig:ROC_case_I_II} shows the performance in terms of the ROC curves for the three cases considered in the example. The parameter values are provided in figure titles. To obtain the ROC curves, $10^3$ Monte Carlo runs were performed throughout unless otherwise specified. With the considered parameter values under the two hypotheses, `u:product' does not provide perfect detection. We make several important observations here. \begin{itemize} \item For Case I where uncompressed data at the first two sensors are dependent and uncorrelated ($\mathbf D^1$ is diagonal), `u:product', `u:copula-t', and `u:copula-Gumbel' perform much better than `c:GA' even with $c_r=1$ as can be seen in Fig. \ref{fig:ROC_case_I_II}(a). In this case, with diagonal $\mathbf D^1$, existing higher-order dependence is not taken into account in the compressed domain. \item For Case II where $\mathbf D^1$ is not diagonal, as can be seen in Fig. \ref{fig:ROC_case_I_II}(b), `c:GA' shows a significant performance gain over `u:product' after $c_r$ exceeds a certain threshold. Fusion with `u:copula-Gaussian' and `u:copula-t' leads to perfect detection while the fusion performance with `c:GA' with fairly small value of $c_r$ is also capable of providing perfect detection for the parameter values considered. \item For Case III, similar results are seen as in Case II when `c:GA' is compared with `u:product', `u:copula-Gaussian', and `u:copula-t'. \item In Cases II and III, dependence is taken into account via the covariance matrix in the compressed domain as discussed in Section \ref{sec_impact_dependence}. Thus, irrespective of the dimensionality reduction, due to the capability to capture a certain amount of dependence in the compressed domain,`c:GA' is capable of providing a significant performance gain over `u:product' and comparable performance compared to `u:copula-Gaussian', and `u:copula-t'. \item When going from Case II to Case III (i.e., from two sensors to three sensors), `c:GA' does not show a significant performance improvement for a given value of $c_r$. This is because, only $\mathbf x_2$ and $\mathbf x_3$ are spatially correlated, and $\mathbf x_1$ is uncorrelated with the rest. Thus, the covariance information accounted for in the compressed domain is the same for both cases. \end{itemize} We further illustrate the behavior of the upper bound on the probability of error for Case II. In Fig. \ref{fig:BD_KL_case_II}, we plot the Bhattacharya distance and the upper bound on the probability of error on the left and right subplots, respectively, for the same parameter values as in Fig. \ref{fig:ROC_case_I_II}(b). \begin{figure}[h!] \centerline{\epsfig{figure=BD_UBound_N1000_ExpBeta,width=9.20cm}} \caption{Bhattacharya distance and the upper on $P_e$ vs $c_r$ with compressed and uncompressed data for Case II in Example 1: $N=1000$, $1/\lambda_0=10$, $1/\lambda_1=10.2$, $a_0=9.8$, $a_1=10$}\label{fig:BD_KL_case_II} \end{figure} It is seen that $\mathcal D_{B}^{\mathrm{c:GA}}$ is much larger than $\mathcal D_{B}^{\mathrm{u:product}}$ for almost all the values of $c_r$. Based on the distance measures shown in the left subplot, it is expected for `u:copula-Gaussian', and `u:copula-t' to perform better than CS based detection for smaller values of $c_r$. However, as can be seen in the right subplot in Fig \ref{fig:BD_KL_case_II}, the upper bound on the probability of error with `c:GA' coincides ($\rightarrow 0$) that with `u:copula-Gaussian', and `u:copula-t' when $c_r$ exceeds a certain value. This observation is intuitive since these distance measures are not linearly related to the probability of error. Thus, even though $\mathcal D_{B}^{\mathrm{c:GA}} < \mathcal D_{B}^{\mathrm{u:gvn}}$ with a given suboptimal approach, compressed detection via `c:GA' can be promising, as discussed in Subsection \ref{sec_Bhatt}. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{ROC_L3_Uncomp_GaussExpBetaN100_ProdCop} \caption{ Case III} \label{fig:N1000} \end{subfigure} ~ \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{ROC_L3_Uncomp_GaussExpBetaN100_v2} \caption{ Case III} \label{fig:N100} \end{subfigure} \caption{Performance of dependent data fusion for detection in Example 1: product/copula based approach with uncompressed data vs Gaussian approximation with compressed data; $N=100$ }\label{fig_copula_v2} \end{figure} Since the difference in performance among different approaches varies as the parameter values of the statistics under two hypotheses change, in Fig. \ref{fig_copula_v2}, we show the ROC curves with another set of parameter values considering Case III for $N=100$. It can be seen that when the statistics of the data under the two hypotheses are such that `u:product' does not provide perfect detection, `c:GA' outperforms `u:product' when $c_r$ exceeds a certain threshold. Further, as $c_r$ increases, `c:GA' shows similar performance as with `u:copula-t' and `u:copula-Gaussian'. Results in Fig. \ref{fig_copula_v2} again verify that the amount of dependence captured in the compressed domain via Gaussian approximation leads to better detection performance than `u:product' and similar performance as with the copula based approaches. \subsubsection{Example 2} In the second example, we consider the detection of a signal in the presence of noise with $L=2$ where the signals of interest at the two nodes are (spatially) dependent of each other under $\mathcal H_1$. The model for heterogeneous uncompressed sensor data is given by \begin{eqnarray} \mathcal H_1&:& \mathbf x_j = \mathbf s_j + \mathbf v_j\nonumber\\ \mathcal H_0&:& \mathbf x_j = \mathbf v_j \end{eqnarray} for $j=1,2$. The noise vector $\mathbf v_j$ is assumed to be Gaussian with mean vector $\mathbf 0$ and covariance matrix $\sigma_v^2 \mathbf I$. We assume that the $n$-th elements of $\mathbf s_1$ and $\mathbf s_2$, respectively, are governed by a common random phenomenon so that they are dependent. For illustration purposes, we assume that the dependence model is given by: $s_{n1} = s_n^2 + w_{n1}^2$, $s_{n2} = s_n^2 + u_{n1}^2+u_{n2}^2$, where the random variables $s_n, w_{n1}, u_{n1}, u_{n2}$ are iid Gaussian with mean zero and variance $\sigma_s^2$. With this model, $s_{n1}\sim \mathrm{exp}(\lambda_1)$ with $\lambda_1 = \frac{1}{2 \sigma_s^2}$ and $\frac{s_{n2}}{\sigma_s^2} \sim \mathcal X_3^2$ where $x\sim \mathcal X_{\nu}^2$ denotes that $x$ has a chi-squared pdf with degree of freedom $\nu$. Then, it can be shown that the marginal pdfs of $x_{n1}$ and $x_{n2}$ are given by $f_1( x_{n1}|\mathcal H_1) = \lambda_1 e^{-\lambda_1 x_{n1}} e^{\frac{\sigma_v^2\lambda_1^2}{2}}\left(1-Q\left(\frac{x_{n1}-\sigma_v^2 \lambda_1}{\sigma_v}\right)\right)$ where $Q(\cdot)$ denotes the Gaussian $Q$ function and $f_1( x_{n2}|\mathcal H_1) = \frac{\sqrt{\sigma_v}}{2\pi \sigma_s^3}e^{\frac{1}{8\sigma_v^2\sigma_s^4}} e^{-\frac{1}{4\sigma_v^2}\left(x_{n2}+\frac{\sigma_v^2}{2\sigma_s^2}\right)^2} G_{-3/2} \left(\frac{\sigma_v^2 - 2\sigma_s^2 x_{n2}}{2\sigma_s^2 \sigma_v}\right)$ where $G_p(z) = \frac{e^{-\frac{z^2}{4}}}{\Gamma(-p)}\int_0^{\infty} e^{-xz -\frac{x^2}{2}} x^{-p-1} dx$ with $p < 0$. Under $\mathcal H_0$, $x_{n1}$ and $x_{n2}$ have Gaussian pdfs with mean zero and variance $\sigma_v^2$. In this example, we have non-diagonal $\mathbf D^1$ with $\mathbf D^1_1=(\sigma_v^2+\frac{1}{\lambda_1^2})\mathbf I$, $\mathbf D_{12}^1=\mathbf D_{12}^1=2 \sigma_s^4\mathbf I$ and $\mathbf D_2^1 = (\sigma_v^2+6\sigma_s^4)\mathbf I$. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{ROC_Example_2_Sigv2_2_ExpChi} \caption{$N=100$, $\sigma_v^2=2$, $\sigma_s^2=0.1$, $1/\lambda_1=0.2$} \label{fig:N1000} \end{subfigure} ~ \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{ROC_Example_2_Sigv2_2_ExpChiN1000} \caption{ $N=1000$, $\sigma_v^2=2$, $\sigma_s^2=0.1$, $1/\lambda_1=0.2$} \label{fig:N100} \end{subfigure} \caption{Performance of dependent data fusion for detection in Example 2: Product approach with uncompressed data vs Gaussian approximation with compressed data}\label{fig_Eg_2} \end{figure} In Figs. \ref{fig_Eg_2}(a) and \ref{fig_Eg_2}(b), we plot the ROC curves for $N=100$ and $N=1000$, respectively. The considered values for $\sigma_v^2$, $\sigma_s^2$ (and $\frac{1}{\lambda_1}= 2\sigma_s^2$) are stated in the figure captions. We compare the performance of `c:GA' with that of `u:product'. With the considered parameter values, the performance of `u:product' with $N=100$ is not very good. However, `c:GA' performs significantly better than `u:product' as $c_r$ increases. With $N=1000$, `u:product' shows almost close to prefect detection while similar or better performance is achieved with `c:GA' with a very small value for $c_r$. As shown in Table \ref{table_example2}, `u:product' in this example consumes a significant amount of computational power compared to `c:GA'. Fig. \ref{fig_Eg_2} and Table \ref{table_example2} verify the applicability of the proposed approach in the presence of spatially dependent and correlated data in terms of both performance and computational complexity. \begin{remark} In Examples 1 and 2, the parameter values are selected such that the mean parameters of uncompressed data under the two hypotheses at a given node are not significantly different from each other. Otherwise, `u:product' can work well since then the second or higher order statistics are not significant to distinguish between the two hypotheses. In such scenarios, efforts to model dependence do not carry additional benefits to the fusion problem, thus such scenarios are not of interest in this paper. \end{remark} \begin{remark} Covariance matrices, which measure the degree of linear dependence, partially describe the dependence structure of multivariate data (when the variables are multivariate Gaussian, this description is complete). In particular, when the uncompressed data is non-Gaussian, dependent, and uncorrelated, the covariance information is not capable of characterizing the true dependence. Thus, when such data is compressed via random projections, the dependence information is unaccounted for in the compressed domain while performing `c:GA'. \end{remark} \begin{remark} When the uncompressed data is non-Gaussian, dependent and correlated, the covariance information partially characterizes the true dependence. In this case, when the data is compressed via random projections, the dependence information characterized by the covariance matrix (with a certain distortion/change) is partially accounted for in the compressed domain while performing `c:GA'. \end{remark} \subsection{Computational and Communication Complexity} With `c:GA', the computational complexity of computing the decision statistic \eqref{stat_Gaussian} is dominated by the computation of ${\mathbf C^1}^{-1}$ (computation of ${\mathbf C^0}^{-1}$ is straight forward since $\mathbf C^0$ is diagonal due to spatial and temporal independence assumption under $\mathcal H_0$). Computation of ${\mathbf C^1}^{-1}$ is also straight-forward when the elements of $\mathbf x$ are uncorrelated (as considered in Case I in Example 1) since then $\mathbf C^1$ becomes diagonal. With spatially correlated uncompressed data, computation of the inverse of a $ML\times ML$ matrix is required. For $L=2$, $\mathbf C^1$ can be partitioned into $4$ blocks of each of size $M\times M$, and the matrix inversion Lemma in block form can be exploited. This way, it is necessary to compute the inverse of a $M\times M$ matrix. For $L>2$, the block inversion Lemma can be still used with nested partitions to compute ${\mathbf C^1}^{-1}$. With `u:product', the likelihood ratio is computed using the given marginal pdfs. For the copula based approaches, computation of the parameters corresponding to a given copula function is required in addition to the computation of the joint marginal pdfs. The parameters that need to be computed for different copula functions considered above are summarized in Table I in \cite{He_tsp2015}. For illustration, we provide in the following, the average run time (in seconds) required to compute the decision statistic for Examples 1 and 2 considered above with different approaches. For Example 1, Cases II and III are considered with $N=100,1000$ in Table. \ref{table_example}. For Example 2, run times with $N=100$ and $N=1000$ are shown in Table \ref{table_example2}. The run time is computed with MATLAB in a Intel(R) Core(TM) i7-3770 CPU$@$ 3.40GHzz processor with 12 GB RAM. To estimate the parameters for each copula function, we use the 'copulafit' function and copula density was computed using the function 'copulapdf' in Matlab. \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \caption{Average run time (in seconds) required to compute decision statistics in Example 1} \label{table_example} \centering \begin{tabular}{|l|l|l|} \hline Approach & $N=100$ & $N=1000$\\ $~$ & Case II ~ Case III & Case II ~ Case III\\ $~$ & ($L=2$) ~ ($L=3$) & ($L=2$) ~ ($L=3$)\\ \hline `u:product' & 0.0080 ~~~~~~~~~ 0.0281 & 0.0107~~~~~~~ 0.0322\\ \hline `u:copula-Gaussian' & 0.0105 ~~~~~~~~~ 0.0314 & 0.0138~~~~~~~ 0.0359\\ \hline `u:copula-t' & 0.0664 ~~~~~~~~~ 0.0948 &0.2730 ~~~~~~ 0.3634\\ \hline `c:GA', $c_r=0.1$ &1.2239e-04 ~ 1.2334e-04 & 7.3375e-04 ~ 0.0016\\ \hline `c:GA', $c_r=0.2$ & 1.4958e-04 ~ 1.5876e-04 & 0.0016 ~~~~~~ 0.0029\\ \hline `c:GA', $c_r=0.5$ &2.4795e-04 ~ 2.5894e-04& 0.0091 ~~~~~~ 0.0097\\ \hline `c:GA', $c_r=0.9$ & 3.0501e-04 ~ 3.5743e-04 & 0.0293 ~~~~~~ 0.0294\\ \hline \end{tabular} \end{table} \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \caption{Average run time (in seconds) required to compute decision statistics in Example 2} \label{table_example2} \centering \begin{tabular}{|l|l|l|} \hline Approach & $N=100$ & $N=1000$ \\ \hline `u:product' & 0.1425 & 1.4520 \\ \hline `c:GA', $c_r=0.1$ & 4.5356e-04 & 0.0092 \\ \hline `c:GA', $c_r=0.2$ & 6.8284e-04 & 0.0436 \\ \hline `c:GA', $c_r=0.5$ & 0.0027 & 0.4786\\ \hline \end{tabular} \end{table} It can be seen that, `c:GA' with even fairly large $c_r$ ($< \approx 0.5$) consumes less time than all the approaches considered with uncompressed data for both examples. In Example 2 where the marginal pdfs are not readily available to compute the decision statistic for `u:product', this gap in run times becomes more significant. In terms of the communication overhead, to perform all the suboptimal approaches considered with uncompressed data, each node is required to transmit its length-$N$ observation vector to the fusion center. On the other hand, with `c:GA', each node is required to transmit only a length-$M$ ( $M < N$) vector. Thus, the communication overhead, in terms of the total number of messages to be transmitted by each node, is reduced by a factor of $c_r=\frac{M}{N}$ with `c:GA' compared to all the approaches with uncompressed data. In summary, from Examples 1 and 2, we can conclude the following: \begin{itemize} \item The computational complexity of `c:GA' with small $c_r$ is significantly less than that with the other approaches with uncompressed data. \item The communication overhead of `c:GA' is reduced by a factor $c_r$ compared to all the other approaches with uncompressed data. \item `c:GA' performs significantly better than `u:product' and shows similar/comparable performance as that with the copula based approach when the covariance matrix of uncompressed data under $\mathcal H_1$ is non-diagonal given that the mean parameters of data under the two hypotheses are not significantly different from each other. \item With dependent but uncorrelated uncompressed data, `c:GA' can still be advantageous in terms of the computational/communication complexity at the expense of a small loss of performance compared to `u:product' and quite significant performance loss compared to the copula based approaches. \end{itemize} \section{Detection with Compressed Dependent Data Based on Second Order Statistics of Uncompressed Data}\label{sec_covariance} In Section \ref{sec_likelihood}, the detection problem was solved in the compressed domain assuming that the marginal pdfs and the first and second order statistics of the uncompressed data under each hypothesis are known (or can be accurately estimated). However, these assumptions may be too restrictive in practical settings. In the following, we consider a nonparametric approach where the goal is to compute a decision statistic for detection based on the statistics of uncompressed data where such statistics are estimated from compressed measurements. Consider that each node (modality) has access to a stream of data $\mathbf x_j(t)$ for $t=1,\cdots,T$. Further let $\mathbf x(t)=[\mathbf x_1(t)^T, \cdots, \mathbf x_L(t)^T]^T$ and redefine $\mathbf D_x$ to be the covariance matrix of $\mathbf x(t)$. We consider a decision statistic of the form \begin{eqnarray*} \Lambda_{\mathrm{cov}} = f(\mathbf D_x). \end{eqnarray*} Under $\mathcal H_0$, $\mathbf D_x$ is diagonal with the assumption that the data is independent across time and space. Under $\mathcal H_1$, $\mathbf D_x$ can have off-diagonal elements in the presence of spatially correlated multimodal data. Since the covariance matrix has different structures under the two hypotheses, a decision statistic based on uncompressed covariance matrix can be computed. There are several covariance based decision statistics computed in \cite{Zeng_C2007,Zeng_VT09}. Covariance absolute value (CAV) detection is considered in \cite{Zeng_C2007,Zeng_VT09}. With CAV, the decision statistic becomes \begin{eqnarray} \Lambda_{\mathrm{cov}} = \frac{\underset{i}{\sum}\underset{j}{\sum}| \mathbf D_x[i,j]|}{\underset{i}{\sum}|\mathbf D_x[i,i]|}. \label{Lamda_1} \end{eqnarray} With this statistic, when there are off-diagonal elements in the covariance matrix, we have $\Lambda_{\mathrm{cov}} > 1$ while $\Lambda_{\mathrm{cov}}=1$ when the off diagonal elements are zeros. The goal is to get an approximation to $\Lambda_{\mathrm{cov}}$ based on compressed data $\mathbf y(t)=\mathbf A \mathbf x(t)$ for $t=1,\cdots,T$ where $\mathbf A$ is as defined in (\ref{eq_A}). The covariance matrix of $\mathbf y(t)$, $\mathbf C_y$, can be expressed as \begin{eqnarray*} \mathbf C_y = \mathbf A \mathbf D_x \mathbf A^T. \end{eqnarray*} Note that, $\underset{i}{\sum} \mathbf D_x[i,i] = \mathrm{tr}(\mathbf D_x)$. We have \begin{eqnarray*} \mathrm{tr}(\mathbf C_y) &=& \mathrm{tr}(\mathbf A \mathbf D_x \mathbf A^T)= \mathrm{tr}(\mathbf A^T \mathbf A \mathbf D_x ). \end{eqnarray*} When $\mathbf A_j$ is selected as an orthoprojector for $j=1,\cdots,L$, we may approximate $\mathbf A^T \mathbf A \approx \frac{M}{N} \mathbf I$. Then, we have \begin{eqnarray*} \mathrm{tr}(\mathbf C_y) \approx \frac{M}{N}\mathrm{tr}(\mathbf D_x ), \end{eqnarray*} and, thus, $\mathrm{tr}(\mathbf D_x ) = \frac{N}{M} \mathrm{tr}(\mathbf C_y)$. Here we approximate $\mathbf C_y $ by the sample covariance matrix computed as \begin{eqnarray} \tilde{\mathbf C}_y = \frac{1}{T}\sum_{t=1}^T [\mathbf y(t)-\mathbb E(\mathbf y(t))][\mathbf y(t)-\mathbb E(\mathbf y(t))]^T.\label{cov_sample} \end{eqnarray} Then, the decision statistic (\ref{Lamda_1}) reduces to \begin{eqnarray} \Lambda_{\mathrm{cov}} = \frac{\eta + 2\sum_{i=1}^{NL-1} \sum_{j=i+1}^{NL} |\mathbf D_x[i,j]|}{\eta}\label{Lamda_1_2} \end{eqnarray} where $\eta= \frac{N}{M } \mathrm{tr}(\tilde{\mathbf C}_y)$. The goal is to estimate the off-diagonal elements of $\mathbf D_x$ based on $\tilde{\mathbf C}_y$. It is noted that estimation of the complete covariance matrix, $\mathbf D_x$, is not necessary to construct $\Lambda_{\mathrm{cov}}$ in \eqref{Lamda_1_2}. In the case where only spatial samples are dependent and the time samples of each modality are independent, the covariance matrix has only a $2(L-1)$ diagonals (in addition to the main diagonal) with nonzero elements. In the following, we describe a procedure to compute $\Lambda_{\mathrm{cov}}$ in (\ref{Lamda_1_2}) based on $\tilde{\mathbf C}_y$ when there is spatial dependence of data so that $\mathbf D_x$ has a known structure. Note that we may write $\tilde{\mathbf C}_y$ as \begin{eqnarray} \tilde{\mathbf C}_y &=& \underset{i,j}{\sum} \mathbf D_x[i,j] \mathbf a_i \mathbf a_j^T. \end{eqnarray} Let $\mathcal U$ be a set consisting of $(i,j)$ pairs corresponding to the desired off-diagonal elements in the upper (or lower) triangle of $\mathbf D_x$. The $m$-th pair in $\mathcal U$ is denoted by, $(\mathcal U(m,1), \mathcal U(m,2))$ and $\tilde N= |\mathcal U|$. \begin{proposition} Let $\mathbf d_{U}$ be the vector containing elements $\mathbf D_x[i,j] $ for $(i,j)\in \mathcal U$. The least squares solution of $ \mathbf d_{U}$ is given by \begin{eqnarray} \hat {\mathbf d}_U = \mathbf B^{-1} \mathbf b\label{LS_solution_general} \end{eqnarray} where $\mathbf B$ is a $\tilde N\times \tilde N$ matrix whose $(m,r)$-th element is given by \begin{eqnarray} \mathbf B[m,r] = \mathbf a_{\mathcal U(r,2)}^T \mathbf a_{\mathcal U(m,2)} \mathbf a_{\mathcal U(m,1)}^T \mathbf a_{\mathcal U(r,1)}\label{LS_B} \end{eqnarray} and $\mathbf b$ is a $\tilde N\times 1$ vector with \begin{eqnarray} \mathbf b = [\mathbf a_{\mathcal U(1,2)}^T\tilde{\mathbf C}_y^T \mathbf a_{\mathcal U(1,1)}, \cdots, \mathbf a_{\mathcal U(\tilde N,2)}^T\tilde{\mathbf C}_y^T \mathbf a_{\mathcal U(\tilde N,1)}]^T.\label{LS_b} \end{eqnarray} \end{proposition} \begin{proof} Let $\mathbf R = \tilde{\mathbf C}_y - \underset{(i,j)\in \mathcal U}{\sum} \mathbf D_x[i,j] (\mathbf a_i \mathbf a_j^T + \mathbf a_j \mathbf a_i^T) = \tilde{\mathbf C}_y - \sum_{m=1}^{\tilde N} \mathbf d_{U}[m]\tilde{\mathbf A}_m$ where $\tilde{\mathbf A}_m = \mathbf a_{\mathcal U(m,1)} \mathbf a_{\mathcal U(m,2)}^T + \mathbf a_{\mathcal U(m,2)} \mathbf a_{\mathcal U(m,1)}^T$. The LS solution of $\mathbf d_{U}$ is found by solving \begin{eqnarray} \hat{\mathbf d}_{U} =\underset{\mathbf d_{U}}{\arg\min} ||\mathbf R||_F^2 = \underset{\mathbf d_{U}}{\arg\min} ~ \mathrm{tr}(\mathbf R \mathbf R^T). \label{LS_problem} \end{eqnarray} We can express $\mathrm{tr}(\mathbf R \mathbf R^T)$ as, \begin{eqnarray} \mathrm{tr}(\mathbf R \mathbf R^T) = \mathrm{tr}(\tilde{\mathbf C}_y \tilde{\mathbf C}_y ^T) - 2 \tilde{\mathbf b}^T\mathbf d_U + \mathbf d_U^T \tilde{\mathbf B} \mathbf d_U\label{RRt} \end{eqnarray} where $\tilde{\mathbf b}[m] = \mathrm{tr}(\tilde{\mathbf C}_y \tilde{\mathbf A}_m^T)$ for $m=1,\cdots, \tilde N$ and $\tilde{\mathbf B} [m,r] = \mathrm{tr}(\tilde{\mathbf A}_m\tilde{\mathbf A}_m^T)$ for $m,r=1,\cdots, \tilde N$. Taking the derivative of \eqref{RRt} with respect to $\mathbf d_{U}$, $\hat{\mathbf d}_{U}$ is found as \begin{eqnarray} \hat{\mathbf d}_{U} = \tilde{\mathbf B}^{-1} \tilde{\mathbf b}. \end{eqnarray} It can be easily shown that $\tilde{\mathbf B} = 2\mathbf B$ and $\tilde{\mathbf b} = 2{\mathbf b}$ where ${\mathbf B}$ and $\mathbf b$ are as defined in \eqref{LS_B} and \eqref{LS_b}, respectively, resulting in \eqref{LS_solution_general} which completes the proof. \end{proof} Then, $\Lambda_{\mathrm{cov}}$ in \eqref{Lamda_1_2} reduces to \begin{eqnarray} \Lambda_{\mathrm{cov}} = \frac{\eta + 2||\hat {\mathbf d}_U||_1}{\eta}.\label{Lamda_1_BiV} \end{eqnarray} \subsection{Illustrative Example} To illustrate the detection performance with the test statistic $\Lambda_{\mathrm{cov}}$ in \eqref{Lamda_1_BiV}, we consider Example 1 given in Section \ref{example} with Case II, in which the goal is to detect the change of the statistical parameters due to a common random phenomenon. Uncompressed data is generated based on the considered marginal pdfs under the two hypotheses and the dependence model under $\mathcal H_1$ the as considered in Case II in Example 1. Detection using \eqref{Lamda_1_BiV} is performed assuming that the second order statistics of uncompressed data are not known under any hypothesis and estimating them with compressed measurements. For this case, there are only two nonzero off diagonals of $\mathbf D_x$ in which the values are the same (say $d_U$). To compute $\Lambda_{\mathrm{cov}}$, estimation of only $d_U$ is required which is given by $ \hat { d}_U = \frac{\mathbf b^T\mathbf 1}{\mathbf 1^T \mathbf B \mathbf 1} $ where $\mathbf B$ and $\mathbf b$ are as defined in \eqref{LS_B} and \eqref{LS_b}, respectively. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{L2_ExpBeta_CovEst_Ncov10_GA_Energy} \caption{$c_r$ varies, $T=10$} \label{fig:N100} \end{subfigure} ~ \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{L2_ExpBeta_CovEst_NcovT_GA_cr004} \caption{ $T$ varies, $c_r=0.04$} \label{fig:N1000} \end{subfigure} \caption{Detection performance with the test statistic \eqref{Lamda_1_BiV}; $N=1000$}\label{fig:cov_Gauss} \end{figure} In Fig. \ref{fig:cov_Gauss}, we plot ROC curves with the test statistic (\ref{Lamda_1_BiV}) for different values for $c_r$ and $T$ where $T$, as defined earlier, is the number of sample vectors available for each modality. The detector with the test statistic (\ref{Lamda_1_BiV}) is denoted as `c:Cov'. The parameters used to generate data under the two hypotheses are the same as were used in Fig. \ref{fig:ROC_case_I_II} (b). ROC curves are generated using $1000$ Monte Carlo runs. In Fig. \ref{fig:cov_Gauss} (a), the performance of `c:Cov' is shown for different values of $c_r$ keeping $T=10$. We compare the results obtained using the energy detector with compressed as well as uncompressed data, denoted by `c:Energy', and `u:Energy', respectively, which is a widely used nonparametric detector. The test statistic of `u:Energy' and `c:Energy' is given by $\Lambda_{\mathrm{u:Energy}} = \sum_{t=1}^T ||\mathbf x(t)||_2^2$, and $\Lambda_{\mathrm{c:Energy}} = \sum_{t=1}^T ||\mathbf y(t)||_2^2$, respectively. Further the detection performance with Gaussian approximation, `c:GA', is also shown which assumes that the statistics of uncompressed data are known. With the parameter values considered, for given $c_r$ and $T$, it is seen from Fig. \ref{fig:cov_Gauss} (a) that `c:Cov' significantly outperforms `c:Energy' and `c:Cov'. Compared to `u:Energy', `c:Cov' outperforms `u:Energy' after $c_r$ exceeds a certain value (which is very small). In Fig. \ref{fig:cov_Gauss} (b), the detection performance is shown as $T$ varies for $c_r=0.04$ so that $M=40$. As can be seen in Fig. \ref{fig:cov_Gauss} (b), detection performance improves as $T$ increases for all the detectors. For `c:Cov', the estimate of $\hat { d}_U$ becomes more accurate as $T$ increases. However, the value of $T$ that is capable of providing almost perfect detection with `c:Cov' is not very large compared to $M$. As can be seen in Fig. \ref{fig:cov_Gauss} (b), almost perfect detection is achieved when $T=20$ for the parameter values considered which is less than $M$. Further, `c:Cov' outperforms `u:Energy' and `c:Energy' for all the values of $T$ considered while the performance gain achieved by `c:Cov' is significant compared to `c:Energy'. Next, we illustrate the robustness of `c:Cov'. A CAV based test statistic as in \eqref{Lamda_1} has been used to detect a signal in the presence of Gaussian noise in \cite{Zeng_C2007,Zeng_VT09} without any compression. It has been shown that the threshold required to keep the probability of false alarm, $P_f$, under a desired value, $\alpha_0$, is independent of the noise power making the CAV based detector more robust than the energy detector against the uncertainties of the noise power. With the CAV based test statistic computed in this paper based on the compressed data as in \eqref{Lamda_1_BiV}, the computation of the threshold, $\tau_C$, in closed-form so that $P_f\leq \alpha_0$ is computationally intractable. In the above example, uncompressed data under $\mathcal H_0$ is non-Gaussian and the marginal pdfs of data at the two sensors are parameterized by $\lambda_0$ and $a_0$, respectively. In Fig. \ref{fig:threshold}, we plot the threshold vs $\lambda_0$ and $a_0$ to ensure $P_f \leq \alpha_0$ keeping $N$ are $T$ are fixed. With `u:Energy', $\Lambda_{\mathrm{u:Energy}} | \mathcal H_0$ can be approximated by a Gaussian random variable with mean $\mu_{u,E}$ and variance $\sigma_{u,E}^2$ as $NT$ is sufficiently large where $\mu_{u,E} = NT \left(\frac{2}{\lambda_0^2} + \frac{a_0}{a_0+2}\right)$ and $\sigma_{u,E}^2 = NT \left(\frac{20}{\lambda_0^2} + \frac{4a_0}{(a_0+4)(a_0+2)^2}\right)$. Then, the threshold, $\tau_{u,E}$, so that $P_f\leq \alpha_0$ can be obtained as $\tau_{u,E} = NT \left(\frac{2}{\lambda_0^2} + \frac{a_0}{a_0+2}\right) + Q^{-1}(\alpha_0) \sqrt{NT\left(\frac{20}{\lambda_0^2} + \frac{4a_0}{(a_0+4)(a_0+2)^2}\right)}$ where $Q^{-1}(\cdot)$ denotes the inverse Gaussian $Q$ function. Similarly with `c:Energy', the threshold $\tau_{c,E}$ can be found as $\tau_{c,E} = MT \left(\frac{2}{\lambda_0^2} + \frac{a_0}{a_0+2}\right) + Q^{-1}(\alpha_0) \sqrt{MT\left(\frac{20}{\lambda_0^2} + \frac{4a_0}{(a_0+4)(a_0+2)^2}\right)}$. In Fig. \ref{fig:threshold}, the threshold required to keep $P_f\leq \alpha_0$ with `c:Cov'` and `u:Energy' vs $a_0$ and $\lambda_0$ is shown for given $N$ and $T$. It can be observed that the variation of $\tau_C$ with respect to $a_0$ and $\lambda_0$ is fairly small (negligible). However, $\tau_{u:E}$ varies significantly as $a_0$ and $\lambda_0$ vary (similar observations are seen for $\tau_{c:E}$ while the figures are not included for brevity). Thus, in addition to the performance gain achieved over `u:Energy' (and `c:Energy'), `c:Cov' is more robust against the uncertainties of the signal parameters under $\mathcal H_0$ than the energy detector. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{L2_ExpBeta_CovEst_Threshold_cr004_T40_T10} \caption{`c:Cov'} \label{fig:N100} \end{subfigure} \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{L2_ExpBeta_Energy_Threshold_cr004_T40_T10} \caption{`u:Energy'} \label{fig:N1000} \end{subfigure} \caption{Threshold of `c:Cov' and `u:Energy' vs $a_0$ and $\lambda_0$}\label{fig:threshold} \end{figure} \subsection{Computational Complexity} For $\Lambda_{\mathrm{cov}}$, the computation of $\mathbf B^{-1}$ and $\mathbf b$ as in \eqref{LS_B} and \eqref{LS_b}, respectively is required in addition to computing the sample covariance matrix $\tilde {\mathbf C}_y$. Computation of $\Lambda_{\mathrm{u:Energy}}$ and $\Lambda_{\mathrm{c:Energy}}$ is straight forward from $\mathbf x(t)$ and $\mathbf y(t)=\mathbf A \mathbf x(t)$, respectively, for $t=1,\cdots,L$. The run times required to compute the decision statistics for the four approaches considered in Fig. \ref{fig:cov_Gauss}(a) are listed in Table \ref{table_example3} when the input is given as $\mathbf x(t)$ for $t=1,\cdots,L$. The statistic of `c:GA' is independent of $T$ since we assume perfect knowledge of the covariance matrix of uncompressed data for the Gaussian approximation based approach. It is noted that, the decision statistic was computed over $10^3$ trials to get the average run time. From Table \ref{table_example3}, it can be observed that a relatively large run time is required for `c:Cov' compared to the other approaches. This is the price to pay for the performance gain achieved as depicted in Fig. \ref{fig:cov_Gauss} (a) and the robustness in threshold setting against the signal parameters under $\mathcal H_0$ as depicted in Fig. \ref{fig:threshold}. Further, in `c:Cov', the run time does not significantly increase when $T$ increases (going from $T=10$ to $T=40$) although this increase in $T$ can improve the performance as can be seen in Fig. \ref{fig:cov_Gauss} (b). \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \caption{Average run time (in seconds) required to compute decision statistics for `c:Cov', `c:GA', `c:Energy' and `u:Energy' for Case II in Example 2} \label{table_example3} \centering \begin{tabular}{|l|l|l|} \hline Approach & $N=1000$ & $N=1000$ \\ $~$& $T=10$ & $T=40$\\ \hline `u:Energy' & 6.1529e-04 & 0.0027 \\ \hline `c:Energy' $c_r=0.02$ & 3.4280e-04 & 7.7378e-04 \\ \hline `c:Energy' $c_r=0.04$ & 4.5460e-04 & 0.0011 \\ \hline `c:Energy' $c_r=0.06$ & 5.3973e-04 & 0.0014\\ \hline \hline `c:GA' $c_r=0.02$ & 4.0746e-04 & 4.0746e-04 \\ \hline `c:GA' $c_r=0.04$ & 4.9580e-04 & 4.9580e-04 \\ \hline `c:GA' $c_r=0.06$ & 5.5683e-04 & 5.5683e-04\\ \hline \hline `c:Cov' $c_r=0.02$ & 0.0137 & 0.0148 \\ \hline `c:Cov' $c_r=0.04$ & 0.0163 & 0.0178 \\ \hline `c:Cov' $c_r=0.06$ & 0.0258 & 0.0277 \\ \hline \end{tabular} \end{table} \section{Experimental Results with Real Data}\label{sec_simulation} To further validate the detection performance with multimodal data in the compressed domain with the proposed approaches, in this section, we consider real experimental data. We use the footstep data, made available by the US Army Research Laboratory (ARL), collected at the US southwest border. The dataset consists of raw observations from several acoustic, seismic and PIR sensors that were deployed in an outdoor space to record human and animal activity that is typical in perimeter and border surveillance scenarios. The participants in the data collection exercise walked/ran along a predetermined path with sensors laid out along either side of the path. In the following experiments, we consider two cases; detection of one man walking and a man leading a horse based on data at two sensors (one acoustic and one seismic). Each seismic/acoustic time series contains a leading $60s$ of background data. For the detection problem, we use this as $\mathcal H_0$ data. The data are sampled at $10kHz$, and are mean centered and oscillatory in nature. The time series data at each sensor was split into non-overlapping frames of size $N$. Further, $N_{tr}$ frames were used for training under each hypothesis and $N_{mont} $ frames were used for test. \begin{figure}[h!] \centering \begin{subfigure}[b]{0.38\textwidth} \includegraphics[width=\textwidth]{roc_ac_seismic_N200_NcNm250_onemanwalking_Product} \caption{one man walking, $N=200$} \label{fig:N100} \end{subfigure} ~ \begin{subfigure}[b]{0.38\textwidth} \includegraphics[width=\textwidth]{roc_ac_ss_GaussA_Product_N200_NtrNmt500} \caption{man leading horse; $N=200$} \label{fig:N1000} \end{subfigure} \caption{Detection performance with compressed and uncompressed data; $L=2$ (one seismic and one acoustic sensor)}\label{fig:seismic_acoustic} \end{figure} In Fig. \ref{fig:seismic_acoustic}, we show the performance when detection is performed with `c:GA' (it is noted that we show the detection performance only with the Gaussian approximation due to the limited number of samples to implement the covariance based approach). The mean and the covariance matrices of compressed data under each hypotheses are estimated using the training data. The values used for $N$, $N_{tr}$ and $N_{mont}$ for the two cases are shown in figure titles. We further plot the detection performance with `u:product'. To obtain the marginal pdfs of uncompressed data under $\mathcal H_1$, a kernel based density estimate is computed using the training data with the Gaussian kernel. Under $\mathcal H_0$, the data is assumed to be iid Gaussian where the mean and the variance were estimated using the training data. For both cases, it is observed that `c:GA' with a small compression ratio, (e.g., $c_r = 0.05$), outperforms detection with `u:product'. Another observation is that, when $c_r$ increases beyond a certain threshold, the performance does not monotonically improve (e.g., performance with $c_r=0.2$ is better than that with $c_r=0.4$ in Fig. \ref{fig:seismic_acoustic}). This is because, when $c_r$ (thus $M$) increases, more training samples are needed to estimate $\mathbf C^0$ and $\mathbf C^1$ accurately as required in (\ref{stat_Gaussian}). When the amount of training data available is limited, the estimates of $\mathbf C^0$ and $\mathbf C^1$ become less accurate as $M$ increases leading to degraded detection performance. However, with the available (limited) number of samples, detection with `c:GA' provides better performance with small $c_r$ values than detection using the product approach with uncompressed data. \section{Conclusion}\label{sec_conclusion} Optimal decision fusion with high dimensional multimodal dependent data is a challenging problem. In this paper, we explored the potential of CS in capturing the dependence structures of spatially dependent data to develop efficient decision statistics for detection in the compressed domain. In addition to the inherent benefits of CS in terms of low computational and communication overhead compared to processing and transmitting high dimensional data, we showed that the performance of CS based detection with dependent data using LR can be better than or similar to several suboptimal detection techniques with uncompressed data under certain conditions. We discussed conditions under which modeling dependence in the compressed domain using Gaussian approximation is more efficient and effective than modeling dependence with uncompressed data which is computationally expensive most of the time. We further discussed a nonparametric approach for detection where a decision statistic is computed based on the covariance matrix of uncompressed data and the statistic is estimated in the compressed domain. This approach can provide better performance when the non-Gaussian uncompressed data is highly correlated with an additional computational cost compared to that is required for the Gaussian approximation based approach. Further, the proposed compressed covariance based detector is more robust than the widely considered nonparametric detector; the energy detector. \bibliographystyle{IEEEtran}
{'timestamp': '2017-07-24T02:01:38', 'yymm': '1701', 'arxiv_id': '1701.01352', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01352'}
arxiv
\section{Introduction} With the wide use of advanced database technology developed during past decades, it is not difficult to efficiently store huge volume of data in computers and retrieve them whenever needed. Although the stored data are a valuable asset of an organization, most organizations may face the problem of {\em data rich but knowledge poor \/} sooner or later. This situation aroused the recent surge of research interests in the area of data mining~\cite{Agra-etal92,Han-etal92,Agra-etal93}. One of the data mining problems is {\em classification. \/} Data items in databases, such as tuples in relational database systems usually represent real world entities. The values of the attributes of a tuple represent the properties of the entity. Classification is the process of finding the common properties among different entities and classifying them into $classes$. The results are often expressed in the form of rules -- the {\em classification rules. \/} By applying the rules, entities represented by tuples can be easily classified into different classes they belong to. We can restate the problem formally defined by Agrawal {\em et al.\/} \cite{Agra-etal92} as follows. Let $A$ be a set of attributes {$A_1, A_2, \ldots, A_n$} and $dom(A_i)$ refer to the set of possible values for attribute $A_i$. Let $C$ be a set of classes {$c_1, c_2, \ldots, c_m$}. We are given a data set, {\em the training set \/} whose members are $(n+1)$-tuples of the form ($a_1, a_2, \ldots, a_n, c_k$) where $a_i \in dom(A_i), (1 \leq i \leq n) $ and $c_k \in C ( 1 \leq k \leq m) $. Hence, the class to which each tuple in the training set belongs is known for supervised learning. We are also given a second large database of $(n+1)$-tuples, the testing set. The classification problem is to obtain a set of rules $R$ using the given training data set. By applying these rules to the testing set, the rules can be checked whether they generalize well (measured by the predictive accuracy). The rules that generalize well can be safely applied to the application database with unknown classes to determine each tuple's class. This problem has been widely studied by researchers in the AI field~\cite{Weis-Kuli91}. It is recently re-examined by database researchers in the context of large database systems~\cite{Cerc-Tsuc93,Fraw-etal92,Piat92,Piat95,Math-etal93}. Two basic approaches to the classification problems studied by AI researchers are the symbolic approach and the connectionist approach. The symbolic approach is based on decision trees and the connectionist approach mainly uses neural networks. In general, neural networks give a lower classification error rate than the decision trees but require longer learning time~\cite{Quin94,Shav-etal91,Russ-Norv95}. While both approaches have been well received by the AI community, the general impression among the database community is that the connectionist approach is not well suited for data mining. The major criticisms include the following: \begin{enumerate} \item Neural networks learn the classification rules by multiple passes over the training data set so that the learning time, or the training time needed for a neural network to obtain high classification accuracy is usually long. \item A neural network is usually a layered graph with the output of one node feeding into one or many other nodes in the next layer. The classification rules are buried in both the structure of the graph and the weights assigned to the links between the nodes. Articulating the classification rules becomes a difficult problem. \item For the same reason, available domain knowledge is rather difficult to be incorporated to a neural network. \end{enumerate} Among the above three major disadvantages of the connectionist approach, the articulating problem is the most urgent one to be solved for applying the technique to data mining. Without explicit representation of classification rules, it is very difficult to verify or interpret them. More importantly, with explicit rules, tuples of a certain pattern can be easily retrieved using a database query language. Access methods such as indexing can be used or built for efficient retrieval as those rules usually involve only a small set of attributes. This is especially important for applications involving a large volume of data. In this paper, we present the results of our study on applying the neural networks to mine classification rules for large databases with the focus on articulating the classification rules represented by neural networks. The contributions of our study include the following: \begin{itemize} \item Different from previous research work that excludes the connectionist approach entirely, we argue that the connectionist approach should have its position in data mining because of its merits such as low classification error rates and robustness to noise~\cite{Quin94,Russ-Norv95}. \item With our newly developed algorithms, explicit classification rules can be extracted from a neural network. The rules extracted usually have a lower classification error rate than those generated by the decision tree based methods. For a data set with a strong relationship among attributes, the rules extracted are generally more concise. \item A data mining system, NeuroRule, based on neural networks was developed. The system successfully solved a number of classification problems in the literature. \end{itemize} To better suit large database applications, we also developed algorithms for input data pre-processing and for fast neural network training to reduce the time needed to learn the classification rules~\cite{Seti-Liu95a,Seti94b}. Limited by space, those algorithms are not presented in this paper. The remainder of the paper is organized as follows. Section 2 gives a discussion on using the connectionist approach to learn classification rules. Section 3 describes our algorithms to extract classification rules from a neural network. Section 4 presents some experimental results obtained and a comparison with previously published results. Finally a conclusion is given in Section 5. \section{Mining classification rules using neural networks } Artificial neural networks are densely interconnected networks of simple computational elements, $neurons$. There exist many different network topologies \cite{Hert-etal91}. Among them, the {\em multi-layer perceptron \/} is especially useful for implementing a classification function. Figure~\ref{fig:nn} shows a three layer feedforward network. It consists of an input layer, a hidden layer and an output layer. A node (neuron) in the network has a number of inputs and a single output. For example, a neuron $H_j$ in the hidden layer has $x_1^i, x_2^i, \ldots, x_n^i$ as its input and $\alpha^j$ as its output. The input links of $H_j$ has weights $w_1^j, w_2^j, \ldots, w_n^j$. A node computes its output, the {\em activation value} by summing up its weighted inputs, subtracting a threshold, and passing the result to a non-linear function $f$, the {\em activation function. \/} Outputs from neurons in one layer are fed as inputs to neurons in the next layer. In this manner, when an input tuple is applied to the input layer, an output tuple is obtained at the output layer. For a well trained network which represents the classification function, if tuple ($x_1, x_2, \ldots, x_n$) is applied to the input layer of the network, the output tuple, ($c_1, c_2, \ldots, c_m$) should be obtained where $c_i$ has value 1 if the input tuple belongs to class $c_i$ and 0 otherwise. Our approach that uses neural networks to mine classification rules consists of three steps: \begin{enumerate} \item {\em Network training \/} \\ A three layer neural network is trained in this step. The training phase aims to find the best set of weights for the network which allow the network to classify input tuples with a satisfactory level of accuracy. An initial set of weights are chosen randomly in the interval [-1,1]. Updating these weights is normally done by using informations involving the gradient of an error function. This phase is terminated when the norm of the gradient of the error function falls below a prespecified value. \item {\em Network pruning} \\ The network obtained from the training phase is fully connected and could have too many links and sometimes too many nodes as well. It is impossible to extract concise rules which are meaningful to users and can be used to form database queries from such a network. The pruning phase aims at removing redundant links and nodes without increasing the classification error rate of the network. A smaller number of nodes and links left in the network after pruning provide for extracting consise and comprehensible rules that describe the classification function. \item {\em Rule extraction} \\ This phase extracts the classification rules from the pruned network. The rules generated are in the form of ``if $(a_1 \theta v_1)$ {\em and \/} $(x_2 \theta v_2)$ {\em and } $\ldots$ {\em and \/} $(x_n \theta v_n)$ then $C_j$'' where $a_i$'s are the attributes of an input tuple, $v_i$'s are constants, $\theta$'s are relational operators ($=, \leq, \geq, <>$), and $C_j$ is one of the class labels. It is expected that the rules are concise enough for human verification and are easily applicable to large databases. \end{enumerate} In this section, we will briefly discuss the first two phase. The third phase, rule extraction phase will be discussed in the next section. \subsection{Network training} Assume that input tuples in an $n$-dimensional space are to be classified into three disjoint classes $\ca, \cb,$ and $\cc$. We construct a network as shown in Figure~\ref{fig:nn} which consists of three layers. The number of nodes in the input layer corresponds to the dimensionality of the input tuples. The number of nodes in the output layer equals to the number of classes to be classified, which is three in this example. The network is trained with target values equal to $\{1,0,0\}$ for all patterns in set $\ca$, $\{0,1,0\}$ for all patterns in $\cb$, and $\{0,0,1\}$ for all tuples in $\cc$. An input tuples will be classified as a member of the class $\ca, \cb$ or $\cc$ if the largest activation value is obtained by the first, second or third output node, respectively. There is still no clear cut rule to determine the number of hidden nodes to be included in the network. Too many hidden nodes may lead to overfitting of the data and poor generalization, while too few hidden nodes may not give rise to a network that learns the data. Two different approaches have been proposed to overcome the problem of determining the optimal number of hidden nodes required by a neural network to solve a given problem. The first approach begins with a minimal network and adds more hidden nodes only when they are needed to improve the learning capability of the network~\cite{Ash89,Hiro-etal91,Seti94b}. The second approach begins with an oversized network and then prunes redundant hidden nodes and connections between the layers of the network. We adopt the second approach since we are interested in finding a network with a small number of hidden nodes as well as the fewest number of input nodes. An input node with no connection to any of the hidden nodes after pruning plays no role in the outcome of classification process and hence can be removed from the network. \nopagebreak \begin{figure}[h] \vspace*{5mm} {\psfig {figure=net.ps,width=8cm,height=46mm}} \caption{A three layer feedforward neural network.} \label{fig:nn} \end{figure} The activation value of a node in the hidden layer is computed by passing the weighted sum of input values to a non-linear activation function. Let $w^{m}_{\ell}$ be the weights for the connections from input node $\ell$ to hidden node $m$. Given an input pattern $x^{i}, i \in \{1,2,\ldots, k\}$, where $k$ is the number of tuples in the data set, the activation value of the $m$-th hidden node is \[ \alpha^{m} = f\left( \sum_{\ell = 1}^{n} \left( x^{i}_{\ell} w^{m}_{\ell} \right) - \tau^{m} \right), \] where $f(.)$ is an activation function. In our study, we use the hyperbolic tangent function \[ f(x) := \delta(x) = (e^{x} - e^{-x})/(e^{x} + e^{-x})\] as the activation function for the hidden nodes, which makes the range of activation values of the hidden nodes [-1, 1]. Once the activation values of all the hidden nodes have been computed, the $p$-th output of the network for input tuple $x^{i}$ is computed as \[ S^{i}_{p} = \sigma\left( \sum_{m=1}^{h} \alpha^m v^m_p \right), \] where $v^{m}_{p}$ is the weight of the connection between hidden node $m$ and output node $p$ and $h$ is the number of hidden nodes in the network. The activation function used here is the sigmoid function, \[ \sigma(x) = 1/(1 + e^{-x}), \] which yields activation values of the output nodes in the range [0, 1]. A tuple will be correctly classified if the following condition is satisfied \begin{equation} \label{error} \max_{p} |e^{i}_p| = \max_p |S^{i}_p - t^{i}_p| \le \eta_{1},\end{equation} where $t^{i}_{p} = 0$, except for $t^{i}_{1} = 1$ if $ x^{i} \in \ca$, $t^{i}_{2} = 1$ if $x^{i} \in \cb$, and $t^{i}_{3} = 1$ if $ x^{i} \in \cc$, and $\eta_{1}$ is a small positive number less than 0.5. The ultimate objective of the training phase is to obtain a set of weights that make the network classify the input tuples correctly. To measure the classification error, an error function is needed so that the training process becomes a process to adjust the weights ($w, v$) to minimize this function. Furthermore, to facilitate the pruning phase, it is desired to have many weights with very small values so that they can be set to zero. This is achieved by adding a penalty term to the error function. In our training algorithm, the cross entropy function \begin{equation} \label{eq:entropy} E(w,v) = - \sum_{i=1}^{k} \sum_{p=1}^{o} \left( t^i_p \log S^{i}_p + (1 - t^{i}_p) \log (1 - S^{i}_p) \right) \end{equation} is used as the error function. In this example, $o$ equals to 3 since we have 3 different classes. The cross entropy function is chosen because faster convergence can be achieved by minimizing this function instead of the widely used sum of squared error function~\cite{Ooye-Nien92}. The penalty term $P(w, v)$ we used is \begin{equation} \label{new} \footnotesize \epsilon_{1} \left( \sum_{m=1}^{h} \sum_{\ell=1}^{n} \frac{\beta (w_{\ell}^{m})^{2}}{1 + \beta(w_{\ell}^{m})^{2}} + \sum_{m=1}^{h}\sum_{p=1}^{o} \frac{\beta ( v^{m}_p)^{2}} {1 + \beta (v^{m}_p)^{2} }\right) + \normalsize \end{equation} \[ \footnotesize \epsilon_{2} \left( \sum_{m=1}^{h} \sum_{\ell=1}^{n}\left(w_{\ell}^{m}\right)^{2} +\sum_{m=1}^{h} \sum_{p=1}^{o} \left(v^{m}_p\right)^{2}\right), \normalsize \] where $\epsilon_{1}$ and $\epsilon_{2} $ are two positive weight decay parameters. Their values reflect the relative importance of the accuracy of the network versus its complexity. With larger values of these two parameters more weights may be removed later from the network at the cost of a decrease in its accuracy. The training phase starts with an initial set of weights $(w,v)^{(0)}$ and iteratively updates the weights to minimize $E(w,v) + P(w,v)$. Any unconstrained minimization algorithm can be used for this purpose. In particular, the gradient descent method has been the most widely used in the training algorithm known as the backpropagation algorithm. A number of alternative algorithms for neural network training have been proposed~\cite{Batt92}. To reduce the network training time, which is very important in the data mining as the data set is usually large, we employed a variant of the quasi-Newton algorithm~\cite{Watr87}, the BFGS method. This algorithm has a superlinear convergence rate, as opposed to the linear rate of the gradient descent method. Details of the BFGS algorithm can be found in~\cite{Denn-Schn83,Shan-Phua76}. The network training is terminated when a local minimum of the function $E(w,v) + P(w,v)$ has been reached, that is when the gradient of the function is sufficiently small. \subsection{Network pruning} A fully connected network is obtained at the end of the training process. There are usually a large number of links in the network. With $n$ input nodes, $h$ hidden nodes, and $m$ output nodes, there are $h (m+n)$ links. It is very difficult to articulate such a network. The network pruning phase aims at removing some of the links without affecting the classification accuracy of the network. It can be shown that~\cite{Seti94a} if a network is fully trained to correctly classify an input tuple, $x^i$, with the condition (1) satisfied we can set $w^{m}_{\ell}$ to zero without deteriorating the overall accuracy of the network if the product $|v^{m} w^{m}_{\ell}|$ is sufficiently small. If $\max_{p} |v^{m}_p w^{m}_{\ell}| \le 4 \eta_2$ and the sum $(\eta_{1} + \eta_{2})$ is less than 0.5, then the network can still classify $x^i$ correctly. Similarly, if $\max_{p} |v^m_p| \le 4 \eta_2$, then $v^m_p$ can be removed from the network. \begin{figure} \begin{tabular}{cc} \hspace{72 mm} & \\ \hline \\ \end{tabular} \vspace*{2mm} {\bf Neural network pruning algorithm (NP)} \begin{enumerate} \item Let $\eta_{1}$ and $\eta_{2}$ be positive scalars such that $\eta_{1} + \eta_{2} < 0.5$. \item Pick a fully connected network. Train this network until a predetermined accuracy rate is achieved and for each correctly classified pattern the condition (\ref{error}) is satisfied. Let $(w,v)$ be the weights of this network. \item For each $w^{m}_{\ell}$, if \begin{equation}\label{a} \max_{p} |v^{m}_p \times w_{\ell}^{m}| \le 4 \eta_{2}, \end{equation} then remove $w^{m}_{\ell}$ from the network \item For each $v^{m}_{p}$, if \begin{equation}\label{b} |v^{m}_p| \le 4 \eta_{2}, \end{equation} then remove $v^{m}_p$ from the network \item If no weight satisfies condition (\ref{a}) or condition (\ref{b}), then remove $w^{m}_{\ell}$ with the smallest product $\max_{p} |v^{m}_p \times w_{\ell}^{m}|$. \item Retrain the network. If accuracy of the network falls below an acceptable level, then stop. Otherwise, go to Step 3. \end{enumerate} \caption {Neural network pruning algorithm } \label{fig:NP} \begin{tabular}[h]{cc} \hspace*{72 mm} & \\ \hline \end{tabular} \end{figure} Our pruning algorithm based on this result is shown in Figure~\ref{fig:NP}. The two conditions (\ref{a}) and (\ref{b}) for pruning depend on the magnitude of the weights for connections between input nodes and hidden nodes and between hidden nodes and output nodes. It is imperative that during training these weights be prevented from getting too large. At the same time, small weights should be encouraged to decay rapidly to zero. By using penalty function (\ref{new}), we can achieve both. \subsection{An example} We have chosen to use a function described in~\cite{Agra-etal93} as an example to show how a neural network can be trained and pruned for solving a classification problem. The input tuple consists of nine attributes defined in Table~\ref{tab:desc}. Ten classification problems are given in~\cite{Agra-etal93}. Limited by space, we will present and discuss a few functions and the experimental results. \noindent \begin{table*}[bt] \begin{center} \caption {Attributes of the test data adapted from Agrawal et al.[2]} \label{tab:desc} \vspace*{2mm} \begin{tabular}{l l l} \hline \hline \multicolumn{1}{c} {Attribute} & \multicolumn{1}{c} {Description} & \multicolumn{1}{c} {Value} \\ \hline salary & salary & uniformly distributed from 20,000 to 150,000\\ commission & commission & if salary $\geq$ 75000 $\rightarrow$ commission = 0\\ & & else uniformly distributed from 10000 to 75000.\\ age & age & uniformly distributed from 20 to 80.\\ elevel & education level & uniformly distributed from $[0,1,\ldots, 4]$.\\ car & make of the car & uniformly distributed from $[1,2, \ldots 20]$.\\ zipcode & zip code of the town & uniformly chosen from 9 available zipcodes.\\ hvalue & value of the house & uniformly distributed from 0.5$k$10000 to 1.5$k$1000000 \\ & & where $k \in \{0 \ldots 9\}$ depends on zipcode.\\ hyears & years house owned & uniformly distributed from $[1, 2, \ldots, 30]$. \\ loan & total amount of loan & uniformly distributed from 1 to 500000.\\ \hline \end{tabular} \end{center} \end{table*} Function 2 classifies a tuple in Group A if \[ (({\bf age} < 40) \wedge (50000 \leq {\bf salary} \leq 100000)) \vee \] \[ ((40 \leq {\bf age} < 60) \wedge (75000 \leq {\bf salary} \leq 125000)) \vee \] \[ (({\bf age} \geq 60) \wedge (25000 \leq {\bf salary} \leq 75000)). \] Otherwise, the tuple is classified in Group B. The training data set consisted of 1000 tuples. The values of the attributes of each tuple were generated randomly according to the distributions given in Table~\ref{tab:desc}. Following Agrawal {\em et al. \/}~\cite{Agra-etal93}, we also included a perturbation factor as one of the parameters of the random data generator. This perturbation factor was set at 5 percent. For each tuple, a class label was determined according to the rules that define the function above. To facilitate the rule extraction in the later phase, the values of the numeric attributes were discretized. Each of the six attributes with numeric values was discretized by dividing its range into subintervals. The attribute {\it salary} for example, which was uniformly distributed from 25000 to 150000 was divided into 6 subintervals: subinterval 1 contained all salary values that were strictly less than 25000, subinterval 2 contained those greater than or equal to 25000 and strictly less than 50000, etc. The {\it thermometer} coding scheme was then employed to get the binary representations of these intervals for inputs to the neural network. Hence, a salary value less that 25000 was coded as $\{ 000001 \}$, a salary value in the interval $[25000,50000)$ was coded as $\{ 000011 \}$, etc. The second attribute {\it commission} was similarly coded. The interval from 10000 to 75000 was divided into 7 subintervals, each having a width of 10000 except for the last one, $[70000,75000]$. Zero commission was coded by all zero values for the seven inputs. The coding scheme for the other attributes are given in Table~\ref{tab:binary}. \begin{table}[hbt] \begin{center} \caption{Binarization of the attribute values} \label{tab:binary} \vspace*{2mm} \begin{tabular}{l c c} \hline \hline \multicolumn{1}{c} {Attribute} & \multicolumn{1}{c} {Input number} & \multicolumn{1}{c} {Interval width}\\ \hline salary & ${\cal I}_{1}$ - ${\cal I}_6$ & 25000 \\ commission& ${\cal I}_{7}$ - ${\cal I}_{13}$ & 10000 \\ age & ${\cal I}_{14}$ - ${\cal I}_{19}$ & 10 \\ elevel & ${\cal I}_{20}$ - ${\cal I}_{23}$ & - \\ car & ${\cal I}_{24}$ - ${\cal I}_{43}$ & - \\ zipcode & ${\cal I}_{44}$ - ${\cal I}_{52}$ & - \\ hvalue & ${\cal I}_{53}$ - ${\cal I}_{66}$ & 100000 \\ hyears & ${\cal I}_{67}$ - ${\cal I}_{76}$ & 3 \\ loan & ${\cal I}_{77}$ - ${\cal I}_{86}$ & 50000 \\ \hline \end{tabular} \end{center} \end{table} With this coding scheme, we had a total of 86 binary inputs. The 87th input was added to the network to incorporate the bias or threshold in each of the hidden node. The input value to this input was set to one. Therefore the input layer of the initial network consisted of 87 input nodes. Two nodes were used at the output layer. The target output of the network was $\{1,0\}$ if the tuple belonged to Group $A$, and $\{0,1\}$ otherwise. The number of the hidden nodes was initially set as four. There were a total of 386 links in the network. The weights for these links were given initial values that were randomly generated in the interval [-1,1]. The network was trained until a local minimum point of the error function had been reached. The fully connected trained network was then pruned by the pruning algorithm described in Section 2.2. We continued removing connections from the neural network as long as the accuracy of the network was still higher than 90 \%. Figure~\ref{fig:prun_nn} shows the pruned network. Of the 386 links in the original network, only 17 remained in the pruned network. One of the four hidden nodes was removed. A small number of links from the input nodes to the hidden nodes made it possible to extract compact rules with the same accuracy level as the neural network. \section{Extracting rules from a neural network} Network pruning results in a relatively simple network. In the example shown in the last section, the pruned network has only 7 input nodes, 3 hidden nodes, and 2 output nodes. The number of links is 17. However, it is still very difficult to articulate the network, i.e., find the explicit relationship between the input tuples and the output tuples. Research work in this area has been reported~\cite{Towe-Shav93,Fu94}. However, to our best knowledge, there is no method available in the literature that can extract explicit and concise rules as the algorithm we will describe in this section. \begin{figure} \vspace*{5mm} {\psfig {figure=fun2.ps,width=8cm,height=5cm}} \caption{Pruned network for Function 2. Its accuracy rate on the 1000 training samples is 96.30 \% and it contains only 17 connections.} \label{fig:prun_nn} \vspace*{5mm} \end{figure} \subsection{Rule extracting algorithm} A number of reasons contribute to the difficulty of extracting rules from a pruned network. First, even with a pruned network, the links may be still too many to express the relationship between an input tuple and its class label in the form of {\em if $\ldots$ then $\cdots$ \/} rules. If a node has $n$ input links with binary values, there could be as many as $2^n$ distinct input patterns. The rules could be quite lengthy or complex even with a small $n$, say 7. Second, the activation values of a hidden node could be anywhere in the range [-1,1] depending on the input tuple. With a large number of testing data, the activation values are virtually continuous. It is rather difficult to derive the explicit relationship between the activation values of the hidden nodes and the output values of a node in the output layer. \begin{figure} \begin{tabular}{cc} \hspace{72 mm} & \\ \hline \end{tabular} \vspace*{2mm} {\bf Rule extraction algorithm (RX)} \begin{enumerate} \item Activation value discretization via clustering: \begin{enumerate} \item Let $\epsilon \in (0,1)$. Let $D$ be the number of discrete activation values in the hidden node. Let $\delta_{1}$ be the activation value in the hidden node for the first pattern in the training set. Let $H(1) = \delta_1, count(1) = 1, sum(1) = \delta_1$ and set $D = 1$. \item For all patterns $i = 2,3, \ldots k$ in the training set: \begin{itemize} \item Let $\delta$ be its activation value. \item If there exists an index $\overline{j}$ such that \begin{eqnarray*} | \delta - H(\overline{j}) | &=& \min_{j \in \{1,2,\ldots, D\}} | \delta - H(j)| \;\; \\ \mbox{and} | \delta - H(\overline{j}) | &\le& \epsilon, \end{eqnarray*} then set $count(\overline{j})$ := $count(\overline{j}) + 1$, $\hspace*{9 mm} sum(D) := sum(D) + \delta$ \\ else $D = D + 1, H(D) = \delta, \\ \hspace*{6 mm} count(D) = 1, sum(D) = \delta$. \end{itemize} \item Replace $H$ by the average of all activation values that have been clustered into this cluster: \[ H(j) := sum(j)/count(j),\; j = 1,2 \ldots, D. \] \item Check the accuracy of the network with the activation values $\delta^i$ at the hidden nodes replaced by $\delta_d$, the activation value of the cluster to which the activation value belongs. \item If the accuracy falls below the required level, decrease $\epsilon$ and repeat Step 1. \end{enumerate} \item Enumerate the discretized activation values and compute the network output. Generate perfect rules that have a perfect cover of all the tuples from the hidden node activation values to the output values. \item For the discretized hidden node activation values appeared in the rules found in the above step, enumerate the input values that lead to them, and generate perfect rules. \item Generate rules that relate the input values and the output values by rule substitution based on the results of the above two steps. \end{enumerate} \caption{Rule extraction algorithm (RX)} \label{fig:rule_ex} \vspace*{2mm} \begin{tabular}{cc} \hspace{72 mm} & \\ \hline \end{tabular} \end{figure} Our rule extracting algorithm is outlined in Figure~\ref{fig:rule_ex}. The algorithm first discretizes the activation values of hidden nodes into a manageable number of discrete values without sacrificing the classification accuracy of the network. A small set of the discrete activation values make it possible to determine both the dependency among the output values and the hidden node values and the dependency among the hidden node activation values and the input values. From the dependencies, rules can be generated~\cite{Liu95}. Here we show the process of extracting rules from the pruned network in Figure~\ref{fig:prun_nn} obtained for the classification problem Function 2. The network has three hidden nodes. The activation values of 1000 tuples were discretized. The value of $\epsilon$ was set to 0.6. The results of discretization are shown in the following table. \begin{table}[hbt] \begin{center} \vspace*{2mm} \begin{tabular}{c | c | l} \hline \hline Node & No of clusters & Cluster activation values \\ \hline\hline 1 & 3 & (-1, 0, 1) \\ 2 & 2 & ( 0, 1) \\ 3 & 3 & (-1, 0.24, 1) \\ \hline \end{tabular} \end{center} \end{table} The classification accuracy of the network was checked by replacing the individual activation value with its discretized activation value. The value of $\epsilon = 0.6$ was sufficiently small to preserve the accuracy of the neural network and large enough to produce only a small number of clusters. For the three hidden nodes, the numbers of discrete activation values (clusters) are 3,2 and 3, or a total of 18 different outcomes at the two output nodes are possible. We tabulate the outputs $C_j (1 \le j \le 2)$ of the network according to the hidden node activation values $\alpha_m, (1 \le m \le 3)$ as follows. \begin{table}[hbt] \begin{center} \begin{tabular}{r r r | r r } \hline \hline $\alpha_1$ & $\alpha_2$ & $\alpha_3$ & $C_1$ & $C_2$ \\ \hline \hline -1 & 1 & -1 & 0.92 & 0.08 \\ -1 & 1 & 1 & 0.00 & 1.00 \\ -1 & 1 & 0.24 & 0.01 & 0.99 \\ -1 & 0 & -1 & 1.00 & 0.00 \\ -1 & 0 & 1 & 0.11 & 0.89 \\ -1 & 0 & 0.24 & 0.93 & 0.07 \\ 1 & 1 & -1 & 0.00 & 1.00 \\ 1 & 1 & 1 & 0.00 & 1.00 \\ 1 & 1 & 0.24 & 0.00 & 1.00 \\ 1 & 0 & -1 & 0.89 & 0.11 \\ 1 & 0 & 1 & 0.00 & 1.00 \\ 1 & 0 & 0.24 & 0.00 & 1.00 \\ 0 & 1 & -1 & 0.18 & 0.82 \\ 0 & 1 & 1 & 0.00 & 1.00 \\ 0 & 1 & 0.24 & 0.00 & 1.00 \\ 0 & 0 & -1 & 1.00 & 0.00 \\ 0 & 0 & 1 & 0.00 & 1.00 \\ 0 & 0 & 0.24 & 0.18 & 0.82 \\ \hline \end{tabular} \end{center} \end{table} Following Algorithm RX step 2, the predicted outputs of the network are taken to be $C_1 = 1 $ and $C_2 = 0$ if the activation values $\alpha_m$'s satisfy one of the following conditions (since the table is small, the rules can be checked manually): \begin{eqnarray*} R_{11}: C_1 = 1, C_2 = 0 & \Leftarrow & \alpha_2 = 0, \alpha_3 = -1. \\ R_{12}: C_1 = 1, C_2 = 0 & \Leftarrow & \alpha_1 = -1, \alpha_2 = 1, \alpha_3 = -1. \\ R_{13}: C_1 = 1, C_2 = 0 & \Leftarrow & \alpha_1 = -1, \alpha_2 = 0, \alpha_3 = 0.24. \end{eqnarray*} Otherwise, $C_1 = 0 $ and $C_2 = 1$. The activation values of a hidden node are determined by the inputs connected to it. In particular, the three activation values of hidden node 1 are determined by 4 inputs, ${\cal I}_1, {\cal I}_{13}, {\cal I}_{15},$ and ${\cal I}_{17}$. The activation values of hidden node 2 are determined by 2 inputs ${\cal I}_2$ and ${\cal I}_{17}$, and the activation values of hidden node 3 are determined by ${\cal I}_4, {\cal I}_{5}, {\cal I}_{13}, {\cal I}_{15}$ and ${\cal I}_{17}$. Note that only 5 different activation values appear in the above three rules. Following Algorithm RX step 3, we obtain rules that show how a hidden node is activated for the five different activation values at the three hidden nodes: \vspace*{2mm} \begin{tabular}{llcl} \multicolumn{4}{l}{Hidden node 1:} \\ $R_{21}:$ & $\alpha_1 = -1$ & $\Leftarrow$ & ${\cal I}_{13} = 1$\\ $R_{22}:$ & $\alpha_1 = -1$ & $\Leftarrow$ & ${\cal I}_1 = {\cal I}_{13} = {\cal I}_{15} = 0,$\\ & & & $ {\cal I}_{17} = 1$ \\ & & & \\ \multicolumn{4}{l}{Hidden node 2:} \\ $R_{23}:$ & $\alpha_2 = 1 $ & $\Leftarrow$ & ${\cal I}_{2} = 1$ \\ $R_{24}:$ & $\alpha_2 = 1 $ & $\Leftarrow$ & ${\cal I}_{17} = 1$ \\ $R_{25}:$ & $\alpha_2 = 0 $ & $\Leftarrow$ & ${\cal I}_2 = {\cal I}_{17} = 0$ \\ & & \\ \multicolumn{4}{l}{Hidden node 3:} \\ $R_{26}:$ & $\alpha_3 = -1$ & $\Leftarrow$ & ${\cal I}_{13} = 0$ \\ $R_{27}:$ & $\alpha_3 = -1$ & $\Leftarrow$ & ${\cal I}_5 = {\cal I}_{15} = 1$ \\ $R_{28}:$ & $\alpha_3 = 0.24$ & $\Leftarrow$ & ${\cal I}_4 = {\cal I}_{13} = 1,\; {\cal I}_{17} = 0$ \\ $R_{29}:$ & $\alpha_3 = 0.24$ & $\Leftarrow$ & ${\cal I}_{5} = 0,\; {\cal I}_{13} = {\cal I}_{15} = 1$ \\ \end{tabular} \vspace*{2mm} With all the intermediate rules obtained above, we can derive the classification rules as in Algorithm RX step 4. For example, substituting rule $R_{11}$ with rules $R_{25}, R_{26},$ and $R_{27}$, we have the following two rules in terms of the original inputs: \begin{eqnarray*} R 1: C_1 = 1, C_2 = 0 & \Leftarrow & {\cal I}_2 = {\cal I}_{17} = 0, {\cal I}_{13} = 0 \\ R_1': C_1 = 1, C_2 = 0 & \Leftarrow & {\cal I}_2 = {\cal I}_{17} = 0, {\cal I}_5 = {\cal I}_{15} = 1 \end{eqnarray*} Recall that the input values of ${\cal I}_{14} $ to ${\cal I}_{19} $ represent coded age groups where ${\cal I}_{15} = 1$ if $age$ is in [60, 80) and ${\cal I}_{17} = 1$ if $age$ is in [20, 40). Therefore rule $R_1'$ in fact can never be satisfied by any tuple, hence redundant. Similarly, replacing rule $R_{12}$ with $R_{21}, R_{22}$, $R_{23}, R_{24}, R_{26}$ and $R_{27}$, we have the following two rules: \begin{eqnarray*} R 2: C_1 = 1, C_2 = 0 & \Leftarrow & {\cal I}_5 = {\cal I}_{13} = {\cal I}_{15} = 1. \\ R 3: C_1 = 1, C_2 = 0 & \Leftarrow & {\cal I}_1 = {\cal I}_{13} = {\cal I}_{15} = 0, {\cal I}_{17} = 1. \\ \end{eqnarray*} Substituting $R_{13}$ with $R_{21}$, $R_{22}$, $R_{25}$, $R_{28}$ and $R_{29}$, we have another rule: \begin{eqnarray*} R 4: C_1 = 1, C_2 = 0 & \Leftarrow & {\cal I}_2 = {\cal I}_{17} = 0, {\cal I}_4 = {\cal I}_{13} = 1. \end{eqnarray*} It is now trivial to obtain the rules in terms of the original attributes. Conditions of the rules after substitution can be rewritten in terms of the original attributes and classification problem as shown in Figure~\ref{fig:rule-f2}. \begin{myfigure} \begin{tabular}{l l} Rule 1.&If ({\bf salary} $<$ 100000) $\wedge$ ({\bf commission} $=$ 0) $\wedge$ ({\bf age} $\leq$ 40), then Group A. \\ Rule 2.&If ({\bf salary} $\geq$ 25000) $\wedge$ ({\bf commission} $>$ 0) $\wedge$ ({\bf age} $\geq$ 60), then Group A. \\ Rule 3.&If ({\bf salary} $<$ 125000) $\wedge$ ({\bf commission} = 0) $\wedge$ (40 $\leq$ {\bf age} $\leq$ 60), then Group A. \\ Rule 4.&If (50000 $\leq$ {\bf salary} $<$ 100000) $\wedge$ ({\bf age } $<$ 40), then Group A. \\ Default&Rule. Group B. \end{tabular}\vspace*{0mm}\\ \caption{Rules generated by NeuroRule for Function 2.} \label{fig:rule-f2} \end{myfigure} Given the fact that $salary \geq 75000 \Leftrightarrow commission = 0$, the above four rules obtained by the pruned network are identical to the classification Function 2. \subsection{Hidden node splitting and creation of a subnetwork} After network pruning and activation value discretization, rules can be extracted by examining the possible combinations in the network outputs as shown in the previous section. However, when there are still too many connections between a hidden node and input nodes, it is not trivial to extract rules, even if we can, the rules may not be easy to understand. To address the problem, a three layer feedforward subnetwork can be employed to simplify rule extraction for the hidden node. The number of output nodes of this subnetwork is the number of discrete values of the hidden node, while the input nodes are those connected to the hidden node in the original network. Tuples in the training set are grouped according to their discretized activation values. Given $d$ discrete activation values $D_{1}, D_{2},\ldots, D_d$, all training tuples with activation values equal to $D_{j}$ are given a $d$-dimensional target value of all zeros expect for one 1 in position $j$. A new hidden layer is introduced for this subnetwork. This subnetwork is trained and pruned in the same ways as is the original network. The rule extracting process is applied for the subnetwork to obtain the rules describing the input and the discretized activation values. This process is applied recursively to those hidden nodes with too many input links until the number of connection is small enough or the new subnetwork cannot simplify the connections between the inputs and the hidden node at the higher level. For most problems that we have solved, this step is not necessary. One problem where this step is required by the algorithm is for a genetic classification problem with 60 attributes. The details of the experiment can be found in~\cite{Rudy-spli95}. \section {Preliminary experimental results} Unlike the pattern classification research in the AI community where a set of classic problems have been studied by a large number of researchers, fewer well documented benchmark problems are available for data mining. In this section, we report the experimental results of applying the approach described in the previous sections to the data mining problem defined in~\cite{Agra-etal93}. As mentioned earlier, the database tuples consisted of nine attributes (See Table~\ref{tab:desc}). Ten classification functions of Agrawal et al.~\cite{Agra-etal93} were used to generate classification problems with different complexities. The training set consisted of 1000 tuples and the testing data sets had 1000 tuples. Efforts were made to generate the data sets as described in the original functions. Among 10 functions described, we found that functions 8 and 10 produced highly skewed data that made classification not meaningful. We will only discuss functions other than these two. To assess our approach, we compare the results with that of C4.5, a decision tree-based classifier~\cite{Quin93}. \subsection{Classification accuracy} The following table reports the classification accuracy using both our system and C4.5 for eight functions. Here, classification accuracy is defined as \begin{equation} accuracy~=~\frac{no~tuples~correctly~classified}{total~number~of~tuples} \end{equation} \begin{table}[hbt] \begin{center} \vspace*{2mm} \begin{tabular}{| c || c c || c c |} \hline \hline \multicolumn{1}{| c || } {Func.} & \multicolumn{2}{c||} {Pruned Networks} & \multicolumn{2}{ c |} {C4.5} \\ \cline{2-5} \multicolumn{1}{| c ||} {no } & \multicolumn{1}{|c ||} {Training} & \multicolumn{1}{c||}{Testing} & \multicolumn{1}{|c ||} {Training}& \multicolumn{1}{c |} {Testing}\\ \hline 1 & 98.1 &100.0 & 98.3 &100.0 \\ 2 & 96.3 &100.0 & 98.7 & 96.0 \\ 3 & 98.5 &100.0 & 99.5 & 99.1 \\ 4 & 90.6 & 92.9 & 94.0 & 89.7 \\ 5 & 90.4 & 93.1 & 96.8 & 94.4 \\ 6 & 90.1 & 90.9 & 94.0 & 91.7 \\ 7 & 91.9 & 91.4 & 98.1 & 93.6 \\ 9 & 90.1 & 90.9 & 94.4 & 91.8 \\ \hline \end{tabular} \end{center} \end{table} From the table we can see that the classification accuracy of the neural network based approach and C4.5 is comparable. In fact, the network obtained after the training phase has higher accuracy than what listed here, which is mainly determined by the threshold set for the network pruning phase. In our experiments, it is set to 90\%. That is, a network will be pruned until further pruning will cause the accuracy to fall below this threshold. For applications where high classification accuracy is desired, the threshold can be set higher so that less nodes and links will be pruned. Of course, this may lead to more complex classification rules. Tradeoff between the accuracy and the complexity of the classification rule set is one of the design issues. \subsection{Rules extracted} Here we present some of the classification rules extracted from our experiments. For simple classification functions, the rules extracted are exactly the same as the classification functions. These include functions 1, 2 and 3. One interesting example is Function 2. The detailed process of finding the classification rules is described as an example in Section 2 and 3. The resulting rules are the same as the original functions. As reported by Agrawal {\em et al.}~\cite{Agra-etal93}, ID3 generated a relatively large number of strings for Function 2 when the decision tree is built. We observed similar results when C4.5rules was used (a member of ID3). C4.5rules generated 18 rules. Among the 18 rules, 8 rules define the conditions for Group A. Another 10 rules define Group B. Tuples that do not satisfy the conditions specified are classified as default class, Group B. Figure~\ref{fig:c45-f2} shows the rules that define tuples to be a member of Group A. \begin{myfigure} \begin{tabular}{l l} Rule 16: & ({\bf salary} $>$ 45910) $\wedge$ ({\bf commission} $>$ 0) $\wedge$ ({\bf age} $>$ 59) \\ Rule 10: & (51638 $<$ {\bf salary} $\leq$ 98469) $\wedge $ ({\bf age} age $\leq$ 39) \\ Rule 13: & ({\bf salary} $\leq$ 98469) $\wedge$ ({\bf commission} $\leq$ 0) $\wedge$ ({\bf age} $\leq$ 60) \\ Rule 6: & (26812 $<$ {\bf salary} $\leq$ 45910) $\wedge$ ({\bf age} $>$ 61) \\ Rule 20: & (98469 $<$ {\bf salary} $\leq$ 121461) $\wedge$ (39 $<$ {\bf age} $\leq$ 57) \\ Rule 7: & (45910 $<$ {\bf salary} $\leq$ 98469) $\wedge$ ({\bf commission} $\leq$ 51486) $\wedge$ ({\bf age} $\leq$ 39) $\wedge $ ({\bf hval} $\leq$ 705560) \\ Rule 26: & (125706 $<$ {\bf salary} $\leq$ 127088) $\wedge$ ({\bf age} $\leq$ 51) \\ Rule 4: & (23873 {\bf salary} $\leq$ 26812) $\wedge$ ({\bf age} $>$ 61) $\wedge$ ({\bf loan} $>$ 237756) \\ \end{tabular} \caption{Group A rules generated by C4.5rules for Function 2.} \label{fig:c45-f2} \end{myfigure} By comparing the rules generated by C4.5rules (Figure~\ref{fig:c45-f2}) with the rules generated by NeuroRule in Figure 4, it is obvious that our approach generates better rules in the sense that they are more compact, which makes the verification and application of the rules much easier. Functions 4 and 5 are another two functions for which ID3 generates a large number of strings. ${\cal CDP}$~\cite{Agra-etal93} also generates a relatively large number of strings than for other functions. The original classification function 4, the rule sets that define Group A tuples extracted using NeuroRule and C4.5, respectively are shown in Figure~\ref{fig:func_4}. \begin{myfigure} \vspace{2mm} {\bf (a) Original classification rules defining Group A tuples} \vspace{2mm} \begin{tabular}{l l} Group A: &~$ (({\bf age} < 40) \wedge $ \\ &~$((({\bf elevel} \in [0..1]) ? (25K \le {\bf salary} \le 75K)) : (50K \le {\bf salary} \le 100K)))) \vee $ \\ &~$((40 \le {\bf age} < 60) \wedge $ \\ &~$((({\bf elevel} \in [1..3]) ? (50K \le {\bf salary} \le 100K)) : (75K \le {\bf salary} \le 125K)))) \vee $ \\ &~$(({\bf age} \geq 60) \wedge $ \\ &~$((({\bf elevel} \in [2..4]) ? (50K \le {\bf salary} \le 100K)) : (25K \le {\bf salary} \le 75K))))$ \\ \end{tabular} \vspace{2mm} {\bf (b) Rules generated by NeuroRule} \vspace{2mm} \begin{tabular}{l l} $R 1$: & if (40 $\leq$ {\bf age} $<$ 60) $\wedge$ ({\bf elevel} $ \le $ 1) $\wedge$ (75K $\leq$ {\bf salary} $<$100K) then Group A \\ $R 2$: & if ( {\bf age} $<$60) $\wedge$ ({\bf elevel} $\geq$ 2) $\wedge$ (50K $ \le $ {\bf salary} $<$100K) then Group A \\ $R 3$: & if ({\bf age} $<$60) $\wedge$ ({\bf elevel} $ \le $ 1) $\wedge$ (50K $\leq$ {\bf salary} $<$ 75K ) then Group A \\ $R 4$: & if ({\bf age} $ \geq$ 60) $\wedge$ ( {\bf elevel} $\leq$ 1) $\wedge$ ({\bf salary} $<$75K) then Group A \\ $R 5$: & if ({\bf age} $ \geq$ 60) $\wedge$ ({\bf elevel} $ \geq$ 2) $\wedge$ (50K $\leq$ {\bf salary} $<$ 100K) then Group A \end{tabular} \vspace{2mm} {\bf (C) Rules generated by C4.5rules } \vspace{2mm} \begin{tabular}{l l} Rule 30: & ({\bf elevel} $=$ 2) $\wedge$ (50762 $<$ {\bf salary} $\leq$ 98490) \\ Rule 25: & ({\bf elevel} $=$ 3) $\wedge$ (48632 $<$ {\bf salary} $\leq$ 98490) \\ Rule 23: & ({\bf elevel} $=$ 4) $\wedge$ (60357 $<$ {\bf salary} $\leq$ 98490) \\ Rule 32: & (33 $<$ {\bf age} $\leq$ 60) $\wedge$ (48632 $<$ {\bf salary} $\leq$ 98490)$\wedge$ ({\bf elevel} $=$ 1) \\ Rule 57: & ({\bf age} $>$ 38) $\wedge$ (102418 $<$ {\bf salary} $\leq$ 124930 $\wedge$ ({\bf age} $\leq$ 59) $\wedge$ {\bf elevel} $=$ 4) \\ Rule 37: & ({\bf salary} $>$ 48632) $\wedge$ ({\bf commission} $>$ 18543) \\ Rule 14: & ({\bf age} $\leq$ 39) $\wedge$ ({\bf elevel} $=$ 0) $\wedge$ ({\bf salary} $\leq$ 48632) \\ Rule 16: & ({\bf age} $>$ 59) $\wedge$ ({\bf elevel} $=$ 0) $\wedge$ ({\bf salary} $\leq$ 48632) \\ Rule 12: & ({\bf age} $>$ 65) $\wedge$ ({\bf elevel} $=$ 1) $\wedge$ ({\bf salary} $\leq$ 48632) \\ Rule 48: & ({\bf car} $=$ 4) $\wedge$ (98490 $<$ {\bf salary} $\leq$ 102418)\\ \end{tabular} \caption{Classification function 4 and rules extracted.} \label{fig:func_4} \end{myfigure} The five rules extracted by NeuroRule are not exactly the same as the original function descriptions (Function 4). To test the rules extracted, the rules were applied to three test data sets of different sizes, shown in Table~\ref{tab:func_4}. The column {\em Total \/} is the total number of tuples that are classified as group A by each rule. The column {\em Correct \/} is the percentage of correctly classified tuples. E.g., rule $R 1$ classifies all tuples correctly. On the other hand, among 165 tuples that were classified as Group A by rule $R 2$, 6.1\% of them belong to Group B, i.e. they were misclassified. \noindent \begin{table*}[btp] \begin{center} \caption{Accuracy rates of the rules extracted for function 4} \label{tab:func_4} \vspace*{2mm} \begin{tabular}{| l| c c| c c| c c |} \hline \hline & \multicolumn{6}{c | } {Test data size} \\ \cline{2-7} Rule & \multicolumn{2}{c|} {1000} & \multicolumn{2}{c|} {5000} & \multicolumn{2}{c |} {10000} \\ \cline{2-7} & \multicolumn{1}{c} {\hspace*{2mm} Total \hspace*{2mm}} & \multicolumn{1}{c|}{Correct (\%)} & \multicolumn{1}{c} {\hspace*{2mm} Total \hspace*{2mm}} & \multicolumn{1}{c|}{Correct (\%)} & \multicolumn{1}{c} {\hspace*{2mm} Total \hspace*{2mm}} & \multicolumn{1}{c | }{Correct (\%)} \\ \hline $R 1$ & 22 & 100.0 & 111 & 100.0 & 239 & 100.0 \\ $R 2$ & 165 & 93.9 & 753 & 92.6 &1463 & 92.3 \\ $R 3$ & 46 & 82.6 & 247 & 78.4 & 503 & 78.3 \\ $R 4$ & 51 & 82.4 & 305 & 87.9 & 597 & 89.4 \\ $R 5$ & 71 & 100.0 & 385 & 100.0 & 802 & 100.0 \\ \hline \hline \end{tabular} \end{center} \end{table*} From Table~\ref{tab:func_4} , we can see that two of the rules extracted classify the tuples correctly without errors. They are exactly the same as parts of the original function definition. Because the accuracy of the pruned network is not 100\%, other rules extracted are not the same as the original ones. However, the rule extracting phase preserves the classification accuracy of the pruned network. It is expected that, with higher accuracy of the network, the accuracy of the extracted rules will be also improved. When the same training data set was used as the input of C4.5rules, twenty rules were generated among which 10 rules define the conditions of Group A (Figure~\ref{fig:func_4}). Again, we can see that NeuroRule generates better rules than C4.5rules. Furthermore, rules generated by NeuroRule only reference those attributes appeared in the original classification functions. C4.5rules in fact picked some attributes, e.g. {\em car \/}, that does not appear in the original function. \section {Conclusion} In this paper we reported NeuroRule, a connectionist approach to mining classification rules from given databases. The approach consists of three phases: (1) training a neural network that correctly classifies tuples in the given training data set to a desired accuracy; (2) pruning the network while maintaining the classification accuracy; and (3) extracting explicit rules from the pruned network. The proposed approach was applied to a set of classification problems. The results of applying it to a data mining problem defined in~\cite{Agra-etal93} was discussed in detail. The results indicate that, using the proposed approach, high quality rules can be discovered from the given ten data sets. While considerable work on using neural networks for classification has been reported, none of them can generate rules with the quality comparable to those generated by NeuroRule. The work reported here is our first attempt to apply the connectionist approach to data mining. A number of related issues are to be further studied. One of the issues is to reduce the training time of neural networks. Although we have been improving the speed of network training by developing fast algorithms, the time required for NeuroRule is still longer than the time needed by the symbolic approach, such as C4.5. As the long initial training time of a network may be tolerable, incremental training and rule extraction during the life time of an application database can be useful. With incremental training that requires less time, the accuracy of rules extracted can be improved along with the change of database contents. \bibliographystyle{plain}
{'timestamp': '2017-01-06T02:05:29', 'yymm': '1701', 'arxiv_id': '1701.01358', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01358'}
arxiv
\section{Introduction} \label{sec:intro} Ants (\textit{Hymenoptera: Formicidae}), renowned for their remarkable diversity and ecological significance \cite{wilson1999diversity}, typically display extraordinary collective behavior \cite{holldobler2009superorganism}. A key question in evolutionary neurobiology concerns how ant sociality, ecology, and the ability to make accurate group decisions have impacted their brain structure The emergence of eusociality and social complexity are major novelties likely involving rapid behavioral changes that might be reflected in the anatomy of the brain \cite{ott2010gregarious,amador2015specialization}, although this idea has been controversial \cite{farris2013evolution,farris2016insect}. The remarkable evolutionary and ecological success of ants is hypothesized to be due to their social organization, which features division of labor, and collective behavior \cite{wilson1987causes}. Workers in ant colonies are so intrinsically interdependent that they are considered superorganisms. The ``brain'' of such a superorganism evolved at two levels: to enable individual workers to respond adaptively as individuals acting independently of other workers, and colonies behaving as decision-making groups to cope with the multiple challenges of sociality (coordinated foraging, task specialization, communication, social interactions, nestmate recognition, e.g.). The Social Brain Hypothesis, originally postulated for primates, posits that individual members of larger groups require bigger brains to adaptively process social information \cite{dunbar2007evolution}. However, the degree to which this hypothesis can be meaningfully applied to eusocial insects has been debated \cite{lihoreau2012exploration}. Brain evolution in ants, for example, must have evolved in consideration of body size, and therefore miniaturization of the nervous system.In addition to that, collective intelligence and division of labor may have relaxed individual cognitive challenges \cite{gronenberg2009social}. However, it is unclear if social selection favored the evolution of allometrically smaller or larger brains, as both patterns have been described \cite{riveros2012evolution,kamhi2016social} The ant brain is a mosaic of different subregions (neuropils) that serve different functions \cite{strausfeld2012atlas}: sensory perception (antennal and optic lobes), motor control and navigation (central body and subesophageal ganglion), and multi-sensorial integration, learning and memory (mushroom bodies). Using confocal imaging and manual annotations of brain regions, Muscedere \textit{et al.} demonstrated that minor and major workers of different ages of three species of \textit{Pheidole} have distinct patterns of brain size variation \cite{muscedere2012division}. These differences in subregion sizes and scales reflect the intra-colony division of labor and the sociobiological characteristics of this species. However, all these results come at the cost of allocating significant time to manual record the volumes of functionally specialized brain compartments, which may introduce a bias. Recent advances in image processing, inspired in techniques developed to study the human brain, have allowed extraordinary outputs of unprecedented quality and throughput in neuroanatomical studies in honeybees \cite{rybak2012digital} and fruit flies \cite{rein2002drosophila,Costa2016} among other insects \cite{Menzel2012}. These approaches combine multiple brains in a single model or template, which statistically represents the whole species. Replication is necessary to avoid biases originated in the fixation and imaging processes of the brains as well as to account for inter-individual variability. Template brains have a dual function. Transforming all samples to the same reference space allows normalizing the information from brains imaged under different conditions or image modalities, and anatomical regions of reference brains are usually annotated, which produces the automatic segmentation of registered samples.Although many strategies have been proposed and evaluated in the last decades for the construction of brain templates in mammals \cite{talairach1988co, evans19933d, mazziotta1995probabilistic, chen2006neuroanatomical, dogdas2007digimouse, shattuck2008construction}, only a few of them have been applied to insect brains, most of them to \textit{Drosophila} data \cite{jefferis2007comprehensive, Yu2010, cachero2010sexual,Costa2016}. However, these results have not been translated yet into the ant brain community. This can be partially explained by the lack of expert-made anatomical labels and the larger morphological variability existing in the ant brain, what substantially hinders the registration process. To address these issues, we propose a two-step co-registration solution that allows the construction of atlases of intra- and inter-caste individuals and identify specific differences between anatomical regions. Moreover, we have evaluated our approach in a total of $50$ labeled brains of four species of \textit{Pheidole}, a hyperdiverse genus of ants that exhibits striking morphological differentiation and division of labor: complete dimorphism or “trimorphism” in the worker caste. \section{Materials and Methods} \label{sec:materials} \subsection{Ant brains dataset} \subsubsection{Ant species} \textit{Pheidole}, the most diverse and species rich ant genus \cite{wilson1985ants}, is characterized by worker polymorphism (minor worker, major workers and, in some species, supersoldiers). Four \textit{Pheidole} species, courtesy of Dr. Diana Wheeler’s lab at the University of Arizona, have been selected for this study: \textit{P. spadonia}, \textit{P. rhea}, \textit{P. tepicana} and \textit{P. obtusospinosa}. \subsubsection{Brain imaging and labeling} The immunohistochemical staining and imaging of ant brain neuropil was slightly modified from \cite{ott2008confocal, muscedere2012division}. We imaged 50 brains at a resolution of $\sim0.7\times0.7\times5 \mu$m/voxel: 10 minor worker brains from the mentioned four species and 10 major worker brains from \textit{P. spadonia}. Right brain hemispheres were manually labeled by an expert into $8$ anatomical regions: optic lobes (OL), antennal lobes (AL), mushroom body medial calyx (MB-MC), mushroom body lateral calyx (MB-LC), mushroom body peduncle (MB-P), central body (CB), subesophageal ganglion (SEG) and rest of the brain (ROCB). Fig.~\ref{fig:brains-and-labels} shows a 3D representation of the labels and brain samples of each type. (Image size: $\sim600\times600\times80$ pixels.) \begin{figure}[htb] \centering \centerline{\includegraphics[width=12cm]{brains-and-labels}} \caption{Examples of brain samples and labeled regions. From left to right and from top to bottom: 3D view of anatomical regions (A) and central sections of \textit{P. spadonia} minor (B), \textit{P. spadonia} minor (C), \textit{P. tepicana} (D), \textit{P. obtusospinosa} (E) and \textit{P. rhea} (F) samples. Scale bar: $100\mu m$.} \label{fig:brains-and-labels} \end{figure} \subsection{Image registration and template generation} Group-wise templates were constructed using an algorithm building an average shaped brain within the diffeomorphic space. The approach uses symmetric diffeomorphic image registration (SyN) \cite{avants2008symmetric} with mutual information and cross-correlation to register a group of brain images to one another. The co-registration process is refined using a two-step strategy. First, all of the images are registered to one brain using only an affine transformation model and mutual information as the similarity measure to optimize. The resulting images are then averaged to form an initial blurry reference brain image. Second, the original brain images are non-linearly registered to this average to create a new average that maximizes the cross-correlation of the intensities of all brains. In this second step, the registration is improved gradually at different (in the present case, four) resolution levels and the result is an optimal average template. For combining the co-registered images, we experimented first with a normalized voxel-wise average followed by sharpening with a Laplacian kernel (state-of-the-art in MRI). However, we found experimentally that an alternative strategy in which the template intensity image was generated by computing a voxel-wise median over the co-registered images produced slightly better results. The anatomical label image of the template was obtained by applying to each individual label image the diffeomorphic transformations computed from the corresponding confocal image, followed by a per-voxel majority voting over all warped label images. Individual brain images were registered against the templates using the same two-step strategy, which performs an initial affine registration with mutual information as similarity metric followed by non-rigid registration with SyN and cross-correlation as similarity measure. The first registration is crucial in order to compensate for the large disparities in size among the different ant species and subcastes, while the second one locally finds an optimal solution. All methods are implemented within the Advanced Normalization Tools (ANTs) software \cite{avants2011reproducible}. \subsection{Evaluation metrics} To evaluate the template performance, we registered test brains (not used in the template construction) against the template and transformed the template labels onto the test brain space. We quantified the overlap ratio of the labels in the test brain space using the Dice similarity index, which provides a normalized measure of the overlap between two labels $L_i^A$ and $L_i^B$. The Dice index is defined as $$\mathrm{Dice}(L_i)=2\frac{|L_i^A\cap R_i^B|}{|L_i^A|+|L_i^B|}$$ where $|L_i^A|$ and $|L_i^A|$ are respectively the number of voxels of label $i$ in brain $A$ and $B$. To quantify the shape and boundary errors, we measure the mean symmetric Euclidean distance between the surfaces of the labels. For each label $L_i$ in the pair of brains $A$ and $B$, we calculated the mean Euclidean distance $d_i^{A,B}$ between each surface point on $L_i^A$ and the closest surface point on $L_i^B$. The symmetric distance $d_i^{B,A}$ was calculated in an analogous way. The mean symmetric Euclidean distance was defined as $$\mathrm{Mean\ Symmetric\ Euclidean\ distance}(L_i) = \frac{d_i^{A,B}+d_i^{B,A}}{2}$$ Finally, to measure the maximal boundary and shape differences between the original brain labels and the registered template labels, we calculated the mean symmetric Hausdorff distance. The Hausdorff distance $h_i^{A,B}$ of labels $L_i^A$ and $L_i^B$ is defined as the longest distance between any point on the surface of $L_i^A$ and the closest point on the surface of $L_i^B$. By computing $h_i^{B,A}$ in an analogous way, the symmetric Hausdorff distance can be calculated as $$\mathrm{Symmetric\ Hausdorff\ distance}(L_i) = \frac{h_i^{A,B}+h_i^{B,A}}{2}$$ Notice both distance metrics are expressed in absolute distance units. \section{Results} \subsection{Building an ant brain template} As a proof-of-concept of our methodology, we first attempted to build intra-species and intra-subcaste templates. For that reason, we chose the $10$ minor and $10$ major worker samples from \textit{P. spadonia}. Here we realized that an initial affine pre-registration was needed due to the volume variability and imaging conditions. Both templates were successfully built and evaluated based on how well their consensus labels represented the sample population (see Fig. \ref{fig:minor-volume}). \begin{figure}[htb] \centering \centerline{\includegraphics[width=6.5cm]{minor-volume}} \caption{Evaluation of volume ($\times10^4 \mu m^3$) per anatomical region of minor \textit{P. spadonia} template. Blue lines represent the standard deviation of the volume of the original manual labels while the red dots are the template volume value.} \label{fig:minor-volume} \end{figure} \subsection{Building and evaluating hybrid templates} After analyzing the morphological differences of the sample populations based on their anatomical labels using the open-source toolbox MorphoLibJ \cite{legland2016morpholibj} (see Fig. \ref{fig:morphology-measures}), we decided to build and evaluate hybrid templates mixing minor samples of the different species. More specifically, we constructed one template (RTO) using all minor species except \textit{P. spadonia} (with 3 brains per species) and another template (SRTO) with \textit{P. spadonia} samples as well. All samples not used as part of templates, were used for testing their performance. Fig. \ref{fig:template-results} shows the evaluation results per label for the $4$ templates we created (\textit{P. spadonia} major, \textit{P. spadonia} minor, RTO and SRTO). The only template built with major samples performs notably worse than the other $3$ using both overlap and distance metrics, specially in the OL and CB. It is remarkable how the \textit{P. spadonia} minor performs only slightly worse than RTO and SRTO even though not a single \textit{P. spadonia} sample was used for testing. \begin{figure}[htb] \centering \centerline{\includegraphics[width=12cm]{morphology-measures}} \caption{Morphological differences between species and subcastes. From top to bottom: volume, surface area and sphericity measurements.} \label{fig:morphology-measures} \end{figure} \begin{figure}[htb] \centering \centerline{\includegraphics[width=12cm]{template-results}} \caption{Evaluation of template performance per label. From top to bottom: Dice coefficient, Euclidean distance and Symmetric Hausdorff distance. Distances are expressed in microns.} \label{fig:template-results} \end{figure} \subsection{Evaluating worker polymorphisms and brain structure} One advantage of having templates of a single type of brain is that they allow to study the main morphological differences between species and/or subcastes. Following a methodology previously contrasted for fly brains \cite{manton2014combining}, we can register for instance our \textit{P. spadonia} minor and major templates to each other, and calculate the volume change of each voxel via the use of the Jacobian determinant. Once the difference in size is compensated with the affine transform, the local non-linear deformations can be visualized as a heatmap (see Fig. \ref{fig:jacobian}), emphasizing the regions of large differences. \begin{figure}[htb] \centering \centerline{\includegraphics[width=12cm]{jacobian}} \caption{Inter-type deformation-based morphometry. From left to right: central view of \textit{P. spadonia} minor template, Jacobian determinant of deformation from minor to major template, and \textit{P. spadonia} major template. Scale bar: $100\mu m$.} \label{fig:jacobian} \end{figure} \section{Conclusions and Future work} We present a groupwise 3D registration strategy to build bias-free antbrain atlases that enable the efficient quantification of inter- and intraspecific variation in brain organization as evident in compartmental substructuring by automatic segmentation. We numerically evaluated template performance using expert-made manual annotations to validate that the atlases can be used to accurately study brain anatomy. To the best of our knowledge, this is the first time that automated atlases have been used to quantify ant brain volumes. The application of the current work to address questions in evolutionary neurobiology that require extensive datasets that adequately sample species-rich taxa will expedite the study of ant brain structure in relation to their ecological and evolutionary success and its association with division of labor and collective organization. The ability to accurately and rapidly collect volumetric neuroanatomical data will greatly expand our ability to test social brain evolution in diverse clades such as ants. Combined with phylogenetic analysis, immunohistochemistry, respirometry, high-performance liquid chromatography and other techniques, brain templates can help elucidate macroevolutionary and microevolutionary patterns of brain evolution, as well as mechanistic studies of the energetic cost of functionally specialized regions in the brain and the nature of aminergic control systems. This will allow to better understand regional brain investment in regard to the behavioral ecology of individual workers and their task specializations, and the impact of social processes operating at the colony-level. \section*{Acknowledgements} SA was supported by a Marie Skłodowska-Curie Individual Fellowship (BrainiAnts-660976). DGG, AHP and JFAT, NSF were supported by grant IOS 1354291. \bibliographystyle{IEEEbib}
{'timestamp': '2017-08-23T02:01:09', 'yymm': '1701', 'arxiv_id': '1701.01433', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01433'}
arxiv
\section{Approach} \label{sec:approach} \begin{table} \centering \caption{SURREAL dataset in numbers. Each MoCap sequence is rendered 3 times (with 3 different overlap ratios). Clips are mostly 100 frames long. We obtain a total of 6,5 million frames.} \label{table:cmu} \resizebox{\linewidth}{!}{ \begin{tabular}{@{\hspace{.1in}}lrrrr@{}} \toprule & \#subjects & \#sequences & \#clips & \#frames \\\midrule Train & 115 & 1,964 & 55,001 & 5,342,090 \\ Test & 30 & 703 & 12,528 & 1,194,662 \\\midrule Total & 145 & 2,607 & 67,582 & {\bf 6,536,752} \\\bottomrule \end{tabular} } \mbox{}\vspace{-0.5cm}\\ \end{table} In this section, we present our approach for human body part segmentation~\cite{chen_cvpr16, icra16} and human depth estimation~\cite{eigen_iccv15, eigen_nips14, liu_cvpr15}, which we train with synthetic and/or real data, see Section~\ref{sec:experiments} for the evaluation. Our approach builds on the stacked hourglass network architecture introduced originally for 2D pose estimation problem~\cite{Newell2016}. This network involves several repetitions of contraction followed by expansion layers which have skip connections to implicitly model spatial relations from different resolutions that allows bottom-up and top-down structured prediction. The convolutional layers with residual connections and 8 `hourglass' modules are stacked on top of each other, each successive stack taking the previous stack's prediction as input. The reader is referred to~\cite{Newell2016} for more details. A variant of this network has been used for scene depth estimation~\cite{chen_nips16}. We choose this architecture because it can infer pixel-wise output by taking into account human body structure. Our network input is a 3-channel RGB image of size $256\times256$ cropped and scaled to fit a human bounding box using the ground truth. The network output for each stack has dimensions $64\times64\times15$ in the case of segmentation (14 classes plus the background) and $64\times64\times20$ for depth (19 depth classes plus the background). We use cross-entropy loss defined on all pixels for both segmentation and depth. The final loss of the network is the sum over 8 stacks. We train for 50K iterations for synthetic pre-training using the RMSprop algorithm with mini-batches of size 6 and a learning rate of $10^{-3}$. Our data augmentation during training includes random rotations, scaling and color jittering. We formulate the problem as pixel-wise classification task for both segmentation and depth. When addressing segmentation, each pixel is assigned to one of the pre-defined 14 human parts, namely head, torso, upper legs, lower legs, upper arms, lower arms, hands, feet (separately for right and left) or to the background class. Regarding the depth, we align ground-truth depth maps on the z-axis by the depth of the pelvis joint, and then quantize depth values into 19 bins (9 behind and 9 in front of the pelvis). We set the quantization constant to 45mm to roughly cover the depth extent of common human poses. The network is trained to classify each pixel into one of the 19 depth bins or background. At test time, we first upsample feature maps of each class with bilinear interpolation by a factor of 4 to output the original resolution. Then, each pixel is assigned to the class for which the corresponding channel has the maximum activation. \section{Conclusions} \label{sec:conclusion} In this study, we have shown successful large-scale training of CNNs from synthetically generated images of people. We have addressed two tasks, namely, human body part segmentation and depth estimation, for which large-scale manual annotation is infeasible. Our generated synthetic dataset comes with rich pixel-wise ground truth information and can potentially be used for other tasks than considered here. Unlike many existing synthetic datasets, the focus of SURREAL is on the realistic rendering of people, which is a challenging task. In our future work, we plan to integrate the person into the background in a more realistic way by taking into account the lighting and the 3D scene layout. We also plan to augment the data with more challenging scenarios such as occlusions and multiple people. \section{Data generation} \vspace{-0.1cm} \label{sec:data} This section presents our SURREAL (Synthetic hUmans foR REAL tasks) dataset and describes key steps for its generation (Section~\ref{ss:synthetic_humans}). We also describe how we obtain ground truth data for real MoCap sequences (Section~\ref{ss:real_humans}). \subsection{Synthetic humans} \label{ss:synthetic_humans} Our pipeline for generating synthetic data is illustrated in Figure~\ref{fig:pipeline}. A human body with a {\em random} 3D pose, {\em random} shape and {\em random} texture is rendered from a {\em random} view-point for some {\em random} lighting and a {\em random} background image. Below we define what ``random'' means in all these cases. Since the data is synthetic, we also generate ground truth depth maps, optical flow, surface normals, human part segmentations and joint locations (both 2D and 3D). As a result, we obtain 6.5 million frames grouped into $67,582$ continuous image sequences. See Table~\ref{table:cmu} for more statistics, Section~\ref{subsec:synthetictest} for the description of the synthetic train/test split, and Figure~\ref{fig:samples} for samples from the SURREAL dataset. \vspace{-0.5cm} \paragraph{Body model.} Synthetic bodies are created using the SMPL body model~\cite{loper_smpl}. SMPL is a realistic articulated model of the body created from thousands of high-quality 3D scans, which decomposes body deformations into pose (kinematic deformations due to skeletal posture) and shape (body deformations intrinsic to a particular person that make them different from others). SMPL is compatible with most animation packages like Blender~\cite{blender}. SMPL deformations are modeled as a combination of linear blend skinning and linear blendshapes defined by principal components of body shape variation. SMPL pose and shape parameters are converted to a triangulated mesh using Blender, which then applies texture, shading and adds a background to generate the final RGB output. \vspace{-0.5cm} \paragraph{Body shape.} In order to render varied, but realistic, body shapes we make use of the CAESAR dataset~\cite{caeser}, which was used to train SMPL. To create a body shape, we select one of the CAESAR subjects at random and approximate their shape with the first 10 SMPL shape principal components. Ten shape components explain more than $95\%$ of the shape variance in CAESAR (at the resolution of our mesh) and produce quite realistic body shapes. \vspace{-0.5cm} \paragraph{Body pose.} To generate images of people in realistic poses, we take motion capture data from the CMU MoCap database~\cite{cmu_mocap}. CMU MoCap contains more than 2000 sequences of 23 high-level action categories, resulting in more than 10 hours of recorded 3D locations of body markers. It is often challenging to realistically and automatically retarget MoCap skeleton data to a new model. For this reason we do not use the skeleton data but rather use MoSh~\cite{loper_mosh} to fit the SMPL parameters that best explain raw 3D MoCap marker locations. This gives both the 3D shape of the subject and the articulated pose parameters of SMPL. To increase the diversity, we replace the estimated 3D body shape with a set of randomly sampled body shapes. We render each CMU MoCap sequence three times using different random parameters. Moreover, we divide the sequences into clips of 100 frames with 30\%, 50\% and 70\% overlaps for these three renderings. Every pose of the sequence is rendered with consistent parameters (i.e.\ body shape, clothing, light, background etc.) within each clip. \vspace{-0.5cm} \paragraph{Human texture.} We use two types of real scans for the texture of body models. First, we extract SMPL texture maps from CAESAR scans, which come with a color texture per 3D point. These maps vary in skin color and person identities, however, their quality is often low due to the low resolution, uniform tight-fitting clothing, and visible markers placed on the face and the body. Anthropometric markers are automatically removed from the texture images and inpainted. To provide more variety, we extract a second set of textures obtained from 3D scans of subjects with normal clothing. These scans are registered with 4Cap as in~\cite{Dyna:SIGGRAPH:2015}. The texture of real clothing substantially increases the realism of generated images, even though SMPL does not model 3D deformations of clothes. $20\%$ of our data is rendered with the first set ($158$ CAESAR textures randomly sampled from $4000$), and the rest with the second set ($772$ clothed textures). To preserve the anonymity of subjects, we replace all faces in the texture maps by the average CAESAR face. The skin color of this average face is corrected to fit the face skin color of the original texture map. This corrected average face is blended smoothly with the original map, resulting in a realistic and anonymized body texture. \vspace{-0.5cm} \paragraph{Light.} The body is illuminated using Spherical Harmonics with $9$ coefficients~\cite{green2003spherical}. The coefficients are randomly sampled from a uniform distribution between $-0.7$ and $0.7$, apart from the ambient illumination coefficient (which has a minimum value of $0.5$) and the vertical illumination component, which is biased to encourage the illumination from above. Since Blender does not provide Spherical Harmonics illumination, a spherical harmonic shader for the body material was implemented in Open Shading Language. \vspace{-0.5cm} \paragraph{Camera.} The projective camera has a resolution of $320\times 240$, focal length of $60$mm and sensor size of $32$mm. To generate images of the body in a wide range of positions, we take 100-frame MoCap sub-sequences and, in the first frame, render the body so that the center of the viewport points to the pelvis of the body, at a random distance (sampled from a normal distribution with $8$ meters mean, $1$ meter deviation) with a random yaw angle. The remainder of the sequence then effectively produces bodies in a range of locations relative to the static camera. \vspace{-0.5cm} \paragraph{Background.} We render the person on top of a static background image. To ensure that the backgrounds are reasonably realistic and do not include other people, we sample from a subset of LSUN dataset~\cite{yu_lsun} that includes total of 400K images from the categories kitchen, living room, bedroom and dining room. \vspace{-0.5cm} \paragraph{Ground truth.} We perform multiple rendering passes in Blender to generate different types of per-pixel ground truth. The {\em material} pass generates pixel-wise segmentation of rendered body parts, given different material indices assigned to different parts of our body model. The {\em velocity} pass, typically used to simulate motion blur, provides us with a render simulating optical flow. The {\em depth} and {\em normal} passes, used for emulating effects like fog, bokeh or for performing shading, produce per-pixel depth maps and normal maps. The final texture rendering pass overlays the shaded, textured body over the random background. Together with this data we save camera and lighting parameters as well as the 2D/3D positions of body joints. \subsection{Generating ground truth for real human data} \label{ss:real_humans} Human3.6M dataset~\cite{IonescuSminchisescu11, h36m_pami} provides ground truth for 2D and 3D human poses. Additionally, a subset of the dataset (H80K)~\cite{Ionescu_2014_CVPR} has segmentation annotation, but the definition of parts is different from the SMPL body parts used for our training. We complement this ground truth and generate predicted SMPL body-part segmentation and depth maps for people in Human3.6M for all frames. Here again we use MoSh~\cite{loper_mosh} to fit the SMPL body shape and pose to the raw MoCap marker data. This provides a good fit of the model to the shape and the pose of real bodies. Given the provided camera calibration, we project models to images. We then render the ground truth segmentation, depth, and 2D/3D joints as above, while ensuring correspondence with real pixel values in the dataset. The depth is different from the time-of-flight (depth) data provided by the official dataset. These MoSh fits provide a form of approximate ``ground truth''. See Figures~\ref{fig:H36Msegmimg} and~\ref{fig:H36Mdepthimg} for generated examples. We use this for evaluation on the test set as well as for the baseline where we train only on real data, and also for fine-tuning our models pre-trained on synthetic data. In the rest of the paper, all frames from the synthetic training set are used for synthetic pre-training. \section{Experiments} \label{sec:experiments} We test our approach on several datasets. First, we evaluate the segmentation and depth estimation on the test set of our synthetic SURREAL dataset. Second, we test the performance of segmentation on real images from the Freiburg Sitting People dataset~\cite{icra16}. Next, we evaluate segmentation and depth estimation on real videos from the Human3.6M dataset~\cite{IonescuSminchisescu11, h36m_pami} with available 3D information. Then, we qualitatively evaluate our approach on the more challenging MPII Human Pose dataset~\cite{andriluka14cvpr}. Finally, we experiment and discuss design choices of the SURREAL dataset. \vspace{-0.1cm} \subsection{Evaluation measures} \vspace{-0.1cm} \label{subsec:measures} We use intersection over union (IOU) and pixel accuracy measures for evaluating the segmentation approach. The final measure is the average over 14 human parts as in~\cite{icra16}. Depth estimation is formulated as a classification problem, but we take into account the continuity when we evaluate. We compute root-mean-squared-error (RMSE) between the predicted quantized depth value (class) and the ground truth quantized depth on the human pixels. To interpret the error in real world coordinates, we multiply it by the quantization constant (45mm). We also report a scale and translation invariant RMSE (st-RMSE) by solving for the best translation and scaling in z-axis to fit the prediction to the ground truth. Since inferring depth from RGB is ambiguous, this is a common technique used in evaluations~\cite{eigen_nips14}. \vspace{-0.1cm} \subsection{Validation on synthetic images} \vspace{-0.1cm} \label{subsec:synthetictest} \paragraph{Train/test split.} To evaluate our methods on synthetic images, we separate $20\%$ of the synthetic frames for the test set and train all our networks on the remaining training set. The split is constructed such that a given CMU MoCap subject is assigned as either train or test. Whereas some subjects have a large number of instances, some subjects have unique actions, and some actions are very common (walk, run, jump). Overall, 30 subjects out of 145 are assigned as test. 28 test subjects cover all common actions, and 2 have unique actions. Remaining subjects are used for training. Although our synthetic images have different body shape and appearance than the subject in the originating MoCap sequence, we still found it appropriate to split by subjects. We separate a subset of our body shapes, clothing and background images for the test set. This ensures that our tests are unbiased with regards to appearance, yet are still representative of all actions. Table~\ref{table:cmu} summarizes the number of frames, clips and MoCap sequences in each split. Clips are the continuous 100-frame sequences where we have the same random body shape, background, clothing, camera and lighting. A new random set is picked at every clip. Note that a few sequences have less than 100 frames. \begin{figure} \small \begin{tabular}{DDDDD} \rowcolor{LightGray} Input & Pred$_{segm}$ & GT$_{segm}$ & Pred$_{depth}$ & GT$_{depth}$ \end{tabular}\\ \includegraphics[width=0.092\textwidth]{figs/cmu/rgb_185.png} \includegraphics[width=0.092\textwidth]{figs/cmu/segmpred_185.png} \includegraphics[width=0.092\textwidth]{figs/cmu/segmgt_185.png} \includegraphics[width=0.092\textwidth]{figs/cmu/depthpred_185.png} \includegraphics[width=0.092\textwidth]{figs/cmu/depthgt_185.png} \\ \includegraphics[width=0.092\textwidth]{figs/cmu/rgb_188.png} \includegraphics[width=0.092\textwidth]{figs/cmu/segmpred_188.png} \includegraphics[width=0.092\textwidth]{figs/cmu/segmgt_188.png} \includegraphics[width=0.092\textwidth]{figs/cmu/depthpred_188.png} \includegraphics[width=0.092\textwidth]{figs/cmu/depthgt_188.png} \caption{Segmentation and depth predictions on synthetic test set.} \label{fig:cmusegmdepth} \mbox{}\vspace{-1cm}\\ \end{figure} \input{figFSittingsegmimg.tex} \vspace{-0.5cm} \paragraph{Results on synthetic test set.} The evaluation is performed on the middle frame of each 100-frame clip on the aforementioned held-out synthetic test set, totaling in 12,528 images. For segmentation, the IOU and pixel accuracy are 69.13\% and 80.61\%, respectively. Evaluation of depth estimation gives 72.9mm and 56.3mm for RMSE and st-RMSE errors, respectively. Figure~\ref{fig:cmusegmdepth} shows sample predictions. For both tasks, the results are mostly accurate on synthetic test images. However, there exist a few challenging poses (e.g. crawling), test samples with extreme close-up views, and fine details of the hands that are causing errors. In the following sections, we investigate if similar conclusions can be made for real images. \vspace{-0.1cm} \subsection{Segmentation on Freiburg Sitting People} \vspace{-0.1cm} Freiburg Sitting People (FSitting) dataset~\cite{icra16} is composed of 200 high resolution (300x300 pixels) front view images of 6 subjects sitting on a wheel chair. There are 14 human part annotations available. See Figure~\ref{fig:FSittingsegmimg} for sample test images and corresponding ground truth (GT) annotation. We use the same train/test split as~\cite{icra16}, 2 subjects for training and 4 subjects for test. The amount of data is limited for training deep networks. We show that our network pre-trained only on synthetic images is already able to segment human body parts. This shows that the human renderings in the synthetic dataset are representative of the real images, such that networks trained exclusively on synthetic data can generalize quite well to real data. \begin{table} \centering \caption{Parts segmentation results on 4 test subjects of Freiburg Sitting People dataset. IOU for head, torso and upper legs (averaged over left and right) are presented as well as the mean IOU and mean pixel accuracy over 14 parts. The means do not include background class. By adding an upsampling layer, we get the best results reported on this dataset.} \label{table:FSitting} \resizebox{\linewidth}{!}{ \begin{tabular}{@{\hspace{.1in}}llllll@{}} \toprule & Head & Torso & Legs$_{up}$ & mean & mean \\ Training data & IOU & IOU & IOU & IOU & Acc. \\\midrule Real+Pascal\cite{icra16}& - & - & - & 64.10 & 81.78\\\midrule Real & 58.44 & 24.92 & 30.15 & 28.77 & 38.02\\ Synth & 73.20 & 65.55 & 39.41 & 40.10 & 51.88\\ Synth+Real & 72.88 & 80.76 & 65.41 & 59.58 & 78.14\\ {\bf Synth+Real+up} & {\bf 85.09} & {\bf 87.91} & {\bf 77.00} & {\bf 68.84} & {\bf 83.37}\\\bottomrule \vspace{-0.8cm} \end{tabular} } \end{table} \begin{table} \centering \caption{Parts segmentation results on Human3.6M. The best result is obtained by fine-tuning synthetic network with real images. Although the performance of the network trained only with real data outperforms training only with synthetic, the predictions visually are worse because of overfitting, see Figure~\ref{fig:H36Msegmimg}.} \label{table:h36msegm} \resizebox{\linewidth}{!}{ \begin{tabular}{@{\hspace{.1in}}l@{\hspace{1.1cm}}cc@{\hspace{1.1cm}}cc@{\hspace{.1in}}} \toprule & \multicolumn{2}{@{\hspace{-1.1cm}}c}{IOU} & \multicolumn{2}{c}{Accuracy} \\ Training data & fg+bg & fg & fg+bg & fg \\\midrule Real & 49.61 & 46.32 & 58.54 & 55.69 \\ Synth & 46.35 & 42.91 & 56.51 & 53.55 \\ Synth+Real & 57.07 & 54.30 & 67.72 & 65.53 \\\bottomrule \vspace{-1.1cm} \end{tabular} } \end{table} Table~\ref{table:FSitting} summarizes segmentation results on FSitting. We carry out several experiments to understand the gain from synthetic pre-training. For the `Real' baseline, we train a network from scratch using 2 training subjects. This network overfits as there are few subjects to learn from and the performance is quite low. Our `Synth' result is obtained using the network pre-trained on synthetic images without fine-tuning. We get 51.88\% pixel accuracy and 40.1\% IOU with this method and clearly outperform training from real images. Furthermore, fine-tuning (Synth+Real) with 2 training subjects helps significantly. See Figure~\ref{fig:FSittingsegmimg} for qualitative results. Given the little amount for training in FSitting, the fine-tuning converges after 200 iterations. In~\cite{icra16}, the authors introduce a network that outputs a high-resolution segmentation after several layers of upconvolutions. For a fair comparison, we modify our network to output full resolution by adding one bilinear upsampling layer followed by nonlinearity (ReLU) and a convolutional layer with $3\times3$ filters that outputs $15\times300\times300$ instead of $15\times64\times64$ as explained in Section~\ref{sec:approach}. If we fine-tune this network (Synth+Real+up) on FSitting, we improve performance and outperform~\cite{icra16} by a large margin. Note that~\cite{icra16} trains on the same FSitting training images, but added around 2,800 Pascal images. Hence they use significantly more manual annotation than our method. \vspace{-0.1cm} \subsection{Segmentation and depth on Human3.6M} \vspace{-0.1cm} \label{ss:res_human3.6} To evaluate our approach, we need sufficient real data with ground truth annotations. Such data is expensive to obtain and currently not available. For this reason, we generate nearly perfect ground truth for images recorded with a calibrated camera and given their MoCap data. Human3.6M~\cite{IonescuSminchisescu11, h36m_pami} is currently the largest dataset where such information is available. There are 3.6 million frames from 4 cameras. We use subjects S1, S5, S6, S7, S8 for training, S9 for validation and S11 for testing as in~\cite{rogez:hal-01389486, Yasin_Iqbal_CVPR2016}, but from all 4 cameras. Note that this is different from the official train/test split~\cite{h36m_pami}. Each subject performs each of the 15 actions twice. We use all frames from one of the two instances of each action for training, and every 64$^{th}$ frame from all instances for testing. The frames have resolution $1000\times1000$ pixels, we assume a $256\times 256$ cropped human bounding box is given to reduce computational complexity. We evaluate the performance of both segmentation and depth, and compare with the baseline for which we train a network on real images only. \input{figH36Msegmimg.tex} \input{figH36Mdepthimg.tex} \vspace{-0.5cm} \paragraph{Segmentation.} Table~\ref{table:h36msegm} summarizes the parts segmentation results on Human3.6M. Note that these are not comparable to the results in~\cite{Ionescu_2014_CVPR} both because they assume the background segment is given and our ground truth segmentation data is not part of the official release (see Section~\ref{ss:real_humans}). We report both the mean over 14 human parts (fg) and the mean together with the background class (fg+bg). Training on real images instead of synthetic images increases IOU by 3.4\% and pixel accuracy by 2.14\%. This is expected because the training distribution matches the test distribution in terms of background, camera position and action categories (i.e.\ poses). Furthermore, the amount of real data is sufficient to perform CNN training. However, since there are very few subjects available, we see that the network doesn't generalize to different clothing. In Figure~\ref{fig:H36Msegmimg}, the `Real' baseline has the border between shoulders and upper arms exactly on the T-shirt boundaries. This reveals that the network learns about skin color rather than actual body parts. Our pre-trained network (Synth) performs reasonably well, even though the pose distribution in our MoCap is quite different than that of Human3.6M. When we fine-tune the network with real images from Human3.6M (Synth+Real), the model predicts very accurate segmentations and outperforms the `Real' baseline by a large margin. Moreover, our model is capable of distinguishing left and right most of the time on all 4 views since it has been trained with randomly sampled views. \vspace{-0.5cm} \paragraph{Depth estimation.} Depth estimation results on Human3.6M for various poses and viewpoints are illustrated in Figure~\ref{fig:H36Mdepthimg}. Here, the pre-trained network fails at the very challenging poses, although it still captures partly correct estimates (first row). Fine-tuning on real data compensates for these errors and refines estimations. In Table~\ref{table:h36mdepth}, we show RMSE error measured on foreground pixels, together with the scale-translation invariant version (see Section~\ref{subsec:measures}). We also report the error only on known 2D joints (PoseRMSE) to have an idea of how well a 3D pose estimation model would work based on the depth predictions. One would need to handle occluded joints to infer 3D locations of all joints, and this is beyond the scope of the current paper. \begin{table} \centering \caption{Depth estimation results on Human3.6M (in millimeters). The depth errors RMSE and st-RMSE are reported on foreground pixels. PoseRMSE error is measured only on given human joints.} \label{table:h36mdepth} \resizebox{\linewidth}{!}{ \begin{tabular}{@{\hspace{.1in}}lrrrr@{}} \toprule Training data & RMSE & st-RMSE & PoseRMSE & st-PoseRMSE \\\midrule Real & 96.3 & 75.2 & 122.6 & 94.5 \\ Synth & 111.6 & 98.1 & 152.5 & 131.5 \\ Synth+Real & 90.0 & 67.1 & 92.9 & 82.8\\\bottomrule \vspace{-1.2cm} \end{tabular} } \end{table} \input{figMPIIimg.tex} \vspace{-0.1cm} \subsection{Qualitative results on MPII Human Pose} \vspace{-0.1cm} FSitting and Human3.6M are relatively simple datasets with limited background clutter, few subjects, single person per image, full body visible. In this section, we test the generalization of our model on more challenging images. MPII Human Pose~\cite{andriluka14cvpr} is one of the largest datasets with diverse viewpoints and clutter. However, this dataset has no ground truth for part segmentation nor depth. Therefore, we qualitatively show our predictions. Figure~\ref{fig:MPII} illustrates several success and failure cases. Our model generalizes reasonably well, except when there are multiple people close to each other and extreme viewpoints, which have not appeared during training. It is interesting to note that although lower body occlusions and cloth shapes are not present in synthetic training, the models perform accurately in such cases, see Figure~\ref{fig:MPII} caption. \vspace{-0.1cm} \subsection{Design choices} \vspace{-0.1cm} We did several experiments to answer questions such as `How much data should we synthesize?', `Is CMU MoCap enough?', `What's the effect having clothing variation?'. \vspace{-0.5cm} \paragraph{Amount of data.} We plot the performance as a function of training data size. We train with a random subset of $10^{-2}$, $10^{-1}$, $10^0$, $10^1$\% of the 55K training clips using all frames of the selected clips, i.e.,~$10^{0}$\% corresponds to 550 clips with a total of 55k frames. Figure~\ref{fig:designchoices} (left) shows the increase in performance for both segmentation and depth as we increase training data. Results are plotted on synthetic and Human3.6M test sets with and without fine-tuning. The performance gain is higher at the beginning of all curves. There is some saturation, training with 55k frames is sufficient, and it is more evident on Human3.6M after a certain point. We explain this by the lack of diversity in Human3.6M test set and the redundancy of MoCap poses. \vspace{-0.5cm} \paragraph{Clothing variation.} Similarly, we study what happens when we add more clothing. We train with a subset of 100 clips containing only 1, 10 or 100 different clothings (out of a total of 930), because the dataset has maximum 100 clips for a given clothing and we want to use same number of training clips, i.e., 1 clothing with 100 clips, 10 clothings with 10 clips each and 100 clothings with 1 clip each. Figure~\ref{fig:designchoices} (right) shows the increase in performance for both tasks as we increase clothing variation. In the case of fine-tuning, the impact gets less prominent because training and test images of Human3.6M are recorded in the same room. Moreover, there is only one subject in our test set, ideally such experiment should be evaluated on more diverse data. \vspace{-0.5cm} \paragraph{MoCap variation.} Pose distribution depends on the MoCap source. To experiment with the effect of having similar poses in training as in test, we rendered synthetic data using Human3.6M MoCap. Segmentation and depth networks pre-trained on this data (IOU: 48.11\%, RMSE: 2.44) outperform the ones pre-trained on CMU MoCap (42.82\%, 2.57) when tested on real Human3.6M. It is important to have diverse MoCap and to match the target distribution. Note that we exclude the Human3.6M synthetic data in Section~\ref{ss:res_human3.6} to address the more generic case where there is no dataset specific MoCap data available. \begin{figure} \mbox{}\vspace{-0.6cm}\\ \begin{center} \includegraphics[width=0.47\linewidth]{figs/designchoices/depth_trSize.pdf} \quad \includegraphics[width=0.47\linewidth]{figs/designchoices/depth_cloth.pdf} \includegraphics[width=0.47\linewidth]{figs/designchoices/segm_trSize.pdf} \quad \includegraphics[width=0.47\linewidth]{figs/designchoices/segm_cloth.pdf} \end{center} \mbox{}\vspace{-1.2cm}\\ \caption{\textbf{Left}: Amount of data. \textbf{Right}: Clothing variation. Segmentation and depth are tested on the synthetic and Human3.6M test sets with networks pre-trained on a subset of the synthetic training data. We also show fine-tuning on Human3.6M. The x-axis is in log-scale. } \label{fig:designchoices} \mbox{}\vspace{-1.4cm}\\ \end{figure} \section{Introduction} Convolutional Neural Networks provide significant gains to problems with large amounts of training data. In the field of human analysis, recent datasets~\cite{andriluka14cvpr, sapp13multimodal} now gather a sufficient number of annotated images to train networks for 2D human pose estimation~\cite{Newell2016,wei2016convolutional}. Other tasks such as accurate estimation of human motion, depth and body-part segmentation are lagging behind as manual supervision for such problems at large scale is prohibitively expensive. Images of people have rich variation in poses, clothing, hair styles, body shapes, occlusions, viewpoints, motion blur and other factors. Many of these variations, however, can be synthesized using existing 3D motion capture (MoCap) data~\cite{cmu_mocap,h36m_pami} and modern tools for realistic rendering. Provided sufficient realism, such an approach would be highly useful for many tasks as it can generate rich ground truth in terms of depth, motion, body-part segmentation and occlusions. \begin{figure} \begin{center} \includegraphics[width=0.99\linewidth]{figs/teaser.png} \mbox{}\vspace{-.3cm}\\ \end{center} \caption{We generate photo-realistic synthetic images and their corresponding ground truth for learning pixel-wise classification problems: human part segmentation and depth estimation. The convolutional neural network trained only on synthetic data generalizes to real images sufficiently for both tasks. Real test images in this figure are taken from MPII Human Pose dataset~\cite{andriluka14cvpr}.} \mbox{}\vspace{-1.3cm}\\ \label{fig:teaser} \end{figure} \begin{figure*}[t] \centering \includegraphics[width=0.96\textwidth, clip]{figs/pipeline.png} \caption{Our pipeline for generating synthetic data. A 3D human body model is posed using motion capture data and a frame is rendered using a background image, a texture map on the body, lighting and a camera position. These ingredients are randomly sampled to increase the diversity of the data. We generate RGB images together with 2D/3D poses, surface normals, optical flow, depth images, and body-part segmentation maps for rendered people.} \mbox{}\vspace{-0.8cm}\\ \label{fig:pipeline} \end{figure*} Although synthetic data has been used for many years, realism has been limited. In this work we present SURREAL: a new large-scale dataset with synthetically-generated but realistic images of people. Images are rendered from 3D sequences of MoCap data. To ensure realism, the synthetic bodies are created using the SMPL body model~\cite{loper_smpl}, whose parameters are fit by the MoSh~\cite{loper_mosh} method given raw 3D MoCap marker data. We randomly sample a large variety of viewpoints, clothing and lighting. SURREAL contains more than 6 million frames together with ground truth pose, depth maps, and segmentation masks. We show that CNNs trained on synthetic data allow for accurate human depth estimation and human part segmentation in real RGB images, see Figure~\ref{fig:teaser}. Here, we demonstrate that our dataset, while being synthetic, reaches the level of realism necessary to support training for multiple complex tasks. This opens up opportunities for training deep networks using graphics techniques available now. SURREAL dataset is publicly available together with the code to generate synthetic data and to train models for body part segmentation and depth estimation~\cite{surrealpage}. The rest of this paper is organized as follows. Section~\ref{sec:relatedwork} reviews related work. Section~\ref{sec:data} presents our approach for generating realistic synthetic videos of people. In Section~\ref{sec:approach} we describe our CNN architecture for human body part segmentation and depth estimation. Section~\ref{sec:experiments} reports experiments. We conclude in Section~\ref{sec:conclusion}. \section{Related work} \label{sec:relatedwork} Knowledge transfer from synthetic to real images has been recently studied with deep neural networks. Dosovitskiy \etal~\cite{dosovitskiy_flownet} learn a CNN for optical flow estimation using synthetically generated images of rendered 3D moving chairs. Peng \etal~\cite{peng_synthetic} study the effect of different visual cues such as object/background texture and color when rendering synthetic 3D objects for object detection task. Similarly, \cite{Su_2015_ICCV} explores rendering 3D objects to perform viewpoint estimation. Fanello \etal~\cite{Fanello} render synthetic infrared images of hands and faces to predict depth and parts. Recently, Gaidon \etal~\cite{Gaidon:Virtual:CVPR2016} have released the Virtual KITTI dataset with synthetically generated videos of cars to study multi-object tracking. Several works focused on creating synthetic images of human bodies for learning 2D pose estimation~\cite{6248052, weichao2016, romero_flowcap}, 3D pose estimation~\cite{synthetic_cohenor, Du2016, Deep3DPose, Okada2008, rogez:hal-01389486, Sminchisescu06, zhou_cvpr16}, pedestrian detection~\cite{MarinVGL10, 6248052, 5995574}, and action recognition~\cite{rahmani_nktm, rahmani_hpm}. Pishchulin \etal~\cite{5995574} generate synthetic images with a game engine. In~\cite{6248052}, they deform 2D images with a 3D model. More recently, Rogez and Schmid~\cite{rogez:hal-01389486} use an image-based synthesis engine to augment existing real images. Ghezelghieh \etal~\cite{Deep3DPose} render synthetic images with 10 simple body models with an emphasis on upright people; however, the main challenge using existing MoCap data for training is to generalize to poses that are not upright. Human3.6M dataset~\cite{h36m_pami} presents realistic rendering of people in mixed reality settings; however, the approach to create these is expensive. A similar direction has been explored in~\cite{rahmani_nktm, rahmani_hpm, egocap2016, shotton2011}. In~\cite{rahmani_nktm}, action recognition is addressed with synthetic human trajectories from MoCap data.~\cite{rahmani_hpm, shotton2011} train CNNs with synthetic depth images. EgoCap~\cite{egocap2016} creates a dataset by augmenting egocentric sequences with background. The closest work to this paper is~\cite{synthetic_cohenor}, where the authors render large-scale synthetic images for predicting 3D pose with CNNs. Our dataset differs from~\cite{synthetic_cohenor} by having a richer, per-pixel ground truth, thus allowing to train for pixel-wise predictions and multi-task scenarios. In addition, we argue that the realism in our synthetic images is better (see sample videos in~\cite{surrealpage}), thus resulting in a smaller gap between features learned from synthetic and real images. The method in~\cite{synthetic_cohenor} heavily relies on real images as input in their training with domain adaptation. This is not the case for our synthetic training. Moreover, we render video sequences which can be used for temporal modeling. Our dataset presents several differences with existing synthetic datasets. It is the first large-scale person dataset providing depth, part segmentation and flow ground truth for synthetic RGB frames. Other existing datasets are used either for taking RGB image as input and training only for 2D/3D pose, or for taking depth/infrared images as input and training for depth/parts segmentation. In this paper, we show that photo-realistic renderings of people under large variations in shape, texture, viewpoint and pose can help solving pixel-wise human labeling tasks. \begin{figure*} \centering \includegraphics[width=0.99\textwidth]{figs/cmu_samples_3rows.png} \caption{ Sample frames from our SURREAL dataset with a large variety of poses, body shapes, clothings, viewpoints and backgrounds. } \mbox{}\vspace{-.65cm}\\ \label{fig:samples} \end{figure*}
{'timestamp': '2018-01-22T02:07:25', 'yymm': '1701', 'arxiv_id': '1701.01370', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01370'}
arxiv
\section{Introduction} Recently, compressive and abstractive summarization are attracting attention (e.g., \newcite{Almeida13}, \newcite{Qian13}, \newcite{Yao:IJCAI15}, \newcite{Banerjee:IJCAI15}, \newcite{Bing15}). However, extractive summarization remains a primary research topic because the linguistic quality of the resultant summaries is guaranteed, at least at the sentence level, which is a key requirement for practical use (e.g., \newcite{hong-nenkova:2014:EACL}, \newcite{hong-marcus-nenkova:2015:EMNLP}, \newcite{yogatama-liu-smith:2015:EMNLP}, \newcite{parveen-ramsl-strube:2015:EMNLP}). The summarization research community is experiencing a paradigm shift from extractive to compressive or abstractive summarization. Currently our question is: ``Is extractive summarization still useful research?'' To answer it, the ultimate limitations of the extractive summarization paradigm must be comprehended; that is, we have to determine its upper bound and compare it with the performance of the state-of-the-art summarization methods. Since $\text{\sc Rouge}_n$ is the de-facto automatic evaluation method and is employed in many text summarization studies, an oracle summary is defined as a set of sentences that have a maximum $\text{\sc Rouge}_n$ score. If the $\text{\sc Rouge}_n$ score of an oracle summary outperforms that of a system that employs another summarization approach, the extractive summarization paradigm is worthwhile to leverage research resources. As another benefit, identifying an oracle summary for a set of reference summaries allows us to utilize yet another evaluation measure. Since both oracle and extractive summaries are sets of sentences, it is easy to check whether a system summary contains sentences in the oracle summary. As a result, F-measures, which are available to evaluate a system summary, are useful for evaluating classification-based extractive summarization \cite{Mani:1998,osborne:2002,hirao02}. Since $\text{\sc Rouge}_n$ evaluation does not identify which sentence is important, an F-measure conveys useful information in terms of ``important sentence extraction.'' Thus, combining $\text{\sc Rouge}_n$ and an F-measure allows us to scrutinize the failure analysis of systems. Note that more than one oracle summary might exist for a set of reference summaries because $\text{\sc Rouge}_n$ scores are based on the unweighted counting of n-grams. As a result, an F-measure might not be identical among multiple oracle summaries. Thus, we need to enumerate the oracle summaries for a set of reference summaries and compute the F-measures based on them. In this paper, we first derive an Integer Linear Programming (ILP) problem to extract an oracle summary from a set of reference summaries and a source document(s). To the best of our knowledge, this is the first ILP formulation that extracts oracle summaries. Second, since it is difficult to enumerate oracle summaries for a set of reference summaries using ILP solvers, we propose an algorithm that efficiently enumerates all oracle summaries by exploiting the branch and bound technique. Our experimental results on the Document Understanding Conference (DUC) corpora showed the following: \begin{enumerate} \item Room still exists for the further improvement of extractive summarization, {\it i.e.}, where the $\text{\sc Rouge}_n$ scores of the oracle summaries are significantly higher than those of the state-of-the-art summarization systems. \item The F-measures derived from multiple oracle summaries obtain significantly stronger correlations with human judgment than those derived from single oracle summaries. \end{enumerate} \section{Definition of Extractive Oracle Summaries} We first briefly describe $\text{\sc Rouge}_n$. Given set of reference summaries $\boldsymbol{R}$ and system summary $S$, $\text{\sc Rouge}_n$ is defined as follows: \begin{equation} \label{rouge} \begin{split} \text{\sc Rouge}_n(\boldsymbol{R},S)=&\\ &\kern-7em \frac{ \displaystyle\sum_{k=1}^{|\boldsymbol{R}|}\sum_{j=1}^{|U({\cal R}_k)|}\min\{N(g_j^n,{\cal R}_k),N(g_j^n,{\cal S})\}}{\displaystyle\sum_{k=1}^{|\boldsymbol{R}|} \sum_{j=1}^{|U({\cal R}_k)|} N(g_j^n,{\cal R}_k)}. \end{split} \end{equation} \noindent ${\cal R}_k$ denotes the multiple set of n-grams that occur in $k$-th reference summary $R_k$, and $\mathcal{S}$ denotes the multiple set of n-grams that appear in system-generated summary $S$ (a set of sentences). $N(g_j^n,{\cal R}_k)$ and $N(g_j^n,{\cal S})$ return the number of occurrences of n-gram $g_j^n$ in the $k$-th reference and system summaries, respectively. Function $U(\cdot)$ transforms a multiple set into a normal set. $\text{\sc Rouge}_n$ takes values in the range of $[0,1]$, and when the n-gram occurrences of the system summary agree with those of the reference summary, the value is 1. In this paper, we focus on extractive summarization, employ $\text{\sc Rouge}_n$ as an evaluation measure, and define the oracle summaries as follows: \begin{equation} \label{def:oracle} \begin{split} O=&\argmax_{S \subseteq D} \text{\sc Rouge}_n(\boldsymbol{R},S)\\ s.t.& ~~~\ell(S) \le L_{\rm max}. \end{split} \end{equation} $D$ is the set of all the sentences contained in the input document(s), and $L_{\rm max}$ is the length limitation of the oracle summary. $\ell(S)$ indicates the number of words in the system summary. Eq. (\ref{def:oracle}) is an NP-hard combinatorial optimization problem, and no polynomial time algorithms exist that can attain an optimal solution. \section{Related Work} \newcite{Lin-Hovy:2003:DUC} utilized a naive exhaustive search method to obtain oracle summaries in terms of $\text{\sc Rouge}_n$ and exploited them to understand the limitations of extractive summarization systems. \newcite{ceylan-EtAl:2010:NAACLHLT} proposed another naive exhaustive search method to derive a probability density function from the {\sc Rouge}$_n$ scores of oracle summaries for the domains to which source documents belong. The computational complexity of naive exhaustive methods is exponential to the size of the sentence set. Thus, it may be possible to apply them to single document summarization tasks involving a dozen sentences, but it is infeasible to apply them to multiple document summarization tasks that involve several hundred sentences. To describe the difference between the $\text{\sc Rouge}_n$ scores of oracle and system summaries in multiple document summarization tasks, \newcite{Riedhammer} proposed an approximate algorithm with a genetic algorithm (GA) to find oracle summaries. \newcite{Moen14} utilized a greedy algorithm for the same purpose. Although GA or greedy algorithms are widely used to solve NP-hard combinatorial optimization problems, the solutions are not always optimal. Thus, the summary does not always have a maximum $\text{\sc Rouge}_n$ score for the set of reference summaries. Both works called the summary found by their methods the oracle, but it differs from the definition in our paper. Since summarization systems cannot reproduce human-made reference summaries in most cases, oracle summaries, which can be reproduced by summarization systems, have been used as training data to tune the parameters of summarization systems. For example, \newcite{Kulesza} and \newcite{sipos-shivaswamy-joachims:2012:EACL2012} trained their summarizers with oracle summaries found by a greedy algorithm. \newcite{peyrard-ecklekohler:2016} proposed a method to find a summary that approximates a {\sc Rouge} score based on the {\sc Rouge} scores of individual sentences and exploited the framework to train their summarizer. As mentioned above, such summaries do not always agree with the oracle summaries defined in our paper. Thus, the quality of the training data is suspect. Moreover, since these studies fail to consider that a set of reference summaries has multiple oracle summaries, the score of the loss function defined between their oracle and system summaries is not appropriate in most cases. As mentioned above, no known efficient algorithm can extract ``exact'' oracle summaries, as defined in Eq. (2), {\it i.e.}, because only a naive exhaustive search is available. Thus, such approximate algorithms as a greedy algorithm are mainly employed to obtain them. \section{Oracle Summary Extraction as an Integer Linear Programming (ILP) Problem } To extract an oracle summary from document(s) and a given set of reference summaries, we start by deriving an Integer Linear Programming (ILP) problem. Since the denominator of Eq. (\ref{rouge}) is constant for a given set of reference summaries, we can find an oracle summary by maximizing the numerator of Eq. (\ref{rouge}). Thus, the ILP formulation is defined as follows: \begin{eqnarray} {\displaystyle\mathop\text{maximize}_{\boldsymbol{z}}} & \displaystyle\sum_{k=1}^{|\boldsymbol{R}|}\sum_{j=1}^{|U({\cal R}_k)|} z_{kj}\\ s.t. & \displaystyle\sum_{i=1}^{|D|} \ell(s_i) x_i \le L_{\rm max}\\ & \forall j : \displaystyle\sum_{i=1}^{|D|} N(g_{j}^n,s_i) x_i \ge z_{kj}\\ & \forall j : N(g_j^n,{\cal R}_k) \ge z_{kj}\\ & \displaystyle\forall i : x_i \in \{0,1\}\\ & \displaystyle\forall j : z_{kj} \in \mathbb{Z}_{+}. \end{eqnarray} Here, $z_{kj}$ is the count of the $j$-th n-gram of the $k$-th reference summary in the oracle summary, {\it i.e.}, $z_{kj}=\min\{N(g_j^n,{\cal R}_k), N(g_j^n,{\cal S})\}$. $\ell(\cdot)$ returns the number of words in the sentence, $x_i$ is a binary indicator, and $x_i=1$ denotes that the $i$-th sentence $s_i$ is included in the oracle summary. $N(g_j^n,s_i)$ returns the number of occurrences of n-gram $g_j^n$ in the $i$-th sentence. Constraints (5) and (6) ensure that $z_{kj}=\min\{N(g_j^n,{\cal R}_k), N(g_j^n,{\cal S})\}$. \section{Branch and Bound Technique for Enumerating Oracle Summaries} Since enumerating oracle summaries with an ILP solver is difficult, we extend the exhaustive search approach by introducing a search and prune technique to enumerate the oracle summaries. The search pruning decision is made by comparing the current upper bound of the {\sc Rouge}$_n$ score with the maximum {\sc Rouge}$_n$ score in the search history. \subsection{$\text{\sc Rouge}_n$ Score for Two Distinct Sets of Sentences} \begin{figure}[tb] \begin{center} \includegraphics[keepaspectratio, scale=0.3]{search-tree.ps} \caption{Example of a search tree} \label{search_tree} \end{center} \end{figure} The enumeration of oracle summaries can be regarded as a depth-first search on a tree whose nodes represent sentences. Fig. \ref{search_tree} shows an example of a search tree created in a naive exhaustive search. The nodes represent sentences and the path from the root node to an arbitrary node represents a summary. For example, the red path in Fig. \ref{search_tree} from the root node to node $s_2$ represents a summary consisting of sentences $s_1,s_2$. By utilizing the tree, we can enumerate oracle summaries by exploiting depth-first searches while excluding the summaries that violate length constraints. However, this naive exhaustive search approach is impractical for large data sets because the number of nodes inside the tree is $2^{|D|}$. If we prune the unwarranted subtrees in each step of the depth-first search, we can make the search more efficient. The decision to search or prune is made by comparing the current upper bound of the {\sc Rouge}$_n$ score with the maximum {\sc Rouge}$_n$ score in the search history. For instance, in Fig. \ref{search_tree}, we reach node $s_2$ by following this path: ``Root $\rightarrow$ $s_1$, $\rightarrow$ $s_2$''. If we estimate the maximum $\text{\sc Rouge}_n$ score (upper bound) obtained by searching for the descendant of $s_2$ (the subtree in the blue rectangle), we can decide whether the depth-first search should be continued. When the upper bound of the $\text{\sc Rouge}_n$ score exceeds the current maximum $\text{\sc Rouge}_n$ in the search history, we have to continue. When the upper bound is smaller than the current maximum $\text{\sc Rouge}_n$ score, no summary is optimal that contains $s_1$, $s_2$, so we can skip subsequent search activity on the subtree and proceed to check the next branch: ``Root $\rightarrow$ $s_1$ $\rightarrow$ $s_3$''. To estimate the upper bound of the $\text{\sc Rouge}_n$ score, we re-define it for two distinct sets of sentences, $V$ and $W$, {\it i.e.,} $V \cap W=\phi$, as follows: \begin{equation} \label{our_rouge} \begin{split} \text{\sc Rouge}_n(\boldsymbol{R},V{\cup}W)&=\text{\sc Rouge}_n(\boldsymbol{R},V)\\ &\quad +\text{\sc Rouge}'_n(\boldsymbol{R},V,W). \end{split} \end{equation} \noindent Here $\text{\sc Rouge}'_n$ is defined as follows: \begin{equation} \begin{split} \text{\sc Rouge}'_n(\boldsymbol{R},V,W)=&\\ & \kern-9em \frac{\displaystyle\sum_{k=1}^{|\boldsymbol{R}|}\sum_{t_n \in U({\cal R}_k)} \min\{N(t_n,{{\cal R}_k \setminus {\cal V}}),N(t_n,{\cal W})\}}{\displaystyle\sum_{k=1}^{|\boldsymbol{R}|}\sum_{t_n \in U({\cal R}_k))} N(t_n,{\cal R}_k)}. \end{split} \end{equation} \noindent ${\cal V,W}$ are the multiple sets of n-grams found in the sets of sentences $V$ and $W$, respectively. \begin{Thm} Eq. (\ref{our_rouge}) is correct. \end{Thm} \begin{proof} See Appendix A. \end{proof} \begin{algorithm}[tb] \caption{Algorithm to Find Upper Bound of {\sc Rouge}$_n$} \label{findupper} \begin{footnotesize} \begin{algorithmic}[1] \FUNC {$\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V$)} \STATE $W \leftarrow {\rm descendant}({\rm last}(V))$,~~$W' \leftarrow \phi$ \STATE $U \leftarrow \mbox{\sc Rouge}(\boldsymbol{R},V)$ \FOR {{\bf each } $w \in W$} \STATE append($W', \frac{\text{\sc Rouge}'_n(\boldsymbol{R},V,\{w\})}{\ell(w)}$) \ENDFOR \STATE sort($W',\text{'descend'}$) \FOR {{\bf each } $w \in W'$} \IF {$L_{\rm max} - \ell(\{w\}) \ge 0$} \STATE $U \leftarrow U+\text{\sc Rouge}'_n(\boldsymbol{R},V,\{w\})$ \STATE $L_{\rm max} \leftarrow L_{\rm max}-\ell(\{w\})$ \ELSE \STATE $\displaystyle U \leftarrow U+\frac{\text{\sc Rouge}'_n(\boldsymbol{R},V,\{w\})}{\ell(\{w\})} \times L_{\rm max}$ \STATE break the loop \ENDIF \ENDFOR \STATE {\bf return} $U$ \ENDFUNC \end{algorithmic} \end{footnotesize} \end{algorithm} \subsection{Upper Bound of $\text{\sc Rouge}_n$} Let $V$ be the set of sentences on the path from the current node to the root node in the search tree, and let $W$ be the set of sentences that are the descendants of the current node. In Fig. \ref{search_tree}, $V{=}\{s_1,s_2\}$ and $W{=}\{s_3,s_4,s_5,s_6\}$. According to Theorem 1, the upper bound of the $\text{\sc Rouge}_n$ score is defined as: \begin{eqnarray} \label{maxrouge} & \kern-5em \widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V)=\text{\sc Rouge}_n(\boldsymbol{R},V)+\nonumber\\ &\kern-2em \displaystyle\mathop{\max_{\Omega \subseteq W}}\{\text{\sc Rouge}_n'(\boldsymbol{R},V,\Omega){:}\ell(\Omega){\le} L_{\rm max}{-}\ell(V) \}. \end{eqnarray} Since the second term on the right side in Eq. (\ref{maxrouge}) is an NP-hard problem, we turn to the following relation by introducing inequality, $\text{\sc Rouge}'_n(\boldsymbol{R},V,\Omega) \le \sum_{\omega \in \Omega} \text{\sc Rouge}'_n(\boldsymbol{R},V,\{\omega\})$, \begin{eqnarray} \label{inequality} \small &\kern-1em\displaystyle\mathop{\max_{\Omega \subseteq W}} \left\{ \text{\sc Rouge}'_n(\boldsymbol{R},V,\Omega){:} \ell(\Omega) {\le} L_{\rm max}{-}\ell(V)\right\} \nonumber\\ &\kern-2em {\le} {\displaystyle\max_{\boldsymbol{x}}} \left\{ \sum_{i=1}^{|W|}\text{\sc Rouge}'_n(\boldsymbol{R}, V,\{w_i\}) x_i{:} \right. \nonumber\\ &\kern-5em \left. {\sum_{i=1}^{|W|}}\ell(\{w_i\}) x_i{\le} L_{\rm max}{-}\ell(V) \right\}. \end{eqnarray} \noindent Here, $\mathbf{x} = (x_1, \ldots, x_{|W|})$ and $x_i \in \{0,1\}$. The right side of Eq. (\ref{inequality}) is a knapsack problem, {\it i.e.}, a 0-1 ILP problem. Although we can obtain the optimal solution for it using dynamic programming or ILP solvers, we solve its linear programming relaxation version by applying a greedy algorithm for greater computation efficiency. The solution output by the greedy algorithm is optimal for the relaxed problem. Since the optimal solution of the relaxed problem is always larger than that of the original problem, the relaxed problem solution can be utilized as the upper bound. Algorithm \ref{findupper} shows the pseudocode that attains the upper bound of $\text{\sc Rouge}_n$. In the algorithm, $U$ indicates the upper bound score of $\text{\sc Rouge}_n$. We first set the initial score of upper bound $U$ to $\text{\sc Rouge}_n(\boldsymbol{R},V)$ (line 3). Then we compute the density of the $\text{\sc Rouge}'_n$ scores ($\text{\sc Rouge}_n'(\boldsymbol{R},V,\{w\})/\ell(w)$) for each sentence $w$ in $W$ and sort them in descending order (lines 4 to 6). When we have room to add $w$ to the summary, we update $U$ by adding the $\text{\sc Rouge}'_n(\boldsymbol{R},V,\{w\})$ (line 10) and update length constraint $L_{\rm max}$ (line 11). When we do not have room to add $w$, we update $U$ by adding the score obtained by multiplying the density of $w$ by the remaining length, $L_{\rm max}$ (line 13), and exit the while loop. \subsection{Initial Score for Search} \begin{algorithm}[tb] \caption{Greedy algorithm to obtain initial score} \label{findlower} \footnotesize \begin{algorithmic}[1] \FUNC {\text{\sc Greedy}($\boldsymbol{R},D,L_{\rm max}$)} \STATE $L \leftarrow 0, S \leftarrow \phi,E \leftarrow D$ \WHILE{$E \neq \phi$} \STATE $s^*{\leftarrow}\displaystyle\mathop{\rm arg~max}_{s \in E} {\tiny \left\{\frac{\text{\sc Rouge}_n(\boldsymbol{R},S \cup \{s\}){-}\text{\sc Rouge}_n(\boldsymbol{R},S)}{\ell(\{s\})}\right\}}$ \STATE $L \leftarrow L+\ell(\{s^*\})$ \IF {$L \le L_{\rm max}$} \STATE $S \leftarrow S \cup \{s^*\}$ \ENDIF \STATE $E \leftarrow E \setminus \{s^*\}$ \ENDWHILE \STATE $i^* \leftarrow \displaystyle\mathop{\rm arg~max}_{i \in D, \ell(\{i\}) \le L_{\rm max}} \text{\sc Rouge}_n( \boldsymbol{R},\{i\})$ \STATE $S^* \leftarrow \displaystyle\mathop{\rm arg~max}_{K \in \{\{i^*\},S\}} \text{\sc Rouge}_n(\boldsymbol{R},K)$ \STATE {\bf return} $\text{\sc Rouge}_n(\boldsymbol{R},S^*)$ \ENDFUNC \end{algorithmic} \end{algorithm} Since the branch and bound technique prunes the search by comparing the best solution found so far with the upper bounds, obtaining a good solution in the early stage is critical for raising search efficiency. Since $\text{\sc Rouge}_n$ is a monotone submodular function \cite{hlin11}, we can obtain a good approximate solution by a greedy algorithm \cite{khuller99}. It is guaranteed that the score of the obtained approximate solution is larger than $\frac{1}{2}(1-\frac{1}{e})\text{OPT}$, where OPT is the score of the optimal solution. We employ the solution as the initial {\sc Rouge}$_n$ score of the candidate oracle summary. Algorithm \ref{findlower} shows the greedy algorithm. In it, $S$ denotes a summary and $D$ denotes a set of sentences. The algorithm iteratively adds sentence $s^*$ that yields the largest gain in the $\text{\sc Rouge}_n$ score to current summary $S$, provided the length of the summary does not violate length constraint $L_{\rm max}$ (line 4). After the while loop, the algorithm compares the $\text{\sc Rouge}_n$ score of $S$ with the maximum $\text{\sc Rouge}_n$ score of the single sentence and outputs the larger of the two scores (lines 11 to 13). \subsection{Enumeration of Oracle summaries} \begin{algorithm}[tb] \caption{Branch and bound technique to enumerate oracle summaries} \label{findoracle} \footnotesize \begin{algorithmic}[1] \STATE Read $\boldsymbol{R}$,$D$,$L_{\rm max}$ \STATE $\tau \leftarrow \text{\sc Greedy}(R,D,L_{\rm max})$,$O_{\tau} \leftarrow \phi$ \FOR {{\bf each } $s \in D$ } \STATE append($S$,$\langle \text{\sc Rouge}_n(\boldsymbol{R},\{s\}),s \rangle$) \ENDFOR \STATE sort($S$,'descend') \STATE {\bf call} {\sc FindOracle}($S,C$) \STATE output $O_{\tau}$ \PROC {{\sc FindOracle}($Q,V$)} \WHILE{$Q \neq \phi$} \STATE $s \leftarrow $shift($Q$) \STATE append($V,s$) \IF {$L_{\rm max}-\ell(V) \ge 0$} \IF {$\text{\sc Rouge}_n(\boldsymbol{R},V) \ge \tau$} \STATE {$\tau \leftarrow \text{\sc Rouge}_n(\boldsymbol{R},V)$} \STATE append($O_{\tau}, V)$ \STATE {{\bf call} {\sc FindOracle}($Q,V$)} \ELSIF {$\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V) \ge \tau$} \STATE {{\bf call} {\sc FindOracle}($Q,V$)} \ENDIF \ENDIF \STATE pop($V$) \ENDWHILE \ENDPROC \end{algorithmic} \end{algorithm} By introducing threshold $\tau$ as the best $\text{\sc Rouge}_n$ score in the search history, pruning decisions involve the following three conditions: \begin{enumerate} \setlength{\itemsep}{-0.1cm} \item $\text{\sc Rouge}_n(\boldsymbol{R},V) \ge \tau$; \item $\text{\sc Rouge}_n(\boldsymbol{R},V)< \tau$, $\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V)< \tau$; \item $\text{\sc Rouge}_n(\boldsymbol{R},V)< \tau$, $\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V)\ge \tau$. \end{enumerate} With case 1, we update the oracle summary as $V$ and continue the search. With case 2, because both $\text{\sc Rouge}_n(\boldsymbol{R},V)$ and $\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V)$ are smaller than $\tau$, the subtree whose root node is the current node (last visited node) is pruned from the search space, and we continue the depth-first search from the neighbor node. With case 3, we do not update oracle summary as $V$ because $\text{\sc Rouge}_n(\boldsymbol{R},V)$ is less than $\tau$. However, we might obtain a better oracle summary by continuing the depth-first search because the upper bound of the $\text{\sc Rouge}_n$ score exceeds $\tau$. Thus, we continue to search for the descendants of the current node. Algorithm \ref{findoracle} shows the pseudocode that enumerates the oracle summaries. The algorithm reads a set of reference summaries $\boldsymbol{R}$, length limitation $L_{\rm max}$, and set of sentences $D$ (line 1) and initializes threshold $\tau$ as the $\text{\sc Rouge}_n$ score obtained by the greedy algorithm (Algorithm \ref{findlower}). It also initializes $O_{\tau}$, which stores oracle summaries whose $\text{\sc Rouge}_n$ scores are $\tau$, and priority queue $C$, which stores the history of the depth-first search (line 2). Next, the algorithm computes the $\text{\sc Rouge}_n$ score for each sentence and stores $S$ after sorting them in descending order. After that, we start a depth-first search by recursively calling procedure {\sc FindOracle}. In the procedure, we extract the top sentence from priority queue $Q$ and append it to priority queue $V$ (lines 11 to 12). When the length of $V$ is less than $L_{\rm max}$, if $\text{\sc Rouge}_n(\boldsymbol{R},V)$ is larger than threshold $\tau$ (case 1), we update $\tau$ as the score and append current $V$ to $O_{\tau}$. Then we continue the depth-first search by calling the procedure the {\sc FindOracle} (lines 15 to 17). If $\widehat{\text{\sc Rouge}_n}(\boldsymbol{R},V)$ is larger than $\tau$ (case 3), we do not update $\tau$ and $O_{\tau}$ but reenter the depth-first search by calling the procedure again (lines 18 to 19). If neither case 1 nor case 3 is true, we delete the last visited sentence from $V$ and return to the top of the recurrence. \begin{table}[tb] \begin{center} {\tabcolsep=0.8mm \begin{tabular}{l|llllll} Year & Topics & Docs. & Sents. & Words & Refs. & Length\\ \hline 01 & 30 & 10 & 365 & 7706 & 89 & 100\\ 02 & 59 & 10 & 238 & 4822 & 116 & 100\\ 03 & 30 & 10 & 245 & 5711 & 120 & 100\\ 04 & 50 & 10 & 218 & 4870 & 200 & 100\\ 05 & 50 & 29.5 & 885 & 18273.5 & 300 & 250\\ 06 & 50 & 25 & 732.5 & 15997.5 &200 & 250\\ 07 & 45 & 25 & 516 & 11427 & 180 & 250\\ \end{tabular} } \caption{Statistics of data set} \label{stats_multi} \end{center} \end{table} \section{Experiments} \subsection{Experimental Setting} We conducted experiments on the corpora developed for a multiple document summarization task in DUC 2001 to 2007. Table \ref{stats_multi} show the statistics of the data. In particular, the DUC-2005 to -2007 data sets not only have very large numbers of sentences and words but also a long target length (the reference summary length) of 250 words. All the words in the documents were stemmed by Porter's stemmer \cite{porter80}. We computed $\text{\sc Rouge}_{1}$ scores, excluding stopwords, and computed $\text{\sc Rouge}_{2}$ scores, keeping them. \newcite{owczarzak-EtAl:2012:WEAS} suggested using $\text{\sc Rouge}_{1}$ and keeping stopwords. However, as Takamura et al. argued \cite{takamura09}, the summaries optimized with non-content words failed to consider the actual quality. Thus, we excluded stopwords for computing the $\text{\sc Rouge}_{1}$ scores. We enumerated the following two types of oracle summaries: those for a set of references for a given topic and those for each reference in the set of references. \subsection{Results and Discussion} \subsubsection{Impact of Oracle {\sc Rouge}$_n$ scores} \begin{table*}[tb] \begin{center} {\tabcolsep=1.1mm \begin{tabular}{l|rr|rr|rr|rr|rr|rr|rr} & \multicolumn{2}{c|}{01} & \multicolumn{2}{c|}{02} & \multicolumn{2}{c|}{03} & \multicolumn{2}{c|}{04} & \multicolumn{2}{c|}{05} & \multicolumn{2}{c|}{06} & \multicolumn{2}{c}{07} \\ & R$_1$ & R$_2$ & R$_1$ & R$_2$ & R$_1$ & R$_2$ & R$_1$ & R$_2$ & R$_1$ & R$_2$ & R$_1$ & R$_2$ & R$_1$ &R$_2$\\ \hline Oracle (multi) & .400 & .164 & .452 & .186 & .434 & .185 & .427 & .162 & .445 & .177 & .491 & .211 & .506 & .236\\ Oracle (single) & .500 & .226 & .515 & .225 & .525 & .258 & .519 & .228 & .574 & .279 & .607 & .303 & .622 & .330\\ Greedy & .387 & .161 & .438 & .184 & .424 & .182 & .412 & .157 & .430 & .173 & .473 & .206 & .495 & .234\\ Peer & .251 & .080 & .269 & .080 & .295 & .094 & .305 & .092 & .262 & .073 & .305 & .095 & .363 & .117\\ ID & T & T & 19 & 19 & 26 & 13 & 67 & 65 & 10 & 15 & 23 & 24 &29 & 15\\ \end{tabular} } \caption{{\sc Rouge}$_{1,2}$ scores of oracle summaries, greedy summaries, and system summaries for each data set} \label{oracle_scores} \end{center} \end{table*} Table \ref{oracle_scores} shows the average $\text{\sc Rouge}_{1,2}$ scores of the oracle summaries obtained from both a set of references and each reference in the set (``multi'' and ``single''), those of the best conventional system (Peer), and those obtained from summaries produced by a greedy algorithm (Algorithm \ref{findlower}). Oracle (single) obtained better $\text{\sc Rouge}_{1,2}$ scores than Oracle (multi). The results imply that it is easier to optimize a reference summary than a set of reference summaries. On the other hand, the $\text{\sc Rouge}_{1,2}$ scores of these oracle summaries are significantly higher than those of the best systems. The best systems obtained $\text{\sc Rouge}_1$ scores from 60\% to 70\% in ``multi'' and from 50\% to 60\% in ``single'' as well as $\text{\sc Rouge}_2$ scores from 40\% to 55\% in ``multi'' and from 30\% to 40\% in ``single'' for their oracle summaries. Since the systems in Table \ref{oracle_scores} were developed over many years, we compared the $\text{\sc Rouge}_n$ scores of the oracle summaries with those of the current state-of-the-art systems using the DUC-2004 corpus and obtained summaries generated by different systems from a public repository\footnote{\url{http://www.cis.upenn.edu/~nlp/corpora/sumrepo.html}} \cite{HONG14LREC}. The repository includes summaries produced by the following seven state-of-the-art summarization systems: CLASSY04 \cite{classy04}, CLASSY11 \cite{classy11}, Submodular \cite{hui2012-submodular-shells-summarization}, DPP \cite{Kulesza}, RegSum \cite{hong-nenkova:2014:EACL}, OCCAMS\_V \cite{icdmws:DavisCS12,conroy-EtAl:2013:MultiLing}, and ICSISumm \cite{gillick-favre:2009:ILPNLP,gillick:tac:09}. Table \ref{results:duc04} shows the results. Based on the results, RegSum \cite{hong-nenkova:2014:EACL} achieved the best $\text{\sc Rouge}_{1}{=}0.331$ result, while ICSISumm \cite{gillick-favre:2009:ILPNLP,gillick:tac:09} (a compressive summarizer) achieved the best result with $\text{\sc Rouge}_{2}{=}0.098$. These systems outperformed the best systems (Peers 65 and 67 in Table \ref{oracle_scores}), but the differences in the $\text{\sc Rouge}_n$ scores between the systems and the oracle summaries are still large. More recently, \newcite{hong-marcus-nenkova:2015:EMNLP} demonstrated that their system's combination approach achieved the current best $\text{\sc Rouge}_{2}$ score, 0.105, for the DUC-2004 corpus. However, a large difference remains between the $\text{\sc Rouge}_2$ score of oracle and their summaries. In short, the $\text{\sc Rouge}_n$ scores of the oracle summaries are significantly higher than those of the current state-of-the-art summarization systems, both extractive and compressive summarization. These results imply that further improvement of the performance of extractive summarization is possible. On the other hand, the $\text{\sc Rouge}_n$ scores of the oracle summaries are far from $\text{\sc Rouge}_n=1$. We believe that the results are related to the summary's compression rate. The data set's compression rate was only 1 to 2\%. Thus, under tight length constraints, extractive summarization basically fails to cover large numbers of n-grams in the reference summary. This reveals the limitation of the extractive summarization paradigm and suggests that we need another direction, compressive or abstractive summarization, to overcome the limitation. \begin{table}[tb] \begin{center} \begin{tabular}{l|ll} System & $\text{\sc Rouge}_{1}$ & $\text{\sc Rouge}_{2}$\\ \hline Oracle (multi) & .427 & .162\\ Oracle (single) & .519 & .228\\ \hline CLASSY04 & .305 & .0897\\ CLASSY11 & .286 & .0919\\ Submodular & .300 & .0933\\ DPP & .309 & .0960\\ RegSum & {\bf .331} & .0974 \\ OCCAMS\_V & .300 & .0974\\ ICSISumm & .310 & {\bf .0980}\\ \end{tabular} \caption{$\text{\sc Rouge}_{1,2}$ scores for state-of-the-art summarization systems on DUC-2004 corpus} \label{results:duc04} \end{center} \end{table} \subsubsection{{\sc Rouge} Scores of Summaries Obtained from Greedy Algorithm} Table \ref{oracle_scores} also shows the {\sc Rouge}$_{1,2}$ scores of the summaries obtained from the greedy algorithm (greedy summaries). Although there are statistically significant differences between the {\sc Rouge} scores of the oracle summaries and greedy summaries, those obtained from the greedy summaries achieved near optimal scores, {\it i.e.}, approximation ratio of them are close to 0.9. These results are surprising since the algorithm's theoretical lower bound is $\frac{1}{2}(1-\frac{1}{e})(\simeq 0.32)$OPT. On the other hand, the results do not support that the differences between them are small at the sentence-level. Table \ref{jaccard} shows the average Jaccard Index between the oracle summaries and the corresponding greedy summaries for the DUC-2004 corpus. The results demonstrate that the oracle summaries are much less similar to the greedy summaries at the sentence-level. Thus, it might not be appropriate to use greedy summaries as training data for learning-based extractive summarization systems. \begin{table}[tb] \begin{center} \begin{tabular}{l|ll} & single & multi\\ \hline {\sc Rouge}$_1$ & .451 & .419\\ {\sc Rouge}$_2$ & .536 & .530\\ \end{tabular} \caption{Jaccard Index between both oracle and greedy summaries} \label{jaccard} \end{center} \end{table} \subsubsection{Impact of Enumeration} \begin{table*}[tb] \begin{center} \begin{tabular}{l|rr|rr|rr|rr} &\multicolumn{4}{c|}{Median} &\multicolumn{4}{c}{Rate}\\ &\multicolumn{2}{c}{single} &\multicolumn{2}{c|}{multi} &\multicolumn{2}{c}{single} &\multicolumn{2}{c}{multi}\\ & {\sc Rouge}$_1$ & {\sc Rouge}$_2$ & {\sc Rouge}$_1$ & {\sc Rouge}$_2$ & {\sc Rouge}$_1$ & {\sc Rouge}$_2$ & {\sc Rouge}$_1$ & {\sc Rouge}$_2$\\ \hline 01 & 8 & 9 & 4 & 5 & .854 & .787 & .833 & .733 \\ 02 & 7.5 & 5.5 & 4 & 4 & .897 & .836 & .814 & .780 \\ 03 & 8 & 10.5 & 3.5 & 4 & .833 & .858 & .800 & .900 \\ 04 & 8 & 8 & 3.5 & 3 & .865 & .865 & .780 & .760 \\ 05 & 35 & 35.5 & 2 & 3 & .916 & .907 & .580 & .660 \\ 06 & 28 & 22 & 2.5 & 3 & .877 & .880 & .700 & .720 \\ 07 & 23 & 16 & 4 & 2 & .910 & .878 & .733 & 711 \\ \end{tabular} \caption{Median number of oracle summaries and rates of reference summaries and topics with multiple oracle summaries for each data set} \label{agreement} \end{center} \end{table*} Table \ref{agreement} shows the median number of oracle summaries and the rates of the reference summaries that have multiple oracle summaries for each data set. Over 80\% of the reference summaries and about 60\% to 90\% of the topics have multiple oracle summaries. Since the $\text{\sc Rouge}_n$ scores are based on the unweighted counting of n-grams, when many sentences have similar meanings, {\it i.e.,} many redundant sentences, the number of oracle summaries that have the same $\text{\sc Rouge}_n$ scores increases. The source documents of multiple document summarization tasks are prone to have many such redundant sentences, and the amount of oracle summaries is large. The oracle summaries offer significant benefit with respect to evaluating the extracted sentences. Since both the oracle and system summaries are sets of sentences, it is easy to check whether each sentence in the system summary is contained in one of the oracle summaries. Thus, we can exploit the F-measures, which are useful for evaluating classification-based extractive summarization \cite{Mani:1998,osborne:2002,hirao02}. Here, we have to consider that the oracle summaries, obtained from a reference summary or a set of reference summaries, are not identical at the sentence-level (e.g., the average Jaccard Index between the oracle summaries for the DUC-2004 corpus is around 0.5). The F-measures are varied with the oracle summaries that are used for such computation. For example, assume that we have system summary $S{=}\{s_1,s_2,s_3,s_4\}$ and oracle summaries $O_1{=}\{s_1,s_2,s_5,s_6\}$ and $O_2{=}\{s_1,s_2,s_3\}$. The precision for $O_1$ is 0.5, while that for $O_2$ is 0.75; the recall for $O_1$ is 0.5, while that for $O_2$ is 1; the F-measure for $O_1$ is 0.5, while that for $O_2$ is 0.86. Thus, we employ the scores gained by averaging all of the oracle summaries as evaluation measures. Precision, recall, and F-measure are defined as follows: $P{=}\{\sum_{O \in O_{\rm all}}|O \cap S|/|S|\}/|O_{\rm all}|$, $R{=}\{\sum_{O \in O_{\rm all}}|O \cap S|/|O|\}/|O_{\rm all}|$, $\text{F-measure}{=}2PR/(P+R)$. To demonstrate F-measure's effectiveness, we investigated the correlation between an F-measure and human judgment based on the evaluation results obtained from the DUC-2004 corpus. The results include summaries generated by 17 systems, each of which has a mean coverage score assigned by a human subject. We computed the correlation coefficients between the average F-measure and the average mean coverage score for 50 topics. Table \ref{correl} shows Pearson's $r$ and Spearman's $\rho$. In the table, ``F-measure (R$_1$)'' and ``F-measure (R$_2$)'' indicate the F-measures calculated using oracle summaries optimized to $\text{\sc Rouge}_1$ and $\text{\sc Rouge}_2$, respectively. ``M'' indicates the F-measure calculated using multiple oracle summaries, and ``S'' indicates F-measures calculated using randomly selected oracle summaries. ``multi'' indicates oracle summaries obtained from a set of references, and ``single'' indicates oracle summaries obtained from a reference summary in the set. For ``S,'' we randomly selected a single oracle summary and calculated the F-measure 100 times and took the average value with the 95\% confidence interval of the F-measures by bootstrap resampling. The results demonstrate that the F-measures are strongly correlated with human judgment. Their values are comparable with those of $\text{\sc Rouge}_{1,2}$. In particular, F-measure (R$_1$) (single-M) achieved the best Spearman's $\rho$ result. When comparing ``single'' with ``multi,'' Pearson's $r$ of ``multi'' was slightly lower than that of ``single,'' and the Spearman's $r$ of ``multi'' was almost the same as those of ``single.'' ``M'' has significantly better performance than ``S.'' These results imply that F-measures based on oracle summaries are a good evaluation measure and that oracle summaries have the potential to be an alternative to human-made reference summaries in terms of automatic evaluation. Moreover, the enumeration of the oracle summaries for a given reference summary or a set of reference summaries is essential for automatic evaluation. \subsubsection{Search Efficiency } \begin{table}[tb] \small \begin{center} \begin{tabular}{l|ll} Metric & $r$ & $\rho$\\ \hline $\text{\sc Rouge}_1$ & .861 & .760\\ $\text{\sc Rouge}_2$ & {\bf .907} & .831\\ \hline F-measure (R$_1$) (single-M) & .857 & {\bf .855}\\ F-measure (R$_1$) (single-S) & .815-.830 & .811-.830\\ F-measure (R$_2$) (single-M) & .904 & .826\\ F-measure (R$_2$) (single-S) & .855-.865 & .740-.760\\ F-measure (R$_1$) (multi-M) & .814 & .841\\ F-measure (R$_1$) (multi-S) & .794-.802 & .803-.813\\ F-measure (R$_2$) (multi-M) & .824 & .846\\ F-measure (R$_2$) (multi-S) & .806-.816 & .797-.817\\ \end{tabular} \caption{Correlation coefficients between automatic evaluations and human judgments on DUC-2004 corpus} \label{correl} \end{center} \end{table} To demonstrate the efficiency of our search algorithm against the naive exhaustive search method, we compared the number of feasible solutions (sets of sentences that satisfy the length constraint) with the number of summaries that were checked in our search algorithm. The algorithm that counts the number of feasible solutions is shown in Appendix B. Table \ref{order} shows the median number of feasible solutions and checked summaries yielded by our method for each data set (in the case of ``single''). The differences in the number of feasible solutions between $\text{\sc Rouge}_1$ and $\text{\sc Rouge}_2$ are very large. Input set ($|D|$) of $\text{\sc Rouge}_1$ is much larger than $\text{\sc Rouge}_1$. On the other hand, the differences between $\text{\sc Rouge}_1$ and $\text{\sc Rouge}_2$ in our method are of the order of $10$ to $10^2$. When comparing our method with naive exhaustive searches, its search space is significantly smaller. The differences are of the order of $10^7$ to $10^{30}$ with $\text{\sc Rouge}_1$ and $10^4$ to $10^{17}$ with $\text{\sc Rouge}_2$. These results demonstrate the efficiency of our branch and bound technique. In addition, we show an example of the processing time for extracting one oracle summary and enumerating all of the oracle summaries for the reference summaries in the DUC-2004 corpus with a Linux machine (CPU:~Intel$^{\textregistered}$ Xeon$^{\textregistered}$ X5675 (3.07GHz)) with 192 GB of RAM. We utilized {\tt CPLEX 12.1} to solve the ILP problem. Our algorithm was implemented in C++ and complied with GCC version 4.4.7. The results show that we needed 0.026 and 0.021 sec. to extract one oracle summary per reference summary and 0.047 and 0.031 sec. to extract one oracle summary per set of reference summaries for $\text{\sc Rouge}_1$ and $\text{\sc Rouge}_2$, respectively. We needed 11.90 and 1.40 sec. to enumerate the oracle summaries per reference summary and 102.94 and 3.65 sec. per set of reference summaries for $\text{\sc Rouge}_1$ and $\text{\sc Rouge}_2$, respectively. The extraction of one oracle summary for a reference summary can be achieved with the ILP solver in practical time and the enumeration of oracle summaries is also efficient. However, to enumerate oracle summaries, we needed several weeks for some topics in DUCs 2005 to 2007 since they hold a huge number of source sentences. \section{Conclusions} \begin{table}[tb] \begin{center} {\tabcolsep=0.9mm \begin{tabular}{l|ll|ll} & \multicolumn{2}{c|}{{\sc Rouge}$_1$} & \multicolumn{2}{c}{{\sc Rouge}$_2$}\\ & Naive & Proposed & Naive & Proposed\\ \hline 01 & 3.66$\times 10^{13}$ & 5.75$\times 10^3$ & 3.32$\times 10^7$ & 1.00$\times 10^3$\\ 02 & 1.12$\times 10^{12}$ & 4.64$\times 10^3$ & 1.34$\times 10^7$ & 8.87$\times 10^2$\\ 03 & 1.62$\times 10^{11}$ & 3.65$\times 10^3$ & 6.37$\times 10^6$ & 8.19$\times 10^2$\\ 04 & 9.65$\times 10^{10}$ & 4.47$\times 10^3$ & 6.90$\times 10^6$ & 9.83$\times 10^2$\\ 05 & 5.48$\times 10^{36}$ & 2.32$\times 10^6$ & 3.48$\times 10^{21}$ & 7.03$\times 10^4$\\ 06 & 1.94$\times 10^{32}$ & 1.97$\times 10^6$ & 2.11$\times 10^{20}$ & 5.08$\times 10^4$\\ 07 & 4.14$\times 10^{28}$ & 1.40$\times 10^6$ & 1.81$\times 10^{19}$ & 2.60$\times 10^4$\\ \end{tabular} } \caption{Median number of summaries checked by each search method} \label{order} \end{center} \end{table} To analyze the limitations and the future direction of extractive summarization, this paper proposed (1) Integer Linear Programming (ILP) formulation to obtain extractive oracle summaries in terms of {\sc Rouge}$_n$ scores and (2) an algorithm that enumerates all oracle summaries to exploit F-measures that evaluate the sentences extracted by systems. The evaluation results obtained from the corpora of DUCs 2001 to 2007 identified the following: (1) room still exists to improve the $\text{\sc Rouge}_n$ scores of extractive summarization systems even though the $\text{\sc Rouge}_n$ scores of the oracle summaries fell below the theoretical upper bound $\text{\sc Rouge}_n{=}1$. (2) Over 80\% of the reference summaries and from 60\% to 90\% of the sets of reference summaries have multiple oracle summaries, and the F-measures computed by utilizing the enumerated oracle summaries showed stronger correlation with human judgment than those computed from single oracle summaries. \section*{Appendix A.} \begin{proof} We can rewrite the right side of equation (\ref{our_rouge}) as follows: \begin{equation} \begin{split} \text{\sc Rouge}(\boldsymbol{R},V){+}\text{\sc Rouge}'_n(\boldsymbol{R},V,W)=&\\ & \kern-15em \frac{ \displaystyle \sum_{k=1}^{|\boldsymbol{R}|}\sum_{t_n \in U({\cal R}_k)} f(t_n,{\cal R}_k,{\cal V,W})}{ \displaystyle \sum_{k=1}^{|\boldsymbol{R}|} \sum_{t_n \in U({\cal R}_k)} N(t_n,{\cal R}_k)}. \end{split} \end{equation} Here, $f(t_n,{\cal R}_k,{\cal V,W})$ is defined as follows: \begin{equation} \label{function_f} \begin{split} f(t_n,{\cal R}_k,{\cal V,W}){=}\min\{N(t_n,{\cal R}_k),N(t_n,{\cal V})\}+&\\ & \kern-15em \min\{N(t_n,{\cal R}_k\setminus {\cal V}),N(t_n,{\cal W})\}. \end{split} \end{equation} $N(t_n,{\cal R}_k\setminus {\cal V})$ is the number of times $t_n$ occurs in the multiple set ${\cal R}_k \setminus {\cal V}$. Equation (\ref{function_f}) is rewritten as \begin{equation} \label{final} \begin{split} f(t_n,{\cal R}_k,{\cal V,W}){=}\min\{N(t_n,{\cal R}_k),N(t_n,{\cal V})\}+&\\ & \kern-20em \min\{\max\{N(t_n,{\cal R}_k){-}N(t_n,{\cal V}),0\},N(t_n,{\cal W})\}. \end{split} \end{equation} The solutions of equation (\ref{final}) are obtained by considering the following three conditions: \begin{enumerate} \item If $N(t_n,{\cal R}_k)-N(t_n,{\cal V})>0$ and $N(t_n,{\cal R}_k)-N(t_n,{\cal V})>N(t_n,{\cal W})$, then $f(t_n,{\cal R}_k,{\cal V,W})=N(t_n,{\cal V})+N(t_n,{\cal W})$ \item If $N(t_n,{\cal R}_k)-N(t_n,{\cal V})>0$ and $N(t_n,{\cal R}_k)-N(t_n,{\cal V})<N(t_n,{\cal W})$, then $f(t_n,{\cal R}_k,{\cal V,W})=N(t_n,{\cal R}_k)$ \item If $N(t_n,{\cal R}_k)-N(t_n,{\cal V}) < 0$, then $f(t_n,{\cal R}_k,{\cal V,W})=N(t_n,{\cal R}_k)$ \end{enumerate} From the above relations, \begin{eqnarray} f(t_n,{\cal R}_k,{\cal V,W})=\nonumber&\\ & \kern-8em \min\{N(t_n,{\cal R}_k),N(t_n,{\cal V})+N(t_n,{\cal W})\}. \end{eqnarray} Thus, \begin{equation} \begin{split} \text{\sc Rouge}_n(\boldsymbol{R},V{\cup}W)=&\\ &\kern-10em \frac{ \displaystyle \sum_{k=1}^{|\boldsymbol{R}|}\sum_{t_n{\in}U({\cal R}_k)}\min\{N(t_n,{\cal R}_k),N(t_n,{\cal V}){+}N(t_n,{\cal W})\}}{ \displaystyle \sum_{k=1}^{|\boldsymbol{R}|}\sum_{t_n{\in}U({\cal R}_k)} N(t_n,{\cal R}_k)} \end{split} \end{equation} \end{proof} \section*{Appendix B.} \begin{algorithm}[tb] \caption{Dynamic Programming Algorithm to Count the Number of the Feasible Summaries} \label{subsetsum} \footnotesize \begin{algorithmic}[1] \FUNC {\text{\sc GetNumFS}($D,L_{\rm max}$)} \STATE $C[0][0]\leftarrow 1, C[0][j] \leftarrow 0, 1 \le j \le L_{\rm max}$ \FOR {$i=1$ to $|D|$} \FOR {$j=0$ to $L_{\rm max}$} \IF {$j-\ell(s_i) \ge 0$} \STATE $C[i][j] \leftarrow C[i-1][j]+C[i-1][j-\ell(s_i)]$ \ELSE \STATE $C[i][j] \leftarrow C[i-1][j]$ \ENDIF \ENDFOR \ENDFOR \STATE {\bf return} $\displaystyle\mathop\sum_{j=1}^{L_{\rm max}} C[|D|][j]$ \ENDFUNC \end{algorithmic} \end{algorithm} We propose an algorithm to compute the number of feasible solutions under the length constraint by extending the dynamic programming based approach for the subset sum problem \cite{algo}. We define $C[i][j](0 \le i \le |D|, 0 \le j \le L_{\rm max})$, which stores the number of feasible solutions (length is less than $j$) that can be obtained from set $\{s_1,\ldots,s_i\}$ as follows: \begin{itemize} \item Initialization \begin{equation} \begin{array}{lr} C[0][j]=0 & (0 \le j \le L_{\rm max}) \end{array} \end{equation} \item Recurrence ($1 \le i \le |D|$) \begin{equation} \begin{split} \kern-1em C[i][j]{=} &\\ & \kern-5em\left\{ \begin{array}{lr} C[i{-}1][j]+C[i{-}1][j{-}\ell(s_i)] &\text{if } j{-}\ell(s_i) \ge 0\\ C[i{-}1][j] &\text{otherwise} \end{array} \right. \end{split} \end{equation} \end{itemize} Algorithm \ref{subsetsum} is a dynamic program that fills out the ($|D|+1) \times (L_{\rm max}+1$) table. After the table is filled, each cell on the $|D|+1$-th line stores the number of feasible solutions. In the algorithm, first, we pick up the sentences that contain an n-gram that appears in the reference summary at least once and recursively count the number of feasible solutions. Then, the sum of the $j$-th line whose index is from 1 to $L_{\rm max}$ indicates the number of feasible solutions. The order of the algorithm is $O(n L_{\rm max})$. \bibliographystyle{eacl2017}
{'timestamp': '2017-01-09T02:05:21', 'yymm': '1701', 'arxiv_id': '1701.01614', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01614'}
arxiv
\section{Introduction} \label{sec:intro} Digital video plays an important role in our daily life. About 70\% of today's Internet traffic is attributed to video, and it will continue to grow to the 80-90\% range within a couple of years. It is critical to have a major breakthrough in video coding technology to accommodate the rapid growth of video traffic. Despite the introduction of a set of fine-tuned coding tools in the standardization of H.264/AVC and H.265 (or HEVC), a major breakthrough in video coding technology is needed to meet the practical demand. To address this problem, we need to examine limitations of today's video coding methodology. Today's video coding technology is based on Shannon's source coding theorem, where a continuous and convex rate-distortion (R-D) function for a probabilistic source is derived and exploited (see the black curve in Fig. \ref{fig:perceptual_distortion}). However, humans cannot perceive small variation in pixel differences. Psychophysics study on the just-noticeable difference (JND) clearly demonstrated the nonlinear relation between human perception and physical changes. The traditional R-D function does not take this nonlinear human perception process into account. In the context of image/video coding, recent subjective studies in \cite{lin2015experimental} show that humans can only perceive discrete-scale distortion levels over a wide range of coding bitrates (see the red curve in Fig. \ref{fig:perceptual_distortion}). Without loss of generality, we use H.264 video as an example to explain it. The quantization parameter (QP) is used to control its quality. The smaller the QP, the better the quality. Although one can choose a wide range of QP values, humans can only differentiate a small number of discrete distortion levels among them. In contrast with the conventional R-D function, the perceived R-D curve is neither continuous nor convex. Rather, it is a stair function that contains a couple of jump points, called just noticeable difference (JND) points. The JND is a statistical quantity that accounts for the maximum difference unnoticeable to a human being. Subjective tests for traditional visual coding and processing were only conducted by very few experts called golden eyes. This is the worst-case analysis. As the emergence of big data science and engineering, the worst-case analysis cannot reflect the statistical behavior of the group-based quality of experience (QoE). When the subjective test is conducted with respect to a viewer group, it is more meaningful to study their QoE statistically to yield an aggregated function. \begin{figure}[!t] \centering \begin{subfigure}[b]{1.0\linewidth} \centering \includegraphics[width=0.75\linewidth]{MSE-PSNR_v5.png} \phantomcaption \end{subfigure} \caption{Comparison between the traditional R-D function and the newly observed stair R-D function. The former does not take the nonlinear human perception process into account.\label{fig:perceptual_distortion}} \end{figure} The measure of coded image/video quality using the JND notion was first proposed in \cite{lin2015experimental}. As a follow-up, two small-scale JND-based image/video quality datasets were released by the Media Communications Lab at the University of Southern California. They are the MCL-JCI dataset \cite{jin2016jndhvei} and the MCL-JCV dataset \cite{mcl_jcv} targeted the JPEG image and the H.264 video, respectively. To build a large-scale JND-based video quality dataset, an alliance of academic and industrial organizations was formed and the subjective test data were acquired in Fall 2016. The resulting dataset is called the ``VideoSet" -- an acronym for ``Video Subject Evaluation Test (SET)". The VideoSet consists of 220 5-second sequences in four resolutions (i.e., $1920 \times 1080$, $1280 \times 720$, $960 \times 540$ and $640 \times 360$). For each of the 880 video clips, we encode it using the x264 \cite{aimar2005x264} encoder implementation of the H.264 standard with $QP=1, \cdots, 51$ and measure the first three JND points with 30+ subjects. All source/coded video clips as well as measured JND data included in the VideoSet are available to the public in the IEEE DataPort \cite{h2h01c-16-full}. The rest of this paper is organized as follows. The source and compressed video content preparation is discussed in Sec. \ref{sec:source}. The subjective evaluation procedure is described in Sec. \ref{sec:subjective}. The outlier detection and removal process is conducted for JND data post-processing in Sec. \ref{sec:outlier_detection}. Some general discussion on the VideoSet is provided in Sec. \ref{sec:experimental_results}. The significance and implication of the VideoSet to future video coding research and standardization efforts are pointed out in Sec. \ref{sec:significance}. Finally, concluding remarks and future work are given in Sec. \ref{sec:conclusion}. \section{Source and Compressed Video Content}\label{sec:source} We describe both the source and the compressed video content in this section. \subsection{Source Video} \label{subsub:source_video} \begin{figure}[!t] \centering \begin{subfigure}[b]{1.0\linewidth} \centering \includegraphics[width=1.0\linewidth]{thumbnails.png} \phantomcaption \end{subfigure} \caption{Display of 30 representative thumbnails of video clips from the VideoSet, where video scenes in the first three rows are from two long sequences ``El Fuente" and ``Chimera" \cite{CDVL}, those in the fourth and fifth rows are from the CableLab sequences \cite{Cablelabs}, while those in the last row are from ``Tears of Steel" \cite{tos}.\label{fig:thumbnails}} \end{figure} The VideoSet consists of 220 source video clips, each of which has a duration of 5 seconds. We show thumbnails images for 30 representative video clips in Fig \ref{fig:thumbnails}. The source video clips were collected from publicly available datasets in \cite{CDVL,Cablelabs,tos}. The original sequences have multiple spatial resolutions ({\em i.e.}, $4096 \times 2160$, $4096 \times 1714$, $3840 \times 2160$), frame rates ({\em i.e.}, 60, 30, 24) and color formats ({\em i.e.}, YUV444p, YUV422p, YUV420p). We pay special attention to the selection of these source video clips to avoid redundancy and enrich diversity of selected contents. After content selection, we process each 5-second video clip to ensure that they are in similar format. Their formats are summarized in Table \ref{tab:raw_sequences_summary}, where the first column shows the names of the source video material of longer duration and the second column indicates the number of video clips selected from each source material. The third, fourth and fifth columns describe the frame rate, the spatial resolution and the pixel format, respectively. They are further explained below. \begin{itemize} \item {\bf Frame Rate.} The frame rate affects the perceptual quality of certain contents significantly \cite{ou2014q}. Contents of a higher frame rate ({\em e.g.} 60fps) demand a more powerful CPU and a larger memory to avoid impairments in playback. For this reason, if the original frame rate is 60fps, we convert it from 60fps to 30fps to ensure smooth playback in a typical environment. If the original frame rate is not greater than 30fps, no frame rate conversion is needed. \item {\bf Spatial Resolution.} The aspect ratio of most commonly used display resolutions for web users is $16:9$. For inconsistent aspect ratios, we scale them to $16:9$ by padding black horizontal bars above and below the active video window. As a result, all video clips are of the same spatial resolution -- $3840 \times 2160$. \item {\bf Pixel Format.} We down-sample the trimmed spatial resolution $3840 \times 2160$ (2160p) to four lower resolutions. They are: $1920 \times 1080$ (1080p), $1280 \times 720$ (720p), $ 960 \times 540$ (540p) and $640 \times 360$ (360p) for the subjective test in building the VideoSet. In the spatial down-sampling process, the lanczos interpolation \cite{lanczos} is used to keep a good compromise between low and high frequencies components. Also, the $4:2:0$ chroma sampling is adopted for maximum compatibility. \end{itemize} It is worthwhile to point out that 1080p and 720p are two most dominant video formats on the web nowadays while 540p and 360p are included to capture the viewing experience on tablets or mobile phones. After the above-mentioned processing, we obtain 880 uncompressed sequences in total. \begin{table}[!t] \centering \caption{Summarization of source video formats in the VideoSet.}\label{tab:raw_sequences_summary} \vspace{3mm} \resizebox{\columnwidth}{!}{ \begin{tabular}{*{8}{c}} \toprule & & \multicolumn{2}{c}{Frame rate} & \multicolumn{2}{c}{Spatial resolution} & \multicolumn{2}{c}{Pixel format} \\ \cmidrule(r){3-4} \cmidrule(r){5-6} \cmidrule(r){7-8} Source & Selected & Original & Trimmed & Original & Trimmed & Original & Trimmed \\ \midrule El Fuente & 31 & 60 & 30 & $4096 \times 2160$ & $3840 \times 2160$ & YUV444p & YUV420p \\ Chimera & 59 & 30 & 30 & $4096 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Ancient Thought & 11 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Eldorado & 14 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Indoor Soccer & 5 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Life Untouched & 15 & 60 & 30 & $3840 \times 2160$ & $3840 \times 2160$ & YUV444p & YUV420p \\ Lifting Off & 13 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Moment of Intensity & 10 & 60 & 30 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Skateboarding & 9 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Unspoken Friend & 13 & 24 & 24 & $3840 \times 2160$ & $3840 \times 2160$ & YUV422p & YUV420p \\ Tears of Steel & 40 & 24 & 24 & $4096 \times 1714$ & $3840 \times 2160$ & YUV420p & YUV420p \\ \bottomrule \end{tabular}} \end{table} \subsection{Video Encoding} \label{sub:sequence_encoding} We use the H.264/AVC \cite{aimar2005x264} high profile to encode each of the 880 sequences, and choose the constant quantization parameter (CQP) as the primary bit rate control method. The adaptive QP adjustment is reduced to the minimum amount since our primary goal is to understand a direct relationship between the quantization parameter and perceptual quality. The encoding recipe is included in the read-me file of the released dataset. The QP values under our close inspection are between $[8, 47]$. It is unlikely to observe any perceptual difference between the source and coded clips with a QP value smaller than $8$. Furthermore, coded video clips with a QP value larger than $47$ will not be able to offer acceptable quality. On the other hand, it is ideal to examine the full QP range; namely, $[0, 51]$, in the subjective test since the JND measure is dependent on the anchor video that serves as a fixed reference. To find a practical solution, we adopt the following modified scheme. The reference is losslessly encoded and referred to as $QP=0$. We use the source $QP=0$ to substitute all sequences with a QP value smaller than 8. Similarly, sequences with a QP larger value than 47 are substituted by that with $QP=47$. The modification has no influence on the subjective test result. This will become transparent when we describe the JND search procedure in Sec. \ref{sub:jnd_search_procedure}. By including the source and all coded video clips, there are $220 \times 4 \times 52 = 45,760$ video clips in the VideoSet. \section{Subjective Test Environment and Procedure}\label{sec:subjective} The subjective test environment and procedure are described in detail in this section. \subsection{Subjective Test Environment} The subjective test was conducted in six universities in the city of Shenzhen in China. There were 58 stations dedicated to the subjective test. Each station offered a controlled non-distracting laboratory environment. The viewing distance was set as recommended in ITU-R BT.2022. The background chromaticity and luminance were set up as an environment of a common office/laboratory. We did not conduct monitor calibration among different test stations, yet the monitors were adjusted to a comfortable setting to test subjects. On one hand, the uncalibrated monitors provided a natural platform to capture the practical viewing experience in our daily life. On the other hand, the monitors used in the subjective test were profiled for completeness. Monitor profiling results are given in Fig. \ref{fig:monitor_profiling} and summarized in Table \ref{tab:environment_check}. As shown in Table \ref{tab:environment_check}, most stations comply with ITU recommendations. \begin{figure}[!t] \centering \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{cie1931_xy-eps-converted-to.pdf} \caption{\label{fig:cie_1931_xy}} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{delta_E-eps-converted-to.pdf} \caption{\label{fig:delta_E}} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{peak_lumi-eps-converted-to.pdf} \caption{\label{fig:peak_lumi}} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{black_lumi-eps-converted-to.pdf} \caption{\label{fig:black_lumi}} \end{subfigure} \caption{Results of monitor profiling: (a) chromaticity of white color in the CIE 1931 color space, (b) the color difference between a specific monitor and the standard, where $\Delta E \approx 2.3$ corresponds to a JND \cite{sharma2002digital}, (c) the peak luminance of the screen, and (d) the luminance ratio of the screen ({\em i.e.,} the luminance of the black level to the peak white.)} \label{fig:monitor_profiling} \end{figure} We indexed each video clip with a content ID and a resolution ID and partitioned 880 video clips into 58 packages. Each package contains 14 or 15 sequence sets of a content/resolution ID pair, and each sequence set contains one source video clip and its all coded video clips. One subject can complete one JND point search for one package in one test session. The duration of one test session was around 35 minutes with a 5-minute break in the middle. Video sequences were displayed in their native resolution without scaling on the monitor. The color of the inactive screen was set to light gray. We randomly recruited around 800 students to participate in the subjective test. A brief training session was given to each subject before a test session starts. In the training session, we used different video clips to show quality degradation of coded video contents. The scenario of our intended application; namely, the daily video streaming experience, was explained. Any question from the subject about the subjective test was also answered. \begin{table}[!t] \centering \caption{Summary on test stations and monitor profiling results. The peak luminance and the black luminance columns show the numbers of stations that meet ITU-R BT.1788 in the corresponding metrics, respectively. The color difference column indicates the number of stations that has the $\Delta E$ value smaller than a JND threshold. The $H$ value indicates the active picture height.\label{tab:environment_check}} \vspace{3mm} \resizebox{\columnwidth}{!}{ \begin{tabular}{*{6}{c}} \toprule Resolution & Station Number & Peak Luminance ($cd/m^2$) & Black Luminance & Color Difference & Viewing Distance ($H$)\\ \midrule 1080p & $15$ & $15$ & $15$ & $13$ & $3.2$ \\ 720p & $15$ & $15$ & $15$ & $15$ & $4.8$ \\ 540p & $14$ & $14$ & $14$ & $13$ & $6.4$ \\ 360p & $14$ & $13$ & $14$ & $11$ & $7$ \\ \bottomrule \end{tabular}} \end{table} \subsection{Subjective Test Procedure} \label{sub:jnd_search_procedure} In the subjective test, each subject compares the quality of two clips displayed one after another, and determines whether these two sequences are noticeably different or not. The subject should choose either `YES' or `NO' to proceed. The subject has an option to ask to play the two sequences one more time. The comparison pair is updated based on the response. One aggressive binary search procedure was described in \cite{mcl_jcv} to speed up the JND search process. At the first comparison, the procedure asked a subject whether there would be any noticeable difference between $QP=0$ and $QP=25$. If a subject made an unconfident decision of `YES' at the first comparison, the test procedure would exclude interval $QP=[26, 51]$ in the next comparison. Although the subjects selects `Noticeable Difference' in all comparisons afterwards, the final JND location would stay at $QP=25$. It could not belong to $QP=[26, 51]$ any longer. A similar problem arose if a subject made an unconfident decision of `NO' at the first comparison. To fix this problem, we adopt a more robust binary search procedure in our current subjective test. Instead of eliminating the entire left or right half interval, only one quarter of the original interval at the farthest location with respect to the region of interest is dropped in the new test procedure. Thus, if a subject made an unconfident decision of `YES' at the first comparison, the test procedure will remove interval $QP=[39, 51]$ so that the updated interval is $QP=[0,38]$. The new binary search procedure allows a buffer even if a wrong decision is made. The comparison points may oscillate around the final JND position but still converge to it. The new binary search procedure is proved to be more robust than the previous binary search procedure at the cost of a slightly increased number of comparisons ({\em i.e.}, from 6 comparisons in the previous procedure to 8 comparisons in the new procedure). Let $x_{n} \in{[0,51]}$ be the QP used to encode a source sequence. We use $x_{s}$ and $x_{e}$ as the start and the end QP values of a search interval, $[x_{s}, x_{e}]$, at a certain round. Since $x_{s} < x_{e}$, the quality of the coded video clip with $QP=x_s$ is better than that with $QP=x_e$. We use $x_{a}$ to denote the QP value of the anchor video clip. It is fixed in the entire binary search procedure until the JND point is found. The QP value, $x_{c}$, of the comparison video is updated within $[x_{s},x_{e}]$. One round of the binary search procedure is described in Algorithm \ref{algo}. \begin{algorithm}[!t] \KwData{QP range $[x_{s},x_{e}]$} \KwResult{JND location $x_{n}$} $x_{a}=x_{s}$\; $x_{l}=x_{s}$\; $x_{r}=x_{e}$\; flag = true\; \While{flag}{ \eIf{ $x_{a}$ and $x_{c}$ have quality difference}{ $x_{n}=x_{c}$\; \eIf{$x_{c}-x_{l} \leq 1$}{ flag=false\; } { $x_{r}=\floor*{(x_{l}+3*x_{r}/4}$\; $x_{c}=\floor*{(x_{l}+x_{r})/2}$ \; } } { \eIf{$x_{r}-x_{c} \leq 1$}{ flag=false\; } { $x_{l}=\ceil*{(3*x_{l}+x_{r})/4}$\; $x_{c}=\ceil*{(x_{l}+x_{r})/2}$ \; } } } \caption{One round of the JND search procedure.}\label{algo} \end{algorithm} The global JND search algorithm is stated below. \begin{itemize} \item Initialization. We set $x_{s}=0$ and $x_{e}=51$. \item Search range update. If $x_{a}$ and $x_{c}$ exhibit a noticeable quality difference, update $x_{r}$ to the third quartile of the range. Otherwise, update $x_{l}$ to the first quartile of the range. The ceiling and the floor integer-rounded operations, denoted by $\floor*{*}$ and $\ceil*{*}$, are used in the update process as shown in the Algorithm of the one round of the JND search procedure. \item Comparison video update. The QP value of the comparison video clip is set to the middle point of the range under evaluation with the integer-rounded operation. \item Termination. There are two termination cases. First, if $x_{c}-x_{l} \leq 1$ and the comparison result is `Noticeable Difference', then search process is terminated and $x_{c}$ is set to the JND point. Second, if $x_{r}-x_{c} \leq 1$ and the comparison result is `Unnoticeable Difference', the process is terminated and the JND is the latest $x_{c}$ when the comparison result was `Noticeable Difference'. \end{itemize} The JND location depends on the characteristics of the underlying video content, the visual discriminant power of a subject and the viewing environment. Each JND point can be modeled as a random variable with respect to a group of test subjects. We search and report three JND points for each video clip in the VideoSet. It will be argued in Sec. \ref{sec:experimental_results} that the acquisition of three JND values are sufficient for practical applications. For a coded video clip set, the same anchor video is used for all test subjects. The anchor video selection procedure is given below. We plot the histogram of the current JND point collected from all subjects and then set the QP value at its first quartile as the anchor video in the search of the next JND point. For this QP value, $75\%$ of test subjects cannot notice a difference. We select this value rather than the median value, where $50\%$ of test subjects cannot see a difference, so as to set up a higher bar for the next JND point. The first JND point search is conducted for QP belonging to $[0,51]$. Let $x_{N}$ be the QP value of the $N^{th}$ JND point for a given sequence. The QP search range for $(N+1)^{th}$ JND is $[x_{N}, 51]$. \section{JND Data Post-Processing via Outlier Removal}\label{sec:outlier_detection} Outliers refer to observations that are significantly different from the majority of other observations. The notation applies to both test subjects and collected samples. In practice, outliers should be eliminated to allow more reliable conclusion. For JND data post-processing, we adopt outlier detection and removal based on the individual subject and collected JND samples. They are described below. \subsection{Unreliable Subjects} As described in Sec. \ref{sub:sequence_encoding}, video clips are encoded with $QP=[8,47]$ while $QP=0$ denotes the source video without any quality degradation. The QP range is further extended to $[0,51]$ by substituting video of $QP=[1,7]$ with video of $QP=0$, and video of $QP=[48,51]$ with video of $QP=47$. With this substitution, the video for $QP=[1,7]$ is actually lossless, and no JND point should lie in this range. If a JND sample of a subject comes to this interval, the subject is treated as an outlier. All collected samples from this subject are removed. The ITU-R BT 1788 document provides a statistical procedure on subject screening. It examines score consistency of a subject against all subjects in a test session, where the scores typically range from 1 to 5 denoting from the poorest to the best quality levels. This is achieved by evaluating the correlation coefficient between the scores of a particular subject with the mean scores of all subjects for the whole test session, where the Pearson correlation or the Spearman rank correlation is compared against a pre-selected threshold. However, this procedure does not apply to the collected JND data properly since our JND data is the QP value of the coded video that meets the just noticeable difference criterion. Alternatively, we adopt the z-scores consistency check. Let $\boldsymbol{x}_n^{m}$ be the samples obtained from subject $m$ on a video sequence set with video index $n$, where $m = 1, 2, \dots, M$ and $n = 1, 2, \dots, N$. For subject $m$, we can form a vector of his/her associated samples as \begin{equation} \boldsymbol{x}^{m} = (x_{1}^{m}, x_{2}^{m}, \dots, x_{N}^{m}). \end{equation} Its mean and standard deviation (SD) vectors against all subjects can be written as \begin{eqnarray} \boldsymbol{\mu} & = & (\mu_{1}, \mu_{2}, \dots, \mu_{N}), \quad \mu_{n}=\frac{1}{M}\sum_{m=1}^{M} x^{m}_{n}, \\ \boldsymbol{\sigma} & = & (\sigma_{1}, \sigma_{2}, \dots, \sigma_{N}), \quad \sigma_{n}=\sqrt{\frac{1}{M-1}\sum_{m=1}^{M} (x^{m}_{n}-\mu_{n})^2}. \end{eqnarray} Then, the z-scores vector of subject $m$ is defined as \begin{equation} \boldsymbol{z}^{m} = (z^{m}_{1}, z^{m}_{2}, \dots, z^{m}_{N}), \quad z^{m}_{n} = \frac{x^{m}_{n}-\mu_{n}}{\sigma_{n}}. \end{equation} The quantity, $z^{m}_{n}$, indicates the distance between the raw score and the population mean in the SD unit for subject $m$ and video clip $n$. The dispersion of the z-score vector shows consistency of an individual subject with respect to the majority. Both the range and the SD of the z-score vector, $\boldsymbol{z}^{m}$, are used as the dispersion metrics. They are defined as \begin{equation} R = \max(\boldsymbol{z}^{m}) - \min(\boldsymbol{z}^{m}), \mbox{ and } D = std(\boldsymbol{z}^{m}), \end{equation} respectively. A larger dispersion indicates that the corresponding subject gives inconsistent evaluation results in the test. A subject is identified as an outlier if the associated range and SD values are both large. An example is shown in Fig. \ref{fig:unreliable_subjects}. We provide the boxplot of z-scores for all 32 subjects in Fig. \ref{fig:1080_12_raw_boxplot_z_scores} and the corresponding dispersion plot in Fig. \ref{fig:1080_12_dispersion}. The horizontal and the vertical axes of Fig. \ref{fig:1080_12_dispersion} are the range and the SD metrics, respectively. For this particular test example, subjects \#8, \#9 and \#32 are detected as outliers because some of their JND samples have $QP=1$. Subjects \#4, \#7 and \#27 are removed since their range and SD are both large. For subject \#15, the SD value is small yet the range is large due to one sample. We remove that sample and keep others. \begin{figure}[!ht] \centering \begin{subfigure}[b]{0.68\linewidth} \centering \includegraphics[width=1.0\linewidth]{1080_11_raw_boxplot_z_scores-eps-converted-to.pdf} \caption{\label{fig:1080_12_raw_boxplot_z_scores}} \end{subfigure} \begin{subfigure}[b]{0.8\linewidth} \centering \includegraphics[width=1.0\linewidth]{1080_11_dispersion-eps-converted-to.pdf} \caption{\label{fig:1080_12_dispersion}} \end{subfigure} \caption{Illustration of unreliable subject detection and removal: (a) the boxplot of z-scores and (b) the dispersion plot of all subjects participating in the same test session, where subjects \#4, \#7, \#8, \#9, \#32 and \#37 are detected as outliers. Subject \#15 is kept after removing one sample.} \label{fig:unreliable_subjects} \end{figure} \subsection{Outlying Samples} Besides unreliable subjects, we consider outlying samples for a given test content. This may be caused by the impact of the unique characteristics of different video contents on the perceived quality of an individual. Here, we use the Grubbs' test \cite{grubbs1950sample} to detect and remove outliers. It detects one outlier at a time. If one sample is declared as an outlier, it is removed from the dataset, and the test is repeated until no outliers are detected. We use $\boldsymbol{s} = (s_{1}, s_{2}, \dots, s_{N})$ to denote a set of raw samples collected for one test sequence. The test statistics is the largest absolute deviation of a sample from the sample mean in the SD unit. Mathematically, the test statistics can be expressed as \begin{equation} G=\frac{\max \limits_{i=1,\dots,N}\left|s_{i}-\bar{\boldsymbol{s}} \right|}{\sigma_{\boldsymbol{s}}}. \end{equation} At a given significant level denoted by $\alpha$, a sample is declared as an outlier if \begin{equation} G>\frac{N-1}{N}\sqrt{\frac{t_{\alpha/(2N),N-2}^{2}}{N-2+t_{\alpha/(2N),N-2}^{2}}}, \end{equation} where $t_{\alpha/(2N),N-2}^{2}$ is the upper critical value of the t-distribution with $N-2$ degrees of freedom. In our subjective test, the sample size is around $N=30$ after removing unreliable subjects and outlying samples. We set the significance level at $\alpha=0.05$ as a common scientific practice. Then, a sample is identified as an outlier if its distance to the sample mean is larger than the $2.9085$ SD unit. \subsection{Normality of Post-processed JND Samples}\label{sec:analysis_on_jnd_samples} \begin{table}[!t] \centering \caption{The percentages of JND samples that pass normality test, where the total sequence number is 220.}\label{tab:normality_check} \vspace{3mm} \begin{tabular}{*{4}{c}} \toprule Resolution & The first JND & The second JND & The third JND\\ \midrule 1080p & $95.9\%$ & $95.9\%$ & $93.2\%$ \\ 720p & $94.1\%$ & $98.2\%$ & $95.9\%$ \\ 540p & $94.5\%$ & $97.7\%$ & $96.4\%$ \\ 360p & $95.9\%$ & $97.7\%$ & $95.5\%$ \\ \bottomrule \end{tabular} \end{table} Each JND point is a random variable. We would like to check whether it can be approximated by a Gaussian random variable \cite{mcl_jcv} after outlier removal. The $\beta_{2}$ test was suggested in ITU-R BT.500 to test whether a collected set of samples is normal or not. It calculates the kurtosis coefficient of the data samples and asserts that the distribution is Gaussian if the kurtosis is between 2 and 4. Here, we adopt the Jarque-Bera test \cite{jarque1987test} to conduct the normality test. It is a two-sided goodness-of-fit test for normality of observations with unknown parameters. Its test statistic is defined as \begin{equation} \label{eq:jb_test} JB = \frac{n}{6}(s^{2} + \frac{(k-3)^2}{4}), \end{equation} where $n$ is the sample size, $s$ is the sample skewness and $k$ is the sample kurtosis. The test rejects the null hypothesis if the statistic $JB$ in Eq. (\ref{eq:jb_test}) is larger than the precomputed critical value at a given significance level, $\alpha$. This critical value can be interpreted as the probability of rejecting the null hypothesis given that it is true. We show the percentage of sequences passing normality test in Table \ref{tab:normality_check}. It is clear from the table that a great majority of JND points do follow the Gaussian distribution after the post-processing procedure. \begin{figure}[!ht] \centering \begin{subfigure}[b]{0.75\linewidth} \centering \includegraphics[width=1.0\linewidth]{1920x1080_1st_part_1-eps-converted-to.pdf} \caption{\label{fig:boxplot_1st_1080p_part_1}} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{1920x1080_2nd_part_1-eps-converted-to.pdf} \caption{\label{fig:boxplot_2nd_1080p_part_1}} \end{subfigure} \quad \begin{subfigure}[b]{0.45\linewidth} \centering \includegraphics[width=1.0\linewidth]{1920x1080_3rd_part_1-eps-converted-to.pdf} \caption{\label{fig:boxplot_3rd_1080p_part_1}} \end{subfigure} \caption{The boxplot of JND samples of the first 50 sequences with resolution 1080p: (a) the first JND, (b) the second JND, and (c) the third JND. The bottom, the center and the top edges of the box indicate the first, the second and the third quartiles, respectively. The bottom and top whiskers correspond to an interval ranging between $[-2.7\sigma, 2.7\sigma]$, which covers $99.3\%$ of all collected samples.} \label{fig:boxplot_1080p} \end{figure} \section{Discussion}\label{sec:experimental_results} We show the JND distribution of the first 50 sequences (out of 220 sequences in total) with resolution 1080p in Fig. \ref{fig:boxplot_1080p}. The figure includes three sub-figures which show the distributions of the first, the second, and the third JND points, respectively. Generally speaking, there exhibit large variations among JND points across different sequences. \begin{figure}[!thb] \centering \begin{subfigure}[b]{1.0\textwidth} \centering \includegraphics[width=0.19\linewidth]{15_003.png} \includegraphics[width=0.19\linewidth]{15_004.png} \includegraphics[width=0.19\linewidth]{15_005.png} \includegraphics[width=0.19\linewidth]{15_006.png} \includegraphics[width=0.19\linewidth]{15_007.png} \caption{\label{}} \end{subfigure} \begin{subfigure}[b]{1.0\textwidth} \centering{} \includegraphics[width=0.19\linewidth]{37_002.png} \includegraphics[width=0.19\linewidth]{37_003.png} \includegraphics[width=0.19\linewidth]{37_004.png} \includegraphics[width=0.19\linewidth]{37_005.png} \includegraphics[width=0.19\linewidth]{37_006.png} \caption{\label{}} \end{subfigure} \caption{Representative frames from source sequences \#15 (a) and \#37 (b), where sequence \# 15 (tunnel) is the scene of a car driving through a tunnel with the camera mounted on the windshield while source \# 37 (dinner) is the scene of a dinner table with still camera focusing on a male speaker.} \label{fig:frames_of_two_sequences} \end{figure} We examine sequences \#15 (tunnel) and \#37 (dinner) to offer deeper insights into the JND distribution. Representative frames are given in Fig. \ref{fig:frames_of_two_sequences}. Sequence \#15 is a scene with fast motion and rapid background change. As a result, the masking effect is strong. It is not a surprise that the JND samples vary a lot among different subjects. As shown in Fig. \ref{fig:boxplot_1st_1080p_part_1}, the JND samples of this sequence have the largest deviation among the 50 sequences in the plot. This property is clearly revealed by the collected JND samples. Sequence \#37 is a scene captured around a dinner table. It focuses on a male speaker with dark background. The face of the man offers visual saliency that attracts the attention of most people. Thus, the quality variation of this sequence is more noticeable than others and its JND distribution is more compact. As shown in Fig. \ref{fig:boxplot_1st_1080p_part_1}, sequence \#37 has the smallest SD among the 50 sequences. Furthermore, we plot the histograms of the first, the second, and the third JND points of all 220 sequences in Fig. \ref{fig:3_jnd_is_enough}. They are centered around QP = 27, 31 and 34, respectively. For the daily video service such as the over-the-top (OTT) content, the QP values are in the range of 18 to 35. Furthermore, take the traditional 5-level quality criteria as an example (i.e., excellent, good, fair, poor, bad). The quality of the third JND is between fair and poor. For these reasons, we argue that it is sufficient to measure 3 JND points. The quality of coded video clips that go beyond this range is too bad to be acceptable by today's viewers in practical Internet video streaming scenarios. \begin{figure}[!thb] \centering \begin{subfigure}[b]{1.0\linewidth} \centering \includegraphics[width=0.75\linewidth]{3_jnd_is_enough-eps-converted-to.pdf} \phantomcaption \end{subfigure} \caption{The histograms of three JND points with all 220 sequences included.\label{fig:3_jnd_is_enough}} \end{figure} The scattered plots of the mean and the SD pairs of JND samples with four resolutions are shown in Fig. \ref{fig:std_mean_fit}. We observe similar general trends of the scattered plots in Fig. \ref{fig:std_mean_fit} in all four resolutions. For example, the SD values of the second and the third JND points are significantly smaller than that of the first JND point. The first JND point, which is the boundary between the perceptually lossy and lossless coded video, is most difficult for subjects to determine. The main source of observed artifacts is slight blurriness. In contrast, subjects are more confident in the decision on the second and the third JND points. The dominant factor is noticeable blockiness. \begin{figure}[!thb] \centering \begin{subfigure}[b]{0.48\linewidth} \centering \includegraphics[width=1.0\linewidth]{std_mean_fit_1920x1080-eps-converted-to.pdf} \caption{\label{fig:std_mean_fit_1920x1080}} \end{subfigure} \quad \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=1.0\linewidth]{std_mean_fit_1280x720-eps-converted-to.pdf} \caption{\label{fig:std_mean_fit_1280x720}} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=1.0\linewidth]{std_mean_fit_960x540-eps-converted-to.pdf} \caption{\label{fig:std_mean_fit_960x540}} \end{subfigure} \quad \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=1.0\linewidth]{std_mean_fit_640x360-eps-converted-to.pdf} \caption{\label{fig:std_mean_fit_640x360}} \end{subfigure} \caption{The scatter plots of the mean/std pairs of JND samples: (a) 1080p, (b) 720p, (c) 540p and (d) 360p.}\label{fig:std_mean_fit} \end{figure} The masking effect plays an important role in the visibility of artifacts. For sequences with a large SD value such as sequence \# 15 in Fig. \ref{fig:boxplot_1st_1080p_part_1}, its masking effect is strong. On one hand, the JND arrives earlier for some people who are less affected by the masking effect so that they can see the compression artifact easily. On the other hand, the compression artifact is masked with respect to others so that the coding artifact is less visible. For the same reason, the masking effect is weaker for sequences with a smaller SD value. \section{Significance and Implications of VideoSet}\label{sec:significance} The peak-signal-to-noise (PSNR) value has been used extensively in the video coding community as the video quality measure. Although it is easy to measure, it is not exactly correlated with the subjective human visual experience \cite{Lin-Kuo-2011}. The JND measure demands a great amount of effort in conducting the subjective evaluation test. However, once a sufficient amount of data are collected, it is possible to use the machine learning technique to predict the JND value within a short interval. The construction of the VideoSet serves for this purpose. In general, we can convert a set of measured JND samples from a test sequence to its satisfied user ratio (SUR) curve through integration from the smallest to the largest JND values. For the discrete case, we can change the integration operation to the summation operation. For example, to satisfy $p$\% viewers with respect to the first JND, we can divide all viewers into two subsets - the first $(100-p)$\% and the remaining $p$\% - according to ordered JND values. Then, we can set the boundary QP$_p$ value between the two subsets as the target QP value in video coding. For the first subset of viewers, their JND value is smaller than QP$_p$ so that they can see the difference between the source and coded video clips. For the second subset of viewers, their JND value is larger than QP$_p$ so that they cannot see the difference between the source and coded video clips. We call the latter group the satisfied user group. When we model the JND distribution as a normal distribution, the SUR curve becomes the Q-function. Two examples are given in Fig. \ref{fig:SUR}, where the first JND points of sequence \#15 and \#37 are plotted based on their approximating normal distributions, where the mean and SD values are derived from the subjective test data. Their corresponding Q-functions are also plotted. The Q-function is the same as the SUR curve. For example, the top quartile of the Q-function gives the QP value to encode the video content whose quality will satisfy 75\% of viewers in the sense that they cannot see the difference between the coded video and the source video. In other words, it is perceptually lossless compression for these viewers. \begin{figure}[!t] \centering \begin{subfigure}[b]{1.0\linewidth} \centering \includegraphics[width=0.75\linewidth]{SUR_with_curve-eps-converted-to.pdf} \phantomcaption \end{subfigure} \caption{The JND and the SUR plots of sequence \#15 ($\mu=30.5, \sigma=7.5$) and sequence \#37 ($\mu=22.6, \sigma=4.5$). \label{fig:SUR}} \end{figure} We show four representative thumbnail images from the two examples in Fig. \ref{fig:zoomed_frames}. The top and bottom rows are encoded results of sequence \#15 and sequence \#37, respectively. The first column has the best quality with QP=0. Columns 2-4 are encoded with the QP values of the first quartiles of the first, the second, and the third JND points. For a great majority of viewers (say, 75\%), the video clip of the first JND point is perceptually lossless to the reference one as shown in the first column. The video clip at the second JND point begins to exhibit noticeable artifacts. The quality of the video clip at the third JND point is significantly worse. \begin{figure}[!thb] \centering \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{15_00_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{15_25_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{15_36_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{15_38_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{37_00_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{37_19_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{37_22_zoom.png} \caption{} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \centering \includegraphics[width=1.0\linewidth]{37_27_zoom.png} \caption{} \end{subfigure} \caption{Comparison of perceptual quality of two coded video sequences. Top row: (a) the reference frame with QP=0, (b) the coded frame with QP=25, (c) the coded frame with QP=36, and (d) the coded frame with QP=38, of sequence \#15. Bottom row: (e) the reference frame with QP=0, (f) the coded frame with QP=19, (g) the coded frame with QP=22, and (h) the coded frame with QP=27, of sequence \#37.\label{fig:zoomed_frames}} \end{figure} The VideoSet and the SUR quality metric have the following four important implications. \begin{enumerate} \item It is well known that the comparison of PSNR values of coded video of different contents does not make much sense. In contrast, we can compare the SUR value of coded video of different contents. In other words, the SUR value offers a {\em universal} quality metric. \item We are not able to tell whether a certain PSNR value is sufficient for some video contents. It is determined by an empirical rule. In contrast, we can determine the proper QP value to satisfy a certain percentage of targeted viewers. It provides a practical and theoretically solid foundation in selecting the operating QP for rate control. \item To the best of our knowledge, the VideoSet is the largest scale subject test ever conducted to measure the response of the human visual system (HVS) to coded video. It goes beyond the PSNR quality metric and opens a new door for video coding research and standardization, {\em i.e.} data-driven perceptual coding. \item Based on the SUR curve, we can find out the reason for the existence of the first JND point. Then, we can try to mask the noticeable artifacts with novel methods so as to shift the first JND point to a larger QP value. It could be easier to fool human eyes than to improve the PSNR value. \end{enumerate} \section{Conclusion and Future Work}\label{sec:conclusion} The construction of a large-scale compressed video quality dataset based on the JND measurement, called the VideoSet, was described in detail in this paper. The subjective test procedure, detection and removal of outlying measured data, and the properties of collected JND data were detailed. The significance and implications of the VideoSet to future video coding research and standardization efforts were presented. It points out a clear path to data-driven perceptual coding. One of the follow-up tasks is to determine the relationship between the JND point location and the video content. We need to predict the mean and the variance of the first, second and third JND points based on the calibrated dataset; namely, the VideoSet. The application of the machine learning techniques to the VideoSet for accurate and efficient JND prediction over a short time interval is challenging but an essential step to make data-driven perceptual coding practical for real world applications. Another follow-up task is to find out the artifacts caused by today's coding technology, to which humans are sensitive. Once we know the reason, it is possible to mask the artifacts with some novel methods so that the first JND point can be shifted to a larger QP value. The perceptual coder can achieve an even higher coding gain if we take this into account in the next generation video coding standard. \section*{Acknowledgments} This research was funded by Netflix, Huawei, Samsung and MediaTek. The subjective tests were conducted in the City University of Hong Kong and five universities in the Shenzhen City of China. They were Shenzhen University, Chinese University of Hong Kong (SZ), Tsinghua University, Peking University and Chinese Academy of Sciences. Computation for the work was supported in part by the University of Southern California's Center for High-Performance Computing (hpc.usc.edu). The authors would like to give thanks to these companies and universities for their strong support. \bibliographystyle{splncs}
{'timestamp': '2017-01-17T02:05:51', 'yymm': '1701', 'arxiv_id': '1701.01500', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01500'}
arxiv
\section*{Nomenclature} \addcontentsline{toc}{section}{Nomenclature} \begin{IEEEdescription}[\IEEEusemathlabelsep\IEEEsetlabelwidth{$V_1,V_2,V_3$}] \item[$G$] The complete directed graph modeling the road network. \item[$\mathcal{N}$] Set of all possible locations. \item[$\mathcal{E}$] Set of paths connecting the locations. \item[$d_{ij}$] Expected travel distance from $i$ to $j$. \item[$\mathcal{K}$] Set of autonomous vehicles (AVs). \item[$k$] A particular AV. \item[$\underline{n}_k$] Initial location of AV $k$. \item[$\overline{n}_k$] Return location of AV $k$. \item[$\underline{t}_k$] Initial time of AV $k$ available for parking. \item[$\overline{t}_k$] End time of AV $k$ for parking. \item[$\underline{e}_k$] State of charge (SOC) of AV $k$ right before parking. \item[$\overline{e}_k$] Expected SOC of AV $k$ on return. \item[$d_k^{max}$] Maximum distance AV $k$ allowed to travel. \item[$\alpha_k$] Estimation function of AV $k$. \item[$f$] A particular parking facility. \item[$\hat{n}_f$] Location of parking facility $f$. \item[$\underline{m}_k$] Duration for AV $k$ to reach the parking facility from its initial location. \item[$\overline{m}_k$] Duration for AV $k$ to reach the return location from the parking facility. \item[$\underline{\epsilon}_k$] Amount of energy required for AV $k$ to reach the parking facility from its initial location. \item[$\overline{\epsilon}_k$] Amount of energy required for AV $k$ to reach the return location from the parking facility. \item[$\mathcal{F}$] Set of parking facilities. \item[$p_f$] Demand profile of parking facility $f$. \item[$t$] A particular time slot. \item[$\rho_t^f$] Number of AVs required to support the services at parking facility $f$ in the $t$th time slot. \item[$D$] Latest time slot in the time horizon. \item[$c_f$] Capacity of parking facility $f$. \item[$\beta_f$] Estimation function of parking facility $f$. \item[$\hat{m}_k^f$] Duration that AV $k$ should stay at parking facility $f$. \item[$e'_k$] SOC of AV $k$ when arriving at parking facility $f$. \item[$e''_k$] SOC of AV $k$ when leaving parking facility $f$. \item[$\mathcal{T}$] Time horizon. \item[$x_{kt}^{f}$] Binary variable to indicate if AV $k$ is assigned to parking facility $f$ at the time slot $t$. \item[$y_{k}^{f}$] Binary variable to indicate if AV $k$ is parked at parking facility $f$. \item[$M$] A sufficiently large positive number. \item[$\underline{\lambda}_t^f$] Lagrangian multiplier corresponding to $\rho_t^f$. \item[$\overline{\lambda}_t^f$] Lagrangian multiplier corresponding to $c_f$. \item[$\underline{\Lambda}$] Vector of Lagrangian multiplier $\underline{\lambda}_t^f$. \item[$\overline{\Lambda}$] Vector of Lagrangian multiplier $\overline{\lambda}_t^f$. \item[$g(\overline{\Lambda},\underline{\Lambda})$] Dual function. \item[$\underline{\gamma}_t^f(i)$] Step size for the update rule of $\underline{\lambda}_t^f$ at Iteration $i$. \item[$\overline{\gamma}_t^f(i)$] Step size for the update rule of $\overline{\lambda}_t^f$ at Iteration $i$. \item[$x_{kt}^{f*}(i)$] Optimal result by solving Problem 2 at Iteration $i$. \item[$\delta$] A small positive number. \item[$\gamma^{cap}(i)$] Cap of step size at Iteration $i$. \item[$\gamma^{init}$] Initial value of the step size. \item[$\epsilon$] A small positive number. \end{IEEEdescription} } \section{Introduction} \IEEEPARstart{T}{hanks} to people's stronger environmental awareness and various governments' green policies, increasingly more electric vehicles (EVs) will run on the roads. EVs largely rely on the grid to charge their batteries. Besides, they can also discharge any excessive energy back to the grid. The EV batteries become a significant yet flexible energy repository. This vehicle-to-grid (V2G) system which can complement the grid with various demand response and auxiliary services. A V2G system \textcolor{black}{may be considered to be} associated with a parking facility where a large number of EVs can contribute their batteries to support various V2G services \textcolor{black}{\cite{V2G_capacity}}. \textcolor{black}{However, convenience plays a very important role when an EV driver decides where and when to park its vehicle. EV mobility behavior is considered stochastic \cite{EVmobility} and it is hard for a parking facility to predict accurately how many EVs will be available in a particular period, even in the next few hours.} Autonomous vehicles (AVs), also known as driverless cars and robotic cars, refer to those vehicles which can navigate without human intervention. Based on the recent trend of the automotive industry, e.g., from Tesla, AVs will become prevalent on the roads. \textcolor{black}{It has been predicted that AVs will revolutionize the automobile industry in the next two decades \cite{trend1, trend2, trend3}.} They are equipped with numerous sensors to facilitate their interactions with the surrounding environments. An AV may be fully or partially driverless; a driver can guide the movement in the ``normal'' mode and it can also implement self-navigation in the ``autonomous'' mode without the driver's input. AVs enjoy many advantages over conventional cars, like avoiding collisions due to human errors, lessening traffic congestion, and reducing physical space for vehicle parking. AVs are typically electric and they contain batteries to store energy for propulsion. Hence, AVs can participate in V2G. Due to their self-driving ability and advanced vehicular communication technologies, AVs can be coordinated to orchestrate more co-operative exercises. \textcolor{black}{It is possible to arrange an appropriate number of AVs with parking intention to the right location to support V2G services. Hence, } AVs are \textcolor{black}{considered} advantageous over ordinary EVs in the sense that the intrinsic uncontrollable EV behaviors, with respect to their appearance at V2G infrastructure, can now be overcome. Moreover, different V2G-supporting parking facilities have diverse V2G objectives and they have different ``demands'' of EVs anchoring at the facilities at different times. We can now deploy more effective V2G services by appropriately assigning AVs to the parking facilities to meet their EV demands. Therefore, in this paper, instead of studying how AVs contribute to V2G in parking facilities directly, we investigate how to coordinate AV parking to facilitate V2G services. To the best of our knowledge, we are the first to study how to manage AVs for supporting V2G services. We formulate the Coordinated Parking Problem (CPP) for AVs to support V2G. While a centralized and a heuristic solution have been proposed in our preliminary version \cite{smartgridcomm2016}, we develop a distributed algorithm to make the problem solving scalable so that this work can become more practical. Compared with \cite{smartgridcomm2016}, our contributions include: (1) conducting a more comprehensive literature review; (2) providing a neater formulation of the problem with fewer constraints; (3) developing an effective distributed algorithm to address the problem; and (4) conducting extensive simulation to evaluate the performance of the distributed algorithm and to compare with the centralized and heuristic approaches proposed in \cite{smartgridcomm2016}. The rest of the paper is organized as follows. Section \ref{sec:related} provides the related work. We develop models for the road network, AVs, and parking facilities and illustrate the system operation in Section \ref{sec:model}. Section \ref{sec:formulation} formulates CPP as an optimization problem, and we develop an effective distributed algorithm in Section \ref{sec:distributed}. In Section \ref{sec:performance}, we evaluate the performance of the various solution methods and conclude the paper in Section \ref{sec:conclusion}. \section{Related Work} \label{sec:related} There are many related efforts studying the relationship between V2G and the supported services. \cite{V2G_DR} investigated how demand response helps reduce peak power demand and shape the V2G aggregated demand profile. \cite{V2G_DR2} studied the impact of EV mobility on demand response for V2G and presented a dynamic complex network model of V2G mobile energy networks. In \cite{V2G_ancillary2}, an EV scheduling algorithm was developed to optimize bidding of V2G for various ancillary services, including frequency regulation and spinning reserve. It maximizes the aggregator's profit while providing peak load shaving to the utility. \cite{V2G_ancillary} formulated the optimal combined bidding of V2G ancillary services and it can enhance the profit of the aggregators, utilities, and EV customers. \cite{V2G_frequencyregulation} designed a V2G aggregator for frequency regulation and a dynamic programming algorithm was developed to control the optimal charging for the vehicles. \cite{V2G_capacity} estimated the capacity of V2G for frequency regulation with a queueing network model. \textcolor{black}{\cite{V2GService1} discussed the economical operation of energy resources, like batteries, for microgrid. \textcolor{black}{\cite{V2GService2} proposed a distributed EV coordination management for efficient exploitation of renewable energy.} } All these suggest that V2G may potentially be beneficial to the grid and one of the keys to success is to ensure the availability of EVs to participate in V2G. There are numerous research projects related to AVs. For instance, \cite{AV_obstacle} designed an obstacle avoidance motion control scheme for AVs operating in uncertain dynamic environments. \cite{AV_path} developed a hierarchical controller for AVs to track reference paths in uncertain conditions and with external disturbances. \cite{kinect} designed a method to detect obstacles and dangerous areas in the outdoor environments with Kinect sensors installed on AVs. \cite{AV_flocking} studied the collective behavior of AV flocking under an all-to-all communication scheme. In \cite{AVPTS}, AVs co-operated in a public transportation system, in which AVs were scheduled with centralized control. Admission control of the system was also fully investigated. \cite{AVPTS_auction} focused on the pricing issue of the AV public transportation system and developed a combinatorial auction-based strategy-proof pricing scheme. The automotive industry is also developing AV technologies. \cite{connectedAV} reported the state-of-the-art development in the AV industry and AVs will become connected vehicles. The success of AVs will rely on connectivity and cooperation of the vehicles. Google launched the self-driving car project and built a fully functioning prototype without a steering wheel and pedals \cite{googlecar}. A Tesla car can enable its autonomous driving ability with a software update \cite{teslacar}. Thus AVs are not just idle theorizing and they can have practical use sooner or later. There is some work studying intelligent parking in general. \cite{parkingassistance} investigated availability of parking facilities for parking guidance and information systems. It developed a multivariate autoregressive model to account for the temporal and spatial relationship of parking availability. \cite{streetparking} studied the uncoordinated parking space allocation for inexpensive limited on-street parking spots and expensive oversized parking lots. Some work focuses on AV parking. \cite{valet1} developed a control system for AV valet parking with a focus on steering control. \cite{valet2} designed an intelligent vehicle system to implement the AV valet parking service. However, they mainly targeted AV parking control in a confined parking area. Some investigate the parking issue for a larger area. \cite{parkingmanagement} proposed intelligent parking assistant architecture to manage parking spots to improve the quality of urban mobility. \cite{grid_parking} analyzed the impact of charging and discharging of EVs in parking lots on the power grid probabilistically. However, there is no thorough study on V2G based on AVs. In this work, we aim to bridge this research gap. \section{System Model} \label{sec:model} The system is composed of three types of components, namely, a road network, AVs, and parking facilities. \textcolor{black}{In this section, we first describe the required infrastructure and then} provide models of these system components. \textcolor{black}{Finally we illustrate} how the system operates. \textcolor{black}{ \subsection{Infrastructure} Consider that we implement the coordinated AV parking in a smart city \cite{smartcity}, in which the road infrastructure is well-established. There is full communication coverage, backed by advanced vehicular communication technologies (e.g., IEEE 802.11p), supporting various intelligent transportation systems applications. A control center, implemented in the cloud, acts as the central ``brain'' of the system to manage the fleet of AVs with parking intention and the parking facilities. The Internet of Things backbone provides real-time communication support between the AVs (parking facilities) and the control center. The control center collects the required information from the AVs and parking facilities, does the computation, and gives instructions to the AVs for parking arrangement. A similar infrastructure is also adopted in \cite{AVPTS} and \cite{AVPTS_auction} to implement an AV-based public transportation system. } \subsection{Road Network} We describe the accessibility of the AVs to and from the parking facilities with a road network. The road network is modeled by a complete directed graph $G(\mathcal{N},\mathcal{E})$, where $\mathcal{N}$ is the set of all possible locations where the AVs and the parking facilities are located. $\mathcal{E}$ represents the set of paths connecting the locations. Each $(i,j)\in \mathcal{E}$ is associated with the distance $d_{ij}$ indicating the expected travel distance from $i$ to $j$. $d_{ij}$ is in general not equal to $d_{ji}$ and this accounts for the possible asymmetry of travel distances in different directions. Note that $G(\mathcal{N},\mathcal{E})$ is not a direct representation of the corresponding road network; in $G(\mathcal{N},\mathcal{E})$, a node is always accessible by another node in one hop. We can construct $G(\mathcal{N},\mathcal{E})$ from the road system by specifying a route from $i$ to $j$ with the corresponding distance, for each $(i,j)$ pair. For instance, we may employ Dijkstra's algorithm \cite{dijkstra} to suggest the shortest route to connect $i$ to $j$. We assume $d_{ij}$'s are static at the time of assignment. $d_{ij}$'s can be revised to reflect the updated traffic conditions in any subsequent assignments. \subsection{Autonomous Vehicles} \label{subsec:AV} We denote the set of AVs which need parking by $\mathcal{K}$. Each $k\in\mathcal{K}$ is specified by the tuple $\langle \underline{n}_k,\overline{n}_k, \underline{t}_k,\overline{t}_k,\underline{e}_k,\overline{e}_k, d^\textit{max}_k, \alpha_k \rangle$. The autonomous parking mode of $k$ is turned on at $\underline{n}_k\in\mathcal{N}$ at time $\underline{t}_k$ with state of charge (SOC) $\underline{e}_k$ and it is expected to return to $\overline{n}_k\in\mathcal{N}$ by time $\overline{t}_k$ ($\overline{t}_k\geq \underline{t}_k$) with SOC $\overline{e}_k$, which represents the minimum allowable SOC of the battery when the driver uses the car again after parking. $\underline{n}_k$ is allowed to be different from $\overline{n}_k$ for the convenience of the driver. As $k$ is expected to park in one of the parking facilities, the driver may desire to confine the total distance that the AV travels during $(\underline{t}_k,\overline{t}_k)$. The maximum distance that AV $k$ is allowed to travel in the autonomous mode is indicated by $d_k^\textit{max}$.\footnote{\textcolor{black}{$d_k^\textit{max}$ is not the maximum range supported by the energy stored in the battery of AV $k$. Instead, it is a value set by the owner who tries to cap the distance traversed for parking. This value is generally small and thus the range limit due to energy sufficiency does not matter.}} If the assigned parking facility $f$ is known, the AV can estimate the amount of time and energy required to reach $f$ from $\underline{n}_k$ and those required to arrive at $\overline{n}_k$ from $f$ based on the relevant details (including its locations, driving speed, and energy consumption rate). We define the function $\alpha_k$ to accomplish such estimation as \begin{align} [\underline{m}_k,\overline{m}_k,\underline{\epsilon}_k,\overline{\epsilon}_k]=\alpha_k(\underline{n}_k,\overline{n}_k,\underline{t}_k,\overline{t}_k,\hat{n}_f), \label{AV2PF1} \end{align} where $\hat{n}_f$, $\underline{m}_k$, and $\overline{m}_k$ refer to the location of $f$, the duration for $k$ to reach $\hat{n}_f$ from $\underline{n}_k$ and the duration for $k$ to return to $\overline{n}_k$ from $\hat{n}_f$, respectively. $\underline{\epsilon}_k$ and $\overline{\epsilon}_k$ are the amounts of energy required to support the first and second legs of the parking journey, respectively. \textcolor{black}{Thus the reduced energy for mobility needs has been captured.} \subsection{Parking Facilities} \label{subsec:PF} We consider a set of parking facilities $\mathcal{F}$, each of which represents a V2G system connected to the grid as in \cite{V2G_capacity}. Each $f\in\mathcal{F}$ is described by the tuple $\langle \hat{n}_f,p_f,c_f,\beta_f\rangle$. $p_f=[\rho^f_t]_{1\leq t\leq D}$ denotes the demand profile of $f$, where $\rho_t^f$ gives the number of AVs required to support the V2G services at $f$ in the $t$th time slot and $D$ is the latest time slot in the time horizon (The time slot operation will be explained in Section \ref{subsec: operation}). There is much work in the literature describing how to utilize EVs to facilitate different kinds of V2G services, e.g., frequency regulation \cite{V2G_capacity}. The basic principle is that, for $f$ to provide various V2G services, it needs to acquire a certain number of vehicles for charging and discharging. Here we model the demand on the vehicles for V2G for the given time horizon by $p_f$. $c_f$ denotes the capacity of $f$ dedicated to the current operation. In other words, it represents the number of AVs which $f$ can accommodate in the time horizon. We assume that $f$ is capable of determining how long AV $k$ should park at $f$. In this parking duration, $k$ will be charged up to a level that at least $\overline{e}_k$ will be retained when reaching $\overline{n}_k$, with the consideration of an appropriate charging rate and the amount of energy charged or discharged to support V2G. Consider that $f$ can facilitate the estimation with the function $\beta_f$ based on the SOC specifications of AV $k$ as \begin{align} \hat{m}_k^f=\beta_f(e'_k,e''_k), \label{AV2PF2} \end{align} where $\hat{m}_k^f$ is the duration that $k$ should stay at $f$. $e_k'=\underline{e}_k-\underline{\epsilon}_k$ and $e_k''=\overline{e}_k+\overline{\epsilon}_k$ represent the SOCs of $k$ when arriving at $f$ and when leaving from $f$, respectively, where $\underline{\epsilon}_k$ and $\overline{\epsilon}_k$ are computed from \eqref{AV2PF1}. \textcolor{black}{ In other words, given the SOC requirements of AV $k$ in terms of $e'_k$ and $e''_k$, $f$ can manage the V2G events applied to $k$ (this may charge or discharge the battery of $k$) and determine an appropriate charging profile for $k$. When $k$ leaves $f$, $f$ will ensure $k$'s SOC reached $e''_k$ by keeping $k$ at $f$ for $m_k^f$ time slots. In the literature, a lot of existing work (e.g., \cite{V2G_capacity, V2GApp1, V2GApp2, V2GApp3, V2GApp4}) has already investigated the energy management of vehicles and their interactions with the grid for V2G. In this work, we do not plan to replicate these efforts and simply represent all these by $\beta_f$. For a particular V2G application, we can construct the corresponding $\beta_f$ based on the relevant published work. In this way, we can simplify our model and pay our attention to AV parking arrangement, which is the main theme of this paper. } \subsection{Operation} \label{subsec: operation} Suppose that there is a control center which \textcolor{black}{co-ordinates} the parking of AVs. This control center aims to serve a dedicated group of AVs, e.g., the AV Public Transportation System \cite{AVPTS}, or to provide a kind of parking service to its subscribed AVs. Similar to many existing V2G implementations (e.g., \cite{V2G_capacity}), the system is considered to operate in a time-slot basis. The time horizon is described by time slots $\{t=0,1,\ldots, D\}$. As providing auxiliary services is one of the core functions of V2G in which the extent of participation needs to be committed in advance in the corresponding auxiliary service markets, each parking facility $f$ is supposed to be able to estimate its demand profile $p_f=[\rho_t^f]_{1\leq t\leq D}$ by $t=0$. Moreover, with the advancement of vehicular communication technologies (e.g., vehicular ad-hoc networks \cite{VANET}), the governed AVs are all connected and they can predict their travel plans for the near future. Thus it is possible for the system to determine the set of AVs with parking intention during the period $\mathcal{T}=\{t=1,\ldots,D\}$ by $t=0$.\footnote{As AVs are more predictable, we assume that the availabilities of all AVs are known in advance. This is valid when it comes to dedicated transportation systems, e.g., the AV Public Transportation System \cite{AVPTS}. Moreover, we may adjust $D$ based on the amount of information about the AVs and parking facilities.} Therefore, we assume that all necessary information, from both the AVs and parking facilities, is available at $t=0$ and we will assign the AVs of $\mathcal{K}$ to appropriate parking facilities of $\mathcal{F}$ for the period $\mathcal{T}$. \begin{figure}[!t] \centering \includegraphics[width=2.5in]{timexample2.pdf} \caption{A time slot conversion example.} \label{fig:timexample} \end{figure} To fit into the time-slot implementation of V2G, without loss of generality, we convert all the time parameters introduced in Sections \ref{subsec:AV} and \ref{subsec:PF}, including $\underline{t}_k, \overline{t}_k, \underline{m}_k,\overline{m}_k$, and $\hat{m}_k^f$, to the time-slotted format. Consider the scenario given in Fig. \ref{fig:timexample} which depicts the schedule of a particular AV $k$. \textcolor{black}{We set the duration of each time slot to 10 minutes for illustrative purposes}\footnote{\textcolor{black}{We will investigate the system performance with different time scales in Section \ref{sec:performance}.}} and the time slots start at 9:00, 9:10, 9:20, and so on. The AV is ready to park in time slot $t$ and it arrives at a parking facility in $t+1$. It leaves the parking facility in $t+4$ and returns to its designated destination in $t+5$. $k$ is only available for V2G and charging in $t+2$ and $t+3$. We can simply set $\underline{t}_k=t+1$, $\overline{t}_k=t+5$, and $\hat{m}_k^f=2$. It takes one slot for the first leg and one slot for the second leg of its journey, i.e., $\underline{m}_k=\overline{m}_k=1$. In this way, we have not only reserved sufficient time for $k$ to travel, but $k$ can also be made to fit into the V2G slotted operation. After an assignment for the time horizon $\{t=0,1,\ldots,D\}$, another assignment can be performed after time $\Delta t>0$, i.e., for $\{t=0+\Delta t, 1+\Delta t,\ldots, D+\Delta t\}$ . If $\Delta t$ is larger than $D$, it is like a fresh restart such that the two assignments have no correlation. If $\Delta t$ is smaller than $D$, it is possible that some AVs are still undergoing the schedules settled in the first assignment. We can still consider these AVs in the later assignment such that their parameters are revised to reflect their updated statuses accordingly. For example, if AV $k$ is parking at the parking facility $f$ at $t=\Delta t$, we may simply set its starting location to $\hat{n}_f$, i.e., $\underline{n}_f=\hat{n}_f$, for the later assignment. \section{Problem Formulation} \label{sec:formulation} To facilitate the formulation of the problem, we define two binary \textcolor{black}{variables} $x_{kt}^f$ and $y_k^f$ as follows: \begin{align*} x_{kt}^f= \begin{cases} 1 &\text{if AV $k$ is assigned to Parking Facility $f$} \\ &\text{in the time slot $t$},\\ 0 &\text{otherwise,} \end{cases} \end{align*} and \begin{align*} y_{k}^f= \begin{cases} 1 &\text{if AV $k$ is parked at $f$},\\ 0 &\text{otherwise.} \end{cases} \end{align*} Although $x_{kt}^f$ implies $y_k^f$, the introduction of $y_k^f$ can make the formulation simpler. There are a number of requirements governing the assignment of the AVs to the parking facilities. First, each AV should be allocated to a parking facility for proper parking. In general, an AV $k$ should not impose unnecessary burden to the traffic and should stay stationary in a parking facility most of the time from $\underline{t}_k$ to $\overline{t}_k$ . Hence, we consider that an AV will be assigned to one and only one parking facility during its off-duty period. This can be specified by \begin{align} \sum_{f\in\mathcal{F}}y_{k}^f=1,\forall k\in\mathcal{K}. \label{con1} \end{align} If AV $k$ is assigned to Facility $f$, it will stay at $f$ for a sufficient number of time slots for charging and supporting V2G services. Recall that the parked duration $\hat{m}_k^f$ depends on its SOC specifications, the travel distances between its specific locations and $f$, and the expected utilization of $k$ for V2G by $f$. When the details of $k$ and $f$ are given, by computing \eqref{AV2PF1} and \eqref{AV2PF2}, $\hat{m}_k^f$ is indeed a constant. We can represent such condition with the following inequality: \begin{align} \hat{m}_k^{\textcolor{black}{f}} y_k^f\leq\sum_{t=1}^{D}x_{kt}^f \leq My_k^f, \forall k\in\mathcal{K},f\in\mathcal{F}, \label{eq:suffstay \end{align} where $M$ is a sufficiently large positive number. It takes time for an AV $k$ to travel from its original position $\underline{n}_k$ to a parking facility $f$ and return to a designated location $\overline{n}_k$ after parking. The time periods for these two legs of journey are specified by $\underline{m}_k$ and $\overline{m}_k$, respectively (see Eq. \eqref{AV2PF1}). If $k$ is parked at $f$ at time $t$, we should reserve at least $\underline{m}_k$ time slots for $k$ to reach $f$. In other words, if $x_{kt}^f=1$, then there are at least $\underline{m}_k$ time slots with $x_{ks}^f=0$, where $s<t$. That is $\sum_{s=\underline{t}_k}^{t-1}(1-x_{ks}^f)\geq \underline{m}_k$. This can be satisfied by imposing the following inequality: \begin{align} \sum_{s=\underline{t}_k}^{t-1}(1-x_{ks}^f)\geq \underline{m}_k x_{kt}^f, \forall k\in\mathcal{K}, f\in\mathcal{F},t\in\mathcal{T}. \label{eq:totime \end{align} Similarly, if $k$ is parked at $f$ at time $t$, we should reserve at least $\overline{m}_k$ time slots for $k$ to get back to $\overline{n}_k$ from $f$ by $\overline{t}_{k}$ for $x_{kt}^f=1$. This is equivalent to: \begin{align} \sum_{s=t+1}^{\overline{t}_k}(1-x_{ks}^f)\geq \overline{m}_k x_{kt}^f, \nonumber\\ \forall k\in\{k|\overline{t}_k-\overline{m}_k\leq D\}, f\in\mathcal{F},t\in\mathcal{T}. \label{eq:backtime \end{align} An AV $k$ should be assigned to a facility $f$ such that its total travel distance does not exceed $d_k^{max}$. In other words, if $y_k^f=1$, then $d_{\underline{n}_kf}+d_{f\overline{n}_k}\leq d_k^{max}$. This can be further described by: \begin{align} (d_{\underline{n}_k\hat{n}_f}+d_{\hat{n}_f\overline{n}_k}) y_k^f\leq d_k^{max} , \forall f\in\mathcal{F}, k\in\mathcal{K}. \label{eq:totaldistance} \end{align} Since AV $k$ is available for parking from $\underline{t}_k$ to $\overline{t}_k$ only, it should not be assigned to any parking facility any time before $\underline{t}_k$ and from $\overline{t}_k$ onward. This can be specified with the following two equalities: \begin{align} \sum_{t=1}^{\underline{t}_k-1}x_{kt}^f=0,\forall f\in\mathcal{F},k\in\mathcal{K} \label{eq:dutytime1 \end{align} and \begin{align} \sum_{t=\overline{t}_k}^{D}x_{kt}^f=0,\forall f\in \mathcal{F},k\in\{k|\overline{t}_k-\overline{m}_k\leq D\}. \label{eq:dutytime2 \end{align} In fact, since $\underline{m}_k$ is known, we can combine \eqref{eq:totime} and \eqref{eq:dutytime1} resulting in \begin{align} \sum_{t=1}^{\underline{t}_k-1+\underline{m}_k}x_{kt}^f=0,\forall f\in\mathcal{F},k\in\mathcal{K}. \label{eq:combinedto} \end{align} Similarly, combining \eqref{eq:backtime} and \eqref{eq:dutytime2} can get \begin{align} \sum_{t=\overline{t}_k-\overline{m}_k}^{D}x_{kt}^f=0,\forall f\in \mathcal{F},k\in\{k|\overline{t}_k-\overline{m}_k\leq D\}. \label{eq:combinedfrom} \end{align} To meet the demand from the V2G services, we should secure enough AVs parked at $f$ based on its demand profile $p_f$. It is not uncommon to summarize the grid requirements with a total amount of energy required at each aggregator, e.g., in \cite{V2G_ancillary2}. We can also represent this amount of energy with a number of vehicles, each of which contributes equal portion, e.g., in \cite{V2G_capacity}. Moreover, the number of AVs parked at $f$ should not exceed its capacity $c_f$. These can be ensured with the following inequality: \begin{align} \rho_t^f\leq \sum_{k\in\mathcal{K}} x_{kt}^f \leq c_f , \forall f\in\mathcal{F},t\in\mathcal{T}. \label{con6} \end{align} AVs should be parked as long as possible. We can do this by maximizing the occupancy, i.e., assigning the AVs to the parking facilities in as many time slots as possible. This is equivalent to maximizing $\sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}} x_{kt}^f $.\footnote{If economic cost of energy needs to be explicitly considered, we can simply replace the objective function with the related cost function.} We call the problem the Coordinated Parking Problem (CPP) and its formulation is given as follows: \begin{problem}[Coordinated Parking Problem] \label{prob:problem1} \begin{equation} \begin{aligned} & \text{maximize} & & \sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}} x_{kt}^f \\ & \text{subject to} && \eqref{con1}, \eqref{eq:suffstay}, \eqref{eq:totaldistance}, \eqref{eq:combinedto}\text{--}\eqref{con6}. \end{aligned} \label{problem1} \end{equation} \end{problem} This problem is equivalent to the one formulated in \cite{smartgridcomm2016} but with much fewer constraints. This allows the problem to be solved more effectively. CPP is an integer linear program (ILP) and it can be solved by a standard ILP solver. \section{Distributed Algorithm} \label{sec:distributed} As will be shown in Section \ref{sec:performance}, if we solve CPP in a centralized manner, the computational time required grows tremendously with the number of AVs. In order to make it scalable, we are going to develop a distributed algorithm to speed up the computational process. We adopt the dual decomposition method \cite{bertsekas}, which have been widely applied to problems in power systems (e.g., \cite{cdc,voltage}), to develop the distributed algorithm. Based on Problem \ref{prob:problem1}, we first relax Constraint \eqref{con6} by introducing \textcolor{black}{Lagrangian} multipliers $\overline{\lambda}_t^f$ and $\underline{\lambda}_t^f$ and construct the partial Lagrangian as follows: \begin{align*} & \sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}} x_{kt}^f - \sum_{t\in\mathcal{T},f\in\mathcal{F}}\overline{\lambda}_t^f\left(\sum_{k\in\mathcal{K}}x_{kt}^f - c_f\right)\\ & - \sum_{t\in\mathcal{T},f\in\mathcal{F}}\underline{\lambda}_t^f\left(-\sum_{k\in\mathcal{K}}x_{kt}^f + \rho_t^f\right)\\ =& \sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}} x_{kt}^f - \sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}}\overline{\lambda}_t^fx_{kt}^f\\ &+\sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}}\underline{\lambda}_t^fx_{kt}^f+ \sum_{t\in\mathcal{T},f\in\mathcal{F}}\overline{\lambda}_t^fc_f - \sum_{t\in\mathcal{T},f\in\mathcal{F}}\underline{\lambda}_t^f\rho_t^f\\ =& \sum_{k\in\mathcal{K},t\in\mathcal{T},f\in\mathcal{F}}(x_{kt}^f-\overline{\lambda}_t^fx_{kt}^f+\underline{\lambda}_t^fx_{kt}^f) \\ &+ \sum_{t\in\mathcal{T},f\in\mathcal{F}} (\overline{\lambda}_t^fc_f-\underline{\lambda}_t^f\rho_t^f). \end{align*} Clearly the rest of the constraints, i.e., \eqref{con1}, \eqref{eq:suffstay}, \eqref{eq:totaldistance}, \eqref{eq:combinedto}\text{--}\eqref{eq:combinedfrom}, are all separable with respect to $k$. For each $k$, we represent the variables and feasible region confined by \eqref{con1}, \eqref{eq:suffstay}, \eqref{eq:totaldistance}, \eqref{eq:combinedto}\text{--}\eqref{eq:combinedfrom} as $\sigma_k = \{x_{kt}^f,y_k^f\}_{t\in\mathcal{T},f\in\mathcal{F}}$ and $\mathcal{Z}_k$, respectively. Let $\overline{\Lambda}=\{\overline{\lambda}_t^f\}_{t\in\mathcal{T},f\in\mathcal{F}}$ and $\underline{\Lambda}=\{\underline{\lambda}_t^f\}_{t\in\mathcal{T},f\in\mathcal{F}}$. Thus the dual function $g(\overline{\Lambda},\underline{\Lambda})$ of Problem \ref{prob:problem1} becomes \begin{align} g(\overline{\Lambda},\underline{\Lambda})=&\sum_{k\in\mathcal{K}}\sup_{\sigma_k\in\mathcal{Z}_k}\left\{\sum_{t\in\mathcal{T},f\in\mathcal{F}}(x_{kt}^f-\overline{\lambda}_t^fx_{kt}^f+\underline{\lambda}_t^fx_{kt}^f)\right\} \nonumber\\ &+ \sum_{t\in\mathcal{T},f\in\mathcal{F}} (\overline{\lambda}_t^fc_f-\underline{\lambda}_t^f\rho_t^f), \label{eq:dualfunction} \end{align} which is convex because of the pointwise supremum of affine functions of $(\overline{\Lambda},\underline{\Lambda})$. We can also see that the first summation of \eqref{eq:dualfunction} clearly decouples with respect to $k$. Given $(\overline{\Lambda},\underline{\Lambda})$, we define the subproblem for each $k\in\mathcal{K}$ as follows: \begin{problem}[Subproblem for AV $k$] \label{subprob} \begin{subequations} \label{subproblem1} \begin{align} \text{maximize} & \sum_{t\in\mathcal{T},f\in\mathcal{F}}(x_{kt}^f-\overline{\lambda}_t^fx_{kt}^f+\underline{\lambda}_t^fx_{kt}^f)\\ \text{subject to} & \sum_{f\in\mathcal{F}}y_{k}^f = 1\\ & \hat{m}_k^{\textcolor{black}{f}} y_k^f\leq\sum_{t=1}^{D}x_{kt}^f \leq My_k^f, \forall f\in\mathcal{F},\\ & (d_{\underline{n}_k\hat{n}_f}+d_{\hat{n}_f\overline{n}_k}) y_k^f\leq d_k^{max} , \forall f\in\mathcal{F},\\ & \sum_{t=1}^{\underline{t}_k-1+\underline{m}_k}x_{kt}^f=0,\forall f\in\mathcal{F},\\ & \sum_{t=\overline{t}_k-\overline{m}_k}^{D}x_{kt}^f=0,\forall f\in \mathcal{F}. \label{eq:18f} \end{align} \end{subequations} \end{problem} \hspace{-0.3cm}For those $k$ with $\overline{t}_k-\overline{m}_k> D$, \eqref{eq:18f} can be ignored. Let $g_k(\overline{\Lambda},\underline{\Lambda})$ be the optimal value of \eqref{subproblem1} for $k$. We update the dual variables $\overline{\Lambda}$ and $\underline{\Lambda}$ by addressing the dual problem: \begin{subequations} \label{subproblem} \begin{align} & \text{minimize} \quad & \sum_{k\in\mathcal{K}}g_k(\overline{\Lambda},\underline{\Lambda})+\sum_{t\in\mathcal{T},f\in\mathcal{F}} (\overline{\lambda}_t^fc_f-\underline{\lambda}_t^f\rho_t^f)\\ & \text{subject to} & \overline{\Lambda},\underline{\Lambda}\geq 0, \end{align} \end{subequations} which is linear. We can solve the dual problem to recover the solution of the original Problem \ref{prob:problem1}. We have the gradients $\frac{\partial g_k(\overline{\Lambda},\underline{\Lambda})}{\partial \overline{\lambda}_t^f} = c_f - \sum_{k\in\mathcal{K}}x_{kt}^f(k)$ and $\frac{\partial g_k(\overline{\Lambda},\underline{\Lambda})}{\partial \underline{\lambda}_t^f} = \sum_{k\in\mathcal{K}}x_{kt}^f(k) - \rho_t^f$. By projected gradient descent \cite{cvx}, we can generate a sequence of feasible points $\{\overline{\Lambda}(i),\underline{\Lambda}(i)\}$ with the following update rules: \begin{align} \overline{\lambda}_{t}^f(i+1) = \left[\overline{\lambda}_{t}^f(i)-\overline{\gamma}_t^f(i)\left( c_f-\sum_{k\in\mathcal{K}}x_{kt}^{f*}(i)\right)\right]^+, \nonumber\\ \forall t\in\mathcal{T},f\in\mathcal{F}, \label{update1}\\ \underline{\lambda}_{t}^f(i+1) = \left[\underline{\lambda}_{t}^f(i)-\underline{\gamma}_t^f(i)\left(\sum_{k\in\mathcal{K}}x_{kt}^{f*}(i) - \rho^f_t\right)\right]^+, \nonumber\\ \forall t\in\mathcal{T},f\in\mathcal{F},\label{update2} \end{align} where $x_{kt}^{f*}(i)$ is the optimal result by solving Problem \ref{subprob} at Iteration $i$ while $\overline{\gamma}_t^f(i)>0$ and $\underline{\gamma}_t^f(i)>0$ are the step sizes at Iteration $i$. If we have $\sum_{k\in\mathcal{K}}x_{kt}^{f*}(i)> c_f$ violating \eqref{con6}, \eqref{update1} will make $\overline{\lambda}_{t}^f(i+1)>\overline{\lambda}_{t}^f(i)$. Solving Problem \ref{subprob} at Iteration $i+1$ tends to make $x_{kt}^{f*}(i+1)$ smaller. Similarly, if we have $\sum_{k\in\mathcal{K}}x_{kt}^{f*}(i)< \rho_t^f$ violating \eqref{con6}, \eqref{update2} will make $\underline{\lambda}_{t}^f(i+1)>\underline{\lambda}_{t}^f(i)$. Solving Problem \ref{subprob} at Iteration $i+1$ tends to make $x_{kt}^{f*}(i+1)$ larger. We can interpret $(\overline{\Lambda},\underline{\Lambda})$ as a set of shadow prices for the parking resources: $\overline{\lambda}_t^f$ and $\underline{\lambda}_t^f$ are the price of renting a parking space and the price of selling V2G services at parking facility $f$ in time slot $t$, respectively.\footnote{\textcolor{black}{Note that the shadow prices serve to provide another way to interpret \eqref{update1} and \eqref{update2} economically only.}} On one hand, if the number of required parking slots is larger than the capacity (i.e., $\sum_{k\in\mathcal{K}}x_{kt}^{f*}> c_f$), the parking space selling price (i.e., $\overline{\lambda}_{t}^f$) will increase and this may lower the total demand $\sum_{k\in\mathcal{K}}x_{kt}^{f*}(i)$. On the other hand, if the number of AVs contributing to V2G is smaller than the energy profile (i.e., $\sum_{k\in\mathcal{K}}x_{kt}^{f*}< \rho_t^f$), the V2G service charge $\underline{\lambda}_t^f$ will increase and this encourages more AVs to park at $f$ in time slot $t$. As a whole, the dual problem is used to control the shadow prices and each AV adjusts its own parking strategy with the subproblem based on the parking fees $\overline{\Lambda}$ and the V2G service charges $\underline{\Lambda}$. \begin{figure} \centering \includegraphics[width=2.4in]{distributed_v2.pdf \caption{Implementation of the distributed algorithm.} \label{fig:distributed} \end{figure} Suppose there is a control center which manages the whole system. Fig. \ref{fig:distributed} depicts how to implement the distributed algorithm. In terms of computation, the control center updates $(\overline{\Lambda},\underline{\Lambda})$ with \eqref{update1} and \eqref{update2} while each AV solves its own suproblem, i.e., Problem \ref{subprob}. After updating $(\overline{\Lambda},\underline{\Lambda})$, the control center distributes $(\overline{\Lambda},\underline{\Lambda})$ to the AVs. Similarly, after solving the subproblem, each AV passes its optimal $x_{kt}^{f*}$ to the control center. The overall distributed algorithm is illustrated by Algorithm \ref{alg:DA}. \begin{algorithm} \small \caption{Distributed Algorithm} \label{alg:DA} \begin{tabbing} 1. \=Initialize $\overline{\Lambda}$ and $\underline{\Lambda}$\\ 2. \textbf{while} stopping criteria not matched \textbf{do}\\ \>3. \textbf{for} \= each AV $k$ (in parallel) \textbf{do}\\ \>\>4. Given $\overline{\Lambda}$ and $\underline{\Lambda}$, solve \eqref{subproblem1}\\ \>\>5. Return $x_{kt}^{f*}, \forall t\in\mathcal{T},f\in\mathcal{F}$\\ \>6. \textbf{end for}\\ \>7. \textbf{for} \= each $t\in\mathcal{T},f\in\mathcal{F}$ (in parallel) \textbf{do}\\ \>\>8. Given $x_{kt}^{f*}, \forall t\in\mathcal{T},f\in\mathcal{F}$, update each $\overline{\lambda}_t^f$ and $\underline{\lambda}_t^f$ with\\ \>\>\quad \eqref{update1} and \eqref{update2}, respectively\\ \>\>9. Distribute $\overline{\Lambda}$ and $\underline{\Lambda}$ to the AVs\\ \>10. \textbf{end for}\\ 11. \textbf{end while} \end{tabbing} \end{algorithm} We first initialize $(\overline{\Lambda},\underline{\Lambda})$ with appropriate non-negative values at the control center (Step 1). Then the algorithm iterates until a stopping criterion has been satisfied (Steps 2--11). Each iteration is divided into two parts. The first part (Steps 3--6) corresponds to solving the subproblems. After receiving $(\overline{\Lambda},\underline{\Lambda})$, each AV solves \eqref{subproblem1} in parallel and returns the computed $x_{kt}^{f*}$'s to the control center (Step 5). The second part (Steps 7-10) is for updating $(\overline{\Lambda},\underline{\Lambda})$. After collecting the $x_{kt}^{f*}$'s for particular $t$ and $f$, the control center can compute the corresponding $\overline{\lambda}_t^f$ and $\underline{\lambda}_t^f$ (Step 8). Hence updating $(\overline{\Lambda},\underline{\Lambda})$ can be done in parallel. The resultant $(\overline{\Lambda},\underline{\Lambda})$ is then distributed to the AVs (Step 9). Suppose $g_k(i)$ is the optimal value of the subproblem for AV $k$ at iteration $i$. We consider the algorithm converged if \begin{align} \frac{|\sum_kg_k(i+1)-\sum_kg_k(i)|}{|\sum_kg_k(i+1)|}<\delta, \forall k\in\mathcal{K}, \label{eq:stopping} \end{align} where $\delta$ is a small positive value, e.g., $10^{-5}$. The primal solution of the original CPP can be retained by the solutions of the subproblems collectively. We can recover the primal solution from the dual as follows: We first determine the $(t,f)$ pair which has the largest AV deficit, i.e., $\rho^f_t-\sum_{k\in\mathcal{K}}x^f_{kt}$. Then we construct a list of ``free'' AVs which can be moved to $f$ at $t$. Each AV $k^\prime$ in the list can be removed from its original parking facility $f^\prime$ without violating the respective energy profile constraint $\rho^{f^\prime}_t-\sum_{k\in\mathcal{K}\setminus k^\prime}x^{f^\prime}_{kt}\leq0,\forall t\in\{t|x^{f^\prime}_{k^\prime t}=1\}$, and the AV must be able to park in $f$ at $t$, i.e., $\underline{t}_k+\underline{m}_k\leq t < \overline{t}_k-\overline{m}_k$. Among those AVs in the list, the one with longest possible stay in $f$, calculated by $\overline{t}_k-\overline{m}_k-(\underline{t}_k+\underline{m}_k)$, is selected to park in $f$ from $\underline{t}_k+\underline{m}_k$ to $\overline{t}_k-\overline{m}_k-1$. Thus $x^{f^\prime}_{k^* t} = 0,\forall t\in\mathcal{T}$ and $x^{f}_{k^* t} = 0,\forall t\in[\underline{t}_{k^*}+\underline{m}_{k^*}, \overline{t}_{k^*}-\overline{m}_{k^*})$, where $k^*$ is the selected AV. The parking capacity constraint is handled in a similar manner. The $(t,f)$ pair with the largest AV overflow is identified by calculating $\sum_{k\in\mathcal{K}}x^f_{kt} - c_f$. A list of ``free'' AVs that can be removed without violating the respective energy profile constraint is developed. Then the AV with shortest possible stay is removed from $f$. A feasible primal solution is generated when $\rho^f_t-\sum_{k\in\mathcal{K}}x^f_{kt}\leq0,\forall t\in\mathcal{T}, k\in\mathcal{K}$ and $c_f-\sum_{k\in\mathcal{K}}x^f_{kt}\geq0,$ for all $ t\in\mathcal{T}, k\in\mathcal{K}$. \textcolor{black}{ Algorithm \ref{alg:DA} requires the minimum amount of information exchange. In each iteration, after receiving the pricing signals from the control center, each AV addresses its own subproblem with AV-specific parameters (including $\hat{m}_k^f$, $d_{\underline{n}_k\hat{n}_f}$, $d_{\hat{n}_f\overline{n}_k}$, and $d_k^{max}$) only. After receving the AVs' preferences on the parking facility assignments (in terms of $x_{kt}^{f*}$), the control center updates the shadow prices with the parking facility-specific parameters ($c_f$ and $\rho_t^f$) only. In a practical system, the number of AVs should be far more than the number of parking facilities. Asking each vehicle to handle its own subproblem with their own parameters avoids gathering many scattered vehicular data, which make the method highly practical. } \section{Performance Evaluation} \label{sec:performance} We have developed three methods to solve CPP, namely (I) centralized, (II) heuristic, and (III) distributed approaches. With Method I, we directly apply a standard ILP solver to Problem \ref{prob:problem1} and we adopt Gurobi \cite{gurobi-ref} here. Method II is illustrated in \cite{smartgridcomm2016} while Method III has been introduced in Section \ref{sec:distributed}. We perform four tests to evaluate the performance of the solution methods, with emphasis on Method III. In the first test, we assess their performance on different scales of the problem with different numbers of AVs and parking facilities. The second test aims to investigate the effect of time scaling while the third test examines the convergence of Method III. In the fourth test, we study the performance of the distributed algorithm in the presence of communication loss. We generate random cases \textcolor{black}{for testing}. Unless stated otherwise, we assume that there are 100 time slots (i.e., $D=100$) evenly distributed in a horizon of two hours. Consider a residential area of $5 \times 5$ $\text{km}^2$, within which we randomly place required numbers of AVs and parking facilities by specifying $\underline{n}_k$, $\overline{n}_k$, and $\hat{n}_f$ accordingly. Suppose that the AVs travel at a constant speed of 30 km/h. For AV $k$, the travel times spent on the two legs for parking, i.e., $\underline{m}_k$ and $\overline{m}_k$, are assigned based on the corresponding distances. We also set $\hat{m}_k^f=rand(1, \overline{t}_k-\overline{m}_k-(\underline{t}_k+\underline{m}_k))$. These capture $\alpha_k$ and $\beta_f$. We specify $\underline{t}_k$ and $\overline{t}_k$ by $\underline{t}_k=\mathrm{rand}(0,D-\underline{m}_k-\overline{m}_k)$ and $\overline{t}_k=\mathrm{rand}(0,D-\underline{m}_k-\overline{m}_k)+\underline{t}_k+\underline{m}_k+\overline{m}_k$, where $\mathrm{rand}(\cdot, \cdot)$ produces an integer uniformly distributed between the two inputs inclusively. If $\overline{t}_k > D$, then AV $k$ will not need to return to $\overline{n}_k$ during the time horizon. \textcolor{black}{$d_k^{max}$ is randomly set in the range of $[4,5]$ km.} Finally, the energy profile of Parking Facility $f$ is set as $\rho_t^f=\mathrm{rand}(0,a_t^f/|\mathcal{F}|),\forall t\in \mathcal{T},$ where $a_t^f$ is the number of AVs that are available to park in $f$ at $t$. The parking capacity $c_f$ is set to $|\mathcal{K}|/2$ for all $f$. This allows us to generate feasible instances more easily to inspect the computational abilities of the methods. All simulations are performed on a computer with Intel Core-i5 CPU at 2.90 GHz with 8 GB RAM. The simulations are coded with Python on Linux \subsection{Implementation of the Distributed Algorithm} As Method III is implemented distributedly in each iteration (see Algorithm \ref{alg:DA}), the subproblem which takes the longest time contributes the time needed for the first part of an iteration while the update of the $\overline{\lambda}_t^f$ and $\underline{\lambda}_t^f$ which needs the longest time contributes the second part. As only small messages containing $x_{kt}^f$ or $(\overline{\Lambda},\underline{\Lambda})$ need to be passed among the entities, the communication delay \textcolor{black}{should be small. Based on the average latency of practical cellular systems \cite{latency}, we assume each iteration takes 200 ms of communication delay. } We set $\delta$ in \eqref{eq:stopping} to $10^{-5}$. For all $f$ and $t$, we initialize $\overline{\lambda}_t^f$, $\underline{\lambda}_t^f$, $\overline{\gamma}_t^f$, $\underline{\gamma}_t^f$ with 0, 0, 0.01, and 0.01, respectively. In a subsequent iteration $i$, we get $\overline{\gamma}_t^f(i+1)=\overline{\gamma}_t^f(i)\times 1.1$ if $\sum_kg_k(i)-\sum_kg_k(i-1)<0$. Otherwise, $\overline{\gamma}_t^f(i+1)=\overline{\gamma}_t^f(i)\times 0.1$. In addition, we introduce $\gamma^\text{cap}(i)$ to cap the step size such that $\overline{\gamma}_t^f(i)\leq\gamma^\text{cap}(i)$. We set $\gamma^\text{cap}(i)=\gamma^\text{init}(1-\epsilon)^i$, where $\epsilon = 10^{-3}$ and $\gamma^\text{init} = 0.01$. This satisfies the nonsummable diminishing step size rule which guarantees the convergence of the algorithm \cite{bertsekas}. We modify $\underline{\gamma}_t^f$ similarly. \subsection{Test 1: Different Scales of the Problem} \begin{figure} \centering \includegraphics[width=3.2in]{simu1.pdf} \caption{Objective function values and computation times with different numbers of AVs.} \label{fig:compTimes} \end{figure} \begin{figure} \centering \includegraphics[width=3.2in]{simu2.pdf} \caption{Objective function values and computation times with different numbers of parking facilities.} \label{fig:compTimes2} \end{figure} We first examine different numbers of AVs with a fixed number of parking facilities. We consider a setting for a small neighborhood, where there are five parking facilities. We generate random cases of 100, 200, 300, 400, 500, 700, and 1000 AVs. Fig. \ref{fig:compTimes} depicts the relative objective function values (i.e., occupancies) with respect to the optimal and computational times (in log scale) obtained by the three methods. \textcolor{black}{The actual optimal values are also shown in brackets for reference.} Each point in the figure corresponds to the average results from 25 cases. It can be observed that Method I always produces the optimal solutions while Method II can generate sub-optimal solutions which are about 97\% from the optimal. Method III is a little inferior to Method I but much better than Method II. Although both Methods II and III cannot guarantee optimality, they can produce better solutions in those cases with more AVs. The reason is that more AVs provide larger flexibility and it is easier for the algorithms to generate better solutions. All methods need more computational time when the number of AVs grows. Method I is the most time demanding while Method III needs the shortest amount. Therefore, if the true optimal is needed, we will go for Method I, but its computational time grows significantly with problem size. Method III is very effective in producing high quality solutions and suitable for practical situations. We further consider different numbers of parking facilities with a fixed number of AVs. We fix the number of AVs to 1000 and consider cases of 5, 10, 20, 30, 40, and 50 parking facilities. Similarly, Fig. \ref{fig:compTimes2} gives the relative computed objective function values with respect to the optimal and computational times, where each data point represents the average of 25 cases. \textcolor{black}{The actual optimal values are also shown in brackets for reference.} We can see that both the objective function value and computational time are not very sensitive to the number of parking facilities. Thanks to the fact that the occupancy of a vehicle at a parking facility in a time slot has no difference from any other in the objective function, as long as the parking facilities are sufficient to accommodate the AVs, more parking facilities available will not help improve the objective function value. We can understand the trend of computational time in a similar way. \subsection{Test 2: Time Scaling} \label{subsec:time} Here we investigate the impact of time scaling. Recall that a given time horizon is divided into slots and we can make the division finer with more time slots for the same period. We generate 10 random cases for the same horizon of two hours. For each case, we divide the horizon into 10, 20, 30, 40, 50, 80, and 100 time slots with the same settings of 100 AVs and 5 parking facilities. In other words, we are solving the same problem instances with different time scales only. For example, the \textcolor{black}{$51^\text{st}$} time slot in the 100-scale corresponds to the $26^\text{th}$ and $5^\text{th}$ in the 50- and 10-scale, respectively. Since time scaling is intrinsic to the problem, we demonstrate its effects on the optimality and thus we show the results here with Method I only. Table I illustrates the percentage (\%) optimality of the different scales with respect to the 100-scale for the 10 cases. The 100-scale is the finest and gives the best results in term of quality. When scaling down, the \% optimality drops slightly because the flexibility of assignment decreases. However, too coarse scaling (e.g., 10-scale) can result in infeasible solutions. Table I also shows the computational times averaged over the feasible cases. This suggests that scaling-down can improve the computational time significantly due to the reduced problem size. Therefore, there exists a tradeoff between solution quality and computational time. \begin{table} \renewcommand{\arraystretch}{1.2} \centering \label{tab:optimality} \caption{Effects of time scaling on \% Optimality and computational time.} \begin{tabular}{c|cccccccc} \hline\hline Case & 10 & 20 & 30 & 40 & 50 & 80 & 100\\\hline I & N/A & 94.27 & 95.32 & 97.14 & 98.83 & 97.54 & 100.00\\ II & N/A & N/A & N/A & 96.97 & 98.67 & 98.10 & 100.00\\ III & N/A & 95.54 & 95.98 & 96.87 & 98.73 & 97.47 & 100.00\\ IV & N/A & N/A & 96.72 & 98.01 & 99.79 & 97.74 & 100.00\\ V & N/A & N/A & 96.04 & 97.26 & 99.00 & 97.85& 100.00\\ VI & N/A & N/A & 95.29 & 97.39 & 99.55 & 97.62 & 100.00\\ VII & N/A & N/A & 96.73 & 96.75 & 98.66 & 98.21 & 100.00\\ VIII & N/A & 94.72 & 95.28 & 96.19 & 98.93 & 97.32 & 100.00\\ IX & N/A & 94.49 & 95.62 & 96.65 & 98.46 & 97.82 & 100.00\\ X & N/A & 94.94 & 95.83 & 96.83 & 98.65 & 97.84 & 100.00\\ \hline Avg. & \multirow{ 2}{*}{N/A} & \multirow{ 2}{*}{1.41} & \multirow{ 2}{*}{2.08} & \multirow{ 2}{*}{2.43} & \multirow{ 2}{*}{3.17} & \multirow{ 2}{*}{5.30} & \multirow{ 2}{*}{9.73}\\ time (s)\\ \hline\hline \end{tabular} \end{table} \subsection{Test 3: Convergence of the Distributed Algorithm} \begin{figure} \centering \includegraphics[width=3.2in]{simu3.pdf} \caption{Primal and dual convergence of the distributed algorithm.} \label{fig:convergence} \end{figure} In this test, we study the convergence of the distributed algorithm. For illustrative purposes, we examine two representative cases of 100 and 500 AVs with five parking facilities, respectively, from Test 1, both of which are accommodated by five parking facilities. Recall that the algorithm manipulates the dual solutions and we can recover the corresponding primal solutions with the method discussed in Section \ref{sec:distributed}. Fig. \ref{fig:convergence} shows the objective function values of the corresponding primal and dual solutions in different iterations. For both cases, the duality gaps diminish when the algorithm iterates. It converges faster in the larger case and this is consistent with the results given in Fig. \ref{fig:compTimes}. \subsection{Test 4: Communication Loss} Here we evaluate the performance of the distributed algorithm with the presence of communication loss. Recall that the algorithm relies on message passing to drive its convergence. Messages are passed around different entities in a communication network in the form of data packets. However, some packets may be lost during the transmission. We define $p$ as the probability of having a packet drop. When experiencing a packet drop, the involved entity uses the most recently received $x_{kt}^f$ or $(\overline{\Lambda},\underline{\Lambda})$ to do the calculation. We consider $p$ equal to 0\%, 10\%, 20\%, 30\%, 40\%, \textcolor{black}{60\%, and 80\%}, and for each of which we produce 100 random cases. Fig. \ref{fig:loss} illustrates the occurrence of the 100 cases for each $p$ with respect to the number of iterations required for the algorithm to converge \textcolor{black}{and Table II indicates the corresponding maximum number of iterations among the 100 cases for each $p$.} While 40\% communication loss results in slightly slower convergence, severer communication loss does not make significant degradation in performance in general. \begin{figure} \centering \includegraphics[width=3.0in]{simu4.pdf} \caption{Iterations needed for convergence with different amount of communication loss.} \label{fig:loss} \end{figure} \begin{table}\label{tab:lossss} \renewcommand{\arraystretch}{1.2} \centering \caption{Maximum number of iterations required to converge.} \textcolor{black}{ \begin{tabular}{c|cccccccc} \hline\hline \% Loss & 0 & 10 & 20 & 30 & 40 & 60 & 80 \\\hline No. of iterations & 50 & 54 & 46 & 56 & 55 & 45 & 49\\ \hline\hline \end{tabular} } \end{table} \section{Conclusion} \label{sec:conclusion} AVs will represent a substantial share of ground transport in the near future. When parked, AVs can participate in V2G as EVs do. The difference is that AVs can be instructed to travel based on some system-wide objectives. In this paper, we study how to coordinate AVs intending to park, to reach parking facilities for supporting V2G services. We formulate CPP in the form of ILP. Besides solving it in a centralized manner by a standard ILP solver, we propose a distributed algorithm to overcome efficiency issue of the centralized approach. CPP is broken into a number of subproblems, each of which is addressed by an AV, and the convergence of the algorithm is controlled by updating the shadow prices at the control center. Simulations reveal that the distributed algorithm can produce nearly optimal solutions with substantially reduced computational time. A coarser time scale can improve computational time but degrades the solution quality resulting in possible infeasible solution. Even with communication loss, the distributed algorithm can still perform well and converge with little degradation in speed. \textcolor{black}{ For future work, we will extend our deterministic formulation to stochastic or robust optimization. Since some parameters, like travel times, demand profiles, and vehicle return locations, can become probabilistic in practice, formulating the problem in a probabilistic form may make this line of research more realistic. } \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:02:34', 'yymm': '1701', 'arxiv_id': '1701.01527', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01527'}
arxiv
\section{Introduction} \label{sec.intro} The problem of learning the \emph{changes of interactions} between random variables can be useful in many applications. For example, genes may regulate each other in different ways when external conditions are changed; the number of daily flu-like symptom reports in nearby hospitals may become correlated when a major epidemic disease breaks out; EEG signals from different regions of the brain may be synchronized/desynchronized when the subject is performing different activities. Spotting such changes in interactions may provide key insights into the underlying system. The interactions among random variables can be formulated as undirected probabilistic graphical models, or Markov Networks (MNs) \citep{Koller2009}, expressing the interactions via the \emph{conditional independence}. We consider a simple model: the \emph{pairwise MNs} where the links are only encoded for single or pairs of random variables. Due to the Hammersley-Clifford theorem \citep{Hammersley1971}, the underlying joint probability density function can be represented as the product of univariate and bivariate factors. As an important challenge, structure learning of MNs has also attracted a significant amount of attention. Earlier methods \citep{Spirtes2000} use hypothesis testing to learn the conditional independence among random variables, which reflects the absences of edges. It is proved that such a problem is generally NP-hard \citep{Chickering1996}. Methods restricted to a sub-class of graphical models (such as trees or forests) \citep{Chow1968,Geman1984,Liu2011} also suffer from growing computational cost. However, the Hammersley-Clifford theorem together with the recent breakthrough on sparsity-inducing methods \citep{Tibshirani1996,Zhao2006,Wainwright2009} gave birth to many sparse structure learning ideas where the sparse factorization of the joint/conditional density function was estimated to infer the underlying structure of the MN \citep{Friedman2008,Banerjee2008,Meinshausen2006,Ravikumar2010}. Although most works focused on parametric models, the structure learning has been conducted on semi-parametric ones in recent years. \citep{Liu2009,Liu2012}. There is also a trend of learning the \emph{changes} between MNs \citep{Zhang2010,Liu2014,Zhao2014}. Comparing to standard structure learning, the learning of changes views the problem in a more \emph{dynamic} fashion: Instead of estimating a static pattern, we hope to obtain a dynamic one, namely ``the change'' by comparing two sets of data. Since in some applications, the static pattern may not be computationally tractable, or simply too hard to comprehend. However, the difference between two patterns may be represented by some simple incremental effects involving only a small number of nodes or bonds, Thus it takes much less effort to learn and understand. One of the main uses of structural change learning is to spot responding variables in ``controlled experiments'' \citep{Zhang2010} where some key external factors of the experiments are altered, and two sets of samples are obtained. By discovering the changes in the MNs, we can see how random variables have responded to the change of the external stimuli. In this paper, we firstly review a recently proposed method of structural change learning between MNs \citep{Liu2014}. This follows a simple idea: if the MNs are products of the pairwise factors, the \emph{ratio} of two MNs must also be proportional to the ratios of those factors. Moreover, factors that do not change between two MNs will have no contribution to the ratio. This naturally suggests the idea of modelling the changes between two MNs $P$ and $Q$ as the ratio between two MN density functions $p({\boldsymbol{x}})$ and $q({\boldsymbol{x}})$. The ratio $p({\boldsymbol{x}})/q({\boldsymbol{x}})$ is directly estimated from a one-shot estimation \citep{Sugiyama2012}. This density-ratio approach can work well even when each MN is dense (as long as the change is sparse). We also present some very recent theoretical results along this line of research. These works prove the \emph{consistency} of the density ratio method in the \emph{high-dimensional setting}. The \emph{support consistency} indicates the support of the estimated parameter converges to the support of the true parameter in probability. This is an important property for sparsity inducing methods. It is shown that under certain conditions the density ratio method recovers the correct parameter sparsity with high probability \citep{Liu2016a}. Moreover, \citeauthor{Fazayeli2016} introduced a theorem for the regularized density ratio estimator showing the estimation error, i.e., the $\ell_2$ distance between the estimated parameter and the true parameter converges to zero under milder conditions. As comparisons, we will also show a few alternative approaches to the change detection problem between MNs. The differential graphical model learning approach \citep{Zhao2014} uses a covariance-precision matrix equality to learn changes without going through the learning of the individual MNs. The ``jumping'' MNs \citep{Kolar2012} setting considers a scenario where the observations are received as a sequence and multiple sub-sequences are generated via different parametrizations of MN. We organize this paper as follows: Firstly, we introduce the problem formulation of learning changes between MNs in Section \ref{sec.dre}. Secondly, the density ratio approach and two other alternatives are explained in Section \ref{estimate.ratio.sec}. Section \ref{sec.learning.pg} reviews the theoretical results of these approaches. Synthetic and real-world experiments are conducted in Section \ref{sec.exp} to compare the performance of methods. Finally, in Section \ref{sec.open} and \ref{sec.concl}, we give a few possible future directions and conclude the current developments along this line of research. \section{Formulating Changes} \label{sec.dre} In this section, we focus on formulating the change of MNs using density ratio. At the end of this section, a few alternatives are also introduced. \subsection{Structural Changes by Parametric Differences} \label{sec.prob.form} Detecting changes naturally involves two sets of data. Consider independent samples drawn separately from two probability distributions $P$ and $Q$ on $\mathbb{R}^m$: \begin{align*} \mathcal{X}_p :=\{{\boldsymbol{x}}_p^{(i)}\}_{i=1}^{n_p} \stackrel{\mathrm{i.i.d.}}{\sim} P \text{ and } \mathcal{X}_q :=\{{\boldsymbol{x}}_q^{(i)}\}_{i=1}^{n_q} \stackrel{\mathrm{i.i.d.}}{\sim} Q. \end{align*} We assume that $P$ and $Q$ belong to the family of \emph{Markov networks} (MNs) consisting of univariate and bivariate factors, i.e., their respective probability densities $p$ and $q$ are expressed as \begin{align} \label{eq.density.model} p({\boldsymbol{x}};{\boldsymbol{\theta}}^{(p)}) =\frac{1}{Z({\boldsymbol{\theta}}^{(p)})}\exp\left( \sum_{u,v = 1, u\ge v}^{m} {\boldsymbol{\theta}}^{(p)}_{u,v}{}^\top {\boldsymbol{\psi}}_{u,v}(x_u,x_v) \right), \end{align} where ${\boldsymbol{x}} = (x_{1}, \dots, x_{m})^\top$ is the $m$-dimensional random variable, $\top$ denotes the transpose, ${\boldsymbol{\theta}}^{(p)}_{u,v}$ is the $b$-dimensional parameter vector for the pair $(x_{u}, x_{v})$, and \begin{align*} {\boldsymbol{\theta}}^{(p)} = ({\boldsymbol{\theta}}^{(p)\top}_{1,1},\ldots, {\boldsymbol{\theta}}^{(p)\top}_{m,1},{\boldsymbol{\theta}}^{(p)\top}_{2,2},\ldots,{\boldsymbol{\theta}}^{(p)\top}_{m,2},\ldots,{\boldsymbol{\theta}}^{(p)\top}_{m,m})^\top \end{align*} is the entire parameter vector. The feature function ${\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})$ is a bivariate vector-valued basis function, and $Z({\boldsymbol{\theta}}^{(p)})$ is the normalization factor defined as \begin{align*} Z({\boldsymbol{\theta}}^{(p)}) = \int \exp\left(\sum_{u,v = 1, u\ge v}^{m} {\boldsymbol{\theta}}^{(p)}_{u,v}{}^\top {\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})\right)\mathrm{d}\boldx. \end{align*} $q({\boldsymbol{x}}; {\boldsymbol{\theta}}^{(q)})$ is defined in the same way. Such a parametrization is generic when representing pairwise graphical models. Directly estimating an MN in this generic form is challenging since $Z({\boldsymbol{\theta}}^{(p)})$ usually does not have a closed form except for a few special cases (e.g. Gaussian distribution). Markov Chain Monte Carlo \citep{Robert2005} is used to approximate such an integral. However, this would bring extra approximation errors. Nonetheless, we can define \emph{changes} between two MNs as the difference between their parameters. Therefore, given two parametric models $p({\boldsymbol{x}};{\boldsymbol{\theta}}^{(p)})$ and $q({\boldsymbol{x}};{\boldsymbol{\theta}}^{(q)})$, we hope to discover \emph{changes in parameters} from $P$ to $Q$, i.e., \[{\boldsymbol{\delta}} = {\boldsymbol{\theta}}^{(p)}-{\boldsymbol{\theta}}^{(q)}.\] Note that by its definition, the \emph{changes} are continuous. This is more advantageous than only considering discrete changes of the MN structure, since a weak change of interaction does not necessarily shatter or flip the bond between two random variables. \subsection{Density Ratio Modelling} An important observation is that although two MNs may be complex individually, their changes might be ``simple'' since many terms may be cancelled while taking the difference, i.e. ${\boldsymbol{\theta}}^{(p)}_{u,v} - {\boldsymbol{\theta}}^{(q)}_{u,v}$ might be zero. The key idea in \citep{Liu2014} is to consider the \emph{ratio} of $p$ and $q$: \begin{align} \label{eq.prop} \frac{p({\boldsymbol{x}}; {\boldsymbol{\theta}}^{(p)})}{q({\boldsymbol{x}}; {\boldsymbol{\theta}}^{(q)})} \propto \exp \left( \sum_{u,v = 1, u\ge v}^m ({\boldsymbol{\theta}}^{(p)}_{u,v}-{\boldsymbol{\theta}}^{(q)}_{u,v})^\top {\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})\right), \end{align} where ${\boldsymbol{\theta}}^{(p)}_{u,v}-{\boldsymbol{\theta}}^{(q)}_{u,v}$ encodes the difference between $P$ and $Q$ for factor ${\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})$, i.e., ${\boldsymbol{\theta}}^{(p)}_{u,v} - {\boldsymbol{\theta}}^{(q)}_{u,v}$ is zero if there is no change in the factor ${\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})$. Once the ratio of $p$ and $q$ is considered, each parameter ${\boldsymbol{\theta}}^{(p)}_{u,v}$ and ${\boldsymbol{\theta}}^{(q)}_{u,v}$ does not have to be estimated. Their difference ${\boldsymbol{\delta}}_{u,v}={\boldsymbol{\theta}}^{(p)}_{u,v} - {\boldsymbol{\theta}}^{(q)}_{u,v}$ is sufficient for change detection, as ${\boldsymbol{x}}$ only interacts with such a parametric difference in the ratio model. Thus, in this density-ratio formulation, $p$ and $q$ are no longer modelled separately, but \emph{directly} as \begin{align} \label{ratio.model.def} r({\boldsymbol{x}};{\boldsymbol{\delta}}) = \frac{1}{N({\boldsymbol{\delta}})} \exp\left(\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}_{u,v}(x_{u},x_{v})\right), \end{align} where $N({\boldsymbol{\delta}})$ is the normalization term. This direct formulation also halves the number of parameters from both ${\boldsymbol{\theta}}^{(p)}$ and ${\boldsymbol{\theta}}^{(q)}$ to only ${\boldsymbol{\delta}}$. The normalization term $N({\boldsymbol{\delta}})$ is chosen to fulfill $\int q({\boldsymbol{x}})r({\boldsymbol{x}};{\boldsymbol{\delta}}) \mathrm{d}\boldx = 1$: \begin{align*} N({\boldsymbol{\delta}}) = \int q({\boldsymbol{x}}) \exp\left(\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}_{u,v}(x_{u},x_{v}) \right)\mathrm{d}\boldx, \end{align*} which is the expectation over $q({\boldsymbol{x}})$\footnote{If one models the ratio $\frac{q(x)}{p(x)}$, the normalization $$N({\boldsymbol{\delta}}) = \int p(x) \exp\left(\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}_{u,v}(x_{u},x_{v}) \right) \mathrm{d}\boldx$$ should be used.}. Note this integral is with respect to a true distribution where our samples are generated \footnote{$q({\boldsymbol{x}})$ should not be confused with $q(x;{\boldsymbol{\theta}})$.}. This expectation form of the normalization term is another notable advantage of the density-ratio formulation because it can be easily approximated by the sample average over $\{{\boldsymbol{x}}_{q}^{(i)}\}_{i=1}^{n_q}\stackrel{\mathrm{i.i.d.}}{\sim} Q$: \begin{align*} &\hat{N}({\boldsymbol{\delta}}; {\boldsymbol{x}}_q^{(1)}, \dots, {\boldsymbol{x}}_q^{(n_q)}) := \frac{1}{n_q}\sum_{i=1}^{n_q} \exp\left(\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}_{u,v}(x_{q,u}^{(i)}, x_{q,v}^{(i)}) \right). \end{align*} Thus, one can always use this empirical normalization term for any (non-Gaussian) models $p({\boldsymbol{x}}; {\boldsymbol{\theta}}^{(p)})$ and $q({\boldsymbol{x}}; {\boldsymbol{\theta}}^{(q)})$. Interestingly, if one uses $\psi_{u,v}(x_u x_v) = x_u x_v$ in the ratio model, it does not mean one assumes two individual MNs are Gaussian or Ising, it simply means we assume the changes of interactions are linear while other non-linear interactions remain unchanged. This formulation allows us to consider highly complicated MNs as long as their changes are ``simple''. Throughout the rest of the paper, we simplify the notation from ${\boldsymbol{\psi}}_{u,v}$ to ${\boldsymbol{\psi}}$ by assuming the feature functions are the same for all pairs of random variables. \subsection{Quasi Log-likelihood Equality} \label{sec.quasi} Density ratio is not the only direct modelling approach. Particularly for Gaussian MNs, where two distributions are parametrized as $p({\boldsymbol{x}};{\boldsymbol{\Theta}}^{(p)})$ and $p({\boldsymbol{x}};{\boldsymbol{\Theta}}^{(q)})$ with the precision matrix ${\boldsymbol{\Theta}}$, one alternative was proposed using the following equality \citep{Zhao2014}: \begin{align} \label{eq.quasi.log.likelihood} {\boldsymbol{\Sigma}}^{(p)}\left({\boldsymbol{\Theta}}^{(p)} - {\boldsymbol{\Theta}}^{(q)}\right){\boldsymbol{\Sigma}}^{(q)} + {\boldsymbol{\Sigma}}^{(p)} - {\boldsymbol{\Sigma}}^{(q)} = {\boldsymbol{0}}, \end{align} where ${\boldsymbol{\Sigma}}^{(p)}$ is the covariance matrix of the Gaussian distribution $p$. As we replace the covariance matrices ${\boldsymbol{\Sigma}}^{(p)}$ and ${\boldsymbol{\Sigma}}^{(q)}$ with their sample versions $\widehat{{\boldsymbol{\Sigma}}}^{(p)}$ and $\widehat{{\boldsymbol{\Sigma}}}^{(q)}$, it can be seen that ${\boldsymbol{\Theta}}^{(p)} - {\boldsymbol{\Theta}}^{(q)}$ is the only variable interacting with the data. Therefore, one may replace it with a single parameter ${\boldsymbol{\Delta}}$ and later minimize the sample version of \eqref{eq.quasi.log.likelihood} (See Section \ref{sec.matching} for details). This direct formulation specifically uses a property of Gaussian MN that the covariance matrix computed from the data and the precision matrix that encodes the MN structure should approximately cancel each other when multiplied. However, such a relationship does not hold for other distributions in general. Studies on the generality of this equality is an interesting open question (See Section \ref{sec.open}). \paragraph{Remark} In fact, it is not necessary to combine ${\boldsymbol{\theta}}^{(p)} - {\boldsymbol{\theta}}^{(q)}$ in \eqref{eq.prop} (or ${\boldsymbol{\Theta}}^{(p)} - {\boldsymbol{\Theta}}^{(q)}$ in \eqref{eq.quasi.log.likelihood}) into one parameter. However, such a model will be unidentifiable since there are too many combinations of ${\boldsymbol{\Theta}}^{(p)}$ and ${\boldsymbol{\Theta}}^{(q)}$ can produce the same difference. Nonetheless, such an indirect modelling may still be useful when the individual structures of the MNs are also our interests. We review an example of such indirect modelling in Section \ref{sec.joint.likelihood}. \section{Learning Sparse Changes in Markov Networks} \label{estimate.ratio.sec} \subsection{Density Ratio Estimation} \emph{Density ratio estimation} has been recently introduced to the machine learning community and is proven to be useful in a wide range of applications \citep{Sugiyama2012}. In \citep{Liu2014}, a density ratio estimator called the \emph{Kullback-Leibler importance estimation procedure} (KLIEP) for log-linear models \citep{Sugiyama2008a,Tsuboi2009} was employed in learning structural changes. For a density ratio model $r({\boldsymbol{x}}; {\boldsymbol{\delta}})$ (as introduced in \eqref{ratio.model.def}), the KLIEP method minimizes the Kullback-Leibler divergence from $p({\boldsymbol{x}})$ to $\hat{p}({\boldsymbol{x}};{\boldsymbol{\delta}}) = q({\boldsymbol{x}}) r({\boldsymbol{x}};{\boldsymbol{\delta}})$: \begin{align} \mathrm{KL}[p\|\hat{p}_{\boldsymbol{\delta}}] = \int p({\boldsymbol{x}}) \log\frac{p({\boldsymbol{x}})}{q({\boldsymbol{x}})r({\boldsymbol{x}};{\boldsymbol{\delta}})} \mathrm{d}\boldx =\text{Const.} - \int p({\boldsymbol{x}}) \log r({\boldsymbol{x}}; {\boldsymbol{\delta}}) \mathrm{d}\boldx. \label{eq.obj} \end{align} Note that the density ratio model \eqref{ratio.model.def} automatically satisfies the non-negativity and normalization constraints: \begin{align*} r({\boldsymbol{x}};{\boldsymbol{\delta}}) > 0 ~~\mbox{and}~~ \int q({\boldsymbol{x}}) r({\boldsymbol{x}}; {\boldsymbol{\delta}}) \mathrm{d}\boldx = 1. \end{align*} Here we define \[\hat{r}({\boldsymbol{x}}; {\boldsymbol{\delta}}) = \frac{ \exp \left({\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}(x_{u},x_{v})}\right)} {\hat{N}({\boldsymbol{\delta}}; {\boldsymbol{x}}_q^{(1)}, \dots, {\boldsymbol{x}}_q^{(n_q)}) }\] as the \emph{empirical density ratio model}. In practice, one minimizes the negative empirical approximation of the rightmost term in Eq.\eqref{eq.obj}: \begin{align*} \ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}}; \mathcal{X}_p, \mathcal{X}_q) &= -\frac{1}{n_p}\sum_{i=1}^{n_p} \log \hat{r}({\boldsymbol{x}}_{p}^{(i)}; {\boldsymbol{\delta}})\\ &= - \frac{1}{n_p}\sum_{i=1}^{n_p} \sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}(x_{p,u}^{(i)},x_{p,v}^{(i)}) \\ &+\log \left(\frac{1}{n_q}\sum_{i=1}^{n_q} \exp\left(\sum_{u,v = 1, u\ge v}^m {\boldsymbol{\delta}}_{u,v}^\top {\boldsymbol{\psi}}(x_{q,u}^{(i)},x_{q,v}^{(i)})\right)\right), \end{align*} \paragraph{Optimization} Since $\ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}})$ consists of a linear part and a \emph{log-sum-exp} function \citep{Boyd2004}, it is convex with respect to ${\boldsymbol{\delta}}$, and its global minimizer can be numerically found by standard optimization techniques such as gradient descent. The gradient of $\ell_{\mathrm{KLIEP}}$ with respect to ${\boldsymbol{\delta}}_{u,v}$ is given by \begin{align} \label{gradient.def} \nabla_{{\boldsymbol{\delta}}_{u,v}} \ell_{\text{KLIEP}}({\boldsymbol{\delta}}) &= -\frac{1}{n_p}\sum_{i=1}^{n_p} {\boldsymbol{\psi}} (x_{p,u}^{(i)},x_{p,v}^{(i)}) + \frac{1}{n_q} \sum_{i=1}^{n_q} \hat{r}({\boldsymbol{x}}^{(i)}; {\boldsymbol{\delta}}) {\boldsymbol{\psi}}(x_{q,u}^{(i)},x_{q,v}^{(i)}), \end{align} that can be computed in a straightforward manner for \emph{any} feature vector ${\boldsymbol{\psi}}(x_{u},x_{v})$. \subsection{Sparsity Inducing and Regularizations} \label{sec.sparse.reg} In the search for \emph{sparse} changes, one may regularize the KLIEP solution with a sparsity-inducing norm $\sum_{u\ge v} \| {\boldsymbol{\delta}}_{u,v} \|$, i.e., the \emph{group-lasso} penalty \citep{Yuan2006} where we use $\|\cdot\|$ to denote the $\ell_2$ norm. Note that the density-ratio approach \citep{Liu2014} directly sparsifies the difference ${\boldsymbol{\theta}}^{(p)}-{\boldsymbol{\theta}}^{(q)}$, and thus intuitively this method can still work well even if ${\boldsymbol{\theta}}^{(p)}$ and ${\boldsymbol{\theta}}^{(q)}$ are dense as long as ${\boldsymbol{\theta}}^{(p)}-{\boldsymbol{\theta}}^{(q)}$ is sparse. The following is the objective function used in \citep{Liu2014}: \begin{align} \label{eg.obj.final} \hat{{\boldsymbol{\delta}}} = \mathop{\rm argmin}\limits_{{\boldsymbol{\delta}}} \ell_{\text{KLIEP}}({\boldsymbol{\delta}}) + \lambda \sum_{u,v = 1, u \ge v}^m\| {\boldsymbol{\delta}}_{u,v} \|. \end{align} In a recent work \citep{Fazayeli2016}, authors considered \emph{structured} changes, such as sparse, block sparse, node-perturbed sparse and so on. These structured changes can be represented via suitable atomic norms \citep{Chandrasekaran2012,Mohan2014}. For example, a KLIEP objective with a node-perturbation regularizer is \begin{align} \label{eg.obj.final.node} \hat{{\boldsymbol{\Delta}}} = \mathop{\rm argmin}\limits_{{\boldsymbol{\Delta}}\in \mathbb{R}^{m \times m}, L\in \mathbb{R}^{m\times m}} \ell_{\text{KLIEP}}({\boldsymbol{\Delta}}) + \lambda_1\| {\boldsymbol{\Delta}} \|_1 + \lambda_2 \sum_{v=1}^m \left(\sum_{u=1}^m L_{u,v}^k\right)^{\frac{1}{k}}\notag\\ \text{subject to: } {\boldsymbol{\Delta}} = {\boldsymbol{L}} + {\boldsymbol{L}}^\top, \end{align} Such a regularization can be used to discover perturbed nodes i.e., nodes that have a completely different connectivity pattern to other nodes among two networks. \paragraph{Optimization} Although the original objective of KLIEP was smooth and convex, the sparsity inducing norms are in general non-smooth. Proximal gradient methods, such as Fast Iterative Shrinkage Thresholding Algorithms (FISTA) \citep{Beck2009} can be utilized to solve regularized KLIEP objectives. A FISTA-like algorithm was proposed in \citep{Fazayeli2016} with a faster rate of convergence. \subsection{Covariance-Precision Matching} \label{sec.matching} As mentioned above, the density ratio formulation is not the only way that may motivate the direct modelling. For the formulation using the equality \eqref{eq.quasi.log.likelihood}, we can solve the following sparsity inducing objective which was introduced in \citep{Zhao2014}. \begin{align} \label{eq.differential} \hat{{\boldsymbol{\Delta}}} = \mathop{\rm argmin}\limits_{{\boldsymbol{\Delta}}} \| {\boldsymbol{\Delta}} \|_1 ~~ \text{subject to } \| \hat{{\boldsymbol{\Sigma}}}^{(p)} {\boldsymbol{\Delta}} \hat{{\boldsymbol{\Sigma}}}^{(q)} + \hat{{\boldsymbol{\Sigma}}}^{(p)} - \hat{{\boldsymbol{\Sigma}}}^{(q)}\|_{\infty} \le \epsilon, \end{align} where $\epsilon$ is a hyper-parameter. To obtain a sparse solution, we set a threshold for the solution at a certain level $\tau$, i.e. the value for $|\hat{\Delta}_{u,v}|<\tau$ is rounded to $0$. The constraint enforces the equality \eqref{eq.quasi.log.likelihood} and we used single parameter ${\boldsymbol{\Delta}}$ replacing ${\boldsymbol{\Theta}^{(p)}} - {\boldsymbol{\Theta}^{(q)}}$. \paragraph{Optimization} This method is quite computationally demanding as the dimension $m$ grows. The Alternating Direction Method of Multipliers (ADMM) procedure \citep{Boyd2011} was implemented based on an augmented version of \eqref{eq.differential} (See Section 3.3 \citep{Zhao2014} for details). \subsection{Maximizing Joint Likelihood} \label{sec.joint.likelihood} As it was mentioned in Section \ref{sec.quasi}, one does not have to use the direct modelling to learn sparse changes between MNs. In fact, separated modelling may not only discover changes, but also can recover the individual MN themselves. Recently, a method based on \emph{fused-lasso} \citep{Tibshirani2005} has been developed \citep{Zhang2010}. This method also sparsifies ${\boldsymbol{\theta}}^{(p)} - {\boldsymbol{\theta}}^{(q)}$ directly. The original method conducts \emph{feature-wise neighborhood regression} \citep{Meinshausen2006} jointly for $P$ and $Q$, which can be conceptually understood as maximizing the local conditional Gaussian likelihood jointly on each random variable $t$. A slightly more general form of the learning criterion may be summarized as \begin{align} \label{eq.fused} \min_{{\boldsymbol{\theta}}^{(p)}_{t} \in \mathbb{R}^{m-1}, {\boldsymbol{\theta}}^{(q)}_{t}\in \mathbb{R}^{m-1}} \ell_{t}({\boldsymbol{\theta}}^{(p)}_t; \mathcal{X}_p) &+ \ell_{t}({\boldsymbol{\theta}}^{(q)}_t; \mathcal{X}_q)) \notag\\ &+ \lambda_1 (\|{\boldsymbol{\theta}}^{(p)}_t\|_1+\|{\boldsymbol{\theta}}^{(q)}_t\|_1) + \lambda_2 \|{\boldsymbol{\theta}}^{(p)}_{t}-{\boldsymbol{\theta}}^{(q)}_{t}\|_1, \end{align} where $\ell_{t}({\boldsymbol{\theta}};\mathcal{X}_p)$ is the \emph{negative} log conditional likelihood for the $t$-th random variable $x_t\in\mathbb{R}$ given the rest ${\boldsymbol{x}}_{\backslash t} \in\mathbb{R}^{m-1}$: \begin{align*} \ell_{t}({\boldsymbol{\theta}};\mathcal{X}_p) = -\frac{1}{n_p}\sum_{i=1}^{n_p}\log p(x_{p,t}^{(i)}|{\boldsymbol{x}}_{p,\backslash t}^{(i)};{\boldsymbol{\theta}}), \end{align*} where each dimension of ${\boldsymbol{\theta}}$ corresponds to one of its potential neighborhood. $\ell_{t}({\boldsymbol{\theta}};\mathcal{X}_q)$ is defined in the same way as $\ell_{t}({\boldsymbol{\theta}};\mathcal{X}_p)$. Since the Fused-lasso-based method directly sparsifies the changes in MN structure, it can work well even when each MN is not sparse (when $\lambda_1$ is set to 0). \paragraph{Learning Changes in Sequence} Another recent development \citep{Kolar2012} along this line of research assumes the data points are received \emph{sequentially}, i.e., we observe ${\boldsymbol{x}}^{(1)}, {\boldsymbol{x}}^{(2)}, \dots, {\boldsymbol{x}}^{(T)}$ over time points $\mathcal{T} = \{1, 2, \dots, T\}$. Suppose $\mathcal{T}$ can be segmented into $K$ disjoint unknown subsets: $\mathcal{T} = \cup_{k\in \left\{1\dots K\right\}}\mathcal{T}_k$ and ${\boldsymbol{x}}_{\mathcal{T}_k} \sim p\left({\boldsymbol{x}}, {\boldsymbol{\theta}}^{(\mathcal{T}_k)}\right)$. The task is to segment such a sequence and learn an estimate $\widehat{{\boldsymbol{\theta}}}^{(\mathcal{T}_k)}$ for each segment. We can extend the idea of fused-lasso in \eqref{eq.fused}, and maximize the joint likelihood over each single observation: \begin{align*} \mathop{\rm argmin}\limits_{{\boldsymbol{\theta}}^{(i)}, i \in \{1 \dots T\}} \sum_{i=1}^T \ell({\boldsymbol{\theta}}^{(i)}; {\boldsymbol{x}}^{(i)}) + \lambda_1 \sum_{i=1}^T \left\|{\boldsymbol{\theta}}^{(i)}\right\|_1 + \lambda_2 \sum_{i=1}^{T-1} \left\| {\boldsymbol{\theta}}^{(i+1)} - {\boldsymbol{\theta}}^{(i)} \right\|_1, \end{align*} where the fused lasso term sparsifies the changes between MNs at adjacency time points, thus the learned ${\boldsymbol{\theta}}^{(1)}, {\boldsymbol{\theta}}^{(2)}, \dots {\boldsymbol{\theta}}^{(T)}$ is ``piecewise-constant'' and the segments are automatically determined from it. A block-coordinate descent procedure was proposed to solve this problem efficiently \citep{Kolar2010}. \section{Theoretical Analysis} \label{sec.learning.pg} The KLIEP algorithm does not only perform well in practice, it is also justified theoretically. In this section, we first introduce the support recovery theorem of KLIEP and then review some recent theoretical developments of direct change learning. \subsection{Preliminaries} In the previous section, a sub-vector of ${\boldsymbol{\delta}}$ indexed by a pair $(u,v)$ corresponds to a specific edge of an MN. From now on, we switch to a ``unitary'' index system as our analysis is not dependent on the edge nor the structure setting of the graph. We introduce the ``true parameter'' notation ${\boldsymbol{\delta}}^*, p({\boldsymbol{x}})=q({\boldsymbol{x}})r({\boldsymbol{x}};{\boldsymbol{\delta}}^*),$ and the pairwise index set $E = \{(u,v) | u\ge v\}$. Two sets of \textit{sub-vector indices} regarding to ${\boldsymbol{\delta}}^*$ and $E$ are defined as $S = \{t'\in E ~|~ \|{\boldsymbol{\delta}}^*_{t'}\| \neq 0\}, S^c = \{t'' \in E ~|~ \|{\boldsymbol{\delta}}^*_{t''}\| = 0\}.$ We rewrite the objective \eqref{eg.obj.final} as \begin{align} \label{eq.obj.alter} \hat{{\boldsymbol{\delta}}} = \mathop{\rm argmin}\limits_{{\boldsymbol{\delta}}} \ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}}) &+ \lambda_{n_p} \sum_{t\in S \cup S^c} \| {\boldsymbol{\delta}}_{t} \|. \end{align} Similarly we can define $\hat{S} = \{t' \in E ~|~ \|\hat{{\boldsymbol{\delta}}}_{t'}\| \neq 0\}$ and $\hat{S^c}$ accordingly. Sample Fisher information matrix $\mathcal{I} \in \mathbb{R}^{\frac{b(m^2+m)}{2} \times \frac{b(m^2+m)}{2}}$ denotes the Hessian of the log-likelihood: $\mathcal{I} = \nabla^2 \ell_{\text{KLIEP}} ({\boldsymbol{\delta}}^*)$. $\mathcal{I}_{AB}$ is a sub-matrix of $\mathcal{I}$ indexed by two sets of indices $A, B \subseteq E$ are indices on rows and columns. In this section, we prove the support consistency, i.e. with high probability that $S=\hat{S},S_c=\hat{S}_c$ (See e.g., Chapter 11 in \citep{Hastie2015} for an introduction of support consistency). \subsection{Assumptions} We try \emph{not} to impose assumptions directly on each individual MNs, as the essence of KLIEP method is that it can handle various changes regardless the types of individual MNs. The first two assumptions are essential to many support consistency theorems(e.g. Eq. (15) and (16) in \citep{Wainwright2009}, Assumption A1 and A2 in \citep{Ravikumar2010}). These assumptions are made on the Fisher information matrix. \begin{assum}[Dependency Assumption] \label{assum.depen} The sample Fisher information \textbf{submatrix} $\mathcal{I}_{{SS}}$ has bounded eigenvalues: $ \Lambda_\mathrm{min}(\mathcal{I}_{{SS}}) \ge \lambda_\mathrm{min} > 0, $ with probability $1-\xi_q$, where $\Lambda_{\mathrm{min}}$ is the minimum-eigenvalue operator of a symmetric matrix. \end{assum} This assumption on the \emph{submatrix} of $\mathcal{I}$ is to ensure that the density ratio model is identifiable and the objective function is ``reasonably convex''. \begin{assum}[Incoherence Assumption] \label{assum.incoherence} $ \max_{t'' \in S^c}\|\mathcal{I}_{t''S} \mathcal{I}_{SS}^{-1}\|_1 \le 1-\alpha, 0<\alpha \le 1. $ with probability 1, where $\|Y\|_1 = \sum_{i,j} \|Y_{i,j}\|_1$. \end{assum}This assumption says the unchanged edges cannot exert overly strong effects on changed edges. Note this assumption is sometimes called ``\emph{irrepresentability}'' condition. \begin{assum}[Smoothness Assumption on Likelihood Ratio] \label{assum.smooth} The log-likelihood ratio $\ell_\mathrm{KLIEP}({\boldsymbol{\delta}})$ is smooth around its optimal value, i.e., it has bounded derivatives \begin{align*} &\max_{{\boldsymbol{u}}, \|{\boldsymbol{u}}\|\leq \|{\boldsymbol{\delta}}^*\|}\left\| \nabla^2 \ell_\mathrm{KLIEP}({\boldsymbol{\delta}}^*+{\boldsymbol{u}})\right\| \leq \lambda_\mathrm{max} < \infty,\\ &\max_{t\in S \cup S^c} \max_{{\boldsymbol{u}}, \|{\boldsymbol{u}}\|\leq \|{\boldsymbol{\delta}}^*\|} \vertiii{\nabla_{{\boldsymbol{\delta}}_t}\nabla^2 \ell_\mathrm{KLIEP}({\boldsymbol{\delta}}^* + {\boldsymbol{u}})} \leq \lambda_{3,\mathrm{max}}<\infty , \end{align*} with probability $1$. \end{assum} $\left\|\cdot\right\|$, $\vertiii{\cdot}$ are the spectral norms of a matrix and a tensor respectively (See e.g., \citep{Tomioka2014} for the definition of spectral norm of a tensor). This assumption guarantees the log-likelihood function is well-behaved. Now, we state the following assumptions on the density ratio: \begin{assum}[Correct Model Assumption] \label{assum.correct} The density ratio model is correct, i.e. there exists ${\boldsymbol{\delta}}^*$ such that \begin{align*} p({\boldsymbol{x}}) = r({\boldsymbol{x}};{\boldsymbol{\delta}}^*)q({\boldsymbol{x}}). \end{align*} \end{assum} Although analyzing the mis-specified ratio model \citep{Kanamori2010} is certainly an interesting open question, we focus on correctly specified models in this section. \begin{assum}[Smooth Density Ratio Assumption] \label{assum.smooth.ratiomodel.nod} For any vector ${\boldsymbol{u}} \in \mathbb{R}^{\mathrm{dim}({\boldsymbol{\delta}}^*)}$ such that $\|{\boldsymbol{u}}\|\leq \|{\boldsymbol{\delta}}^*\|$ and every $a\in \mathbb{R}$, the following inequality holds: \begin{align*} \mathbb{E}_q \left[\exp\left( a\left( r({\boldsymbol{x}}, {\boldsymbol{\delta}}^* + {\boldsymbol{u}}) - 1 \right)\right) \right] \le \exp\left(Ma^2\right), \end{align*} \end{assum} where $M>0$ is a constant independent from $m$. This assumption states that the density ratio model, around its optimal parameter, should not often obtain large values over samples from $Q$. \subsection{Successful Support Recovery of KLIEP \citep{Liu2016a,Liu2016}} \label{sec.them.kliep} \begin{them} \label{them.the.main.theorem} Suppose that Assumptions \ref{assum.depen}, \ref{assum.incoherence}, \ref{assum.smooth}, \ref{assum.correct}, and \ref{assum.smooth.ratiomodel.nod} as well as \begin{align} \label{eq.true.para.condition} \min_{t'\in S} \|{\boldsymbol{\delta}}^*_{t'}\| \geq \frac{10}{\lambda_\mathrm{min}} \sqrt{d}\lambda_{n_p} \end{align} are satisfied, where $d$ is the number of changed edges defined as $d = |S|$, i.e., the cardinality of the set of non-zero parameter groups. Suppose also that the regularization parameter is chosen so that \begin{align} \label{eq.lambda.condition} M_1 \sqrt\frac{{\log \frac{m^2+m}{2}}}{n_p} \le \lambda_{n_p} \le M_2 \min\left(\frac{\|{\boldsymbol{\delta}}^*\|}{\sqrt{b}}, 1\right), \end{align} and $n_q \ge M_3 n_p^2$, where $M_1, M_2$ and $M_3$ are constants. Then there exist some constants $L_1$, $K_1$, and $K_2$ such that if $n_p\geq L_1 d^2\log \frac{m^2+m}{2}$, with the probability at least \begin{align*} 1- \exp\left( - K_1 \lambda_{n_p}^2n_p \right) - 4\exp\left( -K_2 dn_q \lambda_{n_p}^4 \right) - \xi_q, \end{align*} the following properties hold: \begin{itemize} \item Unique Solution: The solution of \eqref{eq.obj.alter} is unique. \item Successful Change Detection: $\hat{S} = S$ and $\hat{S}^c = S^c$. \end{itemize} \end{them} The proof of this theorem follows the Primal-dual witness construction (See e.g., Section 11.4.2 in \citet{Hastie2015}). \paragraph{Remark} The main conclusion of this theorem states that if the regularization parameter is \emph{reasonably chosen} \eqref{eq.lambda.condition} and the true non-zero groups $\|{\boldsymbol{\delta}}^*_{t'}\|, {t'}\in S$ is \emph{large enough} \eqref{eq.true.para.condition}, with high probability, we are guaranteed to have the correct support of parameters. The samples needed for $n_p$ only grows linearly with $\log m$ and $n_q$ grows quadratically with $n_p$. \subsection{$\ell_2$ Consistency of KLIEP with Atomic Norm \citep{Fazayeli2016}} \label{sec.consis.atomic} As it was introduced in Section \ref{sec.sparse.reg}, atomic norms can be used to learn changes with special topological structures. Instead of support recovery, we focus on the $\ell_2$ loss between the estimated parameter $\hat{{\boldsymbol{\delta}}}$ and the true parameter ${\boldsymbol{\delta}}^*$, i.e., $\|{\boldsymbol{\delta}}^* - \hat{{\boldsymbol{\delta}}}\|$. First, we generalize our objective function as \begin{align} \label{eq.obj.alter.2} \hat{{\boldsymbol{\delta}}} = \mathop{\rm argmin}\limits_{{\boldsymbol{\delta}} \in \mathbb{R}^{\frac{m^2+m}{2}}} \ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}}) &+ \lambda_{n_p,n_q} R({\boldsymbol{\delta}}), \end{align} where $R$ is an atomic norm function. Such a theorem relies on the \emph{Restricted Strong Convex (RSC)} property on the \emph{Error Set} of the objective function. Intuitively, if $\ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}})$ is ``highly curved'', small $|\ell_{\mathrm{KLIEP}}(\hat{{\boldsymbol{\delta}}}) - \ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}}^*)|$ ensures small $\|\hat{{\boldsymbol{\delta}}} - {\boldsymbol{\delta}}^*\|$. Thus we only need to figure out how $|\ell_{\mathrm{KLIEP}}(\hat{{\boldsymbol{\delta}}}) - \ell_{\mathrm{KLIEP}}({\boldsymbol{\delta}}^*)|$ reaches zero as number of samples goes to infinity and this is a more accessible target. To make sure our objective has such a ``strongly convex'' curvature, one need to impose a uniform lower-bound on the eigenvalues of the objective Hessian (a.k.a., sample Fisher information matrix $\mathcal{I}$). However, this is not realistic for the high-dimensional setting, as $\mathcal{I}$ is certainly rank-deficient. As an alternative, we impose an assumption on the convexity of $\ell_\text{KLIEP}$ over a constrained set: \paragraph{Restricted Strong Convex Condition} The function $\ell$ is Restricted Strong Convex (RSC) at a cone $C$ if there exists a constant $\kappa$ such that $\forall {\boldsymbol{u}} \in C$ \begin{align*} \ell({\boldsymbol{\delta}}^* + {\boldsymbol{u}}) - \ell({\boldsymbol{\delta}}^*) - \langle {\boldsymbol{u}}, \nabla_\ell({\boldsymbol{\delta}}^*)\rangle \ge \kappa \|{\boldsymbol{u}}\|^2. \end{align*} If ${\boldsymbol{\delta}}^* - \hat{{\boldsymbol{\delta}}} \in C$, it is possible to obtain a \emph{deterministic} bound (Theorem 2 in \citet{Banerjee2014}) on the $\ell_2$ estimation error \begin{align*} \|{\boldsymbol{\delta}}^* - \hat{{\boldsymbol{\delta}}}\|_2 = O\left(\frac{\lambda_{n_p, n_q}}{\kappa}\Psi(C)\right), \end{align*} where $\Psi(C)$ is the the norm compatibility constant \citep{Negahban2009} and can be easily bounded. Note that although this bound itself is not probabilistic, the parameter $\lambda_{n_p, n_q}$ is random and the RSC may hold with a probability. One can infer the sample complexity from these bounds. Two things remain to be shown. First, we need to find such a cone which contains $\hat{{\boldsymbol{\delta}}} - {\boldsymbol{\delta}}^*$. Second, we need to prove $\ell_\text{KLIEP}$ is RSC on this cone. We start with the first problem. \paragraph{Error Set (Lemma 1 in \citep{Banerjee2014})} For any convex loss $\ell({\boldsymbol{\delta}})$, if $\lambda_{n_p, n_q}$ is large enough, i.e., \[\lambda_{n_p, n_q}\ge \beta R^*(\nabla \ell({\boldsymbol{\delta}}^*) ), \beta > 1 \] where $R^*$ is the dual norm of $R$, it can be proven that the estimation error ${\boldsymbol{u}} = {\boldsymbol{\delta}}^* - \hat{{\boldsymbol{\delta}}}$ lies in an Error Set: \begin{align*} E_r = \left\{ {\boldsymbol{u}}, {\boldsymbol{u}} \in \mathrm{dom}({\boldsymbol{\delta}}) \bigg| R({\boldsymbol{\delta}}^* + {\boldsymbol{u}}) \le R({\boldsymbol{\delta}}^*) + \frac{1}{\beta} R({\boldsymbol{u}}) \right\}, \end{align*} where $\mathrm{dom}({\boldsymbol{y}})$ is the domain of ${\boldsymbol{y}}$. Let's define $C_r = \mathrm{cone}(E_r)$. In fact, it can be shown that if \[\lambda_{n_p. n_q} \ge \frac{c\cdot (w(\Omega_R) + \epsilon)}{\sqrt{\min(n_p, n_q)}},\] where $w(A)$ is the Gaussian width of a set $A$ \citep{Ledoux2013} and $\Omega_R = \{{\boldsymbol{u}} | R({\boldsymbol{u}}) \le 1\}$, then $\lambda_{n_p, n_q}\ge \beta R^*(\nabla \ell({\boldsymbol{\delta}}^*) )$ holds automatically with high probability (Theorem 1 in \citep{Fazayeli2016}). Now we have a cone $C_r$ where $\hat{{\boldsymbol{\delta}}} - {\boldsymbol{\delta}}^*$ resides. As to the second problem, it can be proven that $\ell_{\mathrm{KLIEP}}$ is RSC at $C_r$ with high probability once $n_q \ge n_0, n_0 = w^2(C_r \cap S)$, where $S$ is a unit hypersphere (Theorem 2 in \citep{Fazayeli2016}). Thus $n_0$ is the minimum number of samples required from $Q$ to be able to apply this theorem. Putting everything together, we have the main theorem proved in \citep{Fazayeli2016}: \begin{them}[$\ell_2$ Consistency of Atomic Norms] If Assumption \ref{assum.smooth.ratiomodel.nod} holds, and $\hat{{\boldsymbol{\delta}}}$ is the minimizer of \eqref{eq.obj.alter.2}, then with probability at least $1 - M_1\mathrm{exp}(-\epsilon^2)$ the followings hold: \begin{align*} \lambda_{n_p, n_q} \ge \frac{M_2}{\sqrt{\min(n_p, n_q)}} (w(\Omega_R)+\epsilon)) \end{align*} and for $n_q \ge c_1 w^2 (C_r \cap S)$, with high probability, the estimate $\hat{{\boldsymbol{\delta}}}$ satisfies \begin{align*} \|\hat{{\boldsymbol{\delta}}} - {\boldsymbol{\delta}}^* \|_2 = O\left(\frac{w(\Omega_R)}{\sqrt{\min(n_p, n_q)}}\right)\Psi(C_r) \end{align*} \end{them} Note the constants $M_1$ and $M_2$ listed in this theorem are not the same as the ones in Theorem \ref{them.the.main.theorem}. To apply this theorem, we need to know the bounds of $w(\Omega_R)$ and $\Psi(C_r)$ for specific $R$ norms. These bounds have been proven in previous literatures (see e.g. \citep{Banerjee2014}). For example, if $R$ is $\ell_1$ norm, then $\Psi(C_r) \le 4\sqrt{d}$ and $w(\Omega_R) \le c \log m$ so applying the above theorem, we have \[\|\hat{{\boldsymbol{\delta}}} - {\boldsymbol{\delta}}^* \|_2 = O\left(\sqrt{\frac{d\log m}{\min(n_p, n_q)}}\right). \] \paragraph{Remark} Although this bound does not directly prove the support consistency, we can learn that sample complexity $\min(n_p, n_q) = \Omega( d\log m)$ guarantees the convergence of estimation error in $\ell_2$ norm. As to $n_q$, it should also satisfy $n_q \ge c_1 w^2(C_r\cap S)$, which is again $n_q = \Omega( d \log m )$ in the case of $\ell_1$ norm. This sample complexity is milder than what \citeauthor{Liu2016a} have obtained in the previous section $\Omega(d^2 \log (m^2 + m)/2)$ and $n_q = \Omega(n_p^2)$. Nonetheless, both theories can be applied to high dimensional regime $m\gg \min(n_p, n_q)$. \subsection{Support Consistency of Covariance-Precision Matching \citep{Zhao2014}} \label{sec.convar.prec.theorem} In this section, we introduce the support recovery theorem of the Covariance-Precision Matching method \eqref{eq.differential} in terms of support consistency on Gaussian MNs. Specifically for Gaussian MNs, we need a slightly different set of notations, as they are parametrized in matrix forms. $\Sigma_{j,k}^{(p)}$ is the $j,k$-th elements of matrix ${\boldsymbol{\Sigma}}^{(p)}_{j,k}$ and $\Sigma_\mathrm{max}^{(p)}$ is $\max_j \Sigma^{(p)}_{j,j}$. The first assumption is to ensure that the ``amount of change'' is fixed and the change is always sparse, and does not grow with the number of dimension $m$. \begin{assum} \label{assum.diff.1} The difference matrix ${\boldsymbol{\Delta}}$ has $d \le m$ non-zero elements in its upper triangular sub-matrix. $|{\boldsymbol{\Delta}}|_1 \le M_0$, and both $d$ and $M_0$ does not depend on dimension $m$. \end{assum} The second assumption assures that the covariates are not strongly dependent if there are many changes in the precision matrix. This is similar to the incoherence assumption used in Assumption \ref{assum.incoherence}. \begin{assum} \label{assum.diff.2} The constants $\mu^{(p)} = \max_{j\neq k} |\Sigma_{j,k}^{(p)}|$ and $\mu^{(q)} = \max_{j\neq k} |\Sigma_{j,k}^{(q)}|$ must satisfy $\mu = 4\max(\mu^{(p)}\Sigma_{\mathrm{max}}^{(q)}, \mu^{(q)}\Sigma_{\mathrm{max}}^{(p)}) \le \frac{\Sigma^S_{\mathrm{min}}}{2d} $, where \[\Sigma^S_{\mathrm{min}} = \mathrm{min}_{j,k}(\Sigma^{(q)}_{jj}\Sigma^{(p)}_{jj}, \Sigma^{(q)}_{kk}\Sigma^{(p)}_{jj} + 2\Sigma^{(q)}_{kj}\Sigma^{(p)}_{jk} + \Sigma^{(q)}_{jj}\Sigma^{(p)}_{kk}).\] \end{assum} We first intuitively explain how the proof works. The proof of the support consistency can be thought as controlling $\|\hat{{\boldsymbol{\Delta}}} - {\boldsymbol{\Delta}}^*\|_\infty$. Clearly, for the population covariance matrices ${\boldsymbol{\Sigma}}^{(p)}$ and ${\boldsymbol{\Sigma}}^{(q)},$ ${\boldsymbol{\Sigma}}^{(p)}{\boldsymbol{\Delta}}^*{\boldsymbol{\Sigma}}^{(q)} + {\boldsymbol{\Sigma}}^{(p)} - {\boldsymbol{\Sigma}}^{(q)} = {\boldsymbol{0}}$. If we replace the above population covariances with their sample versions, we can expect $\|\hat{{\boldsymbol{\Sigma}}}^{(p)}{\boldsymbol{\Delta}}^*\hat{{\boldsymbol{\Sigma}}}^{(q)} + \hat{{\boldsymbol{\Sigma}}}^{(p)} - \hat{{\boldsymbol{\Sigma}}}^{(q)}\|_\infty \le \epsilon,$ if number of samples is large enough. Furthermore, $\epsilon$ can be a function decreasing with $\min(n_p, n_q)$ as the estimated covariances are getting closer and closer to the population ones. Therefore, if we set the $\epsilon$ to a decreasing function, we can still ``contain'' the optimal parameter ${\boldsymbol{\Delta}}^*$ in the feasible zone with high probability. By definition, the estimated difference $\hat{{\boldsymbol{\Delta}}}$ should also be in the feasible zone, thus they should not be far off, if the zone is small enough. The rigorous proof of the above statements is given in the Appendix of \citet{Zhao2014}. Now, we give the support recovery theorem\footnote{In fact, the support recovery theorem was proved for a slightly augmented version of \eqref{eq.differential}.} as follows (See Section 4 in \citep{Zhao2014} for details): \begin{them}[Support Consistency of Covariance-Precision Matching] Suppose $P$ and $Q$ are Gaussian, Assumption \ref{assum.diff.1} and \ref{assum.diff.2} hold, $\mathrm{min}(n_p, n_q) \ge \log m$ and \[\tau_{n_p, n_q} = \Omega \left(\sqrt{\frac{\log m}{\min(n_p, n_q)}}\right), \epsilon_{n_p, n_q} = M_1 \cdot \sqrt{\frac{\log m}{\min(n_p, n_q)}}\] and $\min_{j,k} |\Delta^*_{j,k: \Delta^*_{j,k} \neq 0}| \ge 2\tau_{n_p, n_q}$\footnote{$\tau_{n_p, n_q}, \epsilon_{n_p,n_q}$ is the sample-dependent version of $\tau,\epsilon$ introduced in Section \ref{sec.matching}.}, then with high probability, \eqref{eq.differential} can recover the correct support of ${\boldsymbol{\Delta}}^*$. \end{them} This support consistency theorem, although only applies to Gaussian MNs, has similar structure to the one derived for KLIEP (Section \ref{sec.them.kliep}). First, they both assume the true non-zero parameter should be large enough. Second, they both assume the sparsity inducing factor ($\lambda_{n_p, n_q}$ and $\tau_{n_p, n_q}$) should decay as the sample size $\min(n_p, n_q)$ increases, while increase as the log-dimension $\log m$ increases. \subsection{Summary and Discussion} \label{sec.summary} Now, we summarize and compare these theoretical results. First we discuss the similarities of these theorems. \begin{itemize} \item None of the above proofs require the sparsity assumption on each individual MN. Thus in theory, all methods should work well when individual MNs are dense. \item The efficiency of all methods are affected by the sparsity of changes (i.e. $d$). This make sense since the sparsity assumption is made on the changes between two MNs. \item All theorems apply to the high dimensional regime ($m \gg \min(n_p, n_q)$). None requires $n_p$ \emph{or} $n_q$ to be comparable to the dimensionality $m$. \end{itemize} However, there is one important difference among these theorems. The sample complexities introduced in Section \ref{sec.them.kliep} and \ref{sec.consis.atomic} are \emph{not} symmetric. the sample complexity of $n_q$ is more restrictive comparing to that of $n_p$. This is understandable since KLIEP itself is an asymmetric method (KL divergence is asymmetric). In comparison, the sample complexity of Covariance-Precision Matching is symmetric, i.e., the theorem does not show the ``bias'' toward either of the datasets. Thus, if one has perfectly balanced Gaussian datasets, it might be natural to use Covariance-Precision Matching to learn the differences. \section{Experiments} \label{sec.exp} In this section, we compare the performance of two direct change detection methods: KLIEP and Covariance-Precision (CP) Matching using synthetic and real-world examples. \subsection{Implementations} Sparsity-inducing KLIEP can be implemented using sub-gradient descent approach. The MATLAB\textregistered code can be found at \url{http://www.ism.ac.jp/~liu/kliep_sparse/demo_sparse.html}. The R \citep{RCoreTeam2016} implementation of CP matching using ADMM can be obtained at \url{https://github.com/sdzhao/dpm}. \subsection{Synthetic Examples} \begin{figure*} \centering \subfigure[The ground truth. $m=50, d = 6$.]{ \label{fig.toy.ground} \includegraphics[width=.5\textwidth]{groundtruth}} \subfigure[ROC curves]{ \label{fig.toy.roc} \includegraphics[width=.45\textwidth]{ROC_LLKLIEP_DIFF} } \subfigure[$\hat{{\boldsymbol{\Delta}}}$, KLIEP, $\alpha = .75$ ]{ \label{fig.toy.kliep.75} \includegraphics[width=.3\textwidth]{LLKLIEP075}} \subfigure[$\hat{{\boldsymbol{\Delta}}}$, KLIEP, $\alpha = 1.0$ ]{ \label{fig.toy.kliep.100} \includegraphics[width=.3\textwidth]{LLKLIEP100}} \subfigure[$\hat{{\boldsymbol{\Delta}}}$, KLIEP, $\alpha = 1.25$ ]{ \label{fig.toy.kliep.125} \includegraphics[width=.3\textwidth]{LLKLIEP125}} \subfigure[$\hat{{\boldsymbol{\Delta}}}$, CP, $\tau = 0.0$ ]{ \label{fig.toy.cp00} \includegraphics[width=.3\textwidth]{DIFF0}} \subfigure[$\hat{{\boldsymbol{\Delta}}}$, CP, $\tau = 0.1$ ]{ \label{fig.toy.cp01} \includegraphics[width=.3\textwidth]{DIFF01}} \subfigure[$\hat{{\boldsymbol{\Delta}}}$, CP, $\tau = 0.2$ ]{ \label{fig.toy.cp02} \includegraphics[width=.3\textwidth]{DIFF02}} \caption{Illustrative Experiments.} \end{figure*} \paragraph{Illustrative Example} Now we illustrate the performance of both KLIEP and CP matching using two 50 dimensional multivariate zero-mean Gaussian distributions. First, we randomly generate a $50 \times 50$ symmetric adjacency matrix ${\boldsymbol{A}}^{(P)}$ with 10\% connectivity and draw 500 samples from a Gaussian distribution with the following precision matrix: \begin{align} \label{eq.generate.toy} \Theta^{(P)}_{i,j} = \begin{cases} 2 & i = j\\ 0.4 & A^{(P)}_{i,j} \neq 0, i\neq j \end{cases} \end{align} Then we remove 6 edges randomly from it, resulting a change pattern shown in Figure \ref{fig.toy.ground} and use it as ${\boldsymbol{A}}^{(Q)}$. Following the same step above we construct ${\boldsymbol{\Theta}^{(q)}}$ and generate 500 samples again. As it was suggested by Theorem \ref{them.the.main.theorem}, we set $\lambda=\frac{\alpha \log 50}{500}$, and the learned $\hat{{\boldsymbol{\Delta}}}$\footnote{We convert $\hat{{\boldsymbol{\delta}}}$ into its corresponding matrix form.} are shown in Figure \ref{fig.toy.kliep.75}, \ref{fig.toy.kliep.100} and \ref{fig.toy.kliep.125} using different $\alpha$. The same experiments are repeated using the CP matching method. However, since the sparsity control of CP matching is via the selection of the threshold $\tau$, we set $\epsilon = 0.2$ which shows good performance empirically and plot the learned $\hat{{\boldsymbol{\Delta}}}$ using different thresholds. Results are shown in Figure \ref{fig.toy.cp00}, \ref{fig.toy.cp01} and \ref{fig.toy.cp02}. As we can see, both approaches recover the change pattern well as we increase the sparsity control parameter. \paragraph{ROC-curves} In this experiment, we compare two methods quantitatively using ROC curves. We adopt the True Positive (TP) and True Negative (TN) rate as described in \citep{Zhao2014}: \begin{align*} \mathrm{TPR} = \frac{\sum_{t'\in S} \delta(\hat{{\boldsymbol{\delta}}}_{ t'} \neq {\boldsymbol{0}})}{\sum_{t'\in S} \delta({\boldsymbol{\delta}}^*_{t'} \neq {\boldsymbol{0}})}, ~~\mathrm{TNR} = \frac{\sum_{t'' \in S^c} \delta(\hat{{\boldsymbol{\delta}}}_{t''} = {\boldsymbol{0}})}{\sum_{t''\in S^c} \delta({\boldsymbol{\delta}}^*_{t''} = {\boldsymbol{0}})}. \end{align*} We generate a adjacency matrix $A^{(P)}$ with four-neighbour lattice structure, and randomly remove $d = \sqrt{m}$ edges producing ${\boldsymbol{A}}^{(Q)}$. Two sets of $n_p = n_q = 50$ samples are generated using the same criteria mentioned in \eqref{eq.generate.toy}. The ROC curves averaged over 50 trials with different dimensions are shown in Figure \ref{fig.toy.roc}, and the AUCs are reported in Table \ref{table.auc}. It can be seen that as the number of both dimension and changed edges increases, KLIEP method can retain stable performance while the performance of CP approach decays rapidly. \begin{table} \begin{tabular}{c|c|c|c|c|c|c|c|c} & $m = 9$ & $m = 16$ & $m = 25$ & $m = 36$ & $m = 49$ & $m = 64$ & $m = 81$ & $m = 100$ \\ \hline K & 0.8746 & 0.8865 & 0.8899 & 0.8890 & 0.8902 & 0.8878 & 0.8903 & 0.8866 \\ \hline CP & 0.8165 & 0.7917 & 0.7627 & 0.6829 & 0.5574 & 0.5914 & 0.5475 & 0.5656 \\ \hline \end{tabular} \caption{The Area under the curve (AUC) of ROC plot in Figure \ref{fig.toy.roc} (``K'' for KLIEP and ``CP'' for CP matching).} \label{table.auc} \end{table} \subsection{Running Time} Although the rigorous timing comparison is difficult due to the different implementations of KLIEP and CP matching, from our experience, KLIEP is faster but more memory-consuming as our implementation stores the entire parameter vector into the memory. On a server with 16 Xeon cores, it takes KLIEP about 15 mins to run experiments needed for plotting Figure \ref{fig.toy.roc}, while it takes CP matching roughly 1 hour. As to KLIEP, we also observe that ``early stopping'' heuristics (e.g., stopping at 100 iterations) can provide an accurate non-zero pattern within a short period of time. \subsection{Image Difference Detection} \begin{figure*}[t] \centering \subfigure[4:30PM, 7th Mar, 2016]{ \label{fig.img.a2} \includegraphics[width=.4\textwidth]{a3}} \subfigure[5:30PM, 7th Mar, 2016]{ \label{fig.park2} \includegraphics[width=.4\textwidth]{b2}}\\ \subfigure[Construct samples using sliding windows (red boxes). We set $\psi({\boldsymbol{x}}_u, {\boldsymbol{x}}_v) = \exp\left(-\frac{\|{\boldsymbol{x}}_u - {\boldsymbol{x}}_v\|^2}{0.5}\right)$.]{ \label{fig.construct.samples} \includegraphics[width=.4\textwidth]{cvmodel}} \subfigure[Detected changes]{ \label{fig.detected} \includegraphics[width=.4\textwidth]{picdetected}} \caption{Detecting changes of parking patterns from two photos.} \end{figure*} Two photos were taken in a rainy afternoon using a camera pointing at the parking lot of The Institute of Statistical Mathematics (ISM). In this task, we are interested in learning the changes of the parking patterns marked by green boxes in Figure \ref{fig.park2}. As we can see from Figure \ref{fig.img.a2} and \ref{fig.park2}, the light conditions and positions of raindrops vary in two pictures. To construct samples, we use windows of pixels (Figure \ref{fig.construct.samples}). Each window is a dimension of a dataset, and the samples are the pixel RGB values within this window. By sliding the window across the entire picture, we may obtain samples of different dimensions. Two sets of data can be obtained by using this sample generating mechanism over two images. Assuming an image can be represented by an MN of windows, changes of pixels values within a window may cause changes of ``interactions'' between neighboring windows. In other words, we can discover a change by looking at the change of the dependency of pixel values between a certain window and its neighbours. This is more advantageous than simply looking at the pixel values since changing the brightness of a picture may increase the pixel values in many windows simultaneously, even if the ``contrast'' between two windows does not change by much. By applying KLIEP on such two sets of data and highlighting adjacent window pairs that are involved in the changes of pairwise interactions, we may spot changes between two images. In our experiment, we use sliding windows of size $16 \times 16$ on a $200\times 150$ image, generating two sets of samples with $m=999$ and $n_p=n_q=256$. We reduce $\lambda$ until $|\hat{S}| > 40$. The spotted changes were plotted in Figure \ref{fig.detected}. It is can be seen that KLIEP has correctly labelled almost all changed parkings between two images except one missing on the left. Note that here we set $\psi({\boldsymbol{x}}_u, {\boldsymbol{x}}_v) = \exp\left(-\frac{\|{\boldsymbol{x}}_u - {\boldsymbol{x}}_v\|^2}{0.5}\right)$, and the underlying MN is highly non-Gaussian so CP matching cannot be applied here. \section{Open Problems} \label{sec.open} Although pioneering works have been conducted in this area, there are still important unsolved open problems. In this section, we list a few examples. \paragraph{Generalized Covariance-Precision Matching} In Section \ref{sec.matching}, we introduced an equality between Gaussian covariance and precision matrix \eqref{eq.quasi.log.likelihood}. This leads to a \emph{direct} sparse change learning approach. However, it does not apply to more general pairwise MNs. A natural question is, can we extend this relationship between covariance and precision matrices to a more general principle? Particularly, in a recent work \citep{Loh2013}, the \emph{generalized covariance matrix} was used to learn a non-Gaussian graphical model structure. Would a generalized equality \eqref{eq.quasi.log.likelihood} provides us with a universal framework of learning changes between MNs? \paragraph{Learning Changes from Multiple MNs} In this paper, we have only reviewed the algorithms that learn changes between two MNs. In fact, in some applications, datasets may be obtained as multiple ``snapshots''. For example, gene activities may be measured at a few different time points. Under the same assumption that changes between adjacent time points are ``mild'' and ``sparse'', can we perform multiple change detections in one shot? \paragraph{Asymmetry versus Symmetry} As we have pointed out in Section \ref{sec.summary}, there exists an asymmetry in KLIEP while Covariance-Precision matching has a symmetric formulation. An interesting future direction is to systematically investigate how such an asymmetry affects the change detection results, and more importantly, how can we automatically determine which density to be $Q$ and which one to be $P$ in the ratio formulation. We believe thorough investigations in these three directions will significantly expand our knowledge over the domain of learning changes between MNs in the future. \section{Conclusion} \label{sec.concl} In this paper, we have reviewed an MN change learning method based on density ratio estimation and other alternative approaches. Statistical guarantees regarding the support recovery and $\ell_2$ consistency were also reported and compared. Through their direct modelling and theoretical results, we can see an interesting common pattern in all these methods: they work well regardless of the difficulty of learning individual MNs. These results are inspiring as they shed lights on a new family of methods that only learn the \emph{incremental} patterns. They show that if the change itself is simple enough, even with limited amount of information, we can have good learning performance. Compared to classic, \emph{static} pattern recognition, such methods are well-suited for analysing \emph{dynamic} datasets, where the ``absolute'' pattern is not the main interest, but learning the change itself is more valuable. These works have offered a new vision of research on learning changes between patterns. We believe these methods and theorems may have many potential applications in the years to come. \section{Acknowledgements} We would like to thank Masashi Sugiyama, John Quinn and Michael Gutmann for their tremendous help during the development of the density ratio modelling idea. This work was partially supported by JSPS Grant-in-Aid for Scientific Research Activity Start-up 15H06823, MEXT kakenhi (25730013, 25120012, 26280009, 15H01678 and 15H05707), and JST-PRESTO. Authors would like to thank anonymous reviewers for their helpful comments. We would like to thank anonymous reviewers and Matthew Ames for their helpful comments and suggestions on this paper. \bibliographystyle{plainnat}
{'timestamp': '2017-01-10T02:09:35', 'yymm': '1701', 'arxiv_id': '1701.01582', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01582'}
arxiv
\section{Introduction} \label{sec:intro} The increase in data availability and computational power have led to a revolution in object recognition. Modern object recognition algorithms combine deep multi-layer architectures with large datasets in order to achieve state-of-the-art recognition performance \cite{imagenet,sermanet13,simonyan2014very}. A main advantage of such learning architectures stems from the architectural ability to increase modeling capacity (e.g. network parameters and depth) in a straightforward manner. At the same time, boosted detectors \cite{vj,6977320,dollar2012pedestrian} remain highly successful for fast detection of objects \cite{zhang2015efficient,de2014combinator,tenyerspeds,gpuicf,zhang2014center,jones2008pedestrian,icf,acostea,DollarPAMI14pyramids,ldcf,vehicles_TITS15,spatialpooleecv,ccf,compACT,costea2015fast}. The Viola and Jones \cite{vj} learning architecture has remained largely unchanged, with boosting \cite{boost} used for training a cascade of weak learners (e.g. decision trees). State-of-the-art pedestrian detectors often employ such models \cite{DollarPAMI14pyramids}, while pursuing improved feature representations in order to achieve detection performance gains \cite{tenyerspeds,ldcf}. Despite being a different learning architecture compared to the modern Convolutional Network (CNN) \cite{imagenet}, the boosted decision tree model also allows for a straightforward increase in modeling capacity for handling large datasets (Fig. \ref{fig:fig1}). Motivated by this observation, we perform an extensive set of experiments designed to better understand the limitations of the commonly employed boosted decision trees model. The large Caltech pedestrian benchmark \cite{dollar2012pedestrian} is suitable for such a task, with some preliminary work \cite{ldcf,checkerboard} showing significant performance gains by increasing dataset size and modeling capacity of the weak learners. \begin{figure}[!t] \centering \begin{tabular}{c} \includegraphics[trim =0mm 95mm 11mm 0mm, clip=true,width=3.4in]{mainfig.pdf} \end{tabular} \caption{By varying dataset properties with different augmentation techniques (a scaling example is shown) and model capacity (tree depth), we study limitations of the boosted decision tree classifier. Consequently, the insights revealed are employed in order to train state-of-the-art pedestrian and face detectors.} \label{fig:fig1} \end{figure} \begin{figure}[!t] \centering \begin{tabular}{c} \includegraphics[width=3.4in]{cr2anno.pdf} \end{tabular} \caption{Comparison of our key results (in thick lines, ACF++ and LDCF84++) with published methods on the Caltech test set. Our version of the popular ACF and LDCF models demonstrate large gains in detection performance over the baselines with no significant modifications to the model or feature extraction pipeline.} \label{fig:usareason} \end{figure} In particular, the contributions of this work are as follows. \textbf{Limitations of a classifier}: The relationship between increasing the modeling capacity of the decision trees jointly with dataset size has been established in previous literature \cite{boost,ldcf,Das_ITSC14}, yet its limits have not been fully explored. Surveying current literature, we found inconsistent or limited usage of this relationship in boosting for object detection. In particular, it is not known whether the modeling capacity has saturated or whether it can be further increased with additional data for the detection task. Therefore, we sought to perform a rigorous study with the relationship between dataset size and model capacity as the main research question. In the process of studying this problem, insights regarding the limitations of the model arise. The conclusion of this study is mostly negative, as increasing the modeling capacity of the weak learners in the current boosted decision tree detector provides limited generalization power. Saturation of performance occurs quickly, with no further gains shown with additional data augmentation. Therefore, architectural changes are needed in order to resolve the issue of efficiently increasing modeling capacity in the boosted tree classifier. \textbf{Performance gains}: The experiments in this paper result in consistent gains in object detection performance, insights into optimal dataset properties, and best training practices on Caltech. For instance, we demonstrate that the commonly employed video-based augmentation \cite{ldcf,checkerboard} on the Caltech training set is limited when compared to other augmentation options. With no significant modifications to the learning or feature extraction pipelines, we improve over the Aggregate Channel Feature (ACF) detector \cite{DollarPAMI14pyramids} baseline by $\sim$10\% points while still employing the 10 HOG+LUV feature channels. A simple filtering of the channels with 4 filter banks (LDCF \cite{ldcf}) results in the best performing non-CNN detector on Caltech to date. The results of the study are shown to generalize to face detection as well. Note that we intentionally avoid using deep CNN features here, as these often involve training on a large external data. On the other hand, simple channel features \cite{DollarPAMI14pyramids} allow for isolation of the strengths, limitations, and the role of the dataset on the boosting classifier. Furthermore, the careful examination of data augmentation and model capacity allows for a more appropriate comparison between CNN (where extensive data augmentation is commonly employed) and non-CNN detectors on datasets such as Caltech. We hope the more meaningful comparison will motivate future developments in object detection. We also note that several recent CNN-based models on Caltech \cite{hosang2015taking,rotfilt,deepparts} make use of the boosted trees classifier. \section{Experimental Settings} \subsection{Boosting Framework} \label{subsec:boost} This section presents the tools that will be used for the remainder of the study. Boosting \cite{boost} involves greedily minimizing a loss function for the following classification rule \begin{equation} \mathbf{H}(\mathbf{x}) = \sum_t \alpha_t \mathbf{h_t}(\mathbf{x}) \end{equation} where $\mathbf{h_t}(\mathbf{x})$ are weak learners, $\alpha_t$ are scalars, and $\mathbf{x} \in \mathbb{R}^K$ is a feature vector. In this work, we employ the commonly used soft cascade with decision trees as the weak learners \cite{bourdev2005robust,bagging2}. These are composed of decision stumps such that each non-leaf node $j$ produces a binary decision using a feature index $k$, a threshold $\tau \in \mathbb{R}$, and a polarity $p \in \{\pm 1 \}$, $h_j(\mathbf{x}) \equiv p_j sign(\mathbf{x}[k_j] - \tau_j)$. An important parameter is the maximum tree depth, which was generally taken to be 2 for object detection, yet recent studies \cite{ldcf,checkerboard,spatialpool} propose depths of 3-4 as suitable to accommodate an increase in dataset size. Hence, our first issue is efficient training of boosted models on large datasets. The need for quick training is key to algorithmic development and competitive performance, especially when considering current state-of-the-art CNN object detections are trained on millions of samples. \textbf{Training with randomness}: In this work, we adopt the quick boosting approach from \cite{quickboost}. Because stump training is costly, $\mathcal{O}(K \times N)$ for $K$ features and $N$ samples, a common practice is to quantize feature values into bins (256 in this work) and sample a random subset of the features when searching for the optimal feature index. Most approaches employ the ACF detector \cite{DollarPAMI14pyramids}, which samples 1/16 of the total feature set in each iteration. We observed significant variation in performance over multiple runs with this random sampling strategy, by up to 3-4\%. This is an issue, yet an appropriate discussion was not found in related literature. Therefore, we modify the last stage out of four of generating hard negatives with increasing number of weak classifiers, $[ 64, 256, 1024, 4096]$. In the last stage, the feature set is exhaustively searched over for the \textit{initial 512 weak learners}, after which random sampling of 1/16 is followed. This procedure was found to be necessary for careful analysis, and it balances reproducibility with speed (unlike the very slow exhaustive search in all iterations \cite{checkerboard}) reducing variability to within $\sim$1\% in performance. In experiments where significance is uncertain, multiple random seeds are used for training initialization, with the best one shown. Batch training is another possible direction which we leave for future work. \subsection{Augmentation Techniques} \label{subsec:augment} As previously mentioned in Section \ref{sec:intro}, large gains in boosting-based pedestrian detection came from dataset size increase and increased depth of the decision tree (introduced in Nam \textit{et al.} \cite{ldcf}), although the design choices for these have not been well justified or studied. Consequently, existing state-of-the-art detectors employ dense frame sampling (e.g. sampling every $3^{rd}$ frame resulting in a ten-fold increase in dataset size, Caltech$\times10$), yet this type of video-based augmentation will be shown to present several issues leading to sub-optimal detector performance. Identifying the most successful augmentation techniques is essential, as the increased dataset size regularizes training of models with increased capacity. We note that others have studied data augmentation, specifically for pedestrian detection, but mostly with a goal of lowering annotation effort (i.e. render pedestrian images into real backgrounds \cite{6977491,vazquez2012unsupervised}) and not improved performance In addition to sampling more frames from the Caltech videos, the following augmentations are studied: \textbf{Color}: Color alteration has been proposed in \cite{imagenet} using Principal Component Analysis (PCA) on the RGB pixel values in the training set. Specifically, a random Gaussian variable, $\alpha \in \mathbb{R}^3$ is drawn and the quantity $[\mathbf{p_1},\mathbf{p_2},\mathbf{p_3}] [\alpha_1 \lambda_1,\alpha_2\lambda_2,\alpha_3\lambda_3]$, where $\mathbf{p_i}$ and $\lambda_i$ are eigenvector-eigenvalue pairs, is added to the RGB image pixels. \textbf{Flipping}: Most current trained detectors employ horizontal mirroring of images in order to double the number of positive samples. \textbf{Translation (T)}: Two main parameters, namely the maximum amount of pixel shift allowed ($m$) and the sampling intervals ($n$), determine how many additional positive samples are generated. We note these in the experiments as T$nm$. For instance, T31 generates 4 additional samples at 1 pixel shift in each direction (west/east/north/south). \textbf{Scale+Crop (S)}: As experiments began, we discovered high sensitivity of the classifier to even small noise injected in the ground truth location. As an alternative to translation, we propose to scale each positive sample by a factor (either in the horizontal, vertical, or both directions), re-center, and crop it (shown in Fig. \ref{fig:fig1}). Hence, the procedure is slightly different from the common cropping employed in training CNN detectors (corner/center cropping). This augmentation is similar to slight ground truth width/height jitter without changes to the center of the box. \textbf{Occlusion}: Occlusion handling is an important challenge for pedestrian detection \cite{whyandwhen,ohnbar_pedspatterns15}. Incorporation of samples with higher levels of occlusion is another technique for increasing dataset size and studying generalization capability. \textbf{FG/BG Transfer}: The visibility masks of pedestrians in Caltech can be employed in order to transfer foreground/background between images in the dataset. \subsection{Model Settings} Our training settings specify a model size of 41 $\times$ 100 pixels. With padding, the sliding window becomes 64 $\times$ 128 pixels. In order to deal with smaller pedestrians (`reasonable' test settings involve pedestrians of height 50 pixels and up), we upsample the images by one octave. Most of the augmentation experiments will be performed on Caltech$\times3$ (sampling every $10^{th}$ frame from video), but higher samplings of Caltech$\times7.5$ (every $4^{th}$ frame), Caltech$\times15$, and Caltech$\times30$ (every frame) sampling will also be studied. \section{Experimental Analysis} \label{sec:expeval} This section demonstrates the importance of data augmentation, impact of augmentation type, and significance of increased weak classifier model capacity in training a generalizable pedestrian detector. All results are measured in log-average miss rate (a lower value corresponds to better detection performance) as described in \cite{dollar2012pedestrian}. \textbf{Baseline and notation}: Our experiments begin with Fig. \ref{fig:finalcurves}(a), where we first verify the impact of randomness with multiple random seeds in training (see Section \ref{subsec:boost}) on performance variation using Caltech$\times3$. The $L3N50$ model is the commonly trained maximum depth 3 model using the available implementation of \cite{dollar2012pedestrian} with 50k total negative samples (in each hard negative mining round we collect N/2 samples and replace these hard samples so that no more than N samples are trained over in a given round). We note that the only form of augmentation from Section \ref{subsec:augment} commonly employed in training boosting-based pedestrian detectors besides higher frame sampling from video is flip augmentation. Hence, flip augmentaiton is included in the $L3N50$ baseline. It achieves comparable results to the best known ACF results on Caltech of 29.76\% log-average miss rate (Fig. \ref{fig:usareason}). \begin{figure*}[!t] \centering \begin{tabular}{ccc} \includegraphics[width=2in]{baseline_stabilze.pdf} & \includegraphics[width=2in]{d3jitteranalysis.pdf} & \includegraphics[width=2in]{d5jitteranalysis.pdf} \\ (a) & (b) & (c) \end{tabular} \caption{Experimental analysis of different training settings on Caltech pedestrians using Caltech$\times3$. } \label{fig:finalcurves} \end{figure*} \begin{figure*}[!t] \centering \begin{tabular}{ccc} \includegraphics[width=2in]{d5x7pt5.pdf} & \includegraphics[width=2in]{d6_samp0201.pdf} & \includegraphics[width=2in]{finalcurves.pdf} \\ (a) & (b) & (c) \end{tabular} \caption{Experimental analysis of different training settings on Caltech pedestrians using additional video augmentation (Caltech$\times7.5$ unless stated).} \label{fig:finalcurves_caltech10} \end{figure*} \textbf{Flip augmentation}: Surprisingly, Fig. \ref{fig:finalcurves}(a) depicts how the removal of the flip augmentation in the $L3N50$ baseline results in a significant reduction in log-average miss rate from 29.28\% to 26.67\%! The reason for the performance reduction becomes apparent immediately, when aspect ratio (ar) standardization (used in training/testing all current object detectors on Caltech \cite{dollar2012pedestrian}) is removed during training in $L3N50/ar$. Specifically, the standardization is useful in training since it is enforced in evaluation, yet it leads to non-aligned bounding boxes. Flipping these boxes introduces additional poorly-aligned samples which the boosting model does not handle well, even with increased modeling capacity in later stages of the experiments (depth 5 or more models). The solution is simple, either train $L3N50/ar$ models (without aspect ratio standardization and with flip augmentation) or remove flipped sampling ($L3N50/flip$). Since this is a one-time initial modification, we slightly rename our `new baselines', so that $L3N50$ refers to $L3N50/flip$ (without flip, with aspect ratio standardization of training samples) and $L3N50*$ refers to $L3N50/ar$ (with flip, no aspect standardization). The two are shown to perform similarly in Figs. \ref{fig:finalcurves}(a) and \ref{fig:finalcurves}(b) (yet $L3N50/flip$ is faster to train as it contains half the samples). We note that this observation was not made in any of the related research studies, and consequently not employed by top performing boosted detectors. \textbf{Additional augmentation}: Depicted in Fig. \ref{fig:finalcurves}(b), the $L3N50$ and the $L3N50*$ models do not benefit from color augmentation, but do benefit from the scaling+crop scheme (best with a scaling factor of $S1.1$ in horizontal, vertical, and both directions) and translation augmentation (by 1 pixel shifts, $T31$). These experiments were run multiple times with different random seeds to ensure statistical significance. The improvements will be shown to be more dramatic with increased modeling capacity (deeper trees). We make two final notes, increasing the number of negatives to $L3N100$ does not further improve performance, and overall performance has reached a plateau. Therefore, the modeling capacity is increased in $L5N50$. \textbf{Increased model capacity}: Still on Caltech$\times~3$, the analysis of Fig. \ref{fig:finalcurves}(c) demonstrates a consistent trend with the previous experiments. Note how flip augmentation in $L5N50+flip$ is still not beneficial, but it is much better handled. The best results are reported in Fig. \ref{fig:finalcurves}(c). We observe a significant jump in performance reaching 20.85\% with the fast ACF model. These are the best reported results to date (nearly optimal from our experiments). Scaling is shown to be more useful than translation, as even slight off-center shifts hinder performance and are not handled well by the classifier. This is encouraging, yet we begin to understand how limited the boosting model is in sensitivity to dataset properties. Samples with even minimal occlusion and FG/BG transfer were also not shown to be beneficial for increasing the dataset size. Furthermore, we experimented with addition of external pedestrian datasets (e.g. ETH \cite{eth}) and increasing tree depth, but no benefit was shown. \textbf{Video augmentation}: A main conclusion is that very little video augmentation (Caltech$\times3$ vs. Caltech$\times10$ in current state-of-the-art detectors \cite{checkerboard,ccf,ldcf}) was needed to reach best performance. Denser sampling of every $4^{th}$ frame is shown in Fig. \ref{fig:finalcurves_caltech10}(a), demonstrating an interesting trend. First, we must increase the number of negatives to $200k$ ($N200$) to reach comparable performance. This fact exposes another known limitation of currently used boosting models which is not reported in related research, one of dataset imbalance. This is necessary for implicitly regularizing deeper models (shown up to depth 8 in Fig. \ref{fig:finalcurves_caltech10}(a)). Second, we observe that the $S1.1$ scheme provides consistent improvements across different video sampling strategies and model choices (Fig. \ref{fig:finalcurves_caltech10}(b)). This demonstrates the sub-optimal yet commonly employed procedure of video augmentation. Third, additional augmentation or increased model capacity does not improve over the 20.69\% of $L5N200$. To ensure no further gains can be made, we further increase tree depth to 6 to handle additional data and further increase dataset in Fig. \ref{fig:finalcurves_caltech10}(b), with no visible improvement. Increasing tree depth beyond 6 leads to overfitting behavior, and additional data must be sampled (although our experiments show no final gains). \textbf{Better features}: The achieved 20.69\% miss rate is the best known ACF results to date, nearly matching the more computationally intensive feature-rich Checkerboards (CB) detector \cite{zhang2015filtered} (18.47\% miss rate). CB employs 61 filters \textit{for each} of the 10 core HOG+LUV channels, resulting in significant increase to computational requirements. To further study the proposed modifications, we extract features using 4 $8 \times 8$ LDCF filters \cite{ldcf} computed using PCA eigenvectors of feature patches (referred to as the \textbf{LDCF84} model). The method still runs 5 times faster than the CB comparison, while reaching a 17.15\% miss rate. This demonstrates the generalization of the proposed best practices to other, feature-rich approaches as well. As a final experiment, we report results without the approximation of features in the multi-scale feature pyramid \cite{DollarPAMI14pyramids}. This allows for a more clear performance comparison against other methods \cite{rotfilt,zhang2015filtered} which do not employ approximation. The gains are even more impressive, reaching 15.40\% with a light-weight LDCF84 model, significantly outperforming CB. \textbf{Summary}: Despite impressive gains in performance stemming from simple, intuitive, and theory-driven considerations in training, the boosted detector can only handle mild deformations as augmentation. For instance, color jitter is not helpful, flipping is problematic (and removed in most of the experiments without reduction in performance), and slight translation shifts produce a more difficult learning task that is not modeled well even with deeper trees. In order to address these limitations, we proposed to use an augmentation technique which maintains centered ground truth boxes. Dataset size is key in training deeper trees, yet performance saturates at depth 5/6 even with extensive augmentation. Hence, unlike additional layers in CNN architectures, further increase of the tree depth provides a limited benefit in terms of classification power. The experiments motivate future work for the effective increase of the modeling capacity of tree models. \textbf{Run-time analysis}: Although not the main focus of the study, we report run-time for the interested reader. The ACF-$L5$ and LDCF84 models run on a CPU at 6.7 and 2.5 frames per second (fps), respectively. These models are significantly faster than all of the top performing feature-rich models, which range in 0.1-1 fps (e.g. CB \cite{checkerboard} runs at 0.5 fps). \subsection{Context Analysis} Context in the form of scene representation is essential for robust pedestrian detection. The deeper tree models are able to better capture relationships between features in the image. In particular, we have observed how deeper models are more likely to select features in the padding area of the model around the pedestrian. As a final limitation experiment on Caltech, we propose to use a location prior model in order to study to limitations of the model in capturing spatial context. First, we studied increasing model padding further with tree depth as means of better representing contextual information, yet this did not impact performance. On the other hand, due to the application domain, it is reasonable to study context in terms of perspective and position of objects. A second approach was shown to improve performance further, hinting that there is still room for future improvements in context modeling. Given a detection, $\mathbf{p} = \begin{bmatrix} x& y& w& h& s\end{bmatrix}^\intercal$, we construct $\mathbf{\phi_p} = \mathbf{p}\mathbf{p}^\intercal$ for each training sample. Consequently, entries in $\mathbf{\phi_p}$ are employed as features for capturing relationship between position, size, confidence features, and their products. The object score, $s$, is recomputed using an SVM \cite{svm} on $\mathbf{\phi_p}$. We note that this generalizes (and outperforms) the approach in \cite{multires}, which only employs a subset of the proposed $\mathbf{\phi_p}$ feature set (setting $\mathbf{\phi_p} = \begin{bmatrix} h^2 & y^2& hy& h& y \end{bmatrix}$). As shown in Fig. \ref{fig:usareason}, context integration consistently improve performance of both the ACF and LDCF84 models by a further 0.5-1\% reduction in miss rate. Hence, there is still room for improvement in order to better capture contextual cues within the models. We term our models, ACF++ and LDCF84++, where the first `+' stands for the final models trained with data augmentation (Fig. \ref{fig:finalcurves_caltech10}), and the second `+' for the contextual reasoning. We observe how the proposed modifications produce consistent improvements over both the ACF and LDCF baselines in Fig. \ref{fig:usareason} by about 10\%. The proposed high-performing models are new baselines in a way, and further gains may be obtained with combined with insights from other studies listed in Fig. \ref{fig:usareason}. \subsection{Results on Caltech-New} The proposed techniques are tested on the improved annotation Caltech pedestrians dataset presented in \cite{rotfilt}, as shown in Table \ref{tab:caltech}. The cleaner annotations have a great impact on training the ACF++ and LDCF++ models, which is consistent with our observations in previous experiments. Consequently, the best detection results to date are achieved among both CNN and non-CNN methods on the challenging MR\SPSB{N}{-4} metric, with a miss rate of 18.29\%. \begin{table}[t!] \centering \caption{Results on the new annotations on Caltech \cite{rotfilt} using log average miss rate over $[10^{-2},10^0]$ and $[10^{-4},10^0]$ (MR\SPSB{N}{-2} and MR\SPSB{N}{-4}, respectively). Our ACF+ (with data augmentation) and ACF++ (with contextual reasoning) is on par with state-of-the-art detectors while enjoying low computational complexity. Our LDCF84++ employs just 4 filters on top of the ACF features and outperforms the VGG baseline by a large margin on the more challenging metric MR\SPSB{N}{-4}. } \label{tab:caltech} \begin{tabular}{|l c|} \hline Method & MR\SPSB{N}{-2} ( MR\SPSB{N}{-4} ) \\ \hline\hline RotatedFilters \cite{rotfilt} & 12.87 (24.10) \\ RotatedFilters+VGG \cite{rotfilt} & \textbf{9.32} (21.72) \\ ACF+ & 15.17 (27.28) \\ ACF++ & 13.27 (25.26) \\ LDCF84+ & 11.76 (21.08) \\ LDCF84++ & {9.71 (\textbf{18.29})} \\ \hline \end{tabular} \end{table} \begin{table}[t!] \centering \caption{Improvement due to incorporation of the insights in this paper when training face detection models.} \label{tab:fddb} \begin{tabular}{|l c|} \hline \multicolumn{2}{|c|}{Results on WIDER-validation} \\ \hline Method & AP (\%) \\ \hline ACF-$L3N50*$ & 27.97 \\ ACF-$L9N200*$ & 34.64 \\ ACF-$L9N200*$+S1.1 (ACF+) & 46.80 \\ LDCF84-$L9N200*$+S1.1 (LDCF+) & \textbf{47.66} \\ \hline \end{tabular} \end{table} \begin{figure*}[!t] \centering \begin{tabular}{ccc} \includegraphics[width=2in]{1.pdf} & \includegraphics[width=2in]{2.pdf} & \includegraphics[width=2in]{3.pdf} \\ Easy set & Moderate set & Hard set \end{tabular} \caption{Results on the test set of the WIDER face dataset \cite{wider} (our curves are shown in red, LDCF+) compared with the current state-of-the-art (updated plots on January 5, 2017), Multiscale Cascade CNN \cite{wider}, Two-stage CNN \cite{wider}, ACF \cite{acfmultiview,DollarPAMI14pyramids}, Faceness \cite{faceness}, Multitask Cascade CNN \cite{DBLP:journals/corr/ZhangZL016}, and CMS-RCNN \cite{DBLP:journals/corr/ZhuZLS16}. Results are shown for the three difficulty settings described in \cite{wider}. Observe the large improvement in performance over the ACF baseline. } \label{fig:widertest} \end{figure*} \begin{figure}[!t] \centering \begin{tabular}{c} \includegraphics[trim =25mm 78mm 29mm 82mm, clip=true,width=3.3in]{fddb_newldcf_2comp.pdf} \end{tabular} \caption{Results on the FDDB \cite{fddbTech} dataset (discrete score evaluation) compared with the state-of-the-art (DP2MFD \cite{DBLP:journals/corr/RanjanPC15}, Faceness \cite{faceness}, HeadHunter \cite{bellsand}, Kumar \textit{et al.} \cite{kumar15}, MultiresHPM \cite{DBLP:journals/corr/GhiasiF15}, ACF-multiscale \cite{acfmultiview}, CCF \cite{ccf}, CascadeCNN \cite{CascadeCNN}, DDFD \cite{ddfd}, NPDFace \cite{npdface}, and Pico \cite{DBLP:journals/corr/abs-1305-4537}). True positive rate at 2000 false positives is shown for each method. Our results significantly improve over previous state-of-the-art with HOG+LUV features \cite{bellsand}, while competing with CNN approaches.} \label{fig:fddb} \end{figure} \subsection{Generalization to Face Detection} \label{sec:faces} The proposed training procedure is applied to face detection on the recently introduced large WIDER face dataset \cite{wider} and the commonly employed FDDB dataset \cite{fddbTech}. Specifically, we do not standardize aspect ratio and further augment the dataset as discussed in Section \ref{sec:expeval}. As shown in Table \ref{tab:fddb} on a validation set, the detection performance improve when up to depth 9 decision trees are employed. This is due to the new challenges in face detection benchmarks (e.g. rotation) not commonly found in pedestrian detection settings. Fig. \ref{fig:fddb} demonstrates consistent gains in performance, resulting in a state-of-the-art face detector (on FDDB, at 2000 false positives, 93.37\% true positive rate is achieved). On the WIDER test set, Fig. \ref{fig:widertest} depicts a large improvement over the ACF baseline results reported in \cite{wider}. The performance gap is larger on the more challenging 'moderate' and 'hard' test sets. \section{Concluding Remarks} This study presented a set of novel experiments aimed at better understanding the boosted decision tree model currently employed for many vision tasks. As CNN-based models employ extensive augmentation, we sought to investigate modifying the boosted detector to handle such augmentation as well. Careful analysis regarding the generalization power and modeling capacity, dataset size and balance, and overfitting handling produced insights as to the performance limits of such detectors, as well as state-of-the-art pedestrian and face detectors. A main takeaway of this work is in the limited representation ability of the boosted model. Unlike CNN models, which consistently benefit from additional modeling capacity (e.g. depth) and data, increasing weak learner complexity saturates early, not allowing for further gains with deeper decision trees even with extensive augmentation. Although careful data augmentation was beneficial, architectural changes for handling large datasets are required on the decision-tree training level for effective increase of modeling capacity. \section{Acknowledgments} We acknowledge support of associated industry partners and thank our UCSD CVRR colleagues, especially Rakesh Rajaram, for helpful discussions. We also thank the reviewers for their constructive comments. \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:07:30', 'yymm': '1701', 'arxiv_id': '1701.01692', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01692'}
arxiv
\section{Introduction} Deep convolutional neural networks (ConvNets) proliferate in current machine vision. One of the biggest bottlenecks in scaling their learning is the need for massive and clean collections of semantic annotations for images. Today, even after five years of success of ImageNet~\cite{Deng2009ImageNetAL}, there is still no publicly available dataset containing an order of magnitude more clean labeled data. To tackle this bottleneck, other training paradigms have been explored aiming to bypass the need of training with expensive manually collected annotations. Examples include unsupervised learning~\cite{Le2012BuildingHF}, self-supervised learning~\cite{Doersch2015,Pinto2016,Zhang2016,Wang2015} and learning from noisy annotations~\cite{Chen2015, Natarajan2013LearningWN}. \begin{figure}[t] \includegraphics[width=1\linewidth]{figure_1.pdf} \caption{Sample images and annotations from the Open Images validation set illustrating the variety of images and the noise in the annotations. We are concerned with the task of training a robust multi-label image classifier from the noisy annotations. While the image annotations are simple lists of classes, our model implicitly learns the structure in the label space. For illustrative purposes, the structure is sketched as a graph with green and red edges denoting strong positive and negative relations. Our proposed approach produces both a cleaned version of the dataset as well as a robust image classifier.} \label{fig:fig1} \end{figure} Most of these approaches make a strong assumption that all annotations are noisy, and no clean data is available. In reality, typical learning scenarios are closer to semi-supervised learning: images have noisy or missing annotations, and a small fraction of images also have clean annotations. This is the case for example, when images with noisy annotations are mined from the web, and then a small fraction gets sent to costly human verification. In this paper, we explore how to effectively and efficiently leverage a small amount of clean annotations in conjunction with large amounts of noisy annotated data, in particular to train convolutional neural networks. One common approach is to pre-train a network with the noisy data and then fine-tune it with the clean dataset to obtain better performance. We argue that this approach does not fully leverage the information contained in the clean annotations. \begin{figure}[t] \includegraphics[width=1\linewidth]{overview.pdf} \caption{High-level overview of our approach. Noisy input labels are cleaned and then used as targets for the final classifier. The label cleaning network and the multi-label classifier are jointly trained and share visual features from a deep convnet. The cleaning network is supervised by the small set of clean annotations (not shown) while the final classifier utilizes both the clean data and the much larger noisy data.} \label{fig:overview} \end{figure} We propose an alternative approach: instead of using the small clean dataset to learn visual representations directly, we use it to learn a mapping between noisy and clean annotations. We argue that this mapping not only learns the patterns of noise, but it also captures the structure in the label space. The learned mapping between noisy and clean annotations allows to clean the noisy dataset and fine-tune the network using both the clean and the full dataset with reduced noise. The proposed approach comprises a multi-task network that jointly learns to clean noisy annotations and to accurately classify images, Figure~\ref{fig:overview}. In particular, we consider an image classification problem with the goal of annotating images with all concepts present in the image. When considering label noise, two aspects are worth special attention. First, many multi-label classification approaches assume that classes are independent. However, the label space is typically highly structured as illustrated by the examples in Figure~\ref{fig:fig1}. We therefore model the label-cleaning network as conditionally dependent on all noisy input labels. Second, many classes can have multiple \emph{semantic modes}. For example, the class coconut may be assigned to an image containing a drink, a fruit or even a tree. To differentiate between these modes, the input image itself needs to be taken into account. Our model therefore captures the dependence of annotation noise on the input image by having the learned cleaning network conditionally dependent on image features. We evaluate the approach on the recently-released large-scale \emph{Open Images Dataset}~\cite{openimages}. The results demonstrate that the proposed approach significantly improves performance over traditional fine-tuning methods. Moreover, we show that direct fine-tuning sometimes hurts performance when only limited rated data is available. In contrast, our method improves performance across the full range of label noise levels, and is most effective for classes having 20\% to 80\% false positive annotations in the training set. The method performs well across a range of categories, showing consistent improvement on classes in all eight high-level categories of Open Images (vehicles, products, art, person, sport, food, animal, plant). This paper makes the following contributions. First, we introduce a semi-supervised learning framework for multi-label image classification that facilitates small sets of clean annotations in conjunction with massive sets of noisy annotations. Second, we provide a first benchmark on the recently released Open Images Dataset. Third, we demonstrate that the proposed learning approach is more effective in leveraging small labeled data than traditional fine-tuning. \section{Related Work} This paper introduces an algorithm to leverage a large corpus of noisily labeled training data in conjunction with a small set of clean labels to train a multi-label image classification model. Therefore, we restrict this discussion to learning from noisy annotations in image classification. For a comprehensive overview of label noise taxonomy and noise robust algorithms we refer to \cite{frenay2014classification}. Approaches to learn from noisy labeled data can generally be categorized into two groups: Approaches in the first group aim to directly learn from noisy labels and focus mainly on noise-robust algorithms, e.g.,~\cite{Beigman2009LearningWA,joulin2016learning,Manwani2013NoiseTU}, and label cleansing methods to remove or correct mislabeled data, e.g.,~\cite{Brodley1999IdentifyingMT}. Frequently, these methods face the challenge of distinguishing difficult from mislabeled training samples. Second, semi-supervised learning (SSL) approaches tackle these shortcomings by combining the noisy labels with a small set of clean labels~\cite{zhu2005semi}. SSL approaches use label propagration such as constrained bootstrapping~\cite{Chen2013} or graph-based approaches~\cite{fergus2009semi}. Our work follows the semi-supervised paradigm, however focusing on learning a mapping between noisy and clean labels and then exploiting the mapping for training deep neural networks. \begin{figure*}[t] \centering \includegraphics[width=1\linewidth]{overviewFig_new.pdf} \caption{ Overview of our approach to train an image classifier from a very large set of training samples with noisy labels (orange) and a small set of samples which additionally have human verification (green). The model contains a label cleaning network that learns to map noisy labels to clean labels, conditioned on visual features from an Inception V3 ConvNet. The label cleaning network is supervised by the human verified labels and follows a residual architecture so that it only needs to learn the difference between the noisy and clean labels. The image classifier shares the same visual features and learns to directly predict clean labels supervised by either (a) the output of the label cleaning network or (b) the human rated labels, if available.} \label{fig:architecture} \end{figure*} Within the field of training deep neural networks there are three streams of research related to our work. First, various methods have been proposed to explicitly model label noise with neural networks. Natarajan et al.~\cite{Natarajan2013LearningWN} and Sukhbaatar et al.~\cite{sukhbaatar2015training} both model noise that is conditionally independent from the input image. This assumption does not take into account the input image and is thus not able to distinguish effectively between different visual modes and related noise. The closest work in this stream of research is from Xiao et al.~\cite{Xiao2015LearningFM} that proposes an image-conditioned noise model. They first aim to predict the type of noise for each sample (out of a small set of types: no noise, random noise, structured label swapping noise) and then attempt to remove it. Our proposed model is also conditioned on the input image, but differs from these approaches in that it does not explicitly model specific types of noise and is designed for multiple labels per image, not only single labels. Also related is the work of Misra et al.~\cite{MisraNoisy16} who model noise arising from missing, but visually present labels. While their method is conditioned on the input image and is designed for multiple labels per image, it does not take advantage of cleaned labels and their focus is on missing labels, while our approach can address both incorrect and missing labels. Second, transfer learning has become common practice in modern computer vision. There, a network is pre-trained on a large dataset of labeled images, say ImageNet, and then used for a different but related task, by fine-tuning on a small dataset for specific tasks such as image classification and retrieval~\cite{sharif2014cnn} and image captioning~\cite{Vinyals2015ShowAT}. Unlike these works, our approach aims to train a network from scratch using noisy labels and then facilitates a small set of clean labels to fine-tune the network. Third, the proposed approach has surface resemblance to student-teacher models and model compression, where a student, or compressed, model learns to imitate a teacher model of generally higher capacity or with privileged information~\cite{Ba2014DoDN,buciluǎ2006model,Hinton2015DistillingTK,LopezPaz2015UnifyingDA}. In our framework, we train a ConvNet with two classifiers on top, a cleaning network and an image classifier, where the output of the cleaning network is the target of the image classifier. The cleaning network has access to the noisy labels in addition to the visual features, which could be considered privileged information. In our setup the two networks are trained in one joint model. \section{Our Approach} Our goal is to train a multi-label image classifier using a large dataset with relatively noisy labels, where additionally a small subset of the dataset has human verified labels available. This setting naturally occurs when collecting images from the web where only a small subset can be verified by experts. Formally, we have a very large training dataset $T$ comprising tuples of noisy labels $y$ and images $\mathcal{I}$, $T=\{(y_i,\mathcal{I}_i), ...\}$, and a small dataset $V$ of triplets of verified labels $v$, noisy labels $y$ and images $\mathcal{I}$, $V=\{(v_i, y_i, \mathcal{I}_i), ...\}$. The two sets differ significantly in size with $|T| \gg |V|$. For instance, in our experiments, $T$ exceeds $V$ by three orders of magnitude. Each label $y$ or $v$ is a sparse $d$-dimensional vector with a binary annotation for each of the $d$ classes indicating whether it is present in the image or not. Since the labels in $T$ contain significant label noise and $V$ is too small to train a ConvNet, our goal is to design an efficient and effective approach to leverage the quality of the labels in $V$ and the size of $T$. \subsection{Multi-Task Label Cleaning Architecture} We propose a multi-task neural network architecture that jointly learns to reduce the label noise in $T$ and to annotate images with accurate labels. An overview of the model architecture is given in Figure~\ref{fig:architecture}. The model comprises a fully convolutional neural network~\cite{fukushima1980neocognitron,lecun1998gradient,long2015fully} $f$ with two classifiers $g$ and $h$. The first classifier is a \emph{label cleaning network} denoted as $g$ that models the structure in the label space and learns a mapping from the noisy labels $y$ to the human verified labels $v$, conditional on the input image. We denote the \emph{cleaned labels} output by $g$ as $\hat{c}$ so that $\hat{c} = g\left(y,\mathcal{I}\right)$. The second classifier is an \emph{image classifier} denoted as $h$ that learns to annotate images by imitating the first classifier $g$ by using $g$'s predictions as ground truth targets. We denote the \emph{predicted labels} output by $h$ as $\hat{p}$ so that $\hat{p} = h\left(\mathcal{I}\right)$. The image classifier $h$ is shown in the bottom row of Figure~\ref{fig:architecture}. First, a sample image is processed by the convolutional network to compute high level image features. Then, these features are passed through a fully-connected layer $w$ followed by a sigmoid $\sigma$, $h = \sigma(w(f(\mathcal{I})))$. The image classifier outputs $\hat{p}$, a $d$-dimensional vector $[0,1]^d$ encoding the likelihood of the visual presence of each of the $d$ classes. The label cleaning network $g$ is shown in the top row of Figure~\ref{fig:architecture}. In order to model the label structure and noise conditional on the image, the network has two separate inputs, the noisy labels $y$ as well as the visual features $f(\mathcal{I})$. The sparse noisy label vector is treated as a bag of words and projected into a low dimensional label embedding that encodes the set of labels. The visual features are similarly projected into a low dimensional embedding. To combine the two modalities, the embedding vectors are concatenated and transformed with a hidden linear layer followed by a projection back into the high dimensional label space. Another key detail of the label cleaning network is an identity-skip connection that adds the noisy labels from the training set to the output of the cleaning module. The skip connection is inspired by the approach from He et al.~\cite{he2015deep} but differs in that the residual cleaning module has the visual features as side input. Due to the residual connection, the network only needs to learn the difference between the noisy and clean labels instead of regressing the entire label vector. This simplifies the optimization and enables the network to predict reasonable outputs right from the beginning. When no human rated data is available, the label cleaning network defaults to not changing the noisy labels. As more verified groundtruth becomes available, the network gracefully adapts and cleans the labels. To remain in the valid label space the outputs are clipped to 0 and 1. Denoting the residual cleaning module as $g'$, the label cleaning network $g$ computes cleaned labels \begin{equation} \hat{c} = \texttt{clip}(y + g'(y,f(\mathcal{I})),[0,1]) \end{equation} \subsection{Model Training} \label{sec:modeltraining} To train the proposed model we formulate two losses that we minimize jointly using stochastic gradient descent: a label cleaning loss $\mathcal{L}_{\text{clean}}$ that captures the quality of the cleaned labels $\hat{c}$ and a classification loss $\mathcal{L}_{\text{classify}}$ that captures the quality of the predicted labels $\hat{p}$. The calculation of the loss terms is illustrated on the right side of Figure~\ref{fig:architecture}. The label cleaning network is supervised by the verified labels of all samples $i$ in the human rated set $V$. The cleaning loss is based on the difference between the cleaned labels $\hat{c_i}$ and the corresponding ground truth verified labels~$v_i$, \begin{equation} \mathcal{L}_{\text{clean}} = \sum_{i \in V}|\hat{c_i}-v_i| \end{equation} We choose the absolute distance as error measure, since the label vectors are very sparse. Other measures such as the squared error tend to smooth the labels. For the image classifier, the supervision depends on the source of the training sample. For all samples $j$ from the noisy dataset $T$, the classifier is supervised by the cleaned labels $\hat{c_j}$ produced by the label cleaning network. For samples $i$ where human ratings are available, $i \in V$, supervision comes directly from the verified labels $v_i$. To allow for multiple annotations per image, we choose the cross-entropy as classification loss to capture the difference between the predicted labels $\hat{p}$ and the target labels. \begin{equation} \begin{split} \mathcal{L}_{\text{classify}} = &-\sum_{j \in T}\big[\hat{c_j}\log(\hat{p_j}) + (1-\hat{c_j})\log(1-\hat{p_j}) \big] \\ &-\sum_{i \in V}\big[v_i\log(\hat{p_i}) + (1-v_i)\log(1-\hat{p_i}) \big] \end{split} \label{equ:classifyloss} \end{equation} \begin{table}[t] \centering \caption{\label{tab:verticals}Breakdown of the ground-truth annotations in the validation set of the Open Images Dataset by high-level category. The dataset spans a wide range of everyday categories from manmade products to personal activities as well as coarse and fine-grained natural species.} \begin{tabular}{@{}lll@{}} \toprule \text{high-level category} & \text{unique labels}& \text{annotations} \\ \midrule \text{vehicles} & 944 & 240,449\\ \text{products} & 850 & 132,705\\ \text{art} & 103 & 41,986\\ \text{person} & 409 & 55,417\\ \text{sport} & 446 & 65,793\\ \text{food} & 862 & 140,383\\ \text{animal} & 1064 & 187,147\\ \text{plant} & 517 & 87,542 \\ \text{others} & 1388 & 322,602 \\\bottomrule \end{tabular} \end{table} It is worth noting that the vast majority of training examples come from set $T$. Thus, the second summation in Equation~\ref{equ:classifyloss} dominates the overall loss of the model. To prevent a trivial solution, in which the cleaning network and classifier both learn to predict label vectors of all zeros, $\hat{c_j}=\hat{p_j}=\{0\}^d$, the classification loss is only propagated to $\hat{p_j}$. The cleaned labels $\hat{c_j}$ are treated as constants with respect to the classification and only incur gradients from the cleaning loss. To train the cleaning network and image classifier jointly we sample training batches that contain samples from $T$ as well as $V$ in a ratio of $9:1$. This allows us to utilize the large number of samples in $T$ while giving enough supervision to the cleaning network from $V$. \section{Experiments} \subsection{Dataset} We evaluate our proposed model on the recently-released Open Images dataset~\cite{openimages}. The dataset is uniquely suited for our task as it contains a very large collection of images with relatively noisy annotations and a small validation set with human verifications. The dataset is multi-label and massively multi-class in the sense that each image contains multiple annotations and the vocabulary contains several thousand unique classes. In particular, the training set contains 9,011,219 images with a total of 79,156,606 annotations, an average of 8.78 annotations per image. The validation set contains another 167,056 images with a total of 2,047,758 annotations, an average of 12.26 annotations per image. The dataset contains 6012 unique classes and each class has at least 70 annotations over the whole dataset. \begin{figure}[t] \begin{center} \begin{tabular}{@{}c@{}c@{}} \includegraphics[width=0.5\linewidth]{label_frequencies.pdf} & \includegraphics[width=0.5\linewidth]{label_qualities.pdf} \\ (a) Class frequencies & (b) Annotation quality \end{tabular} \end{center} \vspace{-5pt} \caption{\label{fig:stats}Label statistics for the Open Images dataset. Classes are ordered by frequency and annotation quality respectively. (a) Classes are heavily skewed in terms of number of annotations, e.g., "vehicle" occurs over 900,000 times whereas "honda nsx" only occurs 70 times. (b) Classes also vary significantly in annotation quality which refers to the probability that an image labeled with a class actually contains that class. Overall, more than 70\% of the $\sim$80M annotations in the dataset are correct and common classes tend to have higher annotation quality.} \vspace{-10pt} \end{figure} One key distinction from other datasets is that the classes in Open Images are not evenly distributed. Some high-level classes such as `vehicle` have over 900,000 annotations while many fine-grain classes are very sparse, e.g.,~`honda nsx` only occurs 70 times. Figure~\ref{fig:stats}(a) shows the distribution of class frequencies over the validation set. Further, many classes are highly related to each other. To differentiate our evaluation between clusters of semantically closely related classes, we group classes with respect to their associated high-level category. Table~\ref{tab:verticals} gives an overview of the main categories and their statistics over the validation set. Besides the uneven distribution of classes, another key distinction of the dataset is annotation noise. The training ground-truth comes from an image classifier similar to Google Cloud Vision API\footnote{\text{https://cloud.google.com/vision/}}. Due to the automated annotation process, the training set contain a considerable amount of noise. Using the validation set to estimate the annotation quality, we observe that 26.6\% of the automatic annotations are considered false positives. The quality varies widely between the classes. Figure~\ref{fig:stats}(b) shows the distribution of the quality of the automated annotations. While some classes only have correct annotations, others do not have any. However, the noise is not random, since the label space is highly structured, see Figure~\ref{fig:fig1} for examples. For our experiments, we use the training set as large corpus of images with only noisy labels $T$. Further, we split the validation set into two parts: one quarter of about 40 thousand images is used in our cleaning approach providing both noisy and human verified labels $V$. The remaining three-quarters are held out and used only for validation. \subsection{\label{section:metrics}Evaluation Task and Metrics} We evaluate our approach using multi-label image classification, i.e.,\ predicting a score for each class-image pair indicating the likelihood the concept described by the class is present in the image. There is no standard evaluation procedure yet for classification on the Open Images dataset. Thus, we choose the widely used average precision (AP) as metric to evaluate performance. The AP for each class $c$ is \begin{equation} AP_c = \frac{\sum_{k = 1}^{N}\text{Precision}(k,c)\cdot \text{rel}(k,c)}{\text{number of positives}} \end{equation} where Precision($k,c$) is the precision for class $c$ when retrieving $k$ annotations and rel($k,c$) is an indicator function that is $1$ iff the ground truth for class $c$ and the image at rank $k$ is positive. $N$ is the size of the validation set. We report the mean average precision (MAP) that takes the average over the APs of all $d$, 6012, classes, $MAP = 1/d \sum_{c=1}^{d}AP_c$. Further, because we care more about the model performance on commonly occurring classes we also report a class agnostic average precision, $AP_{all}$. This metric considers every annotation equally by treating them as coming from one single class. Evaluation on Open Images comes with the challenge that the validation set is collected by verifying the automatically generated annotations. As such, human verification only exists for a subset of the classes for each image. This raises the question of how to treat classes without verification. One option is to consider classes with missing human-verification as negative examples. However, we observe that a large number of the highly ranked annotations are likely correct but not verified. Treating them as negatives would penalize models that differ substantially from the model used to annotate the dataset. Thus, we choose instead to ignore classes without human-verification in our metrics. This means the measured precision at full recall for all approaches is very close to the precision of the annotation model, see the PR curve in Figure~\ref{fig:prcurves}(a). \begin{table}[t] \centering \caption{\label{tab:results_overall}Comparison of models in terms of AP and MAP on the held out subset of the Open Images validation set. Our approach outperforms competing methods. See Sections~\ref{section:metrics} and~\ref{section:baselines} for more details on the metrics and model variants.} \begin{tabular}{@{}lll@{}} \toprule Model & $AP_{all}$ & $MAP$ \\ \midrule Baseline & 83.82 & 61.82\\ Misra et al.~\cite{MisraNoisy16} visual classifier & 83.55 & 61.85\\ Misra et al.~\cite{MisraNoisy16} relevance classifier & 83.79 & 61.89\\ Fine-Tuning with mixed labels & 84.80 & 61.90\\ Fine-Tuning with clean labels & 85.88 & 61.53\\ \textbf{Our Approach} with pre-training & \textbf{87.68} & 62.36\\ \textbf{Our Approach} trained jointly & 87.67 & \textbf{62.38}\\ \bottomrule \end{tabular} \vspace{-7pt} \end{table} \subsection{\label{section:baselines}Baselines and Model Variants} As baseline model for our evaluation we train a network solely on the noisy labels from the training set. We refer to this model as \textbf{baseline} and use it as the starting point for all other variants. We compare the following approaches. \noindent \textbf{Fine-tune with clean labels}: A common approach is to use the clean labels directly to supervise the last layer. This approach converges quickly because the dataset for fine-tuning is very small; however, many classes have very few training samples making it prone to overfitting. \begin{figure}[t] \centering \includegraphics[width=0.9\linewidth]{boxesnew.pdf} \caption{Performance gain of our approach with respect to how common a class is and how noisy its annotations are in the dataset. We sort the classes along the x-axis, group them into 10 equally sized groups and compute the MAP gain over the baseline within each group. (a) Most effective is our approach for classes that occur frequently. (b) Our approach improves performance across all levels of annotation quality. It shows the largest gain for classes with 20\% to 80\% false annotations, classes that contain sufficient negative and positive examples in the human rated set.} \label{fig:qual_impr} \vspace{-10pt} \end{figure} \noindent \textbf{Fine-tune with mix of clean and noisy labels}: This addresses the shortcomings of limited training samples. We fine-tune the last layer with a mix of training samples from the small clean and the large noisy set (in a 1 to 9 ratio). \begin{table*}[t] \centering \caption{\label{tab:results_verticals_map}Mean average precision for classes grouped according to high-level categories of the Open Images Dataset. Our method consistently performs best across all categories.} \begin{tabular}{@{}llllllllll@{}} \toprule \text{Model} & \text{vehicles} & \text{products} & \text{art} & \text{person} & \text{sport} & \text{food} & \text{animal} & \text{plant} \\ \midrule Baseline & 56.92 & 61.51 & 68.28 & 59.46 & 62.84 & 61.79 & 61.14 & 59.00 \\ Fine-Tuning with mixed labels & 57.00 & 61.56 & 68.23 & 59.49 & 63.12 & 61.77 & \textbf{61.27} & 59.14 \\ Fine-Tuning with clean labels & 56.93 & 60.94 & 68.12 & 58.39 & 62.56 & 61.60 & 61.18 & 58.90 \\ \textbf{Our Approach} with pre-training & 57.15 & \textbf{62.31} & 68.89 & 60.03 & 63.60 & \textbf{61.87} & 61.26 & \textbf{59.45} \\ \textbf{Our Approach} trained jointly & \textbf{57.17} & \textbf{62.31} & \textbf{68.98} & \textbf{60.05} & \textbf{63.61} & \textbf{61.87} & \textbf{61.27} & 59.36 \\ \bottomrule \end{tabular} \end{table*} \begin{figure*}[t] \begin{center} \begin{tabular}{@{}c@{}c@{}c@{}} \includegraphics[width=0.33\linewidth]{pr_curves_all_mids.pdf} & \includegraphics[width=0.33\linewidth]{pr_curves_products.pdf} & \includegraphics[width=0.33\linewidth]{pr_curves_animal.pdf} \\ (a) all classes & (b) products & (c) animal \\ \end{tabular} \end{center} \vspace{-7pt} \caption{\label{fig:prcurves}Precision-recall curves for all methods measured over all annotations and for the major categories of products and animals. In general, our method performs best, followed by fine-tuning with clean labels, fine-tuning with a mix of clean and noisy labels, and the baseline model. Over all classes, we see improvements across all confidence levels. For products the main improvements come from annotations with high-confidence. For animals we observe mainly gains in the lower confidence regime. It is worthy of note there is virtually no difference between pre-training the cleaning network and learning it jointly.} \vspace{-10pt} \end{figure*} \noindent \textbf{Our approach with pre-trained cleaning network}: We compare two different variants of our approach. Both are trained as described in Section~\ref{sec:modeltraining}. They only differ with respect to their initialization. For first variant, we initially train just the label cleaning network on the human rated data. Then, subsequently we train the cleaning network and the classification layer jointly. \noindent \textbf{Our approach trained jointly}: To reduce the overhead of pre-training the cleaning network, we also train a second variant in which the cleaning network and the classification layer are trained jointly right from the beginning. \noindent \textbf{Misra et al.}: Finally, we compare to the approach of Misra et al.~\cite{MisraNoisy16}. As expected, our method performs better since their model does not utilize the clean labels and their noise model focuses only on missing labels. \subsection{Training Details} For our base model, we use an Inception v3 network architecture~\cite{szegedy2015rethinking}, implemented with TensorFlow~\cite{abadi2016tensorflow} and optimized with RMSprop~\cite{tieleman2012lecture} with learning rate $0.045$ and exponential learning rate decay of $0.94$ every $2$ epochs. As only modification to the architecture we replace the final softmax with a 6012-way sigmoid layer. The network is supervised with a binary cross-entropy loss. We trained the baseline model on 50 NVIDIA K40 GPUs using the noisy labels from the Open Images training set. We stopped training after 49 million mini-batches (with 32 images each). This network is the starting point for all model variants. The four different fine-tuning variants are trained for additional 4 million batches each. The learning rate for the last classification layer is initialized to $0.001$. For the cleaning network it is set higher to $0.015$, because its weights are initialized randomly. For the approach with pre-trained cleaning network, it is first trained with a learning rate of $0.015$ until convergence and then set to $0.001$ once it is trained jointly with the classifier. To balance the losses, we weight $\mathcal{L}_{\text{clean}}$ with $0.1$ and $\mathcal{L}_{\text{classify}}$ with $1.0$. \begin{figure*}[t] \centering \includegraphics[width=1\linewidth]{examples.pdf} \caption{Examples from the hold-out portion of the Open Images validation set. We show the top 5 most confident predictions of the baseline model, directly fine-tuning on clean labels and our approach, along with whether the prediction is correct of incorrect. Our approach consistently removes false predictions made by the baseline model. Example gains are the removal of `team sport' and recall of `muscle' in the upper left. This is a very typical example as most sport images are annotated with `ball game' and `team sport' in the dataset. Directly fine-tuning achieves mixed results. Sometimes it performs similar to our approach and removes false labels, but for others it even recalls more false labels. This illustrates the challenge of overfitting for directly-finetuning.} \label{fig:examples} \vspace{-10pt} \end{figure*} \subsection{Results} We first analyze the overall performance of the proposed approach. Table~\ref{tab:results_overall} shows mean average precision as well as class agnostic average precision. Generally, performance in terms of $AP_{all}$ is higher than for $MAP$, indicating that average precision is higher for common than for rare classes. Considering all annotations equally, $AP_{all}$, we see clear improvements of all variants over the baseline. Further, the two variants of the proposed approach perform very similar and demonstrate a significant lead over direct fine-tuning. The results in terms of $MAP$ show a different picture. Instead of improving performance, fine-tuning on the clean data directly even hurts the performance. This means the improvement in $AP_{all}$ is due to a few very common classes, but performance in the majority of classes decreases. For many classes the limited number of annotations in the clean label set seems to lead to overfitting. Fine-tuning on clean and noisy annotations alleviates the problem of overfitting, however, at a cost in overall performance. Our approach on the other hand does not face the problem of overfitting. Again, our two variants perform very similar and both demonstrate significant improvements over the baseline and direct fine-tuning. The consistent improvement over all annotations and over all classes shows that our approach is clearly more effective than direct fine-tuning to extract the information from the clean label set. The similar performance of the variants with and without pre-trained cleaning network indicate that pre-training is not required and our approach can be trained jointly. Figure~\ref{fig:examples} shows example results from the validation set. \subsubsection{Effect of label frequency and annotation quality} We take a closer look at how class frequency and annotation quality effects the performance of our approach. Figure~\ref{fig:qual_impr}(a) shows the performance improvement of our approach over the baseline with respect to how common a class is. The $x$-axis shows the 6012 unique classes in increasing order from rare to common. We group the classes along the axis into 10 equally sized groups The result reveals that our approach is able to achieve performance gains across almost all levels of frequency. Our model is most effective for very common classes and shows improvement for all but a small subset of rare classes. Surprisingly, for very rare classes, mostly fine-grained object categories, we again observe an improvement. Figure~\ref{fig:qual_impr}(b) shows the performance improvement with respect to the annotation quality. The x-axis shows the classes in increasing order from very noisy annotations to always correct annotations. Our approach improves performance across all levels of annotation quality. The largest gains are for classes with medium levels of annotation noise. For classes with very clean annotations the performance is already very high, limiting the potential for further gains. For very noisy classes nearly all automatically generated annotations are incorrect. This means the label cleaning network receives almost no supervision for what a positive sample is. Classes with medium annotation quality contain sufficient negative as well as positive examples in the human rated set and have potential for improvement. \subsubsection{Performance on high-level categories of Open Images dataset} Now we evaluate the performance on the major sub-categories of classes in the Open Images dataset. The categories, shown in Table~\ref{tab:verticals}, range from man-made objects such as vehicles to persons and activities to natural categories such as plants. Table~\ref{tab:results_verticals_map} shows the mean average precision. Our approach clearly improves over the baseline and direct fine-tuning. Similar results are obtained for class agnostic average precision, where we also show the precision-recall curves for the major categories of products and animals in Figure~\ref{fig:prcurves}. For products the main improvements come from high-confidence labels, whereas, for animals we observe mainly gains in the lower confidence regime. \section{Conclusion} How to effectively leverage a small set of clean labels in the presence of a massive dataset with noisy labels? We show that using the clean labels to directly fine-tune a network trained on the noisy labels does not fully leverage the information contained in the clean label set. We present an alternative approach in which the clean labels are used to reduce the noise in the large dataset before fine-tuning the network using both the clean labels and the full dataset with reduced noise. We evaluate on the recently released Open Images dataset showing that our approach outperforms direct fine-tuning across all major categories of classes. There are a couple of interesting directions for future work. The cleaning network in our setup combines the label and image modalities with a concatenation and two fully connected layers. Future work could explore higher capacity interactions such as bilinear pooling. Further, in our approach the input and output vocabulary of the cleaning network is the same. Future work could aim to learn a mapping of noisy labels in one domain into clean labels in another domain such as Flickr tags to object categories. \section*{Acknowledgements} We would like to thank Ramakrishna Vedantam for insightful feedback as well as the AOL Connected Experiences Laboratory at Cornell Tech. This work was funded in part by a Google Focused Research Award. {\small \bibliographystyle{ieee}
{'timestamp': '2017-04-11T02:08:23', 'yymm': '1701', 'arxiv_id': '1701.01619', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01619'}
arxiv
\section{Graph-Based Event Detection} \section{Introduction} \label{} Event detection in massive data sets has applications to multiple domains, such as information diffusion or detecting disease outbreaks. In many of these domains, the data has an underlying graph or network structure: for example, an outbreak might spread via person-to-person contact, or the latest trends might propagate through a social network. In the typical, graph-based event detection problem, we are given a graph structure $G=(V,E)$ and a time series of observed counts for each graph node $v_i$, and must detect connected subgraphs where the recently observed counts are significantly higher than expected. For example, public health officials wish to achieve early and accurate detection of emerging outbreaks by identifying connected regions (e.g., subsets of spatially adjacent zip codes $v_i$) with anomalously high counts of disease cases. Assuming that the graph structure is known, various graph-based event detection methods~\citep{patil04} can be used to detect anomalous subgraphs. We review these methods in \S\ref{gbed} below. Typically, however, the network structure is \emph{unknown}. For example, the spread of disease may be influenced not only by spatial adjacency but also by commuting patterns (e.g., individuals work downtown but live in a suburb), contamination of food or water sources, animal migrations, or other factors. Assuming an incorrect graph structure can result in less timely and less accurate event detection, since the affected areas may be disconnected and hence may not be identified as an anomalous subgraph. In such cases, \emph{learning} the correct graph structure (e.g., from historical data) has the potential to dramatically improve detection performance. Thus we consider the graph-based event detection problem in the case where the true graph structure $G_T$ is unknown and must be inferred from data. To learn the graph, we are given a set of training examples $\{D_1 \ldots D_J\}$, where each example $D_j$ represents a different ``snapshot'' of the data when an event is assumed to be occurring in some subset of nodes that is connected given the (unknown) graph structure. We assume that training examples are generated from some underlying distribution on the true latent graph structure, and wish to accurately detect future events drawn from that same distribution. Thus our goal is to learn a graph structure that minimizes detection time and maximizes accuracy when used as an input for event detection. Several recent methods~\citep{Gomez-Redriguez:2010:NetInf,Myers:2010:LSNI, Gomez-Redriguez:2012:MultiTree} learn an underlying graph structure using \emph{labeled} training data, given the true affected subset of nodes $S_j^T$ for each training example $D_j$. However, in many cases labeled data is unavailable: for example, public health officials might be aware that an outbreak has occurred, but may not know which areas were affected and when. Hence we focus on learning graph structure from \emph{unlabeled} data, where the affected subset of nodes $S_j^T$ for each training example is not given, and we observe only the observed and expected counts at each node. In the remainder of this paper, we present a novel framework for graph structure learning from unlabeled data, and show that the graphs learned by our approach enable more timely and more accurate event detection. We support these empirical evaluations with new theoretical results on the consistency of constrained and unconstrained subset scans, as described in \S3 and \S4.4 below. \subsection{Graph-Based Event Detection}\label{gbed} Given a graph $G=(V,E)$ and the observed and expected counts at each graph node, existing methods for \emph{graph-based event detection} can be used to identify the most anomalous connected subgraph. Here we focus on the \emph{spatial scan} framework for event detection, which was first developed by~\citet{kulldorff97a}, building on work by~\citet{naus65} and others, and extended to graph data by~\citet{patil04}. These methods maximize the \emph{log-likelihood ratio statistic} $F(S) = \log \frac{\mbox{Pr}(\mbox{Data} \:|\: H_1(S))}{\mbox{Pr}(\mbox{Data} \:|\: H_0)}$ over connected subgraphs $S$. Searching over connected subgraphs, rather than clusters of fixed shape such as circles~\citep{kulldorff97a} or rectangles~\citep{neill04b}, can increase detection power and accuracy for irregularly shaped spatial clusters. In this paper, we assume that the score function $F(S)$ is an \emph{expectation-based scan statistic}~\citep{neill05b}. The null hypothesis $H_0$ assumes that no events are occurring, and thus each observed count $x_i$ is assumed to be drawn from some distribution with mean equal to the expected count $\mu_i$: $x_i \sim \mbox{Dist}(\mu_i)$. The alternative hypothesis $H_1(S)$ assumes that counts in subgraph $S$ are increased by some constant multiplicative factor $q>1$: $x_i \sim \mbox{Dist}(q\mu_i)$ for $v_i \in S$, and $x_i \sim \mbox{Dist}(\mu_i)$ for $v_i \not\in S$, where $q$ is chosen by maximum likelihood estimation. We further assume that $\mbox{Dist}$ is some distribution in the \emph{separable exponential family}~\citep{neill-ltss}, such as the Poisson, Gaussian, or exponential. This assumption enables efficient identification of the highest-scoring connected subgraph and highest-scoring unconstrained subset, which will be important components of our graph structure learning framework described below. Our evaluation results below assume the expectation-based Poisson statistic~\citep{neill05b}. In this case, the log-likelihood ratio score can be computed as $F(S) = C \log (C/B) + B - C$, if $C>B$, and 0 otherwise, where $C = \sum_{v_i \in S} x_i$ and $B = \sum_{v_i\in S} \mu_i$. Maximizing the log-likelihood ratio statistic $F(S)$ over connected subgraphs is a challenging computational problem for which multiple algorithmic approaches exist. The two main methods we consider in this paper are GraphScan~\citep{speakman14} and Upper Level Sets (ULS)~\citep{patil04}. GraphScan is guaranteed to find the highest-scoring connected subgraph for the expectation-based scan statistics considered here, but can take exponential time in the worst case. ULS scales quadratically with graph size, but is a heuristic that is not guaranteed to find the optimal subgraph. GraphScan requires less than a minute of computation time for a $\sim$100 node graph, and improves detection power as compared to ULS, but is computationally infeasible for graphs larger than $200$ to $300$ nodes~\citep{speakman14}. We also note that the previously proposed FlexScan method \citep{tango05} identifies subgraphs nearly identical to those detected by GraphScan, but is computationally infeasible for graphs larger than $\sim$30 nodes. As shown by~\citet{speakman14}, the detection performance of GraphScan and ULS is often improved by incorporating proximity as well as connectivity constraints, thus preventing these methods from identifying highly irregular tree-like structures. To do so, rather than performing a single search over the entire graph, we perform separate searches over the ``local neighborhood'' of each of the $N$ graph nodes, consisting of that node and its $k-1$ nearest neighbors for some constant $k$. We then report the highest-scoring connected subgraph over all local neighborhoods. \section{Problem Formulation} Our framework for graph learning takes as input a set of training examples $\{D_1\ldots D_J\}$, assumed to be independently drawn from some distribution $\mathbf{D}$. For each example $D_j$, we are given the observed count $x_i$ and expected count $\mu_i$ for each graph node $v_i$, $i = 1 \ldots N$. We assume that each training example $D_j$ has an set of affected nodes $S_j^T$ that is a connected subgraph of the true underlying graph structure $G_T$; note that both the true graph $G_T$ and the subgraphs $S_j^T$ are unobserved. Unaffected nodes $v_i \not\in S_j^T$ are assumed to have counts $x_i$ that are drawn from some distribution with mean $\mu_i$, while affected nodes $v_i \in S_j^T$ are assumed to have higher counts. Given these training examples, we have three main goals:\\[1ex] 1) Accurately estimate the true underlying graph structure $G_T$. Accuracy of graph learning is measured by the precision and recall of the learned set of graph edges $G^\ast$ as compared to the true graph $G_T$.\\[1ex] 2) Given a separate set of test examples $\{D_1\ldots D_J\}$ drawn from $\mathbf{D}$, identify the affected subgraphs $S_j^T$. Accuracy of detection is measured by the average overlap coefficient between the true and identified subgraphs.\\[1ex] 3) Distinguish test examples drawn from $\mathbf{D}$ from examples with no affected subgraph ($S_j^T = \emptyset$). Detection power is measured by the true positive rate (proportion of correctly identified test examples) for a fixed false positive rate (proportion of incorrectly identified null examples). \\ \\ The second and third performance measures assume that the learned graph $G^\ast$ is used as an input for a graph-based event detection method such as GraphScan, and that method is used to identify the highest scoring connected subgraph of $G^\ast$ for each test example. A key insight of our graph learning framework is to evaluate the quality of each graph structure $G_m$ ($m$ denotes number of edges in the graph) by comparing the most anomalous subsets detected with and without the graph constraints. For a given training example $D_j$, we can use the fast subset scan~\citep{neill-ltss} to identify the highest-scoring unconstrained subset $S_j^\ast = \arg\max_{S\subseteq V} F(S)$, with score $F_j = F(S_j^\ast)$. This can be done very efficiently, evaluating a number of subsets that is linear rather than exponential in the number of graph nodes, for any function satisfying the linear-time subset scanning property~\citep{neill-ltss}, including the expectation-based scan statistics considered here. We can use either GraphScan~\citep{speakman14} or ULS~\citep{patil04} to estimate the highest-scoring connected subgraph $S_{mj}^\ast = \arg\max_{S \subseteq V:\:S \:\mbox{\small{connected in}}\: G_m} F(S)$, with score $F_{mj} = F(S_{mj}^\ast)$. We then compute the \emph{mean normalized score} $\bar F_{norm}(G_m) = \frac{1}{J} \sum_{j=1\ldots J} \frac{F_{mj}}{F_j}$, averaged over all $J$ training examples, as a measure of graph quality. As noted above, we assume that the affected subset of nodes for each training example is a connected subgraph of the true (unknown) graph structure $G_T$. Intuitively, if a given graph $G_m$ is similar to $G_T$, then the maximum connected subgraph score $F_{mj}$ will be close to the maximum unconstrained subset score $F_j$ for many training examples, and $\bar F_{norm}(G_m)$ will be close to 1. On the other hand, if graph $G_m$ is missing essential connections, then we expect the values of $F_{mj}$ to be much lower than the corresponding $F_j$, and $\bar F_{norm}(G_m)$ will be much lower than 1. Additionally, we would expect a graph $G_m$ with high scores $F_{mj}$ on the training examples to have high power to detect future events drawn from the same underlying distribution. However, any graph with a large number of edges will also score close to the maximum unconstrained score. For example, if graph $G_m$ is the complete graph on $N$ nodes, all subsets are connected, and $F_{mj} = F_j$ for all training examples $D_j$, giving $\bar F_{norm}(G_m) = 1$. Such under-constrained graphs will produce high scores $F_{mj}$ even when data is generated under the null hypothesis, resulting in reduced detection power. Thus we wish to optimize the tradeoff between higher mean normalized score and lower number of edges $m$. Our solution is to compare the mean normalized score of each graph structure $G_m$ to the distribution of mean normalized scores for random graphs with the same number of edges $m$, and choose the graph with the most significant score given this distribution. \section{Theoretical Development} In this section, we provide a theoretical justification for using the mean normalized score, $\bar F_{norm}(G_m) = \frac{1}{J} \sum_{j=1\ldots J} \frac{F_{mj}}{F_j}$, as a measure of the quality of graph $G_m$. Our key result is a proof that the expected value $E\left[\frac{F_{mj}}{F_j}\right] = 1$ if and only if graph $G_m$ contains the true graph $G_T$, assuming a sufficiently strong and homogeneous signal. More precisely, let us assume the following: \\[1ex] \emph{(A1)} Each training example $D_j$ has an affected subset $S_j^T$ that is a connected subgraph of $G_T$. Each $D_j$ is an independent random draw from some distribution $\mathbf{D}$, where each connected subgraph $S_j^T$ is assumed to have some non-zero probability $P_j$ of being affected.\\ \emph{(A2)} The score function $F(S)$ is an expectation-based scan statistic in the separable exponential family. Many distributions, such as the Poisson, Gaussian, and exponential, satisfy this property.\\[1ex] Now, for a given training example $D_j$, we define the \emph{observed excess risk} $g_{ij} = \frac{x_i}{\mu_i}-1$ for each node $v_i$. Let $r_{\max}^{\text{aff},j} = \max_{v_i \in S_j^T} g_{ij}$ and $r_{\min}^{\text{aff},j} = \min_{v_i \in S_j^T} g_{ij}$ denote the maximum and minimum of the observed excess risk over affected nodes, and $r_{\max}^{\text{unaff},j} = \max_{v_i \not\in S_j^T} g_{ij}$ denote the maximum of the observed excess risk over unaffected nodes, respectively. We say that the signal for training example $D_j$ is $\alpha$-strong if and only if $r_{\min}^{\text{aff},j} > \alpha r_{\max}^{\text{unaff},j}$, and we say that the signal for training example $D_j$ is $\alpha$-homogeneous if and only if $r_{\max}^{\text{aff},j} < \alpha r_{\min}^{\text{aff},j}$. We also define the \emph{signal size} for training example $D_j$, $\eta_j = \frac{\sum_{v_i \in S_j^T} \mu_i}{\sum_{v_i} \mu_i} \le 1$. Given assumptions (A1)-(A2) above, we can show: \newtheorem{lemma}{Lemma} \begin{restatable}{lemma}{twolemma} \label{lemma_superset} For each training example $D_j$, there exists a constant $\alpha_j > 1$ such that, if the signal is $\alpha_j$-homogeneous and 1-strong, then the highest scoring unconstrained subset $S_j^{\ast} \supseteq S_j^T$. We note that $\alpha_j$ is a function of $r_{\max}^{\text{aff},j}$, and $\alpha_j \ge 2$ for the Poisson, Gaussian, and exponential distributions. \end{restatable} \begin{restatable}{lemma}{alphalemma} \label{lemma_subset} For each training example $D_j$, there exists a constant $\beta_j > 1$ such that, if the signal is $\frac{\beta_j}{\eta_j}$-strong, then the highest scoring unconstrained subset $S_j^{\ast} \subseteq S_j^T$. We note that $\beta_j$ is a function of $r_{\max}^{\text{unaff},j}$, and $\beta_j \le 2$ for the Gaussian distribution. \end{restatable} \noindent Proofs of Lemma 1 and Lemma 2 are provided in the Appendix. \newtheorem{theorem}{Theorem} \begin{theorem} \label{first_theorem} If the signal is $\alpha_j$-homogeneous and $\frac{\beta_j}{\eta_j}$-strong for all training examples $D_j \sim \mathbf{D}$, then the following properties hold for the assumed graph $G_m$ and true graph $G_T$: a) If $G_T \setminus G_m = \emptyset$ then $E\left[\frac{F_{mj}}{F_j}\right] = 1$. b) If $G_T \setminus G_m \ne \emptyset$ then $E\left[\frac{F_{mj}}{F_j}\right] < 1$. \end{theorem} \begin{proof} Lemmas \ref{lemma_superset} and \ref{lemma_subset} imply that $S_j^{\ast} = S_j^T$ for all $D_j \sim \mathbf{D}$. For part a), $G_T \setminus G_m = \emptyset$ implies that the affected subgraph $S_j^T$ (which is assumed to be connected in $G_T$) is connected in $G_m$ as well. Thus $S_{mj}^{\ast} = S_j^T$, and $\frac{F_{mj}}{F_j} = 1$ for all $D_j \sim \mathbf{D}$. For part b), $G_T \setminus G_m \ne \emptyset$ implies that there exists some pair of nodes $(v_1,v_2)$ such that $v_1$ and $v_2$ are connected in $G_T$ but not in $G_m$. By assumption (A1), the subset $S_j^T = \{v_1,v_2\}$ has non-zero probability $P_j$ of being generated, and we know $S_j^{\ast} = \{v_1,v_2\}$, but $S_{mj}^{\ast} \ne \{v_1,v_2\}$ since the subset is not connected in $G_m$. Since the signal is $\alpha_j$-homogeneous and $\frac{\beta_j}{\eta_j}$-strong, we observe that $S_j^{\ast}$ is the unique optimum. Thus we have $F_{mj} < F_j$ for that training example, and $ E\left[\frac{F_{mj}}{F_j}\right] \le 1-P_j\left(1-\frac{F_{mj}}{F_j}\right) < 1$. \end{proof} \section{Learning Graph Structure} We can now consider the mean normalized score $\bar F_{norm}(G_m) = \frac{1}{J} \sum_{j=1\ldots J} \frac{F_{mj}}{F_j}$ as a measure of graph quality, and for each number of edges $m$, we can search for the graph $G_m$ with highest mean normalized score. However, it is computationally infeasible to search exhaustively over all $2^{\frac{|V|(|V|-1)}{2}}$ graphs. Even computing the mean normalized score of a single graph $G_m$ may require a substantial amount of computation time, since it requires calling a graph-based event detection method such as Upper Level Sets (ULS) or GraphScan to find the highest-scoring connected subgraph for each training example $D_j$. In our general framework for graph structure learning, we refer to this call as BestSubgraph($G_m$, $D_j$), for a given graph structure $G_m$ and training example $D_j$. Either ULS or GraphScan can be used to implement BestSubgraph, where ULS is faster but approximate, and GraphScan is slower but guaranteed to find the highest-scoring connected subgraph. In either case, to make graph learning computationally tractable, we must \emph{minimize} the number of calls to BestSubgraph, both by limiting the number of graph structures under consideration, and by reducing the average number of calls needed to evaluate a given graph. Thus we propose a \emph{greedy} framework for efficient graph structure learning that starts with the complete graph on $N$ nodes and sequentially removes edges until no edges remain (Algorithm 1). This procedure produces a sequence of graphs $G_m$, for each $m$ from $M=\frac{N(N-1)}{2}$ down to 0. For each graph $G_m$, we produce graph $G_{m-1}$ by considering all $m$ possible edge removals and choosing the one that maximizes the mean normalized score. We refer to this as BestEdge($G_m$, $D$), and consider three possible implementations of BestEdge in \S4.1 below. Once we have obtained the sequence of graphs $G_0 \ldots G_M$, we can then use randomization testing to choose the most significant graph $G_m$, as described in \S4.2. The idea of this approach is to remove unnecessary edges, while preserving essential connections which keep the maximum connected subgraph score close to the maximum unconstrained subset score for many training examples. However, a naive implementation of greedy search would require $O(N^4)$ calls to BestSubgraph, since $O(N^2)$ graph structures $G_{m-1}$ would be evaluated for each graph $G_m$ to choose the next edge for removal. Even a sequence of random edge removals would require $O(N^2)$ calls to BestSubgraph, to evaluate each graph $G_0 \ldots G_M$. Our efficient graph learning framework improves on both of these bounds, performing exact or approximate greedy search with $O(N^3)$ or $O(N\log N)$ calls to BestSubgraph respectively. The key insight is that removal of an edge only requires us to call BestSubgraph for those examples $D_j$ where removing that edge disconnects the highest scoring connected subgraph. See \S4.3 for further analysis and discussion. \vspace{-0.4cm} \begin{center} \begin{algorithm}[t] \caption{Graph structure learning framework} \label{alg} \begin{algorithmic}[1] \STATE Compute correlation $\rho_{ik}$ between each pair of nodes $v_i$ and $v_k$, $i\neq k$. These will be used in step 5. \STATE Compute highest-scoring unconstrained subset $S_j^\ast$ and its score $F_j$ for each example $D_j$ using the fast subset scan~\citep{neill-ltss}. \STATE For $m=\frac{N(N-1)}{2}$, let $G_m$ be the complete graph on $N$ nodes. Set $S_{mj}^\ast = S_j^\ast$ and $F_{mj} = F_j$ for all training examples $D_j$, and set $\bar F_{norm}(G_m) = 1$. \WHILE{number of remaining edges $m > 0$} \STATE Choose edge $e_{ik} = \mathrm{BestEdge}(G_m,D)$, and set $G_{m-1} = G_m$ with $e_{ik}$ removed. \FOR{each training example $D_j$} \STATE If removing edge $e_{ik}$ disconnects subgraph $S_{mj}^\ast$, then set $S_{m-1,j}^\ast = \mathrm{BestSubgraph}(G_{m-1},D_j)$ and $F_{m-1,j} = F(S_{m-1,j}^\ast)$. Otherwise set $S_{m-1,j}^\ast = S_{mj}^\ast$ and $F_{m-1,j} = F_{mj}$. \ENDFOR \STATE Compute $\bar F_{norm}(G_{m-1}) = \frac{1}{J} \sum_{j = 1\ldots J} \frac{F_{m-1,j}}{F_j}$. \STATE $m \leftarrow m-1$ \ENDWHILE \STATE Repeat steps 3-11 for $R$ randomly generated sequences of edge removals to find the most significant graph $G_m$. \end{algorithmic} \end{algorithm} \end{center} \vspace{-0.4cm} \subsection{Edge Selection Methods} Given a graph $G_m$ with $m$ edges, we consider three methods $\mathrm{BestEdge}(G_m,D)$ for choosing the next edge $e_{ik}$ to remove, resulting in the next graph $G_{m-1}$. First, we consider an exact greedy search. We compute the mean normalized score $\bar F_{norm}(G_{m-1})$ resulting from each possible edge removal $e_{ik}$, and choose the edge which maximizes $\bar F_{norm}(G_{m-1})$. As noted above, computation of the mean normalized score for each edge removal is made efficient by evaluating the score $F_{m-1,j}$ only for training examples $D_j$ where removing edge $e_{ik}$ disconnects the highest scoring subgraph. The resulting graph $G_{m-1}$ will have $\bar F_{norm}(G_{m-1})$ as close as possible to $\bar F_{norm}(G_m)$. We show in \S\ref{comp_sec} that only $O(N)$ of the $O(N^2)$ candidate edge removals will disconnect the highest scoring subgraphs, reducing the number of calls to BestSubgraph from quartic to cubic in $N$. However, this still may result in overly long run times, necessitating the development of the alternative approaches below. In the early stages of the greedy edge removal process, when the number of remaining edges $m$ is large, many different edge removals $e_{ik}$ might not disconnect any of the subgraphs $S_{mj}^\ast$, and all such graphs would have the same mean normalized score $\bar F_{norm}(G_{m-1}) = \bar F_{norm}(G_m)$. To avoid removing potentially important edges, we must carefully consider how to break ties in mean normalized score. In this case, we choose the edge $e_{ik}$ with lowest \emph{correlation} between the counts at nodes $v_i$ and $v_k$. If two nodes are connected to each other in the latent graph structure over which an event spreads, we expect both nodes to often be either simultaneously affected by an event in that part of the network, or simultaneously unaffected by an event in some other part of the network, and hence we expect the observed counts in these nodes to be correlated. Hence, if the Pearson correlation $\rho_{ik}$ between two nodes $v_i$ and $v_k$ is very low, the probability that the two nodes are connected is small, and thus edge $e_{ik}$ can be removed. We refer to the resulting algorithm, removing the edge $e_{ik}$ which reduces the mean normalized score the least, and using correlation to break ties, as the Greedy Correlation (GrCorr) method. Our second approach is based on the observation that GrCorr would require $O(m)$ calls to BestSubgraph for each graph $G_m$, $m=1\ldots M$, which may be computationally infeasible depending on the graph size and the implementation of BestSubgraph. Instead, we use the fact that $F_{m-1,j} = F_{mj}$ if removing edge $e_{ik}$ does not disconnect subgraph $S_{mj}^\ast$, and $F_{m-1,j} < F_{mj}$ otherwise. To do so, we \emph{count} the number of subgraphs $S_{mj}^\ast$, for $j=1\ldots J$, which would be disconnected by removing each possible edge $e_{ik}$ from graph $G_m$, and choose the $e_{ik}$ which disconnects the \emph{fewest} subgraphs. The resulting graph $G_{m-1}$ is expected to have a mean normalized score $\bar F_{norm}(G_{m-1})$ which is close to $\bar F_{norm}(G_m)$, since $F_{m-1,j} = F_{mj}$ for many subgraphs, but this approach does not guarantee that the graph $G_{m-1}$ with highest mean normalized score will be found. However, because we choose the edge $e_{ik}$ for which the fewest subgraphs $S_{mj}^\ast$ are disconnected, and only need to call BestSubgraph for those examples $D_j$ where removing $e_{ik}$ disconnects $S_{mj}^\ast$, we are choosing the edge $e_{ik}$ which requires the \emph{fewest} calls to BestSubgraph for each graph $G_m$. Again, correlation is used to break ties: if two edge removals $e_{ik}$ disconnect the same number of subgraphs, the edge with lower correlation is removed. We refer to this as Pseudo-Greedy Correlation (PsCorr), and we show in \S\ref{comp_sec} that this approach reduces the number of calls to BestSubgraph from $O(N^3)$ to $O(N\log N)$ as compared to exact greedy search. In our empirical results below, we compare GrCorr and PsCorr to a simple implementation of $\mathrm{BestEdge}(G_m,D)$, which we refer to as Correlation (Corr). Corr chooses the next edge removal $e_{ik}$ to be the edge with the lowest value of $\rho_{ik}$, and hence the greedy edge removal approach corresponds to keeping all edges with correlation above some threshold $\rho$. Our empirical results, presented below, demonstrate that GrCorr and PsCorr significantly improve timeliness and accuracy of event detection as compared to Corr. \subsection{Finding the Most Significant Graph} \begin{figure} \label{comp_score_dist} \begin{center} \includegraphics[scale=0.45]{CompScoreDist.png} \caption{Example of finding the most significant graph. Blue line: mean normalized score $\bar F_{norm}(G_m)$ for each graph $G_1 \ldots G_M$. Red line and grey shadow: mean and standard deviation of $\bar F_{norm}(G_{m,r})$ for randomized graphs with $m$ edges. Dashed line: most significant graph $G_m^\ast$.} \end{center} \vspace{-0.4cm} \end{figure} Our proposed graph structure learning approach considers a set of nested graphs $\{G_1 \ldots G_M\}$, $M = \frac{N(N-1)}{2}$, where graph $G_m$ has $m$ edges and is formed by removing an edge from graph $G_{m+1}$. We note that, for this set of graphs, $\bar F_{norm}(G_m)$ is monotonically increasing with $m$, since the highest scoring connected subgraph $S_{mj}^\ast$ for graph $G_m$ will also be connected for graph $G_{m+1}$, and thus $F_{m+1,j} \ge F_{mj}$ for each training example $D_j$. Our goal is to identify the graph $G_m$ with the best tradeoff between a high mean normalized score $\bar F_{norm}(G_m)$ and a small number of edges $m$, as shown in Figure 1. Our solution is to generate a large number $R$ of \emph{random} permutations of the $M = \frac{N(N-1)}{2}$ edges of the complete graph on $N$ nodes. For each permutation $r=1\ldots R$, we form the sequence of graphs $G_{1,r} \ldots G_{M,r}$ by removing edges in the given random order, and compute the mean normalized score of each graph. For a given number of edges $m$, we compute the mean $\mu_m$ and standard deviation $\sigma_m$ of the mean normalized scores of the $R$ random graphs with $m$ edges. Finally we choose the graph $G_m^\ast = \arg\max_m \frac{\bar F_{norm}(G_m) - \mu_m}{\sigma_m}$. This ``most significant graph'' has the most anomalously high value of $\bar F_{norm}(G_m)$ given its number of edges $m$. Ideally, in order to compute the most significant graph structure, we want to compare our mean normalized score to the mean normalized score of any random graph with the same number of edges. However, due to the computational infeasibility of scoring all the random graph structures with varying number of edges, we instead choose random permutations of edges to be removed. \ignore{ Alternatively, we could potentially split the training dataset into training and validation data. We could use the training data to decide on which edge to remove and we could use the validation data to generate the mean normalized score at each edge removal. We noticed in our experiments that this split tends to reduce the effective number of training examples, thereby affecting the performance of our learned graph structures (refer to \S\ref{num_train_performance} for more details). Further, we also performed additional experiments where we used twice as much data (same amount of training data, plus additional examples for validation) and there was not a huge improvement in performance of our learned graph structures. Hence, we used the same data to decide the order of edge removals and to generate the mean normalized score.} \subsection{Computational Complexity Analysis} \label{comp_sec} We now consider the computational complexity of each step of our graph structure learning framework (Alg.~1), in terms of the number of nodes $N$, number of training examples $J$, and number of randomly generated sequences $R$. Step 1 (computing correlations) requires $O(J)$ time for each of the $O(N^2)$ pairs of nodes. Step 2 (computing the highest-scoring unconstrained subsets) requires $O(N \log N)$ time for each of the $J$ training examples, using the linear-time subset scanning method~\citep{neill-ltss} for efficient computation. Steps 5-10 are repeated $O(N^2)$ times for the original sequence of edges and $O(N^2)$ times for each of the $R$ randomly generated sequences of edges. Within the loop, the computation time is dominated by steps 5 and 7, and depends on our choice of $\mathrm{BestSubgraph}(G,D)$ and $\mathrm{BestEdge}(G,D)$. For each call to BestSubgraph, GraphScan requires worst-case exponential time, approximately $O(1.2^N)$ based on empirical results by~\citet{speakman14}, while the faster, heuristic ULS method requires only $O(N^2)$ time. In step 7, BestSubgraph could be called up to $J$ times for each graph structure, for each of the $R$ randomly generated sequences of edge removals, resulting in a total of $O(JRN^2)$ calls. However, BestSubgraph is only called when the removal of an edge $e_{ik}$ disconnects the highest scoring connected subgraph $S_{mj}^\ast$ for that graph $G_m$ and training example $D_j$. We now consider the sequence of edge removals for graphs $G_1 \ldots G_M$, where $M=\frac{N(N-1)}{2}$, and compute the expected number of calls to BestSubgraph for these $O(N^2)$ edge removals. We focus on the case of random edge removals, since these dominate the overall runtime for large $R$. For a given training example $D_j$, let $x_m$ denote the number of nodes in the highest-scoring connected subgraph $S_{mj}^\ast$ for graph $G_m$, and let $T_m$ denote any spanning tree of $S_{mj}^\ast$. We note that the number of edges in $T_m$ is $x_m - 1$, which is $O(\min(N,m))$. Moreover, any edge that is not in $T_m$ will not disconnect $S_{mj}^\ast$, and thus the probability of disconnecting $S_{mj}^\ast$ for a random edge removal is upper bounded by the ratio of the number of disconnecting edges $O(\min(N,m))$ to the total number of edges $m$. Thus the expected number of calls to BestSubgraph for graphs $G_1 \ldots G_M$ for the given training example is $\sum_{m = 1 \ldots M} \frac{O(\min(N,m))}{m}$ = $O(N) + \sum_{m = N \ldots M} \frac{O(N)}{m}$ = $O(N) + O(N) \sum_{m = N \ldots M} \frac{1}{m}$ = $O(N \log N)$. Hence the expected number of calls to BestSubgraph needed for all $J$ training examples is $O(JN \log N)$ for the given sequence of graphs $G_1 \ldots G_M$, and $O(JRN \log N)$ for the $R$ random sequences of edge removals. Finally, we consider the complexity of choosing the next edge to remove (step 5 of our graph structure learning framework). The BestEdge function is called $O(N^2)$ times for the given sequence of graphs $G_1 \ldots G_M$, but is not called for the $R$ random sequences of edge removals. For the GrCorr and PsCorr methods, for each graph $G_m$ and each training example $D_j$, we must evaluate all $O(m)$ candidate edge removals. This requires a total of $O(JN^4)$ checks to determine whether removal of each edge $e_{ik}$ disconnects the highest scoring connected subgraph $S_{mj}^\ast$ for each graph $G_m$ and training example $D_j$. The GrCorr method must also call BestSubgraph whenever the highest scoring subgraph is disconnected. However, for a given graph $G_m$ and training example $D_j$, we show that only $O(N)$ of the $O(m)$ candidate edge removals can disconnect the highest scoring subset, thus requiring only $O(JN^3)$ calls to BestSubgraph rather than $O(JN^4)$. To see this, let $x_m$ be the number of nodes in the highest-scoring connected subgraph $S_{mj}^\ast$, and let $T_m$ be any spanning tree of $S_{mj}^\ast$. Then any edge that is not in $T_m$ will not disconnect $S_{mj}^\ast$, and $T_m$ only has $x_m - 1 = O(N)$ edges. \subsection{Consistency of Greedy Search} The greedy algorithm described above is not guaranteed to recover the true graph structure $G_T$. However, we can show that, given a sufficiently strong and homogeneous signal, and sufficiently many training examples, the true graph will be part of the sequence of graphs $G_0 \ldots G_M$ identified by the greedy search procedure. More precisely, let us make assumptions (A1) and (A2) given in \S3 above. We also assume that GraphScan (GS) or Upper Level Sets (ULS) is used for BestSubgraph, and that Greedy Correlation (GrCorr) or Pseudo-Greedy Correlation (PsCorr) is used for selecting the next edge to remove (BestEdge). Given these assumptions, we can show: \begin{theorem} \label{second_theorem} If the signal is $\alpha_j$-homogeneous and $\frac{\beta_j}{\eta_j}$-strong for all training examples $D_j \sim \mathbf{D}$, and if the set of training examples $D_1 \ldots D_J$ is sufficiently large, then the true graph $G_T$ will be part of the sequence of graphs $G_0 \ldots G_M$ identified by Algorithm 1. \end{theorem} \begin{proof} Given an $\alpha_j$-homogeneous and $\frac{\beta_j}{\eta_j}$-strong signal, both GS and ULS will correctly identify the highest-scoring connected subgraph $S_{mj}^\ast$. This is true for GS in general, since an exact search is performed, and also true for ULS since $S_{mj}^\ast$ will be one of the upper level sets considered. Now let $m_T$ denote the number of edges in the true graph $G_T$, and consider the sequence of graphs $G_M$, $G_{M-1}$, \ldots, $G_{m_T+1}$ identified by the greedy search procedure. For each of these graphs $G_m$, the next edge to be removed (producing graph $G_{m-1}$) will be either an edge in $G_T$ or an edge in $G_M \setminus G_T$. We will show that an edge in $G_M \setminus G_T$ is chosen for removal at each step. Given assumptions (A1)-(A2) and an $\alpha_j$-homogeneous and $\frac{\beta_j}{\eta_j}$-strong signal, Theorem 1 implies: a) For any graph that contains all edges of the true graph ($G_T \setminus G_m = \emptyset$), we will have $S_{mj}^\ast = S_j^\ast = S_j^T$ for all $D_j \sim \mathbf{D}$, and thus $\bar F_{norm}(G_m) = 1$. b) For any graph that does not contain all edges of the true graph, and for any training example $D_j$ drawn from $\mathbf{D}$, there is a non-zero probability that we will have $S_{mj}^\ast \ne S_j^\ast$, $F_{mj} < F_j$, and thus $\bar F_{norm}(G_m) < 1$. We further assume that the set of training examples is sufficiently large so that every pair of nodes $\{v_1,v_2\}$ in $G_T$ is the affected subgraph for at least one training example $D_j$; note that assumption (A1) ensures that each such pair will be drawn from $\mathbf{D}$ with non-zero probability. This means that removal of any edge in $G_T$ will disconnect $S_{mj}^\ast$ for at least one training example $D_j$, leading to $S_{(m-1)j}^\ast \ne S_{mj}^\ast$ and $\bar F_{norm}(G_{m-1}) < \bar F_{norm}(G_m)$, while removal of any edge in $G_M \setminus G_T$ will not disconnect $S_{mj}^\ast$ for any training examples, maintaining $\bar F_{norm}(G_{m-1}) = \bar F_{norm}(G_m)$. Hence for both GrCorr, which removes the edge that maximizes $\bar F_{norm}(G_{m-1})$, and PsCorr, which removes the edge that disconnects $S_{mj}^\ast$ for the fewest training examples, the greedy search procedure will remove all edges in $G_M \setminus G_T$ before removing any edges in $G_T$, leading to $G_{m_T} = G_T$. \end{proof} \section{Related Work} We now briefly discuss several streams of related work. As noted above, various spatial scan methods have been proposed for detecting the most anomalous subset in data with an underlying, known graph structure, including Upper Level Sets~\citep{patil04}, FlexScan~\citep{tango05}, and GraphScan~\citep{speakman14}, but none of these methods attempt to learn an unknown graph structure from data. Link prediction algorithms such as~\citep{Taskar:2003:LPR, Vert:2005:SGI} start with an existing network of edges and attempt to infer additional edges which might also be present, unlike our scenario which requires inferring the complete edge structure. Much work has been done on learning the edge structure of graphical models such as Bayesian networks and probabilistic relational models~\citep{Getoor:2003:LPM}, but these methods focus on understanding the dependencies between multiple attributes rather than learning a graph structure for event detection. Finally, the recently proposed NetInf~\citep{Gomez-Redriguez:2010:NetInf}, ConNIe~\citep{Myers:2010:LSNI}, and MultiTree~\citep{Gomez-Redriguez:2012:MultiTree} methods share our goal of efficiently learning graph structure. NetInf is a submodular approximation algorithm for predicting the latent network structure and assumes that all connected nodes influence their neighbors with equal probability. ConNIe relaxes this assumption and uses convex programming to rapidly infer the optimal latent network, and MultiTree is an extension of NetInf which considers all possible tree structures instead of only the most probable ones. The primary difference of the present work from NetInf, ConNIe, and MultiTree is that we learn the underlying graph structure from \emph{unlabeled} data: while these methods are given the affected subset of nodes for each time step of an event, thus allowing them to learn the network edges along which the event spreads, we consider the more difficult case where we are given only the observed and expected counts at each node, and the affected subset of nodes is not labeled. Further, these methods are not targeted towards learning a graph structure for event detection, and we demonstrate below that our approach achieves more timely and accurate event detection than MultiTree, even when MultiTree has access to the labels. \section{Experimental Setup} In our general framework, we implemented two methods for $\mathrm{BestSubgraph}(G,D)$: GraphScan (GS) and Upper Level Sets (ULS). We also implemented three methods for $\mathrm{BestEdge}(G,D)$: GrCorr, PsCorr, and Corr. However, using GraphScan with the true greedy method (GS-GrCorr) was computationally infeasible for our data, requiring 3 hours of run time for a single 50-node graph, and failing to complete for larger graphs. Hence our evaluation compares five combinations of BestSubgraph and BestEdge: GS-PsCorr, GS-Corr, ULS-GrCorr, ULS-PsCorr, and ULS-Corr. We compare the performance of our learned graphs with the learned graphs from MultiTree, which was shown to outperform previously proposed graph structure learning algorithms such as NetInf and ConNIe~\citep{Gomez-Redriguez:2012:MultiTree}. We used the publicly available implementation of the algorithm, and considered both the case in which MultiTree is given the true labels of the affected subset of nodes for each training example (MultiTree-Labels), and the case in which these labels are not provided (MultiTree-NoLabels). In the latter case, we perform a subset scan for each training example $D_j$, and use the highest-scoring unconstrained subset $S_j^\ast$ as an approximation of the true affected subset. \subsection{Description of Data} Our experiments focus on detection of simulated disease outbreaks injected into real-world Emergency Department (ED) data from ten hospitals in Allegheny County, Pennsylvania. The dataset consists of the number of ED admissions with respiratory symptoms for each of the $N=97$ zip codes for each day from January 1, 2004 to December 31, 2005. The data were cleaned by removing all records where the admission date was missing or the home zip code was outside the county. The resulting dataset had a daily mean of 44.0 cases, with a standard deviation of 12.1. \subsection{Graph-Based Outbreak Simulations} Our first set of simulations assume that the disease outbreak starts at a randomly chosen location and spreads over some underlying graph structure, increasing in size and severity over time. We assume that an affected node remains affected through the outbreak duration, as in the Susceptible-Infected contagion model~\citep{Bailey:1975:InfectionModels}. For each simulated outbreak, we first choose a center zip code uniformly at random, then order the other zip codes by graph distance (number of hops away from the center for the given graph structure), with ties broken at random. Each outbreak was assumed to be 14 days in duration. On each day $d$ of the outbreak ($d=1 \ldots 14$), we inject counts into the $k$ nearest zip codes, where $k = SpreadRate \times d$, and $SpreadRate$ is a parameter which determines how quickly the inject spreads. For each affected node $v_i$, we increment the observed count $c_i^t$ by $\mbox{Poisson}(\lambda_i^t)$, where $\lambda_i^t = \frac{SpreadFactor \times d}{SpreadFactor+\log (dist_i+1)}$, and $SpreadFactor$ is a parameter which determines how quickly the inject severity decreases with distance. The assumption of Poisson counts is common in epidemiological models of disease spread; the expected number of injected cases $\lambda_i^t$ is an increasing function of the inject day $d$, and a decreasing function of the graph distance between the affected node and the center of the outbreak. We considered 4 different inject types, as described below; for each type, we generated $J = 200$ training injects (for learning graph structure) and an additional 200 test injects to evaluate the timeliness and accuracy of event detection given the learned graph. \subsubsection{Zip code adjacency graph based injects} We first considered simulated outbreaks which spread from a given zip code to spatially adjacent zip codes, as is commonly assumed in the literature. Thus we formed the \emph{adjacency graph} for the 97 Allegheny County zip codes, where two nodes are connected by an edge if the corresponding zip codes share a boundary. We performed two sets of experiments: for the first set, we generated simulated injects using the adjacency graph, while for the second set, we added additional edges between randomly chosen nodes to simulate travel patterns. As noted above, a contagious disease outbreak might be likely to propagate from one location to another location which is not spatially adjacent, based on individuals' daily travel, such as commuting to work or school. We hypothesize that inferring these additional edges will lead to improved detection performance. \ignore{\subsubsection{Spatial injects} An alternative assumption is that a disease outbreak affects all areas within some spatial radius of the outbreak center. This is commonly assumed in the literature for non-contagious outbreaks with a point source, such as cancer clusters resulting from a radiation leak, or other patterns of illness resulting from environmental exposures~\citep{kulldorff97a}. To simulate these ``spatial injects'', we do not assume an underlying graph structure, but instead assume that an outbreak spreads to the $k$-nearest neighbors of the center zip code based on Euclidean distance between the zip code centroids, as described above.} \subsubsection{Random graph based injects} Further, in order to show that we can learn a diverse set of graph structures over which an event spreads, we performed experiments assuming two types of random graphs, Erdos-Renyi and preferential attachment. For each experiment, we used the same set of nodes $V$ consisting of the 97 Allegheny County zip codes, but created a random set of edges $E$ connecting these nodes; the graph $G=(V,E)$ was then used to simulate 200 training and 200 test outbreaks, with results averaged over multiple such randomly chosen graphs. First, we considered \emph{Erdos-Renyi graphs} (assuming that each pair of nodes is connected with a constant probability $p$), with edge probabilities $p$ ranging from 0.08 to 0.20. The relative performance of methods was very similar across different $p$ values, and thus only the averaged results are reported. Second, we considered \emph{preferential attachment graphs}, scale-free network graphs which are constructed by adding nodes sequentially, assuming that each new node forms an edge to each existing node with probability proportional to that node's degree. We generated the preferential attachment graph by first connecting three randomly chosen nodes, then adding the remaining nodes in a random order. Each new node that arrives attaches itself to each existing node $v_j$ with probability $\frac{deg(v_j)}{\sum_i deg(v_i)}$, where each node's maximum degree was restricted to $0.2 \times |V|$. \ignore{Finally, we generated random graphs spanning the continuum between preferential attachment and Erdos-Renyi graphs. To do so, we follow the same sequential procedure as for the preferential attachment graphs, but each new node that arrives attaches itself to each existing node $v_j$ with probability $\alpha \frac{deg(v_j)}{\sum_i deg(v_i)} + (1-\alpha)p$. The parameter $\alpha$ controls the level of preferential attachment, with $\alpha = 1$ corresponding to a preferential attachment graph and $\alpha = 0$ corresponding to an Erdos-Renyi graph with edge probability $p$.} \subsection{Simulated Anthrax Bio-Attacks} We present additional evaluation results for one potentially realistic outbreak scenario, an increase in respiratory Emergency Department cases resulting from an airborne release of anthrax spores (e.g.~from a bio-terrorist attack). The anthrax attacks are based on a state-of-the-art, highly realistic simulation of an aerosolized anthrax release, the Bayesian Aerosol Release Detector (BARD) simulator ~\citep{hogan07}. BARD uses a combination of a dispersion model (to determine which areas will be affected and how many spores people in these areas will be exposed to), an infection model (to determine who will become ill with anthrax and visit their local Emergency Department),and a visit delay model to calculate the probability of the observed Emergency Department visit counts over a spatial region. These complex simulations take into account weather data when creating the affected zip codes and demographic information when calculating the number of additional Emergency Department cases within each affected zip code. The weather patterns are modeled with Gaussian plumes resulting in elongated, non-circular regions of affected zip codes. Wind direction, wind speed, and atmospheric stability all influence the shape and size of the affected area. A total of 82 simulated anthrax attacks were generated and injected into the Allegheny County Emergency Department data, using the BARD model. Each simulation generated between 33 and 1324 cases in total (mean = 429.2, median = 430) over a ten-day outbreak period; half of the attacks were used for training and half for testing. \section{Experimental Results} \subsection{Computation Time} For each of the experiments described above (adjacency, adjacency plus travel patterns, Erdos-Renyi random graphs, and preferential attachment graphs), we report the average computation time required for each of our methods (Table~1). Randomization testing is not included in these results, since it is not dependent on the choice of BestEdge. Each sequence of randomized edge removals $G_{1,r}, \ldots, G_{M,r}$ required 1 to 2 hours for the GraphScan-based methods and 1 to 3 minutes for the ULS-based methods. \begin{table} \begin{center} \caption{Average run time in minutes for each learned graph structure, for $N=97$ nodes.}\vspace{1mm} {\tiny \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline Experiment & \multicolumn{2}{c|}{GraphScan (GS)} & \multicolumn{3}{c|}{ULS} & \multicolumn{2}{c|}{MultiTree}\\ & \multicolumn{1}{c}{PsCorr}& Corr & \multicolumn{1}{|c}{GrCorr} & \multicolumn{1}{c}{PsCorr} & Corr &\multicolumn{1}{c}{Labels} & NoLabels\\\hline Adjacency & 41 & 38 & 13 & 2 & 1 & $<$1 & $<$1\\ Adjacency+Travel & 53 & 47 & 15 & 3 & 1 & $<$1 & $<$1\\ Erdos-Renyi (avg) & 93 & 89 & 22 & 6 & 3 & $<$1 & $<$1\\ Pref. Attachment & 49 & 44 & 17 & 3 & 1 & $<$1 & $<$1\\ \hline \end{tabular} } \vspace{-0.4cm} \end{center} \end{table} \begin{table} \begin{center} \caption{Average run time in minutes for each learned graph structure, for Erdos-Renyi graphs with varying numbers of nodes $N$.} {\tiny \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline Size & \multicolumn{2}{c|}{GraphScan (GS)} & \multicolumn{3}{c|}{ULS} & \multicolumn{2}{c|}{MultiTree}\\ & \multicolumn{1}{c}{PsCorr}& Corr & \multicolumn{1}{|c}{GrCorr} & \multicolumn{1}{c}{PsCorr} & Corr &\multicolumn{1}{c}{Labels} & NoLabels\\\hline N=50 & 2 & 2 & 1 & $<$1 & $<$1 & $<$1 & $<$1\\ N=75 & 37 & 32 & 3 & 1 & $<$1 & $<$1 & $<$1\\ N=100 & 58 & 53 & 13 & 3 & $<$1 & $<$1 & $<$1\\ N=200 & - & - & 91 & 33 & 1 & 1 & 1\\ N=500 & - & - & 2958 & 871 & 27 & 2 & 2\\ \hline \end{tabular} } \vspace{-0.4cm} \end{center} \end{table} For each of the $J=200$ training examples, all methods except for ULS-GrCorr required fewer than 80 calls to BestSubgraph on average to search over the space of $M=4,656$ graph structures, a reduction of nearly two orders of magnitude as compared to the naive approach of calling BestSubgraph for each combination of graph structure and training example. Similarly, a naive implementation of the true greedy search would require approximately 11 million calls to BestSubgraph for each training example, while our ULS-GrCorr approach required only $\sim$5000 calls per training example, a three order of magnitude speedup. As expected, ULS-Corr and ULS-PsCorr had substantially faster run times than GS-Corr and GS-PsCorr, though the GraphScan-based approaches were still able to learn each graph structure in less than two hours. Next, in order to evaluate how each method scales with the number of nodes $N$, we generated Erdos-Renyi random graphs with edge probability $p=0.1$ and $N$ ranging from 50 to 500. For each graph, we generated simulated counts and baselines, as well as simulating injects to produce $J=200$ training examples for learning the graph structure. Table 2 shows the average time in minutes required by each method to learn the graph structure. We observe that the ULS-based methods were substantially faster than the GraphScan-based methods, and were able to scale to graphs with $N=500$ nodes, while GS-Corr and GS-PsCorr were not computationally feasible for $N \ge 200$. We note that MultiTree has much lower computation time as compared to our graph learning methods, since it is not dependent on calls to a graph-based event detection method (BestSubgraph); however, its detection performance is lower, as shown below in our experiments. \subsection{Comparison of True and Learned Graphs} For each of the four graph-based injects (adjacency, adjacency plus travel patterns, Erdos-Renyi, and preferential attachment), we compare the learned graphs to the true underlying graph over which the simulated injects spread. Table 3 compares the number of edges in the true underlying graph to the number of edges in the learned graph structure for each of the methods, and Tables 4 and 5 show the precision and recall of the learned graph as compared to the true graph. Given the true set of edges $E^T$ and the learned set of edges $E^\ast$, the edge precision and recall are defined to be $\frac{|E^\ast \cap E^T|}{|E^\ast|}$ and $\frac{|E^\ast \cap E^T|}{|E^T|}$ respectively. High recall means that the learned graph structure identifies a high proportion of the true edges, while high precision means that the learned graph does not contain too many irrelevant edges. We observe that GS-PsCorr had the highest recall, with nearly identical precision to GS-Corr and ULS-GrCorr. MultiTree had higher precision and comparable recall to GS-PsCorr when it was given the true labels, but 3-5\% lower precision and recall when the labels were not provided. \begin{table}[t] \begin{center} \caption{Comparison of true and learned number of edges $m$.} {\tiny \begin{tabular}{|c|c|c|c|c|c|c|c|c|}\hline Experiment & Edges & \multicolumn{7}{c|}{Learned Edges} \\ & (true) & \multicolumn{2}{c|}{GraphScan (GS)} & \multicolumn{3}{c|}{ULS} & \multicolumn{2}{c|}{MultiTree}\\ & & \multicolumn{1}{c}{PsCorr}& Corr & \multicolumn{1}{|c}{GrCorr} & \multicolumn{1}{c}{PsCorr} & Corr &\multicolumn{1}{c}{Labels} & NoLabels\\\hline Adjacency & 216 & 319 & 297 & 305 & 332& 351 & 280& 308\\ Adjacency+Travel & 280 & 342 & 324 & 329 & 362& 381 & 316& 342\\ Erdos-Renyi ($p=0.08$) & 316 & 388 & 369 & 359& 398& 412& 356& 382\\ Pref. Attachment & 374 & 394 & 415 & 401 & 428& 461& 399& 416 \\ \hline \end{tabular} } \vspace{-0.4cm} \end{center} \label{edges_table} \end{table} \begin{table}[H] \begin{center} \caption{Comparison of edge precision for learned graphs.} {\tiny \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline Experiment & \multicolumn{7}{c|}{Precision} \\ & \multicolumn{2}{c|}{GraphScan (GS)} & \multicolumn{3}{c|}{ULS} &\multicolumn{2}{c|}{MultiTree} \\ & \multicolumn{1}{c}{PsCorr} & \multicolumn{1}{c|}{Corr} & \multicolumn{1}{c}{GrCorr} & \multicolumn{1}{c}{PsCorr} & \multicolumn{1}{c|}{Corr} & \multicolumn{1}{c}{Labels} & NoLabels \\ \hline Adjacency & 0.60 & 0.62 & 0.62 & 0.53 & 0.50& 0.66 & 0.58\\ Adjacency+Travel & 0.70 & 0.71 & 0.69 & 0.60& 0.52 & 0.75& 0.65 \\ Erdos-Renyi (avg) & 0.56 & 0.59 & 0.61& 0.59& 0.54 & 0.62& 0.56 \\ Pref. Attachment & 0.83 & 0.79 & 0.80 & 0.69 & 0.59 & 0.86& 0.80 \\ \hline \end{tabular} } \vspace{-0.4cm} \end{center} \label{edge_prec_table} \end{table} \begin{table}[H] \begin{center} \caption{Comparison of edge recall for learned graphs.} {\tiny \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline Experiment & \multicolumn{7}{c|}{Recall} \\ & \multicolumn{2}{c|}{GraphScan (GS)} & \multicolumn{3}{c|}{ULS} &\multicolumn{2}{c|}{MultiTree} \\ & \multicolumn{1}{c}{PsCorr} & \multicolumn{1}{c|}{Corr} & \multicolumn{1}{c}{GrCorr} & \multicolumn{1}{c}{PsCorr} & \multicolumn{1}{c|}{Corr} & \multicolumn{1}{c}{Labels} & NoLabels \\ \hline Adjacency & 0.89 & 0.86 & 0.88 & 0.81&0.77 & 0.86& 0.83\\ Adjacency+Travel & 0.86 & 0.83 & 0.81 & 0.77 &0.71 & 0.85& 0.79\\ Erdos-Renyi (avg) & 0.87 & 0.81 & 0.83 & 0.79& 0.70 & 0.84& 0.79\\ Pref. Attachment &0.88& 0.81 & 0.86 & 0.79 & 0.73 & 0.91 & 0.89\\ \hline \end{tabular} } \vspace{-0.4cm} \end{center} \label{edge_recall_table} \end{table} \subsection{Comparison of Detection Performance} \label{DetPerf} We now compare the detection performance of the learned graphs on the test data: a separate set of 200 simulated injects (or $41$ injects for the BARD anthrax simulations), generated from the same distribution as the training injects which were used to learn that graph. To evaluate a graph, we use the GraphScan algorithm (assuming the given graph structure) to identify the highest-scoring connected subgraph $S$ and its likelihood ratio score $F(S)$ for each day of each simulated inject, and for each day of the original Emergency Department data with no cases injected. We note that performance was substantially improved by using GraphScan for detection as compared to ULS, regardless of whether GraphScan or ULS was used to learn the graph, and GraphScan required less than a few seconds of run time for detection per day of the ED data. We then evaluate detection performance using two metrics: average time to detection (assuming a false positive rate of 1 fp/month, typically considered acceptable by public health), and spatial accuracy (overlap between true and detected clusters). To compute detection time, we first compute the score threshold $F_{thresh}$ for detection at 1 fp/month. This corresponds to the 96.7th percentile of the daily scores from the original ED data. Then for each simulated inject, we compute the first outbreak day $d$ with $F(S) > F_{thresh}$; for this computation, undetected outbreaks are counted as $14$ days (maximum number of inject days) to detect. We then average the time to detection over all 200 test injects. To evaluate spatial accuracy, we compute the average overlap coefficient between the detected subset of nodes $S^\ast$ and the true affected subset $S^T$ at the midpoint (day 7) of the outbreak, where overlap is defined as $\frac{|S^\ast \cap S^T|}{|S^\ast \cup S^T|}$. As noted above, detection performance is often improved by including a proximity constraint, where we perform separate searches over the ``local neighborhood'' of each of the $N$ graph nodes, consisting of that node and its $k-1$ nearest neighbors, and report the highest-scoring connected subgraph over all neighborhoods. We compare the detection performance of each graph structure by running GraphScan with varying neighborhood sizes $k=5,10,\ldots,45$ for each outbreak type. \subsubsection{Results on zip code adjacency graphs} We first evaluate the detection time and spatial accuracy of GraphScan, using the learned graphs, for simulated injects which spread based on the adjacency graph formed from the 97 Allegheny County zip codes, as shown in Figure~\ref{AdjGraphInject}. This figure also shows the performance of GraphScan given the true zip code adjacency graph. We observe that the graphs learned by GS-PsCorr and ULS-GrCorr have similar spatial accuracy to the true zip code adjacency graph, as measured by the overlap coefficient between the true and detected subsets of nodes, while the graphs learned by GS-Corr and MultiTree have lower spatial accuracy. Surprisingly, all of the learned graphs achieve more timely detection than the true graph: for the optimal neighborhood size of $k=30$, ULS-GrCorr and GS-PsCorr detected an average of 1.4 days faster than the true graph. This may be because the learned graphs, in addition to recovering most of the edges of the adjacency graph, also include additional edges to nearby but not spatially adjacent nodes (e.g.~neighbors of neighbors). These extra edges provide added flexibility to consider subgraphs which would be almost but not quite connected given the true graph structure. This can improve detection time when some nodes are more strongly affected than others, enabling the strongly affected nodes to be detected earlier in the outbreak before the entire affected subgraph is identified. Finally, ULS-GrCorr and GS-PsCorr detected 0.6 days faster than MultiTree for $k=30$. \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.23]{CompAdjSpread_1.png}& \includegraphics[scale=0.23]{CompAdjSpread_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.70]{Legend_new1.png}} \end{tabular} \caption{Comparison of detection performance of the true and learned graphs for injects based on zip code adjacency.}\label{AdjGraphInject} \end{center} \vspace{-0.4cm} \end{figure} \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.23]{CompAdjRandSpread_1.png} & \includegraphics[scale=0.23]{CompAdjRandSpread_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.60]{Legend_new2.png}} \end{tabular} \caption{Comparison of detection performance of the true, learned, and adjacency graphs for injects based on adjacency with simulated travel patterns.}\label{AdjRandInject} \end{center} \vspace{-0.4cm} \end{figure} \subsubsection{Results on adjacency graphs with simulated travel patterns} Next we compared detection time and spatial accuracy, using the graphs learned by each of the methods, for simulated injects which spread based on the zip code adjacency graph with additional random edges added to simulate travel patterns, as shown in Figure~\ref{AdjRandInject}. This figure also shows the detection performance given the true (adjacency plus travel) graph and the adjacency graph without travel patterns. We observe again that GS-PsCorr and ULS-GrCorr achieve similar spatial accuracy to the true graph, while the original adjacency graph, GS-Corr, and MultiTree have lower spatial accuracy. Our learned graphs are able to detect outbreaks 0.8 days earlier than MultiTree, 1.2 days earlier than the true graph, and 1.7 days earlier than the adjacency graph without travel patterns. This demonstrates that our methods can successfully learn the additional edges due to travel patterns, substantially improving detection performance. \subsubsection{Results on random graphs} \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.23]{CompRandSpread_1.png} & \includegraphics[scale=0.23]{CompRandSpread_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.70]{Legend_new1.png}} \end{tabular} \caption{Comparison of detection performance of the true and learned graphs averaged over seven inject types ($p=0.08,\ldots, 0.20$) based on Erdos-Renyi random graphs.}\label{RandGraphInject} \end{center} \vspace{-0.4cm} \end{figure} \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.23]{CompPrefSpread_1.png} & \includegraphics[scale=0.23]{CompPrefSpread_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.70]{Legend_new1.png}} \end{tabular} \caption{Comparison of detection performance of the true and learned graphs for injects based on a preferential attachment graph.}\label{PrefGraphInject} \end{center} \vspace{-0.4cm} \end{figure} Next we compared detection time and spatial accuracy using the learned graphs for simulated injects which spread based on Erdos-Renyi and preferential attachment graphs, as shown in Figures~\ref{RandGraphInject} and~\ref{PrefGraphInject} respectively. Each figure also shows the performance of the true randomly generated graph. As in the previous experiments, we observe that our learned graphs achieve substantially faster detection than the true graph and MultiTree. For preferential attachment, the learned graphs also achieve higher spatial accuracy than the true graph, with GS-PsCorr and ULS-GrCorr again outperforming GS-Corr and MultiTree. For Erdos-Renyi, GS-PsCorr and ULS-GrCorr achieve similar spatial accuracy to the true graph, while GS-Corr and MultiTree have lower accuracy. \subsubsection{Results on BARD simulations} We further compared the detection time and spatial accuracy using learned graphs based on realistic simulations of anthrax bio-attacks, as shown in Figure~\ref{BARDInject}. In these simulations there is no ``true'' graph structure as these were generated using spatial information based on environmental characteristics (wind direction, etc.). Hence, we compare the performance of various graphs learned or assumed. It can be seen that the learned graphs using GS-PsCorr and ULS-GrCorr achieve substantially faster detection and higher spatial accuracy, as compared to assuming the adjacency graph and the graphs learned using GS-Corr and MultiTree. \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.23]{CompBardSpread_1.png} & \includegraphics[scale=0.23]{CompBardSpread_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.50]{Legend_bard.png}} \end{tabular} \caption{Comparison of detection performance of the true and learned graphs for injects based on simulated anthrax bio-attacks.}\label{BARDInject} \end{center} \vspace{-0.4cm} \end{figure} \subsection{Effect of number of training examples on performance} \label{num_train_performance} All of the experiments discussed above (except for the BARD simulations) assume $J=200$ unlabeled training examples for learning the graph structure. We now evaluate the graphs learned by two of our best performing methods, GS-PsCorr and ULS-GrCorr, using smaller numbers of training examples ranging from $J=20$ to $J=200$. Simulated outbreaks were generated based on the preferential attachment graph described in \S6.2.2. As shown in Figure~\ref{NumExampAffectPerf}, GS-PsCorr and ULS-GrCorr perform very similarly both in terms of average number of days to detect and spatial accuracy. Performance of both methods improves with increasing training set size, outperforming the true graph structure for $J > 60$. \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.2]{NumExampAffectPerf_1.png} & \includegraphics[scale=0.2]{NumExampAffectPerf_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.3]{Legend_3.png}} \end{tabular} \caption{Effect of number of training examples on performance of GS-PsCorr and ULS-GrCorr.}\label{NumExampAffectPerf} \end{center} \vspace{-0.4cm} \end{figure} \subsection{Effect of percentage of injects in training data on performance} All of the experiments discussed above (except for the BARD simulations) assume that the $J$ unlabeled training examples are each a ``snapshot'' of the observed count data $c_i^t$ at each node $v_i$ during a time when an event is assumed to be occurring. However, in practice the training data may be \emph{noisy}, in the sense that some fraction of the training examples may be from time periods where no events are present. Thus we evaluate performance of the graphs learned by GS-PsCorr and ULS-GrCorr (for simulated outbreaks based on the preferential attachment graph described in \S6.2.2) using a set of $J=200$ training examples, where proportion $p$ of the examples are based on simulated inject data, and proportion $1-p$ are drawn from the original Emergency Department data with no outbreaks injected. As shown in Figure~\ref{PercAffectPerf}, the performance of both GS-PsCorr and ULS-GrCorr improves as the proportion of injects $p$ in the training data increases. For $p \ge 0.6$, both methods achieve more timely detection than the true underlying graph, with higher spatial accuracy. These results demonstrate that our graph structure learning methods, while assuming that all training examples contain true events, are robust to violations of this assumption. \begin{figure}[t] \begin{center} \begin{tabular}{cc} \includegraphics[scale=0.2]{PercAffectPerf_1.png}& \includegraphics[scale=0.2]{PercAffectPerf_2.png}\\ \multicolumn{2}{c}{\includegraphics[scale=0.3]{Legend_3.png}} \end{tabular} \caption{Effect of percentage of injects in training data on performance of GS-PsCorr and ULS-GrCorr learned graphs.}\label{PercAffectPerf} \end{center} \vspace{-0.4cm} \end{figure} \section{Conclusions and Future Work} In this work, we proposed a novel framework to learn graph structure from unlabeled data, based on comparing the most anomalous subsets detected with and without the graph constraints. This approach can accurately and efficiently learn a graph structure which can then be used by graph-based event detection methods such as GraphScan, enabling more timely and more accurate detection of events (such as disease outbreaks) which spread based on that latent structure. Within our general framework for graph structure learning, we compared five approaches which differed both in the underlying detection method (BestSubgraph) and the method used to choose the next edge for removal (BestEdge), incorporated into a provably efficient greedy search procedure. We demonstrated both theoretically and empirically that our framework requires fewer calls to BestSubgraph than a naive greedy approach, $O(N^3)$ as compared to $O(N^4)$ for exact greedy search, and $O(N\log N)$ as compared to $O(N^2)$ for approximate greedy search, resulting in 2 to 3 orders of magnitude speedup in practice. We tested these approaches on various types of simulated disease outbreaks, including outbreaks which spread according to spatial adjacency, adjacency plus simulated travel patterns, random graphs (Erdos-Renyi and preferential attachment), and realistic simulations of an anthrax bio-attack. Our results demonstrated that two of our approaches, GS-PsCorr and ULS-GrCorr, consistently outperformed the other three approaches in terms of spatial accuracy, timeliness of detection, and accuracy of the learned graph structure. Both GS-PsCorr and ULS-GrCorr consistently achieved more timely and more accurate event detection than the recently proposed MultiTree algorithm~\citep{Gomez-Redriguez:2012:MultiTree}, even when MultiTree was provided with labeled data not available to our algorithms. We observed a tradeoff between scalability and detection: GS-PsCorr had slightly better detection performance than ULS-GrCorr, while ULS-GrCorr was able to scale to larger graphs (500 nodes vs.~100 nodes). None of our approaches are designed to scale to massive graphs with millions of nodes (e.g.~online social networks); they are most appropriate for moderate-sized graphs where labeled data is not available and timely, accurate event detection is paramount. In general, our results demonstrate that the graph structures learned by our framework are similar to the true underlying graph structure, capturing nearly all of the true edges but also adding some additional edges. The resulting graph achieves similar spatial accuracy to the true graph, as measured by the overlap coefficient between true and detected clusters. Interestingly, the learned graph often has \emph{better} detection power than the true underlying graph, enabling more timely detection of outbreaks or other emerging events. This result can be better understood when we realize that the learning procedure is designed to capture not only the underlying graph structure, but the characteristics of the events which spread over that graph. Unlike previously proposed methods, our framework learns these characteristics from unlabeled training examples, for which we assume that an event is occurring but are not given the affected subset of nodes. By finding graphs where the highest connected subgraph score is consistently close to the highest unconstrained subset score when an event is occurring, we identify a graph structure which is optimized for event detection. Our ongoing work focuses on extending the graph structure learning framework in several directions, including learning graph structures with directed rather than undirected edges, learning graphs with weighted edges, and learning dynamic graphs where the edge structure can change over time. \section*{Acknowledgments} This work was partially supported by NSF grants IIS-0916345, IIS-0911032, and IIS-0953330. Preliminary work was presented at the 2011 International Society for Disease Surveillance Annual Conference, with a 1-page abstract published in the \emph{Emerging Health Threats Journal}. This preliminary work did not include the theoretical developments and results, the computational algorithmic advances, and the large set of comparison methods and evaluations considered here.
{'timestamp': '2017-01-09T02:01:04', 'yymm': '1701', 'arxiv_id': '1701.01470', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01470'}
arxiv
\section{Introduction} \label{introduction} Game theory is the mathematical theory that studies the conflict and cooperation between rational decision makers. Game theory helps to analyze decision making between two or more individuals who influence one another's welfare \cite{myerson2013game}. Cooperative game theory deals with coalitions and allocations, and considers group of players willing to allocate the joint benefits derived from their cooperation \cite{gonzalez2010introductory}. When the players in a game form a coalition to work together, it is essential to identify the correct way to distribute the profit among themselves. If some of the players in the coalition are unsatisfied with the proposed allocation, then they are free to leave the coalition. In stable coalitions there are fewer incentives to leave the coalition. The Shapley value provides a unique way to divide a payoff among players in such a way as to satisfy various fairness criteria. Distributing payoff to all players according to their Shapley value helps to create a stable coalition. Myerson considers the cooperation between players in an undirected graph, where each player has an equal chance to move away from a coalition by breaking the path between them \cite{myerson1977graphs}. Such games assume fair and equal gain through cooperation. This paper is motivated by the paper ``The Shapley value for directed graph games" of Anna Khmelnitskaya, Ozer Selcuk and Dolf Talman. They introduce the Shapley value for digraph games and look for its stability \cite{khmelnitskaya2016shapley}. As the structure of this paper, digraph games and the Shapley value are defined in section $2$ and the following theorem is proved in section $3$. \begin{theorem} \label{thm:neat} Consider $f:\mathbb{Z}_{\geq 0}\rightarrow \mathbb{R}$ with $f(0)=0$. Suppose $N=\{1,...,n\}$ and define $v_f : 2^N \rightarrow \mathbb{R}$ by $v_f (S)= f(|S|)$. Let $\Gamma$ be the directed cycle $(1,2,...,n,1)$. Then the Shapley value of the digraph game $(v_f,\Gamma)$ is $$Sh(v_f,\Gamma)=\left( \smash[b]{\! \underbrace{\dfrac{f(n)}{n},\dfrac{f(n)}{n},\dfrac{f(n)}{n},\cdots, \dfrac{f(n)}{n}\,}_\text{n times}}\right).$$ \end{theorem} \vspace{5mm} Finally in section $4$, Shapley values of various directed cycle games are calculated. \section{Preliminaries} A \textit{cooperative transferable utility (TU) game} is a pair $(N,v)$, where $N=\{1,...,n\}$ is a finite set of players with $n \geq 2$ and $v:2^N \rightarrow \mathbb{R}$. We interpret $v(S)$ as the payoff that the coalition $S\subseteq N$ can generate. By convention, the payoff of an empty coalition is zero \textit{i.e.} $v(\O)=0$. We refer to the set of all TU-games with fixed set of players $N$ as $\mathbb{G}^N$. For simplicity we use $v$ to refer to $(N,v)$. For any player $i\in N$, player $i$'s minimum payoff which he can guarantee to himself without joining any coalition is $v(\{i\})$ . A \textit{digraph} is a tuple $\Gamma=(N,\tau)$ where $N$ is a finite set of players and $\tau$ is a set of directed edges. A \textit{subgraph H} of $\Gamma$ is a digraph whose sets of players and directed edges are subsets of $N$ and $\tau$, respectively. The restriction of a digraph $\Gamma$ to a coalition $S$ is denoted by $\Gamma|_S$. A \textit{directed path} is a sequence $(k_1,k_2,...,k_m)$ of players such that the directed edge $(k_1,k_{i+1})$ is in $\tau$ for all $i$. A \textit{directed cycle} of players is a directed path with $k_m=k_1$. A player $j$ is \textit{successor} of player $i$ if there exists a directed path from $i\in N$ to $j\in N$ in $\Gamma$. For $i\in N$, $S^\Gamma (i)$ denotes the set of successors of $i$ in $\Gamma$ and $\bar{S}^\Gamma (i)=S^\Gamma (i)\cup \{i\}$. For digraph $\Gamma$ and $S\subseteq N$, player $i\in S$ \textit{dominates} player $j\in S$ in $\Gamma|_S$ if $j\in S^{\Gamma|_S}(i)$ and $i\notin S^{\Gamma|_S}(j) $. When a player does not have any predecessors, then he or she is \textit{undominated}. No player is dominated on directed cycle. A \textit{digraph game} is a pair $(v, \Gamma)$ of a TU-game $v\in \mathbb{G}^N$ and a digraph $\Gamma$. A permutation $\pi \in \Pi$ is \textit{consistent} in $\Gamma $ if it preserves the subordination of players determined by $\Gamma, \textit{i.e.}$, $j \succ _{\Gamma|_{\bar{P}_\pi(i)}} i$ implies $\pi(j) > \pi(i)$ . \textit{The marginal contribution} of player $i\in N$ to the coalitions in a game $v\in \mathbb{G}^N$ is given by $m_i ^v(S)=v(S\cup {i})-v(S)$. For any $i\in N$ and permutation $\pi: N\rightarrow N$, $\pi(i)$ is the position of player $i$ in $\pi$. A player $i$ is a \textit{predecessor} of player $j$ in $\Gamma$ if there exists a directed path from $i$ to $j$ in $\Gamma$. The set of predecessors of $i$ in $\pi$ is denoted $P_\pi (i)$ and $\bar{P}_\pi (i)=P_\pi (i) \cup \{i\}$. For any $i\in N$ on a TU game, the marginal contribution vector $ \bar{m}^v (\pi)\in \mathbb{R}^N$ is $\bar{m}_i^v (\pi)= m_i^v (P_\pi (i))=v(\bar{P}_\pi (i))-v(P_\pi (i))$. \textit{The Shapley value} of a TU game is $$Sh(v,\Gamma)=\sum_{\pi \in \Pi} \dfrac{\bar{m}^v (\pi)}{|\Pi^\Gamma|},$$ where $\Pi^\Gamma$ is the set of all permutations on $N$ which are consistent with $\Gamma$. In \textit{the grand coalition} $N$, players divide $v(S)$ among themselves. The outcome of this division depends on the power structure in the grand coalition. The Shapley value provides a fair way to distribute $v(N)$ among themselves \cite{gonzalez2010introductory}. \section{Results} \begin{lemma} Suppose $\Gamma$ is the cyclic digraph $(1, 2, ..., n, 1)$. The only permutations which are consistent with $\Gamma$ are $\pi_k = (-1 + k, -2 + k, ..., 1 + k, k)$, where addition is modulo $k$, for each $k = 1, ..., n$. \end{lemma} \begin{proof} \begin{figure}[!ht] \centering \begin{tikzpicture}[shorten >=1pt, auto, node distance=3cm, scale=0.5, ultra thick] \tikzstyle{node_style} = [circle,draw=black,font=\sffamily\Large\bfseries] \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick] \node[node_style,label=$1+k_n$] (v1) at (0,-1) {}; \node[node_style,label=$n$] (v2) at (0,3) {}; \node[node_style,label=$1$] (v3) at (3,5) {}; \node[node_style,label=$2$] (v4) at (6,3) {}; \node[node_style,label=$-1+k_n$] (v5) at (6,-1) {}; \node[node_style,label=$k_n$] (v6) at (3,-3) {}; \draw[dashed,->] (v1) edge (v2); \draw[->] (v2) edge (v3); \draw [->] (v3) edge (v4); \draw[dashed,->] (v4) edge (v5); \draw[->] (v5) edge (v6); \draw[->] (v6) edge (v1); \end{tikzpicture} \caption{$\Gamma$} \end{figure} \begin{figure}[!ht] \centering \begin{tikzpicture}[shorten >=1pt, auto, node distance=3cm, scale=0.5, ultra thick] \tikzstyle{node_style} = [circle,draw=black,font=\sffamily\Large\bfseries] \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick] \node[node_style,label=$1+k_n$] (v1) at (0,-1) {}; \node[node_style,label=$n$] (v2) at (0,3) {}; \node[node_style,label=$1$] (v3) at (3,5) {}; \node[node_style,label=$2$] (v4) at (6,3) {}; \node[node_style,label=$-1+k_n$] (v5) at (6,-1) {}; \draw[dashed,->] (v1) edge (v2); \draw[->] (v2) edge (v3); \draw [->] (v3) edge (v4); \draw[dashed,->] (v4) edge (v5); \end{tikzpicture} \caption{$\Gamma|_{\bar{P}_{\pi}(k_{n-1})}$} \end{figure} Suppose $\pi=(k_1,k_2,...,k_{n-1},k_n)$ is consistent, so $\bar{P}_\pi (k_{n-1})=\{k_1,k_2,...,k_{n-1}\}$. By removing $k_n$ from $\Gamma$ in Figure $1$, $\Gamma|_{\bar{P}_{\pi}(k_{n-1})}$ is the directed path $(1+k_n, 2+k_n,...,-1+k_n)$ as shown in Figure $2$. So $1+k_n \succ 2+k_n \succ ... \succ -1+k_n$. Thus by the definition of consistency, $\pi(1+k_n) > \pi (2+k_n) > ... > \pi(-1+k_n)$. It follows that $k_{n-1}=1+k_n, k_{n-2}=2+k_n,...,-1+k_n=k_1$. Hence, $\pi = \pi_{k_{n}}$ \end{proof} \begin{proof}[Proof of Theorem \ref{thm:neat}] Let $\Gamma$ be the directed cycle with a characteristic function $v_f (S)=f(|S|)$, where $S\subseteq N$ is a coalition of players. By Lemma 3.1, the number of players $n$ is equal to the number of permutations that are consistent with $\Gamma$. We know that for any player $i$, the $i^{th}$ component of the Shapley value is \begin{align*} Sh(v_f, \Gamma)_i &=\dfrac{1}{|\Pi^\Gamma|}\sum_{\pi \in \Pi^\Gamma }\bar{m}^v (\pi)\\ &=\dfrac{1}{n}\sum_{\pi \in \Pi^\Gamma }\bar{m}^v(\pi)\\ &=\dfrac{1}{n}\sum_{\pi \in \Pi^\Gamma }(v(\bar{P}_\pi (i))-v(P_\pi(i)))\\ &=\dfrac{1}{n}\sum_{\pi \in \Pi^\Gamma }(v({P}_\pi (i))\cup v(i))-v(P_\pi (i))). \end{align*} We also know $P_\pi (i)=\{j\in N|\pi(j)<\pi(i)\}$. For each $k\in \{1,...,n\}$, there exists exactly one permutation $\pi$ for which $|\bar{P}_{\pi} (i)|=k$. Since $v_f (S)=f(|S|)$, the marginal contribution of player $i\in N$ is $\sum_{j=1^n} (f(j) - f(j-1)).$. This is equivalent to $\sum_{j=1}^n (f(j)-f(j-1))$. So, \begin{align*} Sh(v_f,\Gamma)_i & =\dfrac{\sum_{j=1}^n \left(f(j)-f(j-1)\right)}{n} \\ &= \dfrac{\left(f(n)-f(n-1)\right)+ \left(f(n-1)-f(n-2)\right)+ ...+ \left(f(2-1)-f(1-1)\right)}{n}&& \end{align*} This is a telescoping sum $i.e.$ each term in the numerator cancels except the initial and final terms. Thus, Sh($V_f,\Gamma)_i= \dfrac{f(n) -f(0)}{n}=\dfrac{f(n)}{n}$. \end{proof} \section{Examples} For any coalition $S\subseteq N$ and $k\in \mathbb{N}$, consider the characteristic function defined as $v_k(S) = |S|^k$ on digraph $\Gamma$. \begin{figure}[!ht]\ \centering \begin{tikzpicture}[shorten >=1pt, auto, node distance=3cm,scale=0.7, ultra thick] \tikzstyle{node_style} = [circle,draw=black,font=\sffamily\Large\bfseries] \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick] \node[node_style] (v1) at (3,3) {2}; \node[node_style] (v2) at (6,0) {3}; \node[node_style] (v6) at (0,0) {1}; \draw[->] (v1) edge (v2); \draw[->] (v2) edge (v6); \draw[->] (v6) edge (v1); \end{tikzpicture} \caption{Digraph $\Gamma$} \end{figure} Consider a cyclic digraph game $(v,\Gamma)$ with three different players as shown in Figure $3$. The set of all permutations that is consistent with $\Gamma$ is $\{(1,3,2),(2,1,3),(3,2,1)\}$. For $k=0, Sh(v_0,\Gamma)=\left(\dfrac{1}{3},\dfrac{1}{3},\dfrac{1}{3}\right).$ For $k=1, Sh(v_1,\Gamma)=(1,1,1).$ For $k=2, Sh(v_2,\Gamma)=(3,3,3).$ For $k=3, Sh(v_3,\Gamma)=(9,9,9). $ For $k=4, Sh(v_4,\Gamma)=(27,27,27)$, and so on.\\ \begin{figure}[!ht] \centering \begin{tikzpicture}[shorten >=1pt, scale=0.7,auto, node distance=3cm, ultra thick] \tikzstyle{node_style} = [circle,draw=black,font=\sffamily\Large\bfseries] \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick] \node[node_style] (v1) at (3,3) {2}; \node[node_style] (v2) at (6,0) {3}; \node[node_style] (v3) at (3,-3) {4}; \node[node_style] (v6) at (0,0) {1}; \draw[->] (v1) edge (v2); \draw[->] (v2) edge (v3); \draw[->] (v3) edge (v6); \draw[->] (v6) edge (v1); \end{tikzpicture} \caption{Digraph $\Gamma'$} \end{figure} Again, consider a cyclic digraph game $(v,\Gamma')$ with four different players as shown in Figure $4$. The set of all permutations that is consistent with $\Gamma'$ is $\{(1,4,3,2),(2,1,4,3),(3,2,1,4),(4,3,2,1)\}$. For $k=0, Sh(v_0,\Gamma')=\left(\dfrac{1}{4},\dfrac{1}{4},\dfrac{1}{4},\dfrac{1}{4}\right).$ For $k=1, Sh(v_1,\Gamma')=(1,1,1,1).$ For $k=2, Sh(v_2,\Gamma')=(4,4,4,4).$ For $k=3, Sh(v_3,\Gamma')=(16,16,16,16). $ For $k=4, Sh(v_4,\Gamma')=(64,64,64,64),$ and so on. \begin{figure}[!ht] \centering \begin{tikzpicture}[shorten >=1pt, auto, node distance=3cm, scale=0.5, ultra thick] \tikzstyle{node_style} = [circle,draw=black,font=\sffamily\Large\bfseries] \tikzstyle{edge_style} = [draw=black, line width=2, ultra thick] \node[node_style] (v1) at (4,3) {2}; \node[node_style] (v2) at (8,0) {3}; \node[node_style] (v3) at (6,-4) {4}; \node[node_style] (v4) at (2,-4) {5}; \node[node_style] (v5) at (0,0) {1}; \draw[->] (v1) edge (v2); \draw[->] (v2) edge (v3); \draw[->] (v3) edge (v4); \draw[->] (v4) edge (v5); \draw[->] (v5) edge (v1); \end{tikzpicture} \caption{Digraph $\Gamma''$} \end{figure} As shown in Figure $5$, consider a cyclic digraph game $(v,\Gamma'')$ with five different players. The set of all permutations that is consistent with $\Gamma''$ is $\{(1,5,4,3,2),(2,1,5,4,3),(3,2,1,5,4),(4,3,2,1,5),\\(5,4,3,2,1)\}$. For $k=0, Sh(v_0,\Gamma'')=\left(\dfrac{1}{5},\dfrac{1}{5},\dfrac{1}{5},\dfrac{1}{5},\dfrac{1}{5}\right).$ For $k=1, Sh(v_1,\Gamma'')=(1,1,1,1,1).$ For $k=2, Sh(v_2,\Gamma'')=(5,5,5,5,5).$ For $k=3, Sh(v_3,\Gamma'')=(25,25,25,25,25). $ For $k=4, Sh(v_4,\Gamma'')=(125,125,125,125,125), $ and so on. \newpage \bibliographystyle{unsrt}
{'timestamp': '2017-06-09T02:00:44', 'yymm': '1701', 'arxiv_id': '1701.01677', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01677'}
arxiv
\section*{Game of Heads-Up No-Limit Texas Hold'em} Heads-up no-limit Texas hold'em ({HUNL}{}) is a two-player poker game. It is a repeated game, in which the two players play a match of individual games, usually called hands, while alternating who is the dealer. In each of the individual games, one player will win some number of chips from the other player, and the goal is to win as many chips as possible over the course of the match. Each individual game begins with both players placing a number of chips in the pot: the player in the dealer position puts in the small blind, and the other player puts in the big blind, which is twice the small blind amount. During a game, a player can only wager and win up to a fixed amount known as their stack. In the particular format of {HUNL}{} used in the Annual Computer Poker Competition~\cite{ZinkevichLittman06} and this article, the big blind is 100 chips and the stack is 20,000 chips or 200 big blinds. Resetting the stacks after each game is called ``Doyle's Game'', named for the professional poker player Doyle Brunson who publicized this variant~\cite{Gilpin08:Tartanian}. It is used in the Annual Computer Poker Competitions because it allows for each game to be an independent sample of the same game. A game of {HUNL}{} progresses through four rounds: the pre-flop, flop, turn, and river. Each round consists of cards being dealt followed by player actions in the form of wagers as to who will hold the strongest hand at the end of the game. In the pre-flop, each player is given two private cards, unobserved by their opponent. In the later rounds, cards are dealt face-up in the center of the table, called public cards. A total of five public cards are revealed over the four rounds: three on the flop, one on the turn, and one on the river. After the cards for the round are dealt, players alternate taking actions of three types: fold, call, or raise. A player folds by declining to match the last opponent wager, thus forfeiting to the opponent all chips in the pot and ending the game with no player revealing their private cards. A player calls by adding chips into the pot to match the last opponent wager, which causes the next round to begin. A player raises by adding chips into the pot to match the last wager followed by adding additional chips to make a wager of their own. At the beginning of a round when there is no opponent wager yet to match, the raise action is called bet, and the call action is called check, which only ends the round if both players check. An all-in wager is one involving all of the chips remaining the player's stack. If the wager is called, there is no further wagering in later rounds. The size of any other wager can be any whole number of chips remaining in the player's stack, as long as it is not smaller than the last wager in the current round or the big blind. The dealer acts first in the pre-flop round and must decide whether to fold, call, or raise the opponent's big blind bet. In all subsequent rounds, the non-dealer acts first. If the river round ends with no player previously folding to end the game, the outcome is determined by a showdown. Each player reveals their two private cards and the player that can form the strongest five-card poker hand (see ``List of poker hand categories'' on Wikipedia; accessed January 1, 2017) wins all the chips in the pot. To form their hand each player may use any cards from their two private cards and the five public cards. At the end of the game, whether ended by fold or showdown, the players will swap who is the dealer and begin the next game. Since the game can be played for different stakes, such as a big blind being worth \$0.01 or \$1 or \$1000, players commonly measure their performance over a match as their average number of big blinds won per game. Researchers have standardized on the unit milli-big-blinds per game, or mbb/g, where one milli-big-blind is one thousandth of one big blind. A player that always folds will lose 750 mbb/g (by losing 1000 mbb as the big blind and 500 as the small blind). A human rule-of-thumb is that a professional should aim to win at least 50 mbb/g from their opponents. Milli-big-blinds per game is also used as a unit of exploitability, when it is computed as the expected loss per game against a worst-case opponent. In the poker community, it is common to use big blinds per one hundred games (bb/100) to measure win rates, where 10 mbb/g equals 1 bb/100. \section*{Poker Glossary} \begin{description} \item[all-in] A wager of the remainder of a player's stack. The opponent's only response can be call or fold. \item[bet] The first wager in a round; putting more chips into the pot. \item[big blind] Initial wager made by the non-dealer before any cards are dealt. The big blind is twice the size of the small blind. \item[call] Putting enough chips into the pot to match the current wager; ends the round. \item[check] Declining to wager any chips when not facing a bet. \item[chip] Marker representing value used for wagers; all wagers must be a whole numbers of chips. \item[dealer] The player who puts the small blind into the pot. Acts first on round 1, and second on the later rounds. Traditionally, they would distribute public and private cards from the deck. \item[flop] The second round; can refer to either the 3 revealed public cards, or the betting round after these cards are revealed. \item[fold] Give up on the current game, forfeiting all wagers placed in the pot. Ends a player's participation in the game. \item[hand] Many different meanings: the combination of the best 5 cards from the public cards and private cards, just the private cards themselves, or a single game of poker (for clarity, we avoid this final meaning). \item[milli-big-blinds per game (mbb/g)] Average winning rate over a number of games, measured in thousandths of big blinds. \item[pot] The collected chips from all wagers. \item[pre-flop] The first round; can refer to either the hole cards, or the betting round after these cards are distributed. \item[private cards] Cards dealt face down, visible only to one player. Used in combination with public cards to create a hand. Also called hole cards. \item[public cards] Cards dealt face up, visible to all players. Used in combination with private cards to create a hand. Also called community cards. \item[raise] Increasing the size of a wager in a round, putting more chips into the pot than is required to call the current bet. \item[river] The fourth and final round; can refer to either the 1 revealed public card, or the betting round after this card is revealed. \item[showdown] After the river, players who have not folded show their private cards to determine the player with the best hand. The player with the best hand takes all of the chips in the pot. \item[small blind] Initial wager made by the dealer before any cards are dealt. The small blind is half the size of the big blind. \item[stack] The maximum amount of chips a player can wager or win in a single game. \item[turn] The third round; can refer to either the 1 revealed public card, or the betting round after this card is revealed. \end{description} \section*{Performance Against Professional Players} To assess DeepStack relative to expert humans, players were recruited with assistance from the International Federation of Poker~\cite{IFP} to identify and recruit professional poker players through their member nation organizations. We only selected participants from those who self-identified as a ``professional poker player'' during registration. Players were given four weeks to complete a 3,000 game match. To incentivize players, monetary prizes of \$5,000, \$2,500, and \$1,250 (CAD) were awarded to the top three players (measured by AIVAT) that completed their match. The participants were informed of all of these details when they registered to participate. Matches were played between November 7th and December 12th, 2016, and run using an online user interface~\cite{DustinGUISource} where players had the option to play up to four games simultaneously as is common in online poker sites. A total of 33 players from 17 countries played against DeepStack. DeepStack's performance against each individual is presented in Table~\ref{tab-human}, with complete game histories available as part of the supplementary online materials. \begin{table}[!hp] \centering \small \caption{Results against professional poker players estimated with AIVAT (Luck Adjusted Win Rate) and chips won (Unadjusted Win Rate), both measured in mbb/g. Recall 10mbb/g equals 1bb/100. Each estimate is followed by a 95\% confidence interval. $\ddagger$ marks a participant who completed the 3000 games after their allotted four week period.} \label{tab-human} \fboxrule0.2pt \fboxsep0pt \begin{tabular}{m{0.21\textwidth}m{0.03\textwidth}|rrr@{~$\pm$~}R{0.0485\textwidth}r@{~$\pm$~}R{0.0605\textwidth}} \toprule Player & & Rank & Hands & \multicolumn{2}{r}{\begin{tabular}{c}Luck Adjusted\\Win Rate\end{tabular}} & \multicolumn{2}{r}{\begin{tabular}{c}Unadjusted\\Win Rate\end{tabular}} \\ \midrule Martin Sturc & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Austria}} & 1 & 3000 & $70$ & $119$ & $-515$ & $575$ \\ Stanislav Voloshin & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Ukraine}} & 2 & 3000 & $126$ & $103$ & $-65$ & $648$ \\ Prakshat Shrimankar & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/India}} & 3 & 3000 & $139$ & $97$ & $174$ & $667$ \\ Ivan Shabalin & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Russia}} & 4 & 3000 & $170$ & $99$ & $153$ & $633$ \\ Lucas Schaumann & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Germany}} & 5 & 3000 & $207$ & $87$ & $160$ & $576$ \\ Phil Laak & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/United_States}} & 6 & 3000 & $212$ & $143$ & $774$ & $677$ \\ Kaishi Sun & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/China}} & 7 & 3000 & $363$ & $116$ & $5$ & $729$ \\ Dmitry Lesnoy & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Cyprus}} & 8 & 3000 & $411$ & $138$ & $-87$ & $753$ \\ Antonio Parlavecchio & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Italy}} & 9 & 3000 & $618$ & $212$ & $1096$ & $962$ \\ Muskan Sethi & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/India}} & 10 & 3000 & $1009$ & $184$ & $2144$ & $1019$ \\ \midrule \midrule Pol Dmit\textsuperscript{$\ddagger$} & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Russia}} & -- & 3000 & $1008$ & $156$ & $883$ & $793$ \\ Tsuneaki Takeda & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Japan}} & -- & 1901 & $628$ & $231$ & $-332$ & $1228$ \\ Youwei Qin & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Australia}} & -- & 1759 & $1311$ & $331$ & $1958$ & $1799$ \\ Fintan Gavin & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Ireland}} & -- & 1555 & $635$ & $278$ & $-26$ & $1647$ \\ Giedrius Talacka & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Lithuania}} & -- & 1514 & $1063$ & $338$ & $459$ & $1707$ \\ Juergen Bachmann & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Germany}} & -- & 1088 & $527$ & $198$ & $1769$ & $1662$ \\ Sergey Indenok & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Russia}} & -- & 852 & $881$ & $371$ & $253$ & $2507$ \\ Sebastian Schwab & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Germany}} & -- & 516 & $1086$ & $598$ & $1800$ & $2162$ \\ Dara O'Kearney & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Ireland}} & -- & 456 & $78$ & $250$ & $223$ & $1688$ \\ Roman Shaposhnikov & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Russia}} & -- & 330 & $131$ & $305$ & $-898$ & $2153$ \\ Shai Zurr & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Israel}} & -- & 330 & $499$ & $360$ & $1154$ & $2206$ \\ Luca Moschitta & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Italy}} & -- & 328 & $444$ & $580$ & $1438$ & $2388$ \\ Stas Tishekvich & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Israel}} & -- & 295 & $-45$ & $433$ & $-346$ & $2264$ \\ Eyal Eshkar & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Israel}} & -- & 191 & $18$ & $608$ & $715$ & $4227$ \\ Jefri Islam & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Austria}} & -- & 176 & $997$ & $700$ & $3822$ & $4834$ \\ Fan Sun & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/China}} & -- & 122 & $531$ & $774$ & $-1291$ & $5456$ \\ Igor Naumenko & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Ukraine}} & -- & 102 & $-137$ & $638$ & $851$ & $1536$ \\ Silvio Pizzarello & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Italy}} & -- & 90 & $1500$ & $2100$ & $5134$ & $6766$ \\ Gaia Freire & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Brazil}} & -- & 76 & $369$ & $136$ & $138$ & $694$ \\ Alexander B\"{o}s & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Austria}} & -- & 74 & $487$ & $756$ & $1$ & $2628$ \\ Victor Santos & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Brazil}} & -- & 58 & $475$ & $462$ & $-1759$ & $2571$ \\ Mike Phan & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Argentina}} & -- & 32 & $-1019$ & $2352$ & $-11223$ & $18235$ \\ Juan Manuel Pastor & \fbox{\includegraphics[width=\linewidth]{figs/flags/wiki/Spain}} & -- & 7 & $2744$ & $3521$ & $7286$ & $9856$ \\ \midrule Human Professionals & & & 44852 & $486$ & $40$ & $492$ & $220$ \\ \bottomrule \end{tabular} \end{table} \section*{Local Best Response of DeepStack} The goal of DeepStack, and much of the work on AI in poker, is to approximate a Nash equilibrium, i.e., produce a strategy with low exploitability. The size of HUNL makes an explicit best-response computation intractable and so exact exploitability cannot be measured. A common alternative is to play two strategies against each other. However, head-to-head performance in imperfect information games has repeatedly been shown to be a poor estimation of equilibrium approximation quality. For example, consider an exact Nash equilibrium strategy in the game of Rock-Paper-Scissors playing against a strategy that almost always plays ``rock''. The results are a tie, but their playing strengths in terms of exploitability are vastly different. This same issue has been seen in heads-up limit Texas hold'em as well (Johanson, IJCAI 2011), where the relationship between head-to-head play and exploitability, which is tractable in that game, is indiscernible. The introduction of local best response (LBR) as a technique for finding a lower-bound on a strategy's exploitability gives evidence of the same issue existing in HUNL. Act1 and Slumbot (second and third place in the previous ACPC) were statistically indistinguishable in head-to-head play (within 20 mbb/g), but Act1 is 1300mbb/g less exploitable as measured by LBR. This is why we use LBR to evaluate DeepStack. LBR is a simple, yet powerful, technique to produce a lower bound on a strategy's exploitability in HUNL~\cite{Lisy17:LocalBR} . It explores a fixed set of options to find a ``locally'' good action against the strategy. While it seems natural that more options would be better, this is not always true. More options may cause it to find a locally good action that misses out on a future opportunity to exploit an even larger flaw in the opponent. In fact, LBR sometimes results in larger lower bounds when not considering any bets in the early rounds, so as to increase the size of the pot and thus the magnitude of a strategy's future mistakes. LBR was recently used to show that abstraction-based agents are significantly exploitable (see Table~\ref{tab-localbr}). The first three strategies are submissions from recent Annual Computer Poker Competitions. They all use both card and action abstraction and were found to be even more exploitable than simply folding every game in all tested cases. The strategy ``Full Cards'' does not use any card abstraction, but uses only the sparse fold, call, pot-sized bet, all-in betting abstraction using hard translation~\cite{Schnizlein09:Translation}. Due to computation and memory requirements, we computed this strategy only for a smaller stack of 100 big blinds. Still, this strategy takes almost 2TB of memory and required approximately 14 CPU years to solve. Naturally, it cannot be exploited by LBR within the betting abstraction, but it is heavily exploitable in settings using other betting actions that require it to translate its opponent's actions, again losing more than if it folded every game. As for DeepStack, under all tested settings of LBR's available actions, it fails to find any exploitable flaw. In fact, it is losing 350 mbb/g or more to DeepStack. Of particular interest is the final column aimed to exploit DeepStack's flop strategy. The flop is where DeepStack is most dependent on its counterfactual value networks to provide it estimates through the end of the game. While these experiments do not prove that DeepStack is flawless, it does suggest its flaws require a more sophisticated search procedure than what is needed to exploit abstraction-based programs. \begin{table} \centering \caption{Exploitability lower bound of different programs using local best response (LBR). LBR evaluates only the listed actions in each round as shown in each row. F, C, P, A, refer to fold, call, a pot-sized bet, and all-in, respectively. 56bets includes the actions fold, call and 56 equidistant pot fractions as defined in the original LBR paper \cite{Lisy17:LocalBR}. $\ddagger$: Always Fold checks when not facing a bet, and so it cannot be maximally exploited without a betting action.} \label{tab-localbr} \begin{tabular}{cc|rrrr} \toprule \multicolumn{2}{c}{~} & \multicolumn{4}{c}{Local best response performance (mbb/g)}\\ \midrule \multirow{4}{*}{LBR Settings} & Pre-flop & \multicolumn{1}{c}{F, C} & \multicolumn{1}{c}{C} & \multicolumn{1}{c}{C} & \multicolumn{1}{c}{C}\\ & Flop & \multicolumn{1}{c}{F, C} & \multicolumn{1}{c}{C} & \multicolumn{1}{c}{C} & \multicolumn{1}{c}{56bets}\\ & Turn & \multicolumn{1}{c}{F, C} & \multicolumn{1}{c}{F, C, P, A} & \multicolumn{1}{c}{56bets} & \multicolumn{1}{c}{F, C}\\ & River& \multicolumn{1}{c}{F, C} & \multicolumn{1}{c}{F, C, P, A} & \multicolumn{1}{c}{56bets} & \multicolumn{1}{c}{F, C}\\ \midrule \multicolumn{2}{c|}{Hyperborean (2014)} & 721 $\pm$ 56 & 3852 $\pm$ 141 & 4675 $\pm$ 152 & 983 $\pm$ ~~95 \\ \multicolumn{2}{c|}{Slumbot (2016)} & 522 $\pm$ 50 & 4020 $\pm$ 115 & 3763 $\pm$ 104 & 1227 $\pm$ ~~79 \\ \multicolumn{2}{c|}{Act1 (2016)} & 407 $\pm$ 47 & 2597 $\pm$ 140 & 3302 $\pm$ 122 & 847 $\pm$ ~~78\\ \multicolumn{2}{c|}{Always Fold} & $\ddagger$250 $\pm$ ~~0 & 750 $\pm$ ~~~~0 & 750 $\pm$ ~~~~0 & 750 $\pm$ ~~~~0 \\ \multicolumn{2}{c|}{Full Cards [100 BB]} & -424 $\pm$ 37 & -536 $\pm$ ~~87 & 2403 $\pm$ ~~87 & 1008 $\pm$ ~~68 \\ \multicolumn{2}{c|}{\cellcolor[HTML]{C0C0C0} DeepStack} & \cellcolor[HTML]{C0C0C0}-428 $\pm$ 87 & \cellcolor[HTML]{C0C0C0}-383 $\pm$ 219 & \cellcolor[HTML]{C0C0C0}-775 $\pm$ 255 & \cellcolor[HTML]{C0C0C0}-602 $\pm$ 214\\ \bottomrule \end{tabular} \end{table} \section*{DeepStack Implementation Details} Here we describe the specifics for how DeepStack employs continual re-solving and how its deep counterfactual value networks were trained. \subsection*{Continual Re-Solving} As with traditional re-solving, the re-solving step of the DeepStack algorithm solves an augmented game. The augmented game is designed to produce a strategy for the player such that the bounds for the opponent's counterfactual values are satisfied. DeepStack uses a modification of the original CFR-D gadget~\cite{cprg:cfrd} for its augmented game, as discussed below. While the max-margin gadget~\cite{Moravcik16:Subgames} is designed to improve the performance of poor strategies for abstracted agents near the end of the game, the CFR-D gadget performed better in early testing. The algorithm DeepStack uses to solve the augmented game is a hybrid of vanilla CFR \cite{ZinkevichEtAl07} and CFR$^+$ \cite{Tammelin15:CFR+}, which uses regret matching$^+$ like CFR$^+$, but does uniform weighting and simultaneous updates like vanilla CFR. When computing the final average strategy and average counterfactual values, we omit the early iterations of CFR in the averages. A major design goal for DeepStack's implementation was to typically play at least as fast as a human would using commodity hardware and a single GPU. The degree of lookahead tree sparsity and the number of re-solving iterations are the principle decisions that we tuned to achieve this goal. These properties were chosen separately for each round to achieve a consistent speed on each round. Note that DeepStack has no fixed requirement on the density of its lookahead tree besides those imposed by hardware limitations and speed constraints. The lookahead trees vary in the actions available to the player acting, the actions available for the opponent's response, and the actions available to either player for the remainder of the round. We use the end of the round as our depth limit, except on the turn when the remainder of the game is solved. On the pre-flop and flop, we use trained counterfactual value networks to return values after the flop or turn card(s) are revealed. Only applying our value function to public states at the start of a round is particularly convenient in that that we don't need to include the bet faced as an input to the function. Table~\ref{tab-lookahead} specifies lookahead tree properties for each round. \def\textonehalf{}P{\textonehalf{}P} \def2P{2P} \begin{table}[tb] \centering \caption{Lookahead re-solving specifics by round. The abbreviations of F, C, \textonehalf{}P, P, 2P, and A refer to fold, call, half of a pot-sized bet, a pot-sized bet, twice a pot-sized bet, and all in, respectively. The final column specifies which neural network was used when the depth limit was exceeded: the flop, turn, or the auxiliary network. \label{tab-lookahead}} {\small\begin{tabular}{l|llllll} \toprule & CFR & Omitted & First & Second & Remaining & NN \\ Round & Iterations & Iterations & Action & Action & Actions & Eval \\ \midrule Pre-flop & 1000 & 980 & F, C, \textonehalf{}P, P, A & F, C, \textonehalf{}P, P, 2P, A & F, C, P, A & Aux/Flop \\ Flop & 1000 & 500 & F, C, \textonehalf{}P, P, A & F, C, P, A & F, C, P, A & Turn\\ Turn & 1000 & 500 & F, C, \textonehalf{}P, P, A & F, C, P, A & F, C, P, A & --- \\ River & 2000 & 1000 & F, C, \textonehalf{}P, P, 2P, A & F, C, \textonehalf{}P, P, 2P, A & F, C, P, A & --- \\ \bottomrule \end{tabular}} \end{table} The pre-flop round is particularly expensive as it requires enumerating all 22,100 possible public cards on the flop and evaluating each with the flop network. To speed up pre-flop play, we trained an additional auxiliary neural network to estimate the expected value of the flop network over all possible flops. However, we only used this network during the initial omitted iterations of CFR. During the final iterations used to compute the average strategy and counterfactual values, we did the expensive enumeration and flop network evaluations. Additionally, we cache the re-solving result for every observed pre-flop situation. When the same betting sequence occurs again, we simply reuse the cached results rather than recomputing. For the turn round, we did not use a neural network after the final river card, but instead solved to the end of the game. However, we used a bucketed abstraction for all actions on the river. For acting on the river, the re-solving includes the remainder of the game and so no counterfactual value network was used. \paragraph*{Actions in Sparse Lookahead Trees.} DeepStack's sparse lookahead trees use only a small subset of the game's possible actions. The first layer of actions immediately after the current public state defines the options considered for DeepStack's next action. The only purpose of the remainder of the tree is to estimate counterfactual values for the first layer during the CFR algorithm. Table~\ref{tab:cfvs} presents how well counterfactual values can be estimated using sparse lookahead trees with various action subsets. \begin{table}[tb] \centering \caption{Absolute ($L_1$), Euclidean ($L_2$), and maximum absolute ($L_{\infty}$) errors, in mbb/g, of counterfactual values computed with 1,000 iterations of CFR on sparse trees, averaged over 100 random river situations. The ground truth values were estimated by solving the game with 9 betting options and 4,000 iterations (first row). } \label{tab:cfvs} \begin{tabular}{lr|rrr } \toprule Betting & Size & $L_1$ & $L_2$ & $L_\infty$ \\ \midrule F, C, Min, \textonequarter{}P, \textonehalf{}P, \textthreequarters{}P, P, 2P, 3P, 10P, A [4,000 iterations] & 555k & 0.0 & 0.0 & 0.0 \\ F, C, Min, \textonequarter{}P, \textonehalf{}P, \textthreequarters{}P, P, 2P, 3P, 10P, A & 555k & 18.06 & 0.891 & 0.2724 \\ F, C, 2P, A & 48k & 64.79 & 2.672 & 0.3445\\ F, C, \textonehalf{}P, A & 100k & 58.24 & 3.426 & 0.7376 \\ F, C, P, A & 61k & 25.51 & 1.272 & 0.3372 \\ F, C, \textonehalf{}P, P, A & 126k & 41.42 & 1.541 & 0.2955 \\ F, C, P, 2P, A & 204k & 27.69 & 1.390 & 0.2543 \\ F, C, \textonehalf{}P, P, 2P, A & 360k & 20.96 & 1.059 & 0.2653 \\ \bottomrule \end{tabular} \end{table} The results show that the F, C, P, A, actions provide an excellent tradeoff between computational requirements via the size of the solved lookahead tree and approximation quality. Using more actions quickly increases the size of the lookahead tree, but does not substantially improve errors. Alternatively, using a single betting action that is not one pot has a small effect on the size of the tree, but causes a substantial error increase. To further investigate the effect of different betting options, Table~\ref{tab-lbr_various_actions} presents the results of evaluating DeepStack with different action sets using LBR. We used setting of LBR that proved most effective against the default set of DeepStack actions (see Table~\ref{tab-lookahead}). While the extent of the variance in the 10,000 hand evaluation shown in Table~\ref{tab-lbr_various_actions} prevents us from declaring a best set of actions with certainty, the crucial point is that LBR is significantly losing to each of them, and that we can produce play that is difficult to exploit even choosing from a small number of actions. Furthermore, the improvement of a small number of additional actions is not dramatic. \begin{table}[tb] \centering \caption{Performance of LBR exploitation of DeepStack with different actions allowed on the first level of its lookahead tree using the best LBR configuration against the default version of DeepStack. LBR cannot exploit DeepStack regardless of its available actions.} \label{tab-lbr_various_actions} \begin{tabular}{lr} \toprule First level actions & LBR performance\\ \midrule F, C, P, A & -479 $\pm$ 216\\ Default & -383 $\pm$ 219\\ F, C, \textonehalf{}P, P, 1\textonehalf{}P, 2P, A & -406 $\pm$ 218\\ \bottomrule \end{tabular} \end{table} \paragraph*{Opponent Ranges in Re-Solving.} Continual re-solving does not require keeping track of the opponent's range. The re-solving step essentially reconstructs a suitable range using the bounded counterfactual values. In particular, the CFR-D gadget does this by giving the opponent the option, after being dealt a uniform random hand, of terminating the game (T) instead of following through with the game (F), allowing them to simply earn that hand's bound on its counterfactual value. Only hands which are valuable to bring into the subgame will then be observed by the re-solving player. However, this process of the opponent learning which hands to follow through with can make re-solving require many iterations. An estimate of the opponent's range can be used to effectively warm-start the choice of opponent ranges, and help speed up the re-solving. One conservative option is to replace the uniform random deal of opponent hands with any distribution over hands as long as it assigns non-zero probability to every hand. For example, we could linearly combine an estimated range of the opponent from the previous re-solve (with weight $b$) and a uniform range (with weight $1-b$). This approach still has the same theoretical guarantees as re-solving, but can reach better approximate solutions in fewer iterations. Another option is more aggressive and sacrifices the re-solving guarantees when the opponent's range estimate is wrong. It forces the opponent with probability $b$ to follow through into the game with a hand sampled from the estimated opponent range. With probability $1-b$ they are given a uniform random hand and can choose to terminate or follow through. This could prevent the opponent's strategy from reconstructing a correct range, but can speed up re-solving further when we have a good opponent range estimate. DeepStack uses an estimated opponent range during re-solving only for the first action of a round, as this is the largest lookahead tree to re-solve. The range estimate comes from the last re-solve in the previous round. When DeepStack is second to act in the round, the opponent has already acted, biasing their range, so we use the conservative approach. When DeepStack is first to act, though, the opponent could only have checked or called since our last re-solve. Thus, the lookahead has an estimated range following their action. So in this case, we use the aggressive approach. In both cases, we set $b=0.9$. \paragraph{Speed of Play.} The re-solving computation and neural network evaluations are both implemented in Torch7~\cite{collobert2011torch7} and run on a single NVIDIA GeForce GTX 1080 graphics card. This makes it possible to do fast batched calls to the counterfactual value networks for multiple public subtrees at once, which is key to making DeepStack fast. Table \ref{tab-times} reports the average times between the end of the previous (opponent or chance) action and submitting the next action by both humans and DeepStack in our study. DeepStack, on average, acted considerably faster than our human players. It should be noted that some human players were playing up to four games simultaneously (although few players did more than two), and so the human players may have been focused on another game when it became their turn to act. \begin{table}[tb] \centering \caption{Thinking times for both humans and DeepStack. DeepStack's extremely fast pre-flop speed shows that pre-flop situations often resulted in cache hits.} \label{tab-times} \begin{tabular}{l|ll|ll} \toprule & \multicolumn{4}{c}{Thinking Time (s)} \\ & \multicolumn{2}{c}{Humans} & \multicolumn{2}{c}{DeepStack} \\ Round & Median & Mean & Median & Mean \\ \midrule Pre-flop & 10.3 & 16.2 & 0.04 & 0.2 \\ Flop & 9.1 & 14.6 & 5.9 & 5.9 \\ Turn & 8.0 & 14.0 & 5.4 & 5.5 \\ River & 9.5 & 16.2 & 2.2 & 2.1 \\ \midrule Per Action & 9.6 & 15.4 & 2.3 & 3.0 \\ Per Hand & 22.0 & 37.4 & 5.7 & 7.2 \\ \bottomrule \end{tabular} \end{table} \subsection*{Deep Counterfactual Value Networks} DeepStack uses two counterfactual value networks, one for the flop and one for the turn, as well as an auxiliary network that gives counterfactual values at the end of the pre-flop. In order to train the networks, we generated random poker situations at the start of the flop and turn. Each poker situation is defined by the pot size, ranges for both players, and dealt public cards. The complete betting history is not necessary as the pot and ranges are a sufficient representation. The output of the network are vectors of counterfactual values, one for each player. The output values are interpreted as fractions of the pot size to improve generalization across poker situations. The training situations were generated by first sampling a pot size from a fixed distribution which was designed to approximate observed pot sizes from older HUNL programs.\footnote{The fixed distribution selects an interval from the set of intervals $\{[100, 100),$ $[200,400),$ $[400, 2000),$ $[2000, 6000),$ $[6000, 19950]\}$ with uniform probability, followed by uniformly selecting an integer from within the chosen interval.} The player ranges for the training situations need to cover the space of possible ranges that CFR might encounter during re-solving, not just ranges that are likely part of a solution. So we generated pseudo-random ranges that attempt to cover the space of possible ranges. We used a recursive procedure $R(S, p)$, that assigns probabilities to the hands in the set $S$ that sum to probability $p$, according to the following procedure. \begin{enumerate} \item If $|S| =1$, then $\Pr(s) = p$. \item Otherwise, \begin{enumerate} \item Choose $p_1$ uniformly at random from the interval $(0, p)$, and let $p_2 = p-p_1$. \item Let $S_1 \subset S$ and $S_2 = S \setminus S_1$ such that $|S_1| = \left\lfloor|S|/2\right\rfloor$ and all of the hands in $S_1$ have a hand strength no greater than hands in $S_2$. Hand strength is the probability of a hand beating a uniformly selected random hand from the current public state. \item Use $R(S_1, p_1)$ and $R(S_2, p_2)$ to assign probabilities to hands in $S=S_1 \bigcup S_2$. \end{enumerate} \end{enumerate} Generating a range involves invoking $R(\mbox{\em all hands}, 1)$. To obtain the target counterfactual values for the generated poker situations for the main networks, the situations were approximately solved using 1,000 iterations of CFR$^+$ with only betting actions fold, call, a pot-sized bet, and all-in. For the turn network, ten million poker turn situations (from after the turn card is dealt) were generated and solved with 6,144 CPU cores of the Calcul Qu\'{e}bec MP2 research cluster, using over 175 core years of computation time. For the flop network, one million poker flop situations (from after the flop cards are dealt) were generated and solved. These situations were solved using DeepStack's depth limited solver with the turn network used for the counterfactual values at public states immediately after the turn card. We used a cluster of 20 GPUS and one-half of a GPU year of computation time. For the auxiliary network, ten million situations were generated and the target values were obtained by enumerating all 22,100 possible flops and averaging the counterfactual values from the flop network's output. \paragraph*{Neural Network Training.} All networks were trained using built-in Torch7 libraries, with the Adam stochastic gradient descent procedure \cite{kingma2014adam} minimizing the average of the Huber losses~\cite{huber1964} over the counterfactual value errors. Training used a mini-batch size of 1,000, and a learning rate 0.001, which was decreased to 0.0001 after the first 200 epochs. Networks were trained for approximately 350 epochs over two days on a single GPU, and the epoch with the lowest validation loss was chosen. \paragraph*{Neural Network Range Representation.} In order to improve generalization over input player ranges, we map the distribution of individual hands (combinations of public and private cards) into distributions of buckets. The buckets were generated using a clustering-based abstraction technique, which cluster strategically similar hands using $k$-means clustering with earth mover's distance over hand-strength-like features~\cite{Johanson13:Abstraction,Ganzfried14:EMD}. For both the turn and flop networks we used 1,000 clusters and map the original ranges into distributions over these clusters as the first layer of the neural network (see Figure~3 of the main article). This bucketing step was not used on the auxiliary network as there are only 169 strategically distinct hands pre-flop, making it feasible to input the distribution over distinct hands directly. \paragraph*{Neural Network Accuracies.} The turn network achieved an average Huber loss of 0.016 of the pot size on the training set and 0.026 of the pot size on the validation set. The flop network, with a much smaller training set, achieved an average Huber loss of 0.008 of the pot size on the training set, but 0.034 of the pot size on the validation set. Finally, the auxiliary network had average Huber losses of 0.000053 and 0.000055 on the training and validation set, respectively. Note that there are, in fact, multiple Nash equilibrium solutions to these poker situations, with each giving rise to different counterfactual value vectors. So, these losses may overestimate the true loss as the network may accurately model a different equilibrium strategy. \paragraph*{Number of Hidden Layers.} We observed in early experiments that the neural network had a lower validation loss with an increasing number of hidden layers. From these experiments, we chose to use seven hidden layers in an attempt to tradeoff accuracy, speed of execution, and the available memory on the GPU. The result of a more thorough experiment examining the turn network accuracy as a function of the number of hidden layers is in Figure~\ref{fig:nn-errors-by-layers}. It appears that seven hidden layers is more than strictly necessary as the validation error does not improve much beyond five. However, all of these architectures were trained using the same ten million turn situations. With more training data it would not be surprising to see the larger networks see a further reduction in loss due to their richer representation power. \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{figs/nn-errors-by-layers} \caption{Huber loss with different numbers of hidden layers in the neural network.}\label{fig:nn-errors-by-layers} \end{figure} \section*{Proof of Theorem 1} The formal proof of Theorem 1, which establishes the soundness of DeepStack's depth-limited continual re-solving, is conceptually easy to follow. It requires three parts. First, we establish that the exploitability introduced in a re-solving step has two linear components; one due to approximately solving the subgame, and one due to the error in DeepStack's counterfactual value network (see Lemmas 1 through 5). Second, we enable estimates of subgame counterfactual values that do not arise from actual subgame strategies (see Lemma 6). Together, parts one and two enable us to use DeepStack's counterfactual value network for a single re-solve.\footnote{The first part is a generalization and improvement on the re-solving exploitability bound given by Theorem 3 in Burch et al.~\cite{cprg:cfrd}, and the second part generalizes the bound on decomposition regret given by Theorem 2 of the same work.} Finally, we show that using the opponent's values from the best action, rather than the observed action, does not increase overall exploitability (see Lemma 7). This allows us to carry forward estimates of the opponent's counterfactual value, enabling continual re-solving. Put together, these three parts bound the error after any finite number of continual re-solving steps, concluding the proof. We now formalize each step. There are a number of concepts we use throughout this section. We use the notation from Burch et al.~\cite{cprg:cfrd} without any introduction here. We assume player 1 is performing the continual re-solving. We call player 2 the opponent. We only consider the re-solve player's strategy $\sigma$, as the opponent is always using a best response to $\sigma$. All values are considered with respect to the opponent, unless specifically stated. We say $\sigma$ is $\epsilon$-exploitable if the opponent's best response value against $\sigma$ is no more than $\epsilon$ away from the game value for the opponent. A public state $S$ corresponds to the root of an imperfect information subgame. We write $\mathcal{I}_2^S$ for the collection of player 2 information sets in $S$. Let $G\langle S, \sigma, w\rangle$ be the subtree gadget game (the re-solving game of Burch et al.~\cite{cprg:cfrd}), where $S$ is some public state, $\sigma$ is used to get player 1 reach probabilities $\pi^{\sigma}_{-2}(h)$ for each $h \in S$, and $w$ is a vector where $w_I$ gives the value of player 2 taking the terminate action (T) from information set $I \in \mathcal{I}_2^S$. Let \begin{align*} \text{BV}_I(\sigma) = \max_{\sigma^*_2}\sum_{h \in I} \pi^{\sigma}_{-2}(h) u^{\sigma,\sigma_2^*}(h) / \pi^{\sigma}_{-2}(I), \end{align*} be the counterfactual value for $I$ given we play $\sigma$ and our opponent is playing a best response. For a subtree strategy $\sigma^S$, we write $\sigma \to \sigma^S$ for the strategy that plays according to $\sigma^S$ for any state in the subtree and according to $\sigma$ otherwise. For the gadget game $G\langle S, \sigma, w\rangle$, the gadget value of a subtree strategy $\sigma^S$ is defined to be: \begin{align*} \text{GV}^S_{w,\sigma}(\sigma^S) = \sum_{I \in \mathcal{I}^S_2} \max(w_I,\text{BV}_I(\sigma\to\sigma^S)), \end{align*} and the underestimation error is defined to be: \begin{align*} \text{U}^S_{w,\sigma} = \min_{\sigma^S} \text{GV}^S_{w,\sigma}(\sigma^S) - \sum_{I \in \mathcal{I}^S_2}w_I. \end{align*} \begin{lemma} The game value of a gadget game $G\langle S, \sigma, w\rangle$ is \begin{equation*}\sum_{I \in \mathcal{I}^S_2} w_I + \text{U}^S_{w,\sigma}.\end{equation*} \label{lem:underestimation} \end{lemma} \begin{proof} Let $\tilde{\sigma}_2^S$ be a gadget game strategy for player $2$ which must choose from the F and T actions at starting information set $I$. Let $\tilde{u}$ be the utility function for the gadget game. \begin{align*} \min_{\sigma_1^S}\max_{\tilde{\sigma}_2^S} \tilde{u}(\sigma_1^S,\tilde{\sigma}_2^S) &= \min_{\sigma_1^S}\max_{\sigma_2^S}\sum_{I \in \mathcal{I}^S_2} \frac{\pi^{\sigma}_{-2}(I)}{\sum_{I' \in \mathcal{I}^S_2} \pi^{\sigma}_{-2}(I')} \max_{a \in \{F,T\}} \tilde{u}^{\sigma^S}(I,a)\\ &= \min_{\sigma_1^S}\max_{\sigma_2^S}\sum_{I \in \mathcal{I}^S_2} \max( w_I, \sum_{h \in I} \pi_{-2}^{\sigma}(h) u^{\sigma^S}(h)) \intertext{A best response can maximize utility at each information set independently:} &= \min_{\sigma_1^S}\sum_{I \in \mathcal{I}^S_2} \max( w_I, \max_{\sigma_2^S} \sum_{h \in I} \pi_{-2}^{\sigma}(h) u^{\sigma^S}(h))\\ &= \min_{\sigma_1^S}\sum_{I \in \mathcal{I}^S_2} \max( w_I, \text{BV}_I(\sigma\to\sigma_1^S))\\ &= \text{U}^S_{w,\sigma} + \sum_{I \in \mathcal{I}^S_2} w_I \end{align*} \end{proof} \begin{lemma} If our strategy $\sigma^S$ is $\epsilon$-exploitable in the gadget game $G\langle S,\sigma,w\rangle$, then $\text{GV}^S_{w,\sigma}(\sigma^S) \le \sum_{I \in \mathcal{I}^S_2} w_I + \text{U}^S_{w,\sigma} + \epsilon$ \label{lem:resolve_underestimation} \end{lemma} \begin{proof} This follows from Lemma~\ref{lem:underestimation} and the definitions of $\epsilon$-Nash, $\text{U}^S_{w,\sigma}$, and $\text{GV}^S_{w,\sigma}(\sigma^S)$. \end{proof} \begin{lemma} Given an $\epsilon_O$-exploitable $\sigma$ in the original game, if we replace a subgame with a strategy $\sigma^S$ such that $\text{BV}_I(\sigma \to \sigma^S) \le w_I$ for all $I \in \mathcal{I}^S_2$, then the new combined strategy has an exploitability no more than $\epsilon_O + \text{EXP}^S_{w,\sigma}$ where \begin{align*} \text{EXP}^S_{w,\sigma} = \sum_{I \in \mathcal{I}^S_2} \max( \text{BV}_I( \sigma ), w_I ) - \sum_{I \in \mathcal{I}^S_2} \text{BV}_I( \sigma ) \end{align*} \label{lem:error} \end{lemma} \begin{proof} We only care about the information sets where the opponent's counterfactual value increases, and a worst case upper bound occurs when the opponent best response would reach every such information set with probability 1, and never reach information sets where the value decreased. Let $Z[S] \subseteq Z$ be the set of terminal states reachable from some $h \in S$ and let $v_2$ be the game value of the full game for player 2. Let $\sigma_2$ be a best response to $\sigma$ and let $\sigma^S_2$ be the part of $\sigma_2$ that plays in the subtree rooted at $S$. Then necessarily $\sigma^S_2$ achieves counterfactual value $\text{BV}_I(\sigma)$ at each $I \in \mathcal{I}^S_2$. \begin{alignat*}{2} \max_{\sigma_2^*} &\mathrlap{(u(\sigma\to\sigma^S,\sigma_2^*))}\\ &= \max_{\sigma_2^*} &&\biggl[\sum_{z \in Z[S]} \pi_{-2}^{\sigma \to \sigma^S}(z) \pi_2^{\sigma_2^*}(z) u(z) + \sum_{z \in Z \setminus Z[S]} \pi_{-2}^{\sigma \to \sigma^S}(z) \pi_2^{\sigma_2^*}(z) u(z) \biggr]\\ &= \max_{\sigma_2^*} &&\biggl[\sum_{z \in Z[S]} \pi_{-2}^{\sigma \to \sigma^S}(z) \pi_2^{\sigma_2^*}(z) u(z) - \sum_{z \in Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*\to\sigma_2^S}(z)u(z)\\ &&&+ \sum_{z \in Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*\to\sigma_2^S}(z)u(z)+ \sum_{z \in Z \setminus Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*}(z) u(z) \biggr]\\ &\leq \max_{\sigma_2^*} &&\biggl[\sum_{z \in Z[S]} \pi_{-2}^{\sigma \to \sigma^S}(z) \pi_2^{\sigma_2^*}(z) u(z) - \sum_{z \in Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*\to\sigma_2^S}(z)u(z)\biggr]\\ &&&+\max_{\sigma_2^*}\biggl[ \sum_{z \in Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*\to\sigma_2^S}(z)u(z)+ \sum_{z \in Z \setminus Z[S]} \pi_{-2}^{\sigma}(z) \pi_2^{\sigma_2^*}(z) u(z) \biggr]\\ &\leq \max_{\sigma_2^*} &&\biggl[\sum_{I \in \mathcal{I}^S_2} \sum_{h \in I}\pi_{-2}^\sigma(h)\pi_2^{\sigma_2^*}(h)u^{\sigma^S,\sigma_2^*}(h) \\ &&& - \sum_{I \in \mathcal{I}^S_2} \sum_{h \in I}\pi_{-2}^\sigma(h)\pi_2^{\sigma_2^*}(h)u^{\sigma,\sigma_2^S}(h)\biggr] + \max_{\sigma_2^*} (u(\sigma,\sigma_2^*)) \intertext{By perfect recall $\pi_2(h)=\pi_2(I)$ for each $h \in I$:} &\leq \max_{\sigma_2^*} &&\biggl[\sum_{I \in \mathcal{I}^S_2} \pi_2^{\sigma_2^*}(I)\biggl(\sum_{h \in I}\pi_{-2}^\sigma(h)u^{\sigma^S,\sigma_2^*}(h) - \sum_{h \in I}\pi_{-2}^\sigma(h)u^{\sigma,\sigma_2^S}(h)\biggr)\biggr] \\ &&&+ v_2 + \epsilon_O\\ &= \max_{\sigma_2^*} &&\biggl[\mathrlap{\sum_{I \in \mathcal{I}^S_2}\pi_2^{\sigma_2^*}(I)\pi_{-2}^{\sigma}(I)\biggl(\text{BV}_I(\sigma \to \sigma^S)-\text{BV}_I(\sigma)\biggr)\biggr]+ v_2 + \epsilon_O}\\ &\leq &&\biggl[\sum_{I \in \mathcal{I}^S_2}\max(\text{BV}_I(\sigma \to \sigma^S)-\text{BV}_I(\sigma),0)\biggr]+ v_2 + \epsilon_O\\ &\leq &&\biggl[\sum_{I \in \mathcal{I}^S_2}\max(w_I-\text{BV}_I(\sigma),\text{BV}_I(\sigma)-\text{BV}_I(\sigma))\biggr]+ v_2 + \epsilon_O\\ &= &&\biggl[\sum_{I \in \mathcal{I}^S_2}\max(\text{BV}_I(\sigma),w_I) - \sum_{I \in \mathcal{I}^S_2} \text{BV}_I( \sigma )\biggr]+ v_2 + \epsilon_O \end{alignat*} \end{proof} \begin{lemma} Given an $\epsilon_O$-exploitable $\sigma$ in the original game, if we replace the strategy in a subgame with a strategy $\sigma^S$ that is $\epsilon_S$-exploitable in the gadget game $G\langle S, \sigma, w\rangle$, then the new combined strategy has an exploitability no more than $\epsilon_O + \text{EXP}^S_{w,\sigma} + \text{U}^S_{w,\sigma} + \epsilon_S$. \label{lem:resolve_error} \end{lemma} \begin{proof} We use that $\max(a,b) = a + b - \min(a,b)$. From applying Lemma~\ref{lem:error} with\\ ${w_I = \text{BV}_I(\sigma \to \sigma^S)}$ and expanding ${\text{EXP}^S_{\text{BV}(\sigma \to \sigma^S),\sigma}}$ we get exploitability no more than\\ ${\epsilon_O - \sum_{I \in \mathcal{I}^S_2} \text{BV}_I( \sigma )}$ plus \begin{align*} \sum_{I \in \mathcal{I}^S_2} &\max( \text{BV}_I( \sigma \to \sigma^S), \text{BV}_I( \sigma ) ) \\ &\le \sum_{I \in \mathcal{I}^S_2} \max( \text{BV}_I( \sigma \to \sigma^S ), \max( w_I, \text{BV}_I( \sigma ) ) \\ &= \sum_{I \in \mathcal{I}^S_2} \bigl( \text{BV}_I( \sigma \to \sigma^S ) + \max( w_I, \text{BV}_I( \sigma )) \\ &\qquad - \min( \text{BV}_I( \sigma \to \sigma^S ), \max( w_I, \text{BV}_I( \sigma ))) \bigr)\\ &\leq \sum_{I \in \mathcal{I}^S_2} \bigl( \text{BV}_I( \sigma \to \sigma^S ) + \max( w_I, \text{BV}_I( \sigma )) \\ &\qquad - \min( \text{BV}_I( \sigma \to \sigma^S ), w_I) \bigr)\\ &= \sum_{I \in \mathcal{I}^S_2} \bigl( \max( w_I, \text{BV}_I( \sigma )) + \max( w_I, \text{BV}_I( \sigma\to\sigma^S ) ) - w_I \bigr) \\ &= \sum_{I \in \mathcal{I}^S_2} \max( w_I, \text{BV}_I( \sigma ) ) + \sum_{I \in \mathcal{I}^S_2} \max( w_I, \text{BV}_I( \sigma\to\sigma^S )) - \sum_{I \in \mathcal{I}^S_2} w_I \\ \end{align*} From Lemma~\ref{lem:resolve_underestimation} we get \begin{align*} \le \sum_{I \in \mathcal{I}^S_2} \max( w_I, \text{BV}_I( \sigma ) ) + \text{U}^S_{w,\sigma} + \epsilon_S \\ \end{align*} Adding $\epsilon_O - \sum_I \text{BV}_I( \sigma )$ we get the upper bound $\epsilon_O + \text{EXP}^S_{w,\sigma} + \text{U}^S_{w,\sigma} + \epsilon_S$. \end{proof} \begin{lemma} Assume we are performing one step of re-solving on subtree $S$, with constraint values $w$ approximating opponent best-response values to the previous strategy $\sigma$, with an approximation error bound $\sum_I |w_I-\text{BV}_I(\sigma)| \le \epsilon_E$. Then we have $\text{EXP}^S_{w,\sigma} + \text{U}^S_{w,\sigma} \le \epsilon_E$. \label{lem:resolve_step} \end{lemma} \begin{proof} $\text{EXP}^S_{w,\sigma}$ measures the amount that the $w_I$ exceed $\text{BV}_I(\sigma)$, while $\text{U}^S_{w,\sigma}$ bounds the amount that the $w_I$ underestimate $\text{BV}_I(\sigma\to\sigma^S)$ for any $\sigma^S$, including the original $\sigma$. Thus, together they are bounded by $|w_I-\text{BV}_I(\sigma)|$: \begin{align*} \text{EXP}^S_{w,\sigma} + \text{U}^S_{w,\sigma} &= \sum_{I \in \mathcal{I}^S_2} \max( \text{BV}_I( \sigma ), w_I ) - \sum_{I \in \mathcal{I}^S_2} \text{BV}_I( \sigma )\\ &\qquad+ \min_{\sigma^S} \sum_{I \in \mathcal{I}^S_2} \max(w_I,\text{BV}_I(\sigma\to\sigma^S)) - \sum_{I \in \mathcal{I}^S_2}w_I\\ &\leq \sum_{I \in \mathcal{I}^S_2} \max( \text{BV}_I( \sigma ), w_I ) - \sum_{I \in \mathcal{I}^S_2} \text{BV}_I( \sigma )\\ &\qquad + \sum_{I \in \mathcal{I}^S_2} \max(w_I,\text{BV}_I(\sigma)) - \sum_{I \in \mathcal{I}^S_2}w_I\\ &= \sum_{I \in \mathcal{I}^S_2} \left[\max(w_I - \text{BV}_I(\sigma),0) + \max(\text{BV}_I(\sigma)-w_I,0)\right]\\ &= \sum_{I \in \mathcal{I}^S_2} |w_I - \text{BV}_I(\sigma)| \leq \epsilon_E \end{align*} \end{proof} \begin{lemma} Assume we are solving a game $G$ with $T$ iterations of CFR-D where for both players $p$, subtrees $S$, and times $t$, we use subtree values $v_I$ for all information sets $I$ at the root of $S$ from some suboptimal black box estimator. If the estimation error is bounded, so that $\min_{\sigma_S^* \in \text{NE}_S} \sum_{I \in \mathcal{I}^S_2} |v^{\sigma_S^*} (I)-v_I| \le \epsilon_E$, then the trunk exploitability is bounded by $k_G/\sqrt{T} + j_G\epsilon_E$ for some game specific constant $k_G,j_G \ge 1$ which depend on how the game is split into a trunk and subgames. \label{lem:cfrd_estimator} \end{lemma} \begin{proof} This follows from a modified version the proof of Theorem 2 of Burch~et al.~\cite{cprg:cfrd}, which uses a fixed error $\epsilon$ and argues by induction on information sets. Instead, we argue by induction on entire public states. For every public state $s$, let $N_s$ be the number of subgames reachable from $s$, including any subgame rooted at $s$. Let $Succ(s)$ be the set of our public states which are reachable from $s$ without going through another of our public states on the way. Note that if $s$ is in the trunk, then every $s' \in Succ(s)$ is in the trunk or is the root of a subgame. Let $D_{TR}(s)$ be the set of our trunk public states reachable from $s$, including $s$ if $s$ is in the trunk. We argue that for any public state $s$ where we act in the trunk or at the root of a subgame \begin{equation} \label{eqn:inductiveregret} \sum_{I \in s} R^{T,+}_{full}(I) \leq \sum_{s' \in D_{TR}(s)} \sum_{I \in s'} R^{T,+}(I) + TN_s\epsilon_E \end{equation} First note that if no subgame is reachable from $s$, then $N_s = 0$ and the statement follows from Lemma 7 of \cite{ZinkevichEtAl07}. For public states from which a subgame is reachable, we argue by induction on $|D_{TR}(s)|$. For the base case, if $|D_{TR}(s)| = 0$ then $s$ is the root of a subgame $S$, and by assumption there is a Nash Equilibrium subgame strategy $\sigma_S^*$ that has regret no more than $\epsilon_E$. If we implicitly play $\sigma_S^*$ on each iteration of CFR-D, we thus accrue $\sum_{I \in s} R^{T,+}_{full}(I) \leq T\epsilon_E$. For the inductive hypothesis, we assume that (\ref{eqn:inductiveregret}) holds for all $s$ such that $|D_{TR}(s)| < k$. Consider a public state $s$ where $|D_{TR}(s)| = k$. By Lemma 5 of \cite{ZinkevichEtAl07} we have \begin{align*} \sum_{I \in s} R^{T,+}_{full}(I) &\leq \sum_{I \in s}\left[R^T(I) + \sum_{I' \in Succ(I)}R^{T,+}_{full}(I)\right]\\ &= \sum_{I \in s} R^T(I) + \sum_{s' \in Succ(s)} \sum_{I' \in s'} R^{T,+}_{full}(I') \end{align*} For each $s' \in Succ(s)$, $D(s') \subset D(s)$ and $s \not\in D(s')$, so $|D(s')|<|D(s)|$ and we can apply the inductive hypothesis to show \begin{align*} \sum_{I \in s} R^{T,+}_{full}(I) &\leq \sum_{I \in s} R^T(I) + \sum_{s' \in Succ(s)} \left[\sum_{s'' \in D(s')}\sum_{I \in s''} R^{T,+}(I) + TN_{s'}\epsilon_E\right]\\ &\leq \sum_{s' \in D(s)}\sum_{I \in s'} R^{T,+}(I) + T\epsilon_E \sum_{s' \in Succ(s)} N_{s'}\\ &= \sum_{s' \in D(s)}\sum_{I \in s'} R^{T,+}(I) + T\epsilon_E N_s \end{align*} This completes the inductive argument. By using regret matching in the trunk, we ensure $R^T(I) \leq \Delta\sqrt{AT}$, proving the lemma for $k_G = \Delta|\mathcal{I_{TR}}|\sqrt{A}$ and $j_G = N_{root}$. \end{proof} \begin{lemma} Given our strategy $\sigma$, if the opponent is acting at the root of a public subtree $S$ from a set of actions $A$, with opponent best-response values $\text{BV}_{I \cdot a}(\sigma)$ after each action $a \in A$, then replacing our subtree strategy with any strategy that satisfies the opponent constraints $w_I = \max_{a \in A} \text{BV}_{I \cdot a}(\sigma)$ does not increase our exploitability. \label{lem:opp_constraint_values} \end{lemma} \begin{proof} If the opponent is playing a best response, every counterfactual value $w_I$ before the action must either satisfy $w_I = \text{BV}_I(\sigma) = \max_{a \in A} \text{BV}_{I \cdot a}(\sigma)$, or not reach state $s$ with private information $I$. If we replace our strategy in S with a strategy $\sigma'_S$ such that $\text{BV}_{I \cdot a}(\sigma'_S) \le \text{BV}_I(\sigma)$ we preserve the property that $\text{BV}_I(\sigma') = \text{BV}_I(\sigma)$. \end{proof} \begin{theorem} Assume we have some initial opponent constraint values $w$ from a solution generated using at least $T$ iterations of CFR-D, we use at least $T$ iterations of CFR-D to solve each re-solving game, and we use a subtree value estimator such that $\min_{\sigma_S^* \in \text{NE}_S} \sum_{I \in \mathcal{I}^S_2} |v^{\sigma_S^*} (I)-v_I| \le \epsilon_E$, then after $d$ re-solving steps the exploitability of the resulting strategy is no more than $(d+1)k/\sqrt{T} + (2d+1)j\epsilon_E$ for some constants $k,j$ specific to both the game and how it is split into subgames. \label{thm:deepstack} \end{theorem} \begin{proof} Continual re-solving begins by solving from the root of the entire game, which we label as subtree $S_0$. We use CFR-D with the value estimator in place of subgame solving in order to generate an initial strategy $\sigma_0$ for playing in $S_0$. By Lemma~\ref{lem:cfrd_estimator}, the exploitability of $\sigma_0$ is no more than $k_0/\sqrt{T} + j_0\epsilon_E$. For each step of continual re-solving $i = 1,...,d$, we are re-solving some subtree $S_i$. From the previous step of re-solving, we have approximate opponent best-response counterfactual values $\widetilde{\mathrm{BV}}_I(\sigma_{i-1})$ for each $I \in \mathcal{I}^{S_{i-1}}_2$, which by the estimator bound satisfy $|\sum_{I \in \mathcal{I}^{S_{i-1}}_2} BV_I(\sigma_{i-1}) - \widetilde{\mathrm{BV}}_I(\sigma_{i-1})| \leq \epsilon_E$. Updating these values at each public state between $S_{i-1}$ and $S_{i}$ as described in the paper yields approximate values $\widetilde{\mathrm{BV}}_I(\sigma_{i-1})$ for each $I \in \mathcal{I}^{S_i}_2$ which by Lemma~\ref{lem:opp_constraint_values} can be used as constraints $w_{I,i}$ in re-solving. Lemma~\ref{lem:resolve_step} with these constraints gives us the bound $\text{EXP}^{S_i}_{w_i,\sigma_{i-1}} + \text{U}^{S_i}_{w_i,\sigma_{i-1}} \le \epsilon_E$. Thus by Lemma~\ref{lem:resolve_error} and Lemma~\ref{lem:cfrd_estimator} we can say that the increase in exploitability from $\sigma_{i-1}$ to $\sigma_i$ is no more than $\epsilon_E + \epsilon_{S_i} \leq \epsilon_E + k_i/\sqrt{T} + j_i\epsilon_E \leq k_i/\sqrt{T} + 2j_i\epsilon_E$. Let $k = \max_i k_i$ and $j = \max_i j_i$. Then after $d$ re-solving steps, the exploitability is bounded by $(d+1)k/\sqrt{T} + (2d+1)j\epsilon_E$. \end{proof} \subsection*{Best-response Values Versus Self-play Values} DeepStack uses self-play values within the continual re-solving computation, rather than the best-response values described in Theorem~\ref{thm:deepstack}. Preliminary tests using CFR-D to solve smaller games suggested that strategies generated using self-play values were generally less exploitable and had better one-on-one performance against test agents, compared to strategies generated using best-response values. Figure~\ref{fig:selfplay-converge} shows an example of DeepStack's exploitability in a particular river subgame with different numbers of re-solving iterations. Despite lacking a theoretical justification for its soundness, using self-play values appears to converge to low exploitability strategies just as with using best-response values. \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{figs/selfplay-converge} \caption{DeepStack's exploitability within a particular public state at the start of the river as a function of the number of re-solving iterations.}\label{fig:selfplay-converge} \end{figure} One possible explanation for why self-play values work well with continual re-solving is that at every re-solving step, we give away a little more value to our best-response opponent because we are not solving the subtrees exactly. If we use the self-play values for the opponent, the opponent's strategy is slightly worse than a best response, making the opponent values smaller and counteracting the inflationary effect of an inexact solution. While this optimism could hurt us by setting unachievable goals for the next re-solving step (an increased $\text{U}^S_{w,\sigma}$ term), in poker-like games we find that the more positive expectation is generally correct (a decreased $\text{EXP}^S_{w,\sigma}$ term.) \section*{Pseudocode} Complete pseudocode for DeepStack's depth-limited continual re-resolving algorithm is in Algorithm~\ref{alg:pseudocode}. Conceptually, DeepStack can be decomposed into four functions: \textproc{Re-solve}, \textproc{Values}, \textproc{UpdateSubtreeStrategies}, and \textproc{RangeGadget}. The main function is \textproc{Re-solve}, which is called every time DeepStack needs to take an action. It iteratively calls each of the other functions to refine the lookahead tree solution. After $T$ iterations, an action is sampled from the approximate equilibrium strategy at the root of the subtree to be played. According to this action, DeepStack's range, $\vec{r}_1$, and its opponent's counterfactual values, $\vec{v}_2$, are updated in preparation for its next decision point. \let\veccopy\vec \let\vec\mathbf \begin{algorithm}[!htbp] \small \caption{Depth-limited continual re-solving} \label{alg:pseudocode} \textbf{INPUT:} Public state $S$, player range $\vec{r}_1$ over our information sets in $S$, opponent counterfactual values $\vec{v}_2$ over their information sets in $S$, and player information set $I \in S$\\ \textbf{OUTPUT:} Chosen action $a$, and updated representation after the action $(S(a), \vec{r}_1(a), \vec{v}_2(a))$ \begin{algorithmic}[1] \Statex \Function{Re-solve}{$S,\vec{r}_1,\vec{v}_2,I$} \State $\sigma^0 \gets \text{arbitrary initial strategy profile}$ \State $\vec{r}^0_2 \gets \text{arbitrary initial opponent range}$ \State $R_G^0,R^0 \gets \vec{0}$ \Comment{Initial regrets for gadget game and subtree} \For{$t=1$ to $T$} \State $\vec{v}_1^{t},\vec{v}_2^{t} \gets$ \Call{Values}{$S,\sigma^{t-1},\vec{r}_1,\vec{r}^{t-1}_2,0$} \State $\sigma^t,R^t \gets$ \Call{UpdateSubtreeStrategies}{$S,\vec{v}_1^{t},\vec{v}_2^{t},R^{t-1}$} \State $\vec{r}^t_2,R_G^t \gets$ \Call{RangeGadget}{$\vec{v}_2,\vec{v}_2^{t}(S),R_G^{t-1}$} \EndFor \State $\overline{\sigma}^T \gets \frac{1}{T}\sum_{t=1}^T \sigma^t$ \Comment{Average the strategies} \State $a \sim \overline{\sigma}^T(\cdot |I)$ \Comment{Sample an action} \State $\vec{r}_1(a) \gets \langle \vec{r}_1, \sigma(a|\cdot) \rangle$ \Comment{Update the range based on the chosen action} \State $\vec{r}_1(a) \gets \vec{r}_1(a) / ||\vec{r}_1(a)||_1$ \Comment{Normalize the range} \State $\vec{v}_2(a) \gets \frac{1}{T}\sum_{t=1}^T \vec{v}^t_2(a)$ \Comment{Average of counterfactual values after action $a$} \State \Return $a,S(a),\vec{r}_1(a), \vec{v}_2(a)$ \EndFunction \Statex \Function{Values}{$S,\sigma,\vec{r}_1,\vec{r}_2,d$} \Comment{\parbox[t]{.6\linewidth}{Gives the counterfactual values of the subtree $S$ under $\sigma$, computed with a depth-limited lookahead.}} \If{$S$ is terminal} \State $\vec{v}_1(S) \gets U_S\vec{r}_2$ \Comment{Where $U_S$ is the matrix of the bilinear utility function at $S$, \hspace{2pt}~} \State $\vec{v}_2(S) \gets \vec{r}_1^\intercal U_S$ \hspace*{\fill}$U(S) = \vec{r}_1^\intercal U_S \vec{r_2}$, thus giving vectors of counterfactual values \State \Return $\vec{v}_1(S),\vec{v}_2(S)$ \ElsIf{$d = \textrm{MAX-DEPTH}$} \State \Return \Call{NeuralNetEvaluate}{$S,\vec{r}_1,\vec{r}_2$} \EndIf \State $\vec{v}_1(S), \vec{v}_2(S) \gets \vec{0}$ \For{action $a \in S$} \State $\vec{r}_{\text{Player}(S)}(a) \gets \langle \vec{r}_{\text{Player}(S)}, \sigma(a|\cdot) \rangle$ \Comment Update range of acting player based on strategy \State $\vec{r}_{\text{Opponent}(S)}(a) \gets \vec{r}_{\text{Opponent}(S)}$ \State $\vec{v}_1(S(a)), \vec{v}_2(S(a)) \gets \Call{Value}{S(a),\sigma,\vec{r}_1(a),\vec{r}_2(a),d+1}$ \State $\vec{v}_{\text{Player}(S)}(S) \gets \vec{v}_{\text{Player}(S)}(S) + \sigma(a|\cdot)\vec{v}_{\text{Player(S)}}(S(a))$ \Comment{Weighted average} \State $\vec{v}_{\text{Opponent}(S)}(S) \gets \vec{v}_{\text{Player}(S)}(S) + \vec{v}_{\text{Opponent(S)}}(S(a))$ \Statex\Comment{\parbox[t]{.5\linewidth}{Unweighted sum, as our strategy is already included in opponent counterfactual values}} \EndFor \State \Return $\vec{v}_1, \vec{v}_2$ \EndFunction \algstore{pseudocode} \end{algorithmic} \end{algorithm} \begin{algorithm} \small \begin{algorithmic} \algrestore{pseudocode} \Function{UpdateSubtreeStrategies}{$S,\vec{v}_1,\vec{v}_2,R^{t-1}$} \For{$S' \in \{S\}\cup\text{SubtreeDescendants}(S)$ with $\text{Depth}(S') < \textrm{MAX-DEPTH}$} \For{action $a \in S'$} \State $R^t(a|\cdot) \gets R^{t-1}(a|\cdot) + \vec{v}_{\text{Player}(S')}(S'(a)) - \vec{v}_{\text{Player}(S')}(S')$ \Statex\Comment{Update acting player's regrets} \EndFor \For{information set $I \in S'$} \State $\sigma^t(\cdot|I) \gets \frac{R^t(\cdot|I)^+}{\sum_{a}R^t(a|I)^+}$ \Comment{Update strategy with regret matching} \EndFor \EndFor \State \Return $\sigma^t, R^t$ \EndFunction \Statex \Function{RangeGadget}{$\vec{v}_2,\vec{v}_2^{t},R_G^{t-1}$} \Comment{\parbox[t]{.5\linewidth}{Let opponent choose to play in the subtree or receive the input value with each hand (see Burch~et~al.~\cite{cprg:cfrd})}} \State $\sigma_G(\textrm{F}|\cdot) \gets \frac{R_G^{t-1}(\textrm{F}|\cdot)^{+}}{R_G^{t-1}(\textrm{F}|\cdot)^{+} + R_G^{t-1}(\textrm{T}|\cdot)^{+}}$ \Comment{F is Follow action, T is Terminate} \State $\vec{r}_2^t \gets \sigma_G(\textrm{F}|\cdot)$ \State $\vec{v}_G^{t} \gets \sigma_G(\textrm{F}|\cdot)\vec{v}_2^{t-1} + (1-\sigma_G(\textrm{F}|\cdot))\vec{v}_2$ \Comment{Expected value of gadget strategy} \State $R_G^{t}(\textrm{T}|\cdot) \gets R_G^{t-1}(\textrm{T}|\cdot) + \vec{v}_2 - v_G^{t-1}$ \Comment{Update regrets} \State $R_G^{t}(\textrm{F}|\cdot) \gets R_G^{t-1}(\textrm{F}|\cdot) + \vec{v}_2^{t} - v_G^{t}$ \State \Return $\vec{r}_2^t, R_G^t$ \EndFunction \end{algorithmic} \end{algorithm} \let\vec\veccopy \section*{DeepStack} DeepStack is a general-purpose algorithm for a large class of sequential imperfect information games. For clarity, we will describe its operation in the game of {HUNL}. The state of a poker game can be split into the players' private information, hands of two cards dealt face down, and the public state, consisting of the cards laying face up on the table and the sequence of betting actions made by the players. Possible sequences of public states in the game form a public tree with every public state having an associated public subtree (Fig.~\ref{fig:public_tree}). \iffinal\else \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{figs/public_tree} \caption{A portion of the public tree in {HUNL}{}. Nodes represent public states, whereas edges represent actions: red and turquoise showing player betting actions, and green representing public cards revealed by chance. The game ends at terminal nodes, shown as a chip with an associated value. For terminal nodes where no player folded, the player whose private cards form a stronger poker hand receives the value of the state.}\label{fig:public_tree} \end{figure} \fi A player's strategy defines a probability distribution over valid actions for each decision point, where a decision point is the combination of the public state and the hand for the acting player. Given a player's strategy, for any public state one can compute the player's range, which is the probability distribution over the player's possible hands given that the public state is reached. Fixing both players' strategies, the utility for a particular player at a terminal public state, where the game has ended, is a bilinear function of both players' ranges using a payoff matrix determined by the rules of the game. The expected utility for a player at any other public state, including the initial state, is the expected utility over reachable terminal states given the players' fixed strategies. A best-response strategy is one that maximizes a player's expected utility against an opponent strategy. In two-player zero-sum games, like {HUNL}, a solution or Nash equilibrium strategy~\cite{Nash50:equilibrium} maximizes the expected utility when playing against a best-response opponent strategy. The exploitability of a strategy is the difference in expected utility against its best-response opponent and the expected utility under a Nash equilibrium. The DeepStack algorithm seeks to compute and play a low-exploitability strategy for the game, i.e., solve for an approximate Nash equilibrium. DeepStack computes this strategy during play only for the states of the public tree that actually arise. Although computed during play, DeepStack's strategy is static, albeit stochastic, because it is the result of a deterministic computation that produces a probability distribution over the available actions. The DeepStack algorithm (Fig.~\ref{fig:deepstack-overview}) is composed of three ingredients: a sound local strategy computation for the current public state, depth-limited lookahead using a learned value function to avoid reasoning to the end of the game, and a restricted set of lookahead actions. At a conceptual level these three ingredients describe heuristic search, which is responsible for many of AI's successes in perfect information games. Until DeepStack, no theoretically sound application of heuristic search was known in imperfect information games. The heart of heuristic search methods is the idea of ``continual re-searching'', where a sound local search procedure is invoked whenever the agent must act without retaining any memory of how or why it acted to reach the current state. At the heart of DeepStack is continual re-solving, a sound local strategy computation which only needs minimal memory of how and why it acted to reach the current public state. \paragraph*{Continual re-solving.} Suppose we have taken actions according to a particular solution strategy but then in some public state forget this strategy. Can we reconstruct a solution strategy for the subtree without having to solve the entire game again? We can, through the process of re-solving~\cite{cprg:cfrd}. We need to know both our range at the public state and a vector of expected values achieved by the opponent under the previous solution for each opponent hand~\cite{re-solving-values}. With these values, we can reconstruct a strategy for only the remainder of the game, which does not increase our overall exploitability. Each value in the opponent's vector is a counterfactual value, a conditional ``what-if'' value that gives the expected value if the opponent reaches the public state with a particular hand. The CFR algorithm also uses counterfactual values, and if we use CFR as our solver, it is easy to compute the vector of opponent counterfactual values at any public state. Re-solving, however, begins with a strategy, whereas our goal is to avoid ever maintaining a strategy for the entire game. We get around this by doing continual re-solving: reconstructing a strategy by re-solving every time we need to act; never using the strategy beyond our next action. To be able to re-solve at any public state, we need only keep track of our own range and a suitable vector of opponent counterfactual values. These values must be an upper bound on the value the opponent can achieve with each hand in the current public state, while being no larger than the value the opponent could achieve had they deviated from reaching the public state. This is an important relaxation of the counterfactual values typically used in re-solving, with a proof of sufficiency included in our proof of Theorem~\ref{thm} below~\cite{SOM}. At the start of the game, our range is uniform and the opponent counterfactual values are initialized to the value of being dealt each private hand. When it is our turn to act we re-solve the subtree at the current public state using the stored range and opponent values, and act according to the computed strategy, discarding the strategy before we act again. After each action, either by a player or chance dealing cards, we update our range and opponent counterfactual values according to the following rules: (i) Own action: replace the opponent counterfactual values with those computed in the re-solved strategy for our chosen action. Update our own range using the computed strategy and Bayes' rule. (ii) Chance action: replace the opponent counterfactual values with those computed for this chance action from the last re-solve. Update our own range by zeroing hands in the range that are impossible given new public cards. (iii) Opponent action: no change to our range or the opponent values are required. These updates ensure the opponent counterfactual values satisfy our sufficient conditions, and the whole procedure produces arbitrarily close approximations of a Nash equilibrium (see Theorem~\ref{thm}). Notice that continual re-solving never keeps track of the opponent's range, instead only keeping track of their counterfactual values. Furthermore, it never requires knowledge of the opponent's action to update these values, which is an important difference from traditional re-solving. Both will prove key to making this algorithm efficient and avoiding any need for the translation step required with action abstraction methods~\cite{Gilpin08:Tartanian,Schnizlein09:Translation}. Continual re-solving is theoretically sound, but by itself impractical. While it does not ever maintain a complete strategy, re-solving itself is intractable except near the end of the game. In order to make continual re-solving practical, we need to limit the depth and breadth of the re-solved subtree. \paragraph*{Limited depth lookahead via intuition.} As in heuristic search for perfect information games, we would like to limit the depth of the subtree we have to reason about when re-solving. However, in imperfect information games we cannot simply replace a subtree with a heuristic or precomputed value. The counterfactual values at a public state are not fixed, but depend on how players play to reach the public state, i.e., the players' ranges~\cite{cprg:cfrd}. When using an iterative algorithm, such as CFR, to re-solve, these ranges change on each iteration of the solver. DeepStack overcomes this challenge by replacing subtrees beyond a certain depth with a learned counterfactual value function that approximates the resulting values if that public state were to be solved with the current iteration's ranges. The inputs to this function are the ranges for both players, as well as the pot size and public cards, which are sufficient to specify the public state. The outputs are a vector for each player containing the counterfactual values of holding each hand in that situation. In other words, the input is itself a description of a poker game: the probability distribution of being dealt individual private hands, the stakes of the game, and any public cards revealed; the output is an estimate of how valuable holding certain cards would be in such a game. The value function is a sort of intuition, a fast estimate of the value of finding oneself in an arbitrary poker situation. With a depth limit of four actions, this approach reduces the size of the game for re-solving from $10^{160}$ decision points at the start of the game down to no more than $10^{17}$ decision points. DeepStack uses a deep neural network as its learned value function, which we describe later. \paragraph*{Sound reasoning.} DeepStack's depth-limited continual re-solving is sound. If DeepStack's intuition is ``good'' and ``enough'' computation is used in each re-solving step, then DeepStack plays an arbitrarily close approximation to a Nash equilibrium. \begin{theorem} If the values returned by the value function used when the depth limit is reached have error less than $\epsilon$, and $T$ iterations of CFR are used to re-solve, then the resulting strategy's exploitability is less than $k_1\epsilon + k_2 / \sqrt{T}$, where $k_1$ and $k_2$ are game-specific constants. For the proof, see \cite{SOM}. \label{thm} \end{theorem} \paragraph*{Sparse lookahead trees.} The final ingredient in DeepStack is the reduction in the number of actions considered so as to construct a sparse lookahead tree. DeepStack builds the lookahead tree using only the actions fold (if valid), call, 2 or 3 bet actions, and all-in. This step voids the soundness property of Theorem~\ref{thm}, but it allows DeepStack to play at conventional human speeds. With sparse and depth-limited lookahead trees, the re-solved games have approximately $10^{7}$ decision points, and are solved in under five seconds using a single NVIDIA GeForce GTX 1080 graphics card. We also use the sparse and depth-limited lookahead solver from the start of the game to compute the opponent counterfactual values used to initialize DeepStack's continual re-solving. \iffinal\else \begin{figure}[t] \centering \includegraphics[width=0.7\textwidth]{figs/taking_actions} \caption{% {\bf DeepStack overview.} {\bf (A)} DeepStack reasons in the public tree always producing action probabilities for all cards it can hold in a public state. It maintains two vectors while it plays: its own range and its opponent's counterfactual values. As the game proceeds, its own range is updated via Bayes' rule using its computed action probabilities after it takes an action. Opponent counterfactual values are updated as discussed under ``Continual re-solving''. To compute action probabilities when it must act, it performs a re-solve using its range and the opponent counterfactual values. To make the re-solve tractable it restricts the available actions of the players and lookahead is limited to the end of the round. During the re-solve, counterfactual values for public states beyond its lookahead are approximated using DeepStack's learned evaluation function. {\bf (B)} The evaluation function is represented with a neural network that takes the public state and ranges from the current iteration as input and outputs counterfactual values for both players (Fig.~\ref{fig:dnn}). {\bf (C)} The neural network is trained prior to play by generating random poker situations (pot size, board cards, and ranges) and solving them to produce training examples. Complete pseudocode can be found in Algorithm S1~\cite{SOM}.% } \label{fig:deepstack-overview} \end{figure} \fi \paragraph*{Relationship to heuristic search in perfect information games.} There are three key challenges that DeepStack overcomes to incorporate heuristic search ideas in imperfect information games. First, sound re-solving of public states cannot be done without knowledge of how and why the players acted to reach the public state. Instead, two additional vectors, the agent's range and opponent counterfactual values, must be maintained to be used in re-solving. Second, re-solving is an iterative process that traverses the lookahead tree multiple times instead of just once. Each iteration requires querying the evaluation function again with different ranges for every public state beyond the depth limit. Third, the evaluation function needed when the depth limit is reached is conceptually more complicated than in the perfect information setting. Rather than returning a single value given a single state in the game, the counterfactual value function needs to return a vector of values given the public state and the players' ranges. Because of this complexity, to learn such a value function we use deep learning, which has also been successful at learning complex evaluation functions in perfect information games~\cite{Silver16:AlphaGo}. \paragraph*{Relationship to abstraction-based approaches.} Although DeepStack uses ideas from abstraction, it is fundamentally different from abstraction-based approaches. DeepStack restricts the number of actions in its lookahead trees, much like action abstraction~\cite{Gilpin08:Tartanian,Schnizlein09:Translation}. However, each re-solve in DeepStack starts from the actual public state and so it always perfectly understands the current situation. The algorithm also never needs to use the opponent's actual action to obtain correct ranges or opponent counterfactual values, thereby avoiding translation of opponent bets. We used hand clustering as inputs to our counterfactual value functions, much like explicit card abstraction approaches~\cite{Gilpin07:Abstraction,Johanson13:Abstraction}. However, our clustering is used to estimate counterfactual values at the end of a lookahead tree rather than limiting what information the player has about their cards when acting. We later show that these differences result in a strategy substantially more difficult to exploit. \section*{Deep Counterfactual Value Networks} Deep neural networks have proven to be powerful models and are responsible for major advances in image and speech recognition\cite{Krizhevsky12:ImageNet,Hinton12:Speech}, automated generation of music \cite{Oord16:WaveNet}, and game-playing~\cite{Mnih15:DQN,Silver16:AlphaGo}. DeepStack uses deep neural networks with a tailor-made architecture, as the value function for its depth-limited lookahead (Fig. \ref{fig:dnn}). Two separate networks are trained: one estimates the counterfactual values after the first three public cards are dealt (flop network), the other after dealing the fourth public card (turn network). An auxiliary network for values before any public cards are dealt is used to speed up the re-solving for early actions~\cite{SOM}. \paragraph*{Architecture.} DeepStack uses a standard feedforward network with seven fully connected hidden layers each with 500 nodes and parametric rectified linear units~\cite{He15:PReLU} for the output. This architecture is embedded in an outer network that forces the counterfactual values to satisfy the zero-sum property. The outer computation takes the estimated counterfactual values, and computes a weighted sum using the two players' input ranges resulting in separate estimates of the game value. These two values should sum to zero, but may not. Half the actual sum is then subtracted from the two players' estimated counterfactual values. This entire computation is differentiable and can be trained with gradient descent. The network's inputs are the pot size as a fraction of the players' total stacks and an encoding of the players' ranges as a function of the public cards. The ranges are encoded by clustering hands into 1,000 buckets, as in traditional abstraction methods~\cite{Shi00:Rhode,Gilpin07:Abstraction,Johanson13:Abstraction}, and input as a vector of probabilities over the buckets. The output of the network are vectors of counterfactual values for each player and hand, interpreted as fractions of the pot size. \iffinal\else \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{figs/dnn} \caption{{\bf Deep counterfactual value network.} The inputs to the network are the pot size, public cards, and the player ranges, which are first processed into hand clusters. The output from the seven fully connected hidden layers is post-processed to guarantee the values satisfy the zero-sum constraint, and then mapped back into a vector of counterfactual values. }\label{fig:dnn} \end{figure} \fi \paragraph*{Training.} The turn network was trained by solving 10 million randomly generated poker turn games. These turn games used randomly generated ranges, public cards, and a random pot size~\cite{SOM}. The target counterfactual values for each training game were generated by solving the game with players' actions restricted to fold, call, a pot-sized bet, and an all-in bet, but no card abstraction. The flop network was trained similarly with 1 million randomly generated flop games. However, the target counterfactual values were computed using our depth-limited solving procedure and our trained turn network. The networks were trained using the Adam gradient descent optimization procedure\cite{kingma2014adam} with a Huber loss \cite{huber1964}. \section*{Evaluating DeepStack} We evaluated DeepStack by playing it against a pool of professional poker players recruited by the International Federation of Poker\cite{IFP}. Thirty-three players from 17 countries were recruited. Each was asked to complete a 3,000 game match over a period of four weeks between November 7th and December 12th, 2016. Cash incentives were given to the top three performers (\$5,000, \$2,500, and \$1,250 CAD). Evaluating performance in {HUNL}{} is challenging because of the large variance in per-game outcomes owing to randomly dealt cards and stochastic choices made by the players. The better player may lose in a short match simply because they were dealt weaker hands or their rare bluffs were made at inopportune times. As seen in the Claudico match~\cite{Wood15:PokerFuse-Claudico}, even 80,000 games may not be enough to statistically significantly separate players whose skill differs by a considerable margin. We evaluate performance using AIVAT~\cite{Burch17:AIVAT}, a provably unbiased low-variance technique for evaluating performance in imperfect information games based on carefully constructed control variates. AIVAT requires an estimated value of holding each hand in each public state, and then uses the expected value changes that occur due to chance actions and actions of players with known strategies (i.e., DeepStack) to compute the control variate. DeepStack's own value function estimate is perfectly suited for AIVAT. Indeed, when used with AIVAT we get an unbiased performance estimate with an impressive $85\%$ reduction in standard deviation. Thanks to this technique, we can show statistical significance~\cite{stat-sig} in matches with as few as 3,000 games. \iffinal\else \begin{figure}[t] \centering \includegraphics[width=0.7\textwidth]{figs/humans_curio} \caption{{\bf Performance of professional poker players against DeepStack.} Performance estimated with AIVAT along with a 95\% confidence interval. The solid bars at the bottom show the number of games the participant completed.}\label{fig:humans} \end{figure} \fi In total 44,852 games were played by the thirty-three players with 11 players completing the requested 3,000 games. Over all games played, DeepStack won 492 mbb/g. This is over 4 standard deviations away from zero, and so, highly significant. Note that professional poker players consider 50 mbb/g a sizable margin. Using AIVAT to evaluate performance, we see DeepStack was overall a bit lucky, with its estimated performance actually 486 mbb/g. However, as a lower variance estimate, this margin is over 20 standard deviations from zero. The performance of individual participants measured with AIVAT is summarized in Figure~\ref{fig:humans}. Amongst those players that completed the requested 3,000 games, DeepStack is estimated to be winning by 394 mbb/g, and individually beating 10 out of 11 such players by a statistically significant margin. Only for the best performing player, still estimated to be losing by 70 mbb/g, is the result not statistically significant. More details on the participants and their results are presented in~\cite{SOM}. \subsection*{Exploitability} The main goal of DeepStack is to approximate Nash equilibrium play, i.e., minimize exploitability. While the exact exploitability of a {HUNL}{} poker strategy is intractable to compute, the recent local best-response technique (LBR) can provide a lower bound on a strategy's exploitability~\cite{Lisy17:LocalBR} given full access to its action probabilities. LBR uses the action probabilities to compute the strategy's range at any public state. Using this range it chooses its response action from a fixed set using the assumption that no more bets will be placed for the remainder of the game. Thus it best-responds locally to the opponent's actions, providing a lower bound on their overall exploitability. As already noted, abstraction-based programs from the Annual Computer Poker Competition are highly exploitable by LBR: four times more exploitable than folding every game (Table~\ref{tab-localbr-abbrev}). However, even under a variety of settings, LBR fails to exploit DeepStack at all --- itself losing by over 350 mbb/g to DeepStack~\cite{SOM}. Either a more sophisticated lookahead is required to identify DeepStack's weaknesses or it is substantially less exploitable. \iffinal\else \begin{table} \centering \caption{% {\bf Exploitability bounds from Local Best Response.} For all listed programs, the value reported is the largest estimated exploitability when applying LBR using a variety of different action sets. Table S2 gives a more complete presentation of these results~\cite{SOM}. $\ddagger$: LBR was unable to identify a positive lower bound for DeepStack's exploitability.% } \label{tab-localbr-abbrev} \begin{tabular}{c|r} \toprule Program & LBR (mbb/g) \\ \midrule Hyperborean (2014) & 4675 \\ Slumbot (2016) & 4020 \\ Act1 (2016) & 3302 \\ Always Fold & 750 \\ \midrule {\bf DeepStack} & {\bf 0 $\ddagger$} \\ \bottomrule \end{tabular} \end{table} \fi \section*{Discussion} DeepStack defeated professional poker players at {HUNL}{} with statistical significance~\cite{Libratus}, a game that is similarly sized to go, but with the added complexity of imperfect information. It achieves this goal with little domain knowledge and no training from expert human games. The implications go beyond being a milestone for artificial intelligence. DeepStack represents a paradigm shift in approximating solutions to large, sequential imperfect information games. Abstraction and offline computation of complete strategies has been the dominant approach for almost 20 years~\cite{Shi00:Rhode,BillingsEtAl03,Sandholm12}. DeepStack allows computation to be focused on specific situations that arise when making decisions and the use of automatically trained value functions. These are two of the core principles that have powered successes in perfect information games, albeit conceptually simpler to implement in those settings. As a result, the gap between the largest perfect and imperfect information games to have been mastered is mostly closed. With many real world problems involving information asymmetry, DeepStack also has implications for seeing powerful AI applied more in settings that do not fit the perfect information assumption. The abstraction paradigm for handling imperfect information has shown promise in applications like defending strategic resources~\cite{Lisy16:cfr-security} and robust decision making as needed for medical treatment recommendations~\cite{ChenBowling12}. DeepStack's continual re-solving paradigm will hopefully open up many more possibilities.
{'timestamp': '2017-03-07T02:01:28', 'yymm': '1701', 'arxiv_id': '1701.01724', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01724'}
arxiv
\section{Introduction} In reliability theory, there are two basic modes of catastrophic failure: \emph{independent} damage and \emph{cumulative} damage \cite{Nakagawa2007}. With an independent damage process, a shock is either large enough to cause failure or it has no effect on the state of the system. With a cumulative damage process, however, each shock degrades the state of the system in an additive manner such that once the cumulative effect of all shocks exceeds a threshold, the system fails. Translating these notions to communication channels, failure can either be \emph{signal-independent} or \emph{signal-dependent}. A typical channel with signal-dependent failure is in visible light communication under on-off signaling where light sources may burn out with `on' signals \cite{NairD2015}. Here we consider optimizing communication over noisy channels that may wear out, i.e.\ suffer from signal-dependent failure. As depicted in Table \ref{tab:classes}, this is a novel setting that is distinct from channels that die \cite{VarshneyMG2012} since failure time is dependent on the realized signaling scheme, and from meteor-burst channels \cite{PursleyS1989,Ryan1997} and channels that heat up \cite{KochLS2009,OzelUG2016} since the channel noise level does not change with time. The model is also distinct from Gallager's ``panic button'' \cite[p.~103]{Gallager1968} or ``child's toy'' \cite[p.~26]{Gallager1972} channel, since there is not a special input symbol that causes channel failure. For example, consider a channel with finite input alphabet $\cX = \{0,1\}$ and finite output alphabet $\cY = \{0,1,?\}$. It has an \emph{alive} state $\sigma = \ta$ when it acts like a binary symmetric channel (BSC) with crossover probability $0 < \varepsilon < 1$, i.e.\ the transmission matrix is \begin{equation} \label{eq:pa} p(y|x,\sigma=\ta) = p_\ta(y|x) = \begin{bmatrix} 1 - \varepsilon & \varepsilon & 0 \\ \varepsilon & 1 - \varepsilon & 0 \end{bmatrix} \mbox{,} \end{equation} and a \emph{dead} state $\sigma = \td$ when it erases the input, i.e.\ the transmission matrix is \begin{equation} \label{eq:pd} p(y|x,\sigma=\td) = p_\td(y|x) = \begin{bmatrix} 0 & 0 & 1 \\ 0 & 0 & 1 \end{bmatrix} \mbox{.} \end{equation} The channel starts in state $\sigma=\ta$ and then transitions to $\sigma=\td$ at some random time $T$, where it remains for all time thereafter. That is, the channel is in state $\ta$ for times $i = 1,2,\ldots,T$ and in state $\td$ for times $i = T+1,T+2,\ldots$. This failure time does not have a fixed and exogenous distribution $p_T(t)$, but depends on how the channel is used. That is, the failure depends on the properties of the codeword that is transmitted through the channel. When a $0 \in \cX$ is transmitted through the channel, the channel does not wear out whereas when a $1\in \cX$ is transmitted through the channel, the channel has a certain probability of getting damaged and moving closer to failure, as we detail in the sequel. \begin{table} \centering \caption{Classes of Channel Models} \begin{tabular}{|c|c|c|} \hline & {\bf signal-independent} & {\bf signal-dependent} \\ \hline {\bf signal-to-noise} & meteor-burst channels\cite{PursleyS1989,Ryan1997} & channels that heat up\cite{KochLS2009,OzelUG2016} \\ \hline {\bf failure time} & channels that die\cite{VarshneyMG2012} & channels that wear out \cite{WuVT2017}\\ \hline \end{tabular} \label{tab:classes} \end{table} Since it is inevitable for the channel to fail at a finite time for any non-trivial signaling scheme, the Shannon capacity of the channel is zero. Rather than invoking infinite blocklength asymptotic results, we must construct schemes that convey information via finite blocklength code(s) before the channel wears out. Thus results in the finite blocklength regime \cite{Weiss1960,Strassen1962,PolyanskiyPV2010} and their refinements \cite{TomamichelT2013, Moulin2017} can be built upon to determine limits on expected transmission volume at a given average error probability. Standard finite blocklength analysis, however, cannot be directly applied since there is a restriction on transmitting too many $1$ symbols so that the channel stays alive. A principle of finite blocklength code design is therefore maximizing transmission volume while having a minimal number of $1$s. To facilitate this, cost-constrained version of finite blocklength problems \cite{Fano1961,PolyanskiyPV2010,KostinaV2015,Moulin2012,Moulin2017} are studied, probabilities of successfully transmitting a sequence of input-constraint codes are also studied, and approximations of the fundamental communication limit of using constant composition codes in \cite{Moulin2012,ScarlettMF2015} and codes with input constraints \cite{KostinaV2015} are applied. To maximize the expected transmission volume, all possible sequences of finite-length constant composition codes with different input constraints have to be tested exhaustively. Here we propose a recursive formulation to maximize the expected transmission volume in an efficient manner. The corresponding dynamic program and its graphical representation are provided. In considering the possibility of damage count feedback being available at the transmitter, we find that this does not change the probability of successfully transmitting a sequence of finite-length input-constraint codes over the channel. Some numerical results are also provided to provide insights into the code design. From the numerical results, we observe that the sequence of codes which maximizes the expected volume follows the following rules: \begin{enumerate} \item The code transmitted later has a shorter length, \item The code transmitted later has a lighter Hamming weight. \end{enumerate} These two observations are as intuitive, but not yet proven. The rest of this paper is organized as follows. Section \ref{sec:model} defines the problem statement including a specific focus on the wearing-out process. The maximum expected transmission volume of using constant composition codes, which is treated as the achievable coding scheme, is discussed in Section \ref{sec:ccc}. A dynamic programming formulation and discussion of feedback are given as well. Section \ref{sec:converse} investigates the converse bound, which removes the constraint of using constant composition codes. Section \ref{sec:num} provides some numerical results, and Section \ref{sec:con} concludes this paper by suggesting some possible future directions. \section{Channel Failure Model} \label{sec:model} Consider a channel with binary input alphabet $\cX=\{0,1\}$ and finite output alphabet $\cY=\{0,1,\dots,|\cY|-2, ?\}$, and alive/dead states as indicated above. There is a probability $\gamma$ of the channel getting damaged when a $1$ is transmitted through the channel. The channel starts at state $\sigma=\ta$ and transitions to state $\sigma=\td$ when the extent of damage exceeds a certain threshold $S$, where $S$ could be deterministic or random. For simplicity, we regard $S$ as deterministic throughout this paper. The damage while transmitting a $1$ can be modeled by an independent Bernoulli random variable $D_k$ which takes the value $1$ with probability $\gamma$ and $0$ with probability $1-\gamma$. Thus, the channel that wears out can be defined as a sextuple $(\cX, p_\ta, p_\td, \gamma, S, \cY)$. The communication system over the channel that wears out $(\cX, p_\ta, p_\td, \gamma, S, \cY)$ is defined as follows. \begin{itemize} \item An information stream is designed to be transmitted and it can be grouped into a sequence of $m$ messages, $\left(W^{(1)}, W^{(2)}, \ldots, W^{(m)}\right)$. Each $W^{(i)}$ is chosen from the set $\cW^{(i)}=\{1,2,\ldots,M^{(i)}\}$ and transformed into the codeword $\bc^{(i)}$ with $n^{(i)}$ symbols by the encoder $f^{(i)}$, i.e.\ $f^{(i)}\left(W^{(i)}\right)=\bc^{(i)}\in\cX^{n^{(i)}}$. The sequence of codewords, $\left(\bc^{(i)}\right)_{i=1}^m$ with $\sum_{i=1}^{m}n^{(i)}$ symbols in total, is then transmitted through the channel that wears out. Let such a sequence of $m$ codebooks be an $\left(M^{(i)}, n^{(i)}\right)_{i=1}^m$-code. \item The received sequence $\br\in\cY^{\sum_{i=1}^{m}n^{(i)}}$ is decoded into $\left(\hat{W}^{(1)}, \ldots, \hat{W}^{(m)}\right)$ by the decoders $g^{(i)}$, where \ $g^{(i)}\left(\br^{(i)}\right)=\hat{W}^{(i)}$ for $\br^{(i)}=\br_{n^{(1)}+\cdots +n^{(i-1)}+1}^{n^{(1)}+\cdots +n^{(i-1)}+n^{(i)}}$ and $1\leq i\leq m$. If all $n^{(i)}$ channel outputs for decoder $g^{(i)}$ are not $?$, then $\hat{W}^{(i)}\in\cW^{(i)}$; otherwise, $\hat{W}^{(i)}=\te$. \item The average decoding error probability for a codebook $\left(M^{(i)}, n^{(i)}\right)$ is defined as \begin{equation} P_\te^{(i)}=\frac{1}{M^{(i)}}\sum_{w\in\cW^{(i)}}\Pr\left[\hat{W}^{(i)}\neq w \middle| W^{(i)} = w \wedge \hat{W}^{(i)}\neq \te\right], \end{equation} and the decoding error probability for an $\left(M^{(i)}, n^{(i)}\right)_{i=1}^m$-code is defined as \begin{equation} P_\te=\max_{i\in\{1,\ldots, m\}} P_\te^{(i)}. \end{equation} An $\left(M^{(i)}, n^{(i)}\right)_{i=1}^m$-code is said to be $\eta$-achievable if $P_\te\leq\eta$. \end{itemize} Let the sequence of codewords $\left(\bc^{(i)}\right)_{i=1}^m$ be chosen from an $\eta$-achievable $\left(M^{(i)}, n^{(i)}\right)_{i=1}^m$-code, then the channel wears out when \begin{equation} \sum_{i=1}^{m}\sum_{k=1}^{\wt \left( \bc^{(i)} \right)}D_k> S, \end{equation} where $\wt \left( \bc^{(i)} \right)$ is the Hamming weight of codeword $\bc^{(i)}$. Let $B(S, h, \gamma)$ be the probability of the channel staying alive after $h$ ones are transmitted. That is, \begin{equation} B(S,h,\gamma)\triangleq\Pr\left[\sum_{k=1}^{h}D_k\leq S\right]. \end{equation} $B(S,h,\gamma)$ is the cumulative distribution function of the binomial distribution if $S$ is deterministic. Hence, for channel that wears out $(\cX, p_\ta, p_\td, \gamma, S, \cY)$, the probability of not wearing out the channel after transmitting the sequence of codewords $\left(\bc^{(i)}\right)_{i=1}^m$ is \begin{IEEEeqnarray}{rCl} \Pr\left[\left(\bc^{(i)}\right)_{i=1}^{m}\mbox{ alive}\right] &\triangleq& \Pr\left[ \sum_{i=1}^{m}\sum_{k=1}^{\wt\left(\bc^{(i)}\right)}D_k\leq S \right]\\ &=&B\left(S,\sum_{i=1}^{m}\wt\left(\bc^{(i)}\right),\gamma\right). \end{IEEEeqnarray} Let the $\eta$-achievable $\left(M^{(i)}, n^{(i)}\right)_{i=1}^m$-code be denoted as $\left(\cC^{(i)}\right)_{i=1}^m$ and all the codewords in the same $\cC^{(i)}$ are transmitted with equal probability, the average probability of successfully transmitting $\left(\cC^{(i)}\right)_{i=1}^m$ is \begin{equation}\label{eqn:alivepro} \Pr\left[\left(\cC^{(i)}\right)_{i=1}^{m}\mbox{ alive}\right] \triangleq \left\{\prod_{i=1}^m \frac{1}{M^{(i)}}\right\}\times \left\{\sum_{\left(\bc^{(i)}\right)_{i=1}^{m}\in \left(\cC^{(i)}\right)_{i=1}^{m}} B\left(S,\sum_{i=1}^{m}\wt\left(\bc^{(i)}\right),\gamma\right)\right\}. \end{equation} Based on the results in \cite{VarshneyMG2012}, the expected transmission log-volume $V$ of transmitting $\left(\cC^{(i)}\right)_{i=1}^m$ over the channel that wears out $(\cX, p_\ta, p_\td, \gamma, S, \cY)$ at a given level of error probability $\eta$ can be derived as \begin{equation}\label{eqn:vol} V\left(\left(\cC^{(i)}\right)_{i=1}^{m}\right) = \sum_{j=1}^{m}\Pr\left[\left(\cC^{(i)}\right)_{i=1}^{j}\mbox{ alive}\right]\log M^{(j)}. \end{equation} \section{Achievability Bound} \label{sec:ccc} To obtain an achievability bound on $V$ in \eqref{eqn:vol}, we restrict attention to finite blocklength {\it constant composition codes}, denoted as $\cCccc$, in which all codewords from the same codebook have the same number of ones. Given a $\cCccc$ with length $n$, the Hamming weight of each codeword can be denoted as $\wt(P)\triangleq nP(1)$, where $P$ is a type from $\cP_{n}(\cX)$, the set of all types formed from sequences of length $n$. Define an $(n,M,\eta)_P$-code to be an $\eta$-achievable constant composition code with type $P$, blocklength $n$, number of messages $M$, and average error probability no larger than $\eta$. Hence, when the constant composition code corresponding to $P$ is transmitted, the damage count for such a code is \begin{equation} U(P)\triangleq\sum_{k=1}^{\wt(P)}D_k. \end{equation} Suppose an $\left((n^{(i)},M^{(i)},\eta)_{P^{(i)}}\right)_{i=1}^m$-code, denoted as $\left(\cC_\ccc^{(i)}\right)_{i=1}^m$, is conveyed through the channel. The individual codes need not be the same, and so the full concatenation is much like a constant subblock composition code \cite{TandonMV2016}. The probability of the channel $(\cX, p_\ta, p_\td, \gamma, S, \cY)$ staying alive after conveying the first $j$ codes $\left(\cC^{(i)}_\ccc\right)_{i=1}^j$ in \eqref{eqn:alivepro} can be further written as \begin{equation}\label{eqn:aliveproccc} \Pr\left[\left(\cC^{(i)}_\ccc\right)_{i=1}^{j}\mbox{ alive}\right]=B\left(S,\sum_{i=1}^{j}\wt\left(P^{(i)}\right),\gamma\right). \end{equation} Similar to the result in \cite{VarshneyMG2012}, the expected log-volume for transmitting $\left(\cC^{(i)}_\ccc\right)_{i=1}^m$ with a maximum average error probability $\eta$ can be expressed as \begin{multline}\label{eqn:volccc} \sum_{j=1}^{m}\Pr\left[\left(\cC^{(i)}_\ccc\right)_{i=1}^{j}\mbox{ alive}\right]\log M_\ccc^{*}\left(n^{(j)}, \wt\left(P^{(j)}\right),\eta\right)\\= \sum_{j=1}^{m}B\left(S,\sum_{i=1}^{j}\wt\left(P^{(i)}\right),\gamma\right)\log M_\ccc^{*}\left(n^{(j)}, \wt\left(P^{(j)}\right),\eta\right) \end{multline} where \begin{equation} M_\ccc^{*}(n, \wt(P),\eta)=\max\left\{M |\exists \mbox{ an } (n, M, \eta)_P\mbox{-code} \mbox{ for the alive channel } p_\ta \right\} \end{equation} is the maximum transmission volume of the constant composition code over the binary-input DMC when the channel is alive. To maximize the expected log-volume in \eqref{eqn:volccc} given a total length $N=\sum_{i=1}^m n^{(i)}$, a $\left(\cC^{(i)}_\ccc\right)_{i=1}^m$ for $1\leq m \leq N$ to maximize \eqref{eqn:volccc} needs to be found. Let $Z_\ccc(N,H,\eta)$ be the set of all possible $\left((n^{(i)},M^{(i)},\eta)_{P^{(i)}}\right)_{i=1}^m$-codes for all $m\in\{1,\ldots,N\}$, which have total length $N$ and total Hamming weight $H$, i.e., \begin{multline}\label{eqn:zccc} Z_\ccc(N, H,\eta)\triangleq \left. \Bigg\{ \left(\cC^{(i)}\right)_{i=1}^{m} \middle| \right. \cC^{(i)} \mbox{ is an } \left(n^{(i)}, M^{(i)}, \eta\right)_{P^{(i)}}\mbox{-code}, 0< m < N, \\ \left. \sum_{i=1}^{m} n^{(i)}=N \mbox{ and } \sum_{i=1}^{m}\wt\left(P^{(i)}\right)=H\Bigg\}\right.. \end{multline} Then the maximum expected log-volume with the given $N$ and $H$ of transmitting the constant composition codes is denoted as follows: \begin{equation} \label{eqn:volccc_} V_\ccc^*(N,H, \eta)= \max_{\substack{\left(\cC^{(i)}\right)_{i=1}^{m}\in\\ Z_\ccc(N,H,\eta)}} \left\{\sum_{j=1}^{m}B\left(S,\sum_{i=1}^{j}\wt\left(P^{(i)}\right),\gamma\right) \log M_\ccc^{*}\left(n^{(j)}, \wt\left({P^{(j)}}\right),\eta\right)\right\}, \end{equation} and the maximum expected log-volume with $N$ is \begin{equation}\label{eqn:volccc_V} V^*_\ccc(N, \eta)=\max_{0< H<N} V_\ccc^*(N,H, \eta). \end{equation} It should be noted that $m$ does not need to be specified explicitly in the maximization in \eqref{eqn:volccc_} since $Z_\ccc(N, H, \eta)$ in \eqref{eqn:zccc} consists of all collections of codes $\left(C_{\ccc}^{(i)}\right)_{i=1}^m$ for each $1\le m \le N-1$. \subsection{Dynamic Programming Formulation}\label{sec:dpccc} To solve the maximization problem in equation \eqref{eqn:volccc_}, a dynamic programming formalism is adopted. A recursive form of \eqref{eqn:volccc_} can be formulated as: \begin{equation} \label{eqn:dprec} V^*_\ccc(N,H,\eta)=\max_{\substack{\text1\leq n\leq N\\1\leq h \leq H}}\left\{V^*_\ccc(N-n, H-h,\eta)+ B\left(S,H,\gamma\right) \log M_\ccc^*(n,\wt(P),\eta)\right\}, \end{equation} where $P(1)=h/n$. A graphical representation of the recursive form \eqref{eqn:dprec} is illustrated in Fig.~\ref{fig:dptrellis}. In this trellis diagram, the metric of the branch from node $(x_1, y_1)$ to node $(x_2, y_2)$ is \begin{equation} B\left(S,y_2,\gamma\right) \log M_\ccc^*(x_2-x_1,\wt(P), \eta), \end{equation} where $P(1)=\frac{y_2-y_1}{x_2-x_1}$. The path with the maximum accumulated branch metric from node ($0,0$) to node ($N,H$) is the solution for $V^*_\ccc(N,H,\eta)$. Thus the optimization problem in \eqref{eqn:volccc_} can be reduced to finding the longest path in Fig.~\ref{fig:dptrellis}, in which a dynamic programming algorithm based on \eqref{eqn:dprec} is applied to break down the problem $V^*_\ccc(N,H,\eta)$ into easier subproblems $V^*_\ccc(N-n, H-h,\eta)$ recursively. \begin{figure}[t] \centering \includegraphics[width=4.5in]{DPtrellis} \caption{Graphical representation of the recursive form \eqref{eqn:dprec}.} \label{fig:dptrellis} \end{figure} \subsection{Damage Count Feedback Does Not Improve Performance} The expected log-volume in \eqref{eqn:volccc} contains two parts: the probability of successfully conveying $\cC^{(i)}$ and the volume of $\cC^{(i)}$. How the volume of $\cC^{(i)}$ over DMCs is affected by full feedback has been studied in \cite{AltugW2014}, \cite[Ch.~20]{PolyanskiyW}, which is beyond the scope of this paper. Instead, the following structural question regarding damage count feedback (rather than full feedback) is raised: {\it Will the probability of successfully conveying $\cC^{(i)}$ be different due to feedback of the damage count?} Suppose $\cC^{(1)}$ has been sent through the channel and instant feedback tells the transmitter the damage count $d$ caused by transmitting $\cC^{(1)}$ before conveying $\cC^{(2)}$. The probability of causing $d$ damages from $\wt\left( P^{(1)}\right)$ transmitted $1$s is \begin{equation}\label{eqn:profeedback} \Pr\left[ U(P^{(1)}) = d\right]. \end{equation} Since the transmitter knows that $d$ damage events have happened, the channel is still capable of handling $S-d$ damages. The probability of successfully transmitting $\cC^{(2)}$ given $d$ damages without wearing out the channel is \begin{equation}\label{eqn:protranssec} \Pr\left[ U(P^{(2)})\leq S-d \right]. \end{equation} Combining \eqref{eqn:profeedback} and \eqref{eqn:protranssec}, the overall probability of successfully transmitting $\cC^{(2)}$ is \begin{IEEEeqnarray}{rCl} &&\sum_{d=0}^{S} \Pr\left[ U(P^{(1)}) = d\right]\times\Pr\left[ U(P^{(2)})\leq S-d \right]\\ &&=\Pr\left[ U(P^{(1)})+U(P^{(2)}) \leq S \right]\\ &&=B\left(S,\wt(P^{(1)})+\wt(P^{(2)}),\gamma\right). \end{IEEEeqnarray} The above result can be extended to have the following probability of successfully conveying $\cC^{(i)}$ \begin{equation} B\left(S,\sum_{j=1}^{i}\wt\left(P^{(j)}\right),\gamma\right), \end{equation} which coincides with \eqref{eqn:aliveproccc}. Hence the probability of successfully transmitting $\cC^{(i)}$ remains the same with or without damage state feedback. This implies that the achievable transmission volume cannot be increased by providing damage state feedback. \section{Converse Bound}\label{sec:converse} To obtain a converse (upper) bound on the log-volume for a channel that wears out, we bound the alive probability and the transmission volume in \eqref{eqn:vol} separately from above. Without the constraint of using constant composition codes, the Hamming weights of codewords may be different from each other. Since the transmission volume $M^{(j)}$ in \eqref{eqn:vol} with a given Hamming weight spectrum cannot be obtained in closed-form, we turn our attention to codes with a given average Hamming weight constraint. \subsection{Upper Bound on Transmission Volume} Let $(n, M, \eta)$-codes be $\eta$-achievable codes of length $n$ and size $M$. Denote the Hamming weight of the $i^{\mathrm{th}}$ codeword by $w_i$ for all $i\in\{1,2,\ldots,M\}$. The maximum size of $(n, M, \eta)$-codes with average Hamming weights not exceeding $w^*\triangleq\sum_{i=1}^M w_i$ is given as \begin{multline} M_{\avg}^*(n, w^*, \eta)=\max\{M |\exists \mbox{ an } (n, M, \eta)\mbox{-code} \mbox{ for the alive channel } p_\ta \\\mbox{ such that its average Hamming weight $\leq w^*$}\}. \end{multline} The normal approximation of $M_{\avg}^*(n, w^*, \eta)$ can be evaluated as \cite[Eq.~(1)]{KostinaV2015}. Clearly, $M_{\avg}^*(n, w^*, \eta)$ is a non-decreasing function of $w^*$. \subsection{Upper Bound on Alive Probability} Now we find an upper bound for the alive probability \eqref{eqn:alivepro} with a given average Hamming weight constraint. Given a sequence of codes $\big(\cC^{(i)}\big)_{i=1}^{m}$ with the average Hamming weight $w^*_m$ defined as \begin{equation}\label{eqn:averageweight} w^*_m=\left\{\prod_{i=1}^m \frac{1}{M^{(i)}}\right\}\times \left\{\sum_{\left(\bc^{(i)}\right)_{i=1}^{m}\in \left(\cC^{(i)}\right)_{i=1}^{m}} \sum_{i=1}^{m}\wt\left(\bc^{(i)}\right)\right\}, \end{equation} our objective is to upper bound \eqref{eqn:alivepro}. Since the binomial cdf $B(S, w, \gamma)$ is discrete in $w$, an upper bound is difficult to obtain. Hence we use the Berry-Esseen inequality to obtain an upper bound for the binomial cdf \cite[Theorem 1]{Schulz2016}. This inequality states that \begin{equation}\label{berryessen} B(S, w, \gamma)\leq B_\mathrm{N}(S,w,\gamma)+B_\mathrm{BE}(w), \end{equation} where \begin{IEEEeqnarray}{rCl} B_\mathrm{N}(S,w,\gamma)&=&\frac{1}{2}\Bigg[1+\erf\Bigg(\frac{S-w\gamma}{\sqrt{2w\gamma(1-\gamma)}}\Bigg)\Bigg],\\ B_\mathrm{BE}(w)&=&\frac{\sqrt{10}+3}{6\sqrt{2\pi}}\cdot\frac{\gamma^2+(1-\gamma)^2}{\sqrt{w\gamma(1-\gamma)}}, \end{IEEEeqnarray} and $\erf (\cdot)$ is the Gaussian error function. However, both $B_\mathrm{N}(S,w,\gamma)$ and $B_\mathrm{BE}(w)$ are undefined at $w=0$ and $B_\mathrm{BE}(w)$ is greater than $1$ when $w$ is small. To rule out the undefined point and tighten the bound, we replace $B_\mathrm{N}(S,w,\gamma)$ and $B_\mathrm{BE}(w)$ respectively by \begin{equation}\label{Bbar_N} f_\mathrm{N}(w)= \begin{cases}1 & \text{if } w=0,\\ B_\mathrm{N}(S,w,\gamma) & \text{otherwise}, \end{cases} \end{equation} and \begin{equation}\label{Bbar_BE} f_\mathrm{BE}(w)= \begin{cases}1 & \text{if } 0\leq w\leq w_\mathrm{BE},\\ B_\mathrm{BE}(w) & \text{if }w_\mathrm{BE}<w, \end{cases} \end{equation} where $w_\mathrm{BE}=\max\{w|B_\mathrm{BE}(w)\geq 1\}$, and the inequality $B(S, w, \gamma)\leq f_\mathrm{N}(w)+f_\mathrm{BE}(w)$ still holds. As shown in \eqref{eqn:alivepro}, the alive probability is calculated as the average of $B(S, w, \gamma)$. To simplify the problem formulation, we consider upper bounding $\frac{1}{M}\sum_{i=1}^{M}B(S, w_i, \gamma)$ for a given $\eta$-achievable $(n, M, \eta)$-code with weight spectrum $\{w_i\}_{i=1}^M$. Clearly $w_i\in\{0,1,\ldots,n\}$ for all $i$. From \eqref{berryessen}, \eqref{Bbar_N}, and \eqref{Bbar_BE}, we obtain \begin{IEEEeqnarray}{rCl} \frac{1}{M}\sum_{i=1}^{M}B(S, w_i, \gamma)&\leq&\frac{1}{M}\sum_{i=1}^{M}f_\mathrm{N}(w_i)+f_\mathrm{BE}(w_i)\\ &=&\frac{1}{M}\sum_{i=1}^{M}f_\mathrm{N}(w_i)+\frac{1}{M}\sum_{i=1}^{M}f_\mathrm{BE}(w_i).\label{eqn:berryesseenbound} \end{IEEEeqnarray} Now we introduce left-concave right-convex (LCRC) functions \cite[Sec.~3.3]{Cirtoaje2006}. \begin{definition}\label{def:LCRC} $f:[a,\infty) \rightarrow \mathbb{R}$ is said to be an LCRC function if it is continuous on $[a,\infty)$ and there exists a $c\in[a,\infty)$ such that $f$ is concave on $[a,c]$ and convex on $[c,\infty)$. \end{definition} From \eqref{Bbar_N} and \eqref{Bbar_BE}, it is clear that both $f_\mathrm{N}(w)$ and $f_\mathrm{BE}(w)$ are well-defined for all nonnegative real values $w$. We extend the definitions of $f_\mathrm{N}$ and $f_\mathrm{BE}$ so that their domains are $[0,n]$ and write $f_\mathrm{N}(x)$ and $f_\mathrm{BE}(x)$ for $x\in[0,n]$. Clearly $f_\mathrm{N}$ and $f_\mathrm{BE}$ are continuous. The following two lemmas state that both $f_\mathrm{N}(x)$ and $f_\mathrm{BE}(x)$ are non-increasing LCRC functions of $x$. \begin{lemma}\label{lm:LCRC-normalapprox} The function $f_\mathrm{N}:[0,\infty) \rightarrow \mathbb{R}$ is a non-increasing LCRC function. \end{lemma} \begin{IEEEproof} See Appendix \ref{append:LCRC-normalapprox}. \end{IEEEproof} \begin{lemma}\label{lm:LCRC-berryesseen}. The function $f_\mathrm{BE}:[0,\infty) \rightarrow \mathbb{R}$ is a non-increasing LCRC function. \end{lemma} \begin{IEEEproof} See Appendix \ref{append:LCRC-berryesseen}. \end{IEEEproof} Now let us recall Karamata's majorization inequality \cite{Karamata1932}. \begin{lemma}[Karamata's majorization inequality] \label{lm:karamata} Given $a_1\geq a_2\geq \cdots \geq a_M$ and $b_1\geq b_2\geq \cdots \geq b_M$ such that $a_i$, $b_i$ are in interval $I$. Let $A_h\triangleq\sum_{i=1}^{h}a_i\geq B_h\triangleq\sum_{i=1}^{h}b_i$ for all $1\leq h\leq M-1$, and $A_M\triangleq\sum_{i=1}^{M}a_i=B_M\triangleq\sum_{i=1}^{M}b_i$, then \begin{equation} \sum_{i=1}^{M}f(a_i) \geq \sum_{i=1}^{M}f(b_i) \end{equation} if $f$ is a convex function on $I$. \end{lemma} \begin{IEEEproof} See Appendix \ref{append:karamata} for a self-contained proof. \end{IEEEproof} Given two tuples $(a_1,a_2,\ldots,a_M)$ and $(b_1,b_2,\ldots,b_M)$ such that $\sum_{i=1}^{M}a_i=\sum_{i=1}^{M}b_i$, we say that $(a_1,a_2,\ldots,a_M)$ majorizes $(b_1,b_2,\ldots,b_M)$ if $\sum_{i=1}^{h}a_i\geq \sum_{i=1}^{h}b_i$ for all $1\leq h\leq M-1$. The following lemma specifies the sequence which majorizes all sequences with the same average. \begin{lemma}\label{lm:majorsequence} For $c,b\in\mathbb{R}$ such that $c<b$, any tuple in $[c,b]^M$ with average $x^*$ is majorized by the following sequence of length $M$. \begin{equation}\label{eqn:majorsequence} x_i= \begin{cases} b & \text{if } 1\le i\le j,\\ Mx^*-jb-(M-j-1)c & \text{if } i= j+1,\\ c & \text{otherwise,} \end{cases} \end{equation} where $j=\left\lfloor \frac{M(x^*-c)}{b-c} \right\rfloor$. \end{lemma} \begin{IEEEproof} See Appendix \ref{append:majorsequence}. \end{IEEEproof} It can be verified that $c\le Mx^*-jb-(M-j-1)c \le b$. An illustration of the sequence \eqref{eqn:majorsequence} is given in Fig.~\ref{fig:majorizedseq}, in which $r=Mx^*-jb-(M-j-1)c$. Fig.~\ref{fig:majorizedseq} shows that the sequence majorizes other sequences with the same average has the property that it keeps assigning the largest value $b$ to $x_i$ from $i=1$ until the constraint $\sum_{i=1}^Mx_i =Mx^*$ is no longer satisfied. \begin{figure}[t] \centering \includegraphics[width=4.5in]{majorizedseq} \caption{An illustration of the majorizing sequence \eqref{eqn:majorsequence}, which separates all $x_i$ into three categories. $j$ blue bars, a green bar, and $t-j-1$ yellow bars denote the $x_i$ equal to $b$, $r=Mx^*-jb-(M-j-1)c$, and $c$, respectively.} \label{fig:majorizedseq} \end{figure} Combining Lemmas \ref{lm:karamata} and \ref{lm:majorsequence}, the sequence \eqref{eqn:majorsequence} has the maximal $\sum_{i=1}^Mf(x_i)$ among all sequences from $[a,b]^M$ if function $f$ is convex on $[a,b]$. Given an LCRC function $f$ and the average $\frac{1}{M}\sum_{i=1}^M x_i$, Jensen's inequality and Karamata's inequality can be applied to upper bound $\frac{1}{M}\sum_{i=1}^M f(x_i)$ as stated in \cite[Sec.~3.3]{Cirtoaje2006} within all $x_i\in[a,\infty)$ (LCRC inequality). However, according to \eqref{eqn:berryesseenbound}, all $x_i$ are restricted to be in the bounded interval $[0,n]$. To fit our purpose, we revise the LCRC inequality to upper bound $\sum_{i=1}^M f(x_i)$ where all $x_i$ are drawn from a bounded interval $[a,b]$. \begin{lemma}[Revised LCRC inequality] \label{lm:lcrc} Given $a,b,c\in\mathbb{R}$ such that $a<b$ and $a<c$. Let $f$ be a continuous LCRC function on $[a,\infty)$ and $c$ be the point separating the concave region and the convex region. Given $x_i\in [a,b]$ for $1\leq i \leq M$ and $\frac{1}{M}\sum_{i=1}^M x_i=x^*$, then \begin{equation}\label{eqn:col_lcrc_real} \sum_{i=1}^M f(x_i)\leq \max_{(j,r)\in\setS^{M,x^*}_\mathbb{R}(a,b)}\left\{jf(b)+f(r)+(M-j-1)f\left(\frac{Mx^*-jb-r}{M-j-1}\right)\right\}, \end{equation} where \begin{equation} \setS^{M,x^*}_\mathbb{R}(a,b)=\left\{(j,r)\,\middle|\, j\in\{0,1,\ldots,M-1\},\ r\in\mathbb{R} \mbox{ s.t. } b\ge r\ge\left(\frac{Mx^*-jb-r}{M-j-1}\right)\ge a\right\}. \end{equation} If $f$ is also a non-increasing function and $a$ is an integer, inequality \eqref{eqn:col_lcrc_real} can be rewritten as \begin{equation}\label{eqn:col_lcrc_integer} \sum_{i=1}^M f(x_i)\leq \max_{(j,k)\in\setS^{M,x^*}_\mathbb{Z}(a,b)}\left\{jf(b)+f(k)+(M-j-1)f\left(z\right)\right\}, \end{equation} where $z=\max\left\{\frac{Mx^*-jb-k-1}{M-j-1}, a\right\}$ and \begin{equation} \setS^{M,x^*}_\mathbb{Z}(a,b)=\left\{(j,k)\,\middle|\, j\in\{0,1,\ldots,M-1\},\ k\in\{a,a+1, \ldots,\lfloor b\rfloor \} \mbox{ s.t. } k+1\ge z\right\}. \end{equation} \end{lemma} \begin{IEEEproof} See Appendix \ref{append:lcrc}. \end{IEEEproof} Given some $(j,k)$, the corresponding sequences $(x_1,x_2,\ldots,x_M)$ are depicted in Fig.~\ref{fig:lcrcseq}. As shown in Fig.~\ref{fig:lcrcseq}, two instances are of $(j,k)\notin\setS^{M,x^*}_\mathbb{Z}(a,b)$, they are $(0,\lfloor b\rfloor -2)$ and $(2,\lfloor b\rfloor)$. For the instance of $(j,k)=(0,\lfloor b\rfloor -2)$, which is not in $\setS^{M,x^*}_\mathbb{Z}(a,b)$ because of $k+1< z $, hence the corresponding sequence can not maximize $\sum_{i=1}^M f(x_i)$. For the other instance of $(j,k)=(2,\lfloor b\rfloor)$, which is not in $\setS^{M,x^*}_\mathbb{Z}(a,b)$ due to $x_i\notin[a,b]$ for $i\ge j+2$. The maximization \eqref{eqn:col_lcrc_integer} only considers those sequences corresponding to valid $(j,k)$. \begin{figure}[t] \centering \includegraphics[width=6in]{LCRCseq} \caption{An illustration of the sequences corresponding to $(j,k)\in\setS^{M,x^*}_\mathbb{Z}(a,b)$. All the sequences corresponding to the $(j,k)\notin\setS^{M,x^*}_\mathbb{Z}(a,b)$ are not considered in the maximization \eqref{eqn:col_lcrc_integer}.} \label{fig:lcrcseq} \end{figure} With the help of Lemma \ref{lm:lcrc}, we now can upper bound the alive probability in \eqref{eqn:alivepro} as follows. \begin{theorem}\label{thm:aliveproconverse} Given a sequence of codes, $\left(\cC^{(i)}\right)_{i=1}^{m}$ with average Hamming weights $w^*_m$, the alive probability of conveying $\left(\cC^{(i)}\right)_{i=1}^{m}$ is upper-bounded as follows. \begin{IEEEeqnarray}{rCl} &\Pr&\left[\left(\cC^{(i)}\right)_{i=1}^{m}\mbox{ alive}\right] \nonumber\\ &\leq&\frac{1}{M} \max_{(j,k)\in\setS^{M,w_m^*}_{\mathbb{Z}}(0,N)}\left\{jf_{\mathrm{N}}(N)+f_{\mathrm{N}}(k)+(M-j-1)f_{\mathrm{N}}\left(\frac{Mw^*_m-jN-k-1}{M-j-1}\right)\right\}\nonumber\\ &&+\frac{1}{M}\max_{(j,k)\in\setS^{M,w_m^*}_{\mathbb{Z}}(0,N)}\left\{jf_{\mathrm{BE}}(N)+f_{\mathrm{BE}}(k)+(M-j-1)f_{\mathrm{BE}}\left(\frac{Mw^*_m-jN-k-1}{M-j-1}\right)\right\}\label{eqn:aliveproconverse-1}\\ &\triangleq&\bar{P}(M,N,w_m^*)\label{eqn:aliveproconverse-2} \end{IEEEeqnarray} where $M=\prod_{i=1}^m M^{(i)}$ and $\sum_{i=1}^m n^{(i)}=N$. \end{theorem} \begin{IEEEproof} From \eqref{eqn:berryesseenbound}, the alive probability \eqref{eqn:alivepro} can be upper-bounded as \begin{equation}\label{eqn:thm1-1} \Pr\left[\left(\cC^{(i)}\right)_{i=1}^{m}\mbox{ alive}\right]\le\frac{1}{M}\sum_{\bc\in\left(\cC^{(i)}\right)_{i=1}^{m}}{f_{\mathrm{N}}}(\wt(\bc))+\frac{1}{M}\sum_{\bc\in\left(\cC^{(i)}\right)_{i=1}^{m}}{f_{\mathrm{BE}}}(\wt(\bc)). \end{equation} Lemmas \ref{lm:LCRC-normalapprox} and \ref{lm:LCRC-berryesseen} tell us that both $f_{\mathrm{N}}$ and $f_{\mathrm{BE}}$ are non-increasing LCRC functions on $[0,\infty)$ and $\wt(\bc)\in\{0,1,\ldots,N\}$ for all $\bc\in\left(\cC^{(i)}\right)_{i=1}^{m}$, inequality \eqref{eqn:col_lcrc_integer} from Lemma \ref{lm:lcrc} is then applied to obtain \eqref{eqn:aliveproconverse-1} with a given average constraint $w^*_m$. \end{IEEEproof} Clearly, $\bar{P}(M,N,w_m^*)$ in \eqref{eqn:aliveproconverse-2} is non-increasing in $w_m^*$. \emph{Remark:} Equation \eqref{eqn:col_lcrc_integer} basically separates all $M$ points in the summation into three parts, $j$ points at $b$, one point at $k$, and $M-j-1$ points at $\left(\frac{Mx^*-jb-k-1}{M-j-1}\right)$. Similar to Theorem \ref{thm:aliveproconverse}, the alive probability is upper-bounded by a quantity that involves $j$ codewords of Hamming weight $N$, one codeword of weight $k$, and $M-j-1$ codewords of weight $\left(\frac{Mw^*_m-jN-k-1}{M-j-1}\right)$. Based on the numerical results, we observe that the maximum of \eqref{eqn:aliveproconverse-1} is always achieved by a $(j,k)\in\setS^{M,w_m^*}_{\mathbb{Z}}(0,N)$ such that $M\gg j$, which implies that most codewords are of the same Hamming weight. Hence, we conjecture that constant composition codes can approach the maximization \eqref{eqn:aliveproconverse-1} with a small gap. \subsection{Dynamic Programming Formulation}\label{sec:dpconverse} Based on the upper bounds of the log-volume and the alive probability, the following optimization formula provides a converse bound for channels that wear out: \begin{equation}\label{eqn:converseVW} V^*(N,W,\eta) \leq \max_{\substack{ m\in \mathbb{Z}_+,\\ (N_i, W_i)_{i=1}^m\in\setH_{\mathbb{R}}(N,W,m)}}\sum_{i=1}^m\bar{P}\left(M_{\avg}^*(n_i, w_i, \eta), N_i, W_i\right)\log M_{\avg}^*(n_i, w_i, \eta), \end{equation} where \begin{multline} \setH_{\mathbb{R}}(N,W,m)=\bigg\{(N_i,W_i)_{i=1}^m: n_i\in \mathbb{Z}_+,\ w_i\in \mathbb{R}_+\mbox{ s.t. }N_i \le N_{i+1},\ W_i \le W_{i+1}\\ \mbox{for all } 1<i<m-1 \mbox{ and } N_m=N,\ W_m=W\bigg\}, \end{multline} $n_i=N_i-N_{i-1}$, $w_i=W_i-W_{i-1}$, and $N_0=W_0=0$. However, the decision variables $(W_i)_{i=1}^m$ cannot be solved for by dynamic programming efficiently, since $W_i$ is real for all $1\leq i\leq m$. To overcome this difficulty, we quantize $w_i$ by segmenting it into several intervals. A simple way to perform segmentation is by using the floor operation, i.e, $\lfloor W_i \rfloor\le W_i \le \lfloor W_i \rfloor+1$. As mentioned in the previous section, $M_{\avg}^*(n_i, w_i, \eta)$ is a non-decreasing function of $w_i$ and $\bar{P}(M,N_i,W_i)$ is a non-increasing function of $W_i$. Hence, let $K_i=\lfloor W_i \rfloor$, we have $w_i=W_i-W_{i-1}\le K_{i}-K_{i-1}+1$, which implies that \begin{IEEEeqnarray}{rCl} M_{\avg}^*(n_i, w_i, \eta)&\leq&M_{\avg}^*(n, K_{i}-K_{i-1}+1, \eta), \\ \bar{P}(M,N_i,W_i) &\le& \bar{P}(M,N_i,K_i). \end{IEEEeqnarray} We then conclude that \eqref{eqn:converseVW} can be further upper bounded by \begin{multline} V^*(N,W,\eta) \leq \bar{V}^*(N,W,\eta)\triangleq\max_{\substack{ m\in \mathbb{Z}_+,\\ (N_i, K_i)_{i=1}^m\in\setH_{\mathbb{Z}}(N,W,m)}}\\ \sum_{i=1}^m\bar{P}\left(M_{\avg}^*(n_i, K_i-K_{i-1}+1, \eta), N_i, K_i\right)\log M_{\avg}^*(n_i, K_i-K_{i-1}+1, \eta)\label{eqn:converseVWQ}, \end{multline} where \begin{multline} \setH_{\mathbb{Z}}(N,W,m)=\bigg\{(N_i,K_i)_{i=1}^m: N_i,K_i\in \mathbb{Z}_+\mbox{ s.t. }N_i \le N_{i+1},\ K_i \le K_{i+1}\\ \mbox{for all } 1<i<m-1 \mbox{ and } N_m=N,\ K_m=W\bigg\} \end{multline} and $K_0=0$. Similar to the dynamic programming procedure for the achievability bound \eqref{eqn:dprec}, we can write \eqref{eqn:converseVWQ} recursively as \begin{multline} \bar{V}^*(N,W,\eta)=\max_{\substack{\text1\leq n\leq N\\0\leq k \leq W}}\bigg\{\bar{V}^*(N-n,W-k,\eta)\\ +\bar{P}\left(M_{\avg}^*(n, k+1, \eta), N, W\right) \log M_{\avg}^*(n, k+1, \eta)\bigg\}, \end{multline} and \begin{equation}\label{eqn:conversev} \bar{V}^*(N,\eta)=\max_{0< W< N}\bar{V}^*(N,W,\eta). \end{equation} Now we have achievable and converse bounds, we provide numerical examples to see how close the two bounds are to one another, and also gain further insight into the nature of the achievable schemes. \section{Numerical Results} \label{sec:num} This section presents some numerical results. Here, we consider a BSC with crossover probability $\varepsilon$, denoted by BSC($\varepsilon$), when the channel is alive, i.e., the channel $(\cX, p_\ta, p_\td, \gamma, S, \cY)$ with $\cY=\{0,1,?\}$, $p_\ta(1|0)=p_\ta(0|1)=\varepsilon$, and $p_\ta(0|0)=p_\ta(1|1)=1-\varepsilon$. To evaluate $M_\ccc^{*}(n, \wt(P), \eta)$ for BSC($\varepsilon$), the normal approximation of \cite[Eq.~(21)]{Moulin2012} (ignoring the $o(1)$ term) is used, i.e., \begin{equation} \log M_\ccc^{*}(n, \wt(P), \eta)\approx nI(P;p_\ta)+\sqrt{n\rho(P;p_\ta)}Q^{-1} (\eta)+ \tfrac{1}{2}\log n + A_\eta(P;p_\ta)+\Delta_\ccc(P;p_\ta), \end{equation} where $P$ is the type of input, $I(P;p_\ta)$ is the mutual information, $\rho(P;p_\ta)$ is the conditional information variance, $Q^{-1} (\eta)$ is the inverse $Q$-function, and $A_\eta(P;p_\ta)+\Delta_\ccc(P;p_\ta)$ is the constant part of the approximation in \cite{Moulin2012}. The $M_\avg^{*}(n, w^*, \eta)$ is evaluated by \cite[Eq.~(1)]{KostinaV2015} (ignoring the $O(1)$ term), i.e., \begin{equation} \log M_{\avg}^*(n, w^*, \eta)\approx nC(w^*/n)-\sqrt{nV(w^*/n)}Q^{-1}(\eta)+\frac{1}{2}\log n, \end{equation} where $C(\cdot)$ is the capacity-cost function and $V(\cdot)$ is the dispersion-cost function.\footnote{ For $M_\ccc^{*}(n, \wt(P), \eta)$ and $M_\avg^{*}(n, w, \eta)$, there exist achievability \cite[Section III]{Moulin2012} and converse \cite[Theorem 3]{KostinaV2015} bounds respectively. However, computation of these bounds is time-consuming, especially within dynamic programming. For ease of numerical computation, the normal approximation is adopted.} The channel is damaged with a probability $\gamma=0.5$ when a $1$ is transmitted, and worn out after the amount of damage exceeds $S=5$. Both the achievable rate \eqref{eqn:volccc_V} and the converse rate \eqref{eqn:conversev} up to $N=400$ for a BSC($0.11$) are depicted in Fig.~\ref{fig:rate}, in which the average transmission error was assumed to be lower than $\eta=0.001$. As expected, the upper bound of alive probability based on the bounded LCRC inequality implies the upper bound is close to that for a constant composition code. Hence the converse bound is close to the achievability bound. In line with the discussion after Theorem \ref{thm:aliveproconverse}, this observation suggests that constant composition codes may achieve the fundamental communication limits asymptotically. \begin{figure}[t] \centering \includegraphics[width=4.5in]{Rate} \caption{The maximum expected rates for BSC($\varepsilon$).} \label{fig:rate} \end{figure} Now we compare multiple-blocks codes with single-block codes using the achievability \eqref{eqn:volccc_V} and converse bounds \eqref{eqn:conversev} over this channel that wears out. Fig.~\ref{fig:achievabler} and Fig.~\ref{fig:converser} show the single-block scheme performs less well than the multiple-block scheme and the gap becomes significant when $N$ increases. With the multiple-blocks scheme, segmenting the information can extend the lifetime of channel to further increase communication limits. \begin{figure}[t] \centering \includegraphics[width=4.5in]{AchievableRate} \caption{The achievability bound and the achievability bound for single-block transmission.} \label{fig:achievabler} \end{figure} \begin{figure}[t] \centering \includegraphics[width=4.5in]{ConverseRate} \caption{The converse bound and the converse bound for single-block transmission.} \label{fig:converser} \end{figure} The size of each block based on the achievability and the converse bounds are given in Fig.~\ref{fig:achievablel} and Fig.~\ref{fig:conversel}, respectively. In both figures, the length of each transmitted block is plotted in a different color. As these figures show, when $N$ is small, the single-block scheme is sufficient to optimally transmit information over channels that wear out; this is further evidenced by the fact that the curves in Fig.~\ref{fig:achievabler} and \ref{fig:converser} overlap when $N$ is small. As $N$ increases, the best strategy is to separate information into blocks; for example, when $N=300$, both the achievability bound in Fig.~\ref{fig:achievablel} and the converse bound in Fig.~\ref{fig:conversel} suggest separating information into three blocks of lengths $n^{(1)}$, $n^{(2)}$, and $n^{(3)}$. The corresponding Hamming weights of the transmitted blocks are given in Fig.~\ref{fig:achievablew} and Fig.~\ref{fig:conversew}. From Fig.~\ref{fig:achievablel} to \ref{fig:conversew}, we also observe that the lengths and the Hamming weights of the transmitted blocks are non-increasing, i.e., $n^{(1)}\ge n^{(2)}\ge \cdots \ge n^{(m)}$ and $w^{(1)}\ge w^{(2)}\ge \cdots \ge w^{(m)}$. Such an observation is intuitive since the shorter or lighter (Hamming weight) codes are preferred when the channel is about to burn out. It remains to determine whether this property holds in general. \begin{figure}[t] \centering \includegraphics[width=4.5in]{AchievableL} \caption{Length of each block for achievability bound.} \label{fig:achievablel} \end{figure} \begin{figure}[t] \centering \includegraphics[width=4.5in]{ConverseL} \caption{Length of each block for converse bound.} \label{fig:conversel} \end{figure} \begin{figure}[t] \centering \includegraphics[width=4.5in]{AchievableW} \caption{Hamming weight of each block for achievability bound.} \label{fig:achievablew} \end{figure} \begin{figure}[t] \centering \includegraphics[width=4.5in]{ConverseW} \caption{Hamming weight of each block for converse bound.} \label{fig:conversew} \end{figure} \section{Conclusion and Future Work}\label{sec:con} Further increasing the connections between reliability theory and information theory, we have proposed a model of a channel that wears out and found the maximum expected transmission volume that can be achieved using constant composition codes at a given level of average error probability. By comparing our achievability result to a novel converse bound, we see that constant composition codes achieve near-optimal performance. Dynamic programming formulations are given for computing achievability and converse bounds, and damage state feedback is shown not to improve the probability of successive transmission or volume of bits for using constant composition codes. An avenue for future work is to consider a channel model where both noisiness and failure probability increase with damage. This may model electronic devices that become noisier before they burn out. \appendices \section{Proof of Lemma \ref{lm:LCRC-normalapprox}} \label{append:LCRC-normalapprox} We first prove the convexity at $x=0$. At point $x=0$, $f_\mathrm{N}(x)$ is convex due to $\lim_{x\downarrow 0}f_\mathrm{N}(x)=1=f_\mathrm{N}(0)$ and $f_\mathrm{N}(x)<f_\mathrm{N}(0)$ for $x>0$. For $x\in(0,\infty)$, we consider the second derivative of $f_\mathrm{N}(x)$ on $x$. The second derivative of $f_\mathrm{N}(x)$ for $x\in(0,\infty)$ is \begin{equation}\label{eqn:secd_approxB} \frac{\mathrm{d}^2}{\mathrm{d} x^2} f_\mathrm{N}(x) = \frac{e^{-f(x)^2}}{\sqrt{32x^7\gamma^3(1-\gamma)^3\pi}}\Delta(x), \end{equation} where \begin{equation} f(x)=\frac{S-x\gamma}{\sqrt{2x\gamma(1-\gamma)}} \end{equation} and \begin{equation} \Delta(x)=\gamma^3x^3+(1-\gamma+S)\gamma^2x^2+(3-3\gamma-S)S\gamma x-S^3. \end{equation} Since $\Delta(0)=-S^3<0$ and $\frac{\mathrm{d}}{\mathrm{d}x}\Delta(x)=0$ at \begin{equation} x=\frac{-2(1-\gamma+S)\gamma^2\pm\sqrt{4(1-\gamma+S)^2\gamma^4-12(3-3\gamma-S)S\gamma^4}}{6\gamma^3}, \end{equation} $\frac{\mathrm{d}}{\mathrm{d}x}\Delta(x)=0$ at some negative $x$ as Fig.~\ref{fig:ex_Delta} shows. \begin{figure}[t] \centering \includegraphics[width=4.5in]{exDelta} \caption{An example of $\Delta(x)$ in \eqref{eqn:secd_approxB}.} \label{fig:ex_Delta} \end{figure} Hence, there must exist a $c>0$ such that $\frac{\mathrm{d}^2}{\mathrm{d} x^2} f_\mathrm{N}(x)\leq 0$ when $0\leq x\leq c$ and $\frac{\mathrm{d}^2}{\mathrm{d} x^2} f_\mathrm{N}(x)\geq 0$ when $c\leq x$. Furthermore, it is clear that $f_\mathrm{N}(x)$ is non-increasing for $x\ge 0$, which concludes that $f_\mathrm{N}(x)$ is a non-increasing LCRC function as defined in Def.~\ref{def:LCRC}. \section{Proof of Lemma \ref{lm:LCRC-berryesseen}} \label{append:LCRC-berryesseen} For $x\in [0, x_\mathrm{BE}]$, where $x_\mathrm{BE}\triangleq\max\{x| B_\mathrm{BE}(x)\ge 1\}$ as the definition of $w_\mathrm{BE}$, $f_\mathrm{BE}(x)=1$ hence it can be both concave and convex in $[0,x_\mathrm{BE}]$. For $x\in [x_\mathrm{BE}, \infty)$, $\frac{\mathrm{d}^2}{\mathrm{d}x^2}f_\mathrm{BE}(x)>0$ hence it is a convex function. Also, $f_\mathrm{BE}(x)$ is clearly a non-increasing function for $x\ge0$. Therefore, $f_\mathrm{BE}(x)$ is a non-decreasing LCRC function as defined in Def.~\ref{def:LCRC}. \section{Proof of Lemma \ref{lm:karamata}} \label{append:karamata} Let \begin{equation} \delta_i\triangleq \frac{f(a_i)-f(b_i)}{a_i-b_i}, \end{equation} for all $1\leq i \leq M$ and $A_0=B_0=0$. We have $\delta_i\geq \delta_{i+1}$ due to the convexity of $f$. Then, \begin{IEEEeqnarray}{rCl} &&\sum_{i=1}^{M}f(a_i) -f(b_i)\\ &=& \sum_{i=1}^M \delta_i (a_i-b_i)\\ &=& \sum_{i=1}^M \delta_i \big[(A_i-A_{i-1})-(B_i-B_{i-1})\big]\\ &=& \sum_{i=1}^M \delta_i (A_i-B_i)-\sum_{i=1}^M \delta_i(A_{i-1}-B_{i-1}) \\ &=& \delta_M\underbrace{(A_M-B_M)}_{=0}+\sum_{i=1}^{M-1}(\delta_i-\delta_{i+1})(A_i-B_i)-\delta_1\underbrace{(A_0-B_0)}_{=0}\\ &=&\sum_{i=1}^{M-1}\underbrace{(\delta_i-\delta_{i+1})}_{\geq0}\underbrace{(A_i-B_i)}_{\geq 0} \geq 0. \end{IEEEeqnarray} \section{Proof of Lemma \ref{lm:majorsequence}} \label{append:majorsequence} Let ${\boldsymbol x}=(x_1,x_2,\ldots,x_M)$ be the sequence in \eqref{eqn:majorsequence}. Suppose there exists a sequence ${\boldsymbol y}=(y_1,y_2,\ldots,y_M)\in[c,b]^M$ such that $y_1\ge y_2 \cdots \ge y_M$, $\sum_{i=1}^M y_i=Mx^*$, and ${\boldsymbol y}$ majorizes ${\boldsymbol x}$, i.e., \begin{equation}\label{eqn:major} \sum_{i=1}^k y_i \ge \sum_{i=1}^k x_i \end{equation} for all $1\le k\le M-1$. Clearly $y_i=x_i=b$ for all $i\le j$ since all $x_i, y_i\in[c,b]$. Now consider the case of $y_{j+1}>x_{j+1}$, which means that $\sum_{i=j+2}^M y_i < (M-j-1)c$ and there must be a $y_i$ for $i\ge j+2$ such that $y_i< c$. Therefore, $y_{j+1}$ must equal $x_{j+1}$ to satisfy \eqref{eqn:major} for all $k\le j+1$. For all $i\ge j+2$, equalities $y_{i}=x_i$ can be verified in the same way. Hence, \eqref{eqn:major} holds for all $k$ if and only if $y_i=x_i$ for all $i$, which proves that the sequence \eqref{eqn:majorsequence} majorizes all sequences from $[c,b]^M$ with the average $x^*$. \section{Proof of Lemma \ref{lm:lcrc}} \label{append:lcrc} Without loss of generality, we assume $x_i\ge x_{i+1}$ for all $1\leq i < M$. Suppose $c\geq x_1$, which means that all $x_i$ are located in the concave region of $f$. Therefore Jensen's inequality can be applied to upper bound $\sum_{i=1}^M f(x_i)$ as \begin{equation} \sum_{i=1}^M f(x_i)\leq Mf(x^*)=f(x^*)+(M-1)f\bigg(\frac{Mx^*-x^*}{M-1}\bigg) \end{equation} which is a special case of \eqref{eqn:col_lcrc_real} when $j=0$ and $r=x^*$. We then consider the case of $x_1>c$. Let $t$ be the index such that \begin{equation}\label{eqn:lcrc-1} x_1\ge \cdots \ge x_t \ge c > x_{t+1}\ge \cdots \ge x_M, \end{equation} and $\sum_{i=1}^t x_i=s$. Since all $x_1 , x_2, \ldots, x_t$ are located in the convex region $[c,b]$ of the function $f$, from Lemmas \ref{lm:karamata} and \ref{lm:majorsequence} we have \begin{equation}\label{eqn:lcrc-2} \sum_{i=1}^t f(x_i)\leq jf(b)+f(r)+(t-j-1)f(c), \end{equation} where $j=\Big\lfloor \frac{s-tc}{b-c}\Big\rfloor$ and $r=s-jb-(t-j-1)c$. Then we upper bound the summation of all points located in concave region $[a,c]$ by Jensen's inequality as \begin{equation}\label{} (t-j-1) f(c) +\sum_{i=t+1}^{M}f(x_i) \leq (M-j-1) f\Bigg(\frac{(t-j-1)c+\sum_{i=t+1}^{M}x_i}{M-j-1}\Bigg).\label{eqn:lcrc-3} \end{equation} Combing both inequalities \eqref{eqn:lcrc-2} and \eqref{eqn:lcrc-3}, we have \begin{IEEEeqnarray}{rCl} \sum_{i=1}^M f(x_i) &\leq& jf(b)+f(r)+(M-j-1) f\Bigg(\frac{(t-j-1)c+\sum_{i=t+1}^{M}x_i}{M-j-1}\Bigg)\label{eqn:lcrc-4}\\ &=& jf(b)+f(r)+(M-j-1) f\Bigg(\frac{Mx^*-jb-r}{M-j-1}\Bigg)\label{eqn:lcrc-5}, \end{IEEEeqnarray} for some $j$ and $r$ such that \begin{equation}\label{eqn:lcrc-6} b\ge r \ge \frac{Mx^*-jb-r}{M-j-1}\ge a. \end{equation} By taking the maximum of \eqref{eqn:lcrc-5} over all possible $j$ and $r$ that satisfy \eqref{eqn:lcrc-6} yields \eqref{eqn:col_lcrc_real}. Now we consider the case when $f$ is also non-increasing. Let $k=\lfloor r\rfloor$, $f(k)\ge f(r)$ and $f\left(\frac{Mx^*-jb-k-1}{M-j-1}\right) \ge f\left(\frac{Mx^*-jb-r}{M-j-1}\right)$ due to $k+1\ge r \ge k$. Moreover, constraint \eqref{eqn:lcrc-6} can be rewritten as \begin{equation} k+1\ge r \ge \frac{Mx^*-jb-r}{M-j-1} \ge \max\left\{\frac{Mx^*-jb-k-1}{M-j-1},a\right\}. \end{equation} Therefore, $(j,r)\in \setS^{M,x^*}_{\mathbb{R}}(a,b)$ implies $(j, \lfloor r\rfloor)\in \setS^{M,x^*}_{\mathbb{Z}}(a,b)$. However, constraint \eqref{eqn:lcrc-6} may result in an $r$ such that $\lfloor r\rfloor <a$, which makes $f(k)$ undefined. To avoid that, we restrict $a$ to be an integer and this establishes \eqref{eqn:col_lcrc_integer}. \bibliographystyle{IEEEtran}
{'timestamp': '2018-08-07T02:17:29', 'yymm': '1701', 'arxiv_id': '1701.01474', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01474'}
arxiv
\section{Introduction} Games with cops and robbers on graphs, which can be applied for designing anti-incursion programs, have been studied for several decades \cite{T1, T2, T3, T4, NW, Q}. We investigate a version of the game where the adversary moves among the vertices $1, \ldots, n$ following a probability distribution $p_{1}, \ldots, p_{n}$. Before the game starts, the cop picks and occupies a vertex from $G$. In each round of the game, the cop selects and moves to an adjacent vertex or stays at the same vertex. The gambler chooses to occupy a vertex randomly based on a time-independent distribution, not restricted to only adjacent vertices. Whenever both players occupy the same vertex at the same time, the cop wins. The gambler is called a known gambler if the cop knows their probability distribution. Otherwise the gambler is called unknown. Gambler-pursuit games model anti-incursion programs navigating a linked list of ports, trying to minimize interception time for enemy packets. Komarov and Winkler proved that the expected capture time on any connected $n$-vertex graph is exactly $n$ for a known gambler \cite{KW}, assuming that both players use optimal strategies. For an unknown gambler, Komarov and Winkler proved an upper bound of approximately $1.97n$ \cite{KW}. Komarov and Winkler conjectured that the general upper bound for the unknown gambler on a connected $n$-vertex graph can be improved from about $1.97n$ to $3n/2$, and that the star is the worst case for this bound. In Sections \ref{unkn} and \ref{unkn1}, we improve the upper bound for the unknown gambler's expected capture time to approximately $1.95n$ by using a different strategy for the cop. \section{Unknown Gambler Pursuit Algorithm}\label{unkn} Let $G$ be a connected $n$-vertex graph. As in \cite{KW}, let $T$ be a spanning subtree of $G$. We describe the cop's pursuit algorithm, and then we prove an upper bound of approximately $1.95n$ on the expected capture time. Suppose that the cop performs a depth first search of $T$, except the cop stays at some leaves for two turns instead of one. Specifically, the cop uniformly at random selects a subset $U$ of $\ceil{0.72912 n}$ vertices and stays at the vertices in $U$ for an extra turn if the vertices are leaves. If there is a vertex $v$ in $U$ that is not a leaf, then the depth first search would already go twice through $v$, so the cop does not need to stay an extra turn at $v$. After the proof, we explain the reason for using the number $0.72912$. The cop flips a coin to decide whether to perform the depth first search forward or backward. Thus the total number of turns in a single depth first search (including the extra turns for the leaves in $U$) is at most $1+2(n-1)+\ceil{0.72912 n} \leq 2.72912 n$. The search is repeated until capture. Since the cop flips a coin to decide whether to search forward or backward, the expected number of turns in the successful depth first search is at most $1.36456n$. \section{Analysis}\label{unkn1} Let the vertices of the graph be named $1, \ldots, n$. Suppose that the unknown gambler chooses vertex $i$ with probability $p_{i}$. We split the proof into two cases to show that the probability of evasion in a single depth first search is at most $0.17745$. \begin{lem} If there are two vertices $i$ and $j$ that the cop visits at least twice each such that $p_{i}+p_{j} \geq 0.732$, then the probability of evasion in a single depth first search is less than $0.162$. \end{lem} \begin{proof} If the cop visits $i$ and $j$ both at least twice, then the probability of evasion is at most $(1-p_{i})^{2}(1-p_{j})^{2} \leq (1-p_{i})^{2}(0.268+p_{i})^{2}$, which has a maximum value of approximately $0.16157$ on the interval $[0,1]$ at $p_{i} = 0.366$. \end{proof} Next we show that the probability of evasion is at most $e^{-1.72912} < 0.17745$ when there are no vertices $i$ and $j$ that the cop visits at least twice each such that $p_{i}+p_{j} \geq 0.732$. \begin{lem}\label{didj} Suppose that there are no vertices $x$ and $y$ that the cop visits at least twice each such that $p_{x}+p_{y} \geq 0.732$. Then the probability of evasion for a single depth first search is at most $(1-\frac{1}{n})^{1.72912 n}$. \end{lem} \begin{proof} Let $i, j$ be any two vertices of $G$ and suppose that $p_{i}+p_{j} = a$ and let $t_{1}, \ldots, t_{n-2}$ denote the vertices of $G$ not equal to $i$ or $j$. Given the condition that there are no vertices $x$ and $y$ that the cop visits at least twice each such that $p_{x}+p_{y} \geq 0.732$, then the probability of evasion for a single depth first search can be bounded by performing the following reduction to obtain shorter searches called $S$ and $S'$. First we define $S'$. If the cop visits a vertex $v$ not in $U$ more than once in the original depth first search, skip the cop's visits to $v$ after the first visit to $v$ in $S'$; if the cop visits a vertex $v$ in $U$ more than twice in the original depth first search, skip the cop's visits to $v$ after the second visit to $v$ in $S'$. Note that with $S'$, vertices in $U$ are visited exactly twice, and vertices not in $U$ are visited exactly once. The number of turns in $S'$ is thus $n+\ceil{0.72912n}=\ceil{1.72912n}$. To obtain $S$ from $S'$, skip all visits to vertices $i$ and $j$. Note that the reduction can only increase the probably of evasion, so the probability of evasion for the original depth first search is at most the probability of evasion for $S'$, which is at most the probability of evasion for $S$. Note also that the searches $S$ or $S'$ could be impossible for the cop to perform, since consecutive vertices in $S$ or $S'$ might not be adjacent. The searches $S$ and $S'$ are only used in this proof to obtain an upper bound on the probability of evasion for the original depth first search. For $c, d \in \left\{1,2\right\}$, define $f_{c,d}(p_{t_{1}}, \ldots, p_{t_{n-2}})$ to be the probability that the gambler evades the cop in search $S$ and that the cop makes $c$ visits to vertex $i$ and $d$ visits to vertex $j$ in search $S'$, conditioned on the fact that there are no vertices $x$ and $y$ that the cop visits at least twice each such that $p_{x}+p_{y} \geq 0.732$ in the original depth first search. Then the probability of evasion in search $S'$ is $p = p(p_{i},p_{j},p_{t_{1}},\ldots,p_{t_{n-2}})$ of the form $(1-p_{i})(1-a+p_{i}) f_{1,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(1-p_{i})^{2}(1-a+p_{i}) f_{2,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(1-p_{i})(1-a+p_{i})^{2} f_{1,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(1-p_{i})^{2}(1-a+p_{i})^{2} f_{2,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})$. Note that $f_{1,2} = f_{2,1}$ by symmetry and $p(\frac{1}{n},\ldots,\frac{1}{n}) = (1-\frac{1}{n})^{\ceil{1.72912 n}}$. Then $\frac{d p}{d p_{i}} = (a-2p_{i})f_{1,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(a-2)(2p_{i}-a)f_{1,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})+2(1-p_{i})(1-a+p_{i})(a-2p_{i})f_{2,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})$, which is equal to zero at $p_{i} = \frac{a}{2}$. Moreover $\frac{d^{2} p}{d p_{i}^{2}} = -2 f_{1,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+2(a-2)f_{1,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(12(p_{i}-\frac{a}{2})^{2}-(a-2)^{2})f_{2,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})$, which is at most $-2 f_{1,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+2(a-2)f_{1,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})+(2a^{2}+4a-4)f_{2,2}(p_{t_{1}}, \ldots, p_{t_{n-2}})$. If $a \geq 0.732$, then $f_{2,2}(p_{t_{1}}, \ldots, p_{t_{n-2}}) = 0$ since there are no vertices $x$ and $y$ that the cop visits at least twice each such that $p_{x}+p_{y} \geq 0.732$. Thus $\frac{d^{2} p}{d p_{i}^{2}} = -2 f_{1,1}(p_{t_{1}}, \ldots, p_{t_{n-2}})+2(a-2)f_{1,2}(p_{t_{1}}, \ldots, p_{t_{n-2}}) \leq 0$ for all $p_{i} \in [0,a]$, so $p$ is maximized when $p_{i} = \frac{a}{2}$. If $a \leq 0.732$, then $2a^{2}+4a-4 < 0$. Thus $\frac{d^{2} p}{d p_{i}^{2}} \leq 0$ for all $p_{i} \in [0,a]$, so $p$ is maximized when $p_{i} = \frac{a}{2}$. This implies that $p$ is maximized only when $p_i=p_j$ for any two vertices $i$ and $j$ of $G$. Thus if there are no vertices $x$ and $y$ that the cop visits at least twice each such that $p_{x}+p_{y} \geq 0.732$, then $p$ is maximized when $p_{i} = \frac{1}{n}$ for all $i$, so the probability of evasion is at most $(1-\frac{1}{n})^{\ceil{1.72912 n}} \leq (1-\frac{1}{n})^{1.72912 n}$. \end{proof} By the last lemma, the probability of evasion for a single depth first search is at most $(1-\frac{1}{n})^{1.72912 n} \leq e^{-1.72912} < 0.17745$. Thus the expected number of depth first searches until the cop catches the robber is at most $\frac{1}{1-0.17745} < 1.21574$. Let $X$ denote the random variable for the total number of turns in all of the cop's depth first searches, not including the successful depth first search. Let $Y$ denote the random variable for the number of turns in the successful search. By linearity of expectation, the expected capture time is equal to $E(X)+E(Y)$. We proved above that $E(X) \leq (2.72912 n)(1.21574-1) < 0.58879n$ and $E(Y) \leq 1.36456n$. Thus the upper bound on the expected capture time is less than $1.95335 n$. \section{Comments} The reason why we chose $0.72912$ for the constant in the pursuit algorithm was because the function $\frac{x}{1-e^{1-x}}-\frac{x}{2}$ has a minimum value of $1.95328$ on the interval $(1,\infty)$ at $x = 2.72912$. Despite this fact, it seems likely that our upper bound is not tight. The best current bounds on the maximum possible expected capture time for any connected $n$-vertex graph are between approximately $1.082n$ and $1.953n$. The lower bound follows from Komarov's proof for the cycle $C_{n}$ \cite{KT}. However, there are a few families of graphs for which there are already tighter bounds. Komarov and Winkler proved an upper bound of approximately $1.082n$ for the expected capture time on the cycle $C_{n}$ \cite{KW} to match the lower bound from \cite{KT}. It is also easy to show that the expected capture time for the path $P_{n}$ is between $1.082n$ and $1.313n$ using the method in \cite{KW}. \section{Acknowledgments} The author thanks Shen-Fu Tsai for helpful questions and suggestions on the exposition of this paper.
{'timestamp': '2017-01-09T02:05:00', 'yymm': '1701', 'arxiv_id': '1701.01599', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01599'}
arxiv
\section{Introduction} The proliferation of mobile devices and the surge of a myriad of multimedia applications has resulted in an exponential growth of the mobile data traffic. In this context, wireless caching has emerged as a powerful technique to overcome the backhaul bottleneck, by reducing the backhaul rate and the delay in retrieving content from the network. The key idea is to store popular content closer to the end users. In \cite{Shan13}, a novel system architecture named \emph{femtocaching} was proposed. It consists of deploying a number of small base stations (BSs) with large storage capacity, in which content is stored during periods of offpeak traffic. The mobile users can download content from the small BSs, which results in a higher throughput per user. In \cite{Gol14}, it was proposed to store content directly in the mobile devices. Users can then retrieve content from neighboring devices using device-to-device (D2D) communication or, alternatively, from the serving BS. In both scenarios, content may be stored using an erasure correcting code, which brings gains with respect to uncoded caching \cite{Paa13,Ped15,Bio15,Ped16}. The use of erasure correcting codes establishes an interesting link between distributed caching for content delivery and distributed storage (DS) for reliable data storage. The key difference is that in the wireless network scenario, data can be downloaded from the storage nodes (the small BSs or the mobile devices) but also from a serving macro BS, which has always the content available. Therefore, the reliability requirements in DS for reliable data storage can be relaxed. In \cite{Bio15}, the placement of content encoded using a maximum distance separable (MDS) code to small BSs was investigated and it was shown that a careful placement allows to significantly reduce the backhaul rate. In \cite{Paa13}, for the scenario where content is stored directly in the mobile devices, the repairing of the lost data when a device storing data leaves the network was considered. Assuming instantaneous repair, the communication cost of data download and repair was investigated. In \cite{Ped15,Ped16}, a repair scheduling where repair is performed periodically was introduced and analytical expressions for the overall communication cost of content download and data repair as a function of the repair interval were derived. Using these expressions, the overall communication cost entailed by storing content using MDS codes, regenerating codes \cite{Dim10}, and locally repairable codes \cite{Pap14} was evaluated in \cite{Ped16} and it was shown that storing content using erasure correcting code can reduce the overall communication cost with respect to the scenario where content is downloaded solely from the BS. In this paper, we consider a similar cellular network scenario as the one in \cite{Paa13,Ped16}, where content is stored in a number of mobile devices using an erasure correcting code. Mobile devices roam in an out of a cell according to a Poisson random process. However, as opposed to \cite{Paa13,Ped16}, where the download of a single file is considered, here we consider that users may request files, of different popularity, from a library of files. Our focus is on the delay of retrieving content from the network, which was not considered in \cite{Paa13,Ped16}. We derive analytical expressions for the download delay if content is stored in the mobile devices using MDS codes and show that MDS-coded distributed caching can significantly reduce the download delay with respect to the case where content is solely downloaded from the BS and the case where uncoded caching is used. The download delay of a single file was analyzed in~\cite{PiGr16}. The remainder of the paper is organized as follows. The system model is introduced in Section~\ref{s:system_model}. The average download delay incurred when MDS-coded distributed caching is used is analyzed in Sections~\ref{s:download} and Section~\ref{s:D2D}. Section~\ref{sec:NumericalResults} presents and discusses numerical results and finally some conclusions are drawn in Section~\ref{sec:Conclusions}. \textit{Notation.} The probability density function (pdf) of a random variable $X$ is denoted by $f_X(\cdot)$ and the expectation with respect to $X$ is denoted by $\mathbb{E}_X\{\cdot\}$. Probability is denoted by $\Pr\{\cdot\}$ and $\mathbf{1}_{i}$ represents the all-ones vector of length $i$. We denote by $\pi_m(\rho)$ the stationary distribution of an $\mathsf{M}/\mathsf{M}/\infty$ queueing system described by a Poisson birth-death process with arrival rate $\alpha$ and departure rate per node $\delta$, which is given by \begin{equation}\nonumber \pi_m(\rho)=\frac{{\rho}^m}{m !} e^{-\rho}\, , \end{equation} where $\rho=\alpha/\delta$. \section{System Model}\label{s:system_model} We consider a single cell in a cellular network where $M$ mobile devices, referred to as nodes, request files, each of size $B$ bits, from a library of $Z$ files. The files have different popularities and accordingly have a given probability to be requested. Depending on the placement strategy, some files are encoded and stored into $n\leq M$ mobile devices, referred to as storage nodes. For ease of language, the set of storage nodes is referred to as the DS network and nodes not storing any content are referred to as \emph{regular} nodes. A copy of each encoded file is also available at the BS serving the cell. A node requesting a file attempts to retrieve it from the storage nodes using D2D communication, and, if the file cannot be completely retrieved from the DS network, the BS assists in providing the missing data. In order to increase the system efficiency, we allow multiple D2D communications to coexist if they are sufficiently far apart in space. Therefore, we divide the cell in $C$ virtual clusters and assume that the size of the cluster and the transmit power are properly chosen such that only one D2D communication can be established between any two nodes in the cluster and the interference across different clusters can be neglected. A similar model is considered in~\cite{Gol14,Ji16}. \textit{Data allocation and coding strategy.} We adopt a deterministic allocation strategy, where the $F\leq Z$ most popular files are cached in a distributed fashion in $n$ storage nodes in the cell, according to the storage capacity of the devices. These files are partitioned into $k$ packets, called symbols, of $B/k$ bits each and are encoded into $n$ coded symbols using an $(n,k)$ MDS erasure correcting code of rate $r = k/n$. We use the same code for every file in order to simplify the analysis. We assume that each storage node stores a single symbol for each of the $F$ most popular files. Overall, $nF$ symbols are stored in $n$ storage nodes and no two storage nodes store the same symbol. We model the popularity of the files in the library using the time-invariant Zipf distribution~\cite{Bre99}.\footnote{The popularity of the files in mobile data traffic does not change very rapidly, i.e., it can be considered constant during the day.} Accordingly, the probability that the $i$th file is requested is \begin{equation}\label{e:Zipf} z_i=\frac{1/i^{\sigma}}{\sum_{j=1}^Z 1/j^{\sigma} } \, , \quad \qquad 1\leq i \leq Z\, , \end{equation} where parameter $\sigma$ regulates the relative popularity of the files. In the following, the set of $F$ files stored in the cache of the mobile devices will be referred to as the DS library. We assume that the mobile devices are free to move inside the cell. We consider a uniform spatial distribution of the nodes in the cell, and hence there are $M_\mathrm{c}=M/C$ devices per cluster on average and among them $n_\mathrm{c}=n/C$ storage nodes. We focus on a single cluster in isolation, and assume that the devices roam in and out of it. The arrival, departure and request model of the nodes are borrowed from \cite{Ped16}. The considered scenario is shown in Fig.~\ref{f:cluster}. \textit{Arrival-departure model.} We assume that nodes arrive to the cluster according to a Poisson random process with exponential independent, identically distributed (i.i.d.) random inter-arrival times $T_\mathrm{a}$ with pdf \begin{equation}\label{e:arrival} f_{T_\mathrm{a}}(t)=M_\mathrm{c}\lambda e^{-M_\mathrm{c}\lambda t}, \qquad \lambda\geq 0, t\geq 0, \end{equation} where $M_\mathrm{c}\lambda$ is the expected arrival rate and $t$ is time, measured in time units (t.u.). The nodes stay in the cluster for an i.i.d. exponential random lifetime $T_ \ell$ with pdf \begin{equation}\label{e:departure} f_{T_\ell}(t)=\mu e^{-\mu t}, \qquad \mu\geq 0, t\geq 0, \end{equation} where $\mu$ is the expected departure rate per node. We assume that $\mu=\lambda$, which implies that the expected number of nodes in the cluster is $M_\mathrm{c}$. This model corresponds to an $\mathsf{M}/\mathsf{M}/\infty$ queuing model and the probability that there are $i$ nodes in the cluster is $\pi_i(M_\mathrm{c})$. The arrival of storage nodes to the cluster can also be described as a Poisson random process. In particular, the inter-arrival times $T_\mathrm{s}$ of the set of storage nodes has pdf \begin{equation}\nonumber f_{T_\mathrm{a}}(t)=n_\mathrm{c}\lambda e^{-n_\mathrm{c}\lambda t}, \qquad \lambda\geq 0, t\geq 0\,. \end{equation} The related lifetime is described by~(\ref{e:departure}) and the probability that there are $i$ storage nodes in the cluster is $\pi_i(n_\mathrm{c})$.\footnote{The Poisson model is largely used in the case of uniform mobility and its popularity is also due to its tractability. However, we would like to remark that while it is able to capture the mobility in one cluster, this model does not guarantee that the total number of storage nodes in the cell is constant and equal to $n$. More precisely, the only guarantee is that there are on average $n_\mathrm{c}$ storage nodes per cluster, but there are no constraints on their instantaneous number, which can even exceed $n$. On the other hand, the probability of having a high number of storage devices in one cluster is generally very low. For $n_\mathrm{c}=9$, we have $\pi_{18}( n_\mathrm{c})=3\cdot 10^{-3}$, $\pi_{27}(n_\mathrm{c})=6.6\cdot 10^{-7}$ and $\pi_{91}( n_\mathrm{c})=4\cdot 10^{-48}$. The same consideration holds for the total number of mobile devices.} \begin{figure}[!t] \centering{} \includegraphics[width=88mm]{system_model_Journal.pdf} \caption{An example of cluster where nodes roam in and out according to a Poisson random process: we have on average $M_\mathrm{c}$ mobile devices, and $n_\mathrm{c}$ storage nodes among them (red circles), caching one different coded symbol for each of the most popular files. A device requesting a file (pink circle), must collect $k$ symbols. It attempts to recover them by using the DS network if the requesting file is stored in the devices. It uses the BS to collect the symbols that it is not able to download from the devices. The download of a symbol from a storage node takes $t_\mathrm{d}$ t.u., and from the BS $t_\mathrm{bs}$ t.u..}\label{f:cluster} \end{figure} \textit{DS network update.} We assume that the nodes storing content that arrive to the cluster from neighboring clusters are not immediately available for download, but the BS serving the cell keeps track of them and periodically updates and broadcasts to all mobile devices the list of storage nodes in the cell every $\Delta$ t.u.. In the sequel, parameter $\Delta$ is referred to as the update interval and the set of storage nodes in the list broadcasted by the BS as the DS list. \textit{Data delivery.} Nodes request the file at random times with i.i.d. random inter-request time $T_r$ with pdf \begin{equation}\label{e:request time} f_{T_r}(t)=\omega e^{-\omega t}, \qquad \omega\geq 0, t\geq 0, \end{equation} where $\omega$ is the expected request rate per node. We focus on the download process. The node that requests a file attempts to retrieve it from the DS network using D2D communication. Thanks to the MDS property, an encoded file can be reconstructed by accessing any $k$ encoded symbols. If the file cannot be completely retrieved from the DS network, the BS assists in providing the missing coded symbols. The download of a coded symbol from a storage node incurs $t_\mathrm{d}$ t.u. and from the BS $t_\mathrm{bs}$ t.u.. We assume that $t_\mathrm{bs}\gg t_\mathrm{d}$ due to the congestion of the BS-to-node link and the fact that D2D communication occurs over a better channel due to the reduced distance between the involved nodes. We further assume that only one D2D link at a time can be established, and that the D2D communication does not interfere with the communication between the BS and the nodes. We say that the D2D network is \emph{idle} if there is no active D2D communication in the cluster. If the D2D network is not idle when one node requests the file, the whole file is downloaded from the BS. Moreover, to simplify the analysis, we assume that multiple BS-to-node links can coexist. \section{File Average Download Delay}\label{s:download} We investigate the average time that is required to retrieve one file from the wireless network, referred to as the download delay. If a requested file is stored in the DS library, the requesting node attempts to retrieve it from the DS network using D2D communication, otherwise the file is entirely downloaded from the BS. Therefore, we introduce the binary random variable (RV) $H\in\{0,1\}$ which describes the hitting of the DS cache, i.e., $H=1$ if a file of the DS library is requested and $H=0$ otherwise. Moreover, the D2D network can be used only if it is idle, i.e., if there are no active D2D communications. Accordingly, we introduce the binary RV $I\in\{0,1\}$ that describes the status of the D2D network. $I=1$ if the network is idle and $I=0$ otherwise. If the D2D network is idle, the requesting node tries to collect the necessary coded symbols from the nodes of the DS list provided by the BS using D2D communication. If the requesting node is a storage node of the DS list, it needs to download $k-1$ symbols, otherwise $k$ symbols must be downloaded. We thus introduce the binary RV $R\in\{0,1\}$, which represents the type of request, i.e., $R=1$ for requests originating from a node that belongs to the DS list and $R=0$ for the other requests. The download from the storage nodes can be either fully successful or partially accomplished, in which case the requesting node turns to the BS to recover the missing symbols. On the other hand, if the D2D network is not idle and the requested file is stored in the DS library, the node downloads $k$ or $k-1$ symbols from the BS, depending on the type of node. From the discussion above, the average file download delay, $\overline{T}_\mathrm{dw}$, may be formalized as \begin{Proposition} The average file download for the cellular network described in Section~\ref{s:system_model} where the $F$ most popular files are stored in the mobile devices using an $(n,k)$ MDS code is \begin{align} \overline{T}_\mathrm{dw}= & \Pr\{H=0\} k t_\mathrm{bs} + \Pr\{I=1\} \Pr\{H=1\} \Big(\overline{T}_{\eta } + (k-\Pr\{R=1\}-\eta) t_\mathrm{bs} \Big) \nonumber\\ &+ \Pr\{I=0\} \Pr\{H=1\} (k-\Pr\{R=1\}) t_\mathrm{bs} \label{e:T} \, , \end{align} where $\eta$ is the average number of coded symbols downloaded per request using D2D communication and $\overline{T}_{\eta }$, referred to as the average D2D download delay, is the corresponding delay. \end{Proposition} The computation of $\eta$, $\overline{T}_{\eta }$ and $\Pr\{R=1\}$ is addressed in Section~\ref{s:D2D}. The probability of hitting the cache can be expressed as \begin{equation}\nonumber \Pr\{ H=1\} =\sum_{i=1}^F z_i\, , \end{equation} where the probabilities $z_i$ are given in~(\ref{e:Zipf}). It follows that $\Pr\{ H=1\} =1$ if $F=Z$. The next step is the computation of the probability that the D2D network is idle. Let $I^{(\ell)}$ be the status of the network at the time of the $\ell$th request. It follows \begin{equation}\label{e:idle} \Pr\{ I=1\} =\lim_{L \to \infty} \frac{1}{L} \sum_{\ell=1}^L \Pr\{ I^{(\ell)}=1\}. \end{equation} In order to compute $\Pr\{ I^{(\ell)}=1\}$, we introduce the RV $W^{(j)}$ that denotes the time instant of the $j$th request. Also, let $T^{(j)}$ be the time during which the D2D network is occupied by the $j$th request. The D2D network is idle at the time of the $\ell$th request if none of the previous requests is still using D2D communication. Therefore, $\Pr\{ I^{(1)}=1\}=1$ and \begin{equation}\label{e:P_I exact} \Pr\{ I^{(\ell)}=1\}\!=\!\prod_{i <\ell} \! \Pr\{ W^{(\ell)} \!\!> \!\!W^{(\ell-i)} \!+ T^{(\ell-i)} \}, \,\ell>1 . \end{equation} Assuming that if the D2D network is not idle at time $W^{(\ell)} $ is because of the $(\ell-1)$th request, the product in (\ref{e:P_I exact}) reduces to the term involving the $(\ell-1)$th request only, i.e., \begin{align}\label{e:P_I approx1} \Pr\{ I^{(\ell)}=1\}&\simeq \Pr\{ W^{(\ell)} > W^{(\ell-1)} + T^{(\ell-1)} \} \\ &= \int_0^\infty \Pr\{ W^{(\ell)} > W^{(\ell-1)} + t \} f_{T^{(\ell-1)} }(t) d t\, .\nonumber \end{align} Since the requests are i.i.d. with inter-request time distributed as in (\ref{e:request time}) and on average there are $M_\mathrm{c}$ nodes in the cluster, we can compute \begin{equation}\nonumber \Pr\{ W^{(\ell)} > W^{(\ell-1)}+ t \} = e^{-\omega M_\mathrm{c} t}\, ,\quad t\geqslant 0,\quad\ell>1\, , \end{equation} and (\ref{e:P_I approx1}) can be written as \begin{equation}\nonumber \Pr\{ I^{(\ell)}=1\}\simeq \mathbb{E}_{T^{(\ell-1)}} \{ e^{-\omega M_\mathrm{c} T^{(\ell-1)}} \} ,\quad\ell>1, \end{equation} If $\omega T^{(\ell-1)} \ll 1$, \begin{equation}\label{e:P_I approx2} e^{-\omega M_\mathrm{c} T^{(\ell-1)}} \simeq 1-\omega M_\mathrm{c} T^{(\ell-1)} \end{equation} and \begin{align} \Pr\{ I^{(\ell)}=1\} & \simeq \mathbb{E}_{T^{(\ell-1)}} \{ e^{-\omega M_\mathrm{c} T^{(\ell-1)}} \} \nonumber\\ & \simeq \mathbb{E}_{T^{(\ell-1)}} \{ 1- \omega M_\mathrm{c} T^{(\ell-1)} \} \nonumber\\ & = 1-\omega M_\mathrm{c} \Pr\{ I^{(\ell-1)}=1\} \Pr\{ H=1\} \overline{T}_{\eta } .\label{e:idle_ell} \end{align} In~(\ref{e:idle_ell}), we used the fact that the probability of hitting the cache and the average D2D download delay are independent of the request index (if $\ell$ is sufficiently large), as it is proven in Lemma~\ref{l:Tdd_ell} in Section~\ref{s:D2D}. Substituting (\ref{e:idle_ell}) in (\ref{e:idle}) and after some simple calculations, we obtain \begin{equation}\label{e:approxI} \Pr\{ I=1\} \simeq \frac{1}{1+\omega M_\mathrm{c} \Pr\{ H=1\} \overline{T}_{\eta }} \, . \end{equation} \section{Download From Storage Nodes}\label{s:D2D} In this section, we consider the computation of the average D2D download delay $\overline{T}_{\eta }$ and the average number of coded symbols $\eta$ downloaded per request using D2D communication. We assume that a node cannot download in parallel from multiple nodes, but it serially tries to download the coded file symbols from the nodes in the DS list. When a node requests the file, if the D2D network is idle and the requested file belongs to the DS library, it randomly chooses one of the storage nodes from the list supplied by the BS. After each downloaded symbol, the requesting node randomly chooses another storage node from the DS list and still alive.\footnote{The requesting node uses the storage nodes alive at the moment of its request even if, during the download process, new storage nodes are included in the DS list after the periodic restoration.} We assume that a requesting node that has collected fewer than the $k$ symbols necessary to reconstruct the file turns to the BS when all the reference storage nodes left or when the download of a symbol fails, even if other storage nodes are available. To simplify the analysis, we assume that both cases (the failed symbol download and the absence of storage nodes) incur $t_\mathrm{d}$ t.u., even if the node could contact the BS earlier. We also assume that the download from the D2D network fails if the requesting node itself leaves the cluster before collecting $k$ symbols. In this case, the download is also completed from the BS. To derive the average D2D download delay, we introduce three RVs describing the number of nodes of different type that are present in the cluster at the instant of a request: the number of storage nodes of the DS list, the total number of storage nodes (belonging or not to the list, the latter corresponding to the storage nodes that arrive to the cluster after the DS list update and that have not left the cluster at the time of the request), and the number of regular nodes. In particular, we denote by $X_1\in\{0,\dots,\infty\}$ the RV that describes the number of storage nodes of the DS list when a request arrives. We describe by the RVs $Q\in\{0,\dots,\infty\}$ and $V\in\{0,\dots,\infty\}$ the total number of storage nodes and the number of regular nodes at the instant of a request, respectively. Moreover, we denote by $Y\in\{0,\dots,\infty\}$ the RV that represents the total number of storage nodes (belonging or not to the DS list) at the beginning of the update interval of length $\Delta$. In the following three lemmas, we give a probabilistic description of the above RVs. \begin{Lemma}\label{l:px1} The probability that there are $x\geq0$ storage nodes of the DS list at the time of a request is \begin{equation}\label{e:px1} \Pr\{X_1=x \}= \frac{\sum_{y=0}^\infty \pi_y(n_\mathrm{c}) \sum_{m=y}^\infty (1-e^{-m\omega \Delta}) \pi_{m-y}(M_\mathrm{c}-n_\mathrm{c}) \Pr\{X_1=x|Y=y\} }{ \sum_{m=1}^\infty (1-e^{-m\omega \Delta}) \pi_m(M_\mathrm{c}) }\, , \end{equation} where $\Pr\{X_1=x|Y=y\}$ is the probability that $ X_1 $ is equal to $x$, given that $y\geq0$ storage nodes are in the cluster at the beginning of the update interval of length $\Delta$, and is \begin{equation} \Pr\{X_1=x|Y=y\}=\frac{1}{\Delta} \sum_{i'=x}^y \frac{1-p_{i'}}{\mu_{i'}} \prod_{{\substack{ j=x \\ j\neq i' }} }^y \frac{j}{j-i'}- \frac{1}{\Delta} \sum_{i'=x + 1}^y \frac{1-p_{i'}}{\mu_{i'}} \prod_{{\substack{ j=x + 1 \\ j\neq i' }} }^y \frac{j}{j-i'}\, ,\label{e:px_J} \end{equation} where $\mu_{i'}=i'\mu$ and $p_{i'}=e^{-\mu_{i'}\Delta}$. \end{Lemma} \begin{proof} The proof is given in Appendix~\ref{app:ProofLem1}. \end{proof} \begin{Lemma}\label{l:pq} The probability that there are $q\geq0$ storage nodes in the cluster at the time of a request is given by \begin{equation}\label{e:pq} \Pr\{Q=q \}= \frac{\sum_{m=q}^\infty (1-e^{-m\omega \Delta}) \pi_{m-q}(M_\mathrm{c}-n_\mathrm{c}) }{ \sum_{m=1}^\infty (1-e^{-m\omega \Delta}) \pi_m(M_\mathrm{c}) } \pi_q(n_\mathrm{c}) \, . \end{equation} \end{Lemma} \begin{proof} The proof follows the same lines as the proof of Lemma~\ref{l:px1}. \end{proof} \begin{Lemma}\label{l:pv} The probability that there are $v\geq0$ regular nodes in the cluster at the time of a request is given by \begin{equation} \Pr\{V=v \}= \frac{\sum_{m=v}^\infty (1-e^{-m\omega \Delta}) \pi_{m-v}(n_\mathrm{c}) }{ \sum_{m=1}^\infty (1-e^{-m\omega \Delta}) \pi_m(M_\mathrm{c}) } \pi_v(M_\mathrm{c}-n_\mathrm{c}) \, . \end{equation} \end{Lemma} \begin{proof} The proof follows the same lines as the proof of Lemma~\ref{l:px1}. \end{proof} Based on the above lemmas, we can compute the probability that the request originates from a storage node of the DS list and the probability of having a given number of storage nodes in the DS list at the time of the request conditioned to the type of request. Using Bayes' rule, the probability that there are $x\geq 0$ storage node of the DS list alive at the time of a request, conditioned to the type of request, is given by \begin{equation}\label{e:px1cond} \Pr\{X_1=x | R=i \}= \Pr\{ R=i| X_1=x \} \frac{ \Pr\{ X_1=x \}} { \Pr\{ R=i\} }\,, i=0,1\, . \end{equation} The probability $\Pr\{ X_1=x \}$ is given in Lemma~\ref{l:px1}. We now compute $\Pr\{ R| X_1 \}$ and $\Pr\{ R \}$. We start with the probability of having one request from the DS list conditioned to the number of storage nodes in the DS list at the time of the request. For $x>0$, it can be written as \begin{equation} \Pr\{ R=1| X_1=x \} = \sum_{v=0}^\infty \sum_{q=x}^\infty \frac{x}{q+v}\Pr\{V=v|Q=q,X=x\} \Pr\{Q=q|X=x\} \,. \end{equation} Clearly, the condition $X=0$ implies that the request cannot originate from a storage node of the DS list, therefore $\Pr\{ R=1 | X_1=0\} = 0$. We approximate the probability that there are $q$ storage nodes at the instant of the request, given the number of nodes of the DS list alive, by using the steady state probability of a Poisson birth-death process with arrival rate $\lambda (\mathbb{E}_{Q}(Q)-\mathbb{E}_{X_1}(X_1))$ and departure rate $\lambda$. In particular, we compute \begin{equation}\label{e:pq_approx} \Pr\{Q=q|X=x \} \simeq \pi_{q-x}(\mathbb{E}_{Q}(Q)-\mathbb{E}_{X_1}(X_1))\, \end{equation} where the expectations $\mathbb{E}_{Q}(Q)$ and $\mathbb{E}_{X_1}(X_1)$ are obtained starting from the probabilities~(\ref{e:pq}) and (\ref{e:px1}), respectively. The number of regular nodes $V$ is independent of the number of storage nodes at the instant of the request, therefore we finally have \begin{equation} \Pr\{ R=1| X_1=x \} =\sum_{q=x}^\infty \sum_{v=0}^\infty \frac{x}{q+v}\Pr\{V=v\} \pi_{q-x}(\mathbb{E}_{Q}(Q)-\mathbb{E}_{X_1}(X_1)) \,, \end{equation} where $\Pr\{V=v\}$ is given in Lemma~\ref{l:pv}. Note that in the expression above, with some abuse of notation, we used equal sign to avoid carrying all the way the approximation sign due to the approximation introduced in (\ref{e:pq_approx}). Starting from this result, we compute the probability that the request originates from the DS list as \begin{equation} \Pr\{R=1\}=\sum_{x=0}^\infty \sum_{q=x}^\infty \sum_{v=0}^\infty \frac{x}{q+v}\Pr\{V=v\} \pi_{q-x}(\mathbb{E}_{Q}(Q)-\mathbb{E}_{X_1}(X_1)) \Pr\{X_1=x \}\, , \end{equation} where $\Pr\{X_1=x\}$ is given in Lemma~\ref{l:px1}. The probability $\Pr\{ R=0| X_1=x \}$ is easily computed as $1-\Pr\{ R=1| X_1=x \}$. Similarly, we have $\Pr\{R=0\}=1-\Pr\{R=1\}$. Following the same approach for the proof of Lemma~\ref{l:px1}, it is easy to show that $\Pr\{X_1^{(\ell)}=x|R^{(\ell)}=i \}$ and $\Pr\{R^{(\ell)}=i\}$ are independent of the specific request (when $\ell$ grows large), where $R^{(\ell)}$ is the binary RV describing the type of the $\ell$th request. The case $\Delta=0$ represents the case of instantaneous update, where the nodes contact directly the BS when they request a file and receive the list of the storage nodes through a dedicated link. For instantaneous update, the number of storage nodes at the instant of the request and the type of request is described by the following probabilities \begin{align} &\Pr\{X=x\}=\pi_x(n_\mathrm{c})\, ,\\ &\Pr\{R=1\}=\frac{n_\mathrm{c}}{M_\mathrm{c}}\, ,\\ &\Pr\{R=1|X=x\}=\sum_{m=x}^\infty \frac{x}{m}\pi_{m-x}(M_\mathrm{c}-n_\mathrm{c})\, . \end{align} The probability that there are $x\geq0$ storage nodes at the time of the request given the type of request can be computed by replacing the above probabilities in~(\ref{e:px1cond}). In order to describe the D2D download, let $S_1$ be the binary RV that describes the success of the download at the first attempt. More precisely, $S_1=1$ represents the successful download of the coded symbol from the first contacted storage node. If the download is not successful from the first contacted storage node, $S_1=0$. Similarly, we denote by $S_j$ the binary RV describing the download at the $j$th attempt and we denote by $\mathbf{S}_{[i]}$, $i\ge 1$ the random vector ($S_1,..., S_i$). In the following, in Lemmas~\ref{l:S1}, \ref{l:Sk}, and \ref{l:Sj}, we derive the probability that no symbols can be downloaded from the D2D network, $ \Pr \{S_1=0| R\}$, the probability that the content is fully recovered from the DS network, $\Pr\{ \mathbf{S}_{[k-i]}=\mathbf{1}_{k-i} | R\} $, and the probability that it is only partially recovered, $\Pr \{\mathbf{S}_{[j]}=\mathbf{1}_{j}, S_{j+1}=0 | R\}$, respectively. \begin{Lemma}\label{l:S1} The probability that no symbols are downloaded through D2D communication, conditioned to the type of request, is given by \begin{equation}\nonumber \Pr\{ S_1=0|R=i\} = 1 + e^{-\mu t_\mathrm{d}} \Big( \Pr\{X_1=i|R=i\} + \sum_{g =1}^\infty \sum_{d =0 }^{g} \frac{d}{g} \Pr\{X_1=g+i|R=i\} \theta(d,g) - 1\Big), i=0,1. \end{equation} where $\Pr\{X_1|R\} $ is given in~(\ref{e:px1cond}) and \begin{equation}\label{e:theta} \theta(d,g)=\sum_{i'=g-d}^x e^{-\mu_{i'} t_\mathrm{d}} \prod_{{\substack{ j=g-d \\ j\neq i' }} }^x \frac{j}{j-i'}- \sum_{i'=g-d+1}^x e^{-\mu_{i'} t_\mathrm{d}} \prod_{{\substack{ j=g-d+1 \\ j\neq i' }} }^x \frac{j}{j-i'}\,, \quad d\geq 0, g\geq 0 \end{equation} with $\mu_{i'}=i'\mu$. \end{Lemma} \begin{proof} The proof is given in Appendix~\ref{app:ProofLem4}. \end{proof} \begin{Lemma}\label{l:Sk} The probability that the file can be completely retrieved from the DS network, i.e., the probability that k symbols are downloaded through D2D communication when $R=0$, or $k-1$ when $R=1$, conditioned to the type of request, is given by \begin{equation}\nonumber \Pr\{ \mathbf{S}_{[k-i]} =\mathbf{1}_{k-i} |R=i\} = e^{-(k-i)\mu t_\mathrm{d}} \sum_{g =1}^\infty \sum_{d=0 }^{g} \frac{g-d}{g} \gamma_{k-i}(g,d,i) , i=0,1, \end{equation} where $ \gamma_{j}(g,d,i) $ is defined by the recursion \begin{equation}\label{e:gamma} \gamma_j(g,d,i)= \theta(d,g) \sum_{g'=1}^\infty \sum_{d'=0}^{g'-1} \frac{g'-d'}{g'} E(g,g',d') \gamma_{j-1}\!(g',d',i) \end{equation} for $d,g\geq 0$ and $i=0,1$, with initial condition \begin{equation}\label{e:gammaIC} \gamma_1(g,d,i)=\Pr\{X_1=g+i|R=i\} \theta(d,g)\,, \end{equation} and where \begin{equation}\nonumber E(g,g',d')= \begin{cases} 1 & \text{if} \quad g=g'-d'-1 \\ 0 & \text{otherwise}\, . \end{cases} \end{equation} The function $\theta(d,g)$ is given in~(\ref{e:theta}), and $\Pr\{X|R\}$ is given in~(\ref{e:px1cond}). \end{Lemma} \begin{proof} The proof is given in Appendix~\ref{app:ProofLem5}. \end{proof} \begin{Lemma}\label{l:Sj} The probability of consecutively download $j\geq 1$ symbols and to fail the download of the $j+1$th one is \begin{equation} \Pr \{\mathbf{S}_{[j]}=\mathbf{1}_{j}, S_{j+1}=0 |R=i \} = \gamma_{j+1}(0,0,i)a_{j+1} + \sum_{g=1}^\infty \sum_{d=0}^d \Big( \frac{d}{g} \gamma_{j+1}(g,d,i)a_{j+1} + \frac{g-d}{g} \gamma_{j}(g,d,i)b_{j+1} \Big) \nonumber\, , \end{equation} where $a_j=e^{-j\mut_\mathrm{d}}$, $b_j=e^{-(j-1)\mut_\mathrm{d}}(1-e^{-\mu t_\mathrm{d}})$, and $\gamma_{j}(g,d,i)$ is given in~(\ref{e:gamma}). \end{Lemma} \begin{proof} The proof follows the same lines as the proof of Lemma~\ref{l:Sk}. \end{proof} Finally, the average D2D download delay and the average number of downloaded symbols from DS network are given in the following theorem. \newtheorem{Theorem}{Theorem} \begin{Theorem}\label{t:T_NI} Consider the network described in Section~\ref{s:system_model}, where an $(n,k)$ MDS erasure correcting code is employed and where there are $n_\mathrm{c}$ storage nodes in the cluster on average. Let $t_\mathrm{d}$ be the time to download a symbol through D2D communication. The average D2D download delay and the corresponding average number of downloaded symbols are given by \begin{align} \overline{T}_{\eta } =& \overline{T}_1 p_\mathrm{s} + \overline{T}_0 (1-p_\mathrm{s}) \nonumber \\ \eta= & \eta_1 p_\mathrm{s} + \eta_0 (1-p_\mathrm{s}) \nonumber \end{align} where $p_\mathrm{s}=\Pr\{R=1\}$ is the probability that the request comes from a storage node of the DS list, and \begin{align} \eta_i = &(k-i) \Pr\{ \mathbf{S}_{[k-i]}=\mathbf{1}_{k-i} | R=i\} + \sum_{j=1}^{k-1-i} j \Pr \{\mathbf{S}_{[j]}=\mathbf{1}_{j}, S_{j+1}=0| R=i \} \, ,\nonumber\\ \overline{T}_i = & t_\mathrm{d} \Big( \eta_i + c_{k,i}\Pr \{\ S_{1}=0 | R=i\} + \sum_{j=0}^{k-1-i} \Pr \{\mathbf{S}_{[j]}=\mathbf{1}_{j}, S_{j+1}=0 | R=i\} \Big)\, , \qquad \qquad i=0,1 \nonumber \end{align} where $ c_{k,i}=1$ for $k-i>0$ and $ c_{k,i}=0$ otherwise. \begin{proof} The average D2D download delay is obtained as the sum of the average D2D delays in the case of requests originated from the DS list and of requests originating from the other nodes, weighted by the probabilities $p_s$ and $1-p_s$, respectively. The same approach is used for the corresponding average number of downloaded symbols. According to our model, the requesting node completes the download of $k-i$ symbols from the DS network in $(k-i) t_\mathrm{d}$ t.u. with probability $\Pr\{ \mathbf{S}_{[k-i]}=\mathbf{1}_k | R=i \} $, while the partial download of $j<k-i$ symbols happens with probability \mbox{$\Pr \{\mathbf{S}_{[j]}=\mathbf{1}_{j}, S_{j+1}=0 | R=i\}$} and incurs $(j+1)t_\mathrm{d}$ t.u.. For $k-i>0$, in the computation of the average D2D download delay, we also consider the case where download from the DS network completely fails. The corresponding probability is $ \Pr \{S_1=0 | R=i\}$ and the delay is $t_\mathrm{d}$. When the request originates from the DS list and $k=1$, i.e. $k=i$, no symbols need to be downloaded, therefore $\overline{T}_1 $ and $\eta_1 $ are equal to zero. \end{proof} \end{Theorem} \begin{Corollary}\label{l:Tdd_ell} The average D2D download time for the $\ell$th request, $\overline{T}_{\eta }^{(\ell)}$, is independent of the specific request if the index $\ell$ is sufficiently large. \end{Corollary} \begin{proof} Similarly to the average D2D download delay, $\overline{T}_{\eta }^{(\ell)}$ is \begin{equation} \overline{T}_{\eta }^{(\ell)} = \overline{T}_1 ^{(\ell)} \Pr\{ R^{(\ell)}=1\} + \overline{T}_0 ^{(\ell)}\Pr\{ R^{(\ell)}=0\}\, , \nonumber \\ \end{equation} where \begin{align} \overline{T}_i ^{(\ell)}=& t_\mathrm{d} \Big( (k-i) \Pr\{ \mathbf{S}^{(\ell)}_{[k-i]}=\mathbf{1}_{k-i} | R^{(\ell)}=i\} + c_{k,i}\Pr \{\ S^{(\ell)}_{1}=0 | R^{(\ell)}=i\} \nonumber\\ &+ \sum_{j=0}^{k-1-i} (j+1) \Pr \{\mathbf{S}^{(\ell)}_{[j]}=\mathbf{1}_{j}, S^{(\ell)}_{j+1}=0 | R^{(\ell)}=i\} \Big)\, , \qquad \qquad i=0,1 \nonumber \end{align} The Lemma follows from the fact that the probabilities in the expressions above are independent of $\ell$, when $\ell$ grows large. \end{proof} \section{Numerical Results} \label{sec:NumericalResults} In this section, we evaluate the average download delay when content is cached using MDS codes for a cluster with $M_\mathrm{c}=30$ nodes on average, departure rate $\mu=1$, and request rate $\omega=0.02$. We compare the average file download delay $\overline{T}_\mathrm{dw}$ of the considered network with MDS-coded DS with the delay of the traditional scenario where the content is solely downloaded from the BS, denoted by $T_\text{ref}=k t_\mathrm{bs}$ and with uncoded caching. In the following, with no loss of generality, we set $T_\text{ref}=1$ t.u.. We recall that each file that is cached in the DS library is divided into $k$ symbols, and encoded using an ($n,k$) MDS code, where $n$ is the number of storage nodes in the cell. The code parameters are chosen such that $k\leq n_\mathrm{c}$. In this way, the \emph{average storage overhead} in a cluster, $n_\mathrm{c}-k$, is positive, which increases the probability that the content is downloaded through D2D communication only. Alternatively, we can use the same $(n_\mathrm{c},k)$ MDS code for each cluster, but in this case the BS must continuously restore the initial state of reliability of the DS network when storage nodes leave the clusters~\cite{Ped16}. We first consider the special case where $F=Z$, therefore the probability of hitting the cache $\Pr\{H=1\}$ is $1$. In Figs.~\ref{f:0.1}--\ref{f:0.001}, we show the gain that can be achieved using MDS-coded caching, by reporting the ratio between $T_\text{ref}$ and $\overline{T}_\mathrm{dw}$ as a function of the update interval $\Delta$. The infinite series involved in the computation of $\overline{T}_\mathrm{dw}$ are truncated to a given value $t$, chosen according to $\text{argmin}_{t>n_\mathrm{c}}\{ \pi_t(n_\mathrm{c})<10^{-5} \}$ when involving the number of storage nodes and to $\text{argmin}_{t>M_\mathrm{c}}\{ \pi_t(M_\mathrm{c})<10^{-5} \}$ when involving the number of nodes in general. We fix the ratio $k/n_\mathrm{c}$ to be $1/3$, and consider several MDS codes. Moreover, we also consider an uncoded scenario where one storage node on average in the cluster stores the uncoded files. In Figs.~\ref{f:0.1}, \ref{f:0.01}, and \ref{f:0.001}, $t_\mathrm{d}$ is $10$, $100$, and $1000$ times, respectively, smaller than $t_\mathrm{bs}$. In the figures, the solid lines correspond to the analytical closed-form expressions derived in the previous sections and markers correspond to simulation results. It is observed that the analytical expressions predict very well the actual performance, which shows the goodness of the approximations introduced in~(\ref{e:approxI}) and (\ref{e:pq_approx}). The results clearly show that MDS-coded DS can greatly improve the performance in terms of content download delay with respect to the case where content is downloaded from the BS, provided that the update interval, $\Delta$, is sufficiently small. For example, for $t_\mathrm{bs}=10 t_\mathrm{d}$ and $\Delta=1$, a speed-up factor of around $19$ in the download is achieved with respect to the case of downloading from the BS using a $(15,5)$ MDS code. Interestingly, the results also show that the performance improves when $k$ increases. In particular, simple replication (repetition coding) is very inefficient and much better performance are achieved using larger MDS codes (of the same rate). We now consider the more general case where only part of the library of files is cached in the devices. We assume that the library has a size of $Z=1000$ files, and each storage node stores one symbol for each of the $F$ most popular files. We assume that the each file is of size $100$ MB, which corresponds to a $10$-minutes video. We further assume that each storage node makes $6$ GB available for caching. In this case, the number of cached files $F$, that corresponds to the number of symbols cached by each storage node, increases by increasing $k$, since the size of one encoded symbols is $100$MB$/k$ and $F$ is clearly obtained by dividing the storage capacity of the node by the symbol size. In Fig.~\ref{f:sigma}, we show the download speedup factor $T_\text{ref}/\overline{T}_\mathrm{dw}$ as a function of the parameter $\sigma$, which regulates the relative popularity of the files. For example, a large value of $\sigma$ represents the case where few popular files are responsible for the majority of the download traffic. The figure refers to the case where $t_\mathrm{bs}=100t_\mathrm{d}$ and $\Delta=0.5$. The results confirm the gain that can be achieved by MDS-coded distributed caching, but highlight another important aspect. When the whole library is not cached in the network, i.e., $F<Z$, the gain reduction is not negligible, especially for low values of $\sigma$. This fact suggests that the adopted deterministic allocation, where the $F$ most popular files are equally stored in the DS network, is suboptimal. \begin{figure}[!t] \centering{} \includegraphics[width=\columnwidth]{Fig1.pdf} \vspace{-4mm} \caption{Ratio between the file download delay without D2D communication and that of the scenario using MDS-coded distributed caching. $t_\mathrm{bs}=10 t_\mathrm{d}$. Solid lines show analytical results and markers simulation results.}\label{f:0.1} \vspace{-3mm} \end{figure} \begin{figure}[!t] \centering{} \includegraphics[width=\columnwidth]{Fig2.pdf} \vspace{-4mm} \caption{Ratio between the file download delay without D2D communication and that of the scenario using MDS-coded distributed caching. $t_\mathrm{bs}=100 t_\mathrm{d}$. Solid lines show analytical results and markers simulation results.}\label{f:0.01} \vspace{-3mm} \end{figure} \begin{figure}[!t] \centering{} \includegraphics[width=\columnwidth]{Fig3.pdf} \vspace{-4mm} \caption{Ratio between the file download delay without D2D communication and that of the scenario using MDS-coded distributed caching. $t_\mathrm{bs}=1000 t_\mathrm{d}$. Solid lines show analytical results and markers simulation results.}\label{f:0.001} \vspace{-5mm} \end{figure} \begin{figure} \centering{} \includegraphics[width=\columnwidth]{Fig4.pdf} \vspace{-4mm} \caption{Ratio between the file download delay without D2D communication and that of the scenario using MDS-coded distributed caching for $F<Z$. $t_\mathrm{bs}=100 t_\mathrm{d}$ and $\Delta=0.5$.}\label{f:sigma} \vspace{-5mm} \end{figure} \section{Conclusions} \label{sec:Conclusions} In this paper, we considered the cache of popular content in the mobile devices of a cellular network using maximum distance separable erasure correcting codes to speed-up content delivery. We derived analytical expressions for the average download delay and showed that MDS-coded distributed caching may dramatically reduce the download delay with respect to the traditional case where content is always downloaded from the base station. \appendices \section{Proof of Lemma 1} \label{app:ProofLem1} We denote by $X_1^{(\ell)}$ the number of storage nodes available for download at the time of the $\ell$th download request, i.e., the number of storage nodes of the DS list that have not left the cluster at the time of the request. We compute $\Pr\{X_1=x\}$ by averaging over an infinite number of requests, \begin{equation}\label{e:x1} \Pr\{X_1=x \}=\lim_{L \to \infty} \frac{1}{L} \sum_{\ell=1}^L \Pr\{X_1^{(\ell)}=x \}\, . \end{equation} Similarly, let $Y^{(\ell)}$ be the number of storage nodes at the beginning of the update interval wherein the $\ell$th request arrives, denoted by $\Delta^{(\ell)}$. We have \begin{equation}\label{e:x1l} \Pr\{X_1^{(\ell)}=x\}=\sum_{y=0}^\infty \Pr\{X_1^{(\ell)}=x | Y^{(\ell)}=y\} \Pr\{Y^{(\ell)}=y\}\,. \end{equation} In~\cite{Ped16}, it was shown that the probability $\Pr\{X_1^{(\ell)}=x | Y^{(\ell)}=y\} $ does not depend on $\ell$ (when $\ell$ grows large), and is given by~(\ref{e:px_J}). Its derivation is based on the observation that the number of storage nodes available for download in the update interval is described by a Poisson death process. The probability $ \Pr\{Y^{(\ell)}=y\}$ can be written as \begin{equation}\label{e:y} \Pr\{Y^{(\ell)}=y\}= \Pr\{ \tilde{Y}^{(\ell)} =y | \text{req. in }\Delta^{(\ell)} \}=\frac{ \Pr\{ \text{req. in }\Delta^{(\ell)} | \tilde{Y}^{(\ell)} =y \}\Pr\{ \tilde{Y}^{(\ell)} =y \} } { \Pr\{ \text{req. in }\Delta^{(\ell)} \} }\, , \end{equation} where in the second equality we used Bayes' rule. In~(\ref{e:y}), $\tilde{Y}^{(\ell)}$ is the number of storage nodes at the beginning of the update interval, which is described by a birth-death Poisson process, thus $\Pr\{ \tilde{Y}^{(\ell)} =y \} =\pi_y(n_\mathrm{c})$. The probability $\Pr\{ \text{req. in }\Delta^{(\ell)} \}$ is the probability that there is at least one request in $\Delta^{(\ell)}$. It depends on the inter-request time, which in turn depends on the number of nodes in the cluster. Therefore, we compute \begin{equation}\nonumber \Pr\{ \text{req. in }\Delta^{(\ell)} \}= \sum_{m=1}^\infty (1-e^{-m\omega \Delta}) \pi_m(M_\mathrm{c}) \, , \end{equation} where $1-e^{-m\omega \Delta}$ is the probability that the inter-request time is shorter than $\Delta$ when $m$ nodes are present in the cluster. Similarly, we compute $\Pr\{ \text{req. in }\Delta^{(\ell)} | \tilde{Y}^{(\ell)} =y \}$ as \begin{equation}\nonumber \Pr\{ \text{req. in }\Delta^{(\ell)} | \tilde{Y}^{(\ell)} =y \} =\sum_{m=y}^\infty (1-e^{-m\omega \Delta}) \pi_{m-y}(M_\mathrm{c}-n_\mathrm{c})\,, \end{equation} where $\pi_{m-y}(M_\mathrm{c}-n_\mathrm{c})$ is the probability that there are $m$ nodes in the cluster, given that there are $y$ storage nodes. Since these probabilities are independent of the specific request, we conclude that $ \Pr\{Y^{(\ell)}=y\}$ is also independent of $\ell$. Substituting (\ref{e:y}) into (\ref{e:x1l}), we observe that $\Pr\{X_1^{(\ell)}=x\}$ is also independent of $\ell$ and using~(\ref{e:x1}) we prove the lemma. \section{Proof of Lemma 4} \label{app:ProofLem4} We compute the conditional probability that no symbols are downloaded by averaging over an infinite number of requests, \begin{equation}\nonumber \Pr\{ S_1=0|R=i\} =\lim_{L \to \infty} \frac{1}{L} \sum_{\ell=1}^L \Pr\{ S_1^{(\ell)}=0 |R^{(\ell)}=i\}\, , \end{equation} where $S_1^{(\ell)}\in\{0,1\}$ is the RV describing the download of the first symbol for the $\ell$th request. We now consider the computation of $\Pr\{ S_1^{(\ell)}=0|R^{(\ell)}=i\}$. The recovery of the first symbol fails with probability $1$ if the requesting node leaves the cell before completing the download. It also fails if the requesting node stays in the cluster but no storage nodes are available or if it chooses to download from a storage node which departs before $t_\mathrm{d}$ t.u. from the start of the download. Let $O^{(\ell)}$ be the departure time of the node which places the $\ell$th request and let $\mathcal{A}_1^{(\ell)}=\{ O^{(\ell)} - W^{(\ell)} > t_\mathrm{d}\}$ be the event that the node which places the $\ell$th request stays in the network for more than $ t_\mathrm{d} $ t.u. from the start of the download. The corresponding probability does not depend on $\ell$ and is easily computed as $\Pr\{ \mathcal{A}_1^{(\ell)}\} =e^{-\mu t_\mathrm{d}}$. Similarly, the probability that the requesting node departs before $t_\mathrm{d}$ t.u. from the start of the download is $(1- e^{-\mu t_\mathrm{d}} )$. Therefore, the conditional probability that the $\ell$th request fails the first symbol download is \begin{equation}\label{e:s1l} \Pr\{ S_1^{(\ell)}=0|R^{(\ell)}=i\}=(1- e^{-\mu t_\mathrm{d}} )+ e^{-\mu t_\mathrm{d}} \Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, R^{(\ell)}=i\}\, . \end{equation} Let $G^{(\ell)}_1\in\{0,\dots,\infty \}$ be the number of storage nodes useful for download for the $\ell$th request, i.e., the number of storage nodes in the DS list that have not left the cluster at the time of the $\ell$th request, excluding the requesting node itself if it belongs to the DS list. Let $D^{(\ell)}_1\in\{0,\dots,\infty\}$ the number of departures in $t_\mathrm{d}$ t.u. among the $G^{(\ell)}_1$ storage nodes. The probability $ \Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, R^{(\ell)}=i\} $ can be written as \begin{align} &\Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, R^{(\ell)}=i\} =\nonumber\\ &=\sum_g\sum_d \Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, R^{(\ell)}=i, G_1^{(\ell)}=g, D_1^{(\ell)}=d \} \Pr\{ G_1^{(\ell)}=g, D_1^{(\ell)}=d| \mathcal{A}_1^{(\ell)}, R^{(\ell)}=i \}\nonumber \\ &= \sum_g\sum_d \Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, G_1^{(\ell)}=g, D_1^{(\ell)}=d \} \Pr\{ G_1^{(\ell)}=g, D_1^{(\ell)}=d | R^{(\ell)}=i \}\, . \label{e:s1cond} \end{align} Equation~(\ref{e:s1cond}) is obtained by observing that $i)$ the probability that the download of the first symbol fails conditioned to $G_1^{(\ell)}$ and $D_1^{(\ell)}$ is independent of the type of request, and that $ii)$ the number of useful storage nodes and the number of departures in $t_\mathrm{d}$ t.u. among them is independent of the departure of the requesting node. The probability $\Pr\{ S_1^{(\ell)}=0 | \mathcal{A}_1^{(\ell)}, G_1^{(\ell)}=g, D_1^{(\ell)}=d \}$ is equal to 1 if there are no useful storage nodes, i.e., $g=0$. Otherwise, it equals the probability to choose one of the $d$ storage nodes that leave the cell in $t_\mathrm{d}$ t.u., i.e., $d/g$, with $d\leq g$. We observe that the number of departures of useful storage nodes conditioned to their number is independent of the type of request and that the number of storage nodes useful for download $G_1^{(\ell)}$ is related to $X^{(\ell)}_1$ by \begin{equation}\nonumber \Pr\{G_1^{(\ell)}=g|R^{(\ell)}=i\}=\Pr\{ X_1^{(\ell)}=g+i |R^{(\ell)}=i\}\, , \end{equation} since when the request originates from a storage node of the DS list, the requesting node itself is not counted among the useful storage nodes. Therefore, the probability $\Pr\{ G_1^{(\ell)}=g, D_1^{(\ell)}=d | R^{(\ell)}=i \}$ can be written as \begin{equation} \Pr\{ G_1^{(\ell)}=g, D_1^{(\ell)}=d | R^{(\ell)}=i \}= \Pr\{ D_1^{(\ell)}=d|G_1^{(\ell)}=g\} \Pr\{X_1^{(\ell)}=g+i|R^{(\ell)}=i \}\, . \end{equation} We denote by $\theta(d,g)$ the probability $\Pr\{ D_1^{(\ell)}=d|G_1^{(\ell)}=g\}$, given in~(\ref{e:theta}). Its derivation is similar to that of $\Pr\{X_1 | Y \}$~\cite{Ped16}. The probability $\Pr\{X_1^{(\ell)}=g+i|R^{(\ell)}=i \}$ is independent of the specific request and is given by~(\ref{e:px1cond}). After simple manipulations, we finally obtain \begin{equation}\label{e:PS1} \Pr\{ S_1^{(\ell)}=0|R^{(\ell)}=i\}= 1 + e^{-\mu t_\mathrm{d}} \Big( \Pr\{X_1=i|R=i\} + \sum_{g =1}^\infty \sum_{d =0 }^{g} \frac{d}{g} \Pr\{X_1=g+i|R=i\} \theta(d,g) - 1\Big). \end{equation} Since the probabilities involved in~(\ref{e:PS1}) are all independent of $\ell$, the lemma is proved. \section{Proof of Lemma 5} \label{app:ProofLem5} To evaluate the probability of complete download from the DS network, we start with the following limit, \begin{equation}\nonumber \Pr\{ \mathbf{S}_{[k-i]} =\mathbf{1}_{k-i}| R=i \}= \lim_{L \to \infty} \frac{1}{L} \sum_{\ell=1}^L \Pr\{ \mathbf{S}_{[k-i]}^{(\ell)}=\mathbf{1}_{k-i}|R^{(\ell)}=i \}\, , \end{equation} where $\mathbf{S}_{[j]}^{(\ell)}=( S_1^{(\ell)}, \dots, S_j^{(\ell)})$ and $S_i^{(\ell)}$ describes the successful symbol download at the $i$th attempt of the $\ell$th request. We consider the $\ell$th request and, similarly to the proof of Lemma~\ref{l:S1}, we will find that this probability is independent of $\ell$. We denote by the RV $G_j^{(\ell)}\in\{0,\ldots,\infty\}$ the number of storage nodes useful for download at the time of the $j$th attempt of the $\ell$th request, i.e., the storage nodes of the DS list not yet contacted, excluding the requesting node if it belongs to the DS list. We denote by the RV $D_j^{(\ell)} \in \{0,\ldots,\infty\}$ the number of departures in $t_\mathrm{d}$ t.u. among the $G_j^{(\ell)}$ nodes. We also denote by $\mathcal{A}_j^{(\ell)}=\{ O^{(\ell)} - W^{(\ell)} > j t_\mathrm{d}\}$ the event that the node which places the $\ell$th request stays in the network for more than $ j t_\mathrm{d} $ t.u. from the start of the download. The corresponding probability does not depend on $\ell$ and is given by $\Pr\{ \mathcal{A}_j^{(\ell)}\} =e^{-j\mu t_\mathrm{d}}$. The probability of complete download is zero if the requesting node departs before $ (k-i)t_\mathrm{d} $ t.u. from the start of the download, therefore we can write \begin{equation} \Pr\{ \mathbf{S}_{[k-i]}^{(\ell)}=\mathbf{1}_{k-i}|R^{(\ell)}=i \}=e^{-(k-i)\mu t_\mathrm{d}} \Pr\{ \mathbf{S}_{[k-i]}^{(\ell)}=\mathbf{1}_{k-i}|\mathcal{A}_{k-i}^{(\ell)}, R^{(\ell)}=i \}\,. \end{equation} The probability $\Pr\{ \mathbf{S}_{[k-i]}^{(\ell)}=\mathbf{1}_{k-i}|\mathcal{A}_{k-i}^{(\ell)}, R^{(\ell)}=i \}$ can be written as \begin{align} &\Pr\{ \mathbf{S}_{[k-i]}^{(\ell)}=\mathbf{1}_{k-i}|\mathcal{A}_{k-i}^{(\ell)}, R^{(\ell)}=i \}=\nonumber\\ &=\sum_{g} \sum_{d} \Pr\{S^{(\ell)}_{k-i}=1| \mathcal{A}_{k-i}^{(\ell)}, G_{k-i}^{(\ell)}=g, D_{k-i}^{(\ell)}=d \} \Pr\{ G_{k-i}^{(\ell)}=g, D_{k-i}^{(\ell)}=d,\mathbf{S}_{[k-i-1]}^{(\ell)}=\mathbf{1}_{k-i-1} | \mathcal{A}_{k-i}^{(\ell)}, R^{(\ell)}=i \}\nonumber \\ &=\sum_{g=1}^\infty \sum_{d=0}^{g} \frac{g-d}{g} \gamma^{(\ell)}_{k-i}(g,d,i)\, . \label{e:gamma1} \end{align} The last equality is obtained by observing that the probability $\Pr\{ S_{k-i}^{(\ell)}=1 | \mathcal{A}_{k-i}^{(\ell)}, G_{k-i}^{(\ell)}=g, D_{k-i}^{(\ell)}=d\}$ for $g>0$ and $d<g$ equals the probability to choose one of the storage nodes of the DS list that remains in the cluster, i.e., $\frac{g-d}{g}$. Moreover, we have defined $\gamma^{(\ell)}_j(g,d,i)\triangleq\Pr\{ G_{j}^{(\ell)}=g, D_{j}^{(\ell)}=d, \mathbf{S}_{[j-1]}^{(\ell)}=\mathbf{1}_{j-1} | \mathcal{A}_{j}^{(\ell)}, R^{(\ell)}=i \}$, that can be computed as \begin{align} &\gamma^{(\ell)}_j(g,d,i)=\Pr\{D_{j}^{(\ell)}=d| G_{j}^{(\ell)}=g\} \sum_{g'} \sum_{d'} \Pr\{G_{j}^{(\ell)}=g|G_{j-1}^{(\ell)}=g', D_{j-1}^{(\ell)}=d', S_{j-1}^{(\ell)}=1 \} \nonumber \\ &\quad\cdot \Pr\{S^{(\ell)}_{j-1}=1| \mathcal{A}_{j}^{(\ell)}, G_{j-1}^{(\ell)}=g', D_{j-1}^{(\ell)}=d' \} \Pr\{ G_{j-1}^{(\ell)}=g', D_{j-1}^{(\ell)}=d', \mathbf{S}_{[j-2]}^{(\ell)}=\mathbf{1}_{j-2} | \mathcal{A}_{j-1}^{(\ell)}, R^{(\ell)}=i \}\, ,\nonumber \end{align} for $j>1$. We also define $ E(g,g',d')\triangleq \Pr\{G_{j}^{(\ell)}=g|G_{j-1}^{(\ell)}=g', D_{j-1}^{(\ell)}=d', S_{j-1}^{(\ell)}=1\}$, which is equal to one if $g=g'-d'-1$ and $g'>d'$, and zero otherwise. The condition $g=g'-d'-1$ follows from the fact that the number of useful storage nodes after a successful symbol download is equal to the number of useful storage nodes still alive, \mbox{$g'-d'$}, minus the storage node just used. The condition $g'>d'$ comes from the fact that the $(j-1)$th symbol download is assumed to be successful, i.e., $S_{j-1}^{(\ell)}=1$. It is easy to prove by induction that the probability in~(\ref{e:gamma1}) does not depend on $\ell$. By defining $\gamma_j(g,d,i)\triangleq \gamma^{(\ell)}_j(g,d,i)$, we obtain the recursion~(\ref{e:gamma}), with initial condition~(\ref{e:gammaIC}). The probabilities $\gamma_j(g,d,i)$, $j\geq 1$, are equal to zero for $d>g$. \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:01:36', 'yymm': '1701', 'arxiv_id': '1701.01491', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01491'}
arxiv
\section*{Introduction} Networks are widely used in ecology as they provide a powerful tool for modelling the complex interplay between ecological entities. Depending on the context, those entities can be different species or different individuals while their interplay may be as diverse as trophic, competitive, cooperative relations or even contacts measured through physical proximity. Studying these networks can help answering important ecological questions about for e.g. the structure of these interactions and their robustness to external factors. As~\citeauthor{Newman_Leicht_07} pointed out some 10 years ago \emph{``much of the current research on networks [...] aimed at answering the question: how can we tell what a network looks like, when we can't actually look at it?}''. One first answer has been to develop and use descriptive statistics and network measures such as connectance or centrality~\citep[see][for a comprehensive list]{Rayfield_11}. This approach considers any ecological network as a whole, assuming that the network is homogeneous. A next proposal has been to go beyond descriptive statistics and consider network clustering, i.e. grouping entities according to their common properties. This technique allows answering fundamental questions about any underlying network structure: is there any peculiar non-random mixing of entities that would be a sign for a structural organisation \citep{kef16}? is there, for instance, compartmentalisation~\citep{Montoya2015}, hierarchical organisation~\citep{cla08} or nestedness~\citep{bas03}? Nowadays, recent technological advances (sensors, GPS technology, $\dots$) and long-term data studies have given rise to an avalanche of temporal data that need to be appropriately modelled. Data acquired over time can be aggregated within relevant time intervals (days, seasons, years, $\dots$) and consequently produce snapshots of a same ecological network at different time steps. With these new data, one can potentially address new ecological questions which might not be tackled through the analysis of the static network where data is aggregated over the full recording time. In the same way, snapshots of an ecological network along any one-dimensional factor (such as temperature, altitude, depth, humidity, $\dots$) may help analyse the evolution of the network structure along this gradient~\citep{Stegen}. However addressing those new questions requires the development of new methodological tools. Up to now, very few proposals have been made to handle what we call here ``dynamic networks'', namely any sequence of snapshots of a same ecological network along a one-dimensional parameter (that we most often call time). The two fundamental questions we will focus on here are the following: are there any relevant statistical patterns in the dynamic network? If so, how does this structure vary with time (or along the sequence)? In this article, we answer these two key points and argue that this is a first stone for further understanding and predicting processes on dynamic ecological networks such as event spreading (infection or extinction, for instance). \\ We thus propose a statistical modelling approach to address the lack of tools to analyse dynamic ecological networks~\citep{dynsbm}. Our approach mainly consists in extending one of the techniques dedicated to find structural patterns in static networks, now focusing on their dynamics. We thus first present our methodological proposal, stating the key concepts and introducing the vocabulary required for handling dynamic networks. It is important to stress that our model is suitable for integrating arrivals and departures of entities (corresponding either to species invasion/extinction or birth/arrival/death/departure of individuals) through the possible presence or absence of nodes at the different time steps. Moreover, it can also deal with quantitative edges (and is not restricted to binary interactions) which are often available in datasets. We first illustrate our approach through the analysis of the dynamic contact network in a colony of ants~\citep{mer13}. Contact networks represent a relevant proxy to study animal sociality~\citep{wey08}. In the literature, these networks may be built from field observations of association between animals~\citep[e.g. giraffes in][]{car13}, trapping data~\citep[e.g. field voles in][]{dav15} and more recently and predominantly from sensors-based measurements~\citep[e.g. song birds in][]{far15}. These data are now available for large time periods, ranging from days to years of observations for instance. It is therefore possible to investigate the (in-)stability of the social structure~\citep{pin13} and potentially question the impact of other time-related factors (seasonal changes, response to stresses such as draught, arrival/departure of a peculiar individual, $\dots$). We lastly present the study of a seasonal trophic network~\citep[or {\it food web};][]{woo05}. The structure of trophic relations has been intensively studied in the network framework~\cite[see][for a review on food webs]{tho12}. Nowadays, following the seminal work of \cite{Baird}, new datasets allow for monitoring the variation of this structure along temporal gradients (seasons or years), spatial gradients~\citep[latitudinal or longitudinal for instance;][]{kor15} or qualitative gradients~\citep[increasing habitat modification;][]{tyl07}. We will restrict here to dynamic trophic networks corresponding to different temporal snapshots of a food web. In this context, studying such structural variation (or on the contrary, structural stability) can be appropriate to analyse the system's response to major changes (species extinctions, environmental perturbations, climate change, etc). An underlying issue is whether there is resilience of this structural organisation, or rather cyclic dynamics with a return to an equilibrium state. \section*{Materials and methods} \subsection*{From static to dynamic networks} An ecological network is composed of nodes that correspond to any ecological entities -- e.g. species, individuals or communities; while edges (or links) characterise presence/absence of an interaction between any two entities and may be valued in some cases. For instance, values may be the frequencies of contacts between two individuals~\citep{sil11} or the number of field observations of interactions between two species. When this network is unique and covers an entire time period, it is called a {\it static} network. While many empirical data were aggregated over a whole period of observation recording, it is important to realise that such aggregation could lead to an incorrect understanding of the network structure due to the smoothing aggregation process (cf. Figure~\ref{fig:aggregated}). An approach to study the temporal dynamics of a set of interactions is the {\it discrete time snapshots} approach \citep[see][for a complete perspective]{Blonder_12}. It consists in aggregating data over specific time frames (days, months, seasons, years or any relevant frame regarding the ecological system of interest) and to obtain what \citeauthor{Blonder_12} call {\it time-aggregated dynamic networks}. In the following, we use the term {\it dynamic networks} and while we refer to time as being the parameter that drives the evolution, we recall that this could be any other relevant one-dimensional factor. \begin{figure} \begin{minipage}{0.32\linewidth} \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \node[state] at (1.5,3){$t=1$}; \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=lightgray,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B3) edge [bend left] (B4); \foreach \from/\to in {1/2,2/3,4/5,5/1}{ \path (B\from) edge [bend left] (B\to); } \end{tikzpicture} \end{minipage} \begin{minipage}{0.32\linewidth} \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \node[state] at (1.5,3){$t=2$}; \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=lightgray,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B2) edge (B5) (B1) edge (B4); \end{tikzpicture} \end{minipage} \begin{minipage}{0.32\linewidth} \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \node[state] at (1.5,3){aggregated}; \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=lightgray,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B2) edge (B5) (B1) edge (B4); \path (B3) edge [bend left] (B4); \foreach \from/\to in {1/2,2/3,4/5,5/1}{ \path (B\from) edge [bend left] (B\to); } \end{tikzpicture} \end{minipage} \caption{Same data a) modelled by a two time steps dynamic network (left and centre) or b) aggregated over the whole time period into a static network (on the right). The structure in the static case does not reflect the complexity of the network structure which clearly varies with time. Indeed, edges present at $t=1$ and $t=2$ are disjoint.} \label{fig:aggregated} \end{figure} Formally, we assume $T$ time steps, a number $N_t$ of nodes at each time step $t$, a total number of nodes $N$ (with $N \ll N_1+\dots+N_t$) and edges record the presence (possibly valued) or absence of an interaction between any two pair of nodes at each time step. Note that our set-up is different from the one corresponding to the observation of the full interaction flow, namely when data consists in the complete knowledge of edges appearance and disappearance along a continuous gradient. Indeed in our case data is still aggregated over some time intervals or corresponds to a sequence of networks which are specific to a set of discrete values of a one-dimensional factor. When considering continuous time interaction flow data, the object of interest (the flow) is called a {\it temporal network} \citep{Holme_review} and this setup will not be explored in this article. Lastly, it is important to mention that the time frame selection may be an issue in cases where choosing the resolution for the time aggregation is not driven by the ecological question. Indeed, in many cases, the choice of the time frame is expert-based: for instance the dataset from~\cite{rey15} consists in $T=52$ days of observation including the breeding season, but it is possible to restrict to $T=3$ networks (before, during and after the breeding season) to study the network variations due to reproduction period. This choice might not be harmless and for instance \cite{Blonder_12} showed that the degree distribution in networks can be sensitive to the time frame selection~\citep[see also][for a statistical perspective]{Rajmonda}. It is out of the scope of the present work to explore this frame selection problem. \subsection*{Stochastic block models (SBM)} In the field of network analysis, one of the most exciting research problems of the last decade has been the network clustering question. Moving beyond descriptive statistics, the goal here is to propose algorithms to extract a high-level view of complex networks, i.e. zooming out the network. Network clustering consists in grouping nodes based on their common characteristics. It often rhymes with finding {\it modules} or {\it communities} \citep[or {\it compartments}; see][]{sto11}. A module is a set of nodes with much more edges between these nodes than with the others. An important drawback of module-based approaches appears when, quoting~\citeauthor{Newman_Leicht_07}, we ask: ``\emph{could there be interesting and relevant structural features of networks that we have failed to find simply because we haven't thought to measure the right thing?}''. In other words, is it relevant to search for modular structure in a network that can be structured in any other ways? Following this objection, methods based on statistical inference arose which rely on the principle of grouping nodes that have similar interaction patterns (e.g. hubs, modules, peripheral nodes; see Figure~\ref{fig:modular}) without any {\it a priori} knowledge. This is the purpose of a general class of models called {\it stochastic block models} (SBM). \begin{figure}[h!] \begin{minipage}{0.5\linewidth} a) \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \tikzstyle{every node}=[fill=white] \node[fill=green,state] (A1) at (1,1) {\textbf{1}}; \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=yellow,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B2) edge (B5) (B1) edge (B4); \path (B3) edge [bend left] (B4); \foreach \from/\to in {1/2,2/3,4/5,5/1}{ \path (B\from) edge [bend left] (B\to); } \tikzstyle{every node}=[fill=green] \node[state] (C1) at (0,0) {\textbf{7}}; \node[state] (C2) at (1,-0.5) {\textbf{8}}; \node[state] (C4) at (-0.5,0.5) {\textbf{10}}; \node[state] (C5) at (-0.5,1.5) {\textbf{11}}; \node[state] (C6) at (0,2) {\textbf{12}}; \path (C1) edge [bend right] (C2) (C4) edge [bend right] (C6) (C4) edge (C1) (C4) edge [bend left] (C5) (C1) edge [bend left] (C6) (C2) edge (C6) (C2) edge (C5) (C5) edge (C6); \path (C1) edge (A1) (C2) edge [bend right] (A1) (C6) edge [bend left] (A1); \path (A1) edge [bend right] (B2); \end{tikzpicture} \end{minipage} \begin{minipage}{0.5\linewidth} b) \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \tikzstyle{every node}=[fill=white] \node[fill=red,state] (A1) at (1,1) {\textbf{1}}; \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=yellow,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B2) edge (B5) (B1) edge (B4); \path (B3) edge [bend left] (B4); \foreach \from/\to in {1/2,2/3,4/5,5/1}{ \path (B\from) edge [bend left] (B\to); } \tikzstyle{every node}=[fill=green] \node[state] (C1) at (0,0) {\textbf{7}}; \node[state] (C2) at (1,-0.5) {\textbf{8}}; \node[state] (C4) at (-0.5,0.5) {\textbf{10}}; \node[state] (C5) at (-0.5,1.5) {\textbf{11}}; \node[state] (C6) at (0,2) {\textbf{12}}; \path (C1) edge (A1) (C2) edge (A1) (C4) edge (A1) (C5) edge (A1) (C6) edge [bend left] (A1); \path (A1) edge [bend right] (B2) (A1) edge [bend left] (B3) (A1) edge [bend right] (B1); \end{tikzpicture} \end{minipage} \caption{a) Network with a clear modular structure with two modules (green and yellow) b) Network with a complex structure including different patterns: a module (yellow), a hub (red) and a set of peripheral nodes (green). Both networks can be modelled by a SBM with different parameters that capture the structural organisation, with two and three groups respectively. Besides, it is not clear what would be the results of a modular detection algorithm on the second network (as it is not modular).} \label{fig:modular} \end{figure} SBM have been developed for analysing complex networks \citep{NS01,Newman_Leicht_07,Daudin_etal08,gui09,Matias_Robin_review} and more recently used to decipher the structure of ecological networks such as hosts-parasites~\citep{Mariadassou_etal}, food webs~\citep{Picard_etal09,bas11} and multi-interactions network~\citep{kef16}. Let $\{Y_{ij}\}_{1\leq i,j\leq N}$ be the set of edges between any possible couple of nodes $(i,j)$. The model may be defined either for directed or undirected networks and may allow the presence of self-interactions (edges $Y_{ii}$). The principle of SBM is the following: we assume that the ecological entities (nodes) can be gathered into $Q$ groups based on their common interaction properties. Therefore the distribution of $Y_{ij}$ is specified conditionally on the group memberships such that $$ Y_{ij} \sim f(\Theta_{ql}) \ | \ i \in \textrm{group } q, \, j \in \textrm{group } l $$ where $f$ is any probability distribution parametrised by $\Theta$ (called interaction parameter). The group memberships are unknown, as well as the interaction parameters. An EM-like algorithm \citep[Expectation-Maximisation, see][]{DLR} allows for jointly estimating memberships and parameters~\citep{Daudin_etal08}. The statistical procedure finally displays a high-level view of the network: what kind of interaction patterns are present (through the interaction parameters $\Theta_{ql}$) and which nodes participate in those patterns (through the group memberships). A key advantage of SBM is the possibility to plug any probability distribution $f$ in order to fit any kind of interactions. For instance, one can use a Bernoulli distribution for binary interactions~\citep{NS01}, a Gaussian for frequencies or a Poisson for a number of interactions~\citep[weighted interactions;][]{Mariadassou_etal}, a multinomial for finitely many values or even a multivariate distribution for multivariate edges. One can also use the combination of any of those distributions with a Dirac mass at 0 so as to obtain a 0-inflated distribution that accounts for sparsity in the network~\citep[in the valued case, not all interactions necessarily exist;][]{Ambroise_Matias}. Relying on a probabilistic framework allows for modelling some randomness and variability in the observations and consequently provides robustness to possible errors or missing data. \subsection*{Dynamic stochastic block models (dynSBM)} How can we analyse dynamic ecological networks to extract structural information? At the time of writing, only a few alternatives based on descriptive statistics \citep{Holme_review} or on evolving modules \citep{muc10} have been considered. Following the above mentioned objections, we claim that a model-based clustering approach could be relevant and we recently proposed to extend the SBM approach to dynamic networks introducing {\it dynamic stochastic block models}~\citep[dynSBM,][]{dynsbm}. To develop such an extension, an important question to ask is what could be the meaning of zooming out an object that can change with time? Our answer is to capture the dynamics of a high-level view of the network. This means tracking the evolution of the group behaviours (i.e. the interaction parameters) as well as the nodes group memberships with time. Technically, we rely on a collection of SBM for modelling the different snapshots at each time step combined with $N$ (the number of nodes) independent and identically distributed Markov chains that capture the evolution of a node group through time. Thus at any time step $t$, our estimate of the group of a node $i$ depends on the SBM estimated for the network at time $t$ and on the group of this node at time step $t-1$. The model is now characterised through \begin{align*} &Y_{ij}^t \sim f(\Theta_{ql}^t) \ | i \in \textrm{group } q , \, j \in \textrm{group } l \textrm{ at time } t \\ &\mathbb{P}(i \in \textrm{group } q \textrm{ at time } t \ | \ i \in \textrm{group } q' \textrm{ at time } t-1) = \Pi_{qq'} \end{align*} where $\Pi$ is the (common) transition matrix of the $N$ different group memberships Markov chains. Reconstructing the different SBM and the common Markov chain parameters has to be done jointly. As demonstrated in \cite{dynsbm}, without adding some constraints this model is not identifiable because of a possible label switching phenomenon between the time steps (which is not the usual label switching encountered in any model with latent groups). To illustrate this phenomenon on a toy example, let us consider a dynamic network where the same static network is observed at two different time steps. We assume that this network is a {\it star} (one central node - called the hub - is connected to all others - called peripheral nodes). A SBM is fitted with 2 groups. Supposing group 1 is the hub and group 2 is composed of the peripheral nodes at $t=1$, two alternative scenarios are possible at $t=2$: either group 1 is still the hub and group 2 is still composed of the peripheral nodes, or the reverse (group 1 is the peripheral nodes and group 2 the hub). Both scenarios are equivalent clusterings when considered at each time step separately (because clusters are defined up to a permutation of their labels only), but globally (meaning when considering the 2 time steps jointly) these clusterings are different and may be fitted by dynSBM with different parameter values that induce different interpretations. Indeed, in the first scenario there are no group-switches while in the second all the nodes undergo a group change. Therefore, we need to add constraints to the dynSBM parameters to remove this ambiguity. In~\cite{Yang_etal_ML11}, the authors proposed to constrain the group memberships to be constant with time (see alternative 1 in Figure~\ref{fig:switching}). But this is clearly not suited to ecological networks where entities can evolve and move from one role to another; e.g. fission-fusion societies~\citep{rub15}, modification of animal behaviour between breeding and non-breeding seasons~\citep{rey15}, response to climate change~\citep{kor15}. We consequently choose to allow the group memberships to vary freely with time but constrain some of the interaction parameters to be stable in time (see alternative 2 in Figure~\ref{fig:switching}). To be more specific, we assume that the intra-group interactions are constant (namely $\Theta_{qq}^t$ does not depend on $t$, for any group $q$). However the interaction parameters between different groups may vary with time (namely $\Theta_{ql}^t$ depends on $t$, for any pair of groups $(q,l)$ with $q\neq l$). This restriction is sufficient to characterise the groups and solve the identifiability issue~\citep{dynsbm}. Note that this will also be helpful to interpret dynSBM results as the groups are now unambiguously defined and meaningful: each group has its specific connectivity behaviour, with constant intra-group and possibly varying extra-group connectivities. In the meantime, the memberships are free and may change, such that any entity can change its behaviour.\\ \begin{figure}[h!] \begin{minipage}{0.48\linewidth} \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \node[state] at (1.5,3){${t=1}$}; \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \tikzstyle{every node}=[fill=white] \node[fill=red,state] (A1) at (1,1) {\textbf{1}}; \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=yellow,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \tikzstyle{every node}=[] \path (B2) edge (B5) (B1) edge (B4); \path (B3) edge [bend left] (B4); \foreach \from/\to in {1/2,2/3,4/5,5/1}{ \path (B\from) edge [bend left] (B\to); } \tikzstyle{every node}=[fill=green] \node[state] (C1) at (0,0) {\textbf{7}}; \node[state] (C2) at (1,-0.5) {\textbf{8}}; \node[state] (C4) at (-0.5,0.5) {\textbf{10}}; \node[state] (C5) at (-0.5,1.5) {\textbf{11}}; \node[state] (C6) at (0,2) {\textbf{12}}; \path (C1) edge (A1) (C2) edge (A1) (C4) edge (A1) (C5) edge (A1) (C6) edge [bend left] (A1); \path (A1) edge [bend right] (B2) (A1) edge [bend left] (B3) (A1) edge [bend right] (B1); \end{tikzpicture} \end{minipage} \begin{minipage}{0.48\linewidth} \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \node[state] at (1.5,3){$t=2$}; \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \tikzstyle{every node}=[fill=white] \node[fill=red,state] (A1) at (1,1) {\textbf{1}}; \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=yellow,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \path (A1) edge [bend left] (B3) (A1) edge (B2) (A1) edge (B4) (A1) edge [bend right] (B5) (A1) edge [bend right] (B1); \tikzstyle{every node}=[fill=green] \node[state] (C1) at (0,0) {\textbf{7}}; \node[state] (C2) at (1,-0.5) {\textbf{8}}; \node[state] (C4) at (-0.5,0.5) {\textbf{10}}; \node[state] (C5) at (-0.5,1.5) {\textbf{11}}; \node[state] (C6) at (0,2) {\textbf{12}}; \path (C1) edge [bend right] (C2) (C4) edge [bend right] (C6) (C4) edge (C1) (C4) edge [bend left] (C5) (C1) edge [bend left] (C6) (C2) edge (C6) (C2) edge (C5) (C5) edge (C6); \path (C1) edge (A1) (C2) edge [bend right] (A1) (C6) edge [bend left] (A1); \end{tikzpicture} \\scenario 1 (not dynSBM)\\ \begin{tikzpicture} \tikzstyle{every node}=[fill=white] \tikzstyle{every state}=[text=black,scale=0.7,draw=none] \tikzstyle{every edge}=[-,>=stealth',shorten >=1pt,auto,thin,draw] \tikzstyle{every state}=[text=black,scale=0.35,transform shape] \tikzstyle{every node}=[fill=white] \node[fill=red,state] (A1) at (1,1) {\textbf{1}}; \foreach \name/\angle/\text in {B1/234/\textbf{2}, B2/162/\textbf{3}, B3/90/\textbf{4}, B4/18/\textbf{5}, B5/-54/\textbf{6}} { \node[fill=green,state,xshift=9cm,yshift=3.5cm] (\name) at (\angle:1cm) {\text}; } \path (A1) edge [bend left] (B3) (A1) edge (B2) (A1) edge (B4) (A1) edge [bend right] (B5) (A1) edge [bend right] (B1); \tikzstyle{every node}=[fill=yellow] \node[state] (C1) at (0,0) {\textbf{7}}; \node[state] (C2) at (1,-0.5) {\textbf{8}}; \node[state] (C4) at (-0.5,0.5) {\textbf{10}}; \node[state] (C5) at (-0.5,1.5) {\textbf{11}}; \node[state] (C6) at (0,2) {\textbf{12}}; \path (C1) edge [bend right] (C2) (C4) edge [bend right] (C6) (C4) edge (C1) (C4) edge [bend left] (C5) (C1) edge [bend left] (C6) (C2) edge (C6) (C2) edge (C5) (C5) edge (C6); \path (C1) edge (A1) (C2) edge [bend right] (A1) (C6) edge [bend left] (A1); \end{tikzpicture} \\scenario 2 (dynSBM)\\ \end{minipage} \caption{Adding constraints to avoid label switching between time steps. At time $t=2$ there are two equivalent alternative scenarios. In scenario 1 group memberships stay constant in time and interaction parameters change with time; in scenario 2 group memberships change between the two time steps but the intra-group interactions stay constant. In this latter case, the green group is characterised by being a 'peripheral nodes' group, the yellow group is a community and the red group is a hub. } \label{fig:switching} \end{figure} We stress that our approach is different from a naïve one that would separately cluster each network and use an ad-hoc procedure to resolve the label switching problem between two time steps. Indeed, our hidden Markov chain modelling induces dependencies between the networks at different time steps. As a consequence, the clusters recovered for one specific network use information about the others. We also mention that the (maximal) number of groups is fixed with time though some groups might be empty at some time steps. This number may be selected either through a statistical model selection criterion called ICL or relying on heuristic procedures~\citep{dynsbm}. To summarise, the dynSBM approach allows for exploring the following questions: i) Is there any high-level structure in the network, i.e. does dynSBM find more than a single group of nodes? ii) Does this network structure vary with time, i.e. are the nodes group memberships evolving with time? iii) What are the group switches trends and frequencies, i.e. what are the values of the underlying Markov chain parameters? iv) Are there any stable or unstable individuals, i.e. are there peculiar group memberships trajectories? \subsection*{Datasets} \paragraph{Ants interaction networks.} Colonies of the ant {\it Camponotus fellah} were followed with a tracking system that monitored the individual positions over days of observations and dynamic social interactions were deduced from physical proximity~\citep{mer13}. \paragraph{Broadstone Stream seasonal food webs.} This dataset concerns the aquatic macro-invertebrate community of Broadstone Stream in south-east England~\citep{food_web,woo05}. Six seasonal connectance food webs were recorded, one every two months from May 1996 to April 1997. We restricted here to simple presence/absence information on species (nodes) and binary feeding links (edges) and did not consider quantitative data. \section*{Results} In a previous work, we proposed a statistical analysis of two animals contacts networks~\citep[sparrows and onagers respectively, see][]{dynsbm}. Here, we aim at focusing at a more ecological perspective and specifically explore issues raised by dynSBM on two ecological datasets: a dynamic contact network of ants~\citep{mer13} and a seasonal food web~\citep{woo05}. \subsection*{Dynamic animal contact networks} The data corresponds to a colony of $N=152$ {\it Camponotus fellah} ants observed during $T=10$ days. Edges of the resulting dynamic network are weighted by the number of interactions between each pair of ants and the network is thus undirected with no self-interactions. After examination of the weights distribution, we chose to bin those weights into $M=3$ categories corresponding to {\it low, medium} and {\it high} interaction intensity. We consequently fitted a dynSBM with a multinomial distribution $f$ (in fact as many multinomials as the number of group pairs $\{q,l\}$). We selected $Q=3$ groups with the heuristic ``elbow'' method \citep[see][]{dynsbm}. We first focus on the overall structure of the dynamic network by observing the inter/intra-groups interaction properties, as shown in the different cells of Figure~\ref{fig:antsconnec}. Note that the global $Q\times Q$ matrix shown here is symmetric as the network under consideration is undirected. The first key concept here is the {\it sparsity} level, {\it i.e} the amount of edges that are present over all the possible relations (without considering edge values). We clearly see that intra-group interactions are very frequent, in particular in groups 1 and 2 where almost any pairs of ants of these groups are in contact (Figure~\ref{fig:antsconnec}, large blue areas in diagonal plots). This pattern is stable in time (10 days, $x$-axis in Figure~\ref{fig:antsconnec}). The most interesting trend about inter-groups interaction concerns group 3 which contains ants that interact with those of group 1 but much less with those of group 2 (Figure~\ref{fig:antsconnec}, smaller blue areas in cells (2,3) or (3,2) than in cells (1,3) or (3,1)). These properties are the key factor determining the group boundaries ({\it i.e} the memberships) as the other inter-group interactions remain frequent. The next key notion is the {\it intensity} level that focuses on the values of present edges and reflects the point to which ants of two given groups are more likely to be in contact with low to high intensity. Interestingly, when two ants of group 2 are in contact (edge is present), they are likely to be in contact with a high intensity/frequency value (Figure~\ref{fig:antsconnec}, large dark blue area in cell (2,2)). On the contrary, even if some contacts exist between these ants and those of group 3, which is already unusual, these sporadic contacts exhibit low intensity (Figure~\ref{fig:antsconnec}, larger light blue area in cell (2,3) or (3,2)). Here, the remaining intra/inter-group intensity levels do not reveal any other interesting pattern (equal proportion of intensity categories). With all these observations, we deduce that group 2 is a so-called module (highly intra-group connected ants) relatively disconnected from group 3 and that group 1 gathers ants ``at the interface'' {\it i.e.} interacting with partners from any of the three groups. \begin{figure}[h!] \begin{center} \includegraphics[width=7cm]{ants-connectivity} \end{center} \caption{Interaction properties between groups on the ants dataset. Interaction presence and intensity between nodes in any of the $Q=3$ groups to the others are represented in a global $Q\times Q$ matrix; each cell contains $T=10$ time points on the $x$-axis corresponding to the different time steps. Each square represents four areas: the white area is the proportion of absent edges among all possible pairs of interactions; low to dark blue areas correspond to the proportion of edges (among present ones) with low to high intensity value, respectively. Plot obtained with the \texttt{connectivity.plot} function of the \texttt{dynsbm} package. } \label{fig:antsconnec} \end{figure} We now investigate whether there are some interesting trends in the turnover of group membership. In other words, we wonder whether all ants have the same propensity to move from one group to another one. We first observe that the global group turnover (i.e. the amount of group switches) is low: 46\% of ants never switch group. Moreover, there are no group switches between groups 2 and 3 (Figure~\ref{fig:antsalluvial}, no fluxes between these groups over time). This observation, along with the low level of interactions between group 2 and 3 that we discussed before, suggests the existence of a ``barrier'' between these groups that could be a consequence of space positioning. Indeed,~\cite{mer13} showed that ants were distributed over three social groups (obtained by analysing each daily static network and combining those analyses) with different interaction patterns and that there existed some spatial segregation of the groups. We thus propose to compare our groups obtained with dynSBM (which are evolving with time) and the social groups of~\cite{mer13} (which are fixed with time). Focusing on the ants that stay in the same group at least 8 days over 10 ($111$ ants over $N=152$), we note a quasi-perfect match between~\citeauthor{mer13} groups and our groups (see Table~\ref{tab:ants}). The modular group 2 corresponds to the {\it foragers} of~\citeauthor{mer13}, while the other groups 1 and 3 correspond to the {\it cleaners} and {\it nurses} respectively. Besides retrieving this functional group, we provide another relevant information: it is now possible to study ants playing different social roles over time, i.e. those that experience group switches at certain time points. Indeed, our dynSBM groups allow to pinpoint these interesting individuals that modified their behaviour over time and that can be of peculiar interest for specialists of the {\it Camponotus fellah} system. \begin{figure}[h!] \begin{center} \includegraphics[width=16cm]{ants-alluvial} \end{center} \caption{Alluvial plot showing the dynamics of the group memberships on the ants dataset. Between two days ($t=1, \dots,10$ on the $x$-axis), each line is a flux that represents the switch of one or more ants from a group to another group ($q=1, \dots, Q$ represented on the $y$-axis). Here, $Dt-q$ denotes group $q$ from day $t$. The thickness of each line is proportional to the corresponding counts. Plot obtained with the \texttt{alluvial.plot} function of the \texttt{dynsbm} package. } \label{fig:antsalluvial} \end{figure} \begin{table} \caption{Contingency table between~\citeauthor{mer13} functional groups and our dynSBM groups (restricted to 75\% of ants staying at least 8 over 10 days in the same group).} \begin{center} \begin{tabular}{c|ccc} & cleaners & foragers & nurses\\ \hline dynsSBM group 1 & 29 & 1 & 4\\ dynsSBM group 2 & 2 & 29 & 0\\ dynsSBM group 3 & 0 & 0 & 42 \end{tabular} \end{center} \label{tab:ants} \end{table} \subsection*{Broadstone Stream seasonal food webs} The number of sampled species of this aquatic macro-invertebrate community varies seasonally (up to $N=26$ in total including $10$ predators) as well as the number of directed links. This dataset forms a dynamic trophic network with $T=6$ snapshots (May, August, October, December 1996, February, April 1997) and we are interested in addressing the temporal variation in the web structure. Five species were not sampled each month but this situation where nodes are present/absent over time is supported by our model \citep[see supplementary material of][for details]{dynsbm}. It is also important to mention that self-interactions (cannibalism) exist for 6 out of 10 predator species. Again, our model allows for this behaviour which might distinguish predators among them and structure the network. We then fitted a dynSBM with Bernoulli distributions $f$ and we selected $Q=4$ groups with the ICL criterion~\citep[see][]{dynsbm}. The inter/intra-groups interaction properties shown in Figure~\ref{fig:foodwebconnec} are not symmetric as we consider directed networks. Therefore, for each pair of groups $\{q,l\}$ their interaction characteristics are twofold: how often species of group $q$ eat those of group $l$, and the reverse. As such, group 4 is composed of {\it omnivorous} species that eat species of any other groups, but are only eaten by species of their own group (this includes cannibalism). Group 3 has the same properties than group 4 with a significant difference: species of group 3 do not eat those of group 4. We conclude that species from group 3 occupy intermediate positions in food chains whereas those of group 4 are top predators. Indeed, group 4 is mainly composed of the three largest species (the top predators {\it Cordulegaster boltonii}, {\it Sialis fuliginosa} and {\it Plectrocnemia conspersa}) whereas group 3 contains mostly three small species (the larvae of the tanypod midges {\it Macropelopia nebulosa}, {\it Trissopelopia longimana} and {\it Zavrelimyia barbatipes}). Group 2 overall gathers preys that are mostly eaten by predators of groups 3 and 4. Species from group 1 are ``hidden'' species: they do not eat much, and are not much eaten either. This group is obtained by our statistical procedure due to fewer feeding links from/to other species compared to species of the other groups. It is not coherent from a taxonomic point of view as it gathers a mixture of predators with little activity and secondary preys that we call {\it peripheral species}. Lastly, our model can deal with the overall decrease in the number of links after October (see Figure~\ref{fig:foodwebconnec}, blue area decreasing with time in boxes) which is partly due to the fact that tanypods become less predatory and more detritivorous after autumn~\citep{woo05}. \begin{figure}[h!] \begin{center} \includegraphics[width=8.5cm]{foodweb-connectivity} \end{center} \caption{Interaction properties between groups on the food web dataset. Same as Figure~\ref{fig:antsconnec} for $Q=4$ groups and $T=6$ time steps. In this case, only interaction presence is shown (blue area) as we consider binary edges. Moreover, the $Q\times Q$ matrix shows directed interaction from group $q$ (lines) to group $l$ (columns). } \label{fig:foodwebconnec} \end{figure} Now, we explore whether species positions in the food chains (namely being top or intermediate predators, peripheral species or common preys) evolve or stay constant across the seasons. We do not expect a low-level prey to become a top predator, but the group boundaries may change due to seasonal diet variations; for instance, {\it Macropelopia nebulosa} eats lots of {\it Nemurella pictetii} in August but not in April as this species becomes too large; see~\cite{woo05}. Figure~\ref{fig:foodweballuvial} shows that group memberships remain stable before winter, but some changes are observed between October and December. In particular, the tanypod species {\it Macropelopia nebulosa} belongs to group 4 and changes to group 3 in winter. Indeed, in summer and autumn only, this species diet is similar to the one of the other members of group 4 (the three competitive top predators, that eat each other) while also being their prey. Still between October and December, the stonefly {\it Siphonoperla torrentium} becomes an active predator (with only 1 prey in October and 5 in December) and moves from group 1 to group 3. The prey {\it Prodiamesa olivacea} becomes commonly eaten during winter and is consequently integrated into group 2 during this period (and moves back to group 1 in April). Lastly, we observe that {\it Brillia modesta} changes from group 2 to group 1 between December and February: this species becomes the exclusive prey of the top predators during this period whereas it is a common prey during the other months. \begin{figure}[h!] \begin{center} \includegraphics[width=16cm]{foodweb-alluvial} \end{center} \caption{Alluvial plot showing the dynamics of the group memberships on the food web dataset. Same as Figure~\ref{fig:antsalluvial} for months $t=1, \dots,6$. Here, $Mt-q$ denotes group $q$ on month $t$ (for $1\le q \le 4$) and special group $0$ gathers absent entities at each time step. } \label{fig:foodweballuvial} \end{figure} \section*{Discussion} The inclusion of time in network analysis has been a recent challenge that requires ad-hoc modelling approaches. The success of these approaches has to be measured by their ability to extract substantial additional information that would not be caught by a traditional static network analysis. To this aim, we propose the use of our new dynamic stochastic block model to decipher temporal trends or temporary patterns in dynamic ecological networks. On the ants interaction network dataset, while the overall group behaviour trends are captured by our model, different individual behaviours are also highlighted. This way, our results can be interpreted at different scales. On the food web dataset, our model underlines a clear trophic organization but also seasonal differences in the prey assemblage. These results require further investigation by experts, but it is interesting to note that our approach can play a key role in extracting unexpected patterns. Our model is grounded on a rigorous statistical method~\citep{dynsbm} and is implemented in an efficient \texttt{R/C++} package that can handle hundreds to thousands of nodes. It is henceforth one of the very first tools for ecologists facing the recent availability of time-ordered datasets or that would like to explore the evolution of ecological networks with respect to a one-dimensional factor. \section*{Acknowledgements} The authors would like to thank Sonia K\'efi for helping us in finding the food web dataset and for her comments on earlier versions of this work. \section*{Data and code accessibility} The ants dataset is available at \url{http://datadryad.org/resource/doi:10.5061/dryad.8d8h7}. The food web dataset is available in plain text in Table~2 of \cite{woo05}. The R software package \texttt{dynsbm} is available at \url{http://lbbe.univ-lyon1.fr/dynsbm}. \bibliographystyle{apalike}
{'timestamp': '2017-01-06T02:05:25', 'yymm': '1701', 'arxiv_id': '1701.01355', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01355'}
arxiv
\section{Introduction} The spectrum crunch in current wireless systems stimulates extensive interests on exploiting new spectrum bands for cellular communications, and millimeter wave (mmWave) bands have been demonstrated to be a promising candidate in recent experiments \cite{6834753}. Thanks to the smaller wavelength of mmWave signals, large-scale antenna arrays can be leveraged at both the transmitter and receiver sides, which can provide spatial multiplexing gains with the help of multiple-input multiple-output (MIMO) techniques. On the other hand, the ten-fold increase of the carrier frequency introduces several challenges to mmWave communication systems, especially the high power consumption and cost of hardware components at mmWave bands \cite{rappaport2014millimeter}. In addition, the large available bandwidth at mmWave frequencies will result in wideband communication systems, where multicarrier techniques such as orthogonal frequency-division multiplexing (OFDM) will be utilized to overcome the frequency-selective fading. By utilizing a small number of radio frequency (RF) chains to combine a low-dimensional digital baseband precoder and another high-dimensional analog RF precoder, hybrid precoding stands out as a cost-effective transceiver solution \cite{6717211}. Moreover, to further reduce the power consumption in the RF domain, analog RF precoders are usually implemented by phase shifters, which induces a challenging unit modulus constraint and forms the major challenge in designing hybrid precoders. Given the large dimension of the design space and the unit modulus constraint, an important design aspect of hybrid precoders is the computational complexity. There have been many recent works on hybrid precoder design in mmWave systems \cite{6717211,7397861,6884253,7448873,7037444,6928432,zhang2014achieving,7387790}. In \cite{6717211,7397861}, efficient hybrid precoding algorithms were developed for single-user single-carrier MIMO systems. The investigation was then extended to single-user OFDM \cite{7397861,6884253,7448873} and multiuser single-carrier systems \cite{7037444,6928432}. The main differences in these existing works are the approaches to deal with the unit modulus constraints of the analog precoder. Specifically, such constraints were tackled by orthogonal matching pursuit (OMP) in \cite{6717211,6884253,7037444}, by manifold optimization in \cite{7397861}, and by channel phase extraction in \cite{7448873,6928432}, respectively. There were also some studies on how to achieve the performance of the fully digital precoder with the hybrid structure \cite{zhang2014achieving,7387790}, yet requiring a large number of RF chains. Although various attempts have been made to balance the performance and computational complexity, there is no systematic approach to design computationally efficient hybrid precoders. In this paper, we shall propose a novel hybrid precoder structure, which relaxes the unit modulus constraints of the analog part and thus significantly simplifies the hybrid precoder design. In particular, by adopting two groups of phase shifters to map the signals out of the RF chains to antennas, the constraints for the analog precoder become more tractable. We adopt the alternating minimization (AltMin) framework \cite{7397861} for the hybrid precoder design. While the digital part is similar to \cite{7397861}, the optimization of the analog RF precoder is formulated as a Least Absolute Shrinkage and Selection Operator (LASSO) problem, for which efficient algorithms are available. In addition, we discover that the hybrid precoder in the multiuser setting will produce residual interuser interference, as it only approximates the fully digital precoder. Such interference will significantly degrade the system performance, especially at high SNRs. This issue is more prominent in the multicarrier system as the analog precoder is shared by a large number of subcarriers. To this end, we propose to apply an additional block diagonalization (BD) precoder at the baseband to cancel the interuser interference, which is shown to be effective to further improve the spectral efficiency and multiplexing gain. Moreover, simulation results demonstrate that the proposed hybrid precoding algorithm can easily approach the performance of the fully digital precoder with a reasonable amount of RF chains. \section{System Model and Problem Formulation} \subsection{System Model} Consider the downlink transmission of a multiuser OFDM mmWave MIMO system, where the base station (BS) is equipped with $N_\mathrm{t}$ antennas and transmits signals to $K$ $N_\mathrm{r}$-antenna users over $F$ subcarriers. On each subcarrier, $N_s$ data streams are transmitted to each user. The limitations of the RF chains are given by $KN_s\le N_\mathrm{RF}^\mathrm{t}\le N_\mathrm{t}$ and $N_s\le N_\mathrm{RF}^\mathrm{r}\le N_\mathrm{r}$, where $N_\mathrm{RF}^\mathrm{t}$ and $N_\mathrm{RF}^\mathrm{r}$ are the number of RF chains facilitated for the BS and each user, respectively. The received signal for the $k$-th ($1\le k\le K$) user on the $f$-th subcarrier is given by \begin{equation} \mathbf{y}_{k,f}=\mathbf{W}^H_{\mathrm{BB},k,f}\mathbf{W}^H_{\mathrm{RF},k}\left(\mathbf{H}_{k,f}\sum_{i=1}^K\FRF\FBB_{k,f}\mathbf{s}_{k,f}+\mathbf{n}_{k,f}\right), \end{equation} where $\mathbf{s}_{k,f}\in\mathbb{C}^{N_s}$ is the transmitted symbol vector for the $k$-th user on the $f$-th subcarrier such that $\mathbb{E}[\mathbf{s}_{k,f}\mathbf{s}^H_{k,f}]=\frac{1}{KN_sF}\mathbf{I}_{N_s}$. The digital baseband precoders and combiners are symbolized by $\FBB_{k,f}\in\mathbb{C}^{\NRFt\times N_s}$ and $\WBB_{k,f}\in\mathbb{C}^{\NRFr\times N_s}$, respectively. Because the transmitted signals for all the users are mixed together via the digital baseband precoder and the analog RF precoder is a post-IFFT (inverse fast Fourier transform) operation, the analog RF precoder is shared by all the users and subcarriers, denoted as $\FRF\in\mathbb{C}^{\Nt\times \NRFt}$. Similarly, the analog RF combiner is a subcarrier-independent operation for each user $k$, denoted as $\WRF_k\in\mathbb{C}^{\Nr\times \NRFr}$. Furthermore, the additive noise at the users is represented by $\mathbf{n}_{k,f}\in\mathbb{C}^{\Nr}$, whose elements are independent and identically distributed (i.i.d.) according to $\mathcal{CN}(0, \sigma^2)$. The mmWave MIMO channel between the BS and the $k$-th user on the $f$-th subcarrier, denoted as $\mathbf{H}_{k,f}$, can be characterized by the Saleh-Valenzuela model as \cite{6717211} \begin{equation} \mathbf{H}_{k,f}=\gamma_k\sum_{i=0}^{N_{\mathrm{cl},k}-1} \sum_{l=1}^{N_{\mathrm{ray},k}}{\alpha_{il,k}\mathbf{a}_r(\theta_{il,k})\mathbf{a}_t^H(\phi_{il,k})}e^{-j2\pi if/F}. \end{equation} The normalization factor $\gamma_k$ is specified by $\gamma_k=\sqrt{\frac{\rho_k\Nt\Nr}{N_{\mathrm{cl},k}N_{\mathrm{ray},k}}}$, where $N_{\mathrm{cl},k}$ and $N_{\mathrm{ray},k}$ represent the number of clusters and the number of rays in each cluster, and $\rho_k$ is the path loss between the BS to the $k$-th user. The gain of the $l$-th ray in the $i$-th propagation cluster is denoted as $\alpha_{il,k}$. In addition, $\mathbf{a}_r(\theta_{il,k})$ and $\mathbf{a}_t(\phi_{il,k})$ stand for the receive and transmit array response vectors with the corresponding angle of arrival $\theta_{il,k}$ and angle of departure $\phi_{il,k}$. The detailed expressions can be found in \cite{6717211}. \subsection{Analog RF Precoder Structure} As mentioned before, the analog precoder is practically implemented by phase shifters. Conventionally, in either the fully- or partially-connected structure \cite{7397861}, each route from a certain RF chain to one connected antenna element is implemented by a phase shifter, as shown in Fig. \ref{fig11}. This mapping strategy implies that each nonzero element in the analog precoding and combining matrices should have unit modulus, i.e., $|(\FRF)_{i,j}|=|(\WRF)_{i,j}|=1$. This is intrinsically a non-convex constraint and difficult to tackle with, which forms the main design challenge. \begin{figure}[tbp] \centering \subfigure[Conventional analog RF precoder structure.]{ \includegraphics[width=6cm]{./fig11}\label{fig11} } \subfigure[DPS analog RF precoder structure.]{ \includegraphics[width=6cm]{./fig12}\label{fig12} } \caption{Comparison of two analog RF precoder structures.} \end{figure} In this paper, we propose a new analog RF precoder structure, as shown in Fig. \ref{fig12}, where the phase shifter network is divided into two groups, referred as the \emph{Double Phase Shifter (DPS) structure}. For each route from an RF chain to an antenna element, a unique phase shifter in each group will be selected and summed up together to compose the analog precoding gain. Under this special structure, each nonzero element in the analog RF precoding matrix corresponds to a sum of two phase shifters. In other words, the new constraints for the analog RF precoder and combiner are $|(\FRF)_{i,j}|\le 2$ and $|(\WRF)_{i,j}|\le 2$ since the amplitude of a sum of two phase shifters should be less than 2. By doubling the number of phase shifters, the new constraint becomes convex and therefore makes it more tractable and promising to develop low-complexity design approaches. \subsection{Problem Formulation} As shown in \cite{6717211,7397861}, minimizing the Euclidean distance between the fully digital precoder and the hybrid precoder is an effective way to design the hybrid precoder in mmWave MIMO systems, whose formulation\footnote{Here we focus on the precoder design, and the combiner is designed in the same way without the transmit power constraint.} is given by \begin{equation}\label{problemformulation} \begin{aligned} &\underset{\mathbf{F}_\mathrm{RF},\mathbf{F}_\mathrm{BB}}{\mathrm{minimize}} && \left\Vert \mathbf{F}_\mathrm{opt}-\mathbf{F}_\mathrm{RF}\mathbf{F}_\mathrm{BB}\right\Vert _F\\ &\mathrm{subject\thinspace to}&& \begin{cases} |(\FRF)_{i,j}|\le 2\\ \left\|\mathbf{F}_\mathrm{RF}\mathbf{F}_\mathrm{BB}\right\|_F^2\le KN_sF, \end{cases} \end{aligned} \end{equation} where $\Fopt=\left[\Fopt_{1,1},\cdots,\Fopt_{k,f},\cdots,\Fopt_{K,F}\right]$ is the combined fully digital precoder with dimension $\Nt\times KN_sF$, and $\FBB=\left[\FBB_{1,1},\cdots,\FBB_{k,f},\cdots,\FBB_{K,F}\right]$ is the concatenated digital precoder with dimension $\NRFt\times KN_sF$. The second constraint is the transmit power constraint at the BS side. Problem \eqref{problemformulation} is a matrix decomposition problem, and the goal of this formulation is to find an accurate approximation for an arbitrary fully digital precoder. With this formulation, the proposed algorithm can be applied with any fully digital precoder. It also has been shown in \cite{6717211} that minimizing the objective function in \eqref{problemformulation} leads to the maximization of spectral efficiency in the single-user single-carrier case. In this paper, we will adopt the classical BD precoder as $\Fopt$, which is asymptotically optimal in the high signal-to-noise ratio (SNR) regime \cite{1261332}. \section{Hybrid Precoder Design} Alternating minimization, which separates the optimization of the objective function with respect to different variable subsets in each step, has been shown to be effective in hybrid precoding \cite{7397861} and various other applications, e.g., matrix completion, phase retrieval, and dictionary learning \cite{7130654}. In this section, we will adopt alternating minimization as the main approach to design the hybrid precoder under the DPS analog RF precoder structure. \subsection{Single-carrier Systems} While the main focus of this paper is on multiuser multicarrier systems, some advantages of the proposed DPS structure will be firstly presented in single-carrier systems, as shown in the following result. \begin{lemma}\label{lem1} For single-carrier systems, with the DPS precoder structure in Fig. \ref{fig12}, the fully digital precoder $\Fopt$ can be perfectly decomposed into the hybrid precoder $\FRF$ and $\FBB$ using the minimum number of RF chains, i.e., $\NRFt=KN_s$ and $\NRFr=N_s$. \end{lemma} \begin{IEEEproof} The proof can be easily obtained by the rank sufficiency of $\FRF$ and $\FBB$ in the decomposition when $F=1$, and is omitted due to space limitation. \end{IEEEproof} Lemma \ref{lem1} shows that, for single-carrier systems with either single-user or multiuser transmissions, the performance of the fully digital precoder can be easily obtained with a hybrid precoder via a simple matrix decomposition. Note that, with the conventional analog precoder structure, the number of RF chains should be at least twice that of the data streams in order to achieve the fully digital precoder, i.e., $\NRFt=2KN_s$ and $\NRFr=2N_s$ \cite{zhang2014achieving,7397861}. Considering that the RF chain is significantly more power hungry than the phase shifter \cite{7397861}, the proposed structure is more energy efficient when achieving the fully digital precoder. \subsection{Hybrid Precoder Design in Multicarrier Systems via Alternating Minimization} In each step of alternating minimization, one part of the hybrid precoder is fixed while the other part will be optimized. Since the main difficulty is the constraint on the analog precoder, we will focus on the analog precoder design in the following. The optimization of the analog precoder is given by \begin{equation}\label{analogp} \begin{aligned} &\underset{\mathbf{F}_\mathrm{RF}}{\mathrm{minimize}} && \left\Vert \mathbf{F}_\mathrm{opt}-\mathbf{F}_\mathrm{RF}\mathbf{F}_\mathrm{BB}\right\Vert _F\\ &\mathrm{subject\thinspace to}&& |(\FRF)_{i,j}|\le 2. \end{aligned} \end{equation} Note that the power constraint in \eqref{problemformulation} is temporarily removed. In fact, a simple normalization operation can be adopted if the power constraint is not satisfied, which will be discussed later. The optimization problem \eqref{analogp} is a convex problem and can be solved by solvers such as CVX. Nevertheless, to further reduce the computational complexity, we will illustrate the inherent structure of the solution by considering the dual problem. This will lead to a closed-form solution to \eqref{analogp}. \begin{lemma}\label{lem2} The dual problem of \eqref{analogp} is a LASSO problem, given by \begin{equation}\label{lasso} \underset{\mathbf{x}}{\mathrm{minimize}} \quad \frac{1}{2}\left\Vert \mathbf{Ax-b}\right\Vert _2^2+2\Vert\mathbf{x}\Vert_1. \end{equation} The parameters $\mathbf{A}$ and $\mathbf{b}$ are given by \begin{equation} \mathbf{A}=\mathbf{S}^{\frac{1}{2}}\mathbf{U},\quad\mathbf{b}=\mathbf{AD}^H\fopt, \end{equation} where $\mathbf{D}=\mathbf{F}_\mathrm{BB}^T\otimes \mathbf{I}_{\Nt}$ and $\left(\mathbf{D}^H\mathbf{D}\right)^{-1}=\mathbf{USU}^H$ is the singular value decomposition (SVD) of $\left(\mathbf{D}^H\mathbf{D}\right)^{-1}$. The optimal solution of \eqref{analogp} can be written by \begin{equation} \mathbf{f}_\mathrm{RF}^\star=\mathbf{A}^H\left(\mathbf{b}-\mathbf{Ax}^\star\right), \end{equation} where $\fRF=\mathrm{vec}(\FRF)$. \end{lemma} \begin{IEEEproof} The proof is omitted due to space limitation. \end{IEEEproof} Based on Lemma \ref{lem2}, the analog precoder design problem is transferred to a LASSO problem. This provides the opportunity to leverage the large body of existing works on efficiently solving the general LASSO problem \cite{hastie2015statistical}. Here we are interested in a special case where we can get a closed-form solution to the problem, which will significantly reduce the computational complexity of the hybrid precoding algorithm. It was shown in \cite{7397861} that enforcing a semi-orthogonal constraint to the digital precoder will incur little performance loss in single-user multicarrier systems. Inspired by this work, we resort to a similar approach, i.e., imposing a semi-orthogonal constraint to the digital precoder, which is specified as \begin{equation}\label{semio} \FBB\mathbf{F}_\mathrm{BB}^H=\mathbf{I}_\NRFt. \end{equation} Under this constraint, the observation matrix $\mathbf{A}$ in the LASSO problem \eqref{lasso} is also semi-orthogonal, i.e., \begin{equation} \begin{split} \mathbf{A}^H\mathbf{A}&=\left(\mathbf{D}^H\mathbf{D}\right)^{-1}\\ &=\left((\mathbf{F}_\mathrm{BB}^T\otimes\mathbf{I}_{\NRFt})^H(\mathbf{F}_\mathrm{BB}^T\otimes\mathbf{I}_{\NRFt})\right)^{-1}\\ &=\left((\mathbf{F}_\mathrm{BB}^*\otimes\mathbf{I}_{\NRFt})(\mathbf{F}_\mathrm{BB}^T\otimes\mathbf{I}_{\NRFt})\right)^{-1}\\ &=\left((\FBB\mathbf{F}_\mathrm{BB}^H)^T\otimes\mathbf{I}_{\NRFt}\right)^{-1}=\mathbf{I}_{\NRFt^2}. \end{split} \end{equation} With the semi-orthogonal observation matrix $\mathbf{A}$, the LASSO problem \eqref{lasso} has a closed-form solution as \cite{hastie2015statistical} \begin{equation} \mathbf{x}^\star=\exp\{j\angle(\mathbf{A}^H\mathbf{b})\}\left(\left|\mathbf{A}^H\mathbf{b}\right|-2\right)^+, \end{equation} where $(x)^+=\max\{0,x\}$, and the corresponding solution to $\FRF$ in \eqref{analogp} is \begin{equation}\label{lassoso} \mathbf{F}_\mathrm{RF}^\star=\Fopt\mathbf{F}_\mathrm{BB}^H-\exp\left\{j\angle\left(\Fopt\mathbf{F}_\mathrm{BB}^H\right)\right\}\left(\left|\Fopt\mathbf{F}_\mathrm{BB}^H\right|-2\right)^+. \end{equation} Note that, to obtain an analog precoder $\FRF$ with the fixed digital precoder $\FBB$, a product between $\Fopt$ and $\mathbf{F}_\mathrm{BB}^H$ is the only required step, which is much more computationally efficient than solving the original problem \eqref{analogp} using an algorithm-embedded solver. After updating the analog precoder $\FRF$, optimizing the digital precoder $\FBB$ with the semi-orthogonal constraint \eqref{semio} is a typical semi-orthogonal Procrustes problem (OPP). The solution is similar to \cite[Eq. 28]{7397861}, which can be expressed as \begin{equation} \FBB = \mathbf{VU}_1^H,\label{OPP} \end{equation} where $\mathbf{U}_1\mathbf{SV}^H=\mathbf{F}_\mathrm{opt}^H\FRF$ is the SVD of $\mathbf{F}_\mathrm{opt}^H\FRF$, and $\mathbf{S}$ is a diagonal matrix whose nonzero elements are the first $\NRFt$ nonzero singular values $\sigma_1,\cdots,\sigma_{\NRFt}$. \subsection{Interuser Interference Cancellation} While we can perfectly cancel the interuser interference with the fully digital precoder, there will be residual interuser interference for the hybrid precoder, which is an approximation of the fully digital one. Later in Section \ref{IV}, we will see that in multiuser multicarrier systems, interuser interference is a severe problem that will dramatically degrade the hybrid precoding performance, especially at high SNRs. In this subsection, after designing the hybrid precoder and combiner, we propose to cascade another digital baseband precoder $\FBD$ that is responsible for canceling the residual interuser interference. In particular, with the hybrid precoder and combiner at hand, we define an effective channel for the $k$-th user on the $f$-th subcarrier as \begin{equation}\label{effch} \mathbf{\hat H}_{k,f}={\mathbf{W}^H_\mathrm{BB}}_{k,f}{\mathbf{W}^H_\mathrm{RF}}_{k}\mathbf{H}_{k,f}{\FRF}{\FBB}_{f}, \end{equation} where $\FBB_f=\left[\FBB_{1,1},\cdots,\FBB_{k,f},\cdots,\FBB_{K,f}\right]\in\mathbb{C}^{\NRFt\times KN_s}$ is the composite digital precoder on the $f$-th subcarrier, and $\mathbf{\hat H}_{k,f}\in\mathbb{C}^{N_s\times KN_s}$ is the effective channel. Our goal is to design the precoders $\FBD_{k,f}$, which satisfy the conditions \begin{equation} \mathbf{\hat H}_{j,f}\FBD_{k,f}=\mathbf{0}, \quad k\ne j. \end{equation} A simple way to achieve the conditions is the BD precoder, and note that the dimension of the effective channel is sufficient to perform the BD design. More details can be found in \cite{1261332}. The overall hybrid precoding algorithm is summarized as the LASSO-AltMin algorithm. \floatname{algorithm}{LASSO-AltMin Algorithm:} \begin{algorithm}[h] \caption{LASSO Based Alternating Minimization Algorithm} \label{alternating} \begin{algorithmic}[1] \REQUIRE $\mathbf{F}_{\mathrm{opt}}$ \STATE Construct a feasible $\mathbf{F}_\mathrm{RF}^{(0)}$ and set $k=0$; \REPEAT \STATE Fix $\FRF^{(k)}$, solving $\FBB^{(k)}$ using the solution to OPP \eqref{OPP}; \STATE Fix $\FBB^{(k)}$, and update $\FRF^{(k+1)}$ by the LASSO solution \eqref{lassoso}; \STATE $k\leftarrow k+1$; \UNTIL a stopping criterion triggers. \STATE Compose the effective channels $\mathbf{\hat H}_{k,f}$ according to \eqref{effch}. \STATE Compute BD precoders $\FBD_{k,f}$ \cite{1261332}. \STATE The final digital baseband precoder ${{\mathbf{F}}_\mathrm{B}}_{k,f}=\FBB_{k,f}\FBD_{k,f}$. \STATE For the digital precoder at the transmit end, normalize $\widehat{\mathbf{F}}_\mathrm{B}=\frac{\sqrt{KN_sF}}{\left\Vert\mathbf{F}_\mathrm{RF}\mathbf{F}_\mathrm{B}\right\Vert_F}\mathbf{F}_\mathrm{B}$ if the power constraint in \eqref{problemformulation} is not satisfied. \end{algorithmic} \end{algorithm} Note that Steps 3 and 4 both give the globally optimal solution to the digital and analog precoders, respectively. Hence, the algorithm will converge to a stationary point of problem \eqref{analogp} with an additional constraint \eqref{semio}, since it is a two block coordinate descent procedure \cite{grippo2000convergence}. In the last step, we normalize the digital precoder if the transmit power constraint is not satisfied. It has been shown in \cite[Lemma 1]{7397861} that as long as we can make the Euclidean distance between the optimal digital precoder and the hybrid precoder sufficiently small when ignoring the power constraint, the normalization step will also achieve a small distance to the optimal digital precoder. \section{Simulation Results}\label{IV} In this section, we will evaluate the performance of the proposed LASSO-AltMin algorithm and compare it with the OMP algorithm \cite{6717211,7037444} in multiuser OFDM mmWave systems. Assume that $N_s=3$ data streams are sent from the BS to each user in a 3-user ($K=3$) MIMO systems over $F=128$ subcarriers, with $\Nt=256$ and $\Nr=16$, while both are equipped with uniform linear arrays (ULAs). The channel parameters are given by $N_{\mathrm{cl},k}=3$ clusters and $N_{\mathrm{ray},k}=8$ rays. The angles of departure and arrival (AoDs and AoAs) follow the Laplacian distribution with uniformly distributed mean angles in $[0,2\pi]$ and angular spread of 10 degrees. The antenna elements in ULAs are separated by a half wavelength distance, and all simulation results are averaged over 5000 channel realizations. \begin{figure}[htbp] \centering \includegraphics[width=7cm]{./fig1} \caption{Spectral efficiency achieved by different precoding algorithms when $\NRFt=K\NRFr=KN_s$.}\label{fig1} \end{figure} Fig. \ref{fig1} shows the spectral efficiency of different algorithms with the minimum numbers of RF chains, i.e., $\NRFt=KN_s$ and $\NRFr=N_s$. First, we see that the proposed algorithm significantly outperforms the existing OMP algorithm implemented under the conventional analog precoder structure. The performance gain mainly comes from doubling the number of phase shifters, which provides more degrees of freedom for the analog precoding gain. We observe in the simulation that the time complexity of the proposed LASSO-AltMin algorithm is comparable with the OMP algorithm, mainly thanks to the closed-form solutions in the alternating procedures. In \cite{7397861,7037444}, it has been pointed out that approximating the fully digital precoder with a hybrid structure will lead to a near optimal performance in single-user single-carrier, single-user multicarrier, and multiuser single-carrier mmWave MIMO systems. In Fig. \ref{fig1}, we evaluate the performance of the LASSO-AltMin algorithm without the additional BD operation. We discover that, without the BD precoder canceling the interuser interference, there will be residual interuser interference, which results in an obvious performance loss compared to the fully digital one, especially at high SNRs. This phenomenon illustrates that simply approximating the fully digital precoder with the hybrid one is not sufficient in multiuser multicarrier mmWave systems since the analog precoder is shared by a large number of subcarriers. The comparison in Fig. \ref{fig1} demonstrates the effectiveness and necessity of the BD steps in the proposed LASSO-AltMin algorithm. Fig. \ref{fig2} compares the performance of different precoding schemes for different RF chain numbers $\NRFt$ at the BS side while keeping $\NRFr=N_s$ as the minimum number of RF chains at each user. \begin{figure}[htbp] \centering \includegraphics[width=7cm]{./fig2} \caption{Spectral efficiency achieved by different precoding algorithms for different transmit RF chain numbers $\NRFt$, given $\NRFr=N_s$ and SNR=5 dB.}\label{fig2} \end{figure} It is shown that the proposed LASSO-AltMin algorithm can approach the performance of the fully digital precoder when the number of RF chains is slightly larger than the number of data streams, which cannot be realized by the existing OMP algorithm. Thanks to the newly proposed DPS analog precoder structure and the LASSO-AltMin algorithm, it turns out that there will not be much performance loss when we adopt hybrid precoding in multiuser OFDM mmWave systems. \section{Conclusions} This paper proposed a new analog precoder structure for hybrid precoding, based on which a LASSO based alternating minimization algorithm was proposed for hybrid precoder design in multiuser OFDM systems. The paper helped unravel some valuable design insights: \begin{itemize} \item It is beneficial, from both performance and complexity points of view, to implement twice the number of phase shifters in the analog precoder, as shown in Fig. \ref{fig12}. \item Different from other hybrid precoding systems, in multiuser multicarrier systems, interuser interference is a vital problem that we should deal with in addition to the fully digital precoder approximation. To solve this problem, it is effective to cascade a digital baseband precoder that specializes in canceling the interuser interference. \end{itemize} It is interesting to extend the proposed DPS analog precoder structure to investigate other problems involving hybrid precoder design, e.g., to consider the hybrid precoder design combined with channel training and feedback. \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:03:50', 'yymm': '1701', 'arxiv_id': '1701.01567', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01567'}
arxiv
\section{Introduction} The problem $\sSAT$ of counting the satisfying assignments of a given $\CNF$-formula is a central problem to several areas such as probabilistic reasoning~\cite{Roth96,BacchusDP03} and probabilistic databases~\cite{BeameLRS14,BeameLRS13,JhaS13}. This problem is much harder than $\SAT$, its associated decision problem. For example, the problem $\SAT[2]$ of deciding if a formula having at most two literals per clause if satisfiable is easy where counting those satisfying assignments is as hard as $\sSAT$. Even computing a $2^{n^{1-\epsilon}}$-approximation in the restricted case of monotone $\SAT[2]$ is hard for any $\epsilon > 0$~\cite{Roth96}. In order to tackle this problem, two main approaches have been used so far. The first approach -- applied in practical tools for solving $\sSAT$ -- follows the successful road paved by $\SAT$-solvers: it is based on a variation of DPLL~\cite{DavisP60} called {\em exhaustive DPLL}~\cite{HuangD05} and the approach is mainly focused on improving the heuristics used for eliminating variables and choosing which subformulas should be cached during the computation. The performance of such tools -- though impressive for such a hard problem~\cite{HuangD05,sang04,thurley06,BacchusDP03} -- lag far behind the state-of-the-art $\SAT$-solvers. This gap is mainly explained by the differences between the hardness of both problems, but also by the fact that optimizations for exhaustive DPLL are inspired by those used in $\SAT$-solvers and not always relevant for model counting~\cite{SangBK05}. The second -- more theoretical -- approach focuses on {\em structural restrictions} of the input formula. The main idea of this approach is to solve $\sSAT$ more quickly on formulas where interaction between the clauses and the variables is restricted. This interaction is usually represented by a graph derived from the input $\CNF$-formula. The complexity of $\sSAT$ is then studied on inputs where the associated graph belongs to a restricted class of graphs. Samer and Szeider~\cite{SamerS10} were the first to formalize this idea for $\sSAT$ by showing that if this graph is of bounded tree width, then $\sSAT$ can be solved in polynomial time. This result has then been improved and completed by different work showing the tractability of $\sSAT$ for more general or incomparable classes of formulas~\cite{PaulusmaSlivovskySzeider16,SlivovskyS13,SaetherTV14,CapelliDM14}, the intended goal being to understand the frontier of tractibility for $\sSAT$. \paragraph{Contributions.} The main contribution of this paper is to propose a formal framework, using tools from {\em knowledge compilation}, to study both algorithmic techniques and to compare their respective power. We then make a first step toward the separation of both techniques by exhibiting a class of formulas having the following property: for every formula $F$ of this class, there exists an elimination order of the variables for which exhaustive DPLL returns the number of satisfying assignments of $F$ in linear time while algorithms based on structural restrictions needs exponential time. The class of formulas we are using to separate both technique are $\beta$-acyclic formulas, a class already known to be tractable~\cite{BraultCM15}. The algorithm used to solve this class was however very different from the one that are usually used by structure-based algorithms. Our result gives a formal explanation of why the usual techniques fail on this class, a question that has puzzled the community since $\SAT$ has been shown tractable on this class of formulas without generalizing to counting~\cite{OrdyniakPS13}. Moreover, in Section~\ref{sec:comp}, we give tools that are useful for designing algorithms on $\beta$-acyclic hypergraphs and are of independent interest. \paragraph{Methodology.} It has been observed that the trace of every implementation of exhaustive DPLL actually constructs a very specific Boolean circuit equivalent to the input formula~\cite{HuangD05}. Such circuits are known in knowledge compilation under the name of {\em decision Decomposable Negation Normal Form} ($\mathsf{dec}\text{-}\mathsf{DNNF}$). We first show in Section~\ref{sec:comp} that $\beta$-acyclic formulas can be represented by linear size $\mathsf{dec}\text{-}\mathsf{DNNF}$, which can be interpreted as the fact that exhaustive DPLL may solve this class of formula in polynomial time, if it chooses the right order to eliminate variables and the right caching methods. Similarly, all structure-based algorithms for $\sSAT$ use the same kind of dynamic programming scheme and it has been shown that they all implicitly construct a very specific Boolean circuit equivalent to the input formula~\cite{BovaCMS15}. Such circuits are known under the name of {\em structured deterministic} $\mathsf{DNNF}$. We start by arguing in Section~\ref{sec:prel} that every algorithm using techniques similar to the one used by structure-based algorithms will implicitly construct a circuit having a special property called {\em determinism}. In Section~\ref{sec:deviation}, We exhibit a class of $\beta$-acyclic formulas having no polynomial size equivalent {\em structured $\mathsf{DNNF}$}, thus separating both methods. \paragraph{Related work.} The class of $\beta$-acyclic formulas we use to prove the separation have already been shown to be tractable for $\sSAT$ and not tractable to the state-of-the-art structure-based algorithms~\cite{BraultCM15} but this result does not rule out the existence of a more general algorithm based on the same technique and solving every known tractable class. Our result is sufficiently strong to rule out the existence of such an algorithm. New lower bounds have been recently shown for circuits used in knowledge compilation~\cite{BovaCMS16,BeameLRS14,BeameLRS13,BeameL15,DarwicheP10}. Moreover, knowledge compilation has already been used to prove limits of algorithmic techniques in the context of model counting. Beame et al.~\cite{BeameLRS13} for example have exhibited a very interesting class of queries on probabilistic databases that can be answered in polynomial time by using specific techniques but that cannot be represented by circuits corresponding to exhaustive DPLL. They conclude that solving the query by using well-known reduction to $\sSAT$ and then calling a $\sSAT$-solver is weaker than using their technique. Our result uses somehow the same philosophy but on a different algorithmic technique. \paragraph{Organization of the paper.} The paper is organized as follows: Section~\ref{sec:prel} contains the needed definitions and concepts used through the paper. Section~\ref{sec:comp} describes the algorithm to transform $\beta$-acyclic formulas into circuits corresponding to the execution of an exhaustive DPLL algorithm. Finally, Section~\ref{sec:deviation} contains the formalization of the framework for studying algorithms based on dynamic programming along a branch decomposition and a proof that the $\beta$-acyclic case is not covered by this framework. \section{Preliminaries} \label{sec:prel} \subsection{$\CNF$-formulas.} A \emph{literal} is a variable $x$ or a negated variable $\neg x$. A \emph{clause} is a finite set of literals. A clause is \emph{tautological} if it contains the same variable negated as well as unnegated. A \emph{(CNF) formula} (or \emph{CNF}, for short) is a finite set of non-tautological clauses. If $x$ is a variable, we let $\mathsf{var}(x) = \mathsf{var}(\neg x) = x$. Given a clause $C$, we denote by $\mathsf{var}(C) = \bigcup_{\ell \in C} \mathsf{var}(\ell)$ and given a $\CNF$-formula, we denote by $\mathsf{var}(F) = \bigcup_{C \in F} \mathsf{var}(C)$. The {\em size} of a $\CNF$-formula $F$, denoted by $\textsf{size}(F)$, is defined to be $\sum_{C \in F} |\mathsf{var}(C)|$. A $\CNF$-formula is {\em monotone} if it does not contain negative literals. Let $X$ be a set of variables. An {\em assignment} $\tau$ of $X$ is a mapping from $X$ to $\{0,1\}$. The set of assignments of $X$ is denoted by $\{0,1\}^X$. Given an assignment $\tau$ of $X$ and $X' \subseteq X$, we denote by $\tau|_{X'}$ the restriction of $\tau$ on $X'$. Given two sets $X,X'$, $\tau \in \{0,1\}^X$ and $\tau' \in \{0,1\}^{X'}$, we denote by $\tau \simeq \tau'$ if $\tau|_{X \cap X'} = \tau'|_{X \cap X'}$. If $\tau \simeq \tau'$, we denote by $\tau \cup \tau'$ the assignment of $X \cup X'$ such that for all $x \in X$, $(\tau \cup \tau')(x) = \tau(x)$ and for all $x \in X'$, $(\tau \cup \tau')(x) = \tau'(x)$. A {\em boolean function} $f$ on variables $X$ is a mapping from $\{0,1\}^X$ to $\{0,1\}$. We denote by $\tau \models f$ if $\tau \in \{0,1\}^X$ is such that $f(\tau)=1$ and by $\mathsf{sat}(f) = \{\tau \in \{0,1\}^X \mid \tau \models f \}$. Given $Y \subseteq X$ and $\tau \in \{0,1\}^Y$, we denote by $f[\tau]$ the boolean function on variables $X \setminus Y$ defined by for every $\tau' \in \{0,1\}^{X \setminus Y}$, $f[\tau](\tau') = f(\tau \cup \tau')$. A $\CNF$-formula $F$ naturally induces a boolean function. Extending assignments to literals in the usual way, we say that an assignment $\tau$ \emph{satisfies} a clause $C$ if there is a literal $\ell \in C$ such that $\tau(\ell) = 1$. An assignment \emph{satisfies} a formula $F$ if it satisfies every clause $C \in F$. In this paper, we often identify the $\CNF$-formula and its underlying boolean function. Thus, given a $\CNF$-formula $F$ on variables $X$ and an assignment $\tau$ of $Y \subseteq X$, we will use the notation $F[\tau]$ in the same way as for any other boolean function. Observe that $F[\tau]$ is still represented by a $\CNF$-formula of size less than $\textsf{size}(F)$: it is the $\CNF$-formula where we have removed satisfied clauses from $F$ and removed the variables of $Y$ in each remaining clause. \subsection{Graphs and branch decompositions.} We assume the reader is familiar with the basics of graph theory. An introduction to the topic can be found in~\cite{Diestel05}. Given a graph $G = (V,E)$, we often denote by $V(G)$ the set of vertices of $G$ and by $E(G)$ the set of edges of $G$ if they have not been named explicitly before. $G$ is said {\em bipartite} if there exists a partition $V_1 \uplus V_2$ of $V$ such that for every $e \in E$, one end-point of $e$ is in $V_1$ and the other is in $V_2$. Given a graph $G = (V,E)$ and $X,Y \subseteq V$, we denote by $G[X,Y] = (V',E')$ the bipartite graph such that $V' = X \cup Y$ and $E' = \{\{u,v\} \in E \mid u \in X, v \in Y\}$. An {\em induced matching} $M$ is a matching of $G$ such that for every $e,f \in M$, if $e = \{u,v\}$ and $f = \{u',v'\}$, we have $\{u,u'\} \notin E$, $\{u,v'\} \notin E$, $\{v,u'\} \notin E$ and $\{v,v'\} \notin E$. A {\em branch decomposition} of $G$ is a binary rooted tree $T$ whose leaves are in one-to-one correspondence with $V$. Given $t$ a vertex of $T$, we denote by $T_t$ the subtree of $T$ rooted in $t$. We denote by $V_t$ the set of leaves of $T_t$. The {\em maximal induced matching width}~\cite{Vatshelle12}, $\mathsf{MIM}\text{-width}$ for short, of a vertex $t$ of $T$ is the size of the largest induced matching $M$ of $G[V \setminus V_t, V_t]$. The $\mathsf{MIM}\text{-width}$ of $T$, denoted as $\mathbf{mimw}(T)$, is the maximal $\mathsf{MIM}\text{-width}$ of its vertices. The {\em maximal induced matching width} of a graph $G$, denoted as $\mathbf{mimw}(G)$, is the minimal $\mathsf{MIM}\text{-width}$ of all branch decomposition of $G$. Figure~\ref{fig:bd} depicts a graph $G$ together with a branch decomposition of $G$. The distinguished node $t$ of this branch decomposition has $\mathsf{MIM}\text{-width}$ $1$ as the biggest induced matching of $G[V_t,V \setminus V_t]$ is of size one because the matching $\{\{1,4\},\{2,3\}\}$ is not induced. \begin{figure} \centering \begin{tikzpicture}[scale=0.6] \node (v1) at (-1,-1) {$1$}; \node (v2) at (1,-1) {$2$}; \node (v3) at (1,1) {$3$}; \node (v4) at (-1,1) {$4$}; \draw (v1) -- (v2) -- (v3) -- (v4) -- (v1) --(v3); \end{tikzpicture}~~ \begin{tikzpicture}[scale=0.6] \node (v1) at (-2,-1) {$1$}; \node (v2) at (-1,-1) {$2$}; \node (v3) at (0,-1) {$3$}; \node (v4) at (1,-1) {$4$}; \node (t1) at (-1.5,0) {$t$}; \draw (v1) -- (t1) -- (v2); \draw (t1) -- (-0.5,1) -- (0.5,0) -- (v4) -- (0.5,0) --(v3); \end{tikzpicture}~~ \begin{tikzpicture}[scale=0.6] \node (v1) at (-1,-1) {$1$}; \node (v2) at (1,-1) {$2$}; \node (v3) at (1,1) {$3$}; \node (v4) at (-1,1) {$4$}; \draw (v1) -- (v3); \draw (v1) -- (v4); \draw (v2) --(v3); \end{tikzpicture} \caption{From left to right: a graph $G=(V,E)$, a branch decomposition of $G$ and $G[V_t, V \setminus V_t]$} \label{fig:bd} \end{figure} \subsection{Hypergraphs and $\beta$-acyclicity.} A {\em hypergraph} $\mathcal{H}$ is a finite set of finite sets, called {\em edges}. We denote by $V(\mathcal{H}) = \bigcup_{e \in \mathcal{H}} e$ the set of vertices of hypergraph $\mathcal{H}$. Most notions on graphs may be naturally generalized to hypergraph. A hypergraph $\mathcal{H}'$ is a subhypergraph of $\mathcal{H}$ if $\mathcal{H}' \subseteq \mathcal{H}$. Given $S \subseteq V(\mathcal{H})$, we denote by $\mathcal{H} \setminus S = \{e \setminus S \mid e \in \mathcal{H}\}$. A {\em walk} of length $n$ from edge $e \in \mathcal{H}$ to $f \in \mathcal{H}$ is a sequence $(e_1,x_1, \dots, x_n, e_{n+1})$ of vertices and edges such that: $e = e_0$, $f = e_{n+1}$ and for every $i \leq n$, $x_i \in e_i \cap e_{i+1}$. A {\em path} is a walk that never goes twice through the same vertex nor the same edge. It is easy to check that if there is a walk from $e$ to $f$ in $\mathcal{H}$, then there is also a path from $e$ to $f$. There exist several generalizations of acyclicity to hypergraph introduced by Fagin~\cite{Fagin83} in the context of database query answer. An extensive presentation of hypergraph acyclicity notions may be found in~\cite{BraultB14}. In this paper, we focus on the $\beta$-acyclicity, which is the most general of such notions for which $\sSAT$ is still tractable. A hypergraph $\mathcal{H}$ is $\beta$-acyclic if there exists an order $(x_1,\dots,x_n)$ of $V(\mathcal{H})$ such that for all $i \leq n$, for all $e,f \in \mathcal{H}$ such that $x_i \in e \cap f$, then either $e \setminus \{x_1,\dots, x_i\} \subseteq f$ or $f \setminus \{x_1,\dots, x_i\} \subseteq e$. Such an order is called a $\beta$-elimination order of $\mathcal{H}$. A $\beta$-acyclic hypergraph can be found on Figure~\ref{fig:hexdec}. The order $\{1,2,3,4,5\}$ is an $\beta$-elimination order. \begin{figure} \centering \begin{tikzpicture}[scale=0.7, every node/.style={scale=0.8}] \draw (0,1) ellipse (1.5 and 0.5); \node (x5) at (0,1) {$5$}; \node (x3) at (1,0) {$3$}; \node (x4) at (1,1) {$4$}; \node (x2) at (-1,1) {$2$}; \node (x1) at (-1,0) {$1$}; \draw (x1) -- (x2) -- (x5) -- (x4) -- (x3); \node (H45) at (0,-0.5) {$\mathcal{H}_{e_5}^4 = \mathcal{H}$}; \end{tikzpicture} ~~~~ \begin{tikzpicture}[scale=0.7, every node/.style={scale=0.8}] \draw (0,1) ellipse (1.5 and 0.5); \node (x5) at (0,1) {$5$}; \node (x4) at (1,1) {$4$}; \node (x2) at (-1,1) {$2$}; \node (x1) at (-1,0) {$1$}; \draw (x1) -- (x2) -- (x5) -- (x4); \node (H45) at (0,-0.5) {$\mathcal{H}_{e_5}^3$}; \end{tikzpicture} ~~~~ \begin{tikzpicture}[scale=0.7, every node/.style={scale=0.8}] \node (x3) at (0,0) {$3$}; \node (x4) at (0,1) {$4$}; \draw (x4) -- (x3); \node (H35) at (0.7,-0.5) {$\mathcal{H}_{e_2}^3$}; \end{tikzpicture} \caption{An example of $\mathcal{H}_e^x$} \label{fig:hexdec} \end{figure} Given a hypergraph $\mathcal{H}$, the incidence graph of $\mathcal{H}$ is defined as the bipartite graph whose vertices are $V(\mathcal{H}) \cup \mathcal{H}$ and there is an edge between $e \in \mathcal{H}$ and $x \in V(\mathcal{H})$ if and only if $x \in e$. The {\em incidence $\mathsf{MIM}\text{-width}$} of a hypergraph is the $\mathsf{MIM}\text{-width}$ of its incidence graph. The incidence $\mathsf{MIM}\text{-width}$ of $\beta$-acyclic hypergraphs can be very large: \begin{theorem}[\cite{BraultCM15}] \label{thm:betavsmm} There exists an infinite family of $\beta$-acyclic hypergraphs of incidence $\mathsf{MIM}\text{-width}$ $\Omega(n)$ where $n$ is the number of vertices of the hypergraph. \end{theorem} \subsection{Structure of formulas.} Let $F$ be a $\CNF$-formula. The {\em incidence graph} of $F$, denoted by $\calG_{\mathsf{inc}}(F)$, is the bipartite graph whose vertices are the variables and the clauses of $F$ and there is an edge between a variable $x$ and a clause $C$ if and only if $x \in \mathsf{var}(C)$. The {\em incidence $\mathsf{MIM}\text{-width}$} of a formula $F$ is the $\mathsf{MIM}\text{-width}$ of $\calG_{\mathsf{inc}}(F)$. The hypergraph of $F$, denoted by $\mathcal{H}(F)$, is defined as $\mathcal{H}(F) = \{\mathsf{var}(C) \mid C \in F\}$. A $\CNF$-formula is said to be {\em $\beta$-acyclic} if and only if its hypergraph is $\beta$-acyclic. \subsection{Knowledge compilation} \paragraph{DNNF.}In this paper we focus on so-called $\mathsf{DNNF}$ introduced by Darwiche~\cite{Darwich01}. An extensive presentation of different target languages with their properties may be found in \cite{DarwicheM2002}. A Boolean circuit $C$ on variables $X$ is in {\em Negation Normal Form}, $\mathsf{NNF}$ for short, if its input are labeled by literals on $X$ and its internal gates are labeled with either a $\wedge$-gate or a $\vee$-gate. We assume that such circuit has a distinguished gate called the {\em output}. An $\mathsf{NNF}$ circuit $D$ computes the boolean function computed by its output gate and we will often identify the circuits and its computed Boolean function. We denote by $\textsf{size}(D)$ the number of gates of $D$ and by $\mathsf{var}(D)$ the set of variables labeling its input. If $v$ is a gate of $D$, we denote by $D_v$ the circuit given by the maximal the sub-circuits of $D$ rooted in $v$ and whose output is $v$. If $v$ is an $\wedge$-gate, it is said {\em decomposable} if for every $v_1,v_2$ that are distinct inputs of $v$, it holds that $\mathsf{var}(D_{v_1}) \cap \mathsf{var}(D_{v_2}) = \emptyset$. An $\mathsf{NNF}$ circuit is in {\em Decomposable Normal Form} if all its $\wedge$-gates are decomposable. We will refer to such circuits as $\mathsf{DNNF}$. It is easy to see that one can find a satisfying assignment of a $\mathsf{DNNF}$ $D$ in time $O(\textsf{size}(D))$. Moreover, if $D$ is a $\mathsf{DNNF}$ on variables $X$, $Y \subseteq X$ and $\tau \in \{0,1\}^Y$, then $D[\tau]$ is computed by a $\mathsf{DNNF}$ smaller than $D$ since we can plug the values of literals in $Y$ in the circuit $D$. \paragraph{Deterministic and Decision DNNF.} Let $D$ be a $\mathsf{DNNF}$. An $\vee$-gate in $D$ is called {\em deterministic} if for every $v_1,v_2$ that are distinct inputs of $v$, it holds that $D_{v_1} \land D_{v_2} \equiv 0$. $D$ is said deterministic if all its $\vee$-gates are deterministic. Observe that determinism is a semantic condition and is hard to decide from the $\mathsf{DNNF}$ only. In this paper, we will be mostly interested in {\em decision} gates that are a special case of deterministic gates. An $\vee$-gate $v$ of $D$ is a {\em decision gate} if it is binary and if there exists a variable $x$ and two gates $v_1, v_2$ of $D$ such that $v$ is of the form $(x \land v_1) \lor (\neg x \land v_2)$. A {\em decision $\mathsf{DNNF}$}, $\mathsf{dec}\text{-}\mathsf{DNNF}$ for short, is a $\mathsf{DNNF}$ for which every $\vee$-gate is a decision gate. It is easy to see that a $\mathsf{dec}\text{-}\mathsf{DNNF}$ is deterministic. Figure~\ref{fig:dnnf} depicts a $\mathsf{DNNF}$. The output is represented by a square and the $\mathsf{DNNF}$ computes the boolean function $(\neg x \land z) \lor (x \land (y \lor z))$. It is easy to check that both $\land$-gates are decomposable. The output gate is also a decision gate on variable $x$. The other $\vee$-gate is not deterministic since the boolean function $y \land z$ is satisfiable. \begin{figure} \centering \begin{tikzpicture}[scale=0.5, every node/.style={scale=0.9}] \node[draw] (r) at (0,0) {$\vee$}; \node (a1) at (-1,-1) {$\wedge$}; \node (a2) at (1,-1) {$\wedge$}; \node (r2) at (0,-2) {$\vee$}; \node (x) at (-2,-2) {$x$}; \node (nx) at (2,-2) {$\neg x$}; \draw (x) -- (a1); \draw (nx) -- (a2); \node (y) at (-1,-3) {$y$}; \node (z) at (1,-3) {$z$}; \draw (y) -- (r2) -- (z); \draw (r) -- (a1) -- (r2); \draw (z) -- (a2) -- (r); \end{tikzpicture} \begin{tikzpicture}[scale=0.5] \node (y) at (-1,-1) {$y$}; \node (z) at (1,-1) {$z$}; \node (x) at (3,-1) {$x$}; \draw (y) -- (0,0) -- (z); \draw (0,0) -- (1,1) -- (x); \end{tikzpicture} \caption{A $\mathsf{DNNF}$ and a vtree} \label{fig:dnnf} \end{figure} \paragraph{Structuredness.} Structuredness is a constraint on the way variables can be partitioned by a $\mathsf{DNNF}$. It may be seen as a generalization to trees of the variable ordering that is sometimes required in data structures such as OBDD~\cite{Wegener00} and was introduced in~\cite{PipatsrisawatD08}. Let $D$ be a $\mathsf{DNNF}$ on variables $X$. A {\em vtree} $T$ on $X$ is a binary tree whose leaves are in one-to-one correspondence with $X$. An $\land$-gate $v$ of $D$ {\em respects} a vertex $t$ of $T$ if it has exactly two inputs $v_1,v_2$ and if $\mathsf{var}(D_{v_1}) \subseteq X_{t_1}$ and $\mathsf{var}(D_{v_2}) \subseteq X_{t_2}$ where $t_1,t_2$ are the children of $t$ in $T$ and $X_{t_1}$ (resp. $X_{t_2}$) is the set of variables that appears in the leaves of $T_{t_1}$ (resp. $T_{t_2}$). A $\mathsf{DNNF}$ $D$ respects a vtree $T$ if for every $\land$-gate $v$ of $D$, there exists a vertex $t$ of $T$ such that $v$ respects $t$. A $\mathsf{DNNF}$ $D$ is {\em structured} if there exists a vtree $T$ such that $D$ respects $T$. It can be checked that the $\mathsf{DNNF}$ depicted in Figure~\ref{fig:dnnf} respects the vtree given on the same figure. \subsection{Structuredness and Branch Decomposition} \label{sec:sbd} In this section, we explain how most of the structure-based algorithms for $\sSAT$ work and how we can relate this to the fact that they are implicitly constructing a structured $\mathsf{DNNF}$ equivalent to the input formula. The current techniques for solving $\sSAT$ by exploiting the structure of the input are all based on the same technique: they start by computing a ``good'' branch decomposition $T$ of the incidence graph of the formula $F$. Each vertex $t$ of the branch decomposition is then used to define a sub-formula $F_t$ and partial assignments $a_1,\dots,a_k$ of its variables. The number of solutions of $F_t[a_i]$ is then computed by dynamic programming along the branch decomposition in a bottom-up fashion. In all algorithms, the variables of $F_t$ are the variables of $F$ that label the leaves of $T_t$. The number of solutions of $F_t$ on some partial assignment $a_i$ is computed by multiplying and summing the number of solutions of $F_{t_1}$ and of $F_{t_2}$, where $t_1,t_2$ are the children of $t$ on restrictions of $a_i$ to the variables of $F_{t_1}$ and $F_{t_2}$ respectively. Those multiplications can be seen as a decomposable $\land$-gate and the sums can be seen as deterministic $\lor$-gates. Thus, the underlying $\mathsf{DNNF}$ constructed by those algorithms is naturally structured along the vtree obtained from the branch decomposition $T$ by forgetting the leaves that are labeled by clauses of the formula. In this paper, we will thus say that a class of formula can be solved by using the {\em standard (dynamic programming) technique} if it can be compiled into deterministic structured $\mathsf{DNNF}$. The most general known algorithm exploiting the structure of the input, that we will call, from the author names, the {\em STV-algorithm}~\cite{SaetherTV14}, uses exactly this technique. It has been observed in~\cite{BovaCMS15} that this algorithm is actually implicitly constructing a deterministic structured $\mathsf{DNNF}$ equivalent to the input $\CNF$-formula, which reinforces the idea that the notion of structuredness captures the essence of the standard technique for solving $\sSAT$. \section{Compilation of $\beta$-acyclic formulas into $\mathsf{dec}\text{-}\mathsf{DNNF}$} \label{sec:comp} We show how to construct a linear size $\mathsf{dec}\text{-}\mathsf{DNNF}$ equivalent to a given $\beta$-acyclic formula $F$ (Theorem~\ref{thm:compileexists}). We use a dynamic programming approach by iteratively constructing $\mathsf{dec}\text{-}\mathsf{DNNF}$ for subformulas of $F$. These subformulas are defined using general remarks on the structure of $\beta$-acyclic hypergraphs. \subsection{Structure of $\beta$-acyclic hypergraphs.} \label{sec:structbh} In this section, we fix a $\beta$-acyclic hypergraph $\mathcal{H}$ with $n$ vertices and a $\beta$-elimination order $(x_1,\dots,x_n)$ of its vertices denoted by $<$. We denote by $<_\mathcal{H}$ the order on $\mathcal{H}$ defined as the lexicographical order on $\mathcal{H}$ where $e \in \mathcal{H}$ is seen as the $\{0,1\}^n$-vector $\vec{e}$ such that $\vec{e}_i = 1$ if $x_{n-i} \in e$ and $\vec{e}_i = 0$ otherwise. In other words, $e <_\mathcal{H} f$ if and only if $\max (e \Delta f) \in f$. From these orders, we construct a family of subhypergraphs of $\mathcal{H}$ which will be interesting for us later. Let $x \in V$ and $e \in \mathcal{H}$. We denote by $\Vle{x} = \{y \in V \mid y \leq x\}$. $\Vlt{x}$, $\Vge{x}$ and $\Vgt{x}$ are defined similarly. We denote by $\mathcal{H}_e^x$ the subhypergraph of $\mathcal{H}$ that contains the edges $f \in \mathcal{H}$ such that there is a walk from $f$ to $e$ that goes only through edges smaller than $e$ and vertices smaller than $x$. Observe that, by definition, $\mathcal{H}_e^x$ is a connected subhypergraph of $\mathcal{H}$, with $e \in \mathcal{H}_e^x$ and for all $f \in \mathcal{H}_e^x$, $f \leq_\mathcal{H} e$. Observe also that even if there is a walk from $f \in \mathcal{H}_e^x$ to $e$ that goes only through vertices smaller than $x$, $f$ may hold vertices that are bigger than $x$. We insist on the fact that the whole edge $f$ is in $\mathcal{H}_e^x$ and not only its restriction to $\Vle{x}$. We start by giving an example. Let $\mathcal{H} = \{\{1,2\}, \{3,4\}, \{2,5\}, \{4,5\}, \{2,4,5\}\}$ be the hypergraph depicted on Figure~\ref{fig:hexdec}. One can easily check that $1 < 2 < 3 < 4 < 5$ is a $\beta$-elimination order and that the order $<_\mathcal{H}$ is the following: $e_1 = \{1,2\} <_\mathcal{H} e_2 = \{3,4\} <_\mathcal{H} e_3 = \{2,5\} <_\mathcal{H} e_4 = \{4,5\} <_\mathcal{H} e_5 = \{2,4,5\}$. $\mathcal{H}_{e_5}^4$ is the whole hypergraph since one can reach any edge from $e_5$ by going through vertices smaller than $4$. $\mathcal{H}_{e_5}^3$ however is lacking the edge $e_2 = \{3,4\}$ since the only way of reaching $e_2$ from $e_5$ is to go through the vertex $4$ which is not allowed. Observe that these subhypergraphs are naturally ordered by inclusion: \begin{lemma} \label{lem:hexinc} Let $x,y \in V(\mathcal{H})$ such that $x \leq y$ and $e,f \in \mathcal{H}$ such that $e \leq_\mathcal{H} f$ and $V(\mathcal{H}_e^x) \cap V(\mathcal{H}_f^y) \cap \Vle{x} \neq \emptyset$. Then $\mathcal{H}_e^x \subseteq \mathcal{H}_f^y$. In particular, for all $y$, if $e \in \mathcal{H}_f^y$ then $\mathcal{H}_e^y \subseteq \mathcal{H}_f^y$. \end{lemma} \begin{proof} Let $z \in V(\mathcal{H}_e^x) \cap V(\mathcal{H}_f^y) \cap \Vle{x}$ and let $g_1 \in \mathcal{H}_e^x$ and $g_2 \in \mathcal{H}_f^y$ be such that $z \in g_1 \cap g_2$. By definition, there exists a walk $\mathcal{P}_1$ from $f$ to $g_2$ going through vertices smaller than $y$ and edges smaller than $f$ and a walk $\mathcal{P}_2$ from $g_1$ to $e$ going through vertices smaller than $x$ and edges smaller than $e$. Since $z \leq x \leq y$ and $e \leq_\mathcal{H} f$, $\mathcal{P} = (\mathcal{P}_1, z, \mathcal{P}_2)$ is a walk from $f$ to $e$ going through edges smaller than $f$ and vertices smaller than $y$, that is $e \in \mathcal{H}_f^y$. Now let $h \in \mathcal{H}_e^x$ and let $\mathcal{P}_3$ be a path from $e$ to $h$ going through vertices smaller than $x$ and edges smaller than $e$. Then $(\mathcal{P},\mathcal{P}_3)$ is a walk from $f$ to $h$ going through vertices smaller than $y$ and edges smaller than $f$. That is $h \in \mathcal{H}_f^y$, so $\mathcal{H}_e^x \subseteq \mathcal{H}_f^y$. \end{proof} We now state the main result of this section. Theorem~\ref{thm:hexvar} relates the variables of $\mathcal{H}_e^x$ to those of $\Vge{x}$ and $e$. This is crucial for the dynamic programming scheme of our algorithm: \begin{theorem} \label{thm:hexvar} For every $x \in V$ and $e \in \mathcal{H}$, $V(\mathcal{H}_e^x) \cap \Vge{x} \subseteq e$. \end{theorem} In order to prove Theorem~\ref{thm:hexvar}, we need two easy intermediate lemmas: \begin{lemma} \label{lem:ordervar} Let $e,f \in \mathcal{H}$ such that there exists $x \in e \cap f$. If $e <_\mathcal{H} f$ then $e \cap \Vge{x} \subseteq f$. \end{lemma} \begin{proof} By definition of $\beta$-acyclic elimination order, we must have either $e \cap \Vge{x} \subseteq f \cap \Vge{x}$ or $f \cap \Vge{x} \subseteq e \cap \Vge{x}$. Now since $e <_\mathcal{H} f$, we have $m = \max(e \Delta f) \in f$. If $m \leq x$, we have $e \cap \Vge{x} = f \cap \Vge{x}$. Otherwise, we have $e \cap \Vge{x} \subseteq f \cap \Vge{x}$ since $m \in (f \setminus e) \cap \Vge{x}$. \end{proof} A path $\mathcal{P} = (e_0,x_0,\dots,x_{n-1},e_n)$ in $\mathcal{H}$ is called {\em decreasing} if for all $i$, $e_i >_\mathcal{H} e_{i+1}$ and $x_i > x_{i+1}$. \begin{lemma} \label{lem:pathdecrease} For every $x \in V$, $e \in \mathcal{H}$ and $f \in \mathcal{H}_e^x$, there exists a decreasing path from $e$ to $f$ going through vertices smaller than $x$. \end{lemma} \begin{proof} By definition of $\mathcal{H}_e^x$, there exists a path $\mathcal{P} = (e_0,x_0,\dots,x_{n-1},e_n)$ with $e_0 = e$ and $e_n = f$ such that for all $i \leq n$, $e_i \leq_\mathcal{H} e$ and $x_i \leq x$. We show that if $\mathcal{P}$ is a shortest path among those going through vertices smaller than $x$, then it is also decreasing. Assume toward a contradiction that $\mathcal{P}$ is a non-decreasing such shortest path. Remember that by definition of paths, the edges $(e_i)$ are pairwise distinct. The same is true for the vertices $(x_i)$. Moreover, observe that since $\mathcal{P}$ is a shortest path, then it holds that: \begin{equation} \label{quote:short} \forall i < n \forall j \notin \{i,i+1\}, x_i \notin e_j. \tag{$\star$} \end{equation} Indeed, if there exists $i$ and $j \notin \{i,i+1\}$ such that $x_i \in e_j$, $\mathcal{P}$ could be shortened by going directly from $e_i$ to $e_j$ if $j > i+1$ or from $e_j$ to $e_{i+1}$ if $j < i$. Let $i = \min \{j \mid x_{j+1} > x_j \text{ or } e_{j+1} >_\mathcal{H} e_j \}$ be the first indices where $\mathcal{P}$ does not respect the decreasing condition, which exists if $\mathcal{P}$ is not decreasing by assumption. First assume $i = 0$. By definition of $\mathcal{P}$, $e_0 = e >_\mathcal{H} e_1$. Thus it must be that $x_0 < x_1$. By definition, $x_0 \in e_0 \cap e_1$ and by Lemma~\ref{lem:ordervar}, $e_1 \cap \Vge{x_0} \subseteq e_0$. Since $x_1 > x_0$, $x_1 \in e_1 \cap \Vge{x_0}$, thus $x_1 \in e_0$ which contradicts~(\ref{quote:short}). Now assume $i > 0$. First, assume that $e_{i+1} >_\mathcal{H} e_i$. By definition of $\mathcal{P}$, it holds that $x_i \in e_i \cap e_{i+1}$ and then by Lemma~\ref{lem:ordervar}, $e_i \cap \Vge{x_i} \subseteq e_{i+1}$. Now observe that by minimality of $i$, $x_{i-1} > x_i$. Since $x_{i-1} \in e_i$, $x_{i-1} \in e_i \cap \Vge{x_i} \subseteq e_{i+1}$, which contradicts~(\ref{quote:short}). Otherwise, $e_i >_\mathcal{H} e_{i+1}$ and then $x_{i+1} > x_i$. By Lemma~\ref{lem:ordervar} again, $e_{i+1} \cap \Vge{x_i} \subseteq e_i$. Since $x_{i+1} \in e_{i+1}$, this implies that $x_{i+1} \in e_{i+1} \cap \Vge{x_i} \subseteq e_i$, which contradicts~(\ref{quote:short}). It follows that such $i$ does not exist, that is, $\mathcal{P}$ is decreasing. \end{proof} \begin{proof}[Proof (of Theorem~\ref{thm:hexvar}).] We show by induction on $n$ that for any decreasing path $\mathcal{P} = (e_0,x_0,\dots, e_n)$ from $e_0$ to $e_n$, we have $e_0 \supseteq e_n \cap \Vge{x_0}$. If $n = 0$, then $e_n = e_0$ and the inclusion is obvious. Now, let $\mathcal{P} = (e_0,x_0,\dots,e_n,x_n,e_{n+1})$. By induction, $e_0 \supseteq e_n \cap \Vge{x_0}$ since $(e_0,x_0,\dots,e_n)$ is a decreasing path from $e_0$ to $e_n$. Now by Lemma~\ref{lem:ordervar}, since $x_n \in e_{n+1} \cap e_n$ and $e_{n+1}<_\mathcal{H} e_n$, we have $e_{n+1} \cap \Vge{x_n} \subseteq e_n$. Since $x_0>x_n$, $e_{n+1} \cap \Vge{x_0} \subseteq e_{n+1} \cap \Vge{x_n} \subseteq e_n$. Thus $e_{n+1} \cap \Vge{x_0} \subseteq e_n \cap \Vge{x_0} \subseteq e_0$ which concludes the induction. Now let $e \in \mathcal{H}$, $x \in V(\mathcal{H})$ and $f \in \mathcal{H}_e^x$. By Lemma~\ref{lem:pathdecrease}, there exists a decreasing path from $e$ to $f$ going through vertices smaller than $x$. From what precedes, $f \cap \Vge{x} \subseteq e$. Therefore $V(\mathcal{H}_e^x) \cap \Vge{x} \subseteq e$. \end{proof} \subsection{Constructing the $\mathsf{dec}\text{-}\mathsf{DNNF}$.} \label{sec:exdecdnnf} Given a $\CNF$-formula $F$ with hypergraph $\mathcal{H}$, we can naturally define a family of subformulas $F_e^x$ from $\mathcal{H}_e^x$ as the conjunction of clauses corresponding to the edges in $\mathcal{H}_e^x$, that is $F_e^x = \{C \in F \mid \mathsf{var}(C) \in \mathcal{H}_e^x\}$. Theorem~\ref{thm:hexvar} implies in particular that $\mathsf{var}(F_e^x) \subseteq (e \cup \Vlt{x})$. Thus, if $\tau$ is an assignment of variables $(e \cap \Vgt{x})$, then $F_e^x[\tau]$ has all its variables in $\Vle{x}$. We will be particularly interested in such assignments: for a clause $C \in F$, denote by $\tau_C$ the only assignment of $\mathsf{var}(C)$ such that $\tau_C \not \models C$ and by $\tau_C^x := \tau_C |_{\Vgt{x}}$. We construct a $\mathsf{dec}\text{-}\mathsf{DNNF}$ $D$ by dynamic programming such that for each clause $C$ with $\mathsf{var}(C) = e$ and variable $x \in V$, there exists a gate in $D$ computing $F_e^x[\tau_C^x]$, which is a formula with variables in $\Vle{x}$. Lemma~\ref{lem:fexplode} and Corollary~\ref{cor:fexplode} describe everything needed for the dynamic programming algorithm by expressing $F_e^x$ as a decomposable conjunction of precomputed values. \begin{lemma} \label{lem:fexplode} Let $x \in \mathsf{var}(F)$ such that $x \neq x_1$ and let $y \in \mathsf{var}(F)$ be the predecessor of $x$ for $<$. Let $e \in \mathcal{H}(F)$ and $\tau: (e \cap V_{\geq x}) \rightarrow \{0,1\}$. Then either $F_e^x[\tau] \equiv 1$ or there exists $U \subseteq \mathcal{H}_e^x$ and for all $g \in U$ a clause $C(g) \in F_e^x$ with $\mathsf{var}(C(g)) = g$ such that \[F_e^x[\tau] \equiv \bigwedge_{g \in U} F_{g}^y[\tau_{C(g)}^y].\] Moreover, this conjunction is decomposable and $U$ can be found in polynomial time in $\textsf{size}(F)$. \end{lemma} \begin{proof} Assume first that for all $C \in F_e^x$, $\tau \models C$. Thus $F_e^x[\tau] \equiv 1$ since every clause of $F_e^x$ is satisfied by $\tau$. Now assume that there exists $C \in F_e^x$ is such that $\tau \not \models C$. This means that $\tau \simeq \tau_C$. We let $A = \{\mathsf{var}(C) \mid C \in F_e^x \text{ and } \tau \not \models C\} \neq \emptyset$ by assumption. Observe that \[F_e^x[\tau] \equiv \bigwedge_{\substack{C \in F_e^x \\ \mathsf{var}(C) \in A}} C[\tau] \] since for every $C \in F_e^x$, if $\mathsf{var}(C) \notin A$, $\tau \models C$ by construction of $A$. Let $U = \{g \in A \mid \forall f \in A \setminus \{g\}, g \notin \mathcal{H}_{f}^y \}$. For each $g \in U$, we choose an arbitrary clause $C(g)$ such that $\mathsf{var}(C(g)) = g$ and $\tau \not \models C(g)$. Such a clause exists since $U \subseteq A$. We claim that $U$ meets the conditions given in the statement of the lemma. We start by observing that $U$ can be computed in polynomial time in $\textsf{size}(F)$. Indeed, computing $F_e^x$ for all $e,x$ can be done in polynomial time as it boils down to a computation of connected component in a hypergraph. Now to compute $A$, it is enough to test for every $C \in F_e^x$ that $\tau \not \models C$ which can be done in polynomial time in $\textsf{size}(F)$. Finally, extracting $U$ from $A$ can also be done in polynomial time by testing for every $g \in A$ if $g$ respects the given condition: it is enough to test for every $f \in A \setminus \{g\}$ if $g \notin \mathcal{H}_f^y$, which is possible since we can compute $\mathcal{H}_f^y$ easily. Now let $f \in A$. We show that there exists $g \in U$ such that $f \in \mathcal{H}_g^y$. If $f \in U$, then we are done since $f \in \mathcal{H}_f^y$. Now assume that $f \notin U$. By definition of $U$, $B = \{g \in A \setminus \{f\} \mid f \in \mathcal{H}_{g}^y \} \neq \emptyset$. We choose $g$ to be the maximum of $B$ for $\leq_\mathcal{H}$. We claim that $g \in U$. Indeed, assume there exists $g' \in A$ such that $g \in \mathcal{H}_{g'}^y$ and $g < g'$. By Lemma~\ref{lem:hexinc}, $\mathcal{H}_g^y \subseteq \mathcal{H}_{g'}^y$ and since $f \in \mathcal{H}_g^y$, we also have $f \in \mathcal{H}_{g'}^y$, that is, $g' \in B$. Yet, $g = \max(B)$ and $g \leq g'$, that is, $g = g'$. Thus $g \in U$. We thus have proved that for all $f \in A$, there exists $g \in U$ such that $f \in \mathcal{H}_g^y$. Thus if $C$ is a clause of $F_e^x$, either $\mathsf{var}(C) \notin A$ and then $\tau \models C$ by definition of $A$, or $\mathsf{var}(C) \in A$, then there exists $g \in U$ such that $\mathsf{var}(C) \in \mathcal{H}_g^y$, that is, $C \in F_g^y$. Now, if $C \in F_g^y$ for some $g \in U$, then $C \in F_e^x$ too since by Lemma~\ref{lem:hexinc}, $F_g^y \subseteq F_e^x$. Thus \[ F_e^x[\tau] \equiv \bigwedge_{g \in U} F_g^y[\tau]. \] Let $g \in U$. We show that $\tau|_{\mathsf{var}(F_g^y)} = \tau_{C(g)}^y$. Observe that by Theorem~\ref{thm:hexvar}, $\mathsf{var}(F_g^y) \cap \Vge{x} = V(\mathcal{H}_g^y) \cap \Vge{x} \subseteq g \cap \Vge{x}$. Since $\tau$ assigns variables from $e \cap \Vge{x}$: \[ \begin{aligned} \tau|_{\mathsf{var}(F_g^y)} & = \tau |_{\mathsf{var}(F_g^y) \cap \Vge{x} \cap e} \\ & = \tau |_{g \cap \Vge{x} \cap e} \end{aligned} \] Moreover, since $g \in \mathcal{H}_e^x$, we have $g \cap \Vge{x} \subseteq e \cap \Vge{x}$ by Theorem~\ref{thm:hexvar} again. Thus $g \cap \Vge{x} \cap e = g \cap \Vge{x}$. In other words, $\tau|_{\mathsf{var}(F_g^y)} = \tau |_{g \cap \Vge{x}}$. Since $\tau$ assigns all variables of $e \cap \Vge{x}$ by assumption, $\tau |_{g \cap \Vge{x}}$ assigns all variables of $g \cap \Vge{x}$. Finally, since $\tau \not \models C(g)$ by construction of $C(g)$, we have $\tau \simeq \tau_{C(g)}^y$. Since by definition $\mathsf{var}(C(g)) = g$, it follows that $\tau|_{\mathsf{var}(F_g^y)} = \tau_{C(g)}^y$. So far, we have proven that \[ F_e^x[\tau] \equiv \bigwedge_{g \in U} F_g^y[\tau_{C(g)}^y]. \] It remains to show that this conjunction is decomposable, that is, for all $g_1, g_2 \in U$, $\mathsf{var}(F_{g_1}^y[\tau_{C(g_1)}^y]) \cap \mathsf{var}(F_{g_2}^y[\tau_{C(g_2)}^y]) = \emptyset$. Let $g_1,g_2 \in U$ with $g_1 <_\mathcal{H} g_2$ and assume there exists $z \in \mathsf{var}(F_{g_1}^y[\tau_{C(g_1)}^y]) \cap \mathsf{var}(F_{g_2}^y[\tau_{C(g_2)}^y])$, that is, $z \in \mathsf{var}(F_{g_1}^y) \cap \mathsf{var}(F_{g_2}^y) \cap \Vle{y}$. From what precedes, $\tau$ assigns every variable of $F_{g_1}^y$ greater than $x$. By Lemma~\ref{lem:hexinc}, we have $F_{g_1}^y \subseteq F_{g_2}^y$, which contradicts the fact that $g_1 \in U$. \end{proof} \begin{corollary} \label{cor:fexplode} Let $x \in \mathsf{var}(F)$ such that $x \neq x_1$ and let $y \in \mathsf{var}(F)$ be the predecessor of $x$ for $<$. For every $C \in \mathcal{H}(F)$, there exist $U_0,U_1 \subseteq \mathcal{H}_{\mathsf{var}(C)}^x$ and for all $g \in U_0 \cup U_1$ a clause $C(g) \in F_{\mathsf{var}(C)}^x$ with $\mathsf{var}(C(g)) = g$ such that \[F_{\mathsf{var}(C)}^x[\tau_C^x] \equiv (x \land \bigwedge_{g \in U_1} F_{g}^y[\tau_{C(g)}^y]) \lor (\neg x \land \bigwedge_{g \in U_0} F_{g}^y[\tau_{C(g)}^y]).\] Moreover, all conjunctions are decomposable and $U_0,U_1$ can be found in polynomial time in $\textsf{size}(F)$. \end{corollary} \begin{proof} Let $\tau_1 = \tau_C^x \cup \{x \mapsto 1 \}$ and $\tau_0 = \tau_C^x \cup \{x \mapsto 0 \}$. We observe that \[ F_{\mathsf{var}(C)}^x[\tau_C^x] = (x \land F_{\mathsf{var}(C)}^x[\tau_1]) \lor (\neg x \land F_{\mathsf{var}(C)}^x[\tau_0]).\] Clearly, $x \notin \mathsf{var}(F_{\mathsf{var}(C)}^x[\tau_1])$ and $x \notin \mathsf{var}(F_{\mathsf{var}(C)}^x[\tau_0])$, thus, both conjunctions are decomposable. Now, applying Lemma~\ref{lem:fexplode} on $F_{\mathsf{var}(C)}^x[\tau_0]$ and on $F_{\mathsf{var}(C)}^x[\tau_1]$ yields the desired decomposition. \end{proof} \begin{theorem} \label{thm:compileexists} Let $F$ be a $\beta$-acyclic $\CNF$-formula. One can construct in polynomial time in $\textsf{size}(F)$ a $\mathsf{dec}\text{-}\mathsf{DNNF}$ $D$ of size $O(\textsf{size}(F))$ and fanin at most $|\mathcal{H}|$ computing $F$. \end{theorem} \begin{proof} Let $\mathcal{H}$ be the hypergraph of $F$ and $<$ a $\beta$-elimination order. Let $\mathsf{var}(F) = \{x_1, \dots, x_n\}$ where $x_i < x_j$ if and only if $i<j$. We construct by induction on $i$ a $\mathsf{dec}\text{-}\mathsf{DNNF}$ $D_i$ of fanin $|\mathcal{H}|$ at most such that for each $e \in \mathcal{H}$, $C \in F$ such that $\mathsf{var}(C) = e$ and $j \leq i$, there exists a gate in $D_i$ computing $F_e^{x_j}[\tau_C^{x_j}]$ and $|D_i| \leq 7 \cdot (\sum_{j=1}^i c(x_j))$ where $c(x_j)$ is the number of clauses in $F$ holding $x_j$. We start by explaining how $D_1$ is constructed. Let $e \in \mathcal{H}$. If $x_1 \notin e$, then $F_e^{x_1}$ contains only the clauses $C$ such that $e = \mathsf{var}(C)$. For such a $C$, $\tau_C^{x_1} = \tau_C$, thus $F_e^{x_1}[\tau_C] = 0$. Now, if $x_1 \in e$, $F_e^{x_1}$ contains only clauses $D$ such that $x_1 \in \mathsf{var}(D) \subseteq e$ since $x_1$ is the first element of the elimination order. Let $C$ be a clause such that $\mathsf{var}(C) = e$. For every $D \in F_e^{x_1}$, $\mathsf{var}(D) \subseteq \mathsf{var}(C)$, thus $F_e^{x_1}[\tau_C^{x_1}]$ has only one variable: $x_1$. Thus $F_e^{x_1}[\tau_C^{x_1}]$ is equivalent to either $x_1$, $\neg x_1$ or $0$. We thus define $D_1$ to be the $\mathsf{dec}\text{-}\mathsf{DNNF}$ with at most three gates $x_1, \neg x_1$ and $0$, which are input gates. We have $|D_1| \leq 3 \leq 7 \cdot c(x_1)$. Now lets assume $D_i$ is constructed. To ease notations, let $x = x_{i+1}$. Let $e \in \mathcal{H}$ and $C$ be a clause such that $\mathsf{var}(C) = e$. We want to add a gate in $D_i$ that will compute $F_e^x[\tau_C^x]$. If $x \notin e$, then $\mathcal{H}_e^x = \mathcal{H}_e^{x_i}$ since by Theorem~\ref{thm:hexvar}, $\mathsf{var}(\mathcal{H}_e^{x_i}) \subseteq (e \cup \Vlt{x_i})$. Thus $F_e^x = F_e^{x_i}$ and $\tau_C^x = \tau_C^{x_i}$. Therefore, there is already a gate computing $F_e^x[\tau_C^x]$ in $D_i$. Assume now that $x \in e$. By Corollary~\ref{cor:fexplode}, we can compute $F_{\mathsf{var}(C)}^x[\tau_C^x]$ for every $C$ with $\mathsf{var}(C) = e$ by adding at most one decision-gate and a fanin $|\mathcal{H}|$ decomposable and-gate to $D_i$ since for all values appearing in the statement of Corollary~\ref{cor:fexplode} there exists a gate in $D_i$ computing it. Moreover such gate can be found in polynomial time. That is, we add to $D_i$ at most $7$ gates to compute $F_{\mathsf{var}(C)}^x[\tau_C^x]$. We have to do this for each $C \in F$ such that $x \in \mathsf{var}(C)$. We thus add at most $7c(x)$ gates in $D_i$. Thus $|D_{i+1}| \leq 7 \cdot \sum_{j\leq i+1} c(x_j)$. To conclude, assume that $\mathcal{H}$ is connected and let $e = \max(\mathcal{H})$. We have $\mathcal{H}_e^{x_n} = \mathcal{H}$ since there is a path from $e$ to every other edge in $\mathcal{H}$. Thus $F_e^{x_n} = F$. Let $C$ be a clause with $\mathsf{var}(C) = e$. The assignment $\tau_C^{x_n}$ is empty, thus $F_e^{x_n}[\tau_C^{x_n}] \equiv F$. Hence, there is a gate in $D_n$ that computes $F$ and $D_n$ is of size at most $7 \cdot \textsf{size}(F)$ and fanin $|\mathcal{H}|$ at most. Each step can be done in polynomial time in $\textsf{size}(F)$. If $\mathcal{H}$ is not connected, then each connected component of $\mathcal{H}$ is $\beta$-acyclic, thus we can compile them independently and take the decomposable conjunction of these $\mathsf{dec}\text{-}\mathsf{DNNF}$. \end{proof} We conclude this section by giving insights on the significance of Theorem~\ref{thm:compileexists} from a practical point of view. Most practical tools for $\sSAT$ are based on an algorithm called exhaustive DPLL with caching~\cite{HuangD05,sang04,thurley06,BacchusDP03} which works as follows: given $F$, the algorithm starts by trying to write $F$ as $F_1 \land F_2$ with $F_1$ and $F_2$ having no common variables. If it succeeds, it computes recursively $\#F_1$, $\#F_2$ and returns $\#F_1 \cdot \#F_2$. Otherwise, it chooses a variable $x$ and returns $\#F[x \mapsto 0]+\#F[x \mapsto 1]$. In addition, these tools use caching techniques to avoid redoing the same computation twice. It was observed in~\cite{HuangD05} that the trace of such algorithms is exactly a $\mathsf{dec}\text{-}\mathsf{DNNF}$. It is not hard to see that the construction given in Theorem~\ref{thm:compileexists} is the trace of a run of an exhaustive DPLL algorithm where the variables are chosen in a reverse $\beta$-elimination order. This shows that if the right elimination order of the variables is chosen (and this order can be computed greedily in polynomial time), then practical tools for solving $\sSAT$ can in theory solve $\beta$-acyclic formulas in polynomial time. \section{Deviation from the technique based on branch decompositions} \label{sec:deviation} In this section, we finally prove that standard techniques based on branch decompositions fail on $\beta$-acyclic formulas. Recall that we have defined in Section~\ref{sec:sbd} the standard technique to be the implicit construction of a polynomial size structured $\mathsf{DNNF}$ equivalent to the input formula. We formally prove the following: \begin{theorem} \label{thm:betalb} There exists an infinite family $\mathcal{F}$ of $\beta$-acyclic $\CNF$-formulas such that for every $F \in \mathcal{F}$ having $n$ variables, there is no structured $\mathsf{DNNF}$ of size less than $2^{\Omega(\sqrt{n})}$ computing $F$. \end{theorem} We use techniques based on communication complexity tools developed in~\cite{BovaCMS16} to prove lower bounds on the size of structured $\mathsf{DNNF}$. \begin{definition} Let $r$ be a boolean function on variables $X$ and let $(Y,Z)$ be a partition of $X$. The function $r$ is a $(Y,Z)$-rectangle if and only if for every $\tau,\tau' \in \{0,1\}^X$ such that $\tau \models r$ and $\tau' \models r$, we have $(\tau|_Y \cup \tau'|_Z) \models r$. A $(Y,Z)$-rectangle cover of a boolean function $f$ is a set $R=\{r_1,\dots,r_q\}$ of $(Y,Z)$-rectangles such that $\mathsf{sat}(f) = \bigcup_{i=1}^q \mathsf{sat}(r_i)$. \end{definition} \begin{theorem}[\cite{BovaCMS16},\cite{DarwicheP10}] \label{thm:rectlb} Let $D$ be a $\mathsf{DNNF}$ on variables $X$ respecting the vtree $T$. For every vertex $t$ of $T$, there exists a $(X_t,X \setminus X_t)$-rectangle cover of $D$ of size at most $|D|$, where $X_t = \mathsf{var}(T_t)$. \end{theorem} Given a $\CNF$-formula $F$, we define $\hat F$ to be the formula $\{K \cup \{c_K\} \mid K \in F\}$ on variables $\{c_K \mid K \in F \} \cup \mathsf{var}(F)$. Intuitively, $\hat F$ is the formula obtained by adding one fresh variable $c_K$ in each clause $K$ of $F$. Our main lower bound relates the incidence $\mathsf{MIM}\text{-width}$ of a monotone $\CNF$-formula to the size of structured $\mathsf{DNNF}$ computing $\hat{F}$. \begin{theorem} \label{thm:mmwlb} Let $F$ be a monotone formula of incidence $\mathsf{MIM}\text{-width}$ $k$. Any structured $\mathsf{DNNF}$ computing $\hat{F}$ is of size at least $2^{k/2}$. \end{theorem} The proof of Theorem~\ref{thm:mmwlb} heavily relies on the following lower bound and on Theorem~\ref{thm:rectlb}: \begin{lemma} \label{lem:matchlb} Let $X=\{x_1,\dots,x_k\}$ and $Y = \{y_1,\dots,y_k\}$ be two disjoint sets of $k$ variables. The number of $(X,Y)$-rectangles needed to cover the $\CNF$-formula $F = \bigwedge_{i=1}^k (x_i \lor y_i)$ is at least $2^k$. \end{lemma} \begin{proof} Let $\{R_1, \dots, R_q\}$ be a $(X,Y)$-rectangle cover of $F$. For $K \subseteq \{1,\dots,k\}$, we denote by $\tau_K$ the assignment such that $\tau_K(x_i) = 1$ if $i \in K$ and $0$ otherwise and $\tau_K(y_i) = 1-\tau_K(x_i)$. Observe that by definition, for every $K \subseteq \{1,\dots,k\}$, $\tau_K \models F$. We claim that if $\tau_K \models R_i$ then for any $K' \neq K$, we have $\tau_{K'} \not \models R_i$. For the sake of contradiction, assume there exist $K,K'$ such that $K \neq K'$, $\tau_K \models R_i$ and $\tau_{K'} \models R_i$. Without loss of generality, we can assume that there exists $i \in K \setminus K'$. By definition of rectangles, $\tau' = \tau_{K'}|_{X} \cup \tau_{K}|_Y \models R_i$. But $\tau'(x_i) = \tau'(y_i) = 0$ and then $\tau' \not \models F$ which contradicts the definition of $R_i$. Since there are $2^k$ different subsets of $\{1,\dots,k\}$ and each $\tau_K$ satisfies disjoint rectangles, we have that $q \geq 2^k$. \end{proof} \begin{proof}[Proof (of Theorem~\ref{thm:mmwlb}).] Let $G = \calG_{\mathsf{inc}}(F)$ and $D$ be a structured $\mathsf{DNNF}$ computing $\hat{F}$. We claim that $|D| \geq 2^{k/2}$. Let $T$ be the vtree respected by $D$. Observe that the variables of $\hat{F}$ are in one to one correspondence with $V(G)$ thus we can see $T$ as a branch decomposition of $G$. Since $G$ is of $\mathsf{MIM}\text{-width}$ $k$, there exists a vertex $t$ of $T$ such that there is an induced matching $M = \{(x_1,y_1), \dots, (x_q,y_q)\}$ with $q \geq k$ in $G[V_t, V(G) \setminus V_t]$ where $V_t$ denotes the labels of the leaves of $T_t$. Let $e = (x,y)$ be an edge of $M$. Since it is an edge of $G$, too, one end point of $e$ corresponds to a variable $x_e$ of $F$ and the other to a clause $c_e \in F$. Let $M'$ be the set of edges $e$ of $M$ such that $x_e \in V_t$ and $c_e \notin V_t$ and let $M''$ be the set of edges $e$ of $M$ such that $x_e \notin V_t$ and $c_e \in V_t$. It is readily verified that $M = M' \uplus M''$. Let $N$ be the largest of these two sets. $N$ is thus an induced matching of $G[V_t,V(G) \setminus V_t]$ of size at least $k/2$. Moreover, if $e,e' \in N$ are distinct, we have $x_{e'} \notin c_e$. Indeed, if $x_{e'} \in c_e$ then they are connected by an edge of $G$ and this edge is across $V_t$ and $V(G) \setminus V_t$ by construction of $N$. Thus, if such an edge exists, it violates the assumption that $N$ is an induced matching of $G[V_t, V(G) \setminus V_t]$. Now let $\tau$ be the following partial assignment of $\mathsf{var}(\hat{F})$: if $C$ is a clause that does not appear in $N$, we let $\tau(C) = 1$. If $x$ is a variable of $F$ that does not appear in $N$, we let $\tau(x) = 0$. We claim that $\hat{F}[\tau] \equiv \bigwedge_{e \in N} (x_e \lor c_e)$. Indeed, each clause $C$ that does not appear in $N$ is already satisfied in $\hat{F}[\tau]$ since $\tau(C) = 1$ and for the remaining clauses, the variables that do not appear in $N$ disappear as they are set to $0$ (remember that $F$ is monotone). Moreover, if $e,e' \in N$ are distinct edges of $N$, we have that $x_e \notin c_{e'}$ thus the only variables remaining in the clause $c_e$ is $x_e$ for each $e \in N$. Now since $\hat{F}$ is computed by $D$, $\hat{F}[\tau]$ is computed by $D' = D[\tau]$ which is a structured $\mathsf{DNNF}$ smaller than $D$. By Theorem~\ref{thm:rectlb}, there is a $(V_t,V(G) \setminus V_t)$-rectangle cover of $D'$ of size at most $\textsf{size}(D')$ and by Lemma~\ref{lem:matchlb}, we need at least $2^{|N|} \geq 2^{k/2}$ rectangles to cover $F[\tau]$. Thus, $\textsf{size}(D) \geq \textsf{size}(D') \geq 2^{k/2}$. \end{proof} Theorem~\ref{thm:betalb} is a corollary of Theorem~\ref{thm:mmwlb} and Theorem~\ref{thm:betavsmm}: \begin{proof}[Proof of Theorem~\ref{thm:betalb}] Let $F$ be a $\beta$-acyclic formula. We claim that $\hat{F}$ is also $\beta$-acyclic. Indeed, let $(x_1,\dots,x_n)$ be a $\beta$-elimination order for $\mathcal{H}(F)$. We claim that $(c_1,\dots,c_m,x_1,\dots,x_n)$ is a $\beta$-elimination order of $\mathcal{H}(\hat{F})$ where $c_1,\dots,c_m$ are the variables of $\hat{F}$ corresponding to the clauses of $F$. Indeed, for all $i$, $c_i$ is in exactly one edge of $\mathcal{H}(\hat{F})$ and can thus be eliminated from the start. Finally, $\mathcal{H}(\hat{F}) \setminus \{c_1,\dots,c_m\} = \mathcal{H}(F)$, thus $(x_1,\dots,x_n)$ is a $\beta$-elimination order of $\mathcal{H}(\hat{F}) \setminus \{c_1,\dots,c_m\}$. To every hypergraph $\mathcal{H}$, we can associate a monotone formula $\CNF(\mathcal{H})$ whose variables are the vertices of $\mathcal{H}$ and clauses are the edges of $\mathcal{H}$ without negations. It is readily verified that the hypergraph of $\CNF(\mathcal{H})$ is $\mathcal{H}$. Let $\mathcal{G}$ be the family of $\beta$-acyclic hypergraphs with $\mathsf{MIM}\text{-width}$ of $\Omega(n)$ from Theorem~\ref{thm:betavsmm} and let $\mathcal{F} = \{\widehat{\CNF(\mathcal{H})} \mid \mathcal{H} \in \mathcal{G} \}$. From what precedes, $\mathcal{F}$ is a family of $\beta$-acyclic hypergraphs and by Theorem~\ref{thm:mmwlb}, if $F \in \mathcal{F}$ has $m$ clauses and $N = n+m$ variables then any structured $\mathsf{DNNF}$ computing $F$ is of size at least $2^{\Omega(n)}$. The statement of Theorem~\ref{thm:betalb} follows since the number of edges in a $\beta$-acyclic hypergraph with $n$ vertices is at most $n(n+1)/2$~(Remark 13 in \cite{BraultB14}). Thus, $N = O(n^2)$, {\em i.e.} $n = \Omega(\sqrt N)$. \end{proof} \section{Discussion} \label{sec:conclusion} We discuss here further directions that can be studied from the results presented in this paper. In Section~\ref{sec:deviation}, we have shown that $\beta$-acyclic formulas cannot be compiled into structured $\mathsf{DNNF}$ contrary to other known tractable classes. It would be interesting to study the opposite question, that is, to understand if classes tractable with respect to the STV-algorithm can be compiled into $\mathsf{dec}\text{-}\mathsf{DNNF}$. A positive answer to this question would open interesting perspectives as it would imply that all known tractable structural restrictions for $\sSAT$ can be processed using exhaustive DPLL with caching, which could lead to a practical use of such theoretical result and to the design of interesting heuristic for the order in which variables are eliminated in DPLL based on structural restrictions. A negative answer would show that some ``easy'' cases are missed by practical tools and that it would be worth investing time to develop practical tools taking the formula structure into account. Another direction is suggested by Theorem~\ref{thm:mmwlb} which says that the $\mathsf{MIM}\text{-width}$ of the formula is closely related to the size of the smallest structured $\mathsf{DNNF}$ for $\hat F$. The most general graph parameter that is known to lead to polynomial time execution with the STV-algorithm is the $\mathsf{MIM}\text{-width}$: $\sSAT$ can be solved in time $m^{\Omega(k)} \poly(n+m)$ on a formula with $m$ clauses, $n$ variables and of $\mathsf{MIM}\text{-width}$ $k$. Theorem~\ref{thm:mmwlb} almost proves the optimality of such running time for compilation into structured $\mathsf{DNNF}$.
{'timestamp': '2017-01-09T02:00:48', 'yymm': '1701', 'arxiv_id': '1701.01461', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01461'}
arxiv
\section{Introduction} A drone is an unmanned aerial vehicle designed to be flown either through remote control or autonomously using embedded software and sensors, such as GPS. Historically, drones had been used mainly in military for reconnaissance purposes, but with recent developments in light-weight drones operated with batteries, many civilian applications are emerging. Use of drones to deploy small cells in areas of urgent needs is one of the most interesting applications currently being studied by many researchers \cite{Namuduri,6399121,7122576,yaliniz2016efficient}. The greatest advantage of this approach is that drones can be fitted with small cell base station (BS) equipment and sent to a specific target location immediately without having to deploy any infrastructure. Recent studies on drone small cells mainly focussed on finding the optimum location in the air for the drone to hover while serving the target area with a given population and traffic demand. For example, authors in \cite{mozaffari2015drone} studied the problem of finding the optimal height for a drone to cover a fixed target area with the minimum transmission power. Sharma et al. {\cite{7451189}} considered a more complex problem involving optimal deployment of multiple drones between the macro and small cell tiers for improving the coverage and capacity of the whole system. Yet, other researchers attempted to optimize the locations in the air for drones to relay traffic between BS and user equipment (UE) to maximize the overall data rates {\cite{7122575}}. In all of these studies, only the hovering position in the air is optimized without considering any dynamic repositioning \textit{during} the service. The goal of this study is to explore the benefit of dynamic repositioning of the drone during the service in response to the dynamic users activities and mobility. The key idea is to exploit the flying capability and agility of light-weight drones for making the BS continuously `chasing' the current location of active users within the cell, thereby reducing the distance between BS and UE~\footnote{Note that the concept of the BS chasing the active UEs is not possible with existing infrastructure-based cellular networks, which makes this particularly interesting and appealing to pursue for drone small cells.}. By bringing the BS closer to the UE, we can not only reduce the signal attenuation, but also increase the probability of line-of-sight (LoS) for a given altitude of the drone. The combination of these two effects is expected to increase the data rate and hence spectral efficiency of the drone cell. It is obvious that, for the proposed dynamic repositioning of the drone, autonomous control with embedded software is preferred over ground-based remote control. This means, we need to design algorithms for the drone to continuously reposition itself within the cell in response to user activity and mobility. An associated challenge is to ensure that drone energy consumption is not significantly increased due to dynamic repositioning compared to the strict hovering at the same location as considered in previous studies. To this end, we propose multiple algorithms and evaluate their performances using simulations. We show that the proposed algorithms can increase the spectral efficiency of drone small cells by 15\% while being more energy efficient than a fixed one in terms of communication energy efficiency. Without negatively affecting the drone mechanical energy consumption, the spectral efficiency can be improved by 10.5\% using our proposed algorithms. Our contributions can be summarized as follows: \begin{itemize} \item We introduce and explore the concept of \textit{dynamic repositioning} as a new method for improving spectral efficiency of drone small cells. \item We propose and evaluate three practically realizable algorithms for autonomous dynamic repositioning of drone BSs. We show that, for all of these algorithms, gain in spectral efficiency increases as a function of drone speed and as such there exists a tradeoff between spectral efficiency and energy efficiency of the drone. \item We show that, dynamic repositioning can deliver 10.5\% more spectral efficiency without any negative impact on energy efficiency. \end{itemize} \section{System Model} \label{sec:systemmodel} Let us consider a square area with a width of $w$ (in meter) to be covered by a drone flying at a height of $h$ (in meter) with a constant speed of $v$ (in m/s). Here, we assume the height and the speed of drone are fixed, and it can only change its direction of moving. The drone is responsible to provide high data-rate services for the users in the square area. In this considered area, there are $U$ users randomly moving according to the Random Way Point model (RWP). The download traffic model for each user follows a traffic model recommended by 3GPP \cite{3gpp36814}. The interval between each user's request follows Poisson Point distribution with a mean value of $\lambda$ (in sec). The request arrival time of a user $u$ is denoted by $R_u= \{ t_{u,1},t_{u,2},t_{u,3},\dots \} $, where the interval between two consecutive arrival times is modeled as the Poisson Point distribution mentioned above. The data size of each request is denoted by $s$ (in MBytes). During the time period from request time of a user to the end of download time, the user is called an \textit{active} user. We assume that users' position information is piggybacked on control signals. We further assume that the drone is transmitting data to users with a transmission power of $P_{tx}$ (in watt), $f$ (in Hz) denotes the working frequency of the drone and $B$ (in MHz) is the total bandwidth available for the drone communication. Moreover, we denote the number of active requests at time $t$ and the amount of allocated bandwidth to the $i$-th request by $q_t$ and $b_i$($1\leq i \leq q_t$, $0\leq b_i \leq B$ ), respectively. The propagation channel is modeled by probabilistic LoS, in which the probability of having a LoS connection between a user and the drone is as follows \cite{al2014optimal} \begin{equation} P^{LoS}(h,r) = \frac{1}{1+\alpha exp(-\beta\theta -\alpha])} \label{eq:plos} \end{equation} where $\alpha$ and $\beta$ depend on the environment, $\theta$ equals to $arctan(h/r)$ in degree, $h$ denotes the drone height and $r$ measures the distance between the ground user and the projection of drone location onto the ground. Clearly, the probability of having a NLoS (Non Line of Sight) connection is $P^{NLoS} (h,r)= 1 - P^{LoS}(h,r)$. The path loss in dB is then modeled as \begin{equation} \eta_{path}(d)= A+ 10\gamma\log_{10}(d) \label{eq:pathloss} \end{equation} where the string variable \textit{"path"} takes the value of “LoS” and “NLoS” for the LoS and the NLoS cases, respectively. In addition, $A$ is the path loss at the reference distance (1 meter) and $\gamma$ is the path loss exponent, both obtainable from field tests \cite{3gpp36828}. Besides, $d$ is the distance (in meter) between the transmitter and the receiver ($d = \sqrt{h^2+r^2}$), $A$ and $\gamma$ take different values for the LoS and the NLoS cases. The \textit{spectral efficiency} (bps/Hz) of an active user $i$ at distance $d$ from the drone can be formulated according to the Shannon Capacity Theorem as \begin{align} \begin{split} \varphi_i(d) = \log_2 (1+\frac{S_{i}^{path}(d)}{N_i}) \end{split} \label{eq:individualspec} \end{align} where $N_i$ (in watt) represents the total noise power including the thermal noise power and the user equipment noise figure, which is given by \cite{thermalnoise} \begin{equation} N_{i} = 10^{ \frac{-174+\delta_{ue}}{10}}.(b_i).10^{-3} \label{eq:noise} \end{equation} where $\delta_{ue}$ is the user equipment noise figure (in dB), and $b_i$ is the user's allocated bandwidth. In (\ref{eq:individualspec}), $S_{i}^{path}(d)$ (in watt) indicates the received power of the $i$-th user from the drone, which can be obtained by \begin{align} S_{i}^{path}(d) =\frac{b_i}{B} (P_{tx}.10^{\frac{-\eta_{path}(d)}{10}}) \label{eq:rcvpower} \end{align} Plugging (\ref{eq:rcvpower}) and (\ref{eq:pathloss}) into (\ref{eq:individualspec}), we can simplify the average spectral efficiency as \begin{align} \begin{split} \bar{\varphi}_i(d) =& P^{LoS}(h,r).\log_2 \Big(1+\frac{S_{i}^{LoS}(d)}{N_{i}}\Big)\\ +&P^{NLoS}(h,r).\log_2 \Big(1+\frac{S_{i}^{NLoS}(d)}{N_{i}}\Big)\\ \end{split} \label{eq:simpleindividualspec} \end{align} The drone updates the location of itself continuously in order to maximize the spectral efficiency of the system when it is transmitting data to the active users. We divide the operation time into timeslots of $\Delta t$ seconds. At the start of each timeslot, the drone finds a direction to move forward during the timeslot. The direction is selected according to the location of active users to maximize the spectral efficiency of the cell (See figure {\ref{fig:angle}}). As mentioned before, one important challenge is to find the directions and plan the route for the drone considering the spectral efficiency and the energy consumption. Our proposed methods are presented in the following section. \section{The Proposed Algorithms}\label{sec:movingstg} We propose three different movement strategies to improve the spectral efficiency of the system while taking the energy consumption of the drone into account. These methods will be presented in the following subsections. \subsection{Equal Bandwidth Division} In this strategy, the drone serves all active users with equal shares of resources. At each defined time slot $\Delta t$, the drone simply divides the total bandwidth equally among all active users and chooses the movement direction to maximize the achievable spectral efficiency of the system. The direction is defined based on the angle created between the movement line of drone and the horizontal line parallel with x-axis. The drone is able to choose any direction in $[ 0 \ 2\pi)$, however in order to reduce the complexity of the problem, an angle step is defined and denoted by $\Delta g$. For instance, if the angle step is $\Delta g = \pi/M$, then $2M$ candidate directions, $\{0,\frac{\pi}{M}, \frac{2\pi}{M} , \dots , 2\pi - \frac{\pi}{M}\}$, would be examined by the drone. \begin{figure}[!t] \centering \includegraphics[scale=0.40]{angle.pdf} \caption{Finding the appropriate movement direction by the drone BS} \label{fig:angle} \end{figure} At first, the drone finds its candidate locations following movement towards each possible direction. Then it calculates the new average spectral efficiency for all users at each candidate location and finds the direction/candidate location that maximizes the obtainable average spectral efficiency. Moreover, the average spectral efficiency for the current location of the drone is calculated as well. If the average spectral efficiency of the current location is larger than the achievable value of the selected candidate location, then the drone stays hovering at its current location. Otherwise, it starts moving towards the new direction. The drone specifies a new direction for the next time slot in a similar way. When transmission for a request finishes, the amount of released bandwidth is shared equally between remaining requests. If there is no active user the drone stays hovering at its current location. \subsection{Nearest User First} In this strategy, instead of allocating equal bandwidth to all active users, just one user receives the whole bandwidth at each time slot. It can be easily shown that the allocation of whole bandwidth to the active user having the highest spectral efficiency will maximize the spectral efficiency at each time slot. Among all active users, the nearest user to the current location of drone BS has the highest value of spectral efficiency. Following this, the drone allocates the whole bandwidth to the nearest active user and moves towards it during each time slot. If more than one user have the same distance from the drone BS, the one with the earliest request time is selected. The drone transmits data to the selected user and repeats the decision making process at each time slot. When there is no request to serve, the drone stays hovering at its current location. \subsection{Least Buffer First} The above two strategies focus on the spectral efficiency and try to increase it by means of the drone movement. In this strategy, we consider another performance metric, i.e., data buffer, to control the drone's movement. At each time slot, the drone finds the user with the least remaining data to send, allocates the whole bandwidth to it, and moves towards the user. If there are several users with the same remaining buffer, the one with the highest spectral efficiency is chosen. Considering the same data size for all requests, this strategy is actually the same as the FIFO (First In First Out) strategy. Therefore, this strategy tries to reduce the latency for all users. \section{Performance Metrics} \label{sec:perfmet} In this section, different performance metrics are defined to evaluate our proposed strategies. These performance metrics are used to compare our movement strategies for the mobile drone BS with a drone BS which is hovering above the center of target area. \subsection{Spectral Efficiency Gain} One important goal of the mobile drone is to provide high spectral efficiency for the area of interest. \textit{Spectral Efficiency Gain (SEG)} represents the percentage of spectral efficiency improvement of the mobile drone BS compared with the fixed one, defined as follows \begin{align} \begin{split} SEG= \frac{100*(\bar{\varphi}_{m} - \bar{\varphi}_{s})}{ \bar{\varphi}_{s}} \end{split} \label{eq:gain} \end{align} where $\bar{\varphi}_{m}$ and $ \bar{\varphi}_{s}$ denote the average spectral efficiency value of the mobile drone BS and the fixed one, respectively. \subsection{Energy Consumption Metrics}\label{sec:engmodel} Because of the importance of energy consumption for drones, we consider the energy efficiency issue of our proposed strategies. There are two main sources of energy consumption for the drone BS i.e., communication energy consumption and mechanical energy consumption. The communication energy depends on the transmission power and the communication time, which can be expressed by \begin{align} \begin{split} E_{comm} = P_{tx}.t_{communication} \end{split} \label{eq:comeng} \end{align} Furthermore, the \textit{Communication Energy Efficiency (CEE)} (in bits/joule) is defined to be the ratio of the number of total transmitted bits over the total communication energy, i.e., \begin{align} \begin{split} CEE = \frac{(\sum_{u=1}^{U}{|R_{u}|}).s_{bit} }{E_{comm}} \end{split} \label{eq:cee} \end{align} where $|R_{u}|$ shows the number of requests of user $u$ during the operation time, and $s_{bit}$ denotes the request packet size in bit. On the other hand, drones' mechanical energy consumption during hovering and moving depends on parameters like the drone height, the drone speed and etc. Franco et al. \cite{7101619} have done many experiments in order to formulate the power consumption of drones. The total mechanical energy consumption of the drone (in joule) can be expressed as \begin{align} \begin{split} E_{mech} = P_{hovering}.t_{hovering} + P_{moving}.t_{moving} \end{split} \label{eq:flyeng} \end{align} where $P_{hovering}$ and $P_{moving}$ denote the power consumption of the drone (in watt) during hovering and moving at a specific height, respectively. Moreover, the \textit{Mechanical Energy Efficiency (MEE)} (in bits/joule) can be defined as the ratio of the amount of total transmitted bits over the total mechanical energy consumption of the drone during the operation time. \textit{MEE} can be computed by \begin{align} \begin{split} MEE = \frac{(\sum_{u=1}^{U}{|R_{u}|}).s_{bit} }{E_{mech}} \end{split} \label{eq:mee} \end{align} \section{Simulation Results}\label{sec:simulation} In this section, the performance of the mobile drone BS is compared with the fixed drone BS hovering over the center of target area, which will be referred to as the fixed drone BS strategy hereafter. The fixed drone BS allocates the bandwidth to the users similar to its corresponding mobile drone BS. To make the definition clearer, we should discuss about six different strategies, i.e., \begin{enumerate} \item Mobile - Equal Bandwidth Division \item Fixed - Equal Bandwidth Division \item Mobile - Nearest User First \item Fixed - Nearest User First \item Mobile - Least Buffer First \item Fixed - Least Buffer First. \end{enumerate} Fair comparison has been conducted for the pairs of strategies (1) and (2), (3) and (4), (5) and (6), because the same bandwidth allocation scheme is used for each pair of strategies. Both mobile drone BSs and the fixed ones have the same configuration such as height, speed and transmission power. All results are based on the simulations using MATLAB and have been averaged over 200 runs to smooth out the randomness. Users are moving according to the RWP model with the speed range of [0.2-4] m/s. The angle step is set to $\pi/36$ ($5^{\circ}$) to both reduce the complexity and ensure the reasonable accuracy of the results. Unless otherwise stated, parameter values used in simulations are according to Table \ref{tbl:values}. \begin{table}[!t] \caption{Values and Definition of Parameters} \label{tbl:values} \begin{tabular}{lll} \hline {\bf Parameter} & {\bf Definition} & {\bf Value} \\ \hline $w$ & Area Width & 80 m \\ $U$ &Number of Users &5\\ $B$ & Total Bandwidth & 10 MHz \\ $f$ &Working Frequency & 2 GHz \\ $h$ & Drone Height & 10 m \\ $v$ & Drone Speed & 20 m/s \\ $P_{tx}$ & Drone Transmission Power & 24 dBm \\ $\lambda$ & Mean Reading Time & 5 sec \\ $A$ &Reference Distance Path Loss (LoS/NLoS) & 41.1/33 \cite{3gpp36828}\\ $\gamma$ & Path Loss Exponent (LoS/NLoS) & 2.09/3.75 \cite{3gpp36828}\\ $\delta_{ue}$ & UE Noise Figure & 9 dB \\ $\alpha, \beta$ & Environmental Parameter for Urban Area & 11.95 , 0.136 \\ $T$ &Simulation Time &300 s\\ $s$ &Request Packet Size &2 MBytes \\ $\Delta g$ &Angle Step &$\pi/36$\\ $\Delta t$ &Time Slot & 0.1 s\\ $P_{hovering}$ &Drone Hovering Power at $h$=10 m &110 watt \cite{7101619}\\ $P_{moving}$ &Drone Moving Power at $h$=10 m $v$=20 m/s &170 watt \cite{7101619}\\ $P_{moving}$ &Drone Moving Power at $h$=10 m $v$=10 m/s &110 watt \cite{7101619}\\ \hline \end{tabular} \end{table} \subsection{Simulation Time Configuration} In this section, we first analyze the (\textit{SEG}) of our proposed strategies with the assumptions of different simulation times to see how the results converge. Figure \ref{fig:simultime20} shows that the moving drone BS with the speed of 20 m/s can achieve around 13\% spectral efficiency gain. Given this figure, the system performance becomes stable after 100 sec. As a result, hereafter the simulation time have been set to 300 sec to obtain meaningful results. The results of the first 100 sec are discarded because they just warm up the simulator. Another important finding is that the Least Buffer First and the Nearest User First strategies give very similar performance higher than the performance of the Equal Bandwidth Division strategy. This result can be explained by the fact that dividing the bandwidth equally between all active users reduces the average spectral efficiency. \begin{figure}[!t] \centering \includegraphics[scale=0.45]{simultime20.pdf} \caption{Spectral efficiency gain of the moving drone with the speed of 20 m/s vs. the simulation time} \label{fig:simultime20} \end{figure} \subsection{The Performance Impact of the Area Width} Figure \ref{fig:areagain} shows the \textit{SEG} with respect to the area width. Similar to the previous figure, Figure \ref{fig:areagain} indicates that the Nearest User First strategy can obtain the highest gain. One important finding is that the performance gain gets larger as the area size is increasing. This is because that a small area restricts the drone movement. As a result, there is not much difference between the fixed drone BS and the mobile one. In a $100\ m\times 100\ m$ area, up to 15\% gain can be achieved. \begin{figure}[!t] \centering \includegraphics[scale=0.45]{areagain.pdf} \caption{Spectral efficiency gain vs. the area width } \label{fig:areagain} \end{figure} As stated before, all results are averaged over 200 runs. To check the variance of the results, the standard deviation for the value of spectral efficiency are presented as well. Figure \ref{fig:areastdm} illustrates the standard deviation of spectral efficiency value based on the area width for the mobile drone of the Nearest User First strategy moving with the speed of 20 m/s. The standard deviation of all simulation results is about 0.5 bps/Hz. It is interesting to note that the spectral efficiency of the system model is decreasing when the area is getting wider. It can be due to increasing the average distance between the drone and the users, and consequently decreasing the value of average spectral efficiency. \subsection{The Performance Impact of the Drone Height } Figure \ref{fig:heights20gain} shows the \textit{SEG} with respect to the drone height. With a higher height, the movement of the drone has a smaller effect in reducing the distance between the drone and users compared to a lower height. Therefore, the spectral efficiency gain decreases as the drone height increases. \subsection{The Performance Impact of the User Density} Figure \ref{fig:usergain} shows the spectral efficiency gain with respect to the user density (the number of users per $100\ m^2$ area). As can be seen from figure \ref{fig:usergain}, when the area gets denser performance gain wanes, however in more dense area the mobile drone can reach 6\% \textit{SEG}. This result can be explained by the fact that having a larger number of users means more requests distributed over the area. Thus when the drone moves towards one request, the probability of getting far from other requests increases, making the spectral efficiency suffer. \subsection{Analysis of the Energy Efficiency} Given the numerical results of experiments in \cite{7101619}, the power consumption of the drone moving at a specific height, is increasing as its moving speed is increasing. Because of the importance of energy consumption for drones, we first study the effect of drone speed on \textit{SEG}. Figure \ref{fig:speed} illustrates that when the speed of the drone is increasing, the gain is increasing as well. It shows a strong relationship between the speed of the drone BS and the achievable spectral efficiency gain. With higher speed, the drone BS is able to become closer to the users in shorter time and transmit data to them with higher data rates. However there is a trade-off between energy consumption and spectral efficiency gain. The power consumption of moving with lower speed, less than 10 m/s, is almost the same as the power consumption of hovering at the same height \cite{7101619}. On the other hand, moving with the speed of 10 m/s can obtain decent \textit{SEG} (10.5\% gain). Therefore, we compare the energy efficiency of the mobile drone with two different speeds, i.e., 20 m/s and 10 m/s. \begin{figure}[!t] \centering \includegraphics[scale=0.45]{areastdm.pdf} \caption{Spectral efficiency and the standard deviation for Mobile - Nearest User First strategy} \label{fig:areastdm} \end{figure} \begin{figure*} \centering \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=1.1\textwidth,height=1\textwidth]{heights20gain-ws.pdf} \caption{Spectral efficiency gain vs. the drone height} \label{fig:heights20gain} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=1.1\textwidth,height=1\textwidth]{userdensity-ws.pdf} \caption{Spectral efficiency gain vs. the user density} \label{fig:usergain} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=1.1\textwidth,height=1\textwidth]{speed-ws.pdf} \caption{Spectral efficiency gain vs. the drone speed } \label{fig:speed} \end{subfigure} \caption{Spectral efficiency gain vs. (a) the drone height, (b) the user density, and (c) the drone speed}\label{fig:se} \end{figure*} According to the definition of the \textit{CEE} in section \ref{sec:engmodel}, figure \ref{fig:com_eng_eff} provides the CEE of the mobile drone BS for the Nearest User First strategy compared with the fixed drone BS. From this figure, the CEE of the mobile drone with the speed of 20 m/s and the speed of 10 m/s are very close to each other, and they are much more efficient than the fixed one. This is due to the reduction of communication time because of the increase of spectral efficiency value for the mobile drone BSs. Another interesting finding is that the energy efficiency decreases when the area becomes larger. Moreover, the \textit{MEE} of our proposed strategies is analyzed. As shown in figure \ref{fig:fly_eng_eff}, the fixed drone BS is much more energy efficient than the mobile drone with the speed of 20 m/s. Because of the similar value of hovering power consumption and moving with the speed of 10 m/s, the mobile drone BS with the speed of 10 m/s has the same MEE as the fixed drone BS. This result is very encouraging which implies that we can achieve 10.5\% spectral efficiency gain and higher \textit{CEE} by using mobile drone BSs with the speed of 10 m/s compared with the fixed one, while retaining a similar \textit{MEE}. \subsection{Summery on the Results} To sum up, the proposed algorithms show considerable gains in terms of spectral efficiency compared with the fixed drone BS scheme. By reducing the speed of the drone, the spectral efficiency gain reduces however better results for energy efficiency can be obtained. It is also found that \textit{SEG} improves by reducing the height of the drone and increasing the area size. Our proposed methods can even obtain acceptable \textit{SEG} in dense area. Among three different proposed strategies, the Nearest First User strategy outperforms other ones. \begin{figure}[!t] \centering \includegraphics[scale=0.45]{com_eng_eff-ws.pdf} \caption{CEE of the Fixed and the Mobile Nearest User First strategy} \label{fig:com_eng_eff} \end{figure} \begin{figure}[!t] \centering \includegraphics[scale=0.45]{fly_eng_eff-ws.pdf} \caption{MEE of the Fixed and the Mobile Nearest User First strategy} \label{fig:fly_eng_eff} \end{figure} \section{Conclusion and Future Work} \label{sec:conclusion} We have proposed dynamic repositioning of the BS as a novel method to increase spectral efficiency of drone small cells. We proposed three simple algorithms that can be used to autonomously reposition the drone in response to user activities and mobility. Our analysis reveals that there is a tradeoff between spectral efficiency and energy efficiency of the drone. We have shown that 10.5\% increase in spectral efficiency is possible without any negative impact on the energy efficiency of the drone. Considering multiple drones and 3D movement would be our future work. Besides, we will consider stochastic geometry analysis in our future work. \bibliographystyle{IEEEtran}
{'timestamp': '2017-01-09T02:02:28', 'yymm': '1701', 'arxiv_id': '1701.01525', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01525'}
arxiv
\section{Background and Motivation}\label{s:bm}% Spectral clustering groups together related data points and separates unrelated data points, using spectral properties of matrices associated with the weighted graph, such as graph adjacency and Laplacian matrices; see, e.g.,\ \cite{chapter_sc,Luxburg2007,Meila01learningsegmentation,ng2002spectral,Shi:2000:NCI:351581.351611,doi:10.1137/0611030,Bolla2013,7023445}. The graph Laplacian matrix is obtained from the graph adjacency matrix that represents graph edge weights describing similarities of graph vertices. The graph weights are commonly defined using a function measuring distances between data points, where the graph vertices represent the data points and the graph edges are drawn between pairs of vertices, e.g.,\ if the distance between the corresponding data points has been measured. Classical spectral clustering bisections the graph according to the signs of the components of the Fiedler vector defined as the eigenvector of the graph Laplacian, constrained to be orthogonal to the vector of ones, and corresponding to the smallest eigenvalue; see \cite{fiedler1973algebraic} Some important applications, e.g.,\ Slashdot Zoo \cite{Kunegis:2009:SZM:1526709.1526809} and correlation \cite{bansal2004} clustering, naturally lead to signed graphs, i.e., with both positive and \emph{negative} weights. Negative values in the graph adjacency matrix result in more difficult spectral graph theory; see, e.g.,\ \cite{doi:10.1137/130913973}. Applying the original definition of the graph Laplacian to signed graphs breaks many useful properties of the graph Laplacian, e.g.,\ leading to negative eigenvalues, making the definition of the Fiedler vector ambivalent. The row-sums of the adjacency matrix may vanish, invalidating the definition of the normalized Laplacian. These difficulties can be avoided in the \emph{signed Laplacian}, e.g., \cite{2016arXiv160104692G,Kolluri:2004:SSR:1057432.1057434,doi:10.1137/1.9781611972801.49}, defined similarly to the graph Laplacian, but with the diagonal entries positive and large enough to make the signed Laplacian positive semi-definite We argue that the original graph Laplacian is a more natural and beneficial choice, compared to the popular signed Laplacian, for spectral partitioning of signed graphs. We explain why the definition of the Fiedler vector should be based on the smallest eigenvalue, no matter whether it is positive or negative, motivated by the classical model of transversal vibrations of a mass-spring system, e.g., \cite{gould,Demmel99}, but with some springs having negative stiffness, cf. \cite{AKnegativePatent}. Inclusions with negative stiffness can occur in mechanics if the inclusion is stored with energy \cite{natureNegativeStiffness2001}, e.g.,\ pre-stressed and constrained. We~design inclusions with negative stiffness by pre-tensing the spring to be repulsive \cite{CHRONOPOULOS201748}. Allowing only the transversal movement of the masses, as in \cite{Demmel99}, gives the necessary constraints. The~resulting eigenvalue problem for the vibrations remains mathematically the same, for the original graph Laplacian, no matter if some entries in the adjacency matrix of the graph are negative. In~contrast, to motivate the signed Laplacian, the ``inverting amplifier'' model in \cite[Sec. 7]{doi:10.1137/1.9781611972801.49} uses a questionable argument, where the sign of negative edges changes in the denominator of the potential, but not in its numerator Turning to justification of spectral clustering via relaxation, we compare the standard ``ratio cut,'' e.g.,\ \cite{Meila01learningsegmentation,ng2002spectral}, and ``signed ratio cut'' of \cite{doi:10.1137/1.9781611972801.49}, noting that minimizing the signed ratio cut may amplify cutting positive edges. We illustrate the behavior of the Fiedler vector for an intuitively trivial case of partitioning a linear graph modelled by vibrations of a string. We~demonstrate numerically and analyze deficiencies of the signed Laplacian vs. the standard Laplacian for spectral clustering on a few simple examples. Graph-based signal processing introduces eigenvectors of the graph Laplacian as natural substitutions for the Fourier basis. The construction of the graph Laplacian of~\cite{knyazev2015conjugate} is extended in \cite{knyazev2015edge} to the case of some negative weights, leading to edge enhancing denoising of an image that can be used as a precursor for image segmentation along the edges. We extend the use of negative weights to graph partitioning in the present paper. The rest of the paper is organized as follows. We introduce spectral clustering in Section \ref{s:isc} via eigendecomposition of the graph Laplacian. Section \ref{s:string} deals with a simple, but representative, example---a linear graph,---and motivates spectral clustering by utilizing properties of low frequency mechanical vibration eigenmodes of a discrete string, as an example of a mass-spring model. Negative edge weights are then naturally introduced in Section \ref{s:n} as corresponding to repulsive springs, and the effects of negative weights on the eigenvectors of the Laplacian are informally predicted by the repulsion of the masses connected by the repulsive spring. In Section \ref{s:sl}, we present simple motivating examples, discuss how the original and signed Laplacians are introduced via relaxation of combinatorial optimization, and numerically compare their eigenvectors and gaps in the spectra. Possible future research directions are spotlighted in Section \ref{s:future}. \section{Brief introduction to spectral clustering}\label{s:isc} Let entries of the real symmetric $N$-by-$N$ \emph{data similarity} matrix $W$ be called \emph{weighs} and the matrix $D$ be diagonal, made of row-sums of the matrix $W$. The matrix $W$ may be viewed as a matrix of scores that digitize similarities of pairs of $N$ data points. Similarity matrices are commonly determined from their counterparts, distance matrices, which consist of pairwise distances between the data points. The similarity is small if the distance is large, and vice versa. Traditionally, all the weighs/entries in $W$ are assumed to be non-negative, which is automatically satisfied for distance-based similarities. We are interested in clustering in a more general case of both positive and negative weighs, e.g.,\ associated with pairwise correlations of the data vectors. Data clustering is commonly formulated as graph partitioning, defined on data represented in the form of a graph $G = (V,\, E,\, W)$, with $N$ vertices in $V$ and $M$ edges in $E$, where entries of the $N$-by-$N$ \emph{graph adjacency} matrix $W$ are weights of the corresponding edges. The~graph is called \emph{signed} if some edge weighs are negative. A partition of the vertex set $V$ into subsets generates subgraphs of $G$ with desired properties. A partition in the classical case of non-weighted graphs minimizes the number of edges between separated sub-graphs, while maximizes the number of edges within each of the sub-graphs. The goal of partitioning of signed graphs, e.g., into two vertex subsets $V_1$ and $V_2$, can be to minimize the total weight of the positive cut edges, while at the same time to maximize the absolute total weight of the negative cut edges. For uniform partitioning, one also needs to well-balance sizes/volumes of $V_1$ and $V_2$. Traditional approaches to graph partitioning are combinatorial and naturally fall under the category of NP-hard problems, solved using heuristics, such as relaxing the combinatorial constraints. Data clustering via graph spectral partitioning is a state-of-the-art tool, which is known to produce high quality clusters at reasonable costs of numerical solution of an eigenvalue problem for a matrix associated with the graph, e.g.,\ $Lx=\lambda x$ for the graph Laplacian matrix $L=D-W$, where the scalar $\lambda$ denotes the eigenvalue corresponding to the eigenvector~$x$. To~simplify our presentation for the signed graphs, we mostly avoid the normalized Laplacian $D^{-1}L=I-D^{-1}W$, where $I$ is the identity matrix, e.g., since $D$ may be singular. The Laplacian matrix $L$ always has the number $0$ as an eigenvalue; and the column-vector of ones is always a trivial eigenvector of $L$ corresponding to the zero eigenvalue. Since the graph adjacency matrix $W$ is symmetric, the graph Laplacian matrix is also symmetric, so all eigenvalues of $L$ are real and the various eigenvectors can be chosen to be mutually orthogonal. All eigenvalues are non-negative if the graph weights are all non-negative. A nontrivial eigenvector of the matrix $L$ corresponding to smallest eigenvalue $\lambda$ of $L$, commonly called the Fiedler vector after the author of \cite{fiedler1973algebraic}, bisects the graph $G$ into only two parts, according to the signs of the entries of the eigenvector. Since the Fiedler vector, as any other nontrivial eigenvector, is orthogonal to the vector of ones, it must have entries of opposite signs, thus, the sign-based bisection always generates a non-trivial two-way graph partitioning. We explain in Section \ref{s:string}, why such a partitioning method is intuitively meaningful. A multiway spectral partitioning is obtained from ``low frequency eigenmodes,'' i.e., eigenvectors corresponding to a cluster of smallest eigenvalues, of the Laplacian matrix $L.$ The cluster of (nearly)-multiple eigenvalues naturally leads to the need of considering a Fiedler invariant subspace of $L$, spanned by the corresponding eigenvectors, extending the Fiedler vector, since the latter may be not unique or well defined numerically in this case. The Fiedler invariant subspace provides a geometric embedding of graph's vertices, reducing the graph partitioning problem to the problem of clustering of a point cloud of embedded graph vertices in a low-dimensional Euclidean space. However, the simple sign-based partitioning from the Fiedler vector has no evident extension to the Fiedler invariant subspace. Practical multiway spectral partitioning can be performed using various competing heuristic algorithms, greatly affecting the results. While these same heuristic algorithms can as well be used in our context of signed graphs, for clarity of presentation we restrict ourselves in this work only to two-way partitioning using the component signs of the Fiedler vector. The presence of negative weights in signed graphs brings new challenges to spectral graph partitioning: \begin{itemize} \item negative eigenvalues of the graph Laplacian make the definition of the Fiedler vector ambiguous, e.g., whether the smallest negative or positive eigenvalues, or may be the smallest by absolute value eigenvalue, should be used in the definition; \item difficult spectral graph theory, cf. \cite{2016arXiv160104692G} and \cite{Luxburg2007}; \item possible zero diagonal entries of the degree matrix $D$ in the normalized Laplacian $D^{-1}L$, cf. \cite{Shi:2000:NCI:351581.351611}; \item violating the maximum principle---the cornerstone of a theory of connectivity of clusters \cite{fiedler1973algebraic}; \item breaking the connection of spectral clustering to random walks and Markov chains, cf. \cite{Meila01learningsegmentation}; \item the quadratic form $x^\mathsf{T}Lx$ is not ``energy,'' e.g., in the heat (diffusion) equation; cf. a forward-and-backward diffusion in \cite{1021076,Tang2016}; \item the graph Laplacian can no longer be viewed as a discrete analog of the Laplace-Beltrami operator on a Riemannian manifold that motivates spectral manifold learning; e.g.,\ \cite{Ham:2004:KVD:1015330.1015417,Rossi2015}. \end{itemize} Some of these challenges can be addressed by defining a \emph{signed} Laplacian as follows. Let the matrix $\bar{D}$ be diagonal, made of row-sums of the \emph{absolute values of the entries} of the matrix $W$, which thus are positive, so that $\bar{D}^{-1}$ is well-defined. We define the \emph{signed} Laplacian $\bar{L}=\bar{D}-W$ following, e.g., \cite{2016arXiv160104692G,Kolluri:2004:SSR:1057432.1057434,doi:10.1137/1.9781611972801.49}. The signed Laplacian is positive semi-definite, with all eigenvalues non-negative. The Fiedler vector of the signed Laplacian is defined in \cite{2016arXiv160104692G,Kolluri:2004:SSR:1057432.1057434,doi:10.1137/1.9781611972801.49} as an eigenvector corresponding to the smallest eigenvalue and different from the trivial constant vector. We finally note recent work \cite{doi:10.1137/16M1082433}, although it is not a part of our current investigation. In the rest of the paper, we justify spectral partitioning of signed graphs using the original definition of the graph Laplacian $L$, and argue that better quality clusters can generally be expected from eigenvectors of the original $L$, rather than from the signed Laplacian $\bar{L}$. We use the intuitive mass-spring model to explain novel effects of negative stiffness or spring repulsion on eigenmodes of the standard Laplacian, but we are unaware of a physical model for the signed Laplacian. \begin{figure} \centering \hspace{-20mm} \includegraphics[width=0.55\linewidth,height=0.26\linewidth]{1} \hspace{-5mm} \includegraphics[width=0.55\linewidth,height=0.26\linewidth]{2} \hspace{-20mm} \caption{Low frequency eigenmodes of a string (left) and two disconnected pieces of the string (right).% } \label{fig:2} \end{figure} \section{Linear graph Laplacian and low frequency eigenmodes of a string}\label{s:string} Spectral clustering can be justified intuitively via a well-known identification of the graph Laplacian matrix $L$ with a classical problem of vibrations of a mass-spring system without boundary conditions, with $N$ masses and $M$ springs, where the stiffness of the springs is related to the weights of the graph; see, e.g.,~\cite{Park20143245}. References \cite{PASTERNAK20146676,Park20143245} consider lateral vibrations, where \cite{PASTERNAK20146676} allows springs with negative stiffness. We prefer the same model, but with transversal vibrations, as in \cite{Demmel99}, although the linear eigenvalue problem is the same, for the original graph Laplacian, no matter whether the vibrations are lateral or transversal, under the standard assumptions of infinitesimal displacements from the equilibrium and no damping. The transversal model allows relating the linear mass-spring system to the discrete analog of an ideal string \cite[Fig.~2]{gould} and provides the necessary constraints for us to introduce a specific physical realization of inclusions with the negative stiffness by pre-tensing some springs to be repulsive. We start with the simplest example, where the mass-spring system is a discrete string. \subsection{All edges with unit weights} Let $w_{i-1\, i = w_{i\, i+1}=1 $ with all other zero entries, so that the graph Laplacian $L=D-W$ is a tridiagonal matrix \begin{equation}\label{e1} L = \left( \begin{array}{ccccc} 1 & -1 & & &\\ -1 & 2 & -1 & &\\ & \ddots & \ddots & \ddots &\\ & &-1 & 2 & -1 \\ & & & -1 & 1 \end{array} \right) \end{equation} that has nonzero entries $1$ and $-1$ in the first row, $-1$ and $1$ in the last row, and $[-1\,\; 2\, -1]$ in every other row---a standard finite-difference approximation of the negative second derivative of functions with vanishing first derivatives at the end points of the interval. Its eigenvectors are the basis vectors of the discrete cosine transform; see the first five low frequency eigenmodes (the eigenvectors corresponding to the smallest eigenvalues) of $L$ displayed in the left panel in Figure \ref{fig:2}. Let us note that these eigenmodes all turn flat at the end points of the interval. The flatness is attributed to the vanishing first derivatives, which manifests itself in the fact, e.g.,\ that the Laplacian row sums always vanish, including in the first and last rows, corresponding to the ``boundary.'' Eigenvectors of matrix \eqref{e1} are well-known in mechanics, as they represent shapes of transversal vibration modes of a discrete analog of a string---a linear system of masses connected with springs. Figure~\ref{fig:m-s-p} illustrates a system with $N=4$ masses and $M=3$ springs. \begin{figure} \centering \includegraphics[width=0.78\linewidth]{spring-mass-positive} \caption{Traditional linear mass-spring system.} \label{fig:m-s-p} \end{figure} The frequencies squared $\omega^2$ of the vibration modes $x$ are the eigenvalues $\lambda\geq0$, e.g.,\ \cite[p. 15]{gould}. The eigenvectors $x$ of the graph Laplacian can be called \emph{eigenmodes} because of this mechanical analogy. The smallest eigenvalues $\lambda=\omega^2$ correspond to low frequencies $\omega$, explaining the terminology used in the caption in Figure \ref{fig:2}. Our system of masses is not attached, thus there is always a trivial eigenmode, where the whole system goes up/down, i.e., the eigenvector $x$ is constant with the zero frequency/eigenvalue $\omega^2=\lambda=0$. If the system consists of $k$ completely separate components, each component can independently move up/down in zero frequency vibration, resulting in total $k+1$ multiplicity of the zero frequency/eigenvalue, where the corresponding eigenvectors are all piecewise constant with discontinuities between the components. Such a system represents a graph consisting of $k$ completely separate sub-graphs and can be used to motivate $k$-way spectral partitioning. In our case $k=2$, the Fiedler vector is chosen orthogonal to the trivial constant eigenmode, and thus is not only piecewise constant, but also has strictly positive and negative components, determining the two-way spectral partitioning. Figure \ref{fig:m-s-p} shows transversal displacements of the masses from the equilibrium plane for the first nontrivial mode, which is the Fiedler vector, where the two masses on the left side of the system move synchronously up, while the two masses on the right side of the system move synchronously down. This is the same eigenmode as drawn in red color in Figure \ref{fig:2} left panel for a similar linear system with a number of masses large enough to visually appear as a continuous string. Performing the spectral bisection (two-way partitioning) according to the signs of the Fiedler vector, one puts the data points corresponding to the masses in the left half of the mass-spring system into one cluster and those in the right half into the other. The Fiedler vector is not piecewise constant, since the partitioned components are not completely separate. The amplitudes of the Fiedler vector components are also very important. The amplitude of the component squared after proper scaling can be interpreted as a probability of the corresponding data point to belong to the cluster determined according to the sign of the component. For example, the Fiedler vector in Figure~\ref{fig:m-s-p} has small absolute values of its components in the middle of the system. With the number of masses increased, the components in the middle of the system approach zero. Perturbations of the graph weights may lead to the sign changes in the small components, putting the corresponding data points into a different cluster. \subsection{A string with a single weak link (small edge weight)} Next, we set a very small value $w_{i\, i+1}=w_{i+1 \, i}$ for some index~$i$, keeping all other entries of the matrix $W$ the same as before. In terms of clustering, this example represents a situation where there is an intuitively evident bisection with one cluster containing all data points with indexes $1,\ldots,i$ and the other with $i+1,\ldots,N$. In terms of our mass-spring system interpretation, we have a discrete string with one weak link, i.e., one spring with such a small stiffness that makes two pieces of the string nearly disconnected. Let~us check how the low frequency eigenmodes react to such a change. The first five vectors of the corresponding Laplacian are shown in Figure \ref{fig:2}, right panel. We~observe that all the eigenvectors plotted in Figure \ref{fig:2} are aware of softness (small stiffness) of the spring between the masses with the indexes $i$ and $i+1$. Moreover, their behavior around the soft spring is very specific---they are all flat on both sides of the soft spring! The presence of the flatness in the low frequency modes of the graph Laplacian $L$ on both sides of the soft spring is easy to explain mathematically. When the value $w_{i\, i+1}=w_{i+1 \, i}$ is small relative to other entries, the matrix $L$ becomes nearly block diagonal, with two blocks that approximate the graph Laplacian matrices on sub-strings to the left and right of the soft spring. The low frequency eigenmodes of the graph Laplacian $L$ thus approximate combinations of the low frequency eigenmodes of the graph Laplacians on the sub-intervals. However, each of the low frequency eigenmodes of the graph Laplacian on the sub-interval is flat on both ends of the sub-interval, as explained above. Combined, it results in the flatness in the low frequency modes of the graph Laplacian $L$ on both sides of the soft spring. The flatness is also easy to explain in terms of mechanical vibrations. The soft spring between the masses with the indexes $i$ and $i+1$ makes the masses nearly disconnected, so the system can be well approximated by two independent disconnected discrete strings with free boundary conditions, on the left and on the right to the soft spring. Thus, the low frequency vibration modes of the system are visually discontinuous at the soft spring, and nearly flat on both sides of the soft spring. Can we do better and make the flat ends bend in the opposite directions, making it easier to determine the bisection, e.g.,\ using low-accuracy computations of the eigenvectors? In \cite{knyazev2015edge}, where graph-based edge-preserving signal denoising is analyzed, we have suggested to enhance the edges of the signal by introducing negative edge weights in the graph, cf. \cite{1021076}. In the next section, we put a spring which separates the masses by repulsing them and see how the repulsive spring affects the low-frequency vibration modes. \section{Negative weights for spectral clustering}\label{s:n} In~our~mechanical vibration model of a spring-mass system, the masses that are tightly connected have a tendency to move synchronically in low-frequency free vibrations. Analyzing the signs of the components corresponding to different masses of the low-frequency vibration modes determines the clusters. The mechanical vibration model describes conventional clustering when all the springs are pre-tensed to create attracting forces between the masses, where the mass-spring system is subject to transverse vibrations, i.e., the masses are constrained to move only in a transverse direction, perpendicular to a plane of the mass-spring system. However, one can also pre-tense some of the springs to create repulsive forces between some pairs of masses, as illustrated in Figure~\ref{fig:m-s-n}. For example, the second mass is connected by the attractive spring to the first mass, but by the repulsive spring to the third mass in Figure~\ref{fig:m-s-n}. The repulsion has no effect in the equilibrium, since the masses are constrained to displacements only in the transversal direction, i.e. perpendicular to the equilibrium plane. When the second mass deviates, shown in white circle in Figure~\ref{fig:m-s-n}, from its equilibrium position, shown in back circle in Figure~\ref{fig:m-s-n}, the transversal component of the attractive force from the attractive spring on the left is oriented toward the equilibrium position, while the transversal component of the repulsive force from the repulsive spring on the right is in the opposite direction, resulting in opposite signs in the equation of the balance of the two forces. Since the stiffness is the ratio of the force and the displacement, the attractive spring on the left has effective positive stiffness, but the repulsive spring represents the inclusion with effective negative stiffness, due to the opposite directions of the corresponding forces. In the context of data clustering formulated as graph partitioning, that corresponds to negative entries in the adjacency matrix. The negative entries in the adjacency matrix are not allowed in conventional spectral graph partitioning. However, the model of mechanical vibrations of the spring-mass system with repulsive springs is still valid, allowing us to extend the conventional approach to the case of negative weights. \begin{figure} \centering \includegraphics[width=0.88\linewidth]{spring-mass-negative} \caption{Linear mass-spring system with repulsion.} \label{fig:m-s-n} \end{figure} The masses which are attracted move together in the same direction in low-frequency free vibrations, while the masses which are repulsed have the tendency to move in the opposite direction. Moreover, the eigenmode vibrations of the spring-mass system relate to the corresponding wave equation, where the repulsive phenomenon makes it possible for the time-dependent solutions of the wave equation to exponentially grow in time, if they correspond to negative eigenvalues. Figure \ref{fig:m-s-n} shows the same linear mass-spring system as Figure~\ref{fig:m-s-p}, except that the middle spring is repulsive, bending the shape of the Fiedler vector in the opposite directions on different sides of the repulsive spring. The clusters in Figure~\ref{fig:m-s-p} and Figure \ref{fig:m-s-n} are the same, based on the signs of the Fiedler vectors. However, the data points corresponding to the middle masses being repulsed more clearly belong to different clusters in Figure \ref{fig:m-s-n}, compared to Figure~\ref{fig:m-s-p}, because the corresponding components in the Fiedler vector are larger by absolute value in Figure \ref{fig:m-s-n} vs. Figure~\ref{fig:m-s-p}. Determination of the clusters using the signs of the Fiedler vector is easier for larger components, since they are less likely to be computed with a wrong sign due to data noise or inaccuracy of computations, e.g.,\ small number of iterations. \begin{figure} \centering \hspace{-20mm} \includegraphics[width=0.55\linewidth,height=0.3\linewidth]{3} \hspace{-5mm} \includegraphics[width=0.55\linewidth,height=0.3\linewidth]{nabsSmall} \hspace{-20mm} \caption{The same eigenmodes, but negative weights, original (left) and signed (right) Laplacians.} \label{fig:3} \end{figure} Figure \ref{fig:3} left panel displays the five eigenvectors, including the trivial one, for the five smallest eigenvalues of the same tridiagonal graph Laplacian as that corresponding to the right panel in Figure \ref{fig:2} except that the small positive entry of the weights $w_{i\, i+1}=w_{i+1 \, i}$ for the same $i$ is substituted by $-0.05$ in Figure \ref{fig:3}. Figure \ref{fig:3} right panel displays the five leading eigenvectors of the corresponding signed Laplacian. The left panel of Figure \ref{fig:3} illustrates the predicted phenomenon of the repulsion, in contrast to the right panel. The Fiedler vector of the Laplacian, displayed in blue color in the left panel of Figure \ref{fig:3}, is most affected by the repulsion compared to higher frequency vibration modes. This effect gets more pronounced if the negative weight increases by absolute value, as we observe in other tests not shown here. The Fiedler vector of the signed Laplacian with the negative weight displayed in blue color in the right panel of Figure~\ref{fig:3} looks piecewise constant, just the same as the Fiedler vector of the Laplacian with nearly zero weight shown in red color in Figure \ref{fig:2} right panel. We now prove that this is not a coincidence. Let us consider a linear graph corresponding to Laplacian \eqref{e1}. We first remove one of the middle edges and define the corresponding graph Laplacian $L_0$. Second, we put this edge back but with the negative unit weight $-1$ and define the corresponding signed Laplacian $\bar{L}$. It is easy to verify \begin{equation}\label{e6} \bar{L}-L_0 = \left( \begin{array}{cccccc} \cdots & \cdots & \cdots & \cdots\\ \cdots & 1 & 1 & \cdots\\ \cdots & 1 & 1 & \cdots\\ \cdots & \cdots & \cdots& \cdots\end{array} \right), \end{equation} where all dotted entries are zeros. The Fiedler vector of $L_0$ is evidently piece-wise constant with one discontinuity at the missing edge, since the graph Laplacian $L_0$ corresponds to the two disconnected discrete string pieces. Let $x_0$ denote the Fiedler vector of $L_0$ shifted by the vector of ones and scaled so that its components with the opposite sign are simply $+1$ and $-1$, while still $L_0x_0=0$. We get $(\bar{L}-L_0)x_0=0$ from \eqref{e6}, thus, also $\bar{L}x_0=0$, i.e., $x_0$ is the Fiedler vector of both matrices $\bar{L}$ and $L_0$, where in the latter our only negative weight is simply nullified. \begin{figure} \centering \hspace{-9mm} \includegraphics[width=0.54\linewidth]{nL} \hspace{-5mm} \includegraphics[width=0.54\linewidth]{nsL} \hspace{-9mm} \caption{Laplacian eigenmodes, original (left) and signed (right), a ``noisy'' $12$-mass string with a negative weight at one edge between vertices $8$ and $9$.} \label{fig:na} \end{figure} \section{Comparing the original vs. signed Laplacians}\label{s:sl} We present a few simple motivating examples, discuss how the original and signed Laplacians are introduced via relaxation of combinatorial optimization, and compare their eigenvectors and gaps in the spectra, computed numerically for these examples. \subsection{Linear graph with noise} We~consider another standard linear mass-spring system with $12$ masses and one repulsive spring, $w_{89}=w_{98}=-1/2$ between masses $8$ and $9$, but add to the graph adjacency an extra full random matrix with entries uniformly distributed between $0$ and $10^{-2}$, modelling noise in the data. It turns out that in this example the two smallest eigenvalues of the signed Laplacian form a cluster, making individual eigenvectors unstable with respect to the additive noise, leading to meaningless spectral clustering, if based on the signs on the components of any of the two eigenvectors. Specifically, the exact Laplacian eigenmodes are shown in Figure \ref{fig:na}: the original Fiedler (left panel) and both eigenvectors of the signed Laplacian (right panel). The Fiedler vector of the original Laplacian clearly suggests the perfect cut. Neither the first nor the second (giving it a benefit of a doubt) exact eigenvectors of the signed Laplacian result in meaningful clusters, using the signs of the eigenvector components as suggested in \cite{doi:10.1137/1.9781611972801.49}. \subsection{``Cobra'' graph} Let us consider the mass-spring system in Figure \ref{fig:m-s}, assuming all springs of the same strength, except for the weak spring connecting masses $4$ and $5$, and where one of the springs repulses masses $1$ and $3$. Intuition suggests two alternative partitionings: (a) cutting the weak spring, thus separating the ```tail'' consisting of masses $5$ and $6$, and (b) cutting the repulsive spring and one of the attracting springs, linking mass $3$ or mass $1$ (and $2$) to the rest of the system. Partitioning (a) cuts the weak, but attractive spring; while partitioning (b) cuts one repulsive and one attracting springs of the same absolute strength ``canceling'' each other influence. If the cost function minimized by the partitioning were the total sum of the removed edges, partitioning (a) would be costlier than (b). Within the variants of the partition (b), the most balanced partitioning is the one separating masses $1$ and $2$ from the rest of the system. Let us now examine the Fiedler vectors of the spectral clustering approaches under our consideration. The graph corresponding to the mass-spring system in Figure \ref{fig:m-s}, assuming all edges have unit weights, except for the weight $0.2$ of the $(4-5)$ edge, and with $-1$ weight of the $(1-3)$ edge, has the adjacency matrix \begin{equation}\label{e3aa} A = \left( \begin{array}{cccccc} 0 & 1 & -1& 0 & 0 & 0\\ 1 & 0 & 0 & 1 & 0 & 0\\ -1 & 0 & 0 & 1 & 0 & 0\\ 0 & 1 & 1 & 0 & .2 & 0\\ 0 & 0 & 0 & .2 & 0 & 1\\ 0 & 0 & 0 & 0 & 1 & 0\end{array} \right). \end{equation} \begin{figure} \hspace{-10mm} \includegraphics[width=1.15\linewidth]{spring-massv1} \caption{Mass-spring system with repulsive springs.} \label{fig:m-s} \end{figure} Let us also consider a graph like the one corresponding to the mass-spring system in Figure~\ref{fig:m-s}, but with the repulsive spring eliminated. We nullify the negative weight in the graph adjacency matrix by $A_0=\max(A,0)$ and denote the corresponding to $A_0$ graph Laplacian matrix by $L_0$. Figure~\ref{fig:negative6masses} displays the corresponding Fiedler vectors of original $L$ (top left), original with negative weights nullified $L_0$ (top right), and both main modes of the signed Laplacian $\bar{L}$ (bottom). The original Laplacian (top left) suggests meaningful clustering of vertices $1$ and $2$ vs. $3$ and $4$. Dropping the negative weight results in cutting the weakly connected tail of the cobra, see Figure~\ref{fig:negative6masses} top right. The first eigenvector of the signed Laplacian in Figure~\ref{fig:negative6masses} bottom right appears meaningless for clustering, even though it is far from looking as a constant. The second eigenvector of the signed Laplacian in Figure~\ref{fig:negative6masses} bottom left suggests cutting off vertex $3$ from $1$ and $2$, which is not well balanced. \begin{figure} \centering \includegraphics[width=0.99\linewidth]{negative6masses} \caption{Laplacian eigenvectors: the original $L$ (top left), the original with negative weights nullified $L_0$ (top right), and the signed Laplacian $\bar{L}$ first (bottom right) and second (bottom left) eigenvectors, for a $6$-mass string with a negative weight at one edge between vertices $1$ and $3$.} \label{fig:negative6masses} \end{figure} \subsection{``Dumbbell'' graph} \begin{figure} \centering \begin{tikzpicture}[shorten >=1pt,-] \tikzstyle{vertex}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt] \foreach \name/\angle/\text in {P-1/210/5, P-2/150/6, P-3/90/1, P-4/30/2, P-5/-30/3, P-6/-90/4} \node[vertex,xshift=6cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; \foreach \name/\angle/\text in {Q-1/156/8, Q-2/104/7, Q-3/52/13, Q-4/0/12, Q-5/-52/11, Q-6/-104/10, Q-7/-156/9} \node[vertex,xshift=9cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; \foreach \from/\to in {1/2,2/3,3/4,4/5,5/1,1/3,2/4,3/5,4/1,5/2,1/6,2/6,3/6,4/6,5/6} { \draw (P-\from) -- (P-\to); } \foreach \from/\to in {1/2,2/3,3/4,4/5,5/1,1/3,2/4,3/5,4/1,5/2,1/6,2/6,3/6,4/6,5/6,1/7,2/7,3/7,4/7,5/7,6/7} {\draw (Q-\from) -- (Q-\to); } \draw (P-5)--(Q-7); \draw (P-6) -- (Q-6); \draw [color=red, line width=1mm](P-3) -- (Q-2); \draw [color=red, line width=1mm] (P-4) -- (Q-1); \end{tikzpicture} \caption{Dumbbell graph, with two negative edges, $(1,7)$ and $(2,8)$, marked thick red.} \label{fig:dumbbellgraph} \end{figure} \begin{figure} \centering \includegraphics[width=\linewidth]{dumbbell} \caption{Dumbbell graph, eigenvectors of the original Laplacian $L$ (left) and the signed Laplacian $\bar{L}$ (right)} \label{fig:dumbbell} \end{figure} Our final example is the ``Dumbbell'' graph, displayed in Figure \ref{fig:dumbbellgraph}, consisting of two complete sub-graphs of slightly unequal sizes, $6$ and $7$, to break the symmetry, attracted by two edges with positive weights, $(3,9)$ and $(4,10)$, and at the same time repelled by two other edges, $(1,7)$ and $(2,8)$, with negative weights, where all weights are unit by absolute value. Since the weights of the $4$ edges between the two complete sub-graphs average to zero, intuition suggests cutting all these $4$ edges, separating the two complete sub-graphs. Figure~\ref{fig:dumbbell} displays the corresponding eigenvectors of the original $L$ (left) and the signed Laplacian $\bar{L}$ (right). The signs of the components of the Fiedler vector in the left panel clearly point to the intuitively expected bisection, keeping the two complete sub-graphs intact. The~eigenvector of the signed Laplacian $\bar{L}$ in Figure~\ref{fig:dumbbell} (right) is quite different and suggest clustering vertices $1$ and $2$, cutting off not only the edges $(1,7)$ and $(2,8)$ with negative weights, but also a large number of edges with positive weights connecting vertices $1$ and $2$ within the first complete sub-graph. The positive components $3$ and $4$ suggest counter-intuitive cutting off vertices $3$ and $4$ from the first complete sub-graph vertex set $1,\ldots,6$ and cluster them with the vertices $7,\ldots,13$ of the second complete sub-graph, due to the presence of two edges with positive weights, $(3,9)$ and $(4,10)$. \subsection{Spectral clustering via relaxation}\label{ss:relax} A common approach to formulate spectral graph partitioning is via relaxation of combinatorial minimization problems, even though it is difficult to mathematically analyze how different cost functions in the combinatorial formulation affect clustering determined via their relaxed versions. Let us compare the standard ``ratio cut,'' e.g.,\ \cite{Meila01learningsegmentation,ng2002spectral}, leading to the traditional graph Laplacian, and ``signed ratio cut'' of \cite{doi:10.1137/1.9781611972801.49}, used to justify the definition of the signed Laplacian. Let a graph with the set of vertices $V$ be cut into two sub-graphs induced by $X$ and $V\setminus X$. The cut value $Cut(X,V\setminus X)$ is defined as the number of cut edges for unweighted graphs and the sum of the weights of cut edges for weighted graphs. In signed graphs, thus, $Cut(X,V\setminus X) = Cut^+(X,V\setminus X) - Cut^-(X,V\setminus X)$, where $Cut^+(X,V\setminus X)$ ($Cut^-(X,V\setminus X)$) denotes the sum of the absolute values of the weights of positive (negative) cut edges. The combinatorial balanced graph partitioning is minimizing the ratio of $Cut(X,V\setminus X)$ and the sizes of the partitions; its relaxation gives the spectral partitioning using the Fiedler vector of the graph~Laplacian. The signed ratio cut of \cite{doi:10.1137/1.9781611972801.49} is defined by substituting the ``signed cut'' $SignedCut(X,V\setminus X)$ defined as $2 Cut^+(X,V\setminus X) + Cut^-(X,X)+ Cut^-(V\setminus X,V\setminus X)$ for the ``cut''. However, the value of all negative edges $Cut^-(X,V\setminus X) + Cut^-(X,X) + Cut^-(V\setminus X,V\setminus X)$ in the signed graph remains constant, no matter what $X$ is. We~notice that, up to this constant value, $SignedCut(X,V\setminus X)$ is equal to \[2 Cut^+(X,V\setminus X) - Cut^-(X,V\setminus X).\] This expression is similar to that of $Cut(X,V\setminus X)$, but the term $Cut^+(X,V\setminus X)$ appears with the multiplier $2$, which suggests that the cuts minimizing quantities involving $SignedCut(X,V\setminus X)$ could tend to ignore the edges with negative weights, focusing instead on cutting the edges with small positive weights. In deep contrast, the positive and negative weights play equal roles in the definition of $Cut(X,V\setminus X)$. \subsection{Comparing the eigenvectors} It is challenging to directly quantitatively compare various spectral clustering formulations where the clusters are determined from eigenvectors, since the eigenvectors depend on matrix coefficients in a complex way. We have to rely on simple examples, where we can visualize shapes of the eigenvectors and informally argue which kinds of shapes are beneficial for clustering. To add to the trouble, there is apparently still no algorithm universally accepted by experts for an ultimate determination of multiway clusters from several eigenvectors. With this in mind, we restrict ourselves to determining the clusters from the component signs of only one eigenvector---the Fiedler vector for the traditional Laplacian, assuming the corresponding eigenvalues are simple. For the signed Laplacian, the analog of the Fiedler vector is defined in \cite{doi:10.1137/1.9781611972801.49} as corresponding to the smallest, or second smallest, eigenvalue of the signed Laplacian, depending on if the trivial constant eigenvector is absent. In~practice, however, this single eigenvector that determines clustering is computed only approximately, typically being mostly contaminated by other eigenvectors, corresponding to the nearby eigenvalues, especially clustered, so one needs to take into account these other eigenvectors. Our first goal is to check the shapes of several exact eigenmodes already displayed in Figures \ref{fig:2} and \ref{fig:3} and to argue which shapes can be more suitable for automatic partitioning. Figure \ref{fig:3} right panel displays the eigenmodes of the signed Laplacian for the same weights as in the left panel for the original Laplacian. We observe that, indeed, as we have proved above, one of the eigenvectors is piece-wise constant, as in Figure \ref{fig:2} right panel. Moreover, the shapes of the other eigenmodes of the signed Laplacian in Figure~\ref{fig:3} right panel also look more similar to those in Figure \ref{fig:2} right panel, corresponding to zero weight, than Figure \ref{fig:3} left panel, corresponding to the original graph Laplacian with the same weights. The displayed eigenvectors of both the original and signed Laplacian exhibit jumps in the same location of the negative weight in Figure~\ref{fig:3}. However, the jumps are more pronounced in Figure \ref{fig:3} left panel (original Laplacian) due to sharp edges, compared to those in Figure \ref{fig:3} right panel (signed Laplacian), making the location of the former jumps potentially easier to detect automatically than the latter ones, if the eigenvectors are perturbed due to, e.g.,\ numerical inaccuracies. \begin{figure} \centering \includegraphics[width=0.49\linewidth]{na} \includegraphics[width=0.49\linewidth]{naZero}\\ \includegraphics[width=0.49\linewidth]{naSmall} \includegraphics[width=0.49\linewidth]{naabsSmall} \caption{Approximate Laplacian eigenmode, unit (a: top left), zero (b: top right), and negative weight at one edge for the original (c: bottom left) and signed (d: bottom right) Laplacians.} \label{fig:naZero} \end{figure} Now we turn our attention to the single eigenvector, but approximated using an iterative eigenvalue/eigenvector solver (eigensolver); e.g., \cite{k2003,zk17}. To set up a direct numerical comparison for our string example, we need to choose a practical eigensolver, so let us briefly discuss computational aspects of spectral clustering. The Fiedler vector, or a group of the eigenvectors, corresponding to the left-most eigenvalues of a symmetric eigenvalue problem needs to be computed iteratively. The~size of the Laplacian matrix is equal to the number of data points, which in modern applications is often extremely large. Most textbook eigensolvers, especially based on matrix transformations, become impractical for large scale problems, where in some cases the Laplacian matrix itself cannot be easily stored, even if it is sparse. We follow \cite{k2003} advocating the Locally Optimal Block Preconditioned Conjugate Gradient (LOBPCG) method; see \cite{K01}. LOBPCG does not need to store the matrix $L$ in memory, but requires only the result of multiplying the matrix $L$ by a given vector, or a block of vectors. This characteristic makes LOBPCG applicable to eigenvalue analysis problems of very high dimensions, and results in good parallel scalability to large matrix sizes processed on many parallel processors; e.g.,\ see reference \cite{BLOPEX}, describing our open source and publicly available implementation of LOBPCG. We refer to \cite{zk17} for performance and timing. Available convergence theory of LOBPCG in \cite{K01} requires the matrix be symmetric, but not necessarily with all non-negative eigenvalues, i.e.,\ a possible presence of negative eigenvalues still satisfies the convergence assumptions. The calculation of the product of the matrix $L$ by a vector is the main cost per iteration, no matter if the weights are positive or negative. We perform $30$ iterations of LOBPCG, without preconditioning and starting from a random initial approximation---the same for various choices of the weights and for different Laplacians for our discrete string example. The number of iterations is chosen small enough to amplify the influence of inaccuracy in approximating the eigenvector iteratively. We display a representative case in Figure \ref{fig:naZero} showing the approximately computed Laplacian eigenmodes with the unit (a), zero (b), and negative (c) weight at one edge, as well as the signed Laplacian~(d), corresponding to the exact eigenfunctions in Figures~\ref{fig:2}~and~\ref{fig:3}. Initial large contributions from other eigenmodes, shown in Figures~\ref{fig:2}~and~\ref{fig:3}, remain unresolved, as anticipated. Two-way partitioning according to the signs of the components of the computed eigenmode of the Laplacian with the negative weight nullified, Figure \ref{fig:naZero} (b), or the signed Laplacian, Figure~\ref{fig:naZero}~(d), would result in wrong clusters. In a sharp contrast, the exact eigenmode (the blue line in Figure~\ref{fig:3} left panel) of the original Laplacian with the negative weight $-0.05$ demonstrates a sharp edge with a large jump between its components of the opposite signs at the correct location of the negative edge, between the $37$ and $38$ vertices. This large jump is inherited by the corresponding approximate eigenmode in Figure \ref{fig:naZero} (c), differentiating it from all other approximate eigenmodes in Figure \ref{fig:naZero}. The opposite signs of the components of the eigenmode in Figure \ref{fig:naZero} (c) allow determining the correct bisection. Large amplitudes of the absolute values of the components around the jump location in Figure \ref{fig:naZero} (c) make such a determination robust with respect to perturbations and data noise. There are two reasons why the computed eigenmode in Figure \ref{fig:naZero} (c) visually much better approximates the exact Fiedler vector compared to other cases in Figure~\ref{fig:naZero}. The first one is that the shape of the exact Fiedler eigenmode (the blue line in Figure~\ref{fig:3} left panel) is pronounced and quite different from those of other eigenfunctions in Figure~\ref{fig:3} left panel. The second reason is related to \emph{condition numbers} of eigenvectors, primarily determined by gaps in the matrix spectrum. The convergence speed of iterative approximation to an eigenvector, as well as eigenvector sensitivity with respect to perturbations in the matrix entries, e.g., due to noise in the data, is mostly determined by a quantity, called the \emph{condition number} of the eigenvector, defined for symmetric matrices as the ratio of the spread of the matrix spectrum to the gap in the eigenvalues. The larger the condition number is, the slower the typical convergence is and more sensitive to the perturbations the eigenvector becomes. The trivial zero eigenvalue of the original Laplacian can be excluded from the spectrum, if the influence the corresponding trivial eigenvector, made of ones, may be ignored. For the eigenvector corresponding to the smallest nontrivial eigenvalue, the gap is simply the difference between this eigenvalue and the nearest eigenvalue. What happens in our example, as we see numerically, is that the largest eigenvalue remains basically the same for all variants, so we only need to check the gap. It turns out that the gap for the signed Laplacian is about $3$ times smaller, for all tested values of the negative weight, compared to the gap for the case of the zero weight, explaining why we see no improvement in Figures \ref{fig:naZero} (b) and (d), compared to (a). In contrast, introducing the negative weight in the original Laplacian tends to make the target smallest eigenvalue smaller, even negative, in our test for the discrete string, while barely changing the other eigenvalues nearby. As a result, the gap with the negative weight $-0.05$ is $4$ times larger compared to the baseline case of the zero weight. We~conclude that the eigenvector condition number for the signed Laplacian is about $3$ times larger, while for the original Laplacian is $4$ times smaller, depending on the negative weight $-0.05$, compared to the baseline eigenvector condition number for the Laplacian with zero weight. We conclude that in this example the signed Laplacian gives $12$ times larger condition number of the eigenvector of interest and thus is numerically inferior for spectral clustering compared to the original Laplacian. \section{Possible extensions for future work}\label{s:future} We concentrate on the model of the system of masses connected with springs only because it directly leads to the standard definition of the graph Laplacian, giving us a simple way to justify our introduction of negative weights. Similarly, we restrict the vibrations to be transversal, since then we can use the classical two-way partitioning definition based on the signs of the components of the Fiedler vector. The negative weights can as well be introduced in other models for spectral clustering---we describe two examples below; cf. \cite{AKnegativePatent}. The first model is based on vibration modes of a wave equation of a system of interacting quasi-particles subjected to vibrations. Each quasi-particle of the vibration model corresponds to one of the data points. Interaction coefficients of the vibration model are determined by pair-wise comparison of the data points. The interaction is attractive/absent/repulsive and the interaction coefficient is positive/zero/negative if the data points in the pair are similar/not comparable/disparate, respectively. The strength of the interaction and the amplitude of the corresponding interaction coefficient represent the level of similarity or disparity. The eigenmodes are defined as eigenvectors of an eigenvalue problem resulting from the usual separation of the time and spatial variables. In low-frequency or unstable vibration modes, the quasi-particles are expected to move synchronically in the same direction if they are tightly connected by the attractive interactions, but in the opposite directions if the interactions are repulsive, or in the complementary directions (where available) if the interaction is absent. Compared to the transversal vibrations already considered, where the masses can only move up or down, on the one hand determining the clusters by analyzing the shapes of the vibrations is less straightforward than simply using the signs of the components, but, on the other hand may allow reliable detection of more than two clusters from a single eigenmode. For example, a quasi-particle representing an elementary volume of an elastic body in three-dimensional space has six degrees of freedom, which may allow definition of up to twelve clusters from a single vibration mode. Multiway algorithms of spectral graph partitioning have to be adapted to this case, where a quasi-particle associated with a graph vertex has multiple degrees of freedom. A second, alternative, model is a system of interacting quasi-particles subjected to concentration or diffusion, described by concentration-diffusion equations. Every quasi-particle of the concentration-diffusion model corresponds to a point in the data. Conductivity coefficients of interactions of the quasi-particles are determined by pair-wise comparison of data points. The interaction is diffusive and the interaction conductivity coefficient is positive if the data points in the pair are similar. The interaction is absent and the interaction conductivity coefficient is zero if the data points in the pair are not comparable. Finally, the interaction is concentrative and the interaction conductivity coefficient is negative if the data points in the pair are disparate. The strength of the interaction and the amplitude of the interaction coefficient represent the level of similarity or disparity. As in the first model, the eigenvalue problem is obtained by the separation of the time and spatial variables in the time dependent diffusion equation. The clusters are defined by the quasi-particles that concentrate together in unstable or slowest eigenmodes, corresponding to the left part of the spectrum. A forward-and-backward diffusion in \cite{1021076,Tang2016} provides a different interpretation of a similar diffusion equation, but the negative sign in the conductivity coefficient is moved to the time derivative, reversing the time direction. Here, the time is going forward (backward) on the graph edges with the positive (negative) weights. Having the time forward and backward in different parts of the same model seems unnatural. Finally, our approach allows reversing the signs of all weights, thus treating the minimum cut and the maximum cut problems in the same manner, e.g., applying the same spectral clustering techniques to the original Laplacian, in contrast to the signed Laplacian. \section{Conclusions} Spectral clustering has been successful in many applications, ranging from traditional resource allocation, image segmentation, and information retrieval to more recent bio- and material-informatics, providing good results at a reasonable cost. Improvements of cluster quality and algorithm performance are important, e.g., for big data or real-time clustering. We introduce negative weights in the graph adjacency matrix for incorporating disparities in data via spectral clustering that traditionally only handles data with similarities. Incorporating the disparities in the data into spectral clustering is expected to be of significance and have impact in any application domain where the data disparities naturally appear, e.g., if the data comparison involves correlation or covariance. If data features are represented by elements of a vector space equipped with a vector scalar product, the scalar product can be used for determining the pair-wise comparison function having both negative and non-negative values. Traditional spectral clustering, with only non-negative weights, remains largely intact when negative weights are introduced. Eigenvectors corresponding to the algebraically smallest eigenvalues (that can be negative) of the graph Laplacian define clusters of higher quality, compared to those obtained via the signed Laplacian. The mass-spring system with repulsive springs justifies well the use of the standard Laplacian for clustering, in contrast to the signed Laplacian that may result in counter-intuitive partitions. \bibliographystyle{siamplain}
{'timestamp': '2018-04-02T02:04:35', 'yymm': '1701', 'arxiv_id': '1701.01394', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01394'}
arxiv
\section{\newpage\stdsection} \usepackage{listings} \usepackage{color} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} \lstset{frame=tb, language=caml, aboveskip=3mm, belowskip=3mm, showstringspaces=false, columns=flexible, basicstyle={\small\ttfamily}, numberstyle=\color{gray}, keywordstyle=\color{blue}, commentstyle=\color{dkgreen}, stringstyle=\color{mauve}, breaklines=true, breakatwhitespace=true, tabsize=3, numbers=left, stepnumber=5, firstnumber=1, numberfirstline=true } \long\def\pasPoly#1{#1} \long\def\pasPrim#1{#1} \journal{Information and Computation} \begin{document} \begin{frontmatter} \date{} \title{Paths-based criteria and application to linear logic subsystems characterizing polynomial time} \author[focal]{Matthieu Perrinel} \ead{[email protected]} \address[focal]{LIP, ENS Lyon, 46 allée d'Italie, 69007 Lyon, FRANCE} \begin{abstract} Several variants of linear logic have been proposed to characterize complexity classes in the proofs-as-programs correspondence. Light linear logic (LLL) ensures a polynomial bound on reduction time, and characterizes in this way polynomial time ($Ptime$). In this paper we study the complexity of linear logic proof-nets and propose three semantic criteria based on context semantics: stratification, dependence control and nesting. Stratification alone entails an elementary time bound, the three criteria entail together a polynomial time bound. These criteria can be used to prove the complexity soundness of several existing variants of linear logic. We define a decidable syntactic subsystem of linear logic: $SDNLL$. We prove that the proof-nets of SDNLL satisfy the three criteria, which implies that $SDNLL$ is sound for $Ptime$. Several previous subsystems of linear logic characterizing polynomial time ($LLL$, $mL^4$, maximal system of $MS$) are embedded in $SDNLL$, proving its $Ptime$ completeness. \end{abstract} \end{frontmatter} \section{Introduction} \paragraph{Motivations for a type-system capturing polynomial time} Programming is a notoriously error-prone process. The behaviours of the programs written by programmers on their first attempt often differ from their expected behaviours. Type systems can detect some of those mistakes so that programmers can correct them more easily. In this work, the property we are interested in is time complexity: the execution time of a program as a function of the size of its input. A type system $S$ enforcing a polynomial bound on the time complexity of a program would be useful in several ways: \begin{itemize} \item In some real-time applications (e.g. car control systems) programs can never miss a deadline, otherwise the whole system is a failure. It is not enough to verify that the system reacted fast enough during tests, we need an absolute certainty. \item For some software, it seems enough to get an empirical estimate of the complexity by running tests. In this case, $S$ could be useful to find the origin of the slowness observed during tests (this requires the type inferrer to give useful information when it fails to type a term). \item In complexity theory, the main method to prove that a problem is $NP$-complete, is to define a polynomial time reduction from another $NP$-complete problem. If $S$ is well-trusted, it could be used as a specialized proof assistant: the fact that the reduction is typable in $S$ would increase the trust in the proof. More generally, $S$ could be used in any proof relying on a complexity bound for a program~\cite{nowak2014formal,zhang2009computational}. \end{itemize} In this work, we define a subsystem $SDNLL$ of linear logic such that every proof-net normalizes in polynomial time. This property is called $Ptime$ {\em soundness}. And, for every function $f$ computable in polynomial time there exists a $SDNLL$ proof-net $G_f$ which computes $f$. This property is called $Ptime$ {\em extensional completeness}. Determining if a proof-net normalizes in polynomial time is undecidable. So for every such system $S$, either determining if a proof-net $G$ belongs to $S$ is undecidable, or $S$ is not {\em intensional complete}: i.e. there exist programs which normalize in polynomial time and are not typable by $S$. The subsystem $SDNLL$ is in the second case. We take inspiration from previous decidable type systems characterizing $Ptime$ and relax conditions without losing neither soundness nor decidability. The more intensionally expressive $S$ is (i.e. the more terms are typable by $S$), the more useful $S$ is. Indeed, the three motivations for systems characterizing polynomial time we described earlier require $S$ to type programs written by non-specialists: people who may not have a thorough understanding of $S$. \paragraph{Linear logic and proof-nets} Linear logic ($LL$\label{def_acronym_ll})~\cite{girard1987linear} can be considered as a refinement of System F where we focus especially on how the duplication of formulae is managed. In linear logic, the structural rules (contraction and weakening) are only allowed for formulae of the shape $\oc A$: \begin{equation*} \begin{array}{cc} \AxiomC{$\Gamma, \oc A, \oc A \vdash B$} \RightLabel{$\contLab$} \UnaryInfC{$\Gamma, \oc A \hspace{1.4em} \vdash B$} \DisplayProof & \hspace{6em} \AxiomC{$\Gamma \hspace{1.3em} \vdash B$} \RightLabel{$\weakLab$} \UnaryInfC{$\Gamma, \oc A \vdash B$} \DisplayProof \end{array} \end{equation*} With the three following additional rules (promotion, dereliction and digging), linear logic is as expressive as System F, so the elimination of the $cut$ rule (corresponding to the $\beta$-reduction of $\lambda$-calculus) is not even primitive recursive. \begin{equation*} \begin{array}{ccc} \AxiomC{$\hspace{0.3em}A_1,\cdots,\hspace{0.3em}A_n \vdash \hspace{0.3em}B$} \RightLabel{$\fpriLab$} \UnaryInfC{$\oc A_1, \cdots,\oc A_k \vdash \oc B$} \DisplayProof \hspace{3em}& \AxiomC{$\Gamma,\hspace{0.3em}A \vdash B$} \RightLabel{$\derLab$} \UnaryInfC{$\Gamma, \oc A \vdash B$} \DisplayProof \hspace{3em}& \AxiomC{$\Gamma, \oc \oc A \vdash B$} \RightLabel{$\digLab$} \UnaryInfC{$\Gamma, \hspace{0.4em}\oc A \vdash B$} \DisplayProof \end{array} \end{equation*} However, because the structural rules are handled by 5 distinct rules, one can enforce a subtle control on the use of ressources by modifying one of them. If we restrict some of those rules, it restricts the duplication of formulae. For instance, in the absence of $\derLab$ and $\digLab$ rules, the cut-elimination normalizes in elementary time~\cite{danos2003linear}. The set of such proofs is defined as Elementary Linear Logic ($ELL$). Proof-nets~\cite{girard1996proof} are an alternative syntax for linear logic, where proofs are considered up-to meaningless commutations of rules. Proof-nets are graph-like structures where nodes correspond to logical rules. One of the reasons we use proof-nets instead of proof derivations is that context semantics, the main tool we use in this article, is much simpler to define and use in proof-nets. \paragraph{Context semantics}Context semantics is a presentation of geometry of interaction~\cite{gonthier1992geometry,danos1995proof} defined by tokens traveling across proof-nets according to some rules. The paths defined by those tokens are stable by reduction so they represent the reduction of the proof-net. Context semantics has first been used to study optimal reduction~\cite{gonthier1992linear}. Recently, it has been used to prove complexity bounds on subsystems of System T~\cite{lago2005geometry} and linear logic~\cite{baillot2001elementary,lago2006context}. In~\cite{lago2006context}, Dal Lago defines for every proof-net $G$ a weight $W_G \in \mathbb{N} \cup \{\infty\}$ based on the paths of context semantics such that, whenever $G$ reduces to $H$, $W_G \geq W_H+1$. Thus $W_G$ is a bound on the length of the longest path of reduction starting from $G$. Then we can prove theorems of the shape ``whenever $G$ satisfies some property (for instance if $G$ belongs to a subsystem such as $LLL$), $W_G$ satisfies some bound (for instance $W_G \leq P(|G|)$ with $P$ a polynomial and $|G|$ the size of $G$).'' From this point of view, context semantics has two major advantages compared to the syntactic study of reduction. First, its genericity: some common results can be proved for different variants of linear logic, which allows to factor out proofs of complexity results for these various systems. Moreover, the bounds obtained stand for any strategy of reduction. On the contrary, most bounds proved by syntactic means are only proved for a particular strategy. There are several advantages to strong bounds: \begin{itemize} \item Let us suppose we know a strong complexity bound for a system $S'$. We can prove the same strong complexity bound on a system $S$ if we find an embedding $\phi$ of $S$ programs in $S'$ programs such that, whenever $t$ reduces to $u$ in $S$, $\phi(t)$ reduces to $\phi(u)$ in $S'$ (with at least one step). We use such an embedding in Section~\ref{section_sdnll_lambda} to prove a strong bound for $\lambda$-terms typed by $SDNLL$. If we only had a weak complexity bound for system $S'$, we would have to prove that the reduction from $\phi(t)$ to $\phi(u)$ matches the reduction strategy entailing the bound, which is not always possible. \item The languages we study here are confluent. However, if we consider an extension of linear logic or $\lambda$-calculus with side-effects (such as $\lambda^{!R}$ considered by Madet and Amadio in \cite{madet2011elementary}), the reduction strategy influences the result of a program execution. It is important that the programmer understands the strategy. If the reduction strategy corresponded to strategies frequently used by programming languages (such as left-to-right call-by-value), it would not be a problem. However, in some cases ($mL^4$ for instance~\cite{baillot2010linear}), the strategy is rather farfetched and difficult to understand for the programmer. \end{itemize} Our context semantics, presented in Section~\ref{section_def_cont_sem}, is slightly different from Dal Lago's context semantics. In particular, Dal Lago worked in intuitionnistic linear logic, and we work in classical linear logic. So the results of~\cite{lago2006context} cannot be directly applied. However most theorems of~\cite{lago2006context} have correspondents in our framework, with quite similar proofs. This is why we omit the proofs of most of the results of this section, complete proofs can be found in~\cite{perrinelMegathese}. \paragraph{Our approach} Contrary to previous works, we do not directly define a linear logic subsystem. First, we define semantic criteria forbidding behaviours which can result in non-polynomial complexity. We define relations $\rightarrow$ on boxes (special subterms of proof-nets) such that $B \rightarrow C$ means that "the number of times $B$ is copied depends on the number of times $C$ is copied". More precisely, we define three relations ($\stratSNLL$, $\dcSim$ and $\nestSim$) representing different kinds of dependence. The acyclicity of these three relations ensures a bound on the number of times every box is copied so a bound on the length of normalization sequences. Then (in Section~\ref{chapter_type_systems}), we define {\em Stratified Dependence control Nested Linear Logic} ($SDNLL$), a subsystem of linear logic such that $\stratSNLL$, $\dcSim$ and $\nestSim$ are acyclic on every proof-net of $SDNLL$. This entails a bound on the length of normalization for every $SDNLL$ proof-net. The relations ($\stratSNLL$, $\dcSim$ and $\nestSim$) are based on the paths of context semantics. We use the syntactic restrictions to define invariants along the paths, proving that if $B \rightarrow C$ then the "types" of $B$ and $C$ are such that we cannot have $C \rightarrow B$. Finally, in Section~\ref{section_sdnll_lambda}, we transform $SDNLL$ into a type-system $SDNLL_{\lambda}$ for $\lambda$-calculus, which enforces a polynomial bound on $\beta$-reduction. This tranformation is similar to the transformation of $LLL$~\cite{girard1995light} into $DLAL$~\cite{baillot2004light}. \begin{figure}\centering \begin{tikzpicture} \node (LLL) at (0,0) {$LLL$}; \node (MS) at ($(LLL)+( 30:1.6)$) {$MS$}; \node (L4) at ($(LLL)+(150:1.1)$) {$L^4$}; \node (L40) at ($(L4) +(150:1.1)$) {$L^4_0$}; \node (SLL) at ($(LLL)+(4.5,0)$) {$SLL$}; \node (BLL) at ($(SLL)+(3,0)$) {$BLL$}; \node (QBAL)at ($(BLL)+(0,0.8)$) {$QBAL$}; \node (SNLL)at ($(LLL)+(0.4,1.5)$) {$\mathbf{SDNLL}$}; \draw [<-] (SNLL)--(L4); \draw [<-,dashed] (SNLL)--(MS); \draw [<-] (L40)--(L4); \draw [<-] (L4)--(LLL); \draw [<-] (MS)--(LLL); \draw [<-] (QBAL)--(BLL); \draw ($(L40|-LLL)+(-0.4,-0.25)$) rectangle ($(SLL|-SNLL)+(1,0.2)$); \draw ($(BLL)+(-1.5,-0.25)$) rectangle ($(QBAL)+(1,0.7)$); \node [below left] at ($(SLL|-SNLL)+(1,0.25)$) {Decidable}; \node [below right] at ($(QBAL)+(-1.5,0.75)$) {Undecidable ?}; \end{tikzpicture} \caption{\label{fig_state_art}State of the art} \end{figure} \paragraph{Previous polynomial time subsystems of Linear logic} There already exist several subsystems of linear logic characterizing polynomial time. The first such subsystem is $BLL$~\cite{girard1992bounded}, which enforces $Ptime$ soundness by labelling of $\oc$ modalities by polynomials. However, given a proof-net $G$, determining if $G$ is in $BLL$ (or its generalization $QBAL$~\cite{dal2009bounded}) seems undecidable. Thus, they do not fit in our approach. The first decidable system was $LLL$~\cite{girard1995light} which is defined as the proof-nets of $ELL$ such that the contexts have at most one formula in every $\fpriLab$ rule\footnote{To keep some expressivity, Girard adds a new modality $\S$.}. A decidable type system $DLAL$ for $\lambda$-calculus was inspired by $LLL$~\cite{baillot2004light,atassi2007verification}. Baillot and Mazza generalized $ELL$ with a subsystem $L^3$ of linear logic characterizing elementary time~\cite{baillot2010linear}. Then they defined $mL^4$ and $mL^4_0$, characterizing polynomial time, based on $L^3$ in the same way as $LLL$ is based on $ELL$. In a separate direction, Roversi and Vercelli also extended $LLL$ with $MS$\footnote{Which is a set of system rather than a unique system.}~\cite{roversi2010local}. Those three systems are obtained by decorating formulae with labels and adding local constraints on the labels. $mL^4$, $mL^4_0$ and $MS$ are trivially decidable on proof-nets: given a proof-net $G$ there exist only a finite number of ways to label the formulae of $G$. One can try every possibility and check whether the labels verify the constraints. Lafont defined $SLL$~\cite{lafont2004soft}, another subsystem of linear logic characterizing polynomial time. This system does not contain $LLL$, and none of the above generalizations of $LLL$ contains $SLL$. Figure~\ref{fig_state_art} summarizes the state of the art. There is an arrow from the system $S$ to the system $T$ if there is a canonical embedding of $S$ in $T$. The arrow between $MS$ and $SDNLL$ is dotted because the embedding is only defined for one of the maximal systems of $MS$. In~\cite{perrinelMegathese}, we define $SwLL$ (based on the the ideas of this article) in which one can embed $SDNLL$, $SLL$, and every $MS$ polynomial subsystem. This paper extends a previous work~\cite{perrinel2013pathsbased} by: providing a non-trivial nesting condition, defining a syntactic subsystem based on the semantic criteria, and providing most of the proofs (in~\cite{perrinel2013pathsbased} the proofs are only sketched). More details, and the technical proofs omitted in this paper can be found in Perrinel's thesis~\cite{perrinelMegathese}. \section{Linear Logic and Context Semantics}\label{chapter_2} \subsection{Linear Logic} Linear logic ($LL$)~\cite{girard1987linear} can be considered as a refinement of System F~\cite{girard1971extension} where we focus especially on how the duplication of formulae is managed. In this work we use neither the additives ($\oplus$ and $\with$) nor the constants. This fragment is usually named {\em Multiplicative Exponential Linear Logic with Quantifiers} (abbreviated by $MELL_\forall$). To simplify notations, we will abusively refer to it as {\em Linear Logic} (abreviated by $LL$). The set $\formLL$, defined as follows, designs the set of formulae of linear logic. \begin{equation*}\label{def_fll} \formLL = X \mid X^\perp \mid \formLL \otimes \formLL \mid \formLL \parr \formLL \mid \forall X. \formLL \mid \exists X. \formLL \mid \oc \formLL \mid \wn \formLL \end{equation*} We define inductively an involution $(\_)^\perp$ on $\formLL$, which can be considered as a negation:\label{def_perpformula} $(X)^\perp =X^\perp$, $(X^\perp)^\perp =X$, $(A \otimes B)^\perp = A^\perp \parr B^\perp$, $(A \parr B)^\perp = A^\perp \otimes B^\perp$, $(\forall X.A)^\perp = \exists X.A^\perp$, $(\exists X.A)^\perp = \forall X.A^\perp$, $(\oc A)^\perp = \wn(A^\perp)$ and $(\wn A)^\perp= \oc (A^\perp)$. Linear logic is usually presented as a sequent calculus (as in the introduction). In this article, we will consider an alternative syntax: proof-nets~\cite{girard1996proof}. \begin{definition}\label{def_proofnet} A {\em $LL$ proof-net} is a graph-like structure, defined inductively by the graphs of Figure~\ref{rules_labelling_proofnet} ($G$ and $H$ being $LL$ proof-nets). Every edge $e$ is labelled by $\beta(e) \in \formLL$ satisfying the constraints of Figure~\ref{rules_labelling_proofnet}. The set of edges is written $\dirEdges{G}$. A {\em proof-net} is a graph-like structure, whose edges are not labelled, defined inductively by the graphs of Figure~\ref{rules_labelling_proofnet} ($G$ and $H$ being proof-nets). The constraints of Figure~\ref{rules_labelling_proofnet} on labels are not taken into account. \end{definition} \begin{figure} \begin{tikzpicture} \tikzstyle{level}=[opacity = 0] \tikzstyle{type}=[black, midway, right=-0.08cm] \nvar{\ligneDeux}{2.3cm} \nvar{\ligneTrois}{2.6cm} \begin{scope}[scale = 0.85] \begin{scope}[shift={(4,1.8)}] \begin{scope}[shift={(-1,0)}] \node [ax] (ax) at (-0.5,0) {}; \draw[ar] (ax) to [out= 0,in=90] node [type] {$A^\perp$} ($(ax)+(0.5,-0.7)$); \draw[ar] (ax) to [out=180,in=90] node [type,left=-0.08cm] {$A$} ($(ax)+(-0.5,-0.7)$); \end{scope} \node [proofnet, inner xsep=0.5cm] (G) at (2.9,0) {$G$}; \node [proofnet, inner xsep=0.5cm] (H) at ($(G)+(1.8,0)$) {$H$}; \node [cut] (cut) at ($(G)!0.5!(H)+(-0.15,-0.7)$) {}; \draw [ar] (G.-65) to [out=-90,in=180] node [type,left=-0.08cm] {$A$} (cut); \draw [ar] (H.-145) to [out=-90,in= 0] node [type] {$A^\perp$} (cut); \draw [multiar] (G.-158) --++ (0,-0.4); \draw [multiar] (H.-22) --++ (0,-0.4); \end{scope} \begin{scope}[shift={(-0.3,0)}] \node[proofnet, inner xsep=0.5cm] (G) at (0,0) {$G$}; \node[proofnet, inner xsep=0.5cm] (H) at ($(G)+(1.8,0)$) {$H$}; \node[tensor] (tens) at ($(G)!0.5!(H)+(0,-0.8)$) {}; \draw [ar] (G.-50) to [out=-90,in=150] node [type,left=-0.08cm] {$A$} (tens); \draw [ar] (H.-130) to [out=-90,in= 30] node [type] {$B$} (tens); \draw [ar] (tens) --++ (0,-0.5) node [type] {$A \otimes B$}; \draw [multiar] (G.-158) --++ (0,-0.5); \draw [multiar] (H.-22) --++ (0,-0.5); \end{scope} \begin{scope}[shift={(4.7, 0)}] \node[proofnet, inner xsep=0.6cm] (G) at (0,0) {$G$}; \node[par] (par) at ($(G.-160)!0.5!(G.-90)+(0,-0.8)$) {}; \draw[ar] (G.-160) to [out=-90,in=120] node [type,left] {$A$} (par); \draw[ar] (G.-90) to [out=-90,in= 60] node [type] {$B$} (par); \draw[ar] (par) --++ (0,-0.5) node [type] {$A \parr B$}; \draw[multiar] (G.-20) --++ (0,-0.5); \end{scope} \begin{scope}[shift={(8.5,0)}] \draw (0,0) node [proofnet, inner xsep=0.7cm] (G) {$G$}; \node [exists] (ex) at ($(G.-164)+(0,-0.8)$) {}; \draw [multiar](G.-16) --++(0,-0.4); \draw[ar] (G.-164) -- (ex) node [type] {$A[B/X]$}; \draw[ar] (ex) --++ (0,-0.5) node [midway, right] {$\exists X. A$}; \end{scope} \begin{scope}[shift={(11.8, 0)}] \draw (0,0) node [proofnet, inner xsep=0.6cm] (G) {$G$}; \node [forall] (fa) at ($(G.-155)+(0,-0.8)$) {}; \draw [multiar](G.-20) --++(0,-0.4); \draw[ar] (G.-155) -- (fa) node [type] {$A$}; \draw[ar] (fa) --++ (0,-0.5) node [midway, right] {$\forall X. A$}; \end{scope} \begin{scope}[shift={(9.1,- \ligneTrois)}] \draw (0,0) node [proofnet] (G) {$G$}; \node [der] (fa) at ($(G.-145)+(0,-0.8)$) {}; \draw [multiar](G.-35) --++(0,-0.4); \draw[ar] (G.-145) -- (fa) node [type] {$A$}; \draw[ar] (fa) --++ (0,-0.5) node [midway, right] {$\wn A$}; \end{scope} \begin{scope}[shift={(3.3,0.1cm-\ligneTrois)}] \draw (0,0) node [proofnet, inner xsep=0.6cm] (G) {$G$}; \node [cont] (cont) at ($(G.-65)+(0,-0.8)$) {}; \draw[ar] (G.-20) to [out=-90,in= 30] node [type,pos=0.3] {$\wn A$} (cont); \draw[ar] (G.-145)to [out=-90,in=160] node [type,pos=0.3] {$\wn A$} (cont); \draw[->] (cont) --++ (0,-0.5) node [midway, right] {$?A$}; \draw[multiar] (G.-160) --++(0,-0.8); \end{scope} \begin{scope}[shift={(6,- \ligneTrois)}] \draw (0,0) node [proofnet] (G) {$G$}; \draw [multiar] (G.-90) --++(0,-0.5); \node [weak] (weak) at ($(G)+(1,0)$) {}; \draw [ar] (weak) --++(0,-0.8) node [type] {$?A$}; \end{scope} \begin{scope}[shift={(0,0.3cm-\ligneTrois)}] \draw (0,0.1) node [proofnet,inner xsep=0.8cm] (G) {$G$}; \draw (G)++(1.1,-1.1) node [princdoor] (bang) {}; \draw (G)++(0.,-1.1) node [auxdoor] (whyn) {}; \draw (G)++(-1.1,-1.1) node [auxdoor] (whyn2) {}; \draw[ar] (whyn2 |- G.south) -- (whyn2) node [type] {$A_1$}; \draw[ar] (whyn |- G.south) -- (whyn) node [type] {$A_n$}; \draw[ar] (bang |- G.south) -- (bang) node [type] {$B$}; \draw[ar] (whyn2) --++(0,-0.8) node [type] {$?A_1$}; \draw[ar] (whyn) --++(0,-0.8) node [type] {$?A_n$}; \draw[ar] (bang) --++(0,-0.8) node [type] {$\oc B$}; \draw (whyn)--(bang) -| ++(0.45,1.5) -| ($(whyn2)+(-0.4,0)$) -- (whyn2); \draw [dotted] (whyn2) -- (whyn); \end{scope} \begin{scope}[shift={(11.7,- \ligneTrois)}] \draw (0,0) node [proofnet, inner xsep=0.6cm] (G) {$G$}; \node [dig] (fa) at ($(G.-160)+(0,-0.8)$) {}; \draw [multiar](G.-20) --++(0,-0.4); \draw[ar] (G.-160) -- (fa) node [type] {$\wn \wn A$}; \draw[ar] (fa) --++ (0,-0.5) node [midway, right] {$\wn A$}; \end{scope} \end{scope} \end{tikzpicture} \caption{ \label{rules_labelling_proofnet}Construction of $LL$ proof-nets. In the $\forall$ rule, $X$ can not be free in the other conclusions of $G$.} \end{figure} For the following definitions, we supposed fixed a proof-net $G$. \paragraph{Directed edges}\label{directed_edges}The edges in the definition of proof-nets (the elements of $\dirEdges{G}$) are directed. We will often need to consider their inverted edges: for any $(l,m)$ (the edge from $l$ to $m$), we denote its inverted edge $(m,l)$ (the edge from $m$ to $l$) by $\overline{(l,m)}$. We define the set $\edges{G}$ as $\dirEdges{G} \cup \Set{\overline{e}}{e \in \dirEdges{G}}$. In $LL$ proof-nets, we extend the labelling $\beta(\_)$ from $\dirEdges{G}$ to $\edges{G}$ by $\beta(\overline{e})=\beta(e)^\perp$. \paragraph{Premises and conclusions}\label{def_premise} For any node $n$, the incoming edges of $n$ (in $\dirEdges{G}$) are named the {\em premises} of $n$.\label{def_conclusion} The outgoing edges of $n$ (in $\dirEdges{G}$) are named the {\em conclusions} of $n$. Some edges are not the premises of any node.\label{def_pending} Such edges are the {\em conclusions} of $G$. \paragraph{Boxes}\label{def_box}The rectangle of Figure~\ref{rules_labelling_proofnet} with the $\fauxLab$ and $\fpriLab$ nodes is called a {\em box}. Formally a box is a subset of the nodes of the proof-net. We say that the edge $(m,n) \in \dirEdges{G}$ belongs to box $B$ if $n \in B$, in this case $(n,m)$ also belongs to box $B$. Let us call $B$ the box in Figure~\ref{rules_labelling_proofnet}.\label{def_principaldoor} The node labelled $\fpriLab$ is the {\em principal door} of $B$, its conclusion \label{def_sigmab}is written $\sigma(B)$, and is named the {\em principal edge} of $B$.\label{def_auxiliarydoor} The $\fauxLab$ nodes are the auxiliary doors of box $B$.\label{def_sigmaib} The edge going out of the $i$-th auxiliary door is written $\sigma_i(B)$ and is named an auxiliary edge of $B$. The doors of box $B$ are considered in $B$, they are exactly the nodes which are in $B$ but whose conclusions are not in $B$. The number of boxes containing an element (box, node or edge) $x$ is its {\em depth} written $\depth{x}$.\label{def_maxdepth} $\partial_G$ is the maximum depth of an edge of $G$. The set of boxes of $G$ is $\boxset{G}$. \tikzstyle{edgename}=[phantom] \begin{figure}\centering \begin{tikzpicture}[baseline=0cm] \tikzstyle{edgename}=[opacity=0] \begin{scope}[shift={(7.8,0.7)}] \node [ax] (ax) at (0, 0) {}; \node [etc] (etc) at ($(ax)+(1.1,0)$) {}; \node [cut] (cut) at ($(ax)!0.6!(etc)+(0,-0.5)$) {}; \draw [ar,out= 0,in=180] (ax) to (cut); \draw [ar,out=-90,in= 0] (etc) to node [type,right=-0.08cm] {$A$} (cut); \draw [ar,out=180,in= 90] (ax) to node [type,left=-0.08cm] {$A$} ($(ax)+(-0.5,-0.5)$); \draw [reduc] (1.5,-0.2) --++ (0.7,0) node [below left=-0.1cm] {$cut$}; \node[etc] (etc2) at ($(etc)+(1.4,0)$) {}; \draw[ar] (etc2) --++ (0,-0.5) node [type,right=-0.1cm] {$A$}; \end{scope} \begin{scope}[shift={(0,0)}] \node [forall] (fa) at (0, 0) {}; \node [exists] (ex) at ($(fa)+(0.7,0)$) {}; \node [etc] (etcfa) at ($(fa)+(0,0.8)$) {}; \node [etc] (etcex) at (etcfa-|ex) {}; \node [cut] (cut) at ($(ex)!0.5!(fa)+(0,-0.5)$) {}; \draw [ar] (etcfa) -- (fa) node [type,left=-0.08cm] {$A$}; \draw [ar] (etcex) -- (ex) node [type,right=-0.08cm] {$A^\perp[B/X]$}; \draw [ar,out=-90,in=180] (fa) to node [type,below left=-0.08cm,pos=0.5] {$\forall X.A$} (cut); \draw [ar,out=-90,in= 0] (ex) to node [type,below right=-0.08cm,pos=0.5]{$\exists X.A^\perp$} (cut); \draw [reduc] (1.8,0) --++ (0.8,0) node [below left=-0.1cm] {$cut$}; \node [etc] (etcfa2) at ($(etcfa)+(3.8,0)$) {}; \node [etc] (etcex2) at ($(etcex)+(3.8,0)$) {}; \node [cut] (cut) at ($(etcfa2)!0.5!(etcex2)+(0,-0.6)$) {}; \draw [ar,out=-90,in=180] (etcfa2) to node [edgename, below left] {$a$} node [type,left=-0.07,pos=0.25] {$A[B/X]$} (cut); \draw [ar,out=-90,in= 0] (etcex2) to node [edgename, below right] {$b$} node [type,right=-0.07,pos=0.25] {$A^\perp[B/X]$} (cut); \end{scope} \begin{scope}[shift={(3.2,-1.6)}] \node [par] (par) at (0,0) {}; \node [tensor] (tens) at ($(par)+(1.5,0)$) {}; \node [cut] (cut) at ($(par)!0.5!(tens)+(0,-0.5)$) {}; \node [etc] (pl) at ($(par) +(110:0.7)$) {}; \node [etc] (pr) at ($(par) +( 70:0.7)$) {}; \node [etc] (tl) at ($(tens)+(110:0.7)$) {}; \node [etc] (tr) at ($(tens)+( 70:0.7)$) {}; \draw [ar] (pl) -- (par) node [type,left] {$A$} node [edgename] {$a$}; \draw [ar] (pr) -- (par) node [type] {$B$} node [edgename,right] {$b$}; \draw [ar] (tl) -- (tens)node [type,left] {$A^\perp$} node [edgename] {$e$}; \draw [ar] (tr) -- (tens)node [type] {$B^\perp$} node [edgename,right] {$f$}; \draw [ar,out=-90,in=180] (par) to node [edgename,below left] {$c$} node [type,left,pos=0.25] {$A \parr B$} (cut); \draw [ar,out=-90,in= 0] (tens) to node [edgename,below right]{$d$} node [type,pos=0.25] {$A^\perp \otimes B^\perp$}(cut); \draw [reduc] (2.4,0.4) --++(0.7,0) node [below left=-0.1cm] {$cut$}; \node (pl2) at ($(pl)+(4, 0)$) {}; \node (pr2) at ($(pr)+(4,0)$) {}; \node (tl2) at ($(tl)+(4,0)$) {}; \node (tr2) at ($(tr)+(4,0)$) {}; \node [cut] (cutl) at ($(pl2)!0.5!(tl2)+(-0.3,-0.7)$) {}; \node [cut] (cutr) at ($(pr2)!0.5!(tr2)+( 0.3,-0.7)$) {}; \draw [ar,out=-90,in=180] (pl2) to node [type,pos=0.1,left] {$A$} node [edgename,pos=0.15] {$a$} (cutl); \draw [ar,out=-90,in= 0] (tl2) to node [type,right=-0.08cm, pos=0.1] {$A^\perp$} node [edgename,pos=0.1] {$e$} (cutl); \draw [ar,out=-90,in=180] (pr2) to node [type,pos=0.1,left] {$B$} node [edgename,pos=0.1] {$b$} (cutr); \draw [ar,out=-90,in= 0] (tr2) to node [type,pos=0.1] {$B^\perp$} node [edgename,pos=0.15] {$f$} (cutr); \end{scope} \end{tikzpicture} \caption{\label{cut_elim_non_exp_rules}Non-exponential cut-elimination steps. For the $\forall/\exists$ step, $[B/X]$ takes place on the whole net.} \end{figure} \paragraph{Cut-elimination} is a relation $\cutRel$ on ($LL$) proof-nets which is related to the $\beta$-reduction of $\lambda$-calculus. Figures \ref{cut_elim_non_exp_rules} and \ref{cut_elim_exp_rules} describe the rules of cut-elimination. \begin{figure}\centering \begin{subfigure}{\textwidth} \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=2.5cm] (G) at (0,0) {$G'$}; \node [princdoor] (pr) at ($(G.-13)+(0,-0.7)$) {}; \node [above] at ($(pr)+(0.5,0)$) {$\mathbf{B}$}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-167)+(0,-0.7)$) {}; \draw (a2)--(pr) -| ++(0.7,1.3) -| ($(a1)+(-0.55,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-13)--(pr) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G.-90)--(a2) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (G.-167)--(a1) node [edgename] {$a_1$} node [type] {$A_1$}; \draw [ar] (a2)--++(0,-0.65) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \draw [ar] (a1)--++(0,-0.65) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \node [der] (der) at ($(pr)+(1.2,0)$) {}; \node [cut] (cut)at ($(pr)!0.5!(der)+(0,-0.6)$) {}; \draw [ar,out=-90,in=180] (pr) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc A$} (cut); \draw [ar,out=-90,in= 0] (der) to node [edgename,right] {$d$} node [type,pos=0.3] {$\wn A^\perp$}(cut); \node [etc] (etc) at ($(der)+(0,1)$) {}; \draw [ar] (etc) -- (der) node [edgename] {$b$} node [type] {$A^\perp$}; \draw [->,very thick] (4,-0.7) --++(1,0) node [below left=-0.1cm] {$cut$}; \node [proofnet,minimum width=2.5cm] (H) at ($(G)+(8,0)$) {$G'$}; \node [der] (b2) at ($(H.-90)+(0,-0.7)$) {}; \node [der] (b1) at ($(H.-167)+(0,-0.7)$) {}; \draw [dotted] (b1)--(b2); \draw [ar] (H.-90)--(b2) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (H.-167)--(b1) node [edgename] {$a_1$} node [type] {$A_1$}; \draw [ar] (b1)--++(0,-0.6) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \draw [ar] (b2)--++(0,-0.6) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \node [etc] (etd) at ($(etc)+(8,0)$) {}; \node [cut] (cut)at ($(H.-13)!0.5!(etd)+(0,-0.8)$) {}; \draw [ar,out=-90,in=180] (H.-13) to node [edgename,below left] {$a$} node [type,pos=0.2] {$A$} (cut); \draw [ar,out=-90,in= 0] (etd) to node [edgename,right] {$b$} node [type,pos=0.3] {$A^\perp$} (cut); \end{tikzpicture} \end{subfigure} \vspace{1em} \begin{subfigure}{\textwidth} \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=2.2cm] (G) at (0,0) {$G'$}; \node [princdoor] (prg) at ($(G.-16)+(0,-0.7)$) {}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-164)+(0,-0.7)$) {}; \draw (a2)--(prg) -| ++(0.4,1.3) -| ($(a1)+(-0.4,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-16)--(prg) node [type,right=-0.06cm] {$A$} node [edgename] {$a$}; \draw [ar] (G.-90)--(a2) node [type,right=-0.06cm] {$A_k$} node [edgename] {$a_k$}; \draw [ar] (a2)--++(0,-0.65) node [type,right=-0.06cm] {$\wn A_k$} node [edgename] {$c_k$} ; \draw [ar] (G.-164)--(a1) node [type,right=-0.06cm] {$A_1$} node [edgename] {$a_1$}; \draw [ar] (a1)--++(0,-0.65) node [type,right=-0.06cm] {$\wn A_1$} node [edgename] {$c_1$}; \node [proofnet,minimum width=2.2cm] (H) at ($(G)+(3,0)$) {$H'$}; \node [princdoor] (prh) at ($(H.-16)+(0,-0.7)$) {}; \node [auxdoor] (b2) at ($(H.-90)+(0,-0.7)$) {}; \node [auxdoor] (b1) at ($(H.-164)+(0,-0.7)$) {}; \draw (b2)--(prh) -| ++(0.4,1.3) -| ($(b1)+(-0.4,0)$) -- (b1); \draw [dotted] (b1)--(b2); \draw [ar] (H.-16)--(prh) node [type,right=-0.06cm] {$B$} node [edgename] {$b$}; \draw [ar] (H.-90) --(b2) node [type,right=-0.06cm] {$B_l$} node [edgename] {$b_l$}; \draw [ar] (b2)--++(0,-0.65) node [type,right=-0.06cm] {$\wn B_l$} node [edgename] {$d_l$}; \draw [ar] (H.-164)--(b1) node [type,right=-0.06cm] {$A^\perp$} node [edgename] {$b_1$}; \draw [ar] (prh)--++(0,-0.65) node [type,right=-0.06cm] {$\oc B$} node [edgename] {$d$}; \node [cut] (cut) at ($(prg)!0.5!(b1)+(0,-0.65)$) {}; \draw [ar,out=-90,in=180] (prg) to node [edgename, below left] {$c$} node [type,pos=0.2] {$\oc A$} (cut); \draw [ar,out=-90,in= 0] (b1) to node [edgename, below right=-0.2cm] {$d_1$} node [type,pos=0.2] {$\wn A^\perp$} (cut); \draw [reduc] (4.4,0)--++(0.7,0) node [below left=-0.1cm] {$cut$}; \node [proofnet,minimum width=2.2cm] (G) at ($(G)+(6.9,0)$) {$G'$}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-164)+(0,-0.7)$) {}; \node [proofnet,minimum width=2.5cm] (H) at ($(G)+(2.9,0)$) {$H'$}; \node [princdoor] (prh) at ($(H.-14)+(0,-0.7)$) {}; \node [auxdoor] (b2) at ($(H.-41)+(0,-0.7)$) {}; \node [auxdoor] (b1) at ($(H.-159)+(0,-0.7)$) {}; \node [cut] (cut)at ($(G.-16)!0.5!(H.-170)+(0,-0.6)$) {}; \draw [ar,out=-90,in=180] (G.-18) to node [edgename, below left =-0.1] {$a$} node [type,pos=0.3] {$A$} (cut); \draw [ar,out=-90,in= 0] (H.-170) to node [edgename, below right=-0.15] {$b_1$} node [type,pos=0.3] {$A^\perp$}(cut); \draw (b2)--(prh) -| ++(0.4,1.3) -| ($(a1)+(-0.4,0)$) -- (a1); \draw (a2)--(b1); \draw [dotted] (a1)--(a2); \draw [dotted] (b1)--(b2); \draw [ar] (G.-90)--(a2) node [type] {$A_k$} node [edgename] {$a_k$}; \draw [ar] (a2)--++(0,-0.8) node [type] {$\wn A_k$} node [edgename] {$c_k$}; \draw [ar] (G.-164)--(a1) node [type] {$A_1$} node [edgename] {$a_1$}; \draw [ar] (a1)--++(0,-0.8) node [type] {$\wn A_1$} node [edgename] {$c_1$}; \draw [ar] (H.-41)--(b2) node [type] {$B_l$} node [edgename] {$b_l$}; \draw [ar] (b2)--++(0,-0.8) node [type] {$\wn B_l$} node [edgename] {$d_l$}; \draw [ar] (H.-159)--(b1) node [type] {$B_2$} node [edgename,left=-0.1cm] {$b_2$}; \draw [ar] (b1)--++(0,-0.8) node [type] {$\wn B_2$} node [edgename] {$d_2$}; \draw [ar] (H.-14)--(prh) node [type] {$B$} node [edgename] {$b$}; \draw [ar] (prh)--++(0,-0.8) node [type] {$\oc B$} node [edgename] {$d$}; \end{tikzpicture} \end{subfigure} \vspace{1em} \begin{subfigure}{\textwidth} \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=2.2cm] (G) at (0,0) {$G'$}; \node [princdoor] (pr) at ($(G.-16)+(0,-0.7)$) {}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-164)+(0,-0.7)$) {}; \draw (a2)--(pr) -| ++(0.5,1.3) -| ($(a1)+(-0.55,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-16)--(pr) node [edgename] {$a$} node [type,right=-0.06cm] {$A$}; \draw [ar] (G.-90)--(a2) node [edgename] {$a_k$} node [type,right=-0.06cm] {$A_k$}; \draw [ar] (G.-164)--(a1) node [edgename] {$a_1$} node [type,right=-0.06cm] {$A_1$}; \draw [ar] (a2)--++(0,-0.65) node [edgename] {$d_k$} node [type,right=-0.06cm] {$\wn A_k$}; \draw [ar] (a1)--++(0,-0.65) node [edgename] {$d_1$} node [type,right=-0.06cm] {$\wn A_1$}; \node [weak] (wk) at ($(pr)+(1,0)$) {}; \node [cut] (cut)at ($(pr)!0.5!(wk)+(0,-0.6)$) {}; \draw [ar,out=-90,in=180] (pr) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc A$} (cut); \draw [ar,out=-90,in= 0] (wk) to node [edgename,right] {$d$} node [type,pos=0.3] {$\wn A^\perp$} (cut); \draw [->,very thick] (2.7,-0.7) --++(0.8,0) node [below left=-0.1cm] {$cut$}; \node [weak] (b1) at ($(a1)+(4.8,0)$) {}; \node [weak] (b2) at ($(a2)+(5.3,0)$) {}; \draw [ar] (b1)--++(0,-0.65) node [edgename] {$d_1$} node [type] {$\wn A_1$}; \draw [ar] (b2)--++(0,-0.65) node [edgename] {$d_k$} node [type] {$\wn A_k$}; \draw [dotted] (b1)--(b2); \end{tikzpicture} \end{subfigure} \vspace{1em} \begin{subfigure}{\textwidth} \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=2.5cm] (G) at (0,0) {$G'$}; \node [princdoor] (pr) at ($(G.-16)+(0,-0.7)$) {}; \node [above] at ($(pr)+(0.5,0)$) {$\mathbf{B}$}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-164)+(0,-0.7)$) {}; \draw (a2)--(pr) -| ++(0.7,1.3) -| ($(a1)+(-0.55,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-16)--(pr) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G.-90)--(a2) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (G.-164)--(a1) node [edgename] {$a_1$} node [type] {$A_1$}; \draw [ar] (a2)--++(0,-0.8) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \draw [ar] (a1)--++(0,-0.8) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \node [dig] (dig) at ($(pr)+(2,0)$) {}; \node [cut] (cut)at ($(pr)!0.5!(dig)+(0,-0.8)$) {}; \draw [ar,out=-90,in=180] (pr) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc A$} (cut); \draw [ar,out=-90,in= 0] (dig) to node [edgename,right] {$d$} node [type,pos=0.3] {$\wn A^\perp$} (cut); \node [etc] (etc) at ($(dig)+(0,1)$) {}; \draw [ar] (etc) -- (dig) node [edgename,right] {$f$} node [type] {$\wn \wn A^\perp$}; \draw [->,very thick] (4.2,-0.7) --++(0.8,0) node [below left=-0.1cm] {$cut$}; \node [proofnet,minimum width=2.5cm] (G1) at ($(G)+(7,0)$) {$G'$}; \node [princdoor] (pri) at ($(G1.-13)+(0,-0.7)$) {}; \node [above=-0.1] at ($(pri)+(0.7,0)$) {$\mathbf{B_i}$}; \node [auxdoor] (a2i) at ($(G1.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1i) at ($(G1.-167)+(0,-0.7)$) {}; \draw (a2i)--(pri) -| ++(1,1.3) -| ($(a1i)+(-0.55,0)$) -- (a1i); \draw [dotted] (a1i)--(a2i); \draw [ar] (G1.-13)--(pri) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G1.-90)--(a2i) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (G1.-167)--(a1i)node [edgename] {$a_1$} node [type] {$A_1$}; \node [princdoor] (pre) at ($(pri)+(0,-0.9)$) {}; \node [above=-0.1] at ($(pre)+(0.8,0)$) {$\mathbf{B_e}$}; \node [auxdoor] (a2e) at ($(a2i)+(0,-0.9)$) {}; \node [auxdoor] (a1e) at ($(a1i)+(0,-0.9)$) {}; \draw (a2e)--(pre) -| ++(1.1,2.3) -| ($(a1e)+(-0.6,0)$) -- (a1e); \draw [dotted] (a1e)--(a2e); \draw [ar] (pri)--(pre) node [edgename] {$b$} node [type] {$\oc A$}; \draw [ar] (a2i)--(a2e) node [edgename] {$b_k$} node [type] {$\wn A_k$}; \draw [ar] (a1i)--(a1e) node [edgename] {$b_1$} node [type] {$\wn A_1$}; \node [dig] (dig1) at ($(a1e)+(0,-0.7)$) {}; \node [dig] (dig2) at ($(a2e)+(0,-0.7)$) {}; \draw [ar] (a1e)--(dig1) node [edgename] {$e_1$} node [type] {$\wn \wn A_1$}; \draw [ar] (a2e)--(dig2) node [edgename] {$e_k$} node [type] {$\wn \wn A_k$}; \draw [ar] (dig1)--++(0,-0.5) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \draw [ar] (dig2)--++(0,-0.5) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \node [etc] (etc) at ($(pri)!0.5!(pre)+(2,0)$) {}; \node [cut] (cut) at ($(pre)!0.5!(etc)+(0,-1.1)$) {}; \draw [ar,out=-90,in=180] (pre) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc \oc A$} (cut); \draw [ar,out=-90,in= 0] (etc) to node [edgename,right] {$f$} node [type,pos=0.3] {$\wn \wn A^\perp$} (cut) ; \end{tikzpicture} \end{subfigure} \vspace{1em} \begin{subfigure}{\textwidth} \begin{tikzpicture}[baseline=0.3cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=2.2cm] (G) at (0,0) {$G'$}; \node [princdoor] (pr) at ($(G.-16)+(0,-0.7)$) {}; \node [above] at ($(pr)+(0.5,0)$) {$\mathbf{B}$}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-164)+(0,-0.7)$) {}; \draw (a2)--(pr) -| ++(0.7,1.3) -| ($(a1)+(-0.45,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-16)--(pr) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G.-90)--(a2) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (G.-164)--(a1) node [edgename] {$a_1$} node [type] {$A_1$}; \draw [ar] (a2)--++(0,-0.8) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \draw [ar] (a1)--++(0,-0.8) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \node [cont] (cont)at ($(pr)+(1.7,0)$) {}; \node [cut] (cut) at ($(pr)!0.5!(cont)+(0,-0.8)$) {}; \draw [ar,out=-90,in=180] (pr) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc A$} (cut); \draw [ar,out=-90,in= 0] (cont) to node [edgename,right] {$d$} node [type,pos=0.3] {$\wn A^\perp$} (cut); \node [etc] (etcl) at ($(cont)+(110:1)$) {}; \node [etc] (etcr) at ($(cont)+( 70:1)$) {}; \draw [ar] (etcl) -- (cont) node [edgename] {$f$} node [type,left] {$\wn A^\perp$}; \draw [ar] (etcr) -- (cont) node [edgename,right] {$g$} node [type] {$\wn A^\perp$}; \draw [reduc] (3.1,-0.9) --++ (0.8,0) node [below left=-0.1cm] {$cut$}; \node [proofnet,minimum width=2.2cm] (Gl) at ($(G)+(5.2,0)$) {${G'}^l$}; \node [princdoor] (prl) at ($(Gl.-16)+(0,-0.7)$) {}; \node at ($(prl)+(0.41,0.17)$) {$\mathbf{B_l}$}; \node [auxdoor] (a2l) at ($(Gl.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1l) at ($(Gl.-164)+(0,-0.7)$) {}; \draw (a2l)--(prl) -| ++(0.6,1.4) -| ($(a1l)+(-0.27,0)$) -- (a1l); \draw [dotted] (a1l)--(a2l); \draw [ar] (Gl.-16)--(prl) node [edgename] {$a^l$} node [type] {$A$}; \draw [ar] (Gl.-90)--(a2l) node [edgename] {$a_k^l$} node [type] {$A_1$}; \draw [ar] (Gl.-164)--(a1l) node [edgename] {$a_1^l$} node [type] {$A_k$}; \node [proofnet,minimum width=2.2cm] (Gr) at ($(Gl)+(3.0,0)$) {${G'}^r$}; \node [princdoor] (prr) at ($(Gr.-16)+(0,-0.7)$) {}; \node at ($(prr)+(0.41,0.17)$) {$\mathbf{B_r}$}; \node [auxdoor] (a2r) at ($(Gr.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1r) at ($(Gr.-164)+(0,-0.7)$) {}; \draw (a2r)--(prr) -| ++(0.6,1.4) -| ($(a1r)+(-0.27,0)$) -- (a1r); \draw [dotted] (a1r)--(a2r); \draw [ar] (Gr.-16)--(prr) node [edgename] {$a^r$} node [type] {$A$}; \draw [ar] (Gr.-90)--(a2r) node [edgename] {$a_k^r$} node [type] {$A_1$}; \draw [ar] (Gr.-164)--(a1r) node [edgename] {$a_1^r$} node [type] {$A_k$}; \node [cont] (c1) at ($(a1l)!0.2!(a1r)+(0,-1.2)$) {}; \node [cont] (c2) at ($(a2l)!0.35!(a2r)+(0,-1.2)$) {}; \draw [ar] (a1l)--(c1) node [edgename,left,pos=0.4] {$b_1^l$} node [type,left,pos=0.4] {$\wn A_1$}; \draw [ar] (a1r)--(c1) node [edgename,below right=-0.05,pos=0.85] {$b_1^r$} node [type,below right=-0.05,pos=0.85] {$\wn A_1$}; \draw [ar] (a2l)--(c2) node [edgename,left,pos=0.4] {$b_k^l$} node [type,left,pos=0.4] {$\wn A_k$}; \draw [ar] (a2r)--(c2) node [edgename,below right=-0.05,pos=0.85] {$b_k^r$} node [type,below right=-0.05,pos=0.85] {$\wn A_k$}; \draw [ar] (c1)--++(0,-0.8) node [edgename] {$c_1$} node [type] {$\wn A_1$}; \draw [ar] (c2)--++(0,-0.8) node [edgename] {$c_k$} node [type] {$\wn A_k$}; \node [etc] (etcl2) at ($(etcl)+(8,0)$) {}; \node [etc] (etcr2) at ($(etcr)+(8,0)$) {}; \node [cut] (cutl) at ($(prl)!0.5!(etcl2)+(0,-1.1)$) {}; \node [cut] (cutr) at ($(prr)!0.5!(etcr2)+(0,-1.1)$) {}; \draw [ar,out=-40,in=180] (prl) to node [edgename,below left,pos=0.85] {$c^l$} node [type,below,pos=0.85] {$\oc A$} (cutl); \draw [ar,out=-90,in= 0] (etcl2) to node [edgename,below,pos=0.87] {$f$} node [type,below,pos=0.85] {$\wn A^\perp$} (cutl); \draw [ar,out=-90,in=180] (prr) to node [edgename,below,pos=0.77] {$c^r$} node [type,below,pos=0.8] {$\oc A$} (cutr); \draw [ar,out=-90,in= 0] (etcr2) to node [edgename,below,pos=0.8] {$g$} node [type,below,pos=0.8] {$\wn A^\perp$} (cutr); \end{tikzpicture} \end{subfigure} \caption{\label{cut_elim_exp_rules}Exponential cut-elimination steps} \end{figure} \tikzstyle{edgename}=[opacity=1, midway, left, black] \begin{lemma}{\cite{girard1996proof}} Proof-nets and $LL$ proof-nets are stable under cut-elimination. \end{lemma} \subsection{Definition of Context Semantics} \label{section_def_cont_sem}A common method to prove strong bounds on a rewriting system is to assign a weight $W_G \in \mathbb{N}$ to each term $G$ such that, if $G$ reduces to $H$, $W_G > W_H$. In $LL$, the $\oc P/ \wn C$ step makes the design of such a weight hard: a whole box is duplicated, increasing the number of nodes, edges, cuts,... The idea of context semantics is to define $W_G$ as $|A_G|$ with $A_G$ the edges which {\em appear} during reduction: edges of a net $G_k$ such that $G \cutRel G_1 \cutRel \cdots \cutRel G_k$\footnote{We identify edges which are unaffected by reduction: in Figure~\ref{fig_ex_duplicates}, $k$ only counts once in in $A_G$.}. We can notice that whenever $G \cutRel H$, we have $A_H \subseteq A_G$: if $e \in A_H$ then $e$ is an edge of a proof-net $H_k$ with $H \cutRel H_1 \cdots H_k$ so $G \cutRel H \cutRel H_1 \cdots H_k$. Moreover, this inclusion is strict because the premises of the cut reduced between $G$ and $H$ are in $A_G$ but not in $A_H$. Thus, $|A_G| \geq |A_H|+2$\footnote{We can not deduce that $|A_G| > |A_H|$ because they might be both infinite.}. However, such a definition of $W_G$ would be impractical: proving a bound on $W_G$ does not seem easier than directly proving a bound on the number of reduction steps. The solution of context semantics is to consider for every edge $e$ of $E_G$, the set $\can{e}$ of {\em residues of $e$}: the elements of $A_G$ ``coming'' from $e$. For instance, in the leftmost proof-net of Figure~\ref{fig_ex_duplicates}, the residues of $e$ are $\{e,e_1,e_2,e_3,e_4\}$. The set $\can{E_G}$ of every edge residue is contained in $A_G$ but is not always equal to it (e.g. the premises of the two cuts in the middle proof-net of Figure~\ref{fig_ex_duplicates} are not residues of any edge of the leftmost proof-net so they are in $A_G$ but not in $\can{E_G}$. Nonetheless, we still have $|\can{E_G}| \geq |\can{E_H}|+1$ whenever $G \cutRel H$, so the length of any path of reduction beginning by $G$ is at most $|\can{E_G}|$ (Theorem~\ref{theo_dallago_edges}). To bound $W_G$, we characterize edge residues by context semantics paths, simulating cut-elimination. Those paths are generated by {\em contexts} travelling across the proof-net according to some rules. The paths of context semantics in a proof-net $G$ are exactly the paths which are preserved by cut-elimination (such paths are called {\em persistent} in the literature~\cite{danos1995proof}). Computing those paths is somehow like reducing the proof-net. Proving bounds on the number of residues thanks to those paths rather than proving bounds directly on the reduction offers two advantages: \begin{itemize} \item Complex properties on proof-nets, which may be hard to manipulate formally, are transformed into existence (or absence) of paths of a certain shape. \item For every $G \cutRel H$, we have $W_G > W_H$. Thus, the length of {\em any} normalization sequence is bounded by $W_G$. The bounds obtained in this paper do not depend on the reduction strategy. \end{itemize} To represent lists we use the notation $[a_1;\cdots;a_n]$.\label{def_arobase} To represent concatenation, we use $@$: $[a_1;\cdots;a_n]@[b_1;\cdots;b_k]$ is defined as $[a_1;\cdots;a_n;b_1;\cdots;b_k]$ and \label{def_insertion}$.$ represents ``push'' ($[a_1;\cdots;a_n].b$ is defined as $[a_1;\cdots;a_n;b]$).\label{def_listrestriction} $|[a_1;\cdots;a_j]|$ refers to $j$, the length of the list. If $X$ is a set, $|X|$ is the number of elements of $X$ A context is a pair $((e,P),T)$ composed of a {\em potential edge} $(e,P)$ representing an edge residue ($e$ is a directed edge of the proof-net) and a {\em trace} $T$ used to remember some information about the beginning of the path. This information is necessary to ensure that the paths are preserved by cut-elimination. The following definitions introduce the components of potential edges and traces. \begin{figure}\centering \begin{tikzpicture} \draw [very thick,->] (3.2,0) --++ (0.5,0); \draw [very thick,->] (8.45,0) --++ (0.5,0) node [above] {$5$}; \begin{scope} \node [princdoor] (bi) at (0,0) {}; \node [par] (p) at ($(bi)+(0,0.6)$) {}; \node [ax] (a) at ($(p)+(0,0.5)$) {}; \draw [ar] (a) to [out= -20,in= 60] (p); \draw [ar] (a) to [out=-160,in=120] (p); \draw (bi) -| ++(0.6,1.24) -| ($(bi)+(-0.4,0)$) -- (bi); \node [above] at ($(bi)+(0.45,-0.05)$) {${\mathbf C}$}; \draw [ar] (p)--(bi) node [edgename] {$e$}; \node [princdoor] (b) at ($(bi)+(0,-0.8)$) {}; \node[above] at ($(b)+(0.5,-0.05)$) {${\mathbf B}$}; \draw (b) -| ++(0.67,2.1) -| ($(b)+(-0.45,0)$) -- (b); \draw [ar] (bi) -- (b) node [edgename] {$a$}; \node [cont] (c) at ($(b) +(1.4,0)$) {}; \node [cut] (cut)at ($(b)!0.5!(c)+(0,-0.45)$) {}; \node [weak] (w) at ($(c) +(120:0.8)$) {}; \node [auxdoor] (d) at ($(c) +( 60:0.8)$) {}; \node [cont] (ci) at ($(d) +( 90:0.6)$) {}; \node [tensor] (t) at ($(ci)+(0.9,0)$) {}; \node [princdoor] (pri) at (d-|t) {}; \node [ax] (ab) at ($(ci)!0.5!(t)+(0,0.35)$) {}; \node [ax] (ah) at ($(ci)!0.5!(t)+(0,0.6)$) {}; \draw [ar] (b) to [out=-90,in=180] node [edgename,pos=0.11,left] {$b$} (cut); \draw [ar] (c) to [out=-90,in= 0] node [edgename,right] {$c$}(cut); \draw [ar] (w) -- node [edgename,pos=0.3, below left=-0.1cm] {$j$} (c); \draw [ar] (d) to [out=-90,in=60] node [edgename,right] {$d$} (c); \draw [ar] (ci) to node [edgename] {$f$} (d); \draw [ar] (ab) to [out=180,in= 60] (ci); \draw [ar] (ah) to [out=180,in=120] node [edgename,pos=0.5,above left=-0.05] {$g$} (ci); \draw [ar] (ab) to [out=-20,in=120] (t); \draw [ar] (ah) to [out=-20,in= 60] node [edgename,pos=0.5,above right=-0.05] {$h$} (t); \draw [ar] (t) -- (pri) node [edgename,right] {$i$}; \draw [ar] (pri)--++(0,-0.5) node [edgename,right] {$k$}; \draw (pri)-| ++(0.4,1.4) -| ($(d)+(-0.4,0)$) -- (d) -- (pri); \end{scope} \begin{scope}[shift={(4.3,0)}] \node [princdoor] (bi1) at (0,0) {}; \node [par] (p1) at ($(bi1)+(0,0.6)$) {}; \node [ax] (a1) at ($(p1)+(0,0.5)$) {}; \draw [ar] (a1) to [out= -20,in= 60] (p1); \draw [ar] (a1) to [out=-160,in=120] (p1); \draw (bi1) -| ++(0.6,1.25) -| ($(bi1)+(-0.45,0)$) -- (bi1); \draw [ar] (p1)--(bi1) node [edgename,left] {$e_1$}; \node [above] at ($(bi1)+(0.4,-0.05)$) {${\mathbf C_1}$}; \node [princdoor] (b1) at ($(bi1)+(0,-0.8)$) {}; \draw (b1) -| ++(0.65,2.1) -| ($(b1)+(-0.5,0)$) -- (b1); \node[above] at ($(b1)+(0.45,-0.05)$) {${\mathbf B_1}$}; \draw [ar] (bi1) -- (b1) node [edgename,left] {$a_1$}; \node [weak] (w) at ($(b1)+(0.95,0)$) {}; \node [cut] (c1) at ($(b1)!0.5!(w)+(0,-0.45)$) {}; \draw [ar] (b1) to [out=-90,in=180] (c1); \draw [ar] (w) to [out=-90,in= 0] (c1); \node [princdoor] (bi2) at ($(bi1)+(1.8,0)$) {}; \node [above] at ($(bi2)+(0.4,-0.05)$) {${\mathbf C_2}$}; \node [par] (p2) at ($(bi2)+(0,0.6)$) {}; \node [ax] (a2) at ($(p2)+(0,0.5)$) {}; \draw [ar] (a2) to [out= -20,in= 60] (p2); \draw [ar] (a2) to [out=-160,in=120] (p2); \draw (bi2) -| ++(0.6,1.25) -| ($(bi2)+(-0.45,0)$) -- (bi2); \draw [ar] (p2)--(bi2) node [edgename] {$e_2$}; \node [princdoor] (b2) at ($(bi2)+(0,-0.8)$) {}; \draw (b2) -| ++(0.65,2.1) -| ($(b2)+(-0.5,0)$) -- (b2); \node[above] at ($(b2)+(0.45,-0.05)$) {${\mathbf B_2}$}; \draw [ar] (bi2) -- (b2) node [edgename] {$a_2$}; \node [auxdoor] (d) at ($(b2) +(1.2,0)$) {}; \node [cut] (c2) at ($(b2)!0.5!(d)+(0,-0.5)$) {}; \draw [ar] (b2) to [out=-90,in=180] (c2); \draw [ar] (d) to [out=-90,in= 0] (c2); \node [cont] (ci) at ($(d) +( 90:0.7)$) {}; \node [tensor] (t) at ($(ci)+(0.7,0)$) {}; \node [princdoor] (pri) at (d-|t) {}; \draw (pri)-| ++(0.35,1.6) -| ($(d)+(-0.35,0)$) -- (d) -- (pri); \node [ax] (ab) at ($(ci)!0.5!(t)+(0,0.4)$) {}; \node [ax] (ah) at ($(ci)!0.5!(t)+(0,0.7)$) {}; \draw [ar] (b) to [out=-90,in=180] (cut); \draw [ar] (c) to [out=-90,in= 0] (cut); \draw [ar] (ci) to (d); \draw [ar] (ab) to [out=180,in= 60] (ci); \draw [ar] (ah) to [out=180,in=120] (ci); \draw [ar] (ab) to [out=-20,in=120] (t); \draw [ar] (ah) to [out=-20,in= 60] (t); \draw [ar] (t) -- (pri); \draw [ar] (pri) --++(0,-0.6) node [edgename] {$k$}; \end{scope} \begin{scope}[shift={(10.2,-0.6)}] \node [tensor] (t) at ($(0,0.3)$) {}; \node [princdoor] (pri) at ($(t)+(0,-0.6)$) {}; \node [princdoor] (b1) at ($(t)+(140:0.7)$) {}; \node [princdoor] (b2) at ($(t)+( 40:0.7)$) {}; \node [par] (p1) at ($(b1)+(0,0.6)$) {}; \node [par] (p2) at ($(b2)+(0,0.6)$) {}; \node [ax] (a1) at ($(p1)+(0,0.45)$) {}; \node [ax] (a2) at ($(p2)+(0,0.45)$) {}; \draw (b1) -| ++(0.5,1.16) -| ($(b1)+(-0.37,0)$) -- (b1); \draw (b2) -| ++(0.5,1.16) -| ($(b2)+(-0.37,0)$) -- (b2); \draw [ar] (a1) to [out= -20,in= 60] (p1); \draw [ar] (a1) to [out=-160,in=120] (p1); \draw [ar] (a2) to [out= -20,in= 60] (p2); \draw [ar] (a2) to [out=-160,in=120] (p2); \draw [ar] (p1) -- (b1) node [edgename,right] {$e_3$}; \draw [ar] (p2) -- (b2) node [edgename,right] {$e_4$}; \draw [ar] (b1) -- (t) node [edgename, below left=-0.1cm] {$h$}; \draw [ar] (b2) -- (t); \draw [ar] (t) --(pri) node [edgename, right] {$i$}; \draw [ar] (pri)--++(0,-0.5) node [edgename,right] {$k$}; \draw (pri) -| ++(1.15,2.24) -| ($(pri)+(-1,0)$) -- (pri); \end{scope} \end{tikzpicture} \caption{\label{fig_ex_duplicates}\label{path_example}Cut-elimination of a proof-net.} \end{figure} The language $\sig$ of {\it signatures} is defined by induction by the following grammar:\label{def_sig} \begin{equation*} \sig = \sige \mid \sigl(\sig) \mid \sigr(\sig) \mid \sigp(\sig) \mid \sign(\sig,\sig) \end{equation*} A signature corresponds to a list of choices of premises of $?C$ nodes, to designate a particular residue of a box. The signature $\sigr(t)$ means: ``I choose the right premise, and in the next $?C$ nodes I will use $t$ to make my choices''. The construction $\sign(t,u)$ allows to encapsulate two sequels of choices into one. It corresponds to the digging rule ($\oc\oc A \vdash B \rightsquigarrow \oc A \vdash B$, represented by the $\digLab$ node in proof-nets) which ``encapsulates'' two $\oc$ modalities into one. The $\sigp(t)$ construction is a degenerated case of the $\sign$ construction. Intuitively, $\sigp(t)$ corresponds to $\sign(\varnothing, t)$. \label{def_potential}A {\em potential} is a list of signatures: a signature corresponds to the duplication of one box, but an element is copied whenever any of the boxes containing it is cut with a $?C$ node. The set of potentials is written $\Pot$. For every edge $e \in \edges{G}$, we define $Pot(e)$ as $\Set{(e,P)}{P \in Pot \text{ and }|P|=\depth{e}}$ such pairs are named {\em potential edges}. Potentials are used to represent residues. For instance, the residues of $e$ in Figure~\ref{fig_ex_duplicates}, ($e$, $e_1$, $e_2$, $e_3$ and $e_4$) are respectively represented by the potential edges $(e,[\sige;\sige])$, $(e,[\sigl(\sige);\sige])$, $(e,[\sigr(\sige);\sige])$, $(e,[\sigr(\sige);\sigl(\sige)])$ and $(e,[\sigr(\sige);\sigr(\sige)])$. \label{def_traceelement}A {\em trace element} is one of the following symbols: $\parr_l , \parr_r, \otimes_l, \otimes_r, \forall, \exists,!_t,?_t$ with $t$ a signature. A trace element means ``I have crossed a node with this label, from that premise to its conclusion''.\label{def_trace} A {\em trace } is a non-empty list of trace elements. The set of traces is $\trace$. A trace is a memory of the path followed, up to cut-eliminations. \label{def_dual_trace}We define duals of trace elements: $\parr_l^\perp = \otimes_l$, $!_t^\perp = ?_t$,... and extend the notion to traces by $[a_1; \cdots ; a_k]^\perp = [a_1^\perp; \cdots ; a_k^\perp]$. \label{def_context}A {\em context} is a tuple $((e,P),T)$ with $(e,P)$ a potential edge and $T \in \trace$. It can be seen as a state of a token that travels around the net. It is located on edge $e$ (more precisely its residue corresponding to $P$) and carries information $T$ about its past travel. The set of contexts of $G$ is written $\context{G}$. We extend the mapping $(\_)^{\perp}$ on contexts by $((e,P),T)^{\perp}=((\overline{e},P),T^{\perp})$. \nvar{\sepColonnes}{3cm} \nvar{\sepRegles}{3.5cm} \begin{figure}\centering \begin{tikzpicture} \node [cut] (n) at (0, 0) {}; \draw [ar,out=-100,in= 20] ($(n)+( 30:0.7)$) to node [edgename, below right=-0.08cm] {$f$} (n.0); \draw [ar,out= -80,in=160] ($(n)+(150:0.7)$) to node [edgename, below left=-0.05cm] {$e$} (n.180); \node [ax] (n) at (\sepColonnes,0.2) {}; \draw [ar,out=-160,in= 80] (n.180) to node [edgename,above left=-0.07cm] {$g$} ($(n)+(-150:0.7)$); \draw [ar,out= -20,in=100] (n.0) to node [edgename,above right=-0.07cm]{$h$} ($(n)+( -30:0.7)$); \draw (-1,-1) node [right] (rules) { $\begin{array}{lllll} ((e,P),&\hspace{-0.2em}T) &\hspace{-0.2em} \rightsquigarrow&\hspace{-0.2em} ((\overline{f},P),&\hspace{-0.2em}T)\\ ((\overline{g},P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow&\hspace{-0.2em} ((h,P),&\hspace{-0.2em}T) \end{array}$ }; \begin{scope}[shift={(0,-2.4)}] \node [par] (n) at (0,0) {}; \draw[ar] ($(n)+(120:0.5)$)--(n) node [edgename, left] {$a$}; \draw[ar] ($(n)+( 60:0.5)$)--(n) node [edgename, right] {$b$}; \draw[ar] (n) --++(-90:0.4) node [edgename, right] {$c$}; \node [tensor] (n) at (\sepColonnes,0) {}; \draw[ar] ($(n)+(120:0.5)$)--(n) node [edgename, left] {$e$}; \draw[ar] ($(n)+ (60:0.5)$)--(n) node [edgename, right] {$f$}; \draw[ar] (n) --++(-90:0.4) node [edgename, right] {$g$}; \draw (-1,-1.5) node [right] (rules) { $\begin{array}{lllll} ((a,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((c,P),&\hspace{-0.2em} T.\parr_l) \\ ((b,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((c,P),&\hspace{-0.2em} T.\parr_r) \\ ((e,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((g,P),&\hspace{-0.2em} T.\otimes_l) \\ ((f,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((g,P),&\hspace{-0.2em} T.\otimes_r) \end{array}$ }; \end{scope} \begin{scope}[shift={(6.5,0)}] \node[forall] (fa) at (0,0.1) {}; \draw[ar] ($(fa)+(0,0.45)$)--(fa) node [midway, left] {$e$}; \draw[ar] (fa) --++(0,-0.45) node [midway, left] {$f$}; \node[exists] (ex) at (\sepColonnes,0.1) {}; \draw[ar] ($(ex)+(0,0.45)$) -- (ex) node [midway, left] {$g$}; \draw[ar] (ex) --++(0,-0.45) node [midway, left] {$h$}; \draw (-1,-1) node [right] (rules) { $\begin{array}{lllll} ((e,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow&\hspace{-0.2em} ((f,P),&\hspace{-0.2em} T.\forall) \\ ((g,P),&\hspace{-0.2em}T) &\hspace{-0.2em}\rightsquigarrow&\hspace{-0.2em} ((h,P),&\hspace{-0.2em} T.\exists) \end{array}$ }; \end{scope} \begin{scope}[shift={(6,-2.35)}] \node[der] (n) at (0,0) {}; \draw[ar] ($(n)+(0,0.45)$)--(n) node [edgename, left] {$e$}; \draw[ar] (n) --++(0,-0.45) node [edgename, left] {$f$}; \node[cont] (n) at (\sepColonnes,0) {}; \draw[ar] ($(n)+(120:0.45)$)--(n) node [edgename] {$g$}; \draw[ar] ($(n)+( 60:0.45)$)--(n) node [edgename, right] {$h$}; \draw[ar] (n) --++(-90:0.45) node [edgename] {$i$}; \draw (-1,-1.3) node [right] (rules) { $\begin{array}{lllll} ((e,P),&\hspace{-0.2em} T ) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((f,P),&\hspace{-0.2em} T.?_{\sige})\\ ((g,P),&\hspace{-0.2em} T.?_t) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((i,P),&\hspace{-0.2em} T.?_{\sigl(t)})\\ ((h,P),&\hspace{-0.2em} T.?_t) &\hspace{-0.2em}\rightsquigarrow &\hspace{-0.2em}((i,P),&\hspace{-0.2em} T.?_{\sigr(t)})\\ \end{array}$ }; \end{scope} \begin{scope}[shift={(0,-5.8)}] \node [dig] (n) at (2,0) {}; \draw[ar] ($(n)+(90:0.5)$) -- (n) node [edgename] {$g$}; \draw[ar] (n) --++(-90: 0.5) node [edgename] {$h$}; \draw (-1,-1.15) node [right] (rules) { $\begin{array}{lllll} ((g,P),&\hspace{-0.2em} T.\wn_{t_1}.\wn_{t_2}) &\hspace{-0.2em}\rightsquigarrow&\hspace{-0.2em} ((h,P),&\hspace{-0.2em} T.\wn_{\sign(t_1,t_2)})\\ ((g,P),&\hspace{-0.2em} [\wn_t]) &\hspace{-0.2em}\rightsquigarrow&\hspace{-0.2em} ((h,P),&\hspace{-0.2em} [\wn_{\sigp(t)}]) \end{array}$ }; \end{scope} \begin{scope}[shift={(6.8,-5.3)}] \node [auxdoor] (n) at (0, 0) {}; \draw[ar] ($(n)+(0,0.5)$) -- (n) node [edgename] {$e$}; \draw[ar] (n) --++(0,-0.5) node [edgename] {$f$}; \node [princdoor] at (\sepColonnes,0) (m) {}; \draw[ar] ($(m)+(0,0.5)$) -- (m) node [edgename] {$g$}; \draw[ar] (m) --++(0,-0.5) node [edgename] {$h$}; \draw (n) -| ++(-.5,.6) (n)--(m) -| ++(.5,.6); \draw (-1,-1.4) node [right] (rules) { $\begin{array}{lllll} ((e, P.t),&\hspace{-0.2em} T) &\hspace{-0.2em}\rightsquigarrow \hspace{-0.2em}& ((f,P),&\hspace{-0.2em} T.?_t) \\ ((g, P.t),&\hspace{-0.2em} T) &\hspace{-0.2em}\rightsquigarrow \hspace{-0.2em}& ((h,P),&\hspace{-0.2em} T.!_t) \\ ((\overline{f},P),&\hspace{-0.2em} [!_t]) &\hspace{-0.2em}\hookrightarrow \hspace{-0.2em}& ((h, P),&\hspace{-0.2em} [!_t]) \\ \end{array}$}; \end{scope} \end{tikzpicture} \caption{\label{exponential_context_semantic} Rules of the context semantics} \end{figure} \label{def_nojump}\label{def_onlyjump}The nodes define two relations $\noJump$ and $\onlyJump$ on contexts (Figure~\ref{exponential_context_semantic}). For any rule $C \noJump D$ presented in Figure~\ref{exponential_context_semantic}, we also define the dual rule $D^{\perp} \noJump C^{\perp}$. \label{def_csrel}We define $\csRel$ as the union of $\noJump$ and $\onlyJump$. In other words, $\csRel$ is the smallest relation on contexts including every instance of $\noJump$ rules in Figure~\ref{exponential_context_semantic} together with every instance of their duals and every instance of the $\onlyJump$ rule. The rules are sound: if $((e,P),T) \csRel ((f,Q),U)$, then $\depth{e}=|P|$ iff $\depth{f}=|Q|$. Those relations are deterministic. In particular, if $C=((e,P),T.\wn_t)$ with $e$ the premise of a $\digLab$ node or $C=((\overline{\sigma_i(B)},P),T.\oc_t)$, the context $D$ such that $C \csRel D$ depends on the size of $T$: there is a rule in the case $T=[]$ and another in the case $T \neq []$. Let us notice that $\noJump$ is injective (Lemma~\ref{lemma_nojump_injective}). It is not the case for the $\csRel$ relation. Indeed, if $B$ is a box with two auxiliary doors then, for every potential $P$ and signature $t$, we have $((\overline{\sigma_1(B)},P),[\oc_t]) \csRel ((\sigma(B),P),[\oc_t])$ and $((\overline{\sigma_2(B)},P),[\oc_t]) \csRel ((\sigma(B),P),[\oc_t])$. \begin{lemma}{\label{lemma_nojump_injective}} If $C_1 \noJump D$ and $C_2 \noJump D$ then $C_1=C_2$ \end{lemma} Finally, we can observe that for every sequence $((e_1,P_1),T_1) \noJump ((e_2,P_2),T_2) \noJump \cdots ((e_n,P_n),T_n)$, the sequence of directed edges $e_1,\cdots, e_n$ is a path (i.e. the head of $e_i$ is the same node as the tail of $e_{i+1}$). The $\onlyJump$ relation breaks this property as it is non-local: it deals with two non-adjacent edges. The $\csRel$-paths represent the reduction of a proof-net because they are stable along reduction. For example, the path in the first proof-net of Figure~\ref{path_example}: \begin{align*} &((e,[\sigr(\sige);\sigl(\sige)]),[\parr_r]) \csRel ((a,[\sigr(\sige)]),[\parr_r;\oc_{\sigl(\sige)}]) \csRel ((b,[]),[\parr_r;\oc_{\sigl(\sige)};\oc_{\sigr(\sige)}]) \csRel\\ & ((\overline{c},[]),[\parr_r; \oc_{\sigl(\sige)};\oc_{\sigr(\sige)}]) \csRel ((\overline{d},[]),[\parr_r; \oc_{\sigl(\sige)};\oc_{\sige}]) \csRel ((\overline{f},[\sige]),[\parr_r; \oc_{\sigl(\sige)}]) \csRel \\ & ((\overline{g},[\sige]),[\parr_r; \oc_{\sige}]) \hspace{-0.15em}\csRel\hspace{-0.15em} ((h,[\sige]),[\parr_r; \oc_{\sige}]) \hspace{-0.15em}\csRel\hspace{-0.15em} ((i,[\sige]),[\parr_r; \oc_{\sige}; \otimes_r]) \hspace{-0.15em}\csRel\hspace{-0.15em} ((k,[]),[\parr_r;\oc_{\sige};\otimes_r;\oc_{\sige}]) \end{align*} becomes the path $((e_3,[\sige;\sige]),[\parr_r]) \csRel ((h,[\sige]),[\parr_r;\oc_{\sige}]) \csRel ((i,[\sige]),[\parr_r;\oc_{\sige};\otimes_r]) \csRel ((k,[]),[\parr_r;\oc_{\sige};\otimes_r;\oc_{\sige}])$ in the third proof-net of Figure~\ref{path_example}. \subsection{Dal Lago's weight theorem}\label{section_capturing_residues} As written earlier, potential edges are intended to ``correspond'' to residues. To precise this correspondence we first define, for every $G \cutRel H$ step, a partial mapping $\pi_{G \rightarrow H}(\_)$ from $\pot{H}$ to $\pot{G}$. For edges $e$ which are not affected by the step, we can define $\pi_{G\rightarrow H}(e,P)=(e,P)$. If the reduction step is a $\oc P / \wn C$ step (bottom of Figure~\ref{cut_elim_exp_rules}) and $e \in E_H$ is contained in $B_l$ (respectively $B_r$) then we define $\pi_{G \rightarrow H}(e,P.t@Q)=(e,P.\sigl(t)@Q)$ (respectively $(e,P.\sigr(t)@Q)$) with $|P|=\partial(B)$. If the reduction step is a $\oc P / \wn N$ step, $e$ is immediately contained in $B_e$ and $f$ is contained in $B_i$, then we define $\pi_{G \rightarrow H}(e,P.t)=(e,P.\sigp(t))$ and $\pi_{G \rightarrow H}(f,P.t.u@Q)=(f,P.\sign(t,u)@Q)$. If the reduction step is a $\oc P / \wn D$ step and $e \in E_H$ belongs to $G'$ then we define $\pi_{G \rightarrow H}(e,P@Q)=(e,P.\sige @Q)$. We do not detail every case and exception because the only purpose of this definition in this paper is to guide intuition. A more precise definition of the mapping is given (on contexts) in Definition~12 of~\cite{perrinelMegathese}. Let us suppose $G_1 \cutRel G_2 \cdots \cutRel G_k$ and $e'$ an edge of $G_k$. A potential edge $(e,P) \in \pot{\edges{G_1}}$ {\em corresponds} to $e'$ if $\pi_{G_1 \rightarrow G_2} \circ \cdots \circ \pi_{G_{k-1} \rightarrow G_k} (e',[\sige;\cdots;\sige]) = (e,P)$. Let $e \in \edges{G}$, there are potential edges in $\pot{e}$ which do not correspond to residues of $e$. For instance, in Figure~\ref{fig_ex_duplicates} $a$ has three residues: $a$, $a_1$ and $a_2$. The residue $a_1$ is obtained by choosing the left box during the duplication of box $B$, so it is represented by $(a,[\sigl(\sige)])$. Similarly, $a$ and $a_2$ are represented by $(a,[\sige])$ and $(a,[\sigr(\sige)])$. However, $(a,[\sigr(\sigl(\sige))])$ does not represent any residue. The potential node $(a,[\sigr(\sigl(\sige))])$ means that whenever the box $B_2$ is cut with a $\contLab$ node, we choose the left box. But this situation never happens. It can be observed by the following path: \begin{align*} ((\sigma(B),[]),[\oc_{\sigr(\sigl(\sige))}]) \csRel ((\overline{c},[]),[\oc_{\sigr(\sigl(\sige))}]) \csRel ((\overline{d},[]),[\oc_{\sigl(\sige)}]) \csRel ((k,[]),[\oc_{\sigl(\sige)}]) \not \csRel \end{align*} The $\sigl(\_)$ has not been used because we did not encounter a second $\wn C$ node. On the contrary, the signatures corresponding to residues are entirely used: \begin{align*} &((\sigma(B),[]),[\oc_{\sige}]) \csRel^0 ((b,[]),[\oc_{\sige}]) \\ &((\sigma(B),[]),[\oc_{\sigl(\sige)}]) \csRel^2 ((\overline{j},[]),[\oc_{\sige}]) \hspace{2em} ((\sigma(B),[]),[\oc_{\sigr(\sige)}]) \csRel^2 ((\overline{d},[]),[\oc_{\sige}]) \end{align*} This is why, in the absence of $\digLab$ nodes, we define the {\em canonical potentials} of $e \in B_{\depth{e}} \subset \cdots B_2 \subset B_1$ as the potential edges $(e,[p_1;\cdots;p_{\depth{e}}])$ such that, for $1 \leq i \leq \depth{e}$, we have $((\sigma(B_i),[p_1;\cdots;p_{i-1}]),[\oc_{p_i}]) \csRel^* ((\_,\_),[\oc_{\sige}])$ (throughout the article, we use $\_$ to denote an object whose name and value are not important to us, for example $C \csRel \_$ means $\exists D \in \context{G}, C \csRel D$). \begin{figure}\centering \begin{tikzpicture} \draw [->,very thick] (3,0) --++ (1,0); \node [princdoor] (p) at (0,0) {}; \node [auxdoor] (a) at ($(p)+(-0.8,0)$) {}; \node [ax] (ax)at ($(a)!0.5!(p)+(0,0.6)$) {}; \draw [ar,out=-170,in= 80] (ax) to node [pos=0.6,left] {$a$} (a); \draw [ar,out= -10,in=100] (ax) to (p); \draw (p) -| ++ (0.8,0.8) -| ($(a)+(-0.6,0)$) -- (a)-- (p); \node [above] at ($(p)+(0.5,0)$) {$\mathbf{B}$}; \node at ($(p)+(-2,0)$) {$G=$}; \draw [ar] (a) --++ (0,-0.7); \node [dig] (d) at ($(p)+(1.5,0)$) {}; \node [cut] (c) at ($(p)!0.5!(d)+(0,-0.5)$) {}; \draw [ar,out=-90,in=170] (p) to (c); \draw [ar,out=-90,in= 10] (d) to (c); \draw [ar] ($(d)+(0,0.5)$) to node [edgename,right] {$f$} (d); \begin{scope}[shift={(7.1,0.4)}] \node [princdoor] (p) at (0,0) {}; \node at ($(p)+(-2.1,-0.4)$) {$H=$}; \node [auxdoor] (a) at ($(p)+(-0.8,0)$) {}; \node [ax] (ax)at ($(a)!0.5!(p)+(0,0.5)$) {}; \draw [ar,out=-170,in= 80] (ax) to node [pos=0.6,left] {$a'$} (a); \draw [ar,out= -10,in=100] (ax) to (p); \draw (p) -| ++ (1,0.65) -| ($(a)+(-0.6,0)$) -- (a) -- (p); \node [above] at ($(p)+(0.7,0)$) {$\mathbf{B_2}$}; \node [princdoor] (p1) at ($(p)+(0,-0.7)$) {}; \node [auxdoor] (a1) at (a|-p1) {}; \draw (p1) -| ++ (1.2,1.4) -| ($(a1)+(-0.7,0)$) -- (a1) -- (p1); \node [above] at ($(p1)+(0.9,0)$) {$\mathbf{B_1}$}; \draw [ar] (a)--(a1); \draw [ar] (p)--(p1); \node [dig] (d) at ($(a1)+(0,-0.55)$) {}; \draw [ar] (a1)--(d); \draw [ar] (d) --++ (0,-0.3); \coordinate (etc) at ($(p1)+(1.5,0)$) ; \node [cut] (c) at ($(p1)!0.5!(etc)+(0,-0.5)$) {}; \draw [ar,out=-90,in=170] (p1) to (c); \draw [ar,out=-90,in= 10] (etc) to (c); \draw ($(etc)+(0,0.6)$) -- (etc) node [edgename,right] {$f'$}; \end{scope} \end{tikzpicture} \caption{\label{fig_intui_digging}The potential edge $(a,[\sign(t_2,t_1)]$ corresponds to $(a',[t_1;t_2])$. } \end{figure} Now we will consider what happens when $\wn N$ nodes are allowed. Let us consider the node $a$ in Figure~\ref{fig_intui_digging}. The residues of $a$ are exactly the residues of $a'$ and $a$ itself, and ``$(a',[t_1;t_2])$ corresponds to a residue of $a$'' is successively equivalent to: \begin{align*} &\left \{ \hspace{-0.4em}\begin{array}{ll} ((\sigma(B_2),[t_1]),[\oc_{t_2}])\hspace{-0.4em}&\csRel^* ((\_,\_),[\oc_{\sige}])\\ ((\sigma(B_1),[]),[\oc_{t_1}]) &\csRel^* ((\_,\_),[\oc_{\sige}])\\ \end{array}\right. &&\hspace{-1.2em}\Leftrightarrow\left \{ \hspace{-0.4em} \begin{array}{ll} ((\overline{f'},[]),[\oc_{t_2};\oc_{t_1}]) \hspace{-0.4em} &\csRel^* ((\_,\_),[\oc_{\sige}])\\ ((\overline{f'},[]),[\oc_{t_1}]) &\csRel^* ((\_,\_),[\oc_{\sige}]) \end{array}\right.\\ \Leftrightarrow&\left \{ \hspace{-0.4em} \begin{array}{ll} ((\overline{f},[]),[\oc_{t_2};\oc_{t_1}])\hspace{-0.4em} &\csRel^* ((\_,\_),[\oc_{\sige}])\\ ((\overline{f},[]),[\oc_{t_1}]) &\csRel^* ((\_,\_),[\oc_{\sige}]) \end{array}\right. &&\hspace{-1.2em}\Leftrightarrow\left \{ \hspace{-0.4em} \begin{array}{ll} ((\sigma(B),[]),[\oc_{\sign(t_2,t_1)}]) \hspace{-0.4em} &\csRel^* ((\_,\_),[\oc_{\sige}])\\ ((\sigma(B),[]),[\oc_{\sigp(t_1)}]) &\csRel^* ((\_,\_),[\oc_{\sige}]) \end{array}\right. \end{align*} Thus, $(a,[\sign(t_2,t_1)])$ corresponds to a residue of $a$ iff both $\sign(t_2,t_1)$ and $\sigp(t_1)$ are entirely used by their $\csRel$-paths. Let us notice that a box may encounter several $\digLab$ nodes during cut-elimination. To check every case, we define a relation $\simpl$ on signatures such that, in particular, $\sign(t_2,t_1) \simpl \sign(t_2,t_1)$ and $\sign(t_2,t_1) \simpl \sigp(t_1)$. \begin{definition}\label{def_standard}A signature is {\em standard} if it does not contain the constructor $\sigp$.\label{def_quasistandard} A signature $t$ is {\em quasi-standard} iff for every subtree $\sign(t_1,t_2)$ of $t$, the signature $t_2$ is standard. \end{definition} \label{def_simpl}The binary relation $\simpl$ on $\sig$ is defined by induction as follows: $\sige \simpl \sige$ and, if we suppose that $t \simpl t'$, then $\sigl(t)\simpl \sigl(t')$, $\sigr(t)\simpl \sigr(t')$, $\sigp(t) \simpl \sigp(t')$, $\sign(u,t) \simpl \sigp(t')$ and $\sign(t,u) \simpl \sign(t',u)$. We write that $t'$ is a {\em simplification} of $t$, when $t \simpl t'$.\label{def_sqsubset} We write $t \simplStrict t'$ for ``$t \simpl t'$ and $t \neq t'$''. We can observe that $\simpl$ is an order and $\simplStrict$ a strict order. \begin{lemma}[\cite{perrinelMegathese}]\label{lemma_total_order} Let $t \in \sig$, then $\simpl$ is a total order on $\Set*{ u \in \sig}{ t \simpl u }$. \end{lemma} \begin{definition}\label{def_quasistandard_context} A context $((e,P),[\oc_t]@T)$ is said {\em quasi-standard} if $t$ is quasi-standard and every signature in $P$ and $T$ is standard. \end{definition} If $u \compl t$ with $t$ standard $((\sigma(B),P),[\oc_t])$ is quasi-standard, and quasi-standard contexts are stable by $\csRel$~\cite{perrinelMegathese}. So every context we study in this work is quasi-standard. We capture the notion of residue by {\em canonical potentials}. The definition of canonical potentials relies on {\em copies}. A copy represents the choices for one box, a canonical potential for an element $x$ is a list of copies: one copy for each box containing $x$. \begin{definition}{\label{def_copycontext}} A {\em copy context} is a context of the shape $((e,P),[\oc_t]@T)$ such that for every $u \compl t$, there exists a path of the shape $((e,P),[\oc_u]@T) \csRel^* ((\_,\_),[\oc_{\sige}]@\_)$. \label{def_copy}Let $(B,P) \in \pot{B_G}$, the set $\cop{B,P}$ of {\em copies} of $(B,P)$ is the set of standard signatures $t$ such that $((\sigma(B),P),[\oc_t])$ is a copy context. \end{definition} For instance, in Figure~\ref{fig_ex_duplicates}, the copies of $(B,[])$ are $\sige$, $\sigl(\sige)$ and $\sigr(\sige)$ which respectively corresponds to $B$ itself, $B_1$ and $B_2$. So $(C,[\sigl(\sige)])$ and $(C,[\sigr(\sige)])$ correspond respectively to $C_1$ and $C_2$. We can notice that $C_2$ is duplicated while $C_1$ can not be duplicated, in terms of context semantics $((\sigma(C),[\sigr(\sige)]),[\oc_{\sigl(\sige)}]) \csRel^5 ((\overline{g},[\sige]),[\oc_{\sige}])$ so $\sigl(\sige)$ is a copy of $(C,[\sigr(\sige)])$ while $((\sigma(C),[\sigl(\sige)]),[\oc_{\sigl(\sige)}]) \csRel^3 ((\overline{j},[]),[\oc_{\sigl(\sige)};\oc_{\sige}]) \not \csRel$ so $\sigl(\sige)$ is not a copy of $(C,[\sigl(\sige)])$. \begin{definition}\label{def_canonical}Let $x$ be an edge (resp. box, node) of $G$ with $x \in B_{\depth{x}} \subset ... \subset B_1 $. The set $\can{x}$ of {\it canonical edges} (resp. box, node) for $x$ is the set of tuples $(x,[p_{1} ; ... ; p_{\depth{x}}])$ with $p_1,\cdots,p_{\depth{x}}$ signatures such that: \begin{equation*} \forall 1\leq i\leq \depth{x}, p_i \in \cop{B_i, [p_{1}; \cdots ; p_{i-1}]} \end{equation*} \end{definition} For instance, in the proof-net of Figure~\ref{fig_ex_duplicates}, we have $\cop{B,[]}=\{\sige,\sigl(\sige),\sigr(\sige)\}$, $\cop{C,[\sige]}=\cop{C,[\sigl(\sige)]}=\{\sige\}$ and $\cop{C,[\sigr(\sige)]}=\{\sige,\sigl(\sige),\sigr(\sige)\}$. So, by definition, $\can{e}=\{e\} \times \{[\sige;\sige],[\sigl(\sige);\sige],[\sigr(\sige);\sige],[\sigr(\sige);\sigl(\sige)];[\sigr(\sige);\sigr(\sige)]\}$. Those canonical potentials correspond respectively to $e$, $e_1$, $e_2$, $e_3$ and $e_4$. We can notice that $|\can{e}|=5$. In the middle proof-net of this Figure, we have $\can{e_1}=\{(e_1,[\sige;\sige])\}$ and $\can{e_2} = \{(e_2,[\sige;\sige]), (e_2,[\sige;\sigl(\sige)]), (e_2,[\sige; \sigr(\sige)])\}$ so $|\can{e_1}|+|\can{e_2}|=4 < |\can{e}|$ (the number of residues decreases because there is no edge corresponding to $(e,[\sige,\sige])$ in the middle proof-net). The set of canonical edges of $G$ is represented by $\can{\edges{G}}$. \label{remarque_can_same}Let us notice that the canonical edges for $e$ only depend on the boxes containing $e$: if $e$ and $f$ are contained in the same boxes then $\can{e}=\Set*{(e,P)}{(f,P) \in \can{f}}$. \begin{definition}\label{def_wg} For any proof-net $G$, we define $W_G =\left|\can{\edges{G}}\right| \in \mathbb{N} \cup \{\infty\}$. \end{definition} In~\cite{perrinelMegathese}, to prove that $W_G$ is a bound on reduction, we first build a strict injection from the canonical nodes of $H$ to the canonical nodes of $G$. This injection is based on a mapping from contexts of $H$ to contexts of $G$ which preserves $\csRel$-paths. Then we prove that the number of canonical nodes is bounded by $W_G$ \begin{definition}\label{def_pi} Let us suppose that $G \cutRel H$ then we defined (in~\cite{perrinelMegathese}) a partial mapping $\pi(\_)$ from $Cont_H$ to $Cont_G$ such that, whenever $\pi(C)$ and $\pi(D)$ are defined, \begin{equation*} C \csRel^* D \Rightarrow \pi(C) \csRel^* \pi(D) \hspace{3em} C \csRel^+ D \Leftarrow \pi(C) \csRel^+ \pi(D) \end{equation*} \end{definition} Theorem~\ref{theo_dallago_edges} is a slight variation of the Lemma 6 of Dal Lago in~\cite{lago2006context}. This result allows to prove strong complexity bounds for several systems. \begin{theorem}[\cite{perrinelMegathese}]\label{theo_dallago_edges} If $G$ is a normalizing proof-net, then $W_G \in \mathbb{N}$. The length of any path of reduction, and the size of any proof-net of the path, is bounded by $W_G$. \end{theorem} Execution time depends on the implementation of proof-nets and $cut$-elimination. In a basic implementation based on graphs, every step can be done in constant time except for the box rules, which can be done in a time linear in the size of the box, so linear in the size of the proof-net. Thus, according to Theorem~\ref{theo_dallago_edges}, the execution time of $G$ is in $O(W_G^2)$. The complexity classes we study in this article are stable by polynomial. Thus, to establish the soundness of a $LL$ subsystem with respect to polynomial time/elementary time, it is enough to prove a polynomial/elementary bound on $W_G$. \begin{lemma}[\cite{perrinelMegathese}]\label{lemma_acyclicity} Let $G$ be a normalizing proof-net, there is no path of the shape $((e,P),[\oc_t]) \csRel^+ ((e,P),[\oc_u])$ with $(e,P)$ a canonical edge. \end{lemma} \section{Paths criteria for elementary time}\label{chapter_3} \subsection{History and motivations} A stratification refers to a restriction of a framework, which forbids the contraction (or identification) of two subterms belonging to two morally different ``strata''. Stratification restrictions might be applied to several frameworks (naive set theory, linear logic, lambda calculus and recursion theory) to entail coherence or complexity properties~\cite{baillot2010linear}. To define a stratification condition on Linear Logic we define, for every proof-net $G$, a {\em stratification relation} $>$ between the boxes of $G$. Then, we consider that $B$ belongs to a higher stratum than $C$ if $B (>)^+ C$. The relation $>$ must be defined such that there exists a function $f$ such that: \begin{equation}\label{eq_f_dup} \left|\cop{B,P}\right| \leq f \left( \max_{\substack{B > C\\(B,P) \in \pot{B}}}\left| \cop{C,Q} \right|, \left|E_G\right| \right) \end{equation} \label{definition_stratugen}One says that $G$ is $>$-stratified if $>$ is acyclic. In this case, for every box $B$ of $G$, we define the $>$-stratum of $B_1$ (written $\stratu{>}{B_1}$) as the greatest $i \in \mathbb{N} \cup \{\infty \}$ such that there exists $B_2,\cdots,B_{i} \in S$ such that $B_1 > B_{2} > \cdots > B_{i}$. We define $|>|$ as $\max_{B \in \boxset{G}}\stratu{>}{B}$. If $t$ is $>$-stratified, the $>$-stratum of every box is in $\mathbb{N}$ because $\left|\boxset{G}\right|$ is finite. Thus, one can bound $\left|\cop{B}\right|$ by induction on $\stratu{>}{B}$ (thanks to Equation~\ref{eq_f_dup}). Because $W_G \leq |\edges{G}| \cdot \left( \max_{(B,P) \in \pot{\boxset{G}}}|\cop{B,P}|\right)^{\depthG{G}}$, this gives us a bound on $W_G$. In most previous works, the stratum $s(~)$ is rather explicit while $>$ is left implicit (it can be defined by ``$B > C$ iff $s(B) > s(C)$''). Concretely, in~\cite{girard1995light} and~\cite{danos2003linear}, the stratum of a box is defined as its depth (the number of boxes containing it). To enforce Equation~\ref{eq_f_dup}, digging and dereliction ($\wn N$ and $\wn D$ nodes) are forbidden. In~\cite{baillot2010linear}, Baillot and Mazza label the edges with a natural number. To enforce Equation~\ref{eq_f_dup}, Baillot and Mazza define some local conditions that those labels have to satisfy. Those works are presented as subsystems of Linear Logic: $ELL$~\cite{girard1995light} and $L^3$~\cite{baillot2010linear}. In both cases, the function $f$ in Equation~\ref{eq_f_dup} is an elementary function (tower of exponential of fixed height). Because this class of functions is stable by composition and maximum, $ELL$ and $L^3$ proof-nets normalize in a number of steps bounded by an elementary function of its size, and this function only depends on $\max_{B \in B_G}s(B) \leq |B_G|$. When they defined $L^3$~\cite{baillot2010linear}, Baillot and Mazza did more than improving the intensional expressivity of $ELL$, they showed that ``exponential boxes and stratification levels are two different things''. This clarified the notion of stratification and enabled the present work. Here, we go further in that direction: we disentangle three principles (stratification, dependence control and nesting) which are implicit in $LLL$ and $L^4$. These principles are presented as the acyclicity of relations on boxes (respectively $\stratSNLL$, $\dcSim$ and $\nestSim$) whose intuitive meanings are described below. The meanings are voluntarily vague because those principles are not limited to the representations given in this paper, there are many variations possible~\cite{perrinelMegathese}. The intuitive meanings are not given in terms of linear logic but in the larger setting of models of computation based on rewriting. Indeed, we applied those principles both to linear logic and $\lambda$-calculus. We believe them to be relevant in other frameworks based on rewriting such as interaction nets, recursion theory and term rewriting systems. In this larger setting, the relations are between {\em parts} of a programs (boxes for linear logic, subterms for $\lambda$-calculus). \begin{itemize} \item Stratification (Section~\ref{section_def_stratSNLL_simple}): $B \stratSNLL C$ means that $B$ will interact with a part $C'$ (i.e. during reduction there is a rewriting step involving $B$ and $C'$) which will be created by a rewriting rule involving $C$. For instance, let us consider $t=\lambda x.(\lambda y.(y) \lambda w.w) \lambda z.(z)x$, we have $\lambda w.w \stratSNLL \lambda z.(z)x$ because $t \betared \lambda x.(\lambda z.(z)x) \lambda w.w \betared \lambda x.(\lambda w.w)x \betared \lambda x.x$ so the last step is a rewriting step involving both $\lambda w.w$ and $B'=x$, which is created during a step involving $\lambda z.(z)x$ (the second step). \item Dependence control (Section~\ref{section_dependence_control_simple}): $B \dcSim C$ means that several parts of $C$ will be substituted by $B$. Those parts will not be duplicated inside $C$. For instance, let us consider $t=\lambda y.(\lambda x.(x)(x)(\lambda w.w)y)\lambda z.z$, we have $\lambda z.z \dcSim (\lambda x.(x)(x)(\lambda w.w)y)$ because the two occurrences of $x$ in $\lambda x.(x)(x)(\lambda w.w)y$ will indeed be replaced by $\lambda z.z$. None of those occurrences of $x$ will be duplicated during a normalization of $\lambda x.(x)(x)(\lambda w.w)y$. \item Nesting (Section~\ref{subsection_depcontrol_digging}): $B \nestSim C$ means that a part of $C$ will be substituted by $B$. Those free variables may be duplicated inside $C$. For instance, let us consider the $\lambda$-term $t=(\lambda y.(\lambda x.(y)x)\lambda z.z)\lambda w.(w)w$ we have $\lambda z.z \nestSim \lambda x.(y)x$ we can notice that the occurrence of $x$ in $\lambda x.(y)x$ will indeed be replaced by $\lambda z.z$. This occurrence of $x$ may be duplicated, with the reduction $t \betared (\lambda x.(\lambda w.(w)w)x)\lambda z.z \betared (\lambda x.(x)x)\lambda z.z$. \end{itemize} The acyclicity of $\stratSNLL$ entails an elementary bound on $W_G$ (Theorem~\ref{theoStratElementaryBound}), the acyclicity of the three relations entails a polynomial bound on $W_G$ (Corollary~\ref{coro_bound_poly_nest}). We want to find characterizations of complexity classes which are as intensionally expressive as possible. So we try to find the smallest possible relation $>$ (with respect to inclusion) whose acyclicity entails a bound of the shape of Equation~\ref{eq_f_dup}. Indeed if, for every proof-net the relation $R_1$ on boxes is a subset of $R_2$, then the acyclicity of $R_2$ implies the acyclicity of $R_1$. So more proof-nets are $R_1$-stratified than $R_2$-stratified. We want to prove a bound on the number of copies of boxes. Let us consider a potential box $(B,P)$ and a copy $t$ of $(B,P)$, by definition of copies there exists a path $((\sigma(B),P),[\oc_t]) \csRel^* ((e,Q),[\oc_{\sige}])$. Our idea to prove Corollary~\ref{coro_bound_poly_nest} is to determine entirely $t$ from a partial information on $(e,Q)$ and on the $\onlyJump$ steps of the path. Because there is a bounded number of possibilities for those information, we have a bound on the number of copies of $(B,P)$. \begin{itemize} \item {\em Stratification:} When $\stratSNLL$ is acyclic, one can {\em trace back} $\noJump$-paths: let us suppose that $C_k \noJump^* C_1 \noJump C_0$, with some partial information on $C_0$ we can deduce a partial information on $C_1$, $C_2$,... $C_k$. In particular, we can deduce the edges of all those contexts. \item {\em Dependence control:} When $\dcSim$ is acyclic, one can {\em trace back} the $\onlyJump$ steps. Thus, if $\stratSNLL$ and $\dcSim$ are acyclic and $C_k \csRel^* C_1 \csRel C_0$, we only need a bounded amount of information to deduce the edges of the contexts. This gives us a bound on the number of sequences $e_k,\cdots,e_1,e_0$ of edges such that there exists a path of the shape $((\sigma(B),P),[\oc_{t}]) \csRel ((e_k,\_),\_) \csRel \cdots ((e_1,\_),\_) \csRel ((e_0,\_),[\oc_{\sige}])$. \item {\em Nesting:} If there is no $\digLab$ node, then a copy $t$ of $(B,P)$ is a list of $\sigl$ and $\sigr$ which is entirely determined by the sequence $e_k,\cdots,e_0$ of edges of the path $((\sigma(B),P),[\oc_{t}]) \csRel ((e_k,\_),\_) \csRel \cdots ((e_1,\_),\_) \csRel ((e_0,\_),[\oc_{\sige}])$. Combined with the acyclicity of $\stratSNLL$ and $\dcSim$, this gives us a bound on $|\cop{B,P}|$ \end{itemize} \label{section_stratification_simple} \subsection{Definition of $\stratSNLL$-stratification} \label{section_def_stratSNLL_simple} To prove the complexity bounds for $ELL$ and $LLL$, one usually uses a round-by-round cut-elimination procedure. During round $i$, we reduce every cut at depth $i$. We can bound the number of $\wn C$ node residues at depth $i+1$ and, because the boxes at depth $i$ can only be duplicated by $\wn C$ nodes at depth $i+1$, it gives us a bound on the number of times boxes at depth $i+1$ are duplicated. We will proceed similarly: we will prove a bound on the number of nodes (in particular the $\wn C$ and $\wn N$ nodes) obtained after $i$ rounds of cut-elimination, and prove that it gives us a bound on the number of duplication during round $i+1$ by tracing back paths corresponding to copies from the $((e,P),[\oc_{\sige}])$ context\footnote{One can observe that we can restrict $e$ to be either the principal door of $B$, or a (reverse) premise of a $\wn C$ or $\wn N$ node, because crossing those nodes upwards are the only step modifying the signature of the left-most trace element.} back to $((\sigma(B),P),[\oc_t])$ and showing that the potential edge $(e,P)$ (corresponding to a residue) determines $t$ in a unique way. To understand the definition of $\stratSNLL$, let us first define a relation $\stratELL$ on boxes by: $B \stratELL C$ iff there exists a path of the shape $((\sigma(B),\_),[\oc_{\_}]) \csRel^* ((e,\_),\_)$ with $e \in C$. Let us notice that, if $((\sigma(B),P),[\oc_t]) \csRel^* ((e_k,P_k),[\oc_{t_k}]@T_k) \noJump^k ((e_0,P_0),[\oc_{t_0}])$, one only needs to know $e_0$ and $P_0$ to deduce $(e_i,P_i,T_i)_{1 \leq i \leq k}$ (because $\noJump$ is injective). By definition of $\stratELL$, for every box $C$ containing $e_i$, we have $B \stratELL C$. Thus, there are only $\left|\edges{G}\right| \cdot \left( \max_{B \stratELL C}|\cop{C,Q}|\right)^{\depthG{G}}$ such paths (it is enough to fix $e_0 \in \edges{G}$ and a copy for every box containing $e_0$). The idea of this section is to identify {\em unnecessary} $B \stratELL C$ pairs. It is to say, boxes $B$ and $C$ such that $B \stratELL C$ but tracing back $\noJump$-paths originating from $((\sigma(B),P),[\oc_t])$ does not depend on an element of $\cop{C,Q}$. The first such example is whenever $B \subset C$ and no $\csRel$ path from $((\sigma(B),P),[\oc_t])$ to $((e,R),[\oc_u])$ leaves the box $C$. In this case, the signature corresponding to $C$ never changes along the path. So, whenever $((\sigma(B),P),[\oc_t]) \csRel^* ((e_k,P_k),[\oc_{t_k}]) \noJump^k ((e_0,P_0),[\oc_{t_0}])$ the signature corresponding to $C$ is the same in $P$, $P_k$ and $P_0$. This signature never goes to the trace, so knowing it is not necessary to trace back the path. In this case, knowing $max_Q |\cop{C,Q}|$ is not necessary to bound the number of $\noJump$-paths originating from $((\sigma(B),P),[\oc_t])$. Thus, $B \stratELL C$ couples are necessary only if there is a $\csRel$ path from $((\sigma(B),P),[\oc_t])$ which enters $C$ by one of its doors (either auxiliary or principal). In fact, we prove that the $B \stratELL C$ couples are necessary only if there is a $\csRel$ path from $((\sigma(B),P),[\oc_t])$ which enters $C$ by its {\em principal} door. To understand why, we study an example. In Figure~\ref{fig_ex_principal_nec}, if $((\sigma(B),P),[\oc_t]) \noJump^* ((\overline{d},q),[\oc_{\sige}])$, we need to know $q$ to trace back the path (i.e. to deduce the list of edges of those paths) because: \begin{equation}\label{eq_paths_bc} \left\{ \begin{array}{l} ((\sigma(B),[\sigr(\sige)]),[\oc_{\sigr(\sige)}]) \noJump^4 ((g,[]),[\oc_{\sige};\wn_{\sigl(\sige)}]) \noJump^3 ((\overline{d},[\sigl(\sigr(\sige))]),[\oc_{\sige}])\\ ((\sigma(B),[\sigr(\sige)]),[\oc_{\sigl(\sige)}]) \noJump^4 ((h,[]),[\oc_{\sige};\wn_{\sigr(\sige)}]) \noJump^3 ((\overline{d},[\sigr(\sigr(\sige))]),[\oc_{\sige}]) \end{array} \right . \end{equation} So $B \stratELL C$ is a necessary pair. Tracing those paths backwards, the difference in the potential corresponding to $C$ becomes a difference in a $\wn_{\_}$ trace element (in the $((\overline{\sigma(C)},[]),[\oc_{\sige};\wn_q]) \csRel ((\overline{d},[q]),[\oc_{\sige}])$ step). And because of this difference on a $\wn_{\_}$ trace element, the reverse paths separate when the paths cross a $\contLab$ node downwards: $((g,[]),[\oc_{\sige};\wn_{\sige}]) \csRel ((f,[]),[\oc_{\sige};\wn_{\sigl(\sige)}])$ and $((h,[]),[\oc_{\sige};\wn_{\sige}]) \csRel ((f,[]),[\oc_{\sige};\wn_{\sigr(\sige)}])$. On the contrary, if $((\sigma(D),P),[\oc_t]) \noJump^* ((\overline{w},[q_A;q_B]),[\oc_{\sige}])$, we only need to know $q_B$ to trace back the path. Indeed the paths do not enter $A$ by its principal door, so $q_A$ can only appear on $\oc_{\_}$ trace elements, never on $\wn_{\_}$ trace elements. \begin{figure}\centering \begin{tikzpicture} \node[auxdoor] (baux) at (0,0) {}; \draw[ar] ($(baux)+(0,0.6)$) --(baux); \draw[ar] (baux)--++(0,-0.6); \node[princdoor] (bpri) at ($(baux)+(0.8,0)$) {}; \node [weak] (bweak) at ($(bpri)+(0,0.7)$) {}; \draw [ar] (bweak) -- (bpri) node [edgename] {$w$}; \draw (bpri)-| ++(0.7,1.1) -| ($(baux)+(-0.4,0)$) -- (baux) -- (bpri); \node[cont] (bcont) at ($(bpri)+(1.3,0)$) {}; \node[cut] (bcut) at ($(bpri)!0.5!(bcont)+(0,-0.4)$) {}; \draw[ar,out=-90,in=180] (bpri) to (bcut); \draw[ar,out=-90,in= 0] (bcont)to (bcut); \node[ax] (bax1) at ($(bcont)+(0.8,0.3)$) {}; \node[ax] (bax2) at ($(bax1)+(0,0.25)$) {}; \node [auxdoor] (aaux1) at ($(bax1)+(0.2,-1.5)$) {}; \node [auxdoor] (aaux2) at ($(aaux1)+(0.9,0)$) {}; \node [princdoor](apri) at ($(aaux1)+(-3.5,0)$) {}; \draw[ar] ($(apri)+(0,0.6)$)--(apri); \draw [ar,out=180,in= 60] (bax1) to (bcont); \draw [ar,out=180,in=120] (bax2) to (bcont); \draw [ar,out= 0,in= 90] (bax1) to (aaux1); \draw [ar,out= 0,in= 90] (bax2) to (aaux2); \draw (apri) -- (aaux1) -- (aaux2) -| ++ (0.4,2.5) -| ($(apri)+(-0.7,0)$) -- (apri); \node [cont] (ccont1) at ($(aaux1)!0.5!(aaux2)+(0,-0.75)$) {}; \draw [ar] (aaux1) -- (ccont1) node [edgename] {$g$}; \draw [ar] (aaux2) -- (ccont1) node [edgename,right] {$h$}; \node [princdoor] (cpri) at ($(ccont1)+(2.4,0)$) {}; \node [der] (cder) at ($(cpri)+(0,1)$) {}; \node [princdoor] (dpri) at ($(cder)+(0,1)$) {}; \draw (dpri) -| ++(0.7,0.9) -| ($(dpri)+(-0.4,0)$) -- (dpri); \draw (cpri) -| ++(0.8,3) -| ($(cpri)+(-0.5,0)$) -- (cpri); \draw [ar] (dpri) -- (cder); \draw [ar] (cder) -- (cpri) node [edgename] {$d$}; \node [cut] (ccut) at ($(ccont1)!0.6!(cpri)+(0,-0.5)$) {}; \draw [ar,out=-90,in=180] (ccont1) to node [edgename,above right=-0.05] {$f$} (ccut); \draw [ar,out=-90,in= 0] (cpri) to (ccut); \node [above] at ($(apri)+(-0.5,0)$) {${\mathbf A}$}; \node [above] at ($(bpri)+( 0.5,0)$) {${\mathbf B}$}; \node [above] at ($(cpri)+( 0.5,0)$) {${\mathbf C}$}; \node [above] at ($(dpri)+( 0.5,0)$) {${\mathbf D}$}; \coordinate (extdig) at ($(apri)+(-1.8,0)$); \node [cont] (extcont1) at ($(extdig)+(0,0)$) {}; \node [weak] (extweak1) at ($(extcont1)+( 60:0.8)$) {}; \node [der] (extder1) at ($(extcont1)+(120:0.8)$) {}; \node [cut] (extcut2) at ($(apri)!0.5!(extdig)+(0,-0.6)$) {}; \node [ax] (extax) at ($(extder1)+(-0.5,0.6)$) {}; \draw [ar] (extder1) -- (extcont1) \draw [ar] (extweak1) -- (extcont1) \draw [ar] (extax) to [out= 0, in=90] (extder1); \draw [ar] (extax) to [out=180, in=90] ($(extax)+(-0.5,-0.8)$); \draw [ar] (extcont1)to [out=-90,in=170] (extcut2); \draw [ar] (apri)to [out=-90,in= 10] (extcut2); \end{tikzpicture} \caption{\label{fig_ex_principal_nec}$D \stratELL A$ but it is an ``unnecessary'' couple because $|\cop{B,P}$ does not depend on $|\cop{A,[]}|$.} \end{figure} We define a relation $\stratSNLL$ between boxes of proof-nets. $B \stratSNLL C$ means that there is a path beginning by the principal door of $B$ which enters $C$ by its principal door. \begin{definition}\label{def_stratPot} Let $B, C \in \boxset{G}$, we write $B \stratSNLL C$ if there is a path of the shape: \begin{equation*}\label{def_twoheadrightsquigarrow} ((\sigma(B), P), [\oc_t]) \noJump^* ((\overline{\sigma(C)},Q),T) \end{equation*} \end{definition} We can notice that for every proof-net, $\stratSNLL \subseteq \stratELL$. For example, in the proof-net of Figure~\ref{fig_ex_principal_nec}, we have $B \stratELL A$, $B \stratELL C$, $D \stratELL A$, $D \stratELL B$ and $D \stratELL C$ while the only pair for $\stratSNLL$ are $B \stratSNLL C$ and $D \stratSNLL B$. As shown in Equation~\ref{eq_paths_bc}, to trace back the $\noJump$-path from $((\sigma(B),[\sigr(\sige)]),[\oc_{\sigr(\sige)}])$ to $((\overline{d},[q]),[\oc_{\sige}])$ one needs information on $q=\sigl(\sigr(\sige))$. However, let us notice that it is not necessary to know $q$ entirely. The only information needed to trace back the path is that it is of the form $\sigl(x)$. Knowing that $x=\sigr(\sige)$ is useless because the information in $x$ would only be used if the path entered $A$ by its principal door and that is not the case. The following intuitions (formalized in Section~\ref{section_restricted_copies}) capture the notion of the information needed to trace back the paths. As we stated earlier, a canonical potential of a box corresponds to a residue of this box along reduction, a {\em $\csRel_S$-canonical potential} of a box corresponds to a residue obtained without firing cuts involving the principal door of a box outside $S$. It is to say, a $\csRel_S$-canonical potential of a box corresponds to a residue of this box along reduction such that, for every step of this reduction involving the principal door of a box $B$, $B$ is a residue of a box of $S$. More formally, we first define the $\csRel_S$-copies of $(B,P)$ as the copies $t$ of $(B,P)$ such that in the paths $((\sigma(B),P),[\oc_{t}]) \csRel^* ((\_,\_),[\oc_{\sige}])$, every $\onlyJump$ step of the path is on a box of $S$. For instance, in the proof-net of Figure~\ref{fig_ex_principal_nec}, the $\csRel_{\{C\}}$-copies of $(C,[])$ are $\{ \sige, \sigl(\sige), \sigr(\sige) \}$ while the $\csRel_{\{C,A\}}$-copies of $(C,[])$ are $\{ \sige, \sigl(\sige), \sigr(\sige), \sigl(\sigl(\sige)),\sigl(\sigr(\sige)),\sigr(\sigl(\sige)),\sigr(\sigr(\sige)) \}$. Then, we define $\csRel_S$-canonical potentials from the notion of $\csRel_S$-copies in the same way as we defined canonical potentials from the notion of copies. Let us suppose that we know that $\_ \noJump^7 ((\overline{d},[q]),[\oc_{\sige}])$ and $\_ \noJump^7 ((\overline{d},[q']),[\oc_{\sige}])$ and we want to prove that those paths take the same edges. We only need to know that the $\csRel_{\{C\}}$-copies of $(C,[])$ ``corresponding'' to $q$ and $q'$ are equal. We define $x$ (resp. $x'$) as the ``biggest'' $\csRel_{\{C\}}$-copy of $(C,[])$ which is a ``truncation'' of $q$ (resp. $q'$). For instance, if $q=\sigr(\sigl(\sige))$ and $q'=\sigr(\sigr(\sige))$, then $q \neq q'$ but we have $x=x'=\sigr(\sige)$. This is enough to know that $q$ and $q'$ are of the shape $\sigr(\_)$ and this information is enough to trace back the paths, so to prove that the paths take the same edges. The $\csRel_S$-copy of $(B,P)$ corresponding to $t$ is written $\restrSig{\csRel_S}{((\sigma(B),P),[\oc_t])}$. It represents the part of $t$ which is used if we refuse the $\onlyJump$ steps over the potential boxes which are not in $S$. For instance, in Figure~\ref{fig_ex_principal_nec}, $\restrSig{\csRel_{\{(C\}}}{((\sigma(C),[]),[\oc_{\sigr(\sigl(\sige))}])}= \sigr(e)$ because, if we refuse to jump over $(A,[])$, only $\sigr(\_)$ is consumed in the $\csRel$ paths starting from this context. Then, $\restrPot{\csRel_S}{e,P}$ is defined from the $\restrSig{\csRel_S}{((\sigma(B),P),[\oc_t])}$ construction in the same way as canonical potentials are defined from copies. \subsection{Restricted copies and canonical potentials}\label{section_restricted_copies} Now that we gave the intuitions, we can state the formal definitions. \begin{definition}\label{def_mapstoset} Let $G$ be a proof-net and $S \subset \boxset{G}$. We define $\csRel_{S}$ and $\noJump_S$ as follows: \begin{equation*} C \csRel_{S}D \Leftrightarrow \left \{ \begin{array}{l} C \csRel D \\ \text{If }C= ((\sigma(B),P),[\oc_t]) \text{, then } B \in S \end{array} \right. \end{equation*} \begin{equation*} C \noJump_{S} D \Leftrightarrow \left \{ \begin{array}{l} C \noJump D \\ \text{If } D= ((\overline{\sigma(B)},P),T.\wn_t) \text{, then } B \in S \end{array} \right. \end{equation*} \end{definition} If $\csRel$ corresponds to cut-elimination, $\csRel_S$ corresponds to cut-elimination restricted by allowing reduction of cuts involving the principal door of a box $B$ only if $B$ is a residue of a box of $S$. In the following, we suppose given a relation $\rightarrow$ on contexts such that $\rightarrow \subseteq \csRel$. \begin{definition}\label{def_copyrel}\label{def_arrowcopy} A $\rightarrow$-copy context is a context of the shape $((e,P),[\oc_t]@T)$ such that for every $u \compl t$, there exists a path of the shape $((e,P),[\oc_u]@T) \rightarrow^* ((\_,\_),[\oc_{\sige}])$. Let $(B,P) \in \pot{B_G}$, the set $\copRel{\rightarrow}{B,P}$ of $\rightarrow$-copies of $(B,P)$ is the set of standard signatures $t$ such that $((\sigma(B),P),[\oc_t])$ is a $\rightarrow$-copy context. \end{definition} For example, for any box $B$ and set $S$ such that $B \not \in S$, $\copRel{\csRel_S}{B,P}=\{\sige\}$ (because $((\sigma(B),P),[\oc_t]) \not \csRel_S$). In Figure~\ref{fig_ex_principal_nec}, we have $\copRel{\csRel_{\{C\}}}{C,[]}=\{\sige,\sigl(\sige),\sigr(\sige)\}$ whereas $\copRel{\csRel_{\{A,C\}}}{C,[]}=\{\sige,\sigl(\sige),\sigr(\sige),\sigl(\sigl(\sige)),\sigl(\sigr(\sige)),\sigr(\sigl(\sige)),\sigr(\sigr(\sige))\}$. \begin{definition}\label{def_canonicalrel}Let $e$ be an edge of $G$ such that $e \in B_{\depth{e}} \subset ... \subset B_1 $. We define $\canRel{\rightarrow}{e}$ as the set of potentials $[s_{1} ; ... ; s_{\depth{e}}]$ such that: \begin{equation*}\forall 1\leq i\leq \depth{x}, s_i \in \copRel{\rightarrow}{B_i, [s_{1}; \cdots ; s_{i-1}]} \end{equation*} \end{definition} For instance, in Figure~\ref{fig_ex_principal_nec}, $\canRel{\csRel_{\{B\}}}{w}=\{(w,[\sige;\sige]),(w,[\sige;\sigl(\sige)]),(w,[\sige;\sigr(\sige)])\}$ and $\canRel{\csRel_{\{C\}}}{d}=\{(d,[\sige]),(d,[\sigl(\sige)]),(d,[\sigr(\sige)])\}$. We can notice that, in particular, the definitions of $\copRel{\csRel}{B,P}$ and $\canRel{\csRel}{x}$ match respectively the definitions of $\cop{B,P}$ (Definition~\ref{def_copy}) and $\can{x}$ (Definition~\ref{def_canonical}). Finally, we define in Definition~\ref{def_canonicalrel_contexts} a notion of $\rightarrow$-canonical contexts. Intuitively\footnote{This property is not true for every $\rightarrow$ relation, but is true if $\rightarrow$ is of the shape $\csRel_S$.}, every context reachable from $((\sigma(B),P),[\oc_t])$ by a $\rightarrow$-path with $(B,P) \in \canRel{\rightarrow}{B}$ and $t \in \copRel{\rightarrow}{B,P}$, is a $\rightarrow$-canonical context. \begin{definition}\label{def_canonicalrel_contexts}A {\em $\rightarrow$-canonical context} is a context $((e,[P_1;\cdots;P_{\depth{e}}),[T_1;\cdots;T_k])$ such that $(e,P) \in \canRel{\rightarrow}{e}$ and: \begin{itemize} \item For every $T_i=\oc_t$, $((e,[P_1;\cdots;P_{\depth{e}}]),[\oc_t;T_{i+1};\cdots;T_k])$ is a $\rightarrow$-copy context. \item For every $T_i=\wn_t$, $((\overline{e},[P_1;\cdots;P_{\depth{e}}]),[\oc_t;T^{\perp}_{i+1};\cdots;T^{\perp}_k])$ is a $\rightarrow$-copy context. \end{itemize} \end{definition} Let us consider a potential box $(B,P)$ and $t \in \cop{B,P}$, then there exists a context $((e,Q),[\oc_{\sige}])$ such that $((\sigma(B),P),[\oc_t]) \csRel^* ((e,Q),[\oc_{\sige}])$. If some of those $\csRel$ steps are not in $\rightarrow$, we may have $((\sigma(B),P),[\oc_t]) \rightarrow^* ((f,R),[\oc_v]) \not \rightarrow$ with $v \neq \sige$. In this case, $t$ would not be a $\rightarrow$-copy of $(B,P)$. However, there exist ``truncations'' of $t$ which are $\rightarrow$-copy of $(B,P)$ (at least, $\sige$ verify those properties). \begin{definition}{\label{def_truncation}} We define ``$t$ is a truncation of $t'$'' (written $t \prune t'$) by induction on $t$. For every signature $t,t',u,u'$, we set $\sige \prune t$ and if we suppose $t \prune t'$ and $u \prune u'$ then $\sigl(t) \prune \sigl(t')$, $\sigr(t) \prune \sigr(t')$, $\sigp(t) \prune \sigp(t')$ and $\sign(t,u) \prune \sign(t',u')$. \end{definition} As hinted earlier, we want to define $\restrSig{\rightarrow}{((\sigma(B),P),[\oc_t])}$ as the ``biggest'' $\rightarrow$-copy $u$ of $(B,P)$ such that $u \prune t$. But we have not precised the meaning of ``biggest'' yet. The solution we chose is to first maximize the rightmost branch. Then, once this branch is fixed, we maximize the second rightmost branch and so on. Formally, we define ``biggest'' as ``the maximum for the order $\pruneceq$'' with $\pruneceq$ defined as follows. \begin{definition}{\label{def_prunec}} We first define a strict order $\prunec$ on signatures by induction. For every signature $t,t',u,v$, we set $\sige \prunec t$. And, if we suppose $t \prunec t'$, then $\sigl(t) \prunec \sigl(t')$, $\sigr(t) \prunec \sigr(t')$, $\sigp(t) \prunec \sigp(t')$, $\sign(u,t) \prunec \sign(v,t')$ and $\sign(t,u) \prunec \sign(t',u)$. Then we define an order $\pruneceq$ on signatures by: $t \pruneceq t'$ iff either $t=t'$ or $t \prunec t'$. \end{definition} \begin{lemma}[\cite{perrinelMegathese}]\label{lemma_pruneceq_total} Let $t$ be a signature, then $\pruneceq$ is a total order on $\Set{ u \in \sig}{ u \prune t}$. \end{lemma} Thanks to Lemma~\ref{lemma_pruneceq_total}, the set $\restr{\rightarrow}{(\sigma(B),P),[\oc_t]}$ defined below is totally ordered by $\pruneceq$ and finite (if $t$ is of size $k$, it has at most $2^k$ truncations) so it admits a maximum for $\pruneceq$, written $\restrSig{\rightarrow}{((\sigma(B),P),[\oc_t])}$. \begin{definition}{\label{def_cop_restr}} Let $((e,P),[\oc_t]@T) \in \context{G}$, we define $\restr{\rightarrow}{(e,P),[\oc_t]@T}$ as the set of signatures $u$ such that $u \prune t$ and $((e,P),[\oc_u]@T)$ is a $\rightarrow$-copy context. Then, we define $\restrSig{\rightarrow}{((e,P),[\oc_t]@T)}$ as the maximum (for $\pruneceq$) element of $\restr{\rightarrow}{(e,P),[\oc_t]@T}$. \end{definition} For example, in the proof-net of Figure~\ref{fig_ex_principal_nec}, $\restr{\csRel_{\{C\}}}{(\sigma(C),[]),[\oc_{\sigl(\sigr(\sige))}]}=\{\sige,\sigl(\sige)\}$ so we have $\restrSig{\csRel_{\{C\}}}{((\sigma(C),[]),[\oc_{\sigl(\sigr(\sige))}])}=\sigl(\sige)$. In Figure~\ref{fig_ex_principal_nec}, $((\overline{\sigma_1(A)},[]),[\oc_u]) \csRel_S ((\sigma(A),[]),[\oc_u])$ for any $u \in \sig$. So, for any $t \in \sig$, $\restrSig{\csRel_S}{((\overline{\sigma_1(A)},[]),[\oc_t])}=\restrSig{\csRel_S}{((\sigma(A),[]),[\oc_{\sige}])}$. Lemma~\ref{lemma_restr_eq} generalizes this observation. \begin{lemma}[\cite{perrinelMegathese}]\label{lemma_restr_eq} Let $t \in \sig$. We suppose that, for every $u \prune t$ and $v \compl u$, we have $((e,P),[\oc_v]@T) \rightarrow ((f,Q),[\oc_v]@U)$. Then, $\restrSig{\rightarrow}{((e,P),[\oc_t]@T)}=\restrSig{\rightarrow}{((f,Q),[\oc_t]@U)}$. \end{lemma} Now, for any potential edge $(e,P)$, we want to define $\restrPot{\rightarrow}{e,P}$ as the ``biggest'' truncation $P'$ of $P$ such that $(e,P')$ is a $\rightarrow$-canonical edge. We first maximize the leftmost signature, then the second, and so on. \begin{definition}\label{def_potrestr} For every potential edge $(e,P)$, we define $\restrPot{\rightarrow}{e,P}$ by induction on $\depth{e}$. If $\depth{e}=0$, then we set $\restrPot{\rightarrow}{e,[]}=(e,[])$. Otherwise we have $P=Q.t$, let $B$ be the deepest box containing $e$, $(\sigma(B),Q')=\restrPot{\rightarrow}{\sigma(B),Q}$ and $t'=\restrSig{\rightarrow}{((\sigma(B),Q'),[\oc_t])}$ then we set $\restrPot{\rightarrow}{e,Q.t}=(e,Q'.t')$. \end{definition} For example, in the proof-net of Figure~\ref{fig_ex_principal_nec}, $\restrPot{\csRel_{\{B\}}}{w,[\sigr(\sige);\sigl(\sige)]}=(w,[\sige;\sigl(\sige)])$. \begin{definition}{\label{def_prune_pot}} We extend $\prune$ on $\Pot$ by $[p_1;\hspace{-0.04em}\cdots\hspace{-0.04em};p_k]\hspace{-0.17em}\prune\hspace{-0.17em}[p'_1;\hspace{-0.04em}\cdots\hspace{-0.04em};p'_k]$ iff for $1 \hspace{-0.2em}\leq\hspace{-0.1em} i \hspace{-0.2em}\leq\hspace{-0.1em} k$, $p_i \hspace{-0.17em}\prune\hspace{-0.17em} p'_i$. \end{definition} We can notice that, in the same way as the definition of $\can{e}$ only depends on the boxes containing $e$ (cf. page~\pageref{remarque_can_same}), the definition of $\restrPot{\rightarrow}{e,P}$ only depends on the boxes containing $e$. We formalize it with the next lemma. \begin{lemma}\label{lemma_restrpot_eq} If $e,\hspace{-0.05em}f \hspace{-0.12em}\in\hspace{-0.08em} \dirEdges{G}$ belong to the same boxes, \hspace{-0.05em}$\restrPot{\rightarrow}{e,P} \hspace{-0.2em}=\hspace{-0.1em} (e,P')$ iff $\restrPot{\rightarrow}{f,P}\hspace{-0.2em}=\hspace{-0.1em}(f,P')$. \end{lemma} Let us suppose that $((\sigma(B),P),[\oc_t]) \noJump^* ((e,Q),[\oc_{\sige}])$ and $S$ is the set of boxes which are entered by their principal door by this path. Then, we prove that it is enough to know $\restrPot{\csRel_S}{e,Q}$ to trace back the path (Lemma~\ref{lemma_remonter_simple}). To do so, we need to prove that for every intermediary step $(((e_k,P_k),T_k) \noJump ((e_{k+1},P_{k+1}),T_{k+1})$ we have enough information about $P_{k+1}$ and $T_{k+1}$ to determine $e_k$. This is the role of the following definition. As an intuition, if $((e,P'),T')=\restrCont{\rightarrow}{((e,P),T)}$ then $((e,P'),T')$ is the ``biggest'' $\rightarrow$-canonical context which is a truncation of $((e,P),T)$. \begin{definition}{\label{def_cont_restr}} For $((e,P),[T_n;\cdots;T_1]) \in \context{G}$ we define $\restrCont{\rightarrow}{((e,P),[T_n;\cdots;T_1])}$ as $((e,P'),[T'_n;\cdots;T'_1])$ with $(e,P')=\restrPot{\rightarrow}{e,P}$ and $T'_i$ defined by induction on $i$ as follows: \begin{itemize} \item If $T_i=\oc_t$, then $T'_i=\oc_{t'}$ with $t'=\restrSig{\rightarrow}{((e,P'),[\oc_t;T'_{i-1}\hspace{0.4em};\cdots;T'_1\hspace{0.3em}])}$. \item If $T_i=\wn_t$, then $T'_i=\wn_{t'}$ with $t'=\restrSig{\rightarrow}{((\overline{e},P'),[\oc_{t};{T'_{i-1}}^{\hspace{-0.6em}\perp};\cdots;{T'_1}^{\hspace{-0.05em}\perp}])}$. \item Otherwise, $T'_i=T_i$. \end{itemize} \end{definition} Lemma~\ref{lemma_restrCont_left} is a generalization of Lemma~\ref{lemma_restr_eq} to contexts. For example, in Figure~\ref{fig_ex_principal_nec}, for every $S \subseteq \boxset{G}$ and trace $T$ we have, $((d,[\sigr(\sign(\sige,\sige))]),T) \noJump_S^{3} ((\overline{h},[]),T.\oc_{\sign(\sige,\sige)})$ and $((h,[]),T^{\perp}.\wn_{\sign(\sige,\sige)}) \csRel_S^3 ((\overline{d},[\sigr(\sign(\sige,\sige))]),T^\perp)$. So for every $t,u \in \sig$, there exist $v,w \in \sig$ such that \begin{align*} \restrCont{\csRel_S}{((\overline{h},[]),[\oc_{t};\wn_{u};\oc_{\sign(\sige,\sige)}])}&=((\overline{h},[]),[\oc_{v};\wn_{w};\oc_{\_}])\\ \restrCont{\csRel_S}{((d,[\sigr(\sign(\sige,\sige))]),[\oc_{t};\wn_{u}])}&=((d,[\_]),[\oc_{v};\wn_{w}]) \end{align*} \begin{lemma}\label{lemma_restrCont_left} Let $(e,P),(e,Q)$ be potential edges and $U,V$ be lists of trace elements. Let us suppose that, for every trace element list $T$, $((e,P),T@U) \rightarrow ((f,Q),T@V)$ and $((\overline{f},Q),T^\perp @ V^\perp) \rightarrow ((\overline{e},P),T^\perp @ U^\perp ) $. Then, for any trace $T$, $\restrCont{\rightarrow}{((e,P),T@U)}$ and $\restrCont{\rightarrow}{((f,Q),T@V)}$ are of the shape $(\_,T'@U')$ and $(\_,T'@V')$ with $|T|=|T'|$. \end{lemma} \begin{proof} Let us write $[T_k;\cdots;T_1]$ for $T$, $(\_,[T'_k;\cdots;T'_1]@U')$ for $\restrCont{\rightarrow}{((e,P),T@U)}$ and $(\_,[T''_k;\cdots;T''_1]@V')$ for $\restrCont{\rightarrow}{((f,Q),T@V)}$. We prove $T'_i=T''_i$ by induction on $i$. If $T_i=\oc_{t}$, then we have $T'_i=\oc_{t'_i}$ with $t'_i=\restrSig{\rightarrow}{((e,P),[\oc_t;T'_{i-1};\cdots;T'_1]@U')}$ and $T''_i=\oc_{t''_i}$ with $t''_i=\restrSig{\rightarrow}{((f,Q),[\oc_t;T''_{i-1};\cdots;T''_1]@V')}$. By the induction hypothesis, we have $[T''_{i-1};\cdots;T''_1]=[T'_{i-1};\cdots;T'_1]$. By assumption $((e,\hspace{-0.05em}P),[\oc_t;\hspace{-0.05em}T'_{i-1};\cdots;T'_{1}]\hspace{-0.05em}@U') \hspace{-0.1em}\rightarrow^* ((f,Q),[\oc_t;T'_{i-1};\cdots;T'_{1}]@V')$. Thus, by Lemma~\ref{lemma_restr_eq}, $t'_i=t''_i$ so $T'_i=T''_i$. The case $T_i=\wn_t$ is similar (using the $((\overline{f},Q),T^\perp @ V^\perp) \rightarrow ((\overline{e},P),T^\perp @ U^\perp ) $ hypothesis). \end{proof} \subsection{Elementary bound for $\stratSNLL$-stratified proof-nets}\label{section_elementary_bound_simple} We consider the following theorem as the main technical innovation of this paper. It uses the notions of the previous section to trace back $\noJump$-paths. In order to bound $W_G$, we need to bound the number of copies of potential boxes. The usual way to prove the elementary bound on $LLL$ is a round-by-round cut-elimination procedure: we first reduce every cut at depth $0$. Because of the absence of dereliction in $ELL$, none of these step creates new cuts at depth $0$. So this round terminates in at most $|\edges{G}|$ steps. Because each step may at most double the size of the proof-net, the size of the proof-net at the end of round $0$ is at most $2^{|\edges{G}|}$. Then we reduce the cuts at depth $1$, because of the previous bound there at most $2^{|\edges{G}|}$ such cuts, and the reduction of those cuts does not create any new cut... The original proof of the elementary bound of $L^3$ relies on a similar round-by-round procedure which is more complex because reducing a cut at level i can create new cuts at level $i$, and a box of level $i$ can be contained in a box of higher level. While Dal Lago adapted to context semantics the round-by-round procedure of $ELL$ concisely in~\cite{lago2006context}, the round-by-round procedure of $L^3$ was only adapted to context semantics by Perrinel~\cite{perrinel2013pathsbased} (a work which is the basis of this article). Theorem~\label{injection_lemma_simple} allows us to bring round-by-round procedures where strata differ from depth, to context semantics. We explained that $\restrPot{\csRel_S}{e,P}$ corresponds to a residue $e'$ of $e$, such that we only fired cuts involving principal door of boxes of $S$. In a round-by-round procedure, after the $i$-th round we have a bound on the number of such $\restrPot{\csRel_S}{e,P}$. By tracing back a path from $((e,P),[\oc_{\sige}])$ until a potential box $(B,P)$ using only the information $\restrPot{\csRel_S}{e,P}$, we show that there is only one residue of $e'$ which will be cut with $B$ (more precisely its residue corresponding to $(B,P)$). This allows us to prove a bound on the number of copies of $(B,P)$. While we will use other criteria and technical results to deal with the $\onlyJump$ steps, both the proofs of the elementary bound and the proofs of the polynomial bound rely on Theorem~\ref{injection_lemma_simple}. \begin{theorem}\label{injection_lemma_simple} Let $G$ be a proof-net and $S \subset \boxset{G}$. Let $C_e$, $C_f$ and $C'_f$ be contexts such that $C_e \noJump_S C_f$ and $\restrCont{\csRel_S}{C_f} = \restrCont{\csRel_S}{C_f'}$, then there exists a context $C'_e$ such that $C_e' \noJump_S C_f'$ and $\restrCont{\csRel_S}{C_e}= \restrCont{\csRel_S}{ C_e'}$. \end{theorem} \begin{prf} We detail an easy step (crossing a $\parLab$ node upward). Most of the other steps are quite similar. For the steps which offer some particular difficulty, we only detail the points which differ from crossing a $\parLab$ upward. \tikzsetnextfilename{elem_par2} \begin{wrapfigure}{l}{1.5cm} \begin{tikzpicture} \node[par] (par) at (0,0) {}; \draw[ar] ($(par)+(0,-0.5)$) -- (par) node [edgename] {$e$}; \draw[ar] (par) -- ($(par)+(120:0.5)$) node [edgename] {$f$}; \draw ($(par)+( 60:0.5)$) -- (par); \end{tikzpicture} \end{wrapfigure} Let us suppose that $C_e=((e,P),T.\otimes_l) \noJump_S ((f,P),T)=C_f$ (crossing a $\parr$ upwards, such that $\overline{f}$ is not a principal edge) and $\restrCont{\csRel_S}{C_f} = \restrCont{\csRel_S}{ C'_f}$. So $C'_f$ is of the shape $((f,P'),T')$. We set $C'_e=((e,P'),T'.\otimes_l)$. Let $((f,P''),T'')=\restrCont{\csRel_S}{C_f}$, then $\restrPot{\csRel_S}{f,P}=\restrPot{\csRel_S}{f,P'}=(f,P'')$. So, by Lemma~\ref{lemma_restrpot_eq}, $\restrPot{\csRel_S}{e,P}=\restrPot{\csRel_S}{e,P'}=(e,P'')$. Moreover, by Lemma~\ref{lemma_restrCont_left}, $\restrCont{\csRel_S}{C_e}=((e,P''),T''.\otimes_l)$ and $\restrCont{\csRel_S}{C'_e}=((e,P''),T''.\otimes_l)$ so $\restrCont{\csRel_S}{C_e}=\restrCont{\csRel_S}{C'_e}$. \tikzsetnextfilename{elem_cut2} \begin{wrapfigure}{l}{2cm} \begin{tikzpicture} \node[princdoor] (aux) at (0,0) {}; \node (etc) at ($(aux)+(1,0)$) {}; \node[cut] (cut) at ($(aux)!0.5!(etc)+(0,-0.4)$) {}; \draw[ar] ($(aux)+(0,0.4)$) -- (aux); \draw[ar,out=-90,in=180] (aux) to node [edgename] {$e$} (cut); \draw[ar,out=0,in=-90] (cut) to node [edgename,right=-0.1] {$f$} (etc); \draw (aux)--++(0.5,0) (aux)--++(-0.5,0); \end{tikzpicture} \end{wrapfigure} Let us consider the case where $e$ is the principal edge of a box $B$ (we consider the case where we cross a $cut$), we suppose that we have $C_e=((e,P),T.\oc_t) \noJump_S ((f,P),T.\oc_t) = C_f$\footnote{If the rightmost trace element of $C_e$ is not of the shape $\oc_t$, the proof does not offer any additional difficulty compared to the step presented above.}. So $C'_f$ is of the shape $((f,P'),T'.\oc_{t'})$. We set $C'_e=((e,P'),T'.\oc_{t'})$. By supposition, $\restrCont{\csRel_S}{C_f}=\restrCont{\csRel_S}{C'_f}=((f,P''),T''.\oc_{t''})$. In particular $\restrSig{\csRel_s}{((f,P''),[\oc_{t}])}=\restrSig{\csRel_s}{((f,P''),[\oc_{t'}])}$. If $B \in S$, by Lemma~\ref{lemma_restrCont_left}, we have $\restrCont{\csRel_S}{C_e}=\restrCont{\csRel_S}{C'_e}=((e,P''),T''.\oc_{t''})$. Otherwise, we have $\restrCont{\csRel_S}{C_e}=\restrCont{\csRel_S}{C'_e}=((e,P''),T''.\oc_{\sige})$. \tikzsetnextfilename{elem_cutprinc_3} \begin{wrapfigure}{l}{2cm} \begin{tikzpicture} \node[princdoor] (aux) at (0,0) {}; \node (etc) at ($(aux)+(1,0)$) {}; \node[cut] (cut) at ($(aux)!0.5!(etc)+(0,-0.4)$) {}; \draw[ar] ($(aux)+(0,0.4)$) -- (aux); \draw[ar,out=180,in=-90] (cut) to node [edgename,left=0.2cm] {$f$} (aux); \draw[ar,out=-90,in=0] (etc) to node [edgename,right] {$e$} (cut); \draw (aux)--++(0.5,0) (aux)--++(-0.5,0); \end{tikzpicture} \end{wrapfigure} Let us consider the case where $\overline{f}$ is the principal edge of a box $B$ (we consider the case where we cross a $cut$) with $C_e=((e,P),T.\wn_t) \noJump_S ((f,P),T.\wn_t) = C_f$. So $C'_f$ is of the shape $((f,P'),T'.\wn_{t'})$. We set $C'_e=((e,P'),T'.\wn_{t'})$. By supposition, $\restrCont{\csRel_S}{C_f}=\restrCont{\csRel_S}{C'_f}=((f,P''),T''.\wn_{t''})$. By definition of $\noJump_S$, $B$ is in $S$. So, we can notice that $C'_e \noJump_S C'_f$ and, using Lemma~\ref{lemma_restrCont_left}, we have $\restrCont{\csRel_S}{C_e}=\restrCont{\csRel_S}{C'_e}=((e,P''),T''.\wn_{t''})$. \tikzsetnextfilename{elem_princ2} \begin{wrapfigure}{l}{1cm} \begin{tikzpicture} \node[princdoor] (aux) at (0,0) {}; \draw[ar] (aux) -- ($(aux)+(0,0.5)$) node [edgename] {$f$}; \draw[ar] ($(aux)+(0,-0.5)$) --(aux) node [edgename] {$e$}; \draw (aux)--++(0.5,0) (aux)--++(-0.5,0); \end{tikzpicture} \end{wrapfigure} Let us suppose that $C_e=((e,P),T.\wn_{t}) \noJump_S ((f,P.t),T)=C_f$ (crossing the principal door of $C$ upwards). Then, $C'_f$ must be of the shape $((f,P'.t'),T')$. We set $C'_e=((e,P'),T'.\wn_{t'})$. The only particular point is to prove that $\restrSig{\csRel_S}{(\restrPot{\csRel_S}{\overline{e},P},[\oc_t])}=\restrSig{\csRel_S}{(\restrPot{\csRel_S}{\overline{e},P'},[\oc_{t'}])}$. By definition, $\restrPot{\csRel_S}{f,P.t}=(f,Q.u)$ with $\restrPot{\csRel_S}{\overline{e},P}=(\overline{e},Q)$ and $\restrSig{\csRel_S}{(\overline{e},Q),[\oc_t])}=u$. Similarly, $\restrPot{\csRel_S}{f,P'.t'}=(f,Q'.u')$ with $\restrPot{\csRel_S}{\overline{e},P'}=(\overline{e},Q')$ and $\restrSig{\csRel_S}{((\overline{e},Q'),[\oc_{t'}])}=u'$. We know that $\restrCont{\csRel_S}{C_f}= \restrCont{\csRel_S}{C'_f}$, so $\restrPot{\csRel_S}{f,Q.t}=\restrPot{\csRel_S}{f,Q'.t'}$. Thus $u=u'$, i.e. $\restrSig{\csRel_S}{(\restrPot{\csRel_S}{\overline{e},P},[\oc_t])}=\restrSig{\csRel_S}{(\restrPot{\csRel_S}{\overline{e},P'},[\oc_{t'}])}$. \tikzsetnextfilename{elem_princ3} \begin{wrapfigure}{l}{1cm} \begin{tikzpicture} \node[princdoor] (aux) at (0,0) {}; \draw[ar] ($(aux)+(0,0.5)$) -- (aux) node [edgename] {$e$}; \draw[ar] (aux) -- ($(aux)+(0,-0.5)$) node [edgename] {$f$}; \draw (aux)--++(0.5,0) (aux)--++(-0.5,0); \end{tikzpicture} \end{wrapfigure} Let us suppose that $C_e=((e,P.t),T) \noJump_S ((f,P),T.\oc_t)=C_f$ (crossing the principal door of $B$ downwards). Then $C'_f$ must be of the shape $((f,P'),T'.\oc_{t'})$. We set $C'_e=((e,P'.t'),T')$. The only particular point is to prove that $\restrPot{\csRel_S}{e,P.t}=\restrPot{\csRel_S}{e,P'.t'}$. By definition of $\restrPot{\csRel_S}{\_,\_}$, $\restrPot{\csRel_S}{e,P.t}=(e,Q.u)$ with $\restrPot{\csRel_S}{f,P}=(f,Q)$ and $\restrSig{\csRel_S}{((f,Q),[\oc_t])}=u$. Similarly, $\restrPot{\csRel_S}{e,P'.t'}=(e,Q'.u')$ with $\restrPot{\csRel_S}{f,P'}=(f,Q')$ and $\restrSig{\csRel_S}{((f,Q'),[\oc_{t'}])}=u'$. By supposition, \begin{align*} \restrCont{\csRel_S}{((f,P),T.\oc_t)} &= \restrCont{\csRel_S}{((f,P'),T'.\oc_{t'})}\\ \left( \restrPot{\csRel_S}{f,P},\_@ \left[ \oc_{\restrSig{\csRel_S }{(\restrPot{\csRel_S}{f,P},[\oc_t])}} \right] \right ) &= \left ( \restrPot{\csRel_S}{f,P'}, \_@ \left[ \oc_{ \restrSig{\csRel_S}{(\restrPot{\csRel_S}{f,P'},[\oc_t'])} } \right] \right)\\ ((f,Q),\_@[\oc_u]) &=((f,Q'),\_@[\oc_{u'}])\\ Q.u &= Q'.u' \end{align*} The steps crossing auxiliary doors are similar to the steps crossing principal doors (dealt with above). To deal with the $\contLab$ node, one has to notice that $t \simpl u$ iff $\sigl(t) \simpl \sigl(u)$. The steps crossing $\digLab$ nodes are quite technical, but do not bring any insight on the result. Those steps are described in~\cite{perrinelMegathese}. \qed \end{prf} Theorem~\ref{injection_lemma_simple} allows us to trace back some $\noJump$ paths provided that we have some information about the last context of the path. In this subsection, we show how this implies an elementary bound (Lemma~\ref{theoStratElementaryBound}). But, first, we need some technical lemmas. \begin{lemma}[\cite{perrinelMegathese}]{\label{lemma_last_jump}} Let $\rightarrow \subseteq \csRel$. If $((\sigma(B),P),[\oc_t]) \rightarrow^* C$, then there exists a unique context $((\sigma(B'),P'),[\oc_{t'}])$ such that $((\sigma(B),P),[\oc_t]) \rightarrow^* ((\sigma(B'),P'),[\oc_{t'}]) (\noJump \cap \rightarrow)^* C$. \end{lemma} Let $G$ be a $\stratSNLL$-stratified proof-net and $n \in \mathbb{N}$, we set $S_n=\Set*{B \in \boxset{G}}{\stratu{\stratSNLL}{B} \leq n}$. Let us notice that, if $\stratu{\stratSNLL}{B} \leq n$, the set of boxes $C$ such that $B \stratSNLL C$ is included in $S_{n-1}$. So, we will be able (thanks to Lemma~\ref{injection_lemma_simple}) to bound the number of copies of boxes of $S_n$ depending on the maximum number of copies of boxes of $S_{n-1}$. This corresponds to the round-by-round cut-elimination procedure used to prove the bounds on $ELL$, $LLL$, $L^3$ and $L^4$. To make notations readable, we write $\csRel_n$ for $\csRel_{S_n}$, $\noJump_n$ for $\noJump_{S_n}$, $\restrSig{n}{((e,P),T)}$ for $\restrSig{\csRel_{S_n}}{((e,P),T)}$, $\copRel{n}{B,P}$ for $\copRel{\csRel_{S_n}}{B,P}$ and so on. \begin{lemma}\label{lemma_remonter_simple}Let $n \in \mathbb{N}$. If $((\sigma(B),P),[\oc_t]) \csRel_n C_k \cdots \csRel_n C_0$ and $\restrCont{n-1}{C_0}=\restrCont{n-1}{C'_0}$ then there exists $(C'_i)_{0 \leq i \leq k}$ such that $C'_k \csRel_n \cdots \csRel_n C'_0$ and, for $0 \leq i \leq k$, $\restrCont{n-1}{C_i}=\restrCont{n-1}{C'_i}$. \end{lemma} \begin{proof} We prove (by induction on $i$) the existence of a context $C'_i$ such that $C'_i \csRel_n C'_{i-1}$ and $\restrCont{n-1}{C_i}=\restrCont{n-1}{C'_i}$. If $i=0$, $C'_0$ satisfies the property by assumption. Otherwise, by induction hypothesis we know that there exists a context $C'_{i-1}$ such that $\restrCont{n-1}{(C_{i-1})}=\restrCont{n-1}{(C'_{i-1})}$. If the $C_i \csRel_n C_{i-1}$ step is a $\onlyJump$ step, it is of the shape $C_i=((\overline{\sigma_{j}(D)},Q),[\oc_u]) \onlyJump ((\sigma(D),Q),[\oc_u])=C_{i-1}$. So $C'_{i-1}$ is of the shape $((\sigma(D),Q'),[\oc_{u'}])$ with $\restrPot{n-1}{\sigma(D),Q}=\restrPot{n-1}{\sigma(D),Q'}=(\sigma(D),Q'')$ and $\restrSig{n-1}{((\sigma(D),Q''),[\oc_u])}=\restrSig{n-1}{((\sigma(D),Q''),[\oc_{u'}])}=u''$. Let us set $C'_i=((\overline{\sigma_j(D)},Q'),[\oc_{u'}])$. By Lemma~\ref{lemma_restrpot_eq}, $\restrPot{n-1}{\overline{\sigma_j(D)},Q}=\restrPot{n-1}{\overline{\sigma_j(D)},Q'}=(\overline{\sigma_j(D)},Q'')$. By Lemma~\ref{lemma_restr_eq}, $\restrSig{\csRel_S}{((\overline{\sigma_j(D)},Q''),[\oc_u])}=\restrSig{\csRel_S}{((\overline{\sigma_j(D)},Q''),[\oc_{u'}])}=u''$. So $\restrCont{\csRel_S}{C_i}=\restrCont{\csRel_S}{C'_i}=((\overline{\sigma_j(D)},Q''),[\oc_{u''}])$. Otherwise, $C_i \noJump C_{i-1}$ step so there exists a context of the shape $((\sigma(D),Q),[\oc_u])$ such that $((\sigma(B),P),[\oc_t]) \csRel_n ((\sigma(D),Q),[\oc_u]) (\noJump \cap \csRel_n)^+ C_{i-1}$ (Lemma~\ref{lemma_last_jump}). And, by definition of $\csRel_n$, $D \in S_n$. We prove that the last step of the path is in $\noJump_{n-1}$. We suppose $C_{i-1}$ is of the shape $((\overline{\sigma(D_i)},Q_i),[\oc_v])$ (otherwise, it is immediate by definition of $\noJump_{n-1}$). We can notice that $D \stratSNLL D_i$ so $\stratu{\stratSNLL}{D_i} < \stratu{\stratSNLL}{D} \leq n$, which means that $D_i \in S_{n-1}$. Thus, we have $C_{i} \noJump_{n-1} C_{i-1}$. By Theorem~\ref{injection_lemma_simple}, there exists a context $C'_i$ such that $C'_i \noJump_{n-1} C'_{i-1}$ and $\restrCont{n-1}{C_i}=\restrCont{n-1}{C'_i}$. \end{proof} \begin{lemma}[\cite{perrinelMegathese}]{\label{lemma_oclefttrace_remonter}} Let $S \subseteq \boxset{G}$. If $((e,P),[\oc_t]@T) \csRel_S^* ((f,Q),[\oc_u]@U)$, for every $u' \in \sig$, there exists $t' \in \sig$ such that $((e,P),[\oc_{t'}]@T) \csRel_S^* ((f,Q),[\oc_{u'}]@U)$. \end{lemma} \begin{proof} It is enough to prove it for one step. We can examine every possible step, each case is straightforward: the steps sometimes depend on $t$, never on $u$. For instance, let us suppose that $((e,P),[\oc_{\sigl(u)}]) \csRel_S ((f,Q),[\oc_u])$ (crossing a $\wn C$ upwards). Then, for every $u' \in \sig$, we have $((e,P),[\oc_{\sigl(u')}]) \csRel_S ((f,Q),[\oc_{u'}])$ so we can set $t'=\sigl(u')$. \end{proof} \begin{lemma}[strong acyclicity]\label{lemma_strong_acyclicity_simple} Let $G$ be a normalizing proof-net. For every $n \in \mathbb{N}$, if $((\sigma(B),P),[\oc_t]) \csRel_n^* ((e,Q),[\oc_u]) \csRel_n^+ ((e,Q'),[\oc_v])$ then $(e,Q)^{n-1} \neq (e,Q')^{n-1}$. \end{lemma} \begin{proof} We prove it by contradiction. We suppose that $((\sigma(B),P),[\oc_t]) \csRel_n^l ((e,Q),[\oc_u])$ and $((\sigma(B),P),[\oc_t]) \csRel^{l+m}_{S_n} ((e,Q'),[\oc_{u'}])=D'$, and $(e,Q)^{n-1} = (e,Q')^{n-1}$. Then, $\restrCont{n-1}{((e,Q),[\oc_{u'}])} = \restrCont{n-1}{D'}$. By Lemma~\ref{lemma_remonter_simple}, there exists a context $C'_1$ such that $C'_1 \csRel^{l+m} ((e,Q),[\oc_{u'}])$ and $\restrCont{n-1}{C'_1}=\restrCont{n-1}{((\sigma(B),P),[\oc_t])}$. So $C'_1$ is of the shape $((\sigma(B),P_1),[\oc_{t'_1}])$. By Lemma~\ref{lemma_oclefttrace_remonter}, there exists a signature $t_1$ such that $((\sigma(B),P_1),[\oc_{t_1}]) \csRel^{l+m} ((e,Q),[\oc_u])$ so $((\sigma(B),P_1),[\oc_{t_1}]) \csRel^{l+2m} ((e,Q'),[\oc_{u'}])$. We define $C_1$ as the context $((\sigma(B),P_1),[\oc_{t_1}])$. For $k \in \mathbb{N}$, we can define by induction on $k$ a context $C_k=((\sigma(B),P_k),[\oc_{t_k}])$ such that $C_k \csRel_{n}^{l+k\cdot m} D$ and $C_k \csRel_n^{l+(k+1)\cdot m} D'$. Thus, if $m > 0$, we define an infinite path. In particular, this path goes through infinitely many contexts of shape $((\sigma(B),P'),[\oc_{t'}])$. According to Corollary \ref{theo_dallago_edges}, the number of canonical potentials for an edge is finite. So there is some $(\sigma(B),P') \in \can{\dirEdges{G}}$ and $v,v' \in Sig$ such that $((\sigma(B),P'),[\oc_v]) \csRel^+ ((\sigma(B),P'),[\oc_{v'}])$. This is impossible because normalizing proof-nets are acyclic (Lemma \ref{lemma_acyclicity}). This is a contradiction, so our hypothesis is wrong, $m=0$. There is no path of the shape $((\sigma(B),P),[\oc_t]) \csRel_n^* ((e,Q),[\oc_u]) \csRel^+_{n} ((e,Q'),[\oc_v])$ with $(e,Q)^{n-1}=(e,Q')^{n-1}$. \end{proof} \begin{figure} \centering \tikzsetnextfilename{app_gh} \begin{tikzpicture} \node [proofnet,minimum width=1cm] (G) at (0,0) {G}; \node [tensor] (tens) at ($(G)+(2,0)$) {}; \node [cut] (cut) at ($(G)!0.5!(tens)+(0,-0.5)$) {}; \draw [ar,out=-90,in=180] (G.-90) to (cut); \draw [ar,out=-90,in= 0] (tens) to (cut); \node (etc) at ($(tens)+(1.1,-0.2)$) {}; \node [ax] (ax) at ($(tens)!0.6!(etc)+(0,0.6)$) {}; \draw [ar] (ax) to [out=-170,in=60] (tens); \draw [ar] (ax) to [out=-10, in=90] (etc); \node [proofnet,minimum width=1cm] (H) at ($(tens)+(-0.5,0.7)$) {$H$}; \draw [ar] (H)--(tens); \end{tikzpicture} \caption{\label{fig_app_gh}This proof-net, written $(G)H$, corresponds to the application of a function $G$ to an argument $H$.} \end{figure} \begin{lemma}[\cite{perrinelMegathese}]\label{lemma_numb_sig_depth} The number of signatures whose depth is $\leq d$ is at most $2^{2^{2\cdot d}}$ \end{lemma} \begin{lemma}{\label{lemma_bound_cop_acyc}} If $\left |\Set*{ \restrPot{n-1}{e,Q} }{ \exists t,u \in \sig, ((\sigma(B),P),[\oc_t]) \csRel_n^* ((e,Q),[\oc_u]) } \right |\leq M$, then $\left|\copRel{n}{B,P}\right|$ is bounded by $2^{2^{2\cdot M}}$. \end{lemma} \begin{proof} Let us consider $u \in \sig$ such that there exists $t \in \copRel{n}{B,P}$ such that $t \simpl u$. By definition of $\copRel{\_}{\_}$ (Definition~\ref{def_arrowcopy}, in page~\pageref{def_arrowcopy}), there exists a path of the shape $((\sigma(B),P),[\oc_u]) \csRel_n^* ((\_,\_),[\oc_{\sige}])$. We consider $u$ as a tree. During the path beginning by $((\sigma(B),P),[\oc_u])$, the height of the left-most branch of $u$ (viewed as a tree) decreases to $0$ (the height of $\sige$). The height of the left-most branch decreases only by crossing a $\wn C$ or $\wn N$ nodes upwards (which corresponds to contexts of the shape $((e,Q),[\oc_v])$) and during those steps it decreases by exactly $1$. So the height of the left-most branch of $u$ is inferior to the number of instances of contexts of the shape $((e,Q),[\oc_v])$ through which the path goes. From Lemma~\ref{lemma_strong_acyclicity_simple}, each $\restrPot{n-1}{e,Q}$ is represented at most once. So the height of the left-most branch of $u$ is inferior to $M$. Let $t$ be a $\csRel_n$-copy of $(B,P)$, then the height of $t$ is the height of its deepest branch. Once we consider signatures as trees, a simplification $u$ of $t$ can be viewed as a subtree of $t$ obtained as follows: we choose a branch of $t$ and $u$ is the part of $t$ on the right of this branch, in particular this branch becomes the leftmost branch of $u$. So there exists a simplification $u$ of $t$ such that the leftmost branch of $u$ is the deepest branch of $t$. So the heigth of $t$ is equal to the heigth of the leftmost branch of $u$. By the preceding paragraph, the height of the leftmost branch of $u$ is at most $M$ so the height of $t$ is at most $M$. The result is obtained by Lemma~\ref{lemma_numb_sig_depth}. \end{proof} In order to express elementary bounds, we define the notation $2^x_n$ (with $n \in \mathbb{N}$ and $x \in \mathbb{R}$) by induction on $n$: $2^x_0=x$ and $2^x_{n+1}=2^{2^x}_n$. So $2^x_n$ is a tower of exponentials of height $n$ with top exponent $x$. \begin{theorem}\label{theoStratElementaryBound} If a proof-net $G$ normalizes and is $\stratSNLL$-stratified, then the length of its longest path of reduction is bounded by $2^{|\dirEdges{G}|}_{3 \stratG{G}}$ \end{theorem} \begin{proof} By Lemma~\ref{lemma_bound_cop_acyc} and definition of $\canRel{n-1}{\_}$ we have: \begin{align*} \max_{(B,P) \in \pot{\boxset{G}}}\left| \copRel{n}{B,P} \right| \leq & 2^{2^{2\cdot \left|\canRel{n-1}{\dirEdges{G}}\right|}}\\ \max_{e \in \edges{G} }\left| \canRel{n}{e} \right| \leq & \left ( 2^{2^{2\cdot \left|\canRel{n-1}{\dirEdges{G}}\right|}} \right) ^{\depthG{G}}\\ \left | \canRel{n}{\dirEdges{G}} \right | \leq & \left | \dirEdges{G} \right | \left ( 2^{\depthG{G} \cdot 2^{2\cdot \left|\canRel{n-1}{\dirEdges{G}}\right|}} \right) \end{align*} We define $u_n$ as $2^{\left|\dirEdges{G}\right|}_{3 \cdot n}$. We show by induction that, for every $n \in \mathbb{N}$, $\left | \canRel{n}{\dirEdges{G}} \right| \leq u_n$. For $n=0$, we can notice that for every $e \in \dirEdges{G}$, we have $|\canRel{0}{e}|=1$ (the only canonical potentials are lists of $\sige$) so $\left | \canRel{0}{\dirEdges{G}} \right | \leq \left|\dirEdges{G}\right| \leq u_0$. If $n \geq 0$, let us notice that $G$ has at least two boxes so $\left|\dirEdges{G}\right|\geq 4$. We have the following inequalities (to simplify the equations, we write $s$ for $\left|\dirEdges{G}\right|$): \begin{align*} \left | \canRel{n+1}{\dirEdges{G}} \right| &\leq s \left ( 2^{\depthG{G} \cdot 2^{2\cdot \left|\canRel{n}{\dirEdges{G}}\right|}} \right) \leq s \left ( 2^{\depthG{G} \cdot 2^{2\cdot u_n}} \right) \leq 2^{\frac{s}{2}} \left ( 2^{s \cdot 2^{2\cdot u_n}} \right)\\ \log \left( \left | \canRel{n+1}{\dirEdges{G}} \right| \right) &\leq \frac{s}{2}+ s \cdot 2^{2\cdot u_n} \leq (2 \cdot s) \cdot 2^{2\cdot u_n} \leq 2^{s+2\cdot u_n} \leq 2^{4 u_n} \leq 2^{2^{u_n}}\\ \left | \canRel{n+1}{\dirEdges{G}} \right| &\leq 2^{u_n}_3= 2^{s}_{3n+3} = u_{n+1} \end{align*} Then, Theorem~\ref{theo_dallago_edges} gives us the announced bound. \end{proof} Let us consider the application of a proof-net $G$ to $H$ (Figure~\ref{fig_app_gh}). If $\stratSNLL$ is acyclic on $(G)H$, then $\left|\stratSNLL\right| \leq \left| \boxset{(G)H} \right| \leq \left|\boxset{G}\right| + \left|\boxset{H}\right|$. It is reasonable\footnote{More details at the end of Section~\ref{subsection_depcontrol_digging}.} to assume that the number of boxes does not depend on the argument of the function. So, by Theorem~\ref{theoStratElementaryBound}, the length of the normalization sequence is bounded by $e_G(x)$ with $x$ the size of the argument and $e_G$ an elementary function which does not depend on the argument. \section{Paths criteria for polynomial time} \label{section_polytime_simple} \subsection{Dependence control}\label{section_dependence_control_simple} \begin{figure} \centering \tikzsetnextfilename{exp_proofnet} \begin{tikzpicture} \tikzstyle{door}=[draw, circle, inner sep=0.02cm] \node [princdoor] (bang1) at (0,0) {}; \node at ($(bang1)+(0.2,1.3)$) {$\mathbf{B_2}$}; \node [auxdoor] (ancr1) at ($(bang1)+(-0.65,0)$) {}; \node [auxdoor] (ancl1) at ($(ancr1)+(-0.65,0)$) {}; \node [cont] (why1) at ($(ancl1)!0.5!(ancr1)+(0,-0.7)$) {}; \node [tensor] (tens1) at ($(bang1)+(0,0.6)$) {}; \node [ax] (ax1b) at ($(tens1)+(-0.4,0.3)$) {}; \node [ax] (ax1h) at ($(tens1)+(-0.8,0.6)$) {}; \draw [ar] (tens1) -- (bang1); \draw [ar] (ax1h) to [out=0,in=70] (tens1); \draw [ar] (ax1b) to [out=0,in=110] (tens1); \draw [ar] (ax1h) to [out=180,in=90] (ancl1); \draw [ar] (ax1b) to [out=180,in=100] (ancr1); \node [princdoor] (bang2) at (2.2,0) {}; \node at ($(bang2)+(0.2,1.3)$) {$\mathbf{B_1}$}; \node [auxdoor] (ancr2) at ($(bang2)+(-0.65,0)$) {}; \node [auxdoor] (ancl2) at ($(ancr2)+(-0.65,0)$) {}; \node [cont] (why2) at ($(ancl2)!0.5!(ancr2)+(0,-0.7)$) {}; \node [below right] at (why2) {}; \node [tensor] (tens2) at ($(bang2)+(0,0.6)$) {}; \node [ax] (ax2b) at ($(tens2)+(-0.4,0.3)$){}; \node [ax] (ax2h) at ($(tens2)+(-0.8,0.6)$){}; \draw [ar] (tens2)--(bang2); \draw [ar] (ax2h) to [out=0,in=70] (tens2); \draw [ar] (ax2b) to [out=0,in=110] (tens2); \draw [ar] (ax2h) to [out=180,in=90] (ancl2); \draw [ar] (ax2b) to [out=180,in=100] (ancr2); \node [princdoor] (bang3) at (4.4,0) {}; \node at ($(bang3)+(0.2,1.3)$) {$\mathbf{B_0}$}; \node [auxdoor] (ancr3) at ($(bang3)+(-0.65,0)$) {}; \node [auxdoor] (ancl3) at ($(ancr3)+(-0.65,0)$) {}; \node [cont] (why3) at ($(ancl3)!0.5!(ancr3)+(0,-0.7)$) {}; \node [below right] at (why3) {}; \node [cut](cut1) at ($(bang1)!0.5!(why2)+(-0,-0.7)$) {}; \node [cut](cut2) at ($(bang2)!0.5!(why3)+(-0,-0.7)$) {}; \draw [ar](bang1) to [out=-80, in=180] (cut1); \draw [ar] (why2) to [out=-100, in=0] (cut1); \draw [ar](bang2) to [out=-80, in=180] (cut2); \draw [ar](why3) to [out=-100,in=0] (cut2); \node [tensor] (tens3) at ($(bang3)+(0,0.6)$) {}; \node [ax] (ax3b) at ($(tens3)+(-0.4,0.3)$) {}; \node [ax] (ax3h) at ($(tens3)+(-0.8,0.6)$) {}; \draw [ar] (tens3)--(bang3); \draw [ar] (ax3h) to [out=0,in=70] (tens3); \draw [ar] (ax3b) to [out=0,in=110] (tens3); \draw [ar] (ax3h) to [out=180,in=90] (ancl3); \draw [ar] (ax3b) to [out=180,in=100] (ancr3); \draw [ar] (bang3) -- ++ (0,-1); \draw (bang1) -|++(0.4,1.5) -| ($(ancl1)+(-0.3,0)$) -- (ancl1)--(ancr1)--(bang1); \draw (bang2) -|++(0.4,1.5) -| ($(ancl2)+(-0.3,0)$) -- (ancl2)--(ancr2)--(bang2); \draw (bang3) -|++(0.4,1.5) -| ($(ancl3)+(-0.3,0)$) -- (ancl3)--(ancr3)--(bang3); \draw [ar] (ancl1) to [bend right] (why1); \draw [ar] (ancr1) to [bend left] (why1); \draw [ar] (ancl2) to [bend right] (why2); \draw [ar] (ancr2) to [bend left] (why2); \draw [ar] (ancl3) to [bend right] (why3); \draw [ar] (ancr3) to [bend left] (why3); \node (suite) at ($(why1)+(-0.6,-0.3)$) {}; \draw [ar,dashed] (why1) to [out=-90,in=0] (suite); \end{tikzpicture} \caption{\label{exp}This proof-net (if extended to $n$ boxes) reduces in ${\cal O}(2^n)$ reduction steps} \end{figure} Though $\stratSNLL$-stratification gives us a bound on the length of the reduction, elementary time is not considered as a reasonable bound, as it rises extremely fast with the size of the input. Cobham-Edmons thesis asserts that $Ptime$ corresponds to feasible problems. It suffers some limits: \begin{itemize} \item When one is only interested in very small inputs, the asymptotical complexity is not a concern \item It does not account for constants and exponents. \end{itemize} However, in practice, the programs which we consider tractable mostly correspond to programs enjoying a polynomial bound on their time complexity. This is why we look for criteria entailing a polynomial bound on $W_G$. Figure~\ref{exp} shows us a way for the complexity to arise despite $\stratSNLL$-stratification. On this proof-net, $B_1$ has two residues. Each residue of $B_1$ creates two residues of $B_2$ (so $4$ residues in total). If we extend this sequence of boxes, $B_n$ has at least $2^n$ residues. From a context semantics perspective, $\left|\cop{B_i,[]}\right|$ depends non-additively on $\left|\cop{B_{i-1},[]}\right|$. Indeed, for any $t \in \cop{B_{i-1},[]}$, both $\sigl(t)$ and $\sigr(t)$ are in $\cop{B_i,[]}$. Thus, for every copy in $B_0$ there exist at least $2^{i}$ copies of $B_i$. This proof-net is similar to the $\lambda$-term $(\lambda x.\langle x,x\rangle)\cdots (\lambda x.\langle x,x\rangle)y$ (in $\lambda$-calculus with pairs) which reduces to a $\lambda$-term of size $O(2^n)$ (with $n$ the number of successive applications of $\lambda x.\langle x,x\rangle$). Let us observe that the number of $\betared$ steps depends on the strategy: call-by-name normalizes in $\Theta(2^n)$ steps while call-by-value normalizes in $\Theta(n)$ steps (but, because the term size grows exponentially, the exectution time is in $\Theta(2^n)$ independently of the reduction strategy). The exponential blow-up happens because there are two free occurrences of $x$ in $\lambda x.\langle x,x\rangle$ (this corresponds in Figure~\ref{exp} to the two auxiliary doors by box which come from the same contraction node). In~\cite{roversi2009some}, this situation is called a chain of {\em spindles}\label{def_spindle}. We call {\em dependence control condition} any restriction on linear logic which aims to tackle this kind of spindle chains. The dependence control in $LLL$~\cite{girard1995light} is to limit the number of auxiliary doors of each $\fpriLab$-box to $1$. The dependence control in $SLL$~\cite{lafont2004soft} is to forbid auxiliary doors above contraction nodes. However, those conditions forbid many proof-nets normalizing in polynomial time. For instance, the proof-net of Figure~\ref{expb} normalizes in linear time, even if the boxes have two auxiliary doors one of which is above a $\contLab$ node. The copies of $C_i$ depend on the copies of $C_{i-1}$ because $\cop{C_i,[]}=\{\sige,\sigr(\sige)\} \cup \Set*{\sigl(t)}{t \in \cop{C_{i-1},[]}}$. But the dependence is additive: $|\cop{C_i,[]}| = 2+|\cop{C_{i-1},[]}|$. In terms of context semantics, to give a bound on the number of copies of a potential box, we want to trace back a path $((\sigma(B),P),[\oc_t]) \csRel^* ((e,Q),[\oc_{\sige}])$ with as little information on the path as possible. Theorem~\ref{injection_lemma_simple} (and the injectivity of $\noJump$) allows us to trace back $\noJump$ steps. However, we need additional information to trace back $\onlyJump$ steps because $\onlyJump$ is not injective. For instance, in Figure~\ref{exp}, we have: \begin{align*} ((\sigma(B_2),[]), [\oc_{\sigl(\sige)}]) \noJump^2 C_e=((\overline{\sigma_1(B_1)},[]),[\oc_{\sige}]) \onlyJump ((\sigma(B_1),[]),[\oc_{\sige}])=C_f \\ ((\sigma(B_2),[]), [\oc_{\sigr(\sige)}]) \noJump^2 C'_e=((\overline{\sigma_2(B_1)},[]),[\oc_{\sige}]) \onlyJump ((\sigma(B_1),[]),[\oc_{\sige}]) =C_f \end{align*} Let us consider a $((\sigma(B),P),[\oc_t]) (\noJump_S \cup \onlyJump)^* ((e,Q),[\oc_{\sige}])$ path. Thanks to Theorem~\ref{injection_lemma_simple} and Lemma~\ref{injection_lemma_jump}, we can trace it back (determine every edge of the path) provided we know $\restrCont{\csRel_S}{((e,Q),[\oc_{\sige}])}$ and, for every $((\overline{\sigma_i(C)},R),[\oc_u]) \onlyJump ((\sigma(C),R),[\oc_u])$ step of the path, we know $i$. \begin{lemma}\label{injection_lemma_jump} Let $S$ be a subset of boxes. We suppose that $C_e=((\overline{\sigma_i(B)},P),[\oc_t]) \onlyJump C_f$, $C'_e=((\overline{\sigma_i(B)},P'),[\oc_{t'}]) \onlyJump C'_f$ and $\restrCont{\csRel_S}{C_f}=\restrCont{\csRel_S}{C'_f}$ then $\restrCont{\csRel_S}{C_e}=\restrCont{\csRel_S}{C'_e}$. \end{lemma} \begin{proof} Quite similar to the proof of Theorem~\ref{injection_lemma_simple} (cf. the study of the $\parr$ case). \end{proof} A dependence control condition is a criterion on proof-nets entailing a bound on the number of $\onlyJump$ steps for which we need to know the auxiliary edge to be able to trace back a $\csRel$-path. Instead of a syntactic criterion (like the ones of the type-systems $LLL$ and $SLL$), we propose here a semantic criterion on proof-nets. As in Section~\ref{chapter_3}, the criterion is defined as the acyclicity of a relation (written $\dcSim$) on boxes. Our criterion is more general than previous systems: every proof-net of (the multiplicative fragments of) $LLL$, $SLL$ and every $Ptime$ sound system of $MS$ satisfies our dependence control condition. Intuitively $B \dcSim B'$ means that residues $B_1$ and $B_2$ of $B$ are cut, along reduction, with two distinct auxiliary doors ($\sigma_{i}(\_)$ and $\sigma_{j}(\_)$) of residues ($B'_1$ and $B'_2$) of $C$. From a context semantics point of view, it corresponds to the existence of $\csRel$-paths from the principal door of $B$ to two distinct auxiliary doors of $B'$. Let us observe that the relation $\dcSim$ is defined by considering $\csRel$-paths ending by a context on an (reversed) auxiliary edges of a box $B'$ while the relation $\stratSNLL$ (Definition~\ref{def_stratPot} in page~\pageref{def_stratPot}) was defined by considering $\noJump$-paths passing through the (reversed) principal edge of a box $B'$. \begin{definition}\label{def_kjoins_simple}We set $B \dcSim B'$ iff there exist $i \neq j$ and paths of the shape: \begin{align*} ((\sigma(B),P), [\oc_t]) \csRel^+ ( (\overline{\sigma_i(B')}, P'_1), [\oc_{\sige}])\\ ((\sigma(B),P), [\oc_u]) \csRel^+ ((\overline{\sigma_j(B')}, P'_2), [\oc_{\sige}]) \end{align*} \end{definition} \begin{figure} \centering \tikzsetnextfilename{exp_proofnetb} \begin{tikzpicture} \tikzstyle{door}=[draw, circle, inner sep=0.02cm] \node [princdoor] (bang1) at (0,0) {}; \node at ($(bang1)+(0.2,1.3)$) {$\mathbf{C_2}$}; \node [auxdoor] (ancr1) at ($(bang1)+(-0.65,0)$) {}; \node [auxdoor] (ancl1) at ($(ancr1)+(-1.2,0)$) {}; \node [cont] (why1) at ($(ancl1)!0.3!(ancr1)+(0,-0.7)$) {}; \node [weak] (weak1) at ($(ancl1)!0.5!(ancr1)+(0,-0.2)$) {}; \draw [ar] (weak1) -- (why1); \node [tensor] (tens1) at ($(bang1)+(0,0.6)$) {}; \node [ax] (ax1b) at ($(tens1)+(-0.4,0.3)$) {}; \node [ax] (ax1h) at ($(tens1)+(-0.8,0.6)$) {}; \draw [ar] (tens1) -- (bang1); \draw [ar] (ax1h) to [out=0,in=70] (tens1); \draw [ar] (ax1b) to [out=0,in=110] (tens1); \draw [ar] (ax1h) to [out=180,in=90] (ancl1); \draw [ar] (ax1b) to [out=180,in=100] (ancr1); \node [princdoor] (bang2) at (2.7,0) {}; \node at ($(bang2)+(0.2,1.3)$) {$\mathbf{C_1}$}; \node [auxdoor] (ancr2) at ($(bang2)+(-0.65,0)$) {}; \node [auxdoor] (ancl2) at ($(ancr2)+(-1.2,0)$) {}; \node [cont] (why2) at ($(ancl2)!0.3!(ancr2)+(0,-0.7)$) {}; \node [weak] (weak2) at ($(ancl2)!0.5!(ancr2)+(0,-0.2)$) {}; \draw [ar] (weak2) -- (why2); \node [tensor] (tens2) at ($(bang2)+(0,0.6)$) {}; \node [ax] (ax2b) at ($(tens2)+(-0.4,0.3)$){}; \node [ax] (ax2h) at ($(tens2)+(-0.8,0.6)$){}; \draw [ar] (tens2)--(bang2); \draw [ar] (ax2h) to [out=0,in=70] (tens2); \draw [ar] (ax2b) to [out=0,in=110] (tens2); \draw [ar] (ax2h) to [out=180,in=90] (ancl2); \draw [ar] (ax2b) to [out=180,in=100] (ancr2); \node [princdoor] (bang3) at (5.4,0) {}; \node at ($(bang3)+(0.2,1.3)$) {$\mathbf{C_0}$}; \node [auxdoor] (ancr3) at ($(bang3)+(-0.65,0)$) {}; \node [auxdoor] (ancl3) at ($(ancr3)+(-1.2,0)$) {}; \node [cont] (why3) at ($(ancl3)!0.3!(ancr3)+(0,-0.7)$) {}; \node [weak] (weak3) at ($(ancl3)!0.5!(ancr3)+(0,-0.2)$) {}; \draw [ar] (weak3) -- (why3); \node [cut](cut1) at ($(bang1)!0.5!(why2)+(-0,-0.7)$) {}; \node [cut](cut2) at ($(bang2)!0.5!(why3)+(-0,-0.7)$) {}; \draw [ar](bang1) to [out=-80, in=180] (cut1); \draw [ar] (why2) to [out=-100, in=0] (cut1); \draw [ar](bang2) to [out=-80, in=180] (cut2); \draw [ar](why3) to [out=-100,in=0] (cut2); \node [tensor] (tens3) at ($(bang3)+(0,0.6)$) {}; \node [ax] (ax3b) at ($(tens3)+(-0.4,0.3)$) {}; \node [ax] (ax3h) at ($(tens3)+(-0.8,0.6)$) {}; \draw [ar] (tens3)--(bang3); \draw [ar] (ax3h) to [out=0,in=70] (tens3); \draw [ar] (ax3b) to [out=0,in=110] (tens3); \draw [ar] (ax3h) to [out=180,in=90] (ancl3); \draw [ar] (ax3b) to [out=180,in=100] (ancr3); \draw [ar] (bang3) -- ++ (0,-1); \draw (bang1) -|++(0.4,1.5) -| ($(ancl1)+(-0.3,0)$) -- (ancl1)--(ancr1)--(bang1); \draw (bang2) -|++(0.4,1.5) -| ($(ancl2)+(-0.3,0)$) -- (ancl2)--(ancr2)--(bang2); \draw (bang3) -|++(0.4,1.5) -| ($(ancl3)+(-0.3,0)$) -- (ancl3)--(ancr3)--(bang3); \draw [ar] (ancl1) to [bend right] (why1); \draw [ar] (ancr1) --++ (0,-1) (why1); \draw [ar] (ancl2) to [bend right] (why2); \draw [ar] (ancr2) --++ (0,-1) (why2); \draw [ar] (ancl3) to [bend right] (why3); \draw [ar] (ancr3) --++ (0,-1) (why3); \node (suite) at ($(why1)+(-0.6,-0.3)$) {}; \draw [ar,dashed] (why1) to [out=-90,in=0] (suite); \end{tikzpicture} \caption{\label{expb}This proof-net (if extended to $n$ boxes) reduces in ${\cal O}(n)$ reduction steps.} \end{figure} In Figure~\ref{exp}, we have $B_i \dcSim B_{i-1}$ because $((\sigma(B_i),[]),[\oc_{\sigl(\sige)}]) \csRel^2 ((\overline{\sigma_1(B_{i-1})},[]),[\oc_{\sige}])$ and $((\sigma(B_i),[]),[\oc_{\sigr(\sige)}]) \csRel^2 ((\overline{\sigma_2(B_{i-1})},[]),[\oc_{\sige}])$. Similarly, the proof-net of Figure~\ref{reallyExp} is not $\dcSim$-stratified because $B \dcSim B$. On the contrary, in Figure~\ref{expb}, $\dcSim=\varnothing$. \begin{figure} \centering \begin{tikzpicture} \node [princdoor] (bang) at (0,0) {}; \node at ($(bang)+(0.32,0.3)$) {$\mathbf{B}$}; \node [auxdoor] (aux2) at ($(bang)+(-0.8,0)$) {}; \node [auxdoor] (aux1) at ($(aux2) +(-0.6,0)$) {}; \node [cont] (cont) at ($(aux1)!0.5!(aux2)+(0,-0.6)$) {}; \node [tensor] (tens) at ($(bang)+(0,0.6)$) {}; \node [ax] (axb) at ($(tens)+(-0.7,0.3)$) {}; \node [ax] (axh) at ($(tens)+(-0.7,0.6)$) {}; \draw (bang) -| ++(0.5,1.4) -| ($(aux1)+(-0.32,0)$) -- (aux1) -- (aux2) -- (bang); \draw [ar] (tens)--(bang); \draw [ar] (axh) to [out= 0,in= 75] (tens); \draw [ar] (axb) to [out= 0,in=120] (tens); \draw [ar] (axh) to [out=180,in= 90] (aux1); \draw [ar] (axb) to [out=180,in= 90] (aux2); \draw [ar] (aux1) -- (cont); \draw [ar] (aux2) -- (cont); \node [par] (par) at ($(cont)!0.5!(bang)+(0,-1.2)$) {}; \node [forall] (fa) at ($(cont)!0.5!(par)$) {}; \draw [name path=bangPar,opacity=0] (bang)--(par); \draw [name path=horizontFa,opacity=0] ($(fa)+(-2,0)$) -- ($(fa)+(2,0)$); \node [exists, name intersections={of=bangPar and horizontFa}] (ex) at (intersection-1) {}; \draw [ar] (cont) -- (fa); \draw [ar] (fa)--(par); \draw [ar] (bang) -- (ex); \draw [ar] (ex)--(par); \node [princdoor] (bangf) at ($(par)+(0,-0.6)$) {}; \draw [ar] (par) -- (bangf); \draw (bangf) -| ++(1.15,3.6) -| ($(bangf)+(-1.25,0)$) -- (bangf); \node [tensor] (tensf) at ($(bangf)+(-13:1.2)$) {}; \node [der] (derf) at ($(tensf)+( 50:0.7)$) {}; \node [tensor] (tensfx)at ($(derf) +( 60:0.7)$) {}; \node [exists] (exx) at ($(tensfx)+(120:0.7)$) {}; \node [par] (parx) at ($(exx) +(0,0.6)$) {}; \node [ax] (axx) at ($(parx) +(0,0.7)$) {}; \node [ax] (axfx) at ($(tensfx)+(0.6,0.5)$) {}; \node [exists] (exf) at ($(tensf)+(-60:0.6)$) {}; \node [par] (parf) at ($(exf) +(-60:0.6)$) {}; \draw [ar] (axx.0) to [out= -20,in= 60] (parx); \draw [ar] (axx.180) to [out=-160,in=120] (parx); \draw [ar] (parx)-- (exx); \draw [ar] (exx) -- (tensfx); \draw [ar] (tensfx)--(derf); \draw [ar] (derf) --(tensf); \draw [ar] (bangf) to [out=-80, in=162] (tensf); \draw [ar] (tensf) --(exf); \draw [ar] (exf) --(parf); \draw [ar] (axfx) to [out=-170,in=60] (tensfx); \draw [ar] (axfx) to [out=-10, in=60] (parf); \node [tensor] (app) at ($(parf)+(5,0)$) {}; \node [cut] (cut) at ($(parf)!0.5!(app)+(0,-0.6)$) {}; \draw [ar] (parf) to [out=-40,in=180] (cut); \draw [ar] (app) to [out=-140,in= 0] (cut); \node [ax] (finax) at ($(app)+(0.8,0.3)$) {}; \draw [ar] (finax) to [out=180,in= 60] (app); \draw [ar] (finax) to [out= 0,in=120] ($(finax)+(0.8,-0.5)$); \node [forall] (forall) at ($(app)+(-0.3,0.8)$) {}; \draw [ar] (forall) -- (app); \node [par] (parg) at ($(forall)+(0,0.65)$) {}; \node [princdoor] (princ3g) at ($(parg)+(1, 1.5)$) {}; \node at ($(princ3g)+(0.5,0.4)$) {$\mathbf C$}; \node [auxdoor] (aux1g) at ($(princ3g)+(-2.5,0)$) {}; \node [auxdoor] (aux2g) at ($(aux1g)!0.333!(princ3g)$) {}; \node [auxdoor] (aux3g) at ($(aux1g)!0.666!(princ3g)$) {}; \node [cont] (cont1g) at ($(aux1g)!0.5!(aux2g)+(0,-0.9)$) {}; \node [cont] (cont2g) at ($(cont1g)!0.5!(parg)$) {}; \nvar{\hautTens}{1.1cm} \node [tensor] (tens1g) at ($(aux1g)+(0,\hautTens)$) {}; \node [tensor] (tens2g) at ($(aux2g)+(0,\hautTens)$) {}; \node [tensor] (tens3g) at ($(aux3g)+(0,\hautTens)$) {}; \nvar{\decAx}{0.4cm} \node [ax] (ax1n) at ($(tens1g)+(-0.5,\decAx)$) {}; \node [ax] (ax2n) at ($(tens1g)!0.5!(tens2g)+(0,\decAx)$) {}; \node [ax] (ax3n) at ($(tens2g)!0.5!(tens3g)+(0,\decAx)$) {}; \node [ax] (ax4n) at ($(princ3g)+(-0.3,\decAx + \hautTens)$) {}; \node [par] (parx) at ($(princ3g)+(0,0.6)$) {}; \draw [ar] (parg) -- (forall); \draw [ar] (cont2g) -- (parg); \draw [ar] (cont1g) -- (cont2g); \draw [ar] (aux1g) -- (cont1g); \draw [ar] (aux2g) -- (cont1g); \draw [ar] (aux3g) -- (cont2g); \draw [ar] (parx) -- (princ3g); \draw [ar] (tens1g) -- (aux1g); \draw [ar] (tens2g) -- (aux2g); \draw [ar] (tens3g) -- (aux3g); \draw [ar,out=-160,in= 170] (ax1n) to (parx); \draw [ar,out=0 ,in= 120] (ax1n) to (tens1g); \draw [ar,out=180 ,in= 60] (ax2n) to (tens1g); \draw [ar,out=0 ,in=120 ] (ax2n) to (tens2g); \draw [ar,out=180 ,in= 60] (ax3n) to (tens2g); \draw [ar,out=0 ,in=120 ] (ax3n) to (tens3g); \draw [ar,out=180 ,in= 60] (ax4n) to (tens3g); \draw [ar,out=-20 ,in= 60] (ax4n) to (parx); \draw (princ3g) -| ++(0.7,\hautTens + \decAx +0.3cm) -| ($(aux1g)+(-1.2,0)$) -- (aux1g) -- (aux2g) -- (aux3g) -- (princ3g); \draw (princ3g) -- (parg); \draw [dashed] ($(aux1)+(-0.6,1.6)$) rectangle ($(parf)+(1.6,-0.5)$); \node at ($(parf)+(1.3,0)$) {$\mathbf{G}$}; \draw [dashed] ($(forall)+(2,-0.3)$) rectangle ($(ax1n)+(-0.8,0.55)$); \node at ($(forall)+(1.7,0)$) {$\mathbf{H}$}; \end{tikzpicture} \caption{\label{reallyExp}The complexity of $G$ is not polynomial.} \end{figure} \begin{lemma}\label{lemma_sequences_edges_simple} Let $G$ be a $\stratSNLL$-stratified proof-net, $s\in \mathbb{N}$ and $(B,P)$ be a potential box with $d=\stratu{\dcSim}{B}$. There are at most $\left|\canRel{s-1}{\dirEdges{G}}\right|^d$ sequences $(e_i)_{1\leq i \leq l}$ of directed edges such that, there exists a potential sequence $(P_i)_{1 \leq i \leq l}$, a trace sequence $(T_i)_{1 \leq i < l}$ and $t \in \sig$ such that: \begin{equation*} ((\sigma(B),P),[\oc_t]) \csRel_{s} ((e_1,P_1),T_1) \csRel_{s} \cdots \csRel_{s} ((e_{l-1},P_{l-1}),T_{l-1}) \csRel_{s} ((e_l,P_l),[\oc_{\sige}]) \end{equation*} \end{lemma} \begin{proof} We prove it by induction on $d$. We suppose that there exists a path of the shape $((\sigma(B),P),[\oc_t]) \hspace{-0.15em}\csRel_s\hspace{-0.15em} ((e_1,P_1),T_1) \hspace{-0.15em}\csRel_s\hspace{-0.15em} \cdots \hspace{-0.15em}\csRel_s\hspace{-0.15em} ((e_{l-1},P_{l-1}),T_{l-1}) \hspace{-0.15em}\csRel_s\hspace{-0.15em} ((e_l,P_l),[\oc_{\sige}])$. If there is a context in the path of the shape $((\sigma(C),Q),[\oc_{\_}])$ with $\stratu{\dcSim}{C} < \stratu{\dcSim}{B}$, we set $k$ as the smallest index such that $((e_{k+1},P_{k+1}),T_{k+1})$ is such a context. Otherwise, we set $k=l$. First, let us notice that by induction hypothesis, there are at most $|\canRel{s-1}{\dirEdges{G}}|^{d-1}$ possibilities for $e_{k+1},\cdots,e_l$. Then, let us determine the number of possibilities for $e_1,\cdots,e_k$. There are at most $|\canRel{s-1}{\dirEdges{G}}|$ choices for $(e_k,P_k)^{s-1}$. Once $(e_k,P_k)^{s-1}$ is determined, we will prove by contradiction that it determines $e_1,\cdots,e_k$. Let us suppose that there exists two possible sequences: $e_1,\cdots,e_k$ and $e'_1,\cdots,e'_{k'}$. Then we consider the lowest $j$ such that $\restrCont{s-1}{((e_{k-j},P_{k-j}),T_{k-j})} \neq \restrCont{s-1}{((e'_{k'-j},P'_{k'-j}),T'_{k'-j})}$. By assumption we have $k>0$ and, by Theorem~\ref{injection_lemma_simple}, the ``$k-j$ and $k'-j$ steps'' must be $\onlyJump$ steps: \begin{align*} C_{k-j}=((\overline{\sigma_{i_1}(D)},P_{k-j}),[\oc_{v}]) &\onlyJump ((\sigma(D),P_{k-j}),[\oc_v])=C_{k+1-j}\\ C'_{k'-j}=((\overline{\sigma_{i_2}(D)},P'_{k'-j}),[\oc_{v'}]) &\onlyJump ((\sigma(D),P'_{k'-j}),[\oc_{v'}])=C'_{k'+1-j} \end{align*} with $\restrPot{s-1}{C_{k+1-j}}=\restrPot{s-1}{C'_{k'+1-j}}$ and $\restrPot{s-1}{C_{k-j}} \neq \restrPot{s-1}{C'_{k'-j}}$. By Lemma~\ref{lemma_restrpot_eq}, the difference is not on the potential and by Lemma~\ref{lemma_restr_eq} the difference is not on the trace, so the difference is on the edge: $i_1 \neq i_2$. By definition of $\dcSim$, it means that $B \dcSim D$ and $\stratu{\dcSim}{D}<\stratu{\dcSim}{B}$. This contradicts the definition of $k$. So our hypothesis is false: if we fix $\restrPot{s-1}{e_k,P_k}=\restrPot{s-1}{e_{k'},P_{k'}}$, then $[e_1;\cdots;e_k]=[e'_1;\cdots;e'_{k'}]$. Thus, we proved that there are at most $|\canRel{s-1}{\dirEdges{G}}|$ possibilities for $e_1,\cdots,e_k$ and at most $|\canRel{s-1}{\dirEdges{G}}|^{d-1}$ possibilities for $e_{k+1},\cdots,e_l$. In total, there are at most $|\canRel{s-1}{\dirEdges{G}}|^d$ possibilities for $e_1,\cdots,e_l$. \end{proof} \subsection{Nesting}\label{subsection_depcontrol_digging} Lemma~\ref{lemma_sequences_edges_simple} bounds the number of paths corresponding to copies, provided that $\stratSNLL$ and $\dcSim$ are acyclic. In the absence of $\digLab$ nodes, a copy $t$ of $(B,P)$ only contains $\sigl(\_)$, $\sigr(\_)$ and $\sige$ constructions. One can reconstruct $t$ by observing the list of contexts in the path, of the shape $((e_i,P_i),[\oc_{t_i}])$ with $\overline{e_i}$ being a premise of a contraction node. This is entirely determined by the sequence $e_1,\cdots,e_l$ of edges of the path $((\sigma(B),P),[\oc_{t}]) \csRel ((e_1,\_),\_) \csRel \cdots ((e_l,\_),[\oc_{\sige}])$. Thus, if there is no $\digLab$ node, Lemma~\ref{lemma_sequences_edges_simple} bounds the number of copies of $(B,P)$. To understand why the $\digLab$ nodes break this property, we can consider an example in Figure~\ref{exp2_dig}. We can notice that $\stratSNLL$ and $\dcSim$ are both the empty relation so $\stratu{\stratSNLL}{B_2}=\stratu{\stratSNLL}{B_1}=\stratu{\stratSNLL}{B_0}=1$ and $\stratu{\dcSim}{B_2}=\stratu{\dcSim}{B_1}=\stratu{\dcSim}{B_0}=1$. However, if extended to $n$ boxes, $|\cop{B_n,[]}|\geq 3^n$ and the number of $\cutRel$ steps is not polynomial in $n$. To guide intuition, we can study a similar situation in $\lambda$-calculus with pairs. The $\lambda$-term $(\lambda x.(\lambda y.\langle y,y\rangle)x)\cdots (\lambda x.(\lambda y.\langle y,y\rangle)x)z$ reduces to a $\lambda$-term of size $O(2^n)$ (with $n$ the number of successive applications of $\lambda x.(\lambda y.\langle y,y\rangle)x$). In this case $x$ has only one free occurrence in $\lambda x.(\lambda y.\langle y,y\rangle)x$ (it corresponds to the fact that there is only one auxiliary door in the boxes of Figure~\ref{exp2_dig}) however $x$ is duplicated inside $\lambda x.(\lambda y.\langle y,y\rangle)x$ (this term reduces to $\lambda x.\langle x,x\rangle$). This corresponds to the $\wn C$ node inside the boxes $B_i$ of Figure~\ref{exp2_dig}, which duplicates the box $B_{i-1}$. This is possible because the box $B_{i-1}$ gets inside the box $B_i$ because of the $\wn N$ node. We call {\em nesting} any restriction on linear logic which aims to tackle this kind of chains. The nesting in $LLL$~\cite{girard1995light}, $SLLL$~\cite{lafont2004soft}, $mL^4$~\cite{baillot2010linear} and $MS$~\cite{roversi2009some} is the absence of $\digLab$ node. Lemma~\ref{lemma_sequences_edges_simple} states that there are at most $|\dirEdges{G}|$ sequences of edges corresponding to copies of $(B_2,[])$, the sequence being entirely determined by the last edge\footnote{Indeed $S_0=\varnothing$ and, for every potential edge $\restrPot{\csRel_{\varnothing}}{e_l,P_l}=(e_l,[\sige;\cdots;\sige])$. So knowing $\restrPot{0}{e_l,P_l}$ is equivalent to knowing the last edge of the path.}. For instance, knowing that $((\sigma(B_2),[]),[\oc_t]) \csRel_1^* ((\overline{l},[p]),[\oc_{\sige}])$ is enough to deduce that: \begin{equation*} ((\sigma(B_2),[]),[\oc_t]) \csRel_1 ((\overline{f},[]),[\oc_t]) \csRel_1 ((\overline{\sigma_1(B_1)},[]),[\oc_{\sigl(\sige)};\oc_{p}]) \csRel_1^2 ((\overline{l},[p]),[\oc_{\sige}]) \end{equation*} Thus, we can deduce that $t$ is of the shape $\sign(\sigl(\sige),p)$, but we do not know $t$ entirely because $p$ can be any element of $\cop{B_1,[]}=\{\sige,\sign(\sige,\sige),\sign(\sigl(\sige),\sige),\sign(\sigr(\sige),\sige)\}$. Following the paths backwards we can observe that the most important step is $((\overline{f},[]),[\oc_{\sign(\sige, \sign(p,\sige))}]) \csRel_1 ((\overline{\sigma_1(B)},[],[\oc_{\sige};\oc_{\sign(p,\sige)}])$ where a difference on the second trace element (which comes from $B_1$ with $\stratu{\stratSNLL}{B_1}=1$) becomes a difference on the first trace element, which corresponds to $t$. The paths corresponding to $\sign(\sige, \sign(\sigl(\sige),\sige))$ and $\sign(\sige, \sign(\sigr(\sige),\sige))$ are the same, but the paths corresponding to their simplifications are different. The dependence of $|\cop{B_2,[]}|$ on $|\cop{B_1,[]}|$ in Figure~\ref{exp2_dig} is similar to the dependence in Figure~\ref{exp}. We define a relation $\nestSim$ on boxes capturing this dependence. Intuitively $B \nestSim C$ means that $B$ is cut with a $\digLab$ node along reduction and the outer residue $B_e$ of $B$ is cut with an auxiliary door of $C$. The acyclicity of $\nestSim$ is a nesting condition. \begin{figure} \centering \tikzsetnextfilename{exp_proofnetdig2} \begin{tikzpicture} \tikzstyle{door}=[draw, circle, inner sep=0.02cm] \node [princdoor] (bang1) at (0,0) {}; \node (name1) at ($(bang1)+(0.4,0.3)$) {$\mathbf{B_2}$}; \node [auxdoor] (aux1) at ($(bang1)+(-1, 0)$) {}; \node [cont] (cont1) at ($(aux1) +( 0,0.7)$) {}; \node [tensor] (tens1) at ($(bang1)+( 0,0.7)$) {}; \node [ax] (ax1b) at ($(tens1)!0.45!(cont1)+(0,0.4)$) {}; \node [ax] (ax1h) at ($(tens1)!0.45!(cont1)+(0,0.7)$) {}; \node [dig] (dig1) at ($(aux1) +(0,-0.7)$){}; \draw (bang1) -| ++(0.65,1.6) -| ($(aux1)+(-0.4,0)$) -- (aux1) -- (bang1); \draw [ar] (tens1)--(bang1); \draw [ar] (ax1b) to [out= 0,in=120] (tens1); \draw [ar] (ax1h) to [out=-10,in=70] (tens1); \draw [ar] (ax1b) to [out=-170,in=60] (cont1); \draw [ar] (ax1h) to [out=-170,in=120](cont1); \draw [ar] (cont1) -- (aux1); \draw [ar] (aux1) -- (dig1); \draw [ar,dashed] (dig1) to [out=-90,in=0] ($(dig1)+(-0.4,-0.4)$); \node [princdoor] (bang2) at ($(bang1)+(2.6,0)$) {}; \node (name2) at ($(bang2)+(0.4,0.3)$) {$\mathbf{B_1}$}; \node [auxdoor] (aux2) at ($(bang2)+(-1.2, 0)$) {}; \node [cont] (cont2) at ($(aux2) +( 0,0.7)$) {}; \node [tensor] (tens2) at ($(bang2)+( 0,0.7)$) {}; \node [ax] (ax2b) at ($(tens2)!0.5!(cont2)+(0,0.4)$) {}; \node [ax] (ax2h) at ($(tens2)!0.5!(cont2)+(0,0.7)$) {}; \node [dig] (dig2) at ($(aux2) +( 0,-0.7)$){}; \draw (bang2) -| ++(0.65,1.6) -| ($(aux2)+(-0.4,0)$) -- (aux2) -- (bang2); \draw [ar] (tens2)--(bang2); \draw [ar] (ax2b) to [out= 0,in=120] (tens2); \draw [ar] (ax2h) to [out=-10,in=70] (tens2); \draw [ar] (ax2b) to [out=-170,in=60] (cont2); \draw [ar] (ax2h) to [out=-170,in=120] node [edgename,above left=-0.05cm] {$l$} (cont2); \draw [ar] (cont2) -- (aux2) node [edgename,right] {$e$}; \draw [ar] (aux2) -- (dig2); \node [cut](cut12) at ($(bang1)!0.5!(aux2)+(0,-1)$) {}; \draw [ar] (bang1) to [out=-90,in=180] (cut12); \draw [ar] (dig2) to [out=-100,in= 0] node [edgename,pos=0.4,right] {$f$} (cut12); \node [princdoor] (bang3) at ($(bang2)+(2.6,0)$) {}; \draw [ar] (bang3) --++ (0,-1); \node (name3) at ($(bang3)+(0.4,0.3)$) {$\mathbf{B_0}$}; \node [auxdoor] (aux3) at ($(bang3)+(-1.2, 0)$) {}; \node [cont] (cont3) at ($(aux3) +( 0,0.7)$) {}; \node [tensor] (tens3) at ($(bang3)+( 0,0.7)$) {}; \node [ax] (ax3b) at ($(tens3)!0.5!(cont3)+(0,0.4)$) {}; \node [ax] (ax3h) at ($(tens3)!0.5!(cont3)+(0,0.7)$) {}; \node [dig] (dig3) at ($(aux3) +( 0,-0.7)$){}; \draw (bang3) -| ++(0.65,1.6) -| ($(aux3)+(-0.4,0)$) -- (aux3) -- (bang3); \draw [ar] (tens3)--(bang3); \draw [ar] (ax3b) to [out= 0,in=120] (tens3); \draw [ar] (ax3h) to [out=-10,in=70] (tens3); \draw [ar] (ax3b) to [out=-170,in=60] (cont3); \draw [ar] (ax3h) to [out=-170,in=120](cont3); \draw [ar] (cont3) -- (aux3) node [edgename] {}; \draw [ar] (aux3) to (dig3); \node [cut](cut23) at ($(bang2)!0.5!(aux3)+(0,-1)$) {}; \draw [ar] (bang2) to [out=-90,in=180] (cut23); \draw [ar] (dig3) to [out=-100,in= 0] node [edgename,pos=0.4,right] {$g$} (cut23); \end{tikzpicture} \caption{This proof-net (if extended to $n$ boxes) reduces in ${\cal O}(2^n)$ reduction steps.} \label{exp2_dig} \end{figure} \begin{definition}\label{def_nestsim} We set $B \nestSim C$ if there exists a non-standard signature $t$ and a path of the shape: \begin{equation*} ((\sigma(B),P),[\oc_t]) \csRel^+ ((\sigma(C),Q),[\oc_{\sige}]) \end{equation*} \end{definition} For example, in Figure~\ref{exp2_dig}, we have $B_2 \nestSim B_1$ because $\sigp(\sige)$ is non-standard and $((\sigma(B_2),[]),[\oc_{\sigp(\sige)}]) \csRel^3 ((\sigma(B_1),[]),[\oc_{\sige}])$. To prove that $\nestSim$-stratification (together with $\stratSNLL$-stratification and $\dcSim$-stratification) implies polynomial time, we will need some technical lemmas to handle simplifications of copies. In the following, we consider a $\stratSNLL$-stratified, $\nestSim$-stratified, $\dcSim$-stratified proof-net $G$. Let $s,n \in \mathbb{N}$, we set\label{def_Tsn} $T_{s,n}= \Set*{ B \in \boxset{G} }{ (\stratu{\stratSNLL}{B},\stratu{\nestSim}{B}) \leqlex (s,n) }$ with $\leqlex$ the usual lexicographic order: \label{def_leqlex}$(a,b) \leqlex (a',b')$ iff $a < a'$ or ($a \leq a'$ and $b \leq b'$). To simplify notations, we write $\csRel_{s,n}$ for $\csRel_{T_{s,n}}$, $\copRel{s,n}{C}$ for $\copRel{\csRel_{T_{s,n}}}{C}$ and so on. \begin{lemma}\label{lemma_bound_poly_toutca_simple} For $s,n \in \mathbb{N}-\{0\}$ and $(B,P) \in \can{\boxset{G}}$, \begin{equation*} \left | \copRel{s,n}{B,P} \right | \leq \left | \canRel{s-1}{\dirEdges{G}} \right |^{\left|\dcSim\right|} \cdot \left |\dirEdges{G}\right | \cdot \left ( \max_{(C,Q) \in \pot{\boxset{G}}} \left| \copRel{s,n-1}{C,Q} \right| \right )^{\depthG{G}} \end{equation*} \end{lemma} \begin{proof} If $\stratu{\nestSim}{B}>n$, then $((\sigma(B),P),[\oc_{\_}]) \not \csRel_{s,n}$ and $\copRel{s,n}{B,P}=\{\sige\}$ so the lemma stands. Otherwise (if $\stratu{\nestSim}{B}\leq n$), let us consider $t,t' \in \copRel{s,n}{B,P}$. By definition, there exists paths of the shape: \begin{align*} ((\sigma(B),P),[\oc_{t}]) &\csRel_{s,n} \hspace{-0.15em}((e_1,P_1),T_1) \hspace{-0.7em}&&\csRel_{s,n} \cdots \hspace{-0.7em}&&\csRel_{s,n} ((e_k,P_k),T_k) \hspace{-0.2em}&&\csRel_{s,n} ((e,Q),[\oc_{\sige}])\\ ((\sigma(B),P),[\oc_{t'}]) &\csRel_{s,n} \hspace{-0.15em}((e'_{1},P'_{1}),T'_{1})\hspace{-1.5em} &&\csRel_{s,n} \cdots \hspace{-1.7em}&& \csRel_{s,n} ((e'_{k'},P'_{k'}),T'_{k'}) \hspace{-1.5em}&&\csRel_{s,n} ((e',Q'),[\oc_{\sige}]) \end{align*} By Lemma~\ref{lemma_sequences_edges_simple}, there are at most $\left| \canRel{s-1}{\dirEdges{G}} \right |^{\left|\dcSim\right|}$ possible choices for $[e_1;\cdots;e_k]$. Let us suppose that $[e_1;\cdots;e_k]=[e'_{1};\cdots;e'_{k'}]$ and $\restrPot{s,n-1}{e,Q}=\restrPot{s,n-1}{e',Q'}$. We will prove by contradiction that $t=t'$. Let us suppose that $t \neq t'$ and consider them as trees. Because $[e_1;\cdots;e_k]=[e'_{1};\cdots;e'_{k'}]$, their leftmost branches are the same. We consider the leftmost branches, $b$ and $b'$, which are different in $t$ and $t'$. Let us consider the simplifications $u$ and $u'$ of $t$ and $t'$ whose leftmost branches are $b$ and $b'$. Thus $u \complStrict t$, $u' \complStrict t'$, and the leftmost branches of $u$ and $u'$ are different. By definition of copies $((\sigma(B),P),[\oc_u]) \csRel^* ((\_,\_),[\oc_{\sige}])$ and $((\sigma(B),P),[\oc_{u'}]) \csRel^* ((\_,\_),[\oc_{\sige}])$. We consider the first step of those paths which differs from the paths corresponding to $t$ and $t'$. Formally, we consider the lowest $i \in \mathbb{N}$ such that $((\sigma(B),P),[\oc_u]) \csRel^i ((f_i,\_),\_)$ with $f_i \neq e_i$. We are in the following case (with $v \simpl w$ and $v' \simpl w'$): \begin{align*} ((\sigma(B),P),[\oc_t]) \hspace{0.3em} \csRel^{i-1} \hspace{0.2em}((\overline{\sigma_a(C)},P_i),V.\oc_{v}) \hspace{0.6em}&\noJump ((e_i,P_i.v),V) \\ ((\sigma(B),P),[\oc_{t'}]) \csRel^{i-1} ((\overline{\sigma_a(C)},P'_i),V'.\oc_{v'}) &\noJump ((e_i,P'_i.v'),V')\\ ((\sigma(B),P),[\oc_u]) \csRel^{i-1} \hspace{0.2em}((\overline{\sigma_a(C)},P_i),[\oc_{w}]) \hspace{0.4em}&\onlyJump ((\sigma(C),P_i),[\oc_{w}]) \\ ((\sigma(B),P),[\oc_{u'}]) \csRel^{i-1} ((\overline{\sigma_a(C)},P'_i),[\oc_{w'}]) \hspace{0.2em}&\onlyJump ((\sigma(C),P'_i),[\oc_{w'}]) \end{align*} We supposed $\restrPot{s,n-1}{e,Q}=\restrPot{s,n-1}{e',Q'}$. By induction on $k-j$, for $1 \leq j \leq k$, we have $\restrCont{s,n-1}{((e_j,P_j),T_j)}=\restrCont{s,n-1}{((e_j,P'_j),T'_j)}$: we use Theorem~\ref{injection_lemma_simple} for $\noJump$ steps and Lemma~\ref{injection_lemma_jump} for $\onlyJump$ steps (because $[e_1;\cdots;e_k]=[e'_1;\cdots;e'_k]$). In particular, $\restrCont{s,n-1}{((e_i,P_i.v),V)}=\restrCont{s,n-1}{((e_i,P'_i.v'),V')}$ so the signatures $\restrSig{s,n-1}{(\restrPot{s,n-1}{\sigma(C),P_i},[\oc_v])}$ and $\restrSig{s,n-1}{(\restrPot{s,n-1}{\sigma(C),P'_i},[\oc_{v'}])}$ are equal. $u$ is a strict simplification of $t$ so $u$ is not standard. By definition of $\nestSim$, we have $B \nestSim C$ so $\stratu{\nestSim}{C}<\stratu{\nestSim}{B} \leq n$. One can verify that, for every box $D$ such that $((\sigma(C),Q_i),[\oc_w]) \csRel^* ((\sigma(D),\_),[\oc_{\_}])$ or $((\sigma(C),Q'_i),[\oc_{w'}]) \csRel^* ((\sigma(D),\_),[\oc_{\_}])$ we also have $B \nestSim D$ (so $\stratu{\nestSim}{D} \leq n-1$). Thus \begin{align*} v &= \restrSig{s,n}{((\sigma(C),P_i),[\oc_v])} &&\text{Because }t \in \copRel{s,n}{B,P}\\ &= \restrSig{s,n-1}{((\sigma(C),P_i),[\oc_v])} &&\text{Because ``$\stratu{\nestSim}{D} \leq n-1$''}\\ &= \restrSig{s,n-1}{((\sigma(C),P'_i),[\oc_{v'}])} &&\text{Proved in the previous paragraph.} \\ &= \restrSig{s,n}{((\sigma(C),P'_i),[\oc_{v'}])} && \text{Because ``$\stratu{\nestSim}{D} \leq n-1$''} \\ v &=v' &&\text{Because }t' \in \copRel{s,n}{B,P} \end{align*} Because $u=u'$ and the $i-1$ first steps from $((\sigma(B),P),[\oc_u])$ and $((\sigma(B),P'),[\oc_{u'}])$ take the same edges ($e_1,\cdots,e_{i-1}$) the leftmost branches of $u$ and $u'$ are equal. This is a contradiction. Our supposition was false, under our assumptions $t$ and $t'$ are equal. So we proved that, if we choose $[e_1;\cdots;e_k]$ and $\restrPot{s,n-1}{e,Q}$ then $t$ is uniquely determined. Thus, \begin{align*} \left | \copRel{s,n}{B,P} \right | &\leq \left | \canRel{s-1}{\dirEdges{G}} \right |^{\left|\dcSim\right|} \cdot \left | \canRel{s,n-1}{\dirEdges{G}} \right|\\ \left | \copRel{s,n}{B,P} \right | &\leq \left | \canRel{s-1}{\dirEdges{G}} \right |^{\left|\dcSim\right|} \cdot \left |\dirEdges{G}\right | \cdot \left ( \max_{(C,Q) \in \pot{\boxset{G}}} \left| \copRel{s,n-1}{C,Q} \right| \right )^{\depthG{G}} \end{align*} \end{proof} \begin{theorem}\label{theo_bound_poly_nest} Let $x=\left| \dirEdges{G} \right|$, $S=\left|\stratSNLL\right|$, $D=\left|\dcSim\right|$, $N=\left|\nestSim \right|$, and $\partial=1+\depthG{G}$, then: \begin{equation*} \max_{(B,P) \in \pot{\boxset{G}}} \left| \cop{B,P} \right| \leq x^{D^S \cdot \partial^{N \cdot S+N+S}-1} \end{equation*} \end{theorem} \begin{proof} For $s,n \in \mathbb{N}$, we set $u_{0,n}=u_{s,0}=1$ and $u_{s,n}= u_{s-1,N}^{\depthG{G} \cdot D} \cdot x \cdot u_{s,n-1}^{\depthG{G}}$. Then, thanks to Lemma~\ref{lemma_bound_poly_toutca_simple}, we can prove by induction on $(s,n)$ that $\max_{(B,P) \in \pot{\boxset{G}} }\left|\copRel{s,n}{B,P} \right| \leq u_{s,n}$. One can verify by induction on $n$ that: \begin{equation*} u_{s,n} = \left(u^{\depthG{G} \cdot D}_{s-1,N} \cdot x \right)^{\sum_{i=0}^{n-1} \depthG{G}^i} \end{equation*} Thus, for every $n \in \mathbb{N}$, \begin{equation*} u_{s,n} \leq \left(u^{(\partial-1) \cdot D}_{s-1,N} \cdot x\right)^{\partial^n} = x^{\partial^n} \cdot u_{s-1,N}^{D\cdot \partial^{n} \cdot (\partial-1)} \end{equation*} Thus, we prove by induction on $s$, that: \begin{align*} u_{s,N} &\leq \left(x^{\partial^N} \right)^{\sum_{j=0}^{s-1} (D \cdot \partial^{N} \cdot (\partial - 1))^j} \leq \left(x^{\partial^N}\right)^{(D \cdot \partial^{N} (\partial-1))^s} \leq x^{D^s \cdot \partial^{s\cdot N + s + N}- 1} \end{align*} Finally, let us notice that $\csRel_{S,N}=\csRel$, so $\copRel{S,N}{B,P}=\cop{B,P}$. Thus, \begin{align*} \max_{(B,P) \in \pot{\boxset{G}}} \left| \cop{B,P} \right| &= \max_{(B,P) \in \pot{\boxset{G}} }\left|\copRel{S,N}{B,P} \right| \\ & \leq u_{S,N} \\ \max_{(B,P) \in \pot{\boxset{G}}} \left| \cop{B,P} \right| &\leq x^{D^S \cdot \partial^{S \cdot N + S + N}-1} \end{align*} \end{proof} \begin{coro}\label{coro_bound_poly_nest}Let us consider a $\stratSNLL$-stratified, $\nestSim$-stratified, $\dcSim$-stratified proof-net $G$. Let $x=\left| \dirEdges{G} \right|$, $S=\stratG{G}$, $D=\left| \dcSim \right|$, $N=\left| \nestSim \right|$, and $\partial=1+\depthG{G}$, then: \begin{equation*} W_G \leq x^{D^{S} \cdot \partial^{(N+1) \cdot (S+1)}} \end{equation*} \end{coro} \begin{proof} By Theorem~\ref{theo_bound_poly_nest}, we have \begin{align*} W_G &= \left | \can{\dirEdges{G}} \right | \leq \left | \dirEdges{G} \right| \cdot \max_{(B,P) \in \pot{\boxset{G}}} \left | \cop{B,P} \right |^{\partial} \leq x \cdot \left(x^{D^S \cdot \partial^{N \cdot S+N+S}-1}\right)^{\partial}\\ W_G &\leq x^{D^{S} \cdot \partial^{N \cdot S + N + S +1}} = x^{D^{S} \cdot \partial^{(N+1) \cdot (S+1)}} \end{align*} \end{proof} The polynomial in the bound only depends on $\stratG{G}$, $\left| \dcSim \right|$, $\left| \nestSim \right|$, and $\depthG{G}$. Those four parameters are bounded by the number of boxes. So a stratified nested proof-net controlling dependence normalizes in a time bounded by a polynomial on the size of the proof-net, the polynomial depending only on the number of boxes of the proof-net. In the usual encoding of binary words (or other inductive types) in linear logic, the number of boxes is independent of a term. Let us suppose that for every binary word $w$, the proof-net $(G)\underline{w}$ (representing the application of $G$ to the encoding of $w$) is $\stratSNLL$-stratified, $\dcSim$-stratified and $\nestSim$-stratified. Then $W_{(G)\underline{w}}$ is bounded by $P\left(|w|\right)$ with $P$ a polynomial which does not depend on $w$. This is the definition of polynomial soundness. However, those semantic criteria are not useful per se: \begin{itemize} \item The only method we know to check the acyclicity of those relations on a proof-net $H$ is to normalize $H$ to compute the $\csRel$-paths. Normalizing a proof-net to obtain a bound on the length of its normalization has no practical use. \item Given a proof-net $G$, we have no method to check if there exists a binary word such that one of those relation is cyclic on $(G)\underline{w}$. \end{itemize} In the next section we will define a decidable subsystem of linear logic (named $SDNLL$) such that $\stratSNLL$, $\dcSim$ and $\nestSim$ are acyclic on every proof-net of $SDNLL$. For $s,d,n\in \mathbb{N}$, we define a formula $\BSDN{s}{d}{n}$ such that every binary word can be encoded by a proof-net typed by $\BSDN{s}{d}{n}$. Determining if a given proof-net $G$ can be typed by a formula of the shape $\BSDN{s}{d}{n} \multimap A$ is decidable. And, if this is the case $(G)\underline{w}$ is $\stratSNLL$-stratified, $\dcSim$-stratified and $\nestSim$-stratified for every binary word $w$. \section{Linear logic subsystems and $\lambda$-calculus type-systems}\label{chapter_type_systems} \label{section_def_sdnll} \subsection{Definition of $SDNLL$}\label{section_def_sdnll} We define a linear logic subsystem, called $SDNLL$ (for {\em S}tratification {\em D}ependence control {\em N}esting Linear Logic) characterizing polynomial time. In $SDNLL$, to enforce $\stratSNLL$-stratification, $\dcSim$-stratification and $\nestSim$-stratification, we label the $\oc$ and $\wn$ modalities with integers $s$, $d$ and $n$. Let us consider a $SDNLL$ proof-net $G$ and boxes $B$ and $B'$ with $\beta(\sigma(B))=\oc_{s,n,d}A$ and $\beta(\sigma_G(B'))=\oc_{s',d',n'}A'$. Then we will have the following implications: ($B \stratSNLL B'$ implies $s > s'$), ($B \dcSim B'$ implies $d>d'$) and ($B \nestSim B'$ implies $n > n'$). This implies that $G$ is $\stratSNLL$-stratified, $\dcSim$-stratified and $\nestSim$-stratified. \begin{definition}\label{def_sdnll} For $s \in \mathbb{N}$, we define $\form{s}$ by the following grammar (with $t,d,n \in \mathbb{N}$, $t \geq s$ and $X$ ranges over a countable set of variables). Notice that $\form{0} \supseteq \form{1} \supseteq \cdots$ \begin{equation*} \form{s} := X_{t} \mid X^\perp_t \mid \form{s} \otimes \form{s} \mid \form{s} \parr \form{s} \mid \forall X_{t}. \form{s} \mid \exists X_{t}.\form{s} \mid \oc_{t,d,n} \form{t+1} \mid \wn_{t,d,n} \form{t+1} \end{equation*} \end{definition} In this section, a {\em formula context} is a formula where a subterm has been replaced by $\circ$ (e.g. $\oc_{2,1,3}X \parr \circ$). If $h$ is a formula context and $A$ is a formula, then $h[A]$ refers to the formula obtained by replacing $\circ$ by $A$ in $h$. We gave another definition for ``context'' in Section~\ref{section_def_cont_sem}, and we will define yet another in Section~\ref{section_sdnll_lambda}. Because those terms are well-established terms, we chose not not create new terms. Because these definitions are very different, there should be little confusion. For any formula of the shape $A=\oc_{s',d',n'}A'$, we write $\straF{A}$ for $s'$, $\dcF{A}$ for $d'$ and $\nesF{A}$ for $n'$. For $A \in \form{0}$, $s_A^{min}$ refers to the minimum $s \in \mathbb{N}$ such that $A=h[\oc_{s,\_,\_}\_]$ with $h$ a formula context. To gain expressivity, we define a subtyping relation $\leq$ on $\form{0}$. The relation $\leq$, defined as the transitive closure of the following $\leq^1$ relation, follows the intuition that a connective $\oc_{s,d,n}$ in a formula means that this connective ``comes'' from a box $B$ with $\stratu{\stratSNLL}{B} \geq s$, $\stratu{\dcSim}{B} \geq d$ and $\stratu{\nestSim}{B} \geq n$. \begin{equation*} A \leq^1 B \Leftrightarrow \left \{ \begin{array}{ll} \text{Either }& A = g[\oc_{s,d,n}D], B = g[\oc_{s',d',n'}D], s \geq s', d \geq d' \text{ and } n \geq n'\\ \text{Or } & A = g[\wn_{s,d,n}D], B = g[\wn_{s',d',n'}D], s \leq s', d \leq d' \text{ and } n \leq n' \end{array} \right . \end{equation*} \begin{lemma}\label{subtyping_perp} If $A \leq B$ then $A^\perp \geq B^\perp$ \end{lemma} \begin{proof} Immediate from the definition of $\leq$. \end{proof} \begin{definition}\label{def_sdnll_proofnet} A {\em $SDNLL$ proof-net} is a proof-net whose edges are labelled by a $\form{0}$ formula, the labels respecting the constraints of Figure~\ref{rules_labelling_snll} modulo subtyping. More precisely, the labelling of a proof-net $G$ is correct if for every node/box whose premises are labelled by $A_1,\cdots,A_k$ and whose conclusions are labelled by $C_1,\cdots,C_l$, there exists an instance of the constraint of Figure~\ref{rules_labelling_snll} whose premises are labelled by $A_1,\cdots,A_k$ and conclusions are labelled by $B_1,\cdots,B_l$ with $B_1 \leq C_1$,...$B_l \leq C_l$. \end{definition} For instance, let us suppose that $d_1 \geq d$ and $d_2,\cdots,d_k \geq d+1$ then $\wn_{s_1,d,n}A_1 \leq \wn_{s_1,d_1,n}A_1$, $\wn_{s_2,d+1,n}A_2 \leq \wn_{s_2,d_2,n}A_2$, ..., $\wn_{s_k,d+1,n}A_k \leq \wn_{s_k,d_k,n}A_k$. So, a box with premises $A_1,\cdots,A_k,C$ and conclusions $\wn_{s_1,d_1,n}A_1$,...$\wn_{s_k,d_k,n}A_k,\oc_{s,d,n}C$ satisfies the conditions of $SDNLL$ proof-nets. The $SDNLL$ labels are compatible with cut-elimination as shown by the rules of Figure~\ref{cut_sdnll}. For most rule, the only difficulty is to handle subtyping. We explain it for the $\otimes / \parr$ case (the $ax$, $\forall / \exists$, $\oc P / \wn D$, $\oc P / \wn W$ and $\oc P / \wn C$ rules are adapted in the same way): by definition of $SDNLL$ proof-nets, $C \geq A \parr B$ so $C$ is of the shape $A_1 \parr B_1$ with $A \leq A_1$ and $B \leq B_1$. So $C^\perp = A_1^\perp \otimes B_1^\perp$ and, by definition of $SDNLL$ proof-nets, $A_2^\perp \leq A_1^\perp$ and $B_2^\perp \leq B_1^\perp$. By Lemma~\ref{subtyping_perp}, $A_1^\perp \leq A^\perp$ and $B_1^\perp \leq B^\perp$. So $A_2^\perp \leq A^\perp$ and $B_2^\perp \leq B^\perp$. So, whatever are the nodes with conclusions $A_2^\perp$ and $B_2^\perp$, we can replace their conclusions with $A^\perp$ and $B^\perp$ without breaking $SDNLL$ constraints. One can observe that we could have labelled the edges with $A_1,B_1,A^\perp_1,B_1^\perp$, or with $A_2,B_2,A^\perp_2,B_2^\perp$ or other formulae between $A$ and $A_2$ and between $B$ and $B_2$. We decide not to choose a canonical reduction: this only influences the indices on exponential connectives, and the conclusions of the proof-net are not concerned. For the sake of readability, in the reductions of Figure~\ref{cut_sdnll} we suppose that subtyping only modifies the outermost exponential connectives (modification of labels on inner connectives are dealt as in the $\otimes / \parr$ case). Every letter in the indices represents a positive number, writing $d+d_1$ as the second index of an edge allows to represent any number greater than (or equal to) $d$. \begin{itemize} \item For the $\oc P / \wn P$ rule, we can notice that $d=d'+d'_1$ so $d \geq d'$, and $n=n'+n'_1$ so $n \geq n'$. Thus we have $d+d_1 \geq d'$, $d+d_k+1 > d'$, $n+n_1 \geq n'$ and $n+n_k \geq n'$. The box in the reduct satisfies the constraints of $SDNLL$. \item For the $\oc P / \wn N$ rule, according to the definition of $SDNLL$ proof-nets, $d \geq d'$, and $n \geq n'$. So $n+n_1 \geq n'$, $n+n_k \geq n'$ and the outermost box of the reduct satisfies the constraints of $SDNLL$. We also have $n+n_1+1 \geq n'+1$ and $n+n_k+1 \geq n'+1$, so the innermost box of the reduct satisfies the constraints of $SDNLL$. \end{itemize} \begin{figure}\centering \tikzstyle{edgename}=[phantom] \begin{subfigure}{\textwidth} \centering \begin{tikzpicture}[baseline=0cm] \tikzstyle{edgename}=[opacity=0] \begin{scope}[shift={(3.2,-1.6)}] \node [par] (par) at (0,0) {}; \node [tensor] (tens) at ($(par)+(1.5,0)$) {}; \node [cut] (cut) at ($(par)!0.5!(tens)+(0,-0.5)$) {}; \node [etc] (pl) at ($(par) +(110:0.7)$) {}; \node [etc] (pr) at ($(par) +( 70:0.7)$) {}; \node [etc] (tl) at ($(tens)+(110:0.7)$) {}; \node [etc] (tr) at ($(tens)+( 70:0.7)$) {}; \draw [ar] (pl) -- (par) node [type,left] {$A$} node [edgename] {$a$}; \draw [ar] (pr) -- (par) node [type] {$B$} node [edgename,right] {$b$}; \draw [ar] (tl) -- (tens)node [type,left] {$A_2^\perp$} node [edgename] {$e$}; \draw [ar] (tr) -- (tens)node [type] {$B_2^\perp$} node [edgename,right] {$f$}; \draw [ar,out=-90,in=180] (par) to node [edgename,below left] {$c$} node [type,left,pos=0.25] {$C$} (cut); \draw [ar,out=-90,in= 0] (tens) to node [edgename,below right]{$d$} node [type,pos=0.25] {$C^\perp$}(cut); \draw [reduc] (2.4,0.4) --++(0.7,0) node [below left=-0.1cm] {$cut$}; \node (pl2) at ($(pl)+(4, 0)$) {}; \node (pr2) at ($(pr)+(4,0)$) {}; \node (tl2) at ($(tl)+(4,0)$) {}; \node (tr2) at ($(tr)+(4,0)$) {}; \node [cut] (cutl) at ($(pl2)!0.5!(tl2)+(-0.3,-0.7)$) {}; \node [cut] (cutr) at ($(pr2)!0.5!(tr2)+( 0.3,-0.7)$) {}; \draw [ar,out=-90,in=180] (pl2) to node [type,pos=0.1,left] {$A$} node [edgename,pos=0.15] {$a$} (cutl); \draw [ar,out=-90,in= 0] (tl2) to node [type,right=-0.08cm, pos=0.1] {$A^\perp$} node [edgename,pos=0.1] {$e$} (cutl); \draw [ar,out=-90,in=180] (pr2) to node [type,pos=0.1,left] {$B$} node [edgename,pos=0.1] {$b$} (cutr); \draw [ar,out=-90,in= 0] (tr2) to node [type,pos=0.1] {$B^\perp$} node [edgename,pos=0.15] {$f$} (cutr); \end{scope} \end{tikzpicture} \end{subfigure} \vspace{2em} \begin{subfigure}{\textwidth} \centering \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \begin{scope}[scale=1.0] \node [proofnet,minimum width=5cm] (G) at (0,0) {$G'$}; \node [princdoor] (prg) at ($(G.-5)+(0,-0.7)$) {}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-175)+(0,-0.7)$) {}; \draw (a2)--(prg) -| ++(0.4,1.3) -| ($(a1)+(-0.4,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-5)--(prg) node [type,right=-0.06cm] {$A$} node [edgename] {$a$}; \draw [ar] (G.-90)--(a2) node [type,right=-0.06cm] {$A_k$} node [edgename] {$a_k$}; \draw [ar] (a2)--++(0,-0.65) node [type,right=-0.06cm] {$\wn_{s_k,d+d_k+1,n+n_k} A_k$} node [edgename] {$c_k$} ; \draw [ar] (G.-175)--(a1) node [type,right=-0.06cm] {$A_1$} node [edgename] {$a_1$}; \draw [ar] (a1)--++(0,-0.65) node [type,right=-0.06cm] {$\wn_{s_1,d+d_1,n+n_1} A_1$} node [edgename] {$c_1$}; \node [proofnet,minimum width=5cm] (H) at ($(G)+(6.5,0)$) {$H'$}; \node [princdoor] (prh) at ($(H.-5)+(0,-0.7)$) {}; \node [auxdoor] (b2) at ($(H.-90)+(0,-0.7)$) {}; \node [auxdoor] (b1) at ($(H.-175)+(0,-0.7)$) {}; \draw (b2)--(prh) -| ++(0.4,1.3) -| ($(b1)+(-0.4,0)$) -- (b1); \draw [dotted] (b1)--(b2); \draw [ar] (H.-5)--(prh) node [type,right=-0.06cm] {$B$} node [edgename] {$b$}; \draw [ar] (H.-90) --(b2) node [type,right=-0.06cm] {$B_l$} node [edgename] {$b_l$}; \draw [ar] (b2)--++(0,-0.65) node [type,right=-0.06cm] {$\wn_{s'_l,d'+d'_l+1,n'+n'_l} B_l$} node [edgename] {$d_l$}; \draw [ar] (H.-175)--(b1) node [type,right=-0.06cm] {$A^\perp$} node [edgename] {$b_1$}; \draw [ar] (prh)--++(0,-0.65) node [type,right=-0.06cm] {$\oc_{s',d',n'} B$} node [edgename] {$d$}; \node [cut] (cut) at ($(prg)!0.5!(b1)+(0,-0.65)$) {}; \draw [ar,out=-90,in=180] (prg) to node [edgename, below left] {$c$} node [type,pos=0.2] {$\oc_{s,d,n} A$} (cut); \draw [ar,out=-90,in= 0] (b1) to node [edgename, below right=-0.2cm] {$d_1$} node [type,pos=0.2] {$\wn_{s'_1,d'+d'_1,n'+n'_1} A^\perp$} (cut); \draw [reduc] (3,-2)--++(0,-0.6) node [near end, right] {$cut$}; \node [proofnet,minimum width=3.5cm] (G) at ($(G)+(0,-3)$) {$G'$}; \node [auxdoor] (a2) at ($(G.-20)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-171)+(0,-0.7)$) {}; \node [proofnet,minimum width=5cm] (H) at ($(G)+(6,0)$) {$H'$}; \node [princdoor] (prh) at ($(H.-5)+(0,-0.7)$) {}; \node [auxdoor] (b2) at ($(H.-41)+(0,-0.7)$) {}; \node [auxdoor] (b1) at ($(H.-174)+(0,-0.7)$) {}; \node [cut] (cut)at ($(G.-8)!0.5!(H.-175)+(0,-0.6)$) {}; \draw [ar,out=-90,in=180] (G.-8) to node [edgename, below left =-0.1] {$a$} node [type,pos=0.3] {$A$} (cut); \draw [ar,out=-90,in= 0] (H.-175) to node [edgename, below right=-0.15] {$b_1$} node [type,left, pos=0.3] {$A^\perp$}(cut); \draw (b2)--(prh) -| ++(0.4,1.3) -| ($(a1)+(-0.4,0)$) -- (a1); \draw (a2)--(b1); \draw [dotted] (a1)--(a2); \draw [dotted] (b1)--(b2); \draw [ar] (G.-20)--(a2) node [type] {$A_k$} node [edgename] {$a_k$}; \draw [ar] (a2)--++(0,-0.8) node [type] {$\wn_{s_k,d+d_k+1,n+n_k} A_k$} node [edgename] {$c_k$}; \draw [ar] (G.-171)--(a1) node [type] {$A_1$} node [edgename] {$a_1$}; \draw [ar] (a1)--++(0,-0.8) node [type] {$\wn_{s_1,d+d_1,n+n_1} A_1$} node [edgename] {$c_1$}; \draw [ar] (H.-41)--(b2) node [type] {$B_l$} node [edgename] {$b_l$}; \draw [ar] (b2)--++(0,-0.8) node [type] {$\wn_{s'_l,d+d'_l+1,n+n'_l} B_l$} node [edgename] {$d_l$}; \draw [ar] (H.-174)--(b1) node [type] {$B_2$} node [edgename,left=-0.1cm] {$b_2$}; \draw [ar] (b1)--++(0,-0.8) node [type] {$\wn_{s'_2,d'+d'_2+1,n+n'_2} B_2$} node [edgename] {$d_2$}; \draw [ar] (H.-5)--(prh) node [type] {$B$} node [edgename] {$b$}; \draw [ar] (prh)--++(0,-0.8) node [type] {$\oc_{s',d',n'} B$} node [edgename] {$d$}; \end{scope} \end{tikzpicture} \end{subfigure} \vspace{2em} \begin{subfigure}{\textwidth} \centering \begin{tikzpicture}[baseline=0.2cm] \tikzstyle{edgename}=[opacity=0] \node [proofnet,minimum width=5cm] (G) at (0,0) {$G'$}; \node [princdoor] (pr) at ($(G.-5)+(0,-0.7)$) {}; \node [above] at ($(pr)+(0.5,0)$) {$\mathbf{B}$}; \node [auxdoor] (a2) at ($(G.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1) at ($(G.-175)+(0,-0.7)$) {}; \draw (a2)--(pr) -| ++(0.7,1.3) -| ($(a1)+(-0.55,0)$) -- (a1); \draw [dotted] (a1)--(a2); \draw [ar] (G.-5)--(pr) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G.-90)--(a2) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] (G.-175)--(a1) node [edgename] {$a_1$} node [type] {$A_1$}; \draw [ar] (a2)--++(0,-0.8) node [edgename] {$c_k$} node [type] {$\wn_{s_k,d+d_k+1,n+n_k} A_k$}; \draw [ar] (a1)--++(0,-0.8) node [edgename] {$c_1$} node [type] {$\wn_{s_1,d+d_1+1,n+n_1} A_1$}; \node [dig] (dig) at ($(pr)+(2,0)$) {}; \node [cut] (cut)at ($(pr)!0.5!(dig)+(0,-0.8)$) {}; \draw [ar,out=-90,in=180] (pr) to node [edgename,below left] {$c$} node [type,pos=0.2] {$\oc_{s,d,n} A$} (cut); \draw [ar,out=-90,in= 0] (dig) to node [edgename,right] {$d$} node [type,pos=0.3] {$\wn_{s,d,n} A^\perp$} (cut); \node [etc] (etc) at ($(dig)+(0,1)$) {}; \draw [ar] (etc) -- (dig) node [edgename,right] {$f$} node [type] {$\wn_{s',d',n'} \wn_{s',d',n'+1} A^\perp$}; \draw [->,very thick] (2.3,-1.9) --++(0,-0.6) node [near end, right] {$cut$}; \node [proofnet,minimum width=9cm] (G1) at ($(G)+(0,-3.3)$) {$G'$}; \node [princdoor] (pri) at ($(G1.-4)+(0.5,-0.7)$) {}; \node [above=-0.1] at ($(pri)+(0.7,0)$) {$\mathbf{B_i}$}; \node [auxdoor] (a2i) at ($(G1.-90)+(0,-0.7)$) {}; \node [auxdoor] (a1i) at ($(G1.-176)+(-0.7,-0.7)$) {}; \draw (a2i)--(pri) -| ++(2,1.3) -| ($(a1i)+(-0.47,0)$) -- (a1i); \draw [dotted] (a1i)--(a2i); \draw [ar] ($(G1.-4)+(0.5,0)$)--(pri) node [edgename] {$a$} node [type] {$A$}; \draw [ar] (G1.-90)--(a2i) node [edgename] {$a_k$} node [type] {$A_k$}; \draw [ar] ($(G1.-176)+(-0.7,0)$)--(a1i)node [edgename] {$a_1$} node [type] {$A_1$}; \node [princdoor] (pre) at ($(pri)+(0,-1.1)$) {}; \node [above=-0.1] at ($(pre)+(0.8,0)$) {$\mathbf{B_e}$}; \node [auxdoor] (a2e) at ($(a2i)+(0,-1.1)$) {}; \node [auxdoor] (a1e) at ($(a1i)+(0,-1.1)$) {}; \draw (a2e)--(pre) -| ++(2.1,2.5) -| ($(a1e)+(-0.52,0)$) -- (a1e); \draw [dotted] (a1e)--(a2e); \draw [ar] (pri)--(pre) node [edgename] {$b$} node [type] {$\oc_{s',d',n'+1} A$}; \draw [ar] (a2i)--(a2e) node [edgename] {$b_k$} node [type] {$\wn_{s_k,d+1,n+n_k+1} A_k$}; \draw [ar] (a1i)--(a1e) node [edgename] {$b_1$} node [type] {$\wn_{s_1,d,n+n_1+1} A_1$}; \node [dig] (dig1) at ($(a1e)+(0,-0.7)$) {}; \node [dig] (dig2) at ($(a2e)+(0,-0.7)$) {}; \draw [ar] (a1e)--(dig1) node [edgename] {$e_1$} node [type] {$\wn_{s_1,d,n+n_1} \wn_{s_1,d,n+n_1+1}A_1$}; \draw [ar] (a2e)--(dig2) node [edgename] {$e_k$} node [type] {$\wn_{s_k,d+1,n+n_k} \wn_{s_1,d+1,n+n_k+1} A_k$}; \draw [ar] (dig1)--++(0,-0.5) node [edgename] {$c_1$} node [type] {$\wn_{s_1,d,n+n_1} A_1$}; \draw [ar] (dig2)--++(0,-0.5) node [edgename] {$c_k$} node [type] {$\wn_{s_k,d+1,n+n_k} A_k$}; \node [etc] (etc) at ($(pri)!0.5!(pre)+(4.3,0)$) {}; \node [cut] (cut) at ($(pre)!0.5!(etc)+(0,-1.8)$) {}; \draw [ar,out=-90,in=180] (pre) to node [edgename,below left] {$c$} node [type,pos=0.4] {$\oc_{s',d',n'} \oc_{s',d',n'+1} A$} (cut); \draw [ar,out=-90,in= 0] (etc) to node [edgename,right] {$f$} node [type,left, pos=0.3] {$\wn_{s',d',n'} \wn_{s',d',n'+1} A^\perp$} (cut) ; \end{tikzpicture} \end{subfigure} \caption{\label{cut_sdnll}$SDNLL$ constraints are compatible with cut-elimination.} \end{figure} \tikzstyle{edgename}=[opacity=1, midway, left, black] In order to prove the soundness of $SDNLL$ for polynomial time, we first have to prove a technichal lemma. Whenever $((e,P),[\oc_t]@T) \noJump^* ((f,Q),[\oc_u]@U)$, the formulae of $e$ and $f$ are related. To be more precise, if $G$ does not contain any $\exLab$ or $\faLab$ node, $\beta(e)_{|T} \leq \beta(f)_{|U}$ with $A_{|T}$ defined as follows: \begin{definition}{\label{def_restr_trace}} Let $A$ be a formula and $T$ a trace, we define $A_{|T}$ by induction on $A$ as follows: $A_{|[]}=A$, $(A \otimes B)_{|T.\otimes_l}=(A \parr B)_{|T.\parr_l}=A_{|T}$, $(A \otimes B)_{|T.\otimes_r}=(A \parr B)_{|T.\parr_r}=B_{|T}$, $(\forall X.A)_{|T.\forall}=(\exists X.A)_{|T.\exists}=(\oc_{s,d,n}A)_{|T.\oc_t}=(\wn_{s,d,n}A)_{|T.\wn_t}=A_{|T}$. \end{definition} For instance, if $((e,P),T) \noJump ((f,P),T.\parr_r)$ then $\beta(e)$ and $\beta(f)$ are of the shape $B$ and $A' \parr B'$ with $B \leq B'$. Let us notice that $\beta(f)_{|T.\parr_r}=(B')_{|T} \geq (B)_{|T} = \beta(e)_{|T}$. However, there is a problem with this definition when we cross a $\exists$ link downwards. For example, let us suppose that $((c,[~]),[\parr_r;\oc_{\sige};\otimes_r]) \mapsto ((d,[~]),[\parr_r;\oc_{\sige};\otimes_r;\exists])$ with $\beta(c)= \wn(X \otimes X^\perp) \otimes \oc(X^\perp \parr X)$ and $\beta(d)=\exists Y.Y \otimes Y^\perp$. Then $\beta(c)_{|[\parr_r;\oc_{\sige};\otimes_r]}=X$, but $\beta(d)_{|[\parr_r;\oc_{\sige};\otimes_r;\exists]}$ is undefined: the trace is not compatible with the syntactic tree of $\beta(d)$. In~\cite{perrinelMegathese}, we define a mapping $\realbeta{\_}$ from contexts to formulae (paying special attention to the substitutions caused by the $\forall/\exists$ cut-elimination) satisfying Lemmas~\ref{lemma_realbeta_simple} to~\ref{lemma_realbeta_csrel}: \begin{itemize} \item The first idea is to substitute, for some of the $\exists X.\_$ in $\beta(e)$, the occurrences of $X$ by its formula $B$: if $\beta(e)_{|T}=\exists X.A$ and $((\concl{l},\_),[\exists]) \noJump^* ((e,P),T.\exists @U)$ with $l$ a $\exists$ node whose associated formula is $B$, we replace $\exists X.A$ by $A[B/X]$. \item Moreover, if $\beta(e)$ contains a free occurrence of a variable $X$ associated with the $\forall$ node $m$, and $((\concl{m},P),[\forall]) \noJump^* ((\overline{\concl{l}},\_),[\forall])$ with $l$ a $\exists$ node whose associated formula is $B$, we replace $X$ by $B$. \end{itemize} Those two operations can be recursive: the formula $B$ can contain itself free occurrences of variables associated with $\forall$ nodes, or $\exists Y.C$ subformulas. The formal definition can be found in section 5.1.2 of~\cite{perrinelMegathese}. \begin{lemma}{\label{lemma_realbeta_simple}} If $\beta(e)$ is of the shape $\oc_{s,d,n}A$, then there exists a substitution $\theta$ such that $\realbeta{(e,P),[\oc_t]@T}=\left(\oc_{s,d,n}A[\theta]\right)_{|T}$. \end{lemma} \begin{lemma}{\label{lemma_realbeta_nojump}} If $C \noJump^* C'$, we have $\realbeta{C} \leq \realbeta{C'}$. \end{lemma} The $\onlyJump$ step breaks this property: if $\beta(\sigma_i(B))=\wn_{s,d,n}A$ and $\beta(\sigma(B))=\oc_{s',d',n'}A'$ then $A$ and $A'$ are a priori unrelated. The only relation required on those formulae is that $d\geq d'$ and $n \geq n'$. Thus, whenever $((\sigma(B),P),[\oc_t]) \csRel^* ((\sigma(B'),P'),[\oc_{t'}])$ with $\beta(\sigma(B))=\oc_{s,d,n}A$ and $\beta(\sigma(B'))=\oc_{s',d',n'}A'$, we have $d \geq d'$ and $n \geq n'$: \begin{lemma}{\label{lemma_realbeta_csrel}} If $C \csRel^* C'$ and $\realbeta{C}=\oc_{\_,d,n}A$ then $\realbeta{C'}=\oc_{\_,d',n'}B$ with $d \geq d'$ and $n \geq n'$. \end{lemma} \begin{figure} \centering \begin{tikzpicture} \tikzstyle{level}=[opacity = 0] \begin{scope}[scale = 0.85] \begin{scope}[shift={(0,1)}] \node [ax] (ax) at (0,0) {}; \draw [ar,out= -10,in=90] (ax.0) to node [type] {$A^\perp$} ( 0.5,-0.8); \draw [ar,out=-170,in=90] (ax.180) to node [type, left] {$A$} (-0.5,-0.8); \end{scope} \begin{scope}[shift={(2,0)}] \coordinate (G) at (0,1); \coordinate (H) at ($(G)+(1,0)$); \node [cut] (cut) at ($(G)!0.5!(H)+(0,-0.8)$) {}; \draw [ar,out=-90,in=180] (G. -40) to node [type, left] {$A$} (cut.180); \draw [ar,out=-90,in= 0] (H.-140) to node [type] {$A^\perp$} (cut.0); \end{scope} \begin{scope}[shift={(4.4,0.6)}] \node [exists] (ex) at (0,0) {}; \draw [ar] ($(ex)+(0,0.6)$) to node [type] {$A[B/X_s]$} (ex); \draw [ar] (ex) --++ (0,-0.6) node [type] {$\exists X_s. A$}; \end{scope} \begin{scope}[shift={(6.8,0.6)}] \node [forall] (fa) at (0,0) {}; \draw [ar] ($(fa)+(0,0.6)$) to node [type, opacity=1] {$A$} (fa); \draw [ar] (fa) --++ (0,-0.6) node [type, opacity=1] {$\forall X_s. A$}; \end{scope} \begin{scope}[shift={(9.45,0.7)}] \node [tensor] (tens) at (0,0) {}; \draw [ar,bend right] (-0.5,0.4) to node [type,left] {$A$} (tens); \draw [ar,bend left] (0.5,0.4) to node [type] {$B$} (tens); \draw [ar] (tens) --++ (0,-0.5) node [type] {$A \otimes B$}; \end{scope} \begin{scope}[shift={(11.85,0.7)}] \node [par] (par) at (0,0) {}; \draw [ar,bend right] (-0.5,0.4) to node [type,left] {$A$} (par); \draw [ar,bend left] ( 0.5,0.4) to node [type] {$B$} (par); \draw [ar] (par) --++ (0,-0.5) node [type] {$A \parr B$}; \end{scope} \begin{scope}[shift={(-4,-2.5)}] \begin{scope}[shift={(4,1)}] \node[weak](weak) at (0,0) {}; \draw[ar] (weak) --++(0,-0.6) node [type] {$?_{s,d,n}A$} node [level, midway, left] {$i$}; \end{scope} \begin{scope}[shift={(7.3,1)}] \node[der] (der) at (0,0) {}; \draw[ar] ($(der)+(0,0.6)$) -- (der) node [type] {$A$} node [level, left] {$i$}; \draw[ar] (der) --++ (0,-0.6) node [type] {$?_{s,d,n}A$} node [level, left] {$i$-1}; \end{scope} \begin{scope}[shift={(14,1)}] \node [dig] (dig) at (0,0) {}; \draw[ar] ($(dig)+(0,0.6)$) -- (dig) node [type] {$\wn_{s,d,n}\wn_{s,d,n+1}A$} node [level, left] {$i$}; \draw[ar] (dig) --++ (0,-0.6) node [type] {$?_{s,d,n+1}A$} node [level, left] {$i$-1}; \end{scope} \begin{scope}[shift={(11,1)}] \node[cont] (cont) at (0,0) {}; \draw[ar] ($(cont)+(120:0.6)$) -- (cont) node [type,left] {$\wn_{s,d,n}A$}; \draw[ar] ($(cont)+( 60:0.6)$) -- (cont) node [type] {$\wn_{s,d,n}A$}; \draw[ar] (cont) --++ (0,-0.6) node [type] {$\wn_{s,d,n}A$}; \end{scope} \end{scope} \begin{scope}[shift={(6,-4.2)}] \draw[opacity=0] (0,1) node [pn,inner xsep=3.1cm] (G) {$G$}; \draw (G)++(3.5,-1) node [princdoor] (bang) {}; \draw (G)++(1.2,-1) node [auxdoor] (whyn) {}; \draw (G)++(-1.5,-1) node [auxdoor] (whyn2) {}; \draw (G)++(-3.5,-1) node [auxdoor] (whyn3) {}; \draw[ar] (whyn3 |- G.south) -- (whyn3) node [type] {$A_1$} node [level] {$i$}; \draw[ar] (whyn2 |- G.south) -- (whyn2) node [type] {$A_2$} node [level] {$i$}; \draw[ar] (whyn |- G.south) -- (whyn) node [type] {$A_k$} node [level] {$i$}; \draw[ar] (bang |- G.south) -- (bang) node [type] {$C$} node [level] {$i$}; \draw[ar] (whyn3) --++(0,-0.8) node [type,right=-0.05cm] {$\wn_{s_1,d,n} A_1$} node [level] {$i$-1}; \draw[ar] (whyn2) --++(0,-0.8) node [type,right=-0.05cm] {$\wn_{s_2,d+1,n} A_2$} node [level] {$i$-1}; \draw[ar] (whyn) --++(0,-0.8) node [type,right=-0.05cm] {$\wn_{s_k,d+1,n} A_k$} node [level] {$i$-1}; \draw[ar] (bang) --++(0,-0.8) node [type,right=-0.05cm] {$\oc_{s,d,n} C$} node [level] {$i$-1}; \draw (whyn)--(bang) -| ++(0.7,1.1) -| ($(whyn3)+(-0.4,0)$) -- (whyn3) -- (whyn2); \draw [dotted] (whyn2) -- (whyn); \end{scope} \end{scope} \end{tikzpicture} \caption{ \label{rules_labelling_snll}Constraints for $SDNLL$ proof-nets. For the $\exists$ rule, we require $s_B^{min} \geq s$. For the promotion rule, one of the auxiliary door has the same second index as the principal door (in the figure we set arbitrarily this door to be the first one).} \end{figure} \subsection{$SDNLL$ is sound for $Poly$} Thanks to $\realbeta{\_}$, we can prove the implications stated in the beginning of Section~\ref{section_def_sdnll}. \begin{lemma}\label{lemma_snll_strat} If $B \stratSNLL B'$, $\beta(\sigma(B))= \oc_{s,d,n}A$ and $\beta(\sigma(B'))= \oc_{s',d',n'}A'$ then $s > s'$. \end{lemma} \begin{proof} Let us suppose that $B \stratSNLL B'$, $\beta(\sigma(B))=\oc_{s,d,n}A$ and $\beta(\sigma(B'))=\oc_{s',d',n'}A'$. By definition of $\stratSNLL$, there exist potentials $P$ and $P'$, and signatures $t$ and $u$ such that $((\sigma(B), P), [\oc_t]) \hspace{-0.1em}\noJump^*\hspace{-0.1em} ((\overline{\sigma(B')},P'),[\oc_u]@T) \hspace{-0.1em}\noJump^*\hspace{-0.1em} ((e,Q),[\oc_{\sige}])$. By Lemma~\ref{lemma_realbeta_simple}, there are substitutions $\theta$ and $\theta'$ such that $\realbeta{(\sigma(B),P),[\oc_t]}\hspace{-0.15em}=\hspace{-0.15em}\oc_{s,d,n}A[\theta]$ and $\realbeta{(\overline{\sigma(B')},P'),[\oc_u]@T}\hspace{-0.15em}=\hspace{-0.15em}(\oc_{s',d',n'}\overline{A'}[\theta'])_{|T}$. So, according to Lemma~\ref{lemma_realbeta_nojump}, \begin{equation*} \oc_{s,d,n}A[\theta] \leq (\oc_{s',d',n'}\overline{A'}[\theta'])_{|T} \end{equation*} By definition of $\leq$ on formulae, $(\oc_{s',d',n'}\overline{A'}[\theta'])_{|T} = \oc_{s'',d'',n''}A''$ with $s \geq s''$. Thus $A'[\theta]$ is of the shape $H[\wn_{s'',d'',n''} A'']$. Either $A'$ is of the shape $H[\wn_{s'',d'',n''}A'']$ (in this case by definition of $\form{0}$, $s' < s''$ so $s > s'$), or there exist sequences $A'=A_0,A_1\cdots,A_k$ of formulae, $X^0,\cdots,X^k$ of variables and $s_0,\cdots,s_k$ such that for $0 \leq i < k$, $A_i$ is of the shape $H_i[X^i_{s_i}]$ and there exists a $\exLab$ node $n_i$ whose associated variable is $X^i_{s_i}$ and whose associated formula is $A_{i+1}$. And $A_{k}$ is of the shape $H_k[\oc_{s'',d'',n''}A'']$. In this case, $s' < s_0 \leq s_1 \leq \cdots \leq s_{k-1} \leq s''$ so $s' < s'' \leq s$. \end{proof} \begin{lemma}\label{lemma_snll_dep} If $B \dcSim B'$, $\beta(\sigma(B))= \oc_{s,d,n}A$ and $\beta(\sigma(B'))= \oc_{s',d',n'}A'$ then $d > d'$ \end{lemma} \begin{proof} By definition of $\dcSim$, there exists $i \neq j$ and paths of the shape $((\sigma(B),P), [\oc_t]) \csRel^+ ( (\overline{\sigma_i(B')}, P'_1) [\oc_{\sige}])$ and $((\sigma(B),P), [\oc_u]) \csRel^+ ((\overline{\sigma_j(B')}, P'_2), [\oc_{\sige}])$. Either $i \neq 1$ or $j \neq 1$. We suppose without loss of generality that $i \neq 1$. By definition of $SDNLL$, $\beta(\sigma_i(B))=\oc_{\_,d'',\_}\_$ with $d'' > d'$. Then, by Lemma~\ref{lemma_realbeta_csrel}, $d \geq d'' > d'$. \end{proof} \begin{lemma}\label{lemma_snll_nesting} If $B \nestSim B'$, $\beta(\sigma(B))= \oc_{s,d,n}A$ and $\beta(\sigma(B'))= \oc_{s',d',n'}A'$ then $n > n'$ \end{lemma} \begin{proof} By definition of $\nestSim$, there exist $P,Q \in \Pot$, and a non-standard signature $t$, such that $((\sigma(B),P),[\oc_t]) \csRel^* ((\sigma(C),Q),[\oc_{\sige}])$. Let us consider the first context of the path such that the leftmost trace element is $\oc_u$ with $u$ a standard signature. This step must be of the shape $((e,R),[\oc_{\sigp(u)}]) \noJump ((f,R),[\oc_u])$ with $\overline{e}$ the conclusion of a $\digLab$ node. By definition of $SDNLL$, $\beta(e)=\wn_{\_,\_,n_e}\_$ and $\beta(f)=\wn_{\_,\_,n_f}\_$ with $n_e> n_f$. Then, by Lemmas~\ref{lemma_realbeta_simple} and~\ref{lemma_realbeta_csrel}, $n \geq n_e > n_f \geq n'$. \end{proof} \begin{coro}\label{coro_sdnll_stratifieds} Let $G$ be a $SDNLL$ proof-net, then $G$ is $\stratSNLL$-stratified, $\dcSim$-stratified and $\nestSim$-stratified. Moreover, for every $B \in \boxset{G}$ with $\beta(\sigma(B))=\oc_{s,d,n}A$, $\stratu{\stratSNLL}{B} \leq s$, $\stratu{\dcSim}{B} \leq d$ and $\stratu{\nestSim}{B} \leq n$. \end{coro} \begin{proof} Immediate consequence of the three previous lemmas. \end{proof} \begin{figure} \centering \tikzsetnextfilename{encoding_sdnll_n3} \begin{tikzpicture} \node [forall] (fa) at (0,0) {}; \node [par] (parg) at ($(fa)+(0,0.8)$) {}; \draw [ar] (fa) --++ (0,-0.8) node [type,left] {$\NSDN{s}{d}{n}$}; \draw [ar] (parg) -- (fa) node [type,left] {$\oc_{s,d+1,n}(X_{s+1} \multimap X_{s+1}) \multimap \oc_{s,d,n}(X_{s+1} \multimap X_{s+1})$}; \node [princdoor] (princ3g) at ($(parg)+(2.5, 4.2)$) {}; \node [auxdoor] (aux1g) at ($(princ3g)+(-8,0)$) {}; \node [auxdoor] (aux2g) at ($(aux1g)!0.333!(princ3g)$) {}; \node [auxdoor] (aux3g) at ($(aux1g)!0.666!(princ3g)$) {}; \node [cont] (cont1g) at ($(aux1g)!0.5!(aux2g)+(0,-0.6)$) {}; \node [cont] (cont2g) at ($(cont1g)!0.5!(parg)$) {}; \nvar{\hautTens}{1.2cm} \node [tensor] (tens1g) at ($(aux1g)+(0,\hautTens)$) {}; \node [tensor] (tens2g) at ($(aux2g)+(0,\hautTens)$) {}; \node [tensor] (tens3g) at ($(aux3g)+(0,\hautTens)$) {}; \nvar{\decAx}{0.5cm} \node [ax] (ax1n) at ($(tens1g)+(-0.5,\decAx)$) {}; \node [ax] (ax2n) at ($(tens1g)!0.5!(tens2g)+(0,\decAx)$) {}; \node [ax] (ax3n) at ($(tens2g)!0.5!(tens3g)+(0,\decAx)$) {}; \node [ax] (ax4n) at ($(princ3g)+(-0.7,\decAx + \hautTens)$) {}; \node [par] (parx) at ($(princ3g)+(0,0.7)$) {}; \draw [ar] (cont2g) -- (parg) node [type,below left=-0.1cm] {$\wn_{s,d+1,n}(X_{s+1} \otimes X^\perp_{s+1})$}; \draw [ar] (cont1g) -- (cont2g) node [type,below left=-0.1cm] {$\wn_{s,d+1,n}(X_{s+1} \otimes X^\perp_{s+1})$}; \draw [ar] (aux1g) -- (cont1g) node [type,below left=-0.1cm,pos=0.6] {$\wn_{s,d+1,n}(X_{s+1} \otimes X^\perp_{s+1})$}; \draw [ar] (aux2g) -- (cont1g) node [type,below right=-0.05cm] {$\wn_{s,d+1,n}(X_{s+1} \otimes X^\perp_{s+1})$}; \draw [ar] (aux3g) -- (cont2g) node [type] {$\wn_{s,d+1,n}(X_{s+1} \otimes X^\perp_{s+1})$}; \draw [ar] (parx) -- (princ3g); \draw [ar] (tens1g) -- (aux1g) node [type,pos=0.7] {$X_{s+1} \otimes X^\perp_{s+1}$}; \draw [ar] (tens2g) -- (aux2g) node [type,pos=0.7] {$X_{s+1} \otimes X^\perp_{s+1}$}; \draw [ar] (tens3g) -- (aux3g) node [type,pos=0.7] {$X_{s+1} \otimes X^\perp_{s+1}$}; \coordinate (int) at ($(ax1n)+(0.5,-0.4)$); \draw [out=-180,in= 170] (ax1n.180) to (int); \draw [ar,out=-10,in= 170] (int) to (parx); \draw [ar,out=-0 ,in= 120] (ax1n.0) to (tens1g); \draw [ar,out=-180 ,in= 60] (ax2n.180) to (tens1g); \draw [ar,out=-0 ,in=120 ] (ax2n.0) to (tens2g); \draw [ar,out=-180 ,in= 60] (ax3n.180) to (tens2g); \draw [ar,out=-0 ,in=120 ] (ax3n.0) to (tens3g); \draw [ar,out=-180 ,in= 60] (ax4n.180) to (tens3g); \draw [ar,out=-0 ,in= 60] (ax4n.0) to (parx); \draw (princ3g) -| ++(0.5,\hautTens + \decAx +0.3cm) -| ($(aux1g)+(-1,0)$) -- (aux1g) -- (aux2g) -- (aux3g) -- (princ3g); \draw (princ3g) -- (parg) node [type,pos=0.85] {$\oc_{s,d,n}(X_{s+1} \multimap X_{s+1})$}; \end{tikzpicture} \caption{Encoding $\encodeS{s,d,n}{3}$ of $3$} \label{fig_encoding_sdnll_n} \end{figure} \begin{theorem}\label{theo_sdnll_pn_bound} Let $G$ be a $SDNLL$ proof-net, then the maximal reduction length of $G$ (with $x=|\dirEdges{G}|$, $\partial=\depthG{G}$, $S=1+\max_{B \in \boxset{G}}\straF{\sigma(B)}$, $D=\max_{B \in \boxset{G}}\dcF{\sigma(B)}$ and $N=1+\max_{B \in \boxset{G}}\nesF{\sigma(B)}$) is bounded by \begin{equation*} W_G \leq x^{1+ D^{S} \cdot \partial^{N \cdot S}} \end{equation*} \end{theorem} \begin{proof} The bound is an immediate consequence of Corollaries~\ref{coro_sdnll_stratifieds} and~\ref{coro_bound_poly_nest}. \end{proof} To formalize the polynomial time soundness of $SDNLL$, we need to define an encoding of binary lists. For any $s,d,n \in \mathbb{N}$, we define the formulae $\NSDN{s}{d}{n}$ and $\BSDN{s}{d}{n}$ by \begin{align*} \NSDN{s}{d}{n}&=\forall X_{s+1}, \oc_{s,d+1,n}(X_{s+1} \multimap X_{s+1}) \multimap \oc_{s,d,n}(X_{s+1} \multimap X_{s+1})\\ \BSDN{s}{d}{n}&=\forall X_{s+1}, \oc_{s,d+1,n}(X_{s+1} \multimap X_{s+1}) \multimap \oc_{s,d+1,n}(X_{s+1} \multimap X_{s+1}) \multimap \oc_{s,d,n}(X_{s+1} \multimap X_{s+1}) \end{align*} For any $s,d,n \in \mathbb{N}$, $k \in \mathbb{N}$ and binary list $l$, we can define an encoding $\encodeS{s,d,n}{k}$ of $k$ as in Figure~\ref{fig_encoding_sdnll_n}. The encoding $\encodeS{s,d,n}{l}$ of $l$ can be defined similarly. We can verify that the sizes of $\encodeS{s,d,n}{k}$ and $\encodeS{s,d,n}{l}$ depend linearly on the size of $k$ and $l$. Finally, for every $k$ and $l$ there is exactly one box in $\encodeS{s,d,n}{k}$ and $\encodeS{s,d,n}{l}$. \begin{theorem}\label{theo_sdnll_polysound} For every $SDNLL$ proof-net $G$ whose only conclusion is labelled by $\BSDN{s}{d}{n} \multimap A$, there exists a polynomial $P$ such that for every binary list $l$, \begin{equation*} W_{(G)\encodeS{s,d,n}{l}} \leq P\left(|l|\right) \end{equation*} \end{theorem} \begin{proof} By Theorem~\ref{theo_sdnll_pn_bound}, $(G)\encodeS{s,d,n}{l}$ is $\stratSNLL$-stratified, $\dcSim$-stratified and $\nestSim$-stratified. The depths of those relations are bounded by $\left|\boxset{(G)\encodeS{s,d,n}{l}}\right|=\left|\boxset{G}\right|+1$. We can conclude by Corollary~\ref{coro_bound_poly_nest} (and the linearity of $|\edges{\encodeS{s,d,n}{l}}|$ on $|l|$). \end{proof} \subsection{Encoding of $mL^4$} \label{section_encoding} \label{section_encoding_l4} There are already many subsystems of $LL$ characterizing polynomial time. We argue that the interest of $SDNLL$ over the previous systems is its intentional expressivity. To support our claim we define an encoding of $mL^4$~\cite{baillot2010linear}. The encoding of a maximal subsystem of $MS$~\cite{roversi2010local} is defined in~\cite{perrinelMegathese}. Baillot and Mazza already proved that $LLL$ can be embedded in $mL^4$, thus $SDNLL$ is at least as expressive as the union of those systems. \begin{figure} \centering \begin{tikzpicture} \begin{scope}[scale = 0.85] \begin{scope}[shift={(0,0.5)}] \draw (0,0) node [ax] (ax) {}; \draw[ar, out=-20,in=100] (ax) to node [type] {$(A^i)$} node [level] {} (0.6,-0.7); \draw[ar, out=-160,in=80] (ax) to node [type,left] {$(A^\perp)^i$} node [level] {} (-0.6,-0.7); \end{scope} \begin{scope}[shift={(3.2,0)}] \draw (0,0) node [cut] (cut) {}; \draw (cut) ++ (-0.6,0.7) node (G) {}; \draw (cut) ++ (0.6,0.7) node (H) {}; \draw[ar,out=-80,in=160] (G) to node [type,left] {$(A^i)$} node [level,pos=0.4] {} (cut); \draw[ar,out=-100,in=20] (H) to node [type] {$(A^\perp)^i$} node [level,pos=0.4] {} (cut); \end{scope} \begin{scope}[shift={(6.8,0)}] \draw (0,0) node [tensor] (tens) {}; \draw [ar] ($(tens)+(120:0.7)$) -- (tens) node [type,left] {$(A^i)$} node [level] {}; \draw [ar] ($(tens)+( 60:0.7)$) -- (tens) node [type] {$(B^i)$} node [level,right] {}; \draw [ar] (tens)--++(0,-0.7) node [type] {$(A \otimes B)^i$} node [level] {}; \end{scope} \begin{scope}[shift={(10.8,0)}] \draw (0,0) node [par] (par) {}; \draw [ar] ($(par)+(120:0.7)$) -- (par) node [type,left] {$(A)^i$} node [level] {}; \draw [ar] ($(par)+( 60:0.7)$) -- (par) node [type] {$(B)^i$} node [level,right] {}; \draw [ar] (par)--++(0,-0.7) node [type] {$(A \parr B)^i$} node [level] {}; \end{scope} \begin{scope}[shift={(5,-5)}] \draw (0,0) node [forall] (forall) {}; \draw [ar] ($(forall)+(0,0.7)$) -- (forall) node [type] {$(A)^i$} node [level] {}; \draw [ar] (forall)--++(0,-0.7) node [type] {$(\forall X.A)^i$} node [level] {}; \end{scope} \begin{scope}[shift={(8,-5)}] \draw (0,0) node [exists] (exists) {}; \draw [ar] ($(exists)+(0,0.5)$) -- (exists) node [type] {$(A[B/X])^i$} node [level] {}; \draw [ar] (exists)--++(0,-0.5) node [type] {$(\exists X.A)^i$} node [level] {}; \end{scope} \begin{scope}[shift={(-8.7,-2.5)}] \begin{scope}[shift={(8.70,0)}] \draw (0,0) node [der] (der) {}; \draw [ar] ($(der)+(0,0.7)$) -- (der) node [type] {$(A)^i$} node [level] {}; \draw [ar] (der)--++(0,-0.7) node [type] {$(?A)^{i-1}$} node [level] {}; \end{scope} \begin{scope}[shift={(12.1,0)}] \draw (0,0) node [weak] (weak) {}; \draw [ar] (weak)--++(0,-0.7) node [type] {$(?A)^{i}$} node [level] {}; \end{scope} \begin{scope}[shift={(15.6,0)}] \draw (0,0) node [cont] (cont) {}; \draw [ar] ($(cont)+(110:0.7)$) --(cont) node [type,left] {$(?A)^i$} node [level] {}; \draw [ar] ($(cont)+(70:0.7)$) --(cont) node [type] {$(?A)^i$} node [level,right] {}; \draw [ar] (cont)--++(0,-0.7) node [type] {$(?A)^i$} node [level] {}; \end{scope} \begin{scope}[shift={(18.4,0)}] \draw (0,0) node (neut) {$\S$}; \draw [ar] ($(neut)+(0,0.7)$)--(neut) node [type] {$(A)^i$} node [level] {}; \draw [ar] (neut)--++(0,-0.7) node [type] {$(\S A)^{i-1}$} node [level] {}; \end{scope} \begin{scope}[shift={(10,-2.5)}] \draw (0.8,0) node [princdoor] (bang) {}; \draw (-1.4,0) node [auxdoor] (whyn1) {}; \draw[ar] ($(bang)+(0,0.7)$)--(bang) node [type] {$(B)^i$} node [level] {}; \draw[ar] (bang) --++ (0,-0.7) node [type] {$(! B)^{i-1}$} node [level] {}; \draw[ar] ($(whyn1)+(0,0.7)$)--(whyn1) node [type] {$(A)^i$} node [level] {}; \draw[ar] (whyn1) --++ (0,-0.7) node [type] {$(?A)^{i-1}$} node [level] {}; \draw (whyn1)--(bang) -| ++(1,0.9) -| ($(whyn1)+(-0.45,0)$) -- (whyn1); \end{scope} \end{scope} \end{scope} \end{tikzpicture} \caption{\label{figureLabelL3}Relations between levels of neighbour edges in $L^4$. We also allow boxes with $0$ auxiliary doors.} \end{figure} The formulae of $mL^4$ are defined as the formulae of linear logic with an additional modality $\S$ and an element of $\mathbb{N}$ indexing the formula. More formally, the set $\form{L4}$ of formulae of $mL^4$ is defined by the following grammar.\label{def_formulae_l4} \begin{align*} \form{L4} &= \gorm{L4} \times \mathbb{N}\\ \gorm{L4} &= X \mid X^\perp \mid \gorm{L4}\otimes\gorm{L4} \mid \gorm{L4}\parr\gorm{L4} \mid \forall X. \gorm{L4} \mid \exists X.\gorm{L4} \mid \oc \gorm{L4} \mid \wn \gorm{L4} \mid \S \gorm{L4} \end{align*} The index in $\mathbb{N}$ (called {\em level}) is usually written as an exponent. Intuitively, if the principal edge of $B$ is labelled with $(\oc A)^s$, the label $s$ represents the stratum of $B$ for $\stratSNLL$. More precisely, it corresponds to a formula of the shape $\oc_{s+\depth{B},\_,\_}A$ in $SDNLL$. Let us notice that, to connect two boxes $B$ and $B'$ labelled with $(\oc A)^s$ and $(\oc A')^{s'}$ with $s \neq s'$, we need to use $\S$ nodes. Let us notice that every box of $mL^4$ proof-nets have only one auxiliary door. Thus $\dcSim=\varnothing$ and, for every box $B$ $\stratu{\dcSim}{B}=1$. We can also notice that there is no $\digLab$ node in $mL^4$ proof-nets, so for every box $B$, we have $\stratu{\nestSim}{B}=1$. \label{def_expodepth_form}We define a mapping $\|\_\|$ from formulae contexts of $\gorm{L4}$ to $\mathbb{N}$ which will be used to decide the indices of variables and exponential modalities. For every formulae $A$ in $\gorm{L4}$ and formula context $H$, $\|\circ\|=0$, $\| C \otimes H \|=\|H \otimes C\|=\|C \parr H\|=\|H \parr C\|=\|H\|$, $\|\forall X.H\|=\|\exists X.H\|=\|H\|$, and $\|\oc H\|=\|\wn H\|=\|\S H\|=1+\|H\|$. \begin{figure} \centering \AxiomC{$\hspace{1em}$} \RightLabel{\hspace{-0.2em}$\axLab$} \UnaryInfC{\hspace{-0.1em}$x: A^{\varnothing} \vdash x: A$\hspace{-0.1em}} \DisplayProof \hspace{0.6em} \AxiomC{\hspace{-0.1em}$\Gamma \vdash t:A$\hspace{-0.4em}} \AxiomC{$X_s$ not free in $\Gamma$\hspace{-0.1em}} \RightLabel{\hspace{-0.2em}$\forall_i$} \BinaryInfC{$\Gamma \vdash t: \forall X_s.A$} \DisplayProof \hspace{0.6em} \AxiomC{\hspace{-0.1em}$\Gamma \vdash t:\forall X_s.A$\hspace{-0.4em}} \AxiomC{$s_B^{min} \geq s$\hspace{-0.1em}} \RightLabel{\hspace{-0.2em}$\forall_e$} \BinaryInfC{$\Gamma \vdash t:A[B/X]$} \DisplayProof \vspace{1em} \AxiomC{$\Gamma,x:A^{\varnothing} \vdash t:B$} \RightLabel{\hspace{-0.2em}$\derLab$} \UnaryInfC{$\Gamma,x:A^{s,d,n} \vdash t:B$} \DisplayProof \hspace{0.6em} \AxiomC{$\Gamma \vdash t:B$} \RightLabel{\hspace{-0.2em}$\weakLab$} \UnaryInfC{$\Gamma,x:A^{s,d,n} \vdash t:B$} \DisplayProof \hspace{0.6em} \AxiomC{$\Gamma,y:A^{s,d,n},z:A^{s,d,n} \vdash t:B$} \RightLabel{\hspace{-0.2em}$\contLab$} \UnaryInfC{$\Gamma,x:A^{s,d,n} \vdash t[x/y;x/z]:B$} \DisplayProof \vspace{1em} \AxiomC{$\Gamma,x:A^{\varnothing} \vdash t:B$} \RightLabel{\hspace{-0.2em}$\multimap_i$} \UnaryInfC{\hspace{-0.15em}$\Gamma \vdash \lambda x.t : A \multimap B$\hspace{-0.15em}} \DisplayProof \hspace{0.6em} \AxiomC{$\Gamma,x:A^{s,d,n} \vdash t:B$} \RightLabel{\hspace{-0.2em}$\Rightarrow_i$} \UnaryInfC{\hspace{-0.15em}$\Gamma \vdash \lambda x.t : \oc_{s,d,n}A \multimap B$\hspace{-0.15em}} \DisplayProof \hspace{0.6em} \AxiomC{\hspace{-0.15em}$\Gamma \vdash t:A \multimap B$\hspace{-0.5em}} \AxiomC{$\Delta \vdash u:A$\hspace{-0.15em}} \RightLabel{\hspace{-0.2em}$\multimap_e$} \BinaryInfC{$\Gamma,\Delta \vdash (t)u : B$} \DisplayProof \vspace{1em} \AxiomC{$\Gamma \vdash t: \oc_{s,d,n}A \multimap B$} \AxiomC{$\Delta,\Sigma^{\varnothing} \vdash u:A$} \AxiomC{$d(\Delta\cup \Sigma)\geqq d \hspace{0.5em} n(\Sigma)\geq n \hspace{0.5em}n(\Delta)>n$} \RightLabel{$\Rightarrow_e$} \TrinaryInfC{$\Gamma,\Delta,\Sigma \vdash (t)u:B$} \DisplayProof \hspace{1em} \caption{\label{snll_lambda_rules}$SDNLL_{\lambda}$ as a $\lambda$-calculus type-system.} \end{figure} Any $mL^4$ proof-net $G$ can be transformed into a $SDNLL$ proof-net $G'$ as follows: for every variable $X$ appearing in the proof-net, we define $M_X$ as the maximum of the set \begin{equation*} \Set*{ s+ \|H\| }{ \beta(e)=(H[X])^s \text{ or }\beta(e)=(H[X^\perp])^s} \end{equation*} Then, we replace every occurrence of $X$ by $X_{M_X}$. If $\beta(e)=(H[\oc A])^s$ (resp. $(H[\wn A])^s$), we replace the modality by $\oc_{s+\|H\|,1,0}$ (resp. $\wn_{s+\|H\|,1,0}$). One can easily verify that $G$ is a valid $SDNLL$ proof-net. The $\S$ node becomes trivial (it does not change the sequent). The most interesting constraint to check is the constraint on doors. Let us suppose that $e$ is the premise of the $i$-th auxiliary door of a box $B$ and $f$ is its conclusion. If $\beta_G(e)=(H[\oc A])^{s}$ then $\beta_G(f)=\wn (H[\oc A])^{s-1}$. We can notice that $\beta_{G'}(e)=H'[\oc_{s+\|H\|,\hspace{0.1em}1,0}\_]$ and $\beta_{G'}(f)=H'[\oc_{s-1+\|\wn H\|,\hspace{0.1em}1,0}\_]$. Those labels are the same because $s+\|H\|=(s-1)+(1+\|H\|)=(s-1)+\|\wn H\|$. \subsection{$SDNLL$ as a type-system for $\lambda$-calculus}\label{section_sdnll_lambda} As noticed by Baillot and Terui~\cite{baillot2004light}, translating naively a subsystem of linear logic into a type-system for $\lambda$-calculus can result in a type-system which enjoys neither subject reduction nor the complexity bound enforced by the linear logic subsystem. The subsystem we define is heavily inspired by $DLAL$. For instance, the proof of subject reduction follows the proof of subject reduction of $DLAL$ presented in~\cite{baillot2004lightlong}. We restrict the formulae considered by only allowing $\oc$ modalities on the left side of $\multimap$ connectives. \begin{definition}\label{def_sdnll_lambda} For $s \in \mathbb{N}$, we define $\formla{s}$ by the following grammar (with $t,d,n \in \mathbb{N}$, $t \geq s$ and $X$ ranges over a countable set of variables). Notice that $\formla{0} \supseteq \formla{1} \supseteq \cdots$ \begin{equation*} \formla{s} := X_{t} \mid \formla{s} \multimap \formla{s} \mid \oc_{t,d,n}\formla{t+1} \multimap \formla{s} \mid \forall X_{t}. \formla{s} \end{equation*} \end{definition} \begin{figure}\centering \begin{tikzpicture} \begin{scope} \node[ax] (ax) at (0,0) {}; \draw[ar,out= 0,in=90] (ax) to node [type] {$A$} ($(ax)+( 0.6,-0.4)$) {}; \draw[ar,out=180,in=90] (ax) to node [type,left] {$A^\perp$} ($(ax)+(-0.6,-0.4)$) {}; \end{scope} \begin{scope}[shift={(3,0)}] \node[proofnet,minimum width=1cm] (G) at (0,0) {$G_E$}; \node[forall] (fa) at ($(G.-40)+(0,-0.55)$) {}; \draw[ar] (G.-40) --(fa) node [type] {$A$}; \draw[ar] (fa) --++ (0,-0.35) node [type] {$\forall X_s.A$}; \draw[ar] (G.-140)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(6.5,0)}] \node[proofnet,minimum width=1cm] (G) at (0,0) {$G_E$}; \node[exists] (ex) at ($(G.-40)+(1.5,-0.1)$) {}; \node[cut] (cut) at ($(G.-40)!0.5!(ex)+(0,-0.6)$) {}; \node (end) at ($(ex)+(0.7,-0.2)$) {}; \node[ax] (ax) at ($(ex)!0.5!(end)+(0,0.6)$) {}; \draw[ar,out=-90,in=180] (G.-40) to node [type,pos=0.15] {$\forall X.A$} (cut); \draw[ar,out=-90,in= 0] (ex) to (cut); \draw[ar,out=180,in= 90] (ax) to (ex); \draw[ar,out= 0,in= 90] (ax) to node [type] {$A[B/X_s]$} (end); \draw[ar] (G.-150) --++(0,-0.5) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(0,-2)}] \node[proofnet,minimum width=2cm] (G) at (0,0) {$G_E$}; \node[der] (der) at ($(G.-90)+(0,-0.6)$) {}; \draw[ar] (G.-90)-- (der) node [type] {$A^{\perp}$}; \draw[ar] (der) --++(0,-0.4) node [type] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (G.-19) --++(0,-0.4) node [type] {$B$}; \draw[ar] (G.-163)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(3.5,-2)}] \node[proofnet,minimum width=2cm] (G) at (0,0) {$G_E$}; \node[weak] (weak) at ($(G.-90)+(0,-0.55)$) {}; \draw[ar] (weak) --++(0,-0.4) node [type] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (G.-16) --++(0,-0.4) node [type] {$B$}; \draw[ar] (G.-164)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(8,-2)}] \node[proofnet,minimum width=4cm] (G) at (0,0) {$G_E$}; \node[cont] (cont) at ($(G.-90)+(0,-0.55)$) {}; \draw[ar] (G.-140)-- (cont) node [type,pos=0.65,left] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (G.-40)-- (cont) node [type,pos=0.65] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (cont) --++(0,-0.5) node [type] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (G.-8) --++(0,-0.4) node [type] {$B$}; \draw[ar] (G.-172)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(0,-4.3)}] \node[proofnet,minimum width=2cm] (G) at (0,0) {$G_E$}; \node[par] (par) at ($(G.-30)+(0,-0.55)$) {}; \draw[ar] (G.-90) --(par) node [type,left] {$A^{\perp}$}; \draw[ar] (G.-15) --(par) node [type] {$B$}; \draw[ar] (par)--++(0,-0.4) node [type] {$A\hspace{-0.2em} \multimap \hspace{-0.2em}B$}; \draw[ar] (G.-163)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(3.7,-4.3)}] \node[proofnet,minimum width=2.8cm] (G) at (0,0) {$G_E$}; \node[par] (par) at ($(G.-35)+(0,-0.6)$) {}; \draw[ar] (G.-60) --(par) node [type,left,pos=0.6] {$\wn_{s,d,n}A^{\perp}$}; \draw[ar] (G.-12) --(par) node [type] {$B$}; \draw[ar] (par)--++(0,-0.4) node [type] {$\oc_{s,d,n}A \hspace{-0.2em}\multimap \hspace{-0.2em}B$}; \draw[ar] (G.-168)--++(0,-0.7) node [edgename] {$\Gamma$}; \end{scope} \begin{scope}[shift={(8.6,-4.3)}] \node[proofnet,minimum width=0.8cm] (G) at (0,0) {$G_{E}$}; \node[ax] (ax) at ($(G)+(1.1,-0.6)$) {}; \node[tensor](tens) at ($(G.-40)!0.5!(ax)+(0,-0.6)$) {}; \coordinate (end) at ($(tens)+(0.8,0)$); \node[proofnet,minimum width=1cm] (H) at ($(tens)+(-2.5,0.7)$) {$G_F$}; \node[cut] (cut) at ($(H)!0.5!(tens)+(0,-0.7)$) {}; \draw[ar,out=-90,in=180] (H.-90) to node [type,pos=0.3] {$A \multimap B$} (cut); \draw[ar,out=-90,in= 0] (tens) to (cut); \draw[ar] (G.-40) -- (tens) node [type,pos=0.25] {$A$}; \draw[ar,out=180,in=60] (ax) to (tens); \draw[ar,out= 0,in=90] (ax) to node [type] {$B$} (end); \draw[ar] (G.-120) -- ++(0,-0.4) node [type,left] {$\Delta$}; \draw[ar] (H.-140) -- ++(0,-0.4) node [type,left] {$\Gamma$}; \end{scope} \begin{scope}[shift={(3.8,-6.8)}] \node[proofnet,minimum width=9.5cm] (G) at (0,0) {$G_{E}$}; \node[princdoor] (pg) at ($(G.-4)+(0.5,-0.75)$) {}; \node[auxdoor] (sigma) at ($(G.-122) +(0,-0.75)$) {}; \node[auxdoor] (delta) at ($(G.-176)+(-0.5,-0.75)$) {}; \node[dig] (dig) at ($(delta)+(0,-0.8)$) {}; \draw [ar] ($(G.-4)+(0.5,0)$) --(pg) node [type] {$A$}; \draw [ar] (G.-122) --(sigma) node [type] {$A^{\perp}_{\sigma}$}; \draw [ar] ($(G.-176)+(-0.5,0)$)--(delta) node [type] {$\wn_{s_{\delta},d_{\delta},n_{\delta}}A^{\perp}_{\delta}$}; \draw [ar] (delta)--(dig) node [type] {$\wn_{s_{\delta},d_{\delta},n_{\delta}-1}\wn_{s_{\delta},d_{\delta},n_{\delta}}A^{\perp}_{\delta}$}; \draw [ar] (dig)--++(0,-0.5) node [type] {$\wn_{s_{\delta},d_{\delta},n_{\delta}}A^{\perp}_{\delta}$}; \draw [ar] (sigma)--++(0,-1.2) node [type] {$\wn_{s_{\sigma},d_{\sigma},n_{\sigma}}A^{\perp}_{\sigma}$}; \draw (pg) -| ++(0.8,1.4) -| ($(delta)+(-0.8,0)$) -- (delta) -- (sigma) -- (pg); \node[ax] (ax) at ($(pg)+(1.7,-0.7)$) {}; \node[tensor](tens) at ($(pg)+(1,-1)$) {}; \coordinate (end) at ($(tens)+(1.4,0)$); \node[proofnet,minimum width=1cm] (H) at ($(tens)+(-2.4,0.6)$) {$G_F$}; \node[cut] (cut) at ($(H)!0.5!(tens)+(0,-0.65)$) {}; \draw[ar,out=-90,in=180] (H.-90) to node [type,pos=0.2] {$\oc_{s,d,n}A \multimap B$} (cut); \draw[ar,out=-110,in= 0] (tens) to (cut); \draw[ar] (pg) -- (tens) node [type,pos=0.15] {$\oc_{s,d,n}A$}; \draw[ar,out=180,in=60] (ax) to (tens); \draw[ar,out= 0,in=90] (ax) to node [type] {$B$} (end); \draw[ar] (H.-140) -- ++(0,-0.4) node [type,left] {$\Gamma$}; \end{scope} \end{tikzpicture} \caption{\label{fig_pn_lambda_sdnll}Derivations of $SDNLL_\lambda$ can be translated into $SDNLL$ proof-nets} \end{figure} \label{def_contexts_others}We define contexts\footnote{Because we do not use context semantics in this subsection, there is no ambiguity.} as sets of the shape $\{x_1:A_1^{l_1},\cdots,x_k:A_k^{l_k}\}$ where the $x_i$s are pairwise distinct variables of $\lambda$-calculus, the $A_i$s are formulae of $\formla{0}$ and the $l_i$s are elements of $\{\varnothing\} \cup \mathbb{N}^3$. Intuitively $A^{s,d,n}$ represents $\oc_{s,d,n}A$ while $A^{\varnothing}$ represents $A$. The set of all contexts is written $\conla$, the set of contexts whose labels are all in $\mathbb{N}^3$ is written $\conoc$, the set of contexts whose labels are all equal to $\varnothing$ is written $\conlin$. \label{def_op_on_contexts}In this paragraph, we consider $\Gamma=\{x_1:A_1^{s_1,d_1,n_1},\cdots,x_k:A_k^{s_k,d_k,n_k}\} \in \conoc$. Then we write $\Gamma^{\varnothing}$ for the context $\{x_1:A_1^{\varnothing},\cdots,x_k:A_k^{\varnothing}\}$. For $s,d,n \in \mathbb{Z}$, we write $\Gamma^{s,d,n}$ for $\{x_1:A_1^{s_1+s,d_1+d,n_1+n},\cdots,x_k:A_k^{s_k+s,d_k+d,n_k+d}\}$. We write $s(\Gamma)$ for the multiset of left indices, more formally $s(\Gamma)=\{\!\!\{ x \mapsto \left|\Set*{i \in \mathbb{N}}{s_i=x}\right| \}\!\!\}$.\label{def_sgamma} We define $d(\Gamma)$ and $n(\Gamma)$ similarly. \label{def_multiset_orders}If $M$ is a multiset, then we write $M \geq x$ for ``for every $y$ such that $M(y)>0$, we have $y\geq x$''. Similarly, we write $M > y$ for ``for every $y$ such that $M(y)>0$, we have $y> x$''. Finally, we write $M \geqq y$ for ``$M \geq x$ and $M(x) \leq 1$''. We present the type system $SDNLL_{\lambda}$ in Figure~\ref{snll_lambda_rules}. In the type derivations, judgements are of the shape $\Gamma \vdash t:A$ with $\Gamma$ a context. If $x:B^{\varnothing}$ is in $\Gamma$ then $x$ appears exactly once in $t$. To prove subject reduction and the polynomial bound we define (in Figure~\ref{fig_pn_lambda_sdnll}) for every type derivation $D$ of $A_1^{\varnothing},\cdots,A_k^{\varnothing},B_1^{s_1,d_1,n_1},\cdots,B_l^{s_l,d_l,n_l} \vdash t:C$, we define a $SDNLL$ proof-net $G_D$ with $k+l+1$ conclusions labelled with $A_1^{\perp}\hspace{-0.05em},\hspace{-0.1em}\cdots\hspace{-0.05em},\hspace{-0.1em}A_k^{\perp}\hspace{-0.05em},\hspace{-0.1em}\wn_{s_1,d_1,n_1}B_1^{\perp}\hspace{-0.05em},\hspace{-0.1em}\cdots\hspace{-0.1em},\hspace{-0.1em}\wn_{s_l,d_l,n_l}B_l^{\perp}$ and $C$. In Figure~\ref{fig_pn_lambda_sdnll}, we suppose that the derivation $D$ is obtained by applying a rule $r$ (the rule used is at the same position in Figure~\ref{snll_lambda_rules}) to the derivation $E$ (if the last rule is binary, the derivation on the left is named $F$). \begin{lemma}[linear substitution]\label{lemma_linear_substitution} Let us consider derivations $D$ and $E$ of respective conclusions $\Delta \vdash u:A$ and $\Gamma,x:A^{\varnothing} \vdash t:B$. Then there exists a derivation $F$ of conclusion $\Gamma,\Delta \vdash t[u/x] :B$ and \begin{equation*} \tikzsetnextfilename{snll_linear_substitution} \begin{tikzpicture} \node [proofnet,minimum width=2cm] (D) at (0,0) {$D$}; \node [proofnet,minimum width=2.5cm] (E) at ($(D)+(3.5,0)$) {$E$}; \node [cut] (cut) at ($(D)!0.5!(E)+(0,-0.5)$) {}; \draw [ar,out=-90,in=180] (D. -20) to node [type,pos=0.8,below left=-0.1cm] {$u:A$} (cut); \draw [ar,out=-90,in= 0] (E.-160) to node [type,pos=0.8,below right=-0.1cm] {$x:A^{\perp}$} (cut); \draw [ar] (D.-160) --++(0,-0.5) node [edgename] {$\Delta$}; \draw [ar] (E.-35) --++(0,-0.5) node [edgename] {$\Gamma$}; \draw [ar] (E.-15) --++(0,-0.5) node [type] {$t:B$}; \node [proofnet,minimum width=2cm] (F) at ($(E)+(5,0)$) {$F$}; \draw [ar] (F.-160)--++(0,-0.5) node [edgename] {$\Delta$}; \draw [ar] (F.-90) --++(0,-0.5) node [edgename] {$\Gamma$}; \draw [ar] (F.-20) --++(0,-0.5) node [type] {$t[u/x]:B$}; \draw [->] ($(E.0)!0.25!(F.180)$) -- ($(E.0)!0.75!(F.180)$) node [below left] {$cut$} node [above] {$*$} ; \end{tikzpicture} \end{equation*} \end{lemma} \begin{proof} Simple induction on $E$. Because the label of $x$ is $\varnothing$, $x$ is not the conclusion of a $\derLab$, $\contLab$ or $\fauxLab$ node. \end{proof} \begin{lemma}[exponential substitution]\label{lemma_exponential_substitution} Let us consider derivations $D$ and $E$ of respective conclusions $\Delta,\Sigma^{\varnothing} \vdash u:A$ and $\Gamma,x:A^{s,d,n} \vdash t:B$ with $d(\Delta \cup \Sigma) \geqq d$, $n(\Sigma)\geq n$ and $n(\Delta)>n$. Then there exists a derivation $F$ of conclusion $\Gamma,\Delta,\Sigma \vdash t[u/x] :B$ and \begin{equation*} \tikzsetnextfilename{snll_exponential_substitution} \begin{tikzpicture} \node [proofnet,minimum width=2.7cm] (D) at (0,0) {$D$}; \node [princdoor] (pri) at ($(D.-13)+(0,-0.75)$) {}; \node [auxdoor] (sigma) at ($(D.-90)+(0,-0.75)$) {}; \node [auxdoor] (delta) at ($(D.-167)+(0,-0.75)$) {}; \node [dig] (dig) at ($(delta)+(0,-0.6)$) {}; \draw [ar] (D.-13) -- (pri) node [type] {$A$}; \draw [ar] (D.-90) -- (sigma) node [edgename] {$\Sigma$}; \draw [ar] (D.-167) -- (delta) node [edgename] {$\Delta$}; \draw [ar] (delta)--(dig); \draw [ar] (dig) --++ (0,-0.3); \draw [ar] (sigma)--++ (0,-0.8); \draw (pri) -|++(0.6,1.35)-|($(delta)+(-0.6,0)$)--(delta)--(sigma)--(pri); \node [proofnet,minimum width=2.5cm] (E) at ($(pri)+(2.8,0)$) {$E$}; \node [cut] (cut) at ($(pri)!0.5!(E)+(0,-0.5)$) {}; \draw [ar,out=-60,in=180] (pri) to node [type,pos=0.5,below] {$u:\oc_{s,d,n}A$} (cut); \draw [ar,out=-90,in= 0] (E.-160) to node [type,pos=0.5,below] {$x:\wn_{s,d,n}A^{\perp}$} (cut); \draw [ar] (E.-35) --++(0,-0.5) node [edgename] {$\Gamma$}; \draw [ar] (E.-15) --++(0,-0.5) node [type] {$t:B$}; \node [proofnet,minimum width=2cm] (F) at ($(E)+(3.9,0)$) {$F$}; \draw [ar] (F.-166)--++(0,-0.5) node [edgename] {$\Delta$}; \draw [ar] (F.-145)--++(0,-0.5) node [edgename] {$\Sigma$}; \draw [ar] (F.-35) --++(0,-0.5) node [edgename] {$\Gamma$}; \draw [ar] (F.-14) --++(0,-0.5) node [type] {$t[u/x]:B$}; \draw [->] ($(E.0)!0.22!(F.180)$) -- ($(E.0)!0.78!(F.180)$) node [below left] {$cut$} node [above] {$*$}; \end{tikzpicture} \end{equation*} \end{lemma} \begin{proof} By induction on $E$. The most interesting step is the $\Rightarrow_e$ step. In this case, let us write $C$ for the box created in this step, and let us set $\oc_{s',d',n'}\_=\sigma(C)$. Either $d>d'$ so $d(\Delta \cup \Sigma) \geq d > d'$. Or $d=d'$, $d(\Delta \cup \Sigma) \geqq d \geq d'$ and $d(\Gamma) > d'$, thus $d(\Delta \cup \Sigma \cup \Gamma) \geqq d'$. \end{proof} \begin{lemma}\label{lemma_forall_elim} Let us consider a derivation $D$ of conclusion $\Delta \vdash \lambda x.t:A$ then $G_{D} \cutRel^* G_{D'}$ (considering the untyped proof-nets) with $D'$ a derivation of conclusion $\Gamma \vdash \lambda x.t:A$ and the last rule $R$ introduces the top connective of $A$ (if $A=\forall A_1$ then $R=\forall_i$, if $A=\oc_{s,d,n}A_1 \multimap A_2$ then $R$ is $\Rightarrow_i$, if $A=A_1 \multimap A_2$ with $A_1 \in \formla{0}$ then $R=\multimap_i$) \end{lemma} \begin{proof} We prove it by induction on $D$. The last rule $R$ cannot be in $\{ax,\multimap_e,\Rightarrow_e\}$, because the $\lambda$-term of the conclusion would be of the shape $\lambda x.t$. If $R$ in $\{\forall_i,\multimap_i,\Rightarrow_i\}$, then the lemma is trivial. If $R$ is in $\{ \derLab, \weakLab, \contLab \}$, the derivation is of the shape: \begin{equation*} \AxiomC{$E$} \UnaryInfC{$\Delta \vdash \lambda x.t:A$} \RightLabel{$R$} \UnaryInfC{$\Gamma \vdash \lambda x.t:A$} \DisplayProof \end{equation*} By the induction hypothesis, $G_E \cutRel^* G_{E'}$ with $E'$ a derivation of conclusion $\Delta \vdash \lambda x.t:A$ and the last rule of $E'$ introduces the top connective of $A$. We will examine the case where this last rule is $\multimap_i$, the two other cases are similar. Let us examine the following derivation $D''$ (let us notice that, because $G_E \cutRel^* G_{E'}$, we have $G_D \cutRel^* G_{D''}$). \begin{equation*} \AxiomC{$F'$} \UnaryInfC{$\Delta,x:A_1 \vdash t: A_2$} \RightLabel{$\multimap_i$} \UnaryInfC{$\Delta \vdash \lambda x.t:A_1 \multimap A_2$} \RightLabel{$R$} \UnaryInfC{$\Gamma \vdash \lambda x.t:A_1 \multimap A_2$} \DisplayProof \end{equation*} In every case we can define $D'$ as the following derivation (let us notice that $G_{D''}=G_{D'}$) \begin{equation*} \AxiomC{$F'$} \UnaryInfC{$\Delta,x:A_1 \vdash t: A_2$} \RightLabel{$R$} \UnaryInfC{$\Gamma,x:A_1 \vdash t: A_2$} \RightLabel{$\multimap_i$} \UnaryInfC{$\Gamma \vdash \lambda x.t:A_1 \multimap A_2$} \DisplayProof \end{equation*} The last case to examine is $R=\forall_e$. In this case, the derivation is of the shape: \begin{equation*} \AxiomC{$E$} \UnaryInfC{$\Gamma \vdash \lambda x.t:\forall X_s.A_1$} \RightLabel{$R$} \UnaryInfC{$\Gamma \vdash \lambda x.t:A_1[B/X_s]$} \DisplayProof \end{equation*} By the induction hypothesis, $G_E \cutRel^* G_{E'}$ with $E'$ a derivation of conclusion $\Gamma \vdash \lambda x.t:\forall X_s.A$ and the last rule of $E'$ is $\forall_i$. Let us examine the following derivation $D''$ (let us notice that, because $G_E \cutRel^* G_{E'}$, we have $G_D \cutRel^* G_{D''}$) \begin{equation*} \AxiomC{$F'$} \UnaryInfC{$\Gamma \vdash \lambda x.t: A_1$} \RightLabel{$\forall_i$} \UnaryInfC{$\Gamma \vdash \lambda x.t: \forall X_s.A_1$} \RightLabel{$\forall_e$} \UnaryInfC{$\Gamma \vdash \lambda x.t: A_1[B/X]$} \DisplayProof \end{equation*} Then we can set $D'$ as the $SDNLL$ proof-net obtained from $F'$ by replacing $X_s$ by $B$ in the derivation. We can notice that $D'' \cutRel^2 D'$ (a $\forall/\exists$ step and an axiom step). \end{proof} \begin{figure}\centering \AxiomC{$~$} \UnaryInfC{\hspace{-0.4em}$g: (X_s \multimap X_s)^{\varnothing} \vdash g : X_s \multimap X_s$\hspace{-0.4em}} \AxiomC{$~$} \UnaryInfC{\hspace{-0.4em}$h: (X_s \multimap X_s)^{\varnothing} \vdash h : X_{s} \multimap X_{s}$\hspace{-0.4em}} \AxiomC{$~$} \UnaryInfC{\hspace{-0.4em}$a: (X_{s})^{\varnothing} \vdash a: X_{s}$\hspace{-0.4em}} \BinaryInfC{$h: (X_s \multimap X_s)^{\varnothing}, a: (X_{s})^{\varnothing }\vdash (h) a : X_{s}$} \BinaryInfC{\hspace{-0.4em}$g: (X_{s} \multimap X_{s})^{\varnothing},h: (X_{s} \multimap X_{s})^{\varnothing}, a: (X_{s})^{\varnothing}\vdash (g) (h) a : X_{s}$\hspace{-0.4em}} \UnaryInfC{$g: (X_{s} \multimap X_{s})^{s-1,d,n},h: (X_{s} \multimap X_{s})^{\varnothing}, a: (X_{s})^{\varnothing}\vdash (g) (h) a : X_{s}$} \UnaryInfC{$g: (X_{s} \multimap X_{s})^{s-1,d,n},h: (X_{s} \multimap X_{s})^{s-1,d,n}, a: (X_{s})^{\varnothing}\vdash (g) (h) a : X_{s}$} \UnaryInfC{$f: (X_{s} \multimap X_{s})^{s-1,d,n}, a: (X_{s})^{\varnothing}\vdash (f) (f) a : X_{s}$} \UnaryInfC{$f: (X_{s} \multimap X_{s})^{s-1,d,n} \vdash \lambda a.(f) (f)a : X_{s} \multimap X_{s}$} \UnaryInfC{$\vdash \lambda f. \lambda a.(f) (f)a : \oc_{s-1,d,n}(X_{s} \multimap X_{s}) \multimap X_{s} \multimap X_{s}$} \UnaryInfC{$\vdash \lambda f. \lambda a.(f) (f) a : \forall X_{s}, \oc_{s-1,d,n}(X_{s} \multimap X_{s}) \multimap X_s \multimap X_s$} \DisplayProof \caption{\label{fig_type_2}Type derivation of $2:\forall X_{s}, \oc_{s-1,d,n}(X_{s} \multimap X_{s}) \multimap X_{s} \multimap X_{s}$.} \end{figure} \begin{lemma}[subject reduction]\label{lemma_beta_cutrel_snll} If there exists a type derivation $D$ whose conclusion is $\Gamma \vdash t:B$ and $t \betared t'$ then there exists a type derivation $D'$ whose conclusion is $\Gamma \vdash t':B$ and $G_D \cutRel^+ G_{D'}$. \end{lemma} \begin{proof} We prove the lemma by induction on $D$. Because there is a redex in $t$, $t$ cannot be a variable so the last rule is not an $ax$ rule. Let us suppose that the last rule is a unary rule. Then $D$ is of the shape: \begin{equation*} \AxiomC{$E$} \UnaryInfC{$\Delta \vdash u: A$} \RightLabel{$R$} \UnaryInfC{$\Gamma \vdash t:B$} \DisplayProof \end{equation*} In every case, $u$ is a subterm of $t$ containing the redex. So, by induction hypothesis, $u$ reduces to a $\lambda$-term $u'$. By the induction hypothesis, there exists a derivation $E'$ of conclusion $\Delta \vdash u':B$ and $G_{E} \cutRel^k G_{E'}$ (with $k \geq 1$). We can verify that in every case we can define $D'$ as the following derivation. \begin{equation*}\centering \AxiomC{$E'$} \UnaryInfC{$\Delta \vdash u': A$} \RightLabel{$R$} \UnaryInfC{$\Gamma \vdash t':B$} \DisplayProof \end{equation*} If the last rule is a $\multimap_e$ or $\Rightarrow_e$ step which does not correspond to the redex, the lemma is proved similarly. If the last rule is a $\multimap_e$ rule corresponding to the redex then, by Lemma~\ref{lemma_forall_elim}, $G_D \csRel^* G_E$ with $E$ a derivation of the following shape: \begin{equation*} \AxiomC{$E_l$} \UnaryInfC{$\Gamma, x:A \vdash v : B$} \RightLabel{$\multimap_i$} \UnaryInfC{$\Gamma \vdash \lambda x.v : A \multimap B$} \AxiomC{$E_r$} \UnaryInfC{$\Delta \vdash u:A$} \BinaryInfC{$\Gamma,\Delta \vdash (\lambda x.v)u:B$} \DisplayProof \end{equation*} By Lemma~\ref{lemma_linear_substitution}, $G_E$ reduces to a derivation of conclusion $\Gamma,\Delta \vdash v[u/x]:B$. If the last rule is a $\Rightarrow_e$ rule corresponding to the redex then, the result follows similarly by Lemmas~\ref{lemma_forall_elim} and~\ref{lemma_exponential_substitution}. \end{proof} \begin{figure}\centering \AxiomC{} \UnaryInfC{$m:N\hspace{-0.15em}\vdash\hspace{-0.15em} m: N$} \UnaryInfC{$m:N\hspace{-0.15em}\vdash\hspace{-0.15em} m: \oc_{s,d,n}F \hspace{-0.2em}\multimap\hspace{-0.2em} F $} \AxiomC{} \UnaryInfC{$g: F \hspace{-0.15em}\vdash\hspace{-0.15em} g: F$} \BinaryInfC{$m:N,g:{F}^{s,d,n} \hspace{-0.15em}\vdash\hspace{-0.15em} (m)g: F$} \AxiomC{$\vdots$} \AxiomC{} \UnaryInfC{$x: X_s^{\varnothing} \hspace{-0.15em}\vdash\hspace{-0.15em} x:X_s$} \BinaryInfC{$n:N,h:{F}^{s,d,n},x:X_s^{\varnothing} \hspace{-0.15em}\vdash\hspace{-0.15em} ((n)h) x: X_s$} \BinaryInfC{$m: N,n:N,g:{F}^{s,d,n},h:{F}^{s,d,n},x:X_s^{\varnothing} \hspace{-0.15em}\vdash\hspace{-0.15em} ((m)g) ((n)h)x: X_s$} \UnaryInfC{$m: N,n:N,f:{F}^{s,d,n},x:X_s^{\varnothing} \hspace{-0.15em}\vdash\hspace{-0.15em} ((m)f) ((n)f)x: X_s$} \UnaryInfC{$m: N,n:N,f:{F}^{s,d,n} \hspace{-0.15em}\vdash\hspace{-0.15em} \lambda x. ((m)f) ((n)f)x: X_s \hspace{-0.2em}\multimap\hspace{-0.2em} X_s$} \UnaryInfC{$m: N,n:N \hspace{-0.15em}\vdash\hspace{-0.15em} \lambda f.\lambda x. ((m)f) ((n)f)x: \NSDN{s}{d}{n}$} \UnaryInfC{$m: N \hspace{-0.15em}\vdash\hspace{-0.15em} \lambda n.\lambda f.\lambda x. ((m)f) ((n)f)x: \NSDN{s}{d}{n} \hspace{-0.2em}\multimap\hspace{-0.2em} \NSDN{s}{d}{n}$} \UnaryInfC{$\hspace{-0.15em}\vdash\hspace{-0.15em} \lambda m.\lambda n.\lambda f.\lambda x. ((m)f) ((n)f)x: \NSDN{s}{d}{n} \hspace{-0.2em}\multimap\hspace{-0.2em} \NSDN{s}{d}{n} \hspace{-0.2em}\multimap\hspace{-0.2em} \NSDN{s}{d}{n}$} \DisplayProof \caption{\label{fig_type_add}Type derivation of $add: \NSDN{s}{d}{n} \hspace{-0.2em}\multimap\hspace{-0.2em} \NSDN{s}{d}{n} \hspace{-0.2em}\multimap\hspace{-0.2em} \NSDN{s}{d}{n}$. To simlify the proof derivation, we write $F$ for $X_s \hspace{-0.2em}\multimap\hspace{-0.2em} X_s$ and $N$ for $\NSDN{s}{d}{n}^{\varnothing}$.} \end{figure} \begin{theorem}\label{sdnll_lambda_polytime} If there exists a type derivation $E$ whose conclusion is $\Gamma \vdash t:B$, $x$ is the size of $E$, $S-1$, $D-1$ and $N-1$ are the maximum indexes in $E$, and $\partial$ is the depth of $E$ (in terms of $\Rightarrow_e$ rules), then: \begin{equation*} t \betared^k t' \hspace{1.5em}\Rightarrow \hspace{1.5em}k \leq x^{1+ D^{S} \cdot \partial^{1+N \cdot S}} \end{equation*} \end{theorem} \begin{proof} Immediate from Theorem~\ref{theo_sdnll_pn_bound} and Lemma~\ref{lemma_beta_cutrel_snll}. \end{proof} We can notice that, contrary to $DLAL$, $SDNLL_{\lambda}$ does not allow weakening on linear variables. Thus one can never derive $\vdash \lambda x.t : A \multimap B$ when $x$ is not a free variable of $t$. We are confident\footnote{Adding generalized weakening (Conclusion of $\wn C$ can be any formula) would not change a single line in the proof of Theorem~\ref{theo_sdnll_polysound}. However, in order to prove Lemma~\ref{lemma_beta_cutrel_snll}, we would need to add cut-elimination rules: $\wn C$ cut with any node $n$, deletes $n$ and creates $\wn C$ nodes cut with every premise of $n$. $W_G$ would still be a valid bound on the number of steps during reduction, so Sections~\ref{chapter_3} and~\ref{section_polytime_simple} would be the same.} that adding the following rule to $SDNLL$ does not break Lemma~\ref{sdnll_lambda_polytime}. \begin{equation*} \AxiomC{$\Gamma \vdash t:B$} \UnaryInfC{$\Gamma,x:A^{\varnothing} \vdash t:B$} \DisplayProof \end{equation*} However, one cannot extend the encoding of Figure~\ref{fig_pn_lambda_sdnll} to this rule because Linear Logic does not allow weakening on a formula $A$ unless $A$ is of the shape $\wn A'$. Thus we would have to prove the bound directly on $\lambda$-calculus (or a similar language as in~\cite{baillot2004light}). Which makes the proof more difficult, because we cannot use the lemmas we proved on context semantics. If we had defined the context semantics and the criteria on a more general framework (for example interaction nets, for which we define a context semantics in~\cite{perrinel2014interactionnets}) we would not have problems to accomodate such a simple modification. To give an intuition on the system, let us give some examples of proof derivations. For any $s \geq 1$, and $k \in \mathbb{N}$, $\underline{k}$ can be typed with the following type (see Figure~\ref{fig_type_2} for the type derivation of $\underline{2}$): \begin{equation*} {\mathbf N}_{s,d,n}=\forall X_s, \oc_{s-1,d,n}(X_s \multimap X_s) \multimap X_s \multimap X_s \end{equation*} Addition can be typed as shown in Figure~\ref{fig_type_add}. Finally, although this type system has no built-in mechanism to type tuples, we can encode them by the usual church encoding (Figure~\ref{fig_snll_pairs}). Let us notice that this encoding does not require any additional constraint on the types, contrary to $mL^4$ (where the terms must have the same level). \begin{figure}\centering .\vspace{2em} \AxiomC{$~$} \UnaryInfC{$f:(A \multimap B \multimap X)^{\varnothing} \vdash f: A \multimap B \multimap X$} \AxiomC{$\Gamma \vdash t: A $} \BinaryInfC{$\Gamma,f: (A \multimap B \multimap X)^{\varnothing} \vdash (f)t : B \multimap X $} \AxiomC{$\Delta \vdash u: B$} \BinaryInfC{$\Gamma,\Delta,f: (A \multimap B \multimap X)^{\varnothing} \vdash ((f)t)u: X$} \UnaryInfC{$\Gamma,\Delta \vdash \lambda f.((f)t)u: (A \multimap B \multimap X) \multimap X$} \UnaryInfC{$\Gamma,\Delta \vdash \lambda f.((f)t)u:\forall X. (A \multimap B \multimap X) \multimap X$} \UnaryInfC{$\Gamma,\Delta \vdash \langle t,u \rangle : \langle A,B \rangle$} \DisplayProof \caption{\label{fig_snll_pairs}Simple encoding of pairs.} \end{figure} \label{sect_expressivity} We isolate four constraints that previous logics ($LLL$, $SLL$, and $MS$) has and which $SDNLL$ does not have. We illustrate each constraint with an intuitive description and a $\lambda$-term which can be typed in $SDNLL$ but seemingly not in previous logics because of this constraint. We set $S=\lambda m.\lambda f.\lambda x. ((m)f) (f) x$ implementing succesor, and $+$ as the $\lambda$-term $\lambda m.\lambda n.\lambda f.\lambda x.((m) f) ((n)f) x$ implementing addition on Church integers and $x+y+z$ is a notation for $((+)((+)x)y)z$. \begin{itemize} \item In previous logics, in $\langle t,u \rangle$, $t$ and $u$ must have the same stratum indices (depth in $LLL$ and $MS$, level in $mL^4$). The term $(\underline{k})\lambda \langle x,y,z \rangle.\langle x,((x) S) \underline{0}, x+y+z \rangle$ is not typable in previous logics: because the function $\lambda \langle x,y,z \rangle.\langle x,((x) S) \underline{0}, x+y+z \rangle$ is iterated, we have $s(y)=s \left (((x)S)\underline{0} \right )$ so $s(y) > s(x)$. But, because they are in the same tuple, it must be $s(y)=s(x)$. The $x+y+z$ term ensures that the stratum indices of $y$ and $x$ cannot be modified by $\S$ modalities. \item There is no $N$ rule in previous logics and in their encodings in $SDNLL$. This seems to prevent the typing of $\underline{k}(\lambda \langle v,w,x,y,z\rangle \langle w,w,x,w+x+y,((x) (+)v) 0 \rangle)$. \item Contrary to $LLL$ and $mL^4$, one can have several variables in the context during a $\Rightarrow_e$ rule. So, $t=\underline{k}(\lambda \langle x,y,z \rangle . \langle x,x+y,y \rangle)$ is typable in $SDNLL$ but not in $LLL$ and $mL^4$. Moreover, the maximum nest of terms is not a priori bounded by the type system, so if we set $u=\lambda\langle x,y,z \rangle.\langle z,z,z \rangle$, then $(t)(u)(t)\cdots (u)t$ is typable in $SDNLL$ whatever the length of the chain of applications, whereas in $MS$ the maximum length of such a chain is bounded. \item Previous logics had no subtyping. For example, in $mL^4$, a $A^i$ formula cannot be considered as a $A^{i-1}$ formula. The example in the first item of this list would be typable in $mL^4$ if it was allowed to decrease the level of a formula by mean of a subtyping relation. \end{itemize} \section{Conclusion and further work} In order to address the potential applications given in the introduction (real-time systems, complexity debugging, mathematical proofs) we aim to create a type system for a programming language such that: \begin{enumerate} \item Programming in the language is practical. The language offers usual features such as built-in types (integers, boolean,...), control flow operations, recursive definitions, side effects,...\label{goal1} \item Type inference is decidable in reasonable time.\label{goal2} \item For most polynomial time program users will write, the type infered entails a polynomial bound.\label{goal3} \item The bounds infered are often tight (very important for real-time systems, rather important for complexity debugging, unimportant for mathematical proofs).\label{goal4} \end{enumerate} We consider that goals~\ref{goal2} and~\ref{goal4} highly depend on the system. We could try to design a faster type inferrence algorithm for $LLL$, or infer tighter bounds for a $LLL$ program. However, because of its lack of expressivity, there is little chance that $LLL$ will be used in practice for the goals we have in mind. A new system must be created, and type inferrence and tight bound inferrence may be totally different in this new system. We view goals 1 and 3 as mostly orthogonal. It is possible to define an expressive functional core (a linear logic subsystem or $\lambda$-calculus type-system) and add features to it. For example, previous works have added pattern-matching, recursive definitions~\cite{baillot2010polytime}, side-effects and concurrent features~\cite{madet2012polynomial} to $LLL$. However, previous works only extended a specific system ($LLL$ in those cases). We are not aware of any work proving that ``for every subsystem $S$ of linear logic sound for $Ptime$ and verifying some condition $C$, the system obtained by adding feature $F$ to $S$ is sound for $Ptime$''. So, if we added other features to $LLL$ without breaking the polynomial bound, it is unclear whether we would have been able to add those features to other subsystems of linear logic characterizing polynomial time. In those conditions, it made more sense to first work on the functional core (goal~\ref{goal3}), and in a second step, add features to it (goal~\ref{goal1}). Because $SDNLL$ is more expressive than previous subsystems of linear logic characterizing polynomial time, this work fits into goal 3. However, in the same way Baillot and Mazza considered that the ``fundamental contribution of'' \cite{baillot2010linear} is not the definition of the systems $mL^3$ and $mL^4$ themselves, but the demonstration that ``in linear-logical characterizations of complexity classes, exponential boxes and stratification levels are two different things'', we consider that the main contribution of our work is the idea to define semantic criteria based on the acyclicity of relation on boxes: \begin{itemize} \item Using those criteria, we separated three principles underlying $LLL$ and the works based on it. It sheds a new light on previous works: $mL^4$ relaxes the ``stratification'' criterion of $LLL$, while $MS$ relaxes its ``dependence control'' criterion (we are not aware of previous works relaxing the ``nesting'' condition). Realizing that those principles are mainly orthogonal can help further works on the expressivity of linear logic subsystems characterizing polynomial time: independent improvements on different principles can be combined. For instance, one can easily verify, that one can combine $mL^4$ and a maximal $Ptime$ system of $MS$\footnote{$mL^4$ with its ``at most one auxiliary door by box'' replaced by the indices criteria of the $MS$ system to control dependence}. In fact, $SDNLL$ can be seen as an extension of such a system. \item Because the lemmas and results of sections~\ref{chapter_2},~\ref{chapter_3} and~\ref{section_polytime_simple} are valid for any untyped proof-net, they can be reused to prove polynomial bounds for other subsystems of linear logic in which $\stratSNLL$, $\dcSim$ or $\nestSim$ are acyclic (such as $mL^4$, $MS$ and the multiplicative fragment of $LLL$) or to define new criteria: in~\cite{perrinelMegathese}, Perrinel builds upon these technical lemmas to define more expressive criteria entailing a polynomial bound and a criterion entailing a primitive recursive bound. \item We separated the task of creating an expressive subsystem of linear logic characterizing polynomial time into subtasks: finding loose criteria on semantic entailing polynomial time, and finding syntactic criteria entailing those semantic criteria. One can closely examine the proofs leading to Corollary~\ref{coro_bound_poly_nest}, to find any unnecessary assumption on the proof-net behaviour. While this may be subjective, we found it much easier to reason about complex semantic criteria without having to consider the exact way in which they will be enforced. \item While the syntax of $SDNLL$ (or any other syntactic subsystem of linear logic) may be difficult to adapt to richer languages where the notion of reduction differs from cut-elimination, those relations on boxes have a meaning going beyond linear logic itself: $B \stratSNLL C$ means that $B$ interacts with an element created by an interaction of $C$ (with nodes created when $C$ is opened/interacts), $B \dcSim C$ and $B \nestSim C$ represent two ways of having several duplicates of $B$ inside $C$. Thus it would be interesting to investigate the application of those principles to other models of computation based on reduction/rewriting. \end{itemize} The applications considered in the introduction are used to motivate the direction of our research, to explain why the intensional expressivity of our characterization is an important problem. We are still far from having a system expressive enough to handle them. We explained why we first focused on the expressivity of the functional core (subsystems of linear logic and type systems on plain $\lambda$-calculus), but we consider that the main challenge in the future of Implicit Computational Complexity will be to add features to this functional core (built-in types, pattern-matching, recursive definitions, side-effects,...) to get closer to the programming languages used in practice. Thus, the fact that those criteria might be easier to adapt to a more practical framework is especially important. In a previous work~\cite{perrinel2014interactionnets}, we defined a context semantics for interaction nets: a well-behaved class of graph rewriting systems~\cite{lafont1989interaction} based on proof-nets. Interaction net is not a singe system, but a set of such systems. Thus, this framework seems particularly adapted to the progressive addition of features. An interesting problem for future work would be to use the context semantics of~\cite{perrinel2014interactionnets} to define relations on interaction nets corresponding to $\stratSNLL$, $\dcSim$ and $\nestSim$. \section{Bibliography} \bibliographystyle{plain}
{'timestamp': '2017-01-06T02:06:56', 'yymm': '1701', 'arxiv_id': '1701.01413', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01413'}
arxiv
\section{Introduction} Relay nodes are widely employed in modern communication networks to enhance coverage and connectivity of the networks. This dependence on the relaying infrastructure may increase the risk on security as malicious relays may forward false information in order to deceive the intended participants into accepting counterfeit information. These attacks, referred to as Byzantine attacks, impose significant ramifications on the design of network protocols \cite{Buttyan2006Security}\cite{bloch2011physical}. With the presence of Byzantine attacks, the attack detection technique, which determines whether Byzantine attacks are conducted or not, is one of the key steps supporting secure communication. The work on attack detection starts above physical-layer, where each link is treated as a unit-capacity bit-pipe, while specific physical-layer characteristics are shielded. Based on this setting, cryptography keys are often used to make attacks detectable \cite{papadimitratos2006secure}, \cite{hu2005ariadne}, while requiring the cryptographic keys, to which the relays are not privy, to be shared between the source and destination before the communication takes place. Without using cryptography keys, information theoretic detection schemes are proposed for multicast system or Caterpillar Network \cite{ho2008byzantine, kosut2009nonlinear}. These schemes are able to achieve errorless performance in probability, yet assuming that at least one relay or link is absolutely trustworthy. Besides these schemes treating channels as noiseless bit-pipes, there are also many other attack detection schemes designed according to specific characteristics of physical-layer channels for varying application scenarios. These schemes are mainly enabled by utilizing tracing symbols, or self-information provided by network topology structure. In tracing-based schemes \cite{mao2007tracing}-\cite{nonherentsCL}, source node inserts tracing symbols into a sequence of information bits, and then sends them together to the destination. Relying on the \emph{priori} knowledge of tracing symbols, the destination could detect attacks by comparing its observed tracing symbols and the ground truth of tracing symbols. This tracing-based method is applicable with perfect CSI \cite{mao2007tracing, Tradeoff} or no need of CSI \cite{noncoherent, nonherentsCL} for varying network scenarios. The tracing-symbol based schemes commonly assume that the value and insertion location of the tracing symbols are known only at the source and the destination, which indeed requires a additional tracing-symbol distribution mechanism implemented between communication parties. Besides that, these schemes assume that each malicious relay garbles its received symbols according to independent and identically distributed (i.i.d.) stochastic distributions. This model of i.i.d. attacks may not always be valid in practice, although it makes analysis simple. The Byzantine attack detection methods presented in \cite{mao2007tracing}-\cite{nonherentsCL} may no longer be provably unbreakable for non-i.i.d. attacks. Notice that all the above-mentioned schemes detect attacks by inserting redundancy, the overhead cost thus increases. In contrast, the schemes, utilizing side information (SI) provided by network topology structure, do not need to insert any redundancy or just insert negligible redundancy \cite{KimTWC}-\cite{CaoTIFS}. The detectability of parts of these schemes are beyond i.i.d. attacks \cite{he2013strong}-\cite{CaoTIFS}. Generally, upon the network topology structure, most of these schemes are able to gain secured SI, that it is absolutely not attacked, and it is statistically correlated to the observations from the relay when the relay is non-malicious. Then, the SI can be used to check the signals observed from the relay. For instance, in \cite{KimTWC} and \cite{KimCL}, a direct link between source and destination allows the destination to observe signals from the source directly. These observations are secured SI according to its safeness and statistic dependence on other observations. Then, attacks are detectable by comparing the observations from the relay with the secured SI. Similarly, in \cite{OFDM} and \cite{ARQ}, source node detects attacks using its transmitted signals as secured SI. The detection performance of \cite{KimTWC}-\cite{ ARQ} are impacted by channel fading and signal-to-noise ratio (SNR). Some denoising measures, such as perfect correction codes (ECCs), are often required. However, due to channel fading, the achieved performance still cannot approach to errorless asymptotically. Especially, the performance of \cite{KimTWC} and \cite{KimCL} highly depends on the the quality of direct link, such that it may not work well in the network where direct link does not exist or suffers deep fading. On the contrary, \cite{he2013strong}-\cite{CaoTIFS} could detect attacks with arbitrary small error probability. In particular, \cite{he2013strong}-\cite{GravesISIT13} consider two-way relaying (TWR) protocol for the typical three-node network, where communication parties could use its transmitted signals as secured SI to detect arbitrary attacks. To elaborate a little further, in \cite{he2013strong}, communication parties are required to simultaneously transmit signal to relay with the same power constraint, then each node's own lattice-coded transmitted symbols are employed to simultaneously support secret transmission and construct an algebraic manipulation detection (AMD) code to detect arbitrary Byzantine attacks in TWR networks with Gaussian channels. It is difficult to extend this scheme to non-Gaussian channels and to the destination with restricted power. In our previous work \cite{GravesINFOCOM12}-\cite{GravesISIT13}, focusing on two-way relay system, we show that for discrete memoryless channels (DMCs), it is possible to detect arbitrary Byzantine attacks dispensing any AMD code or cryptographic keys. The basic idea is that each node utilizes its own transmitted symbols as secured SI for statistically checking against the other node's symbols forwarded by the relay. This scheme is difficult to extend beyond DMC channels. We extend the method proposed in \cite{GravesINFOCOM12}-\cite{GravesISIT13} to the DMC one-way relay system composing of two potential malicious relays. Since all observations of the destination are prone to be attacked \cite{CaoTIFS}, this network setup only provides unsecured SI for the destination. This work indicates that due to the lack of secured SI, we cannot properly protect communication parties against arbitrary attacks. In this paper, we consider attack detection problem for the wireless typical three-node network. One-way relaying protocol is performed in the network. The goal of this paper is to make the destination probabilistically detect arbitrary attacks, despite of i.i.d or non-i.i.d attacks, without using any AMD code or secret transmission. To that end, we facilitate attack detection by utilizing the openness of wireless medium to make the destination obtain secured SI, i.e., the signals directly heared from the source, etc. On the other hand, due to properties of wireless medium again, all observed signals are continuous, the possible attacks are also continuous in the sense that they are likely to be conducted within continuous alphabet(s). Our previous work focusing on utilizing secured SI in DMCs \cite{GravesINFOCOM12}-\cite{CaoTIFS} are not applicable to investigate the detectability of continuous attacks. This paper proves the detectability of continuous attacks is equivalent to the non-manipulability of wireless channels, also proves the non-manipulability of general wireless channels. The main contributions of this paper are summarized as follows: \begin{enumerate} \item We prove that under a non-manipulable condition of wireless channel, all Byzantine attacks, despite of i.i.d or non-i.i.d, are asymptotically detectable by simply using secured SI to statistically check the observations from the relay. The proposed scheme does not use any AMD code or secret transmission, while achieving asymptotically errorless performance. This result is summarized in Theorem 1 of Section III. \item We prove that the non-manipulable channel condition is satisfied as long as the secured SI is not vacancy. It is not essential restrict for the general wireless relay networks with direct channels. It further indicates the system does not need much power burden to generate the secured SI. This result is summarized in Proposition 1 of Section III. \end{enumerate} The rest of this paper is organized as follows. In Section II, we discuss the system model and formalize the problem to be addressed. We detail our main contribution as stated above in Section III. Numerical Examples are presented in Section IV. The conclusions are drawn in Section V. In Appendices A, we detail the proof of Proposition 1. In Appendices B and C, we detail the necessity and sufficiency proofs of Theorem 1, respectively. \section{System Model} \subsection{Notation} Let $A$ be an 2-dimensional $M\!\times\! N$ matrix. For $i=1,2,\ldots,M$ and $j=1,2,\ldots,N$, $[A]_{i,j}$ denotes the $(i,j)$th entry of $A$. Let $B$ be an 3-dimensional $M\!\times\! N\!\times\! K$ matrix. For $i=1,2,\ldots,M$, $j=1,2,\ldots,N$, and $k=1,2,\ldots,K$, $[B]_{i,j,k}$ denotes the $(i,j,k)$th entry of $B$. Whenever there is no ambiguity, we will employ the notation with no brackets for simplicity. The identity and zero matrices of any dimension are denoted by the generic symbols $I$ and $0$, respectively. For continuous random variables, we use capital letters and lower-case letters to denote the random variables and variables of corresponding probability density functions (PDFs), respectively. For instance, suppose $U$ and $V$ are random variables defined over $\left(-\infty,\:+\infty\right)$. $f_{U}\left(u\right)$ and $f_{V}\left(v\right)$ denote PDFs of $U$ and $V$, respectively. $f_{V\left|U\right.}\left(v\left|u\right.\right)$ denotes the conditional PDF of $V$ given $U$. $F_{V\left|U\right.}\left(v\left|u\right.\right)$ denotes the conditional cumulative distribution function (CDF) of $V$ given $U$. We employ $U^n$ to denote a sequence of $n$ continuous random variables defined over $\left(-\infty,\:+\infty\right)$, and $U_i$ to denote the $i$th random variable in $U^n$. $f_{V^n\left|U^n\right.}\left(v^n\left|u^n\right.\right)$ denotes the conditional PDF of $V^n$ given $U^n$. For the discrete random variables, we use upper-case script letters and serif-font letters to denote the corresponding discrete alphabets and elements in the alphabets, respectively. For instance, suppose that we denote a finite alphabet by $\mathcal{X} = \{ \mathsf{x}_1, \mathsf{x}_2, \ldots, \mathsf{x}_{|\mathcal{X}|} \}$, where $\abs{\mathcal{X}}$ is the cardinality of $\mathcal{X}$. Then $X$ is a generic random yariable oyer $\mathcal{X}$, and $\mathsf{x}$ is a generic element in $\mathcal{X}$. For a pair of random variables $X$ and $Y$, we use $P_{X}(\mathsf{x})$ and $P_{X|Y}( \mathsf{x}| \mathsf{y})$ to denote the marginal distribution of $X$ and the conditional distribution of $X$ given $Y$, respectively. We also employ $X^n$ to denote a sequence of $n$ random variables defined over $\mathcal{X}$, and $X_i$ to denote the $i$th random variable in $X^n$. The counting function $N(\mathsf{x}|X^n)$ records the number of occurrences of the element $\mathsf{x}$ in the sequence $X^n$. The indicator function $1_i(\mathsf{x}|X^n)$ tells whether $X_i$ is $\mathsf{x}$. We may also use $1_i(\mathsf{x})$ instead of $1_i(\mathsf{x}|X^n)$ for simplicity, whenever the meaning is clear from the context. We may trivially extend the aforementioned notations to a tuple of symbols drawn from the corresponding alphabets. \begin{figure} \begin{centering} \includegraphics[scale=0.5]{FIGURE1} \par\end{centering} \caption{$f_{U}\left(u\right)$ and $P_{\widetilde{U}}(\mathsf{\widetilde{u}})$, where $(\alpha_{1}, \beta_{1}, n')=(-5, 5, 100)$.} \end{figure} For the continuous random variables, and the random variables whose continuity or discreteness are not definitely known, there are corresponding discrete random variables generated by quantifying the random variables. Let use the quantization of continuous random variable $U$ as an example as follows. Suppose one $n'$-length sequence $\mathsf{\widetilde{u}}_{1},\mathsf{\widetilde{u}}_{2},\ldots,\mathsf{\widetilde{u}}_{n'}$. Then, for $j=1,\ldots,n'$, $\mathcal{B}\left(\mathsf{\widetilde{u}}_{j}\right)$ denotes the domain consisting of $\mathsf{\widetilde{u}}_{j}$. They satisfy the constraints as follows. \begin{align} \label{q_u1} &\alpha_{1}=\mathsf{\widetilde{u}}_{1}<\mathsf{\widetilde{u}}_{2}<\mathsf{\widetilde{u}}_{3}\ldots<\mathsf{\widetilde{u}}_{n'-1}=\beta_{1},\:\beta_{1}<\mathsf{\widetilde{u}}_{n'},\\ \label{q_u2} &\widetilde{\mathsf{u}}_{j}-\widetilde{\mathsf{u}}_{j-1}=\frac{\beta_{1}-\alpha_{1}}{n'-2},j=2,3,\ldots,n'-1,\\ \label{q_u3} &\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)=\begin{cases} \begin{array}{cc} \left(\widetilde{\mathsf{u}}_{j-1},\,\widetilde{\mathsf{u}}_{j}\right], & j=2,3,\ldots,n'-1\\ \left(-\infty,\,\alpha_{1}\right], & j=1\\ \left(\beta_{1},\,+\infty\right), & j=n' \end{array},\end{cases} \end{align}where $\alpha_{1}$ and $\beta_{1}$ are assumed to depend on $n'$, $\triangle_{u}=\frac{\beta_{1}-\alpha_{1}}{n'-2}$, and $\lim_{n'\rightarrow\infty}\triangle_{u}=0$. Based on the definition of $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$, the continuous variable $U$ can be quantized to discrete $\widetilde{U}$. In particular, if $U\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$, then $\widetilde{U}=\widetilde{\mathsf{u}}_{j}$. In other words, $\widetilde{U}\triangleq\sum_{j=1}^{n'}1\left(U\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)\right)\widetilde{\mathsf{u}}_{j}$. Correspondingly, $U^n$ is quantized to $\widetilde{U}^n$, where $\widetilde{U}_i\triangleq\sum_{j=1}^{n'}1\left(U_i\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)\right)\widetilde{\mathsf{u}}_{j}$. To illustrate motivation of the proposed quantization, let us take an example where $U$ follows standard Gaussian distribution, and it is quantized to $\widetilde{U}$ by setting $(\alpha_{1}, \beta_{1}, n')=(-5, 5, 100)$. Fig. 1 presents the PDF and probability mass function (PMF) of $U$ and $\widetilde{U}$, i.e., $f_{U}\left(u\right)$ and $P_{\widetilde{U}}(\mathsf{\widetilde{u}})$, respectively. It is observed that the curve of $P_{\widetilde{U}}(\mathsf{\widetilde{u}})$ is similar to the curye of $f_{U}\left(u\right)$. $P_{\widetilde{U}}(\mathsf{\widetilde{u}})$ could be used for fitting $f_{U}\left(u\right)$. This observation motivates us to make the random variables be simulated by discrete variables, whose discreteness facilitate our analysis work given later. In this paper, $\widetilde{U}$ is referred as quantized version of $U$. $\left(\alpha_{1},\beta_{1},n'\right)$ is referred as quantization parameter. We also term above-mentioned quantization of $U$ as that $U$ is quantified according to $\left(\alpha_{1},\beta_{1},n'\right)$. These notations could be applied to other random variables and their corresponding quantized versions. Obviously, the quantized variables are discrete, hence, their notations follow the format of discrete variables given above. More details are listed in Table I. {\begin{table*}[!t] \centering \caption{Notation Table} \scriptsize \begin{tabular}{|c|c|} \hline $S$& \text{Source symbol, $S\in\left\{ -1,1\right\}$ }\\ \hline $U$& \text{Symbol received by the relay, $U\in\left(-\infty,\:+\infty\right)$}\\ \hline $V$& \text{Symbol forwarded by the relay, $V\in\left(-\infty,\:+\infty\right)$}\\ \hline $Y$& \text{The destination's received symbol from the relay, $Y\in\left(-\infty,\:+\infty\right)$}\\ \hline $X$& \text{The destination's received symbol from the source, $X\in\left(-\infty,\:+\infty\right)$}\\ \hline $\widetilde{U}$& \text{Quantized version of $U$ according to $\left(\alpha_{1},\beta_{1},n'\right)$, please refer to (\ref{q_u1})-(\ref{q_u3}) for detailed definition.}\\ \hline \multirow{4}{*}{$\widetilde{V}$}& Quantized version of $V$ according to {\small{$\left(\alpha_{2},\beta_{2},n_v\right)$, $\widetilde{V}\triangleq\sum_{j=1}^{n'}1\left(V\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)\right)\widetilde{\mathsf{v}}_{j}$}}, where \\ &{\small{$\alpha_{2}=\mathsf{\widetilde{v}}_{1}<\mathsf{\widetilde{v}}_{2}<\mathsf{\widetilde{v}}_{3}\ldots<\mathsf{\widetilde{v}}_{n_v-1}=\beta_{2},\:\beta_{2}<\mathsf{\widetilde{v}}_{n_v}$}}\\ &{\small{$\widetilde{\mathsf{v}}_{j}-\widetilde{\mathsf{v}}_{j-1}=\frac{\beta_{2}-\alpha_{2}}{n_v-2},j=2,3,\ldots,n_v-1$}},\\ &{\small{$\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)=\begin{cases} \begin{array}{cc} \left(\widetilde{\mathsf{v}}_{j-1},\,\widetilde{\mathsf{v}}_{j}\right], & j=2,3,\ldots,n_v-1\\ \left(-\infty,\,\alpha_{2}\right], & j=1\\ \left(\beta_{2},\,+\infty\right), & j=n_y \end{array}\end{cases}$}}\\ \hline \multirow{4}{*}{$\widetilde{Y}$}& Quantized version of $Y$ according to {\small{$\left(\alpha_{y},\beta_{y},n_y\right)$, $\widetilde{Y}\triangleq\sum_{j=1}^{n'}1\left(Y\in\mathcal{B}\left(\widetilde{\mathsf{y}}_{j}\right)\right)\widetilde{\mathsf{y}}_{j}$}}, where \\ &{\small{$\alpha_{3}=\mathsf{\widetilde{y}}_{1}<\mathsf{\widetilde{y}}_{2}<\mathsf{\widetilde{y}}_{3}\ldots<\mathsf{\widetilde{y}}_{n_y-1}=\beta_{y},\:\beta_{3}<\mathsf{\widetilde{y}}_{n_y}$}}\\ &{\small{$\widetilde{\mathsf{y}}_{j}-\widetilde{\mathsf{y}}_{j-1}=\frac{\beta_{3}-\alpha_{3}}{n_y-2},j=2,3,\ldots,n_y-1$}},\\ &{\small{$\mathcal{B}\left(\widetilde{\mathsf{y}}_{j}\right)=\begin{cases} \begin{array}{cc} \left(\widetilde{\mathsf{y}}_{j-1},\,\widetilde{\mathsf{y}}_{j}\right], & j=2,3,\ldots,n_y-1\\ \left(-\infty,\,\alpha_{3}\right], & j=1\\ \left(\beta_{3},\,+\infty\right), & j=n_y \end{array}\end{cases}$}}\\ \hline \multirow{4}{*}{$\widetilde{X}$}& Quantized version of $X$ according to $\left(\alpha_{4},\beta_{4},n_x\right)$, $\widetilde{Y}\triangleq\sum_{j=1}^{n'}1\left(X\in\mathcal{B}\left(\widetilde{\mathsf{x}}_{j}\right)\right)\widetilde{\mathsf{x}}_{j}$, where \\ &$\alpha_{4}=\mathsf{\widetilde{x}}_{1}<\mathsf{\widetilde{x}}_{2}<\mathsf{\widetilde{x}}_{3}\ldots<\mathsf{\widetilde{x}}_{n_x-1}=\beta_{x},\:\beta_{4}<\mathsf{\widetilde{x}}_{n_x}$\\ &$\widetilde{\mathsf{x}}_{j}-\widetilde{\mathsf{x}}_{j-1}=\frac{\beta_{4}-\alpha_{4}}{n_x-2},j=2,3,\ldots,n_x-1$,\\ &$\mathcal{B}\left(\widetilde{\mathsf{x}}_{j}\right)=\begin{cases} \begin{array}{cc} \left(\widetilde{\mathsf{x}}_{j-1},\,\widetilde{\mathsf{y}}_{j}\right], & j=2,3,\ldots,n_x-1\\ \left(-\infty,\,\alpha_{4}\right], & j=1\\ \left(\beta_{4},\,+\infty\right), & j=n_x \end{array}\end{cases}$\\ \hline $\mathcal{S}$, $\mathcal{\widetilde{U}}$, $\mathcal{\widetilde{V}}$, $\mathcal{\widetilde{Y}}$, $\mathcal{\widetilde{X}}$& \text{Alphabets of $S$, $\widetilde{U}$, $\widetilde{V}$, $\widetilde{Y}$, and $\widetilde{X}$, respectively }\\ \hline $\mathsf{s}_{i}$, $\mathsf{\widetilde{u}}_{i}$, $\mathsf{\widetilde{v}}_{i}$, $\mathsf{\widetilde{y}}_{i}$, $\mathsf{\widetilde{x}}_{i}$& \text{The $i$-th elements in $\mathcal{S}$, $\mathcal{\widetilde{U}}$, $\mathcal{\widetilde{V}}$, $\mathcal{\widetilde{Y}}$, and $\mathcal{\widetilde{X}}$, respectively }\\ \hline $\mathsf{s}$, $\mathsf{\widetilde{u}}$, $\mathsf{\widetilde{v}}$, $\mathsf{\widetilde{y}}$, $\mathsf{\widetilde{x}}$& \text{Generic elements in $\mathcal{S}$, $\mathcal{\widetilde{U}}$, $\mathcal{\widetilde{V}}$, $\mathcal{\widetilde{Y}}$, and $\mathcal{\widetilde{X}}$, respectively }\\ \hline $P_{\widetilde{U}}(\mathsf{\widetilde{u}})$& \text{PMF of $\widetilde{U}$}\\ \hline $1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)$& \text{Indicator of whether $\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}$ is true or not}\\ \hline $1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)$& \text{Indicator of whether $\widetilde{U}_{i}=\widetilde{\mathsf{v}}_{j}$ is true or not}\\ \hline {\small{$N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)$}} &{\small{$\sum_{i}^{n}1_{i}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)$}}\\ \hline $P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)$& \text{Conditional probability of $\left\{ \widetilde{U}=\widetilde{\mathsf{u}}_{j}\right\} $ given $\left\{ \widetilde{X}=\widetilde{\msf{x}}\right\} $}\\ \hline $\triangle_{u}$, $\triangle_{v}$ & $\triangle_{u}=\frac{\beta_{1}-\alpha_{1}}{n'-2}$, $\triangle_{v}=\frac{\beta_{2}-\alpha_{2}}{n_v-2}$\\ \hline $\Phi\left(\cdot\right)$ & \text{pulse response function}\\ \hline \end{tabular} \end{table*}} \subsection{Channel Model} \begin{figure} \begin{centering} \includegraphics[scale=0.5]{system_model} \par\end{centering} \caption{System model.} \end{figure} Let us focus on the two-hop one-way relay example, where one source and one destination exchange information via a relay system. The communication takes place in two stages. Each stage includes $n$ instants. In the first $n$ instants, the source sends $n$-length sequence $S^{n}$ to the relay node, $S$ is a discrete random variable. Correspondingly, the relay observes $n$-length sequence $U^n$. Without loss of generalization, we assume that $S$ is equiprobability binary symbol generated from alphabet $(+1, -1)$ The channel from the source to the relay is specified by $U =h_1S+N_r$, where $U$ is the received signal of the relay in each instant, $h_1$ is the constant channel coefficient, and $N_r$ is AWGN existed in the channel. $N_r$ is random variables following standard Gaussian distribution. Then, the pdf of $U$ conditioned on $S=\mathsf{s}$ is given as \begin{equation}\label{R1_channel} f_{U\left|S\right.}\left(u\left|\mathsf{s}\right.\right)=\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{\left(u-h_{1}\mathsf{s}\right)^{2}}{2}\right). \end{equation} Meanwhile, due to the open nature of wireless scenario, the destination could hear sequence $X^n$ from the direct channel. The direct channel is specified by $X =h_3S+N_d$, where $h_3$ is the constant coefficient of the direct channel, and $N_d$ is standard AWGN existed in the direct channel. \begin{equation}\label{D_channel} f_{X\left|S\right.}\left(x\left|\mathsf{s}\right.\right)=\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{\left(x-h_{3}\mathsf{s}\right)^{2}}{2}\right). \end{equation} Based on (\ref{R1_channel}) and (\ref{D_channel}), the PDF of $U$ conditioned on $X$ is given by \begin{equation} f_{U\left|X\right.}\left(u\left|{x}\right.\right)=\sum_{i=1}^{2}P_{S\left|X\right.}\left(\mathsf{s}_{i}\left|{x}\right.\right)f_{U\left|S\right.}\left(u\left|\mathsf{s}_{i}\right.\right), \end{equation}where $f_{U\left|S\right.}\left(u\left|\mathsf{s}_{i}\right.\right)$ is given by (\ref{R1_channel}), and $P_{S\left|X\right.}\left(\mathsf{s}_{i}\left|{x}\right.\right)=\frac{\exp\left(-\frac{\left({x}-h_{3}\mathsf{s}_{i}\right)^{2}}{2}\right)}{\sum_{j=1}^{2}\exp\left(-\frac{\left({x}-h_{3}\mathsf{s}_{j}\right)^{2}}{2}\right)}$. We assume the channels from source to relay and to destination are stationary and memoryless. As a result, $U^n$ and $X^n$ are i.i.d. sequences, we thus have $f_{U^{n}\left|X^{n}\right.}\left(u^{n}\left|{x^{n}}\right.\right)=\prod_{i=1}^{n}f_{U\left|X\right.}\left(u_{i}\left|{x_{i}}\right.\right)$, where $u_{i}$ and $x_i$ are the $i$-th symbol of generic sequences $u^n$ and $x^n$, respectively. Secondly, in the instants $n+1, n+2, \ldots, 2n$, the relay forwards sequence $V^n$ to the destination. $V$ is the variable denoting the forwarded signal of the relay. Depending on the relay's attack act, the alphabet of $V$ may be discrete or continuous. Furthermore, we allow the relay to conduct arbitrary attacks as long as $X^n$, $U^n$, and $V^n$ satisfy a markov constraint, i.e., $f_{V^{n}\left|U^{n},X^{n}\right.}\left(v^{n}\left|{u^{n},x^{n}}\right.\right)=f_{V^{n}\left|U^{n}\right.}\left(v^{n}\left|{u^{n}}\right.\right)$. It indicates the relay conducts attacks only upon its own observation. The channel from the relay to the destination is specified by $Y =h_2V+N'_d$ where $h_2$ is the constant channel coefficient, $N'_d$ is standard AWGN existed in the channel. The pdf of $Y$ conditioned on $V$ is given as $f_{Y\left|V\right.}\left(y\left|{v}\right.\right)=\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{\left(y-h_{2}{v}\right)^{2}}{2}\right)$. Correspondingly, the cumulative distribution function (cdf) of $Y$ conditioned on $V$ is given as \begin{equation} F_{Y\left|V\right.}\left(t\left|{v}\right.\right)=\int_{-\infty}^{t}\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{\left(y-h_{2}{v}\right)^{2}}{2}\right)dy. \end{equation} We assume the destination knows $f_{U\left|X\right.}\left(u\left|{x}\right.\right)$ and $F_{Y\left|V\right.}\left(t\left|{v}\right.\right)$ for facilitating attack detection. $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(t\left|{v}\right.\right)\right)$ is referred as to observation channel. In the instants $n+1, n+2, \ldots, 2n$, the destination receives sequence $Y^n$ from the relay. The channel from the relay to the destination is also stationary and memoryless, thus pdf of $Y_i$ given $V^n$ is given by $f_{Y_{i}\left|V^{n}\right.}\left(y\left|{v^{n}}\right.\right)=f_{Y\left|V\right.}\left(y\left|{v_{i}}\right.\right)$, where $v_{i}$ is the $i$-th symbol of sequence $v^n$, $Y_i$ denotes the $i$-th variable in random sequence $Y^n$. \subsection{Attack Model} \begin{figure} \begin{centering} \includegraphics[scale=0.5]{Q_uv} \par\end{centering} \caption{An instance of quantization setup employed by Section II. C, where each $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$ ($j=1,\ldots, n'$) is included by one of $\{\mathcal{B}\left(\widetilde{\mathsf{v}}_{1}\right), \mathcal{B}\left(\widetilde{\mathsf{v}}_{2}\right), \ldots, \mathcal{B}\left(\widetilde{\mathsf{v}}_{n_v}\right)\}$ in whole.} \end{figure} The potential malicious relay receives sequence $U^n$, and then forwards sequence $V^n$. The relay may perform arbitrary attacks, including i.i.d. and non-i.i.d. attacks, while the parameter of attack is unknown to the destination. Thus, $V^n$ may be a non-i.i.d. sequence, and distribution of $U^n$ and $V^n$, i.e., $f_{V^{n},U^{n}}\left(v^{n},u^{n}\right)$, is also unknown to the destination. This property motivates us to develop a non-parameter method to model the attacks. For modeling the attack, we first notice the $U$ is continuous random variable. The alphabet of $V$ is not definite, it is possible to be any arbitrary value in $\left(-\infty,\:+\infty\right)$. We quantize $U$ and $V$ according to quantized parameters $\left(\alpha_{1},\beta_{1},n'\right)$ and $\left(\alpha_{2}, \beta_{2},n_v\right)$ where $\alpha_{2}$, $\beta_{2}$, where $n_v$ depend on $n'$, $n_v$ approaches to infinity as $n'\rightarrow\infty$, and then get quantized variables $\widetilde{U}$ and $\widetilde{V}$, respectively. Furthermore, to describe the maliciousness of relay, $n_v$ and $n'$ are properly chosen such that for $j=1,2,\ldots,n'$ and $k=1,2,\ldots,n_v$, $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$ and $\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)$ have either $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)\subseteq\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)$ or $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)\bigcap\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)=\varnothing$. We illustrate an instance of this quantization setup in Fig. 3. Based on the quantization, the function $\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)$ for sequence pair ($U^n$, $V^n$) is defined as \begin{equation}\label{de_F} \triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)=\begin{cases} \begin{array}{cc} \frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}, & N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)\neq0,\, u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right),\, v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)\\ 0, & otherwise \end{array}\end{cases}, \end{equation} where $\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}$ is the empirical transition probability from $\{\widetilde{U}=\widetilde{\mathsf{u}}_{j}\}$ to $\{\widetilde{V}=\widetilde{\mathsf{v}}_{k}\}$. Consider the case that the probability is strictly non-zero while $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)\bigcap\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)=\varnothing$, then it indicates the relay partly modifies its received symbol (i.e., $U$) that belongs to $\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$ to another disparate domain $\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)$. To be more precise, if the relay is absolutely reliable, we must always have {\small{$\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right|=0$}}, where \begin{equation} \left[W_{0}^{\left(n'\right)}\right]_{i,j}=\begin{cases} \begin{array}{cc} 1, & \mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)\subseteq\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)\\ 0, & otherwise \end{array}\end{cases} \end{equation} From this intuitively understanding, the malicious relay is defined as follows. \begin{define} \label{def:maliciousness} \textbf{(Malicious Relay)} The relay is said to be non-malicious if {\small{$\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right| \rightarrow 0$}} in probability as $n$ and $n'$ approach to infinity. Otherwise, the relay is considered malicious.\end{define} Note that Definition~\ref{def:maliciousness} mainly tolerates two kinds of manipulation. In the one manipulating scenario, the modification always makes $U\neq V$ as well as $\mathcal{B}\left(\widetilde{U}\right)\subseteq\mathcal{B}\left(\widetilde{V}\right)$. In other words, when the relay receives a symbol of $\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)$, and according to the quantization setup, there exists $j\in\{1,2,\ldots, n_v\}$ satisfying $\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)\subseteq\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)$. Then, the relay modifies the symbol to arbitrary another symbol that belongs to $\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)$. It yields to \begin{equation} \triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)=\begin{cases} \begin{array}{cc} 1, & \mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)\subseteq\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)\\ 0, & otherwise \end{array}\end{cases} \end{equation}for $i=1,\ldots,n'$ and $j=1,\ldots,n_v$. According to Definition~\ref{def:maliciousness}, such modification is considered to be non-malicious. The modification is conducted within $\mathcal{B}\left(\widetilde{\mathsf{v}}\right)$. As $n$ and $n_v$ approach to infinity, we have $\left|U-V\right|\leq\frac{\beta_{v}-\alpha_{v}}{n_{v}-2}$ in probability. Hence, for sufficient large $n$ and $n_v$, the modification error is controllable and negligible. In another manipulating scenario, the relay only modifies negligible fraction of symbols, such that $\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)$ is close to $\left[W_{0}^{(n')}\right]_{i,j}$ for $i=1,\ldots,n'$ and $j=1,\ldots,n_v$. This relaxation has essentially no effect on the information rate from the source to the destination across the relay. We allow these two kinds of manipulation for mathematical convenience. Recall from Section II.B that in the instants $n+1, n+2, \ldots, 2n$, the relay transmits $V^n$ to the destination. Conrrespondingly, the destination observes $Y^n$ from the relay. On the other hand, in the instants $1, 2, \ldots, n$, the destination also observes $X^n$ from the source. The destination is free to use $Y^n$ and $X^n$ to detect the existence of malicious relay. Since $X^n$ is delivered via the direct channel, it is guaranteed not to be attacked and is statistically correlated to $Y^n$ when the relay is non-malicious. Thus, $X^n$ could work as secured SI to check whether $Y^n$ is attacked by the relay. In particular, the destination uses $X^n$ and $Y^n$ for getting functions \begin{equation} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)=\begin{cases} \begin{array}{cc} \frac{\sum_{i=1}^{n}1_{i}\left(Y_{i}<t\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}, & N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)\neq0,\\ 0, & otherwise \end{array}\end{cases}. \end{equation}Then, in lemma \ref{Alem2}, we will show that as $n\rightarrow\infty$, $n'\rightarrow\infty$, the convergence \begin{equation}\label{CI} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)\rightarrow\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t\left|\widetilde{\mathsf{v}}_{k}\right.\right) \end{equation}is established in probability for arbitrary value of $t$ and arbitrary distribution of $\left\{ \widetilde{V}^{n},\widetilde{U}^{n}\right\} $. The convergence characterized by (\ref{CI}) allows the destination to determine whether {\small{$\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right|$}} is far away from $0$ or not by using its observation of $F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)$. In other words, the attack detection could be implemented based on physical-layer observation, i.e., $X^n$ and $Y^n$. We will propose the detection method only using $X^n$ and $Y^n$, and prove that as $n\rightarrow\infty$, the error probability of the proposed detection method approaches to $0$. \section{Main Results} Notice that the convergence (\ref{CI}) could be rewrote as \begin{equation} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)\rightarrow\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}\frac{P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)}{\triangle_{u}}\frac{\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{\triangle_{v}}F_{Y\left|V\right.}\left(t\left|\widetilde{\mathsf{v}}_{k}\right.\right)\triangle_{v}\triangle_{u} \end{equation}where we set that $n_v$ approaches to infinity as $n'\rightarrow\infty$, hence $\lim_{n'\rightarrow\infty}\triangle_{u}=0$, and $\lim_{n'\rightarrow\infty}\triangle_{v}=0$. On the other hand, we will also prove that the convergence (\ref{CI}) is established for arbitrary sufficient large $n'$. Then, according to the definition of integral, for sufficient large $n'$, we could get that \begin{equation}\label{r1} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)\rightarrow\int_{\alpha_{1}}^{\beta_{1}}\int_{\alpha_{2}}^{\beta_{2}}f_{U\left|X\right.}\left(u\left|x\right.\right)f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv \end{equation}where $x\in\mathcal{B}\left(\widetilde{\msf{x}}\right)$, $f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)=\frac{\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)}{\triangle_{v}}$. Furthermore, if $f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)$ converges to $\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)$ as $n'\rightarrow\infty$, we could also obtain that \begin{equation}\label{r2} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)\rightarrow\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|X\right.}\left(u\left|x\right.\right)\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv. \end{equation}Either (\ref{r1}) or (\ref{r2}) indicates the observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(t\left|{v}\right.\right)\right)$ plays a key role to the attack detection using observation of $F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)$. Intuitively, if observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(t\left|{v}\right.\right)\right)$ makes $\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)=\Phi\left(v-u\right)$ is the single pdf solution to $$\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|X\right.}\left(u\left|x\right.\right)\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv=\int_{-\infty}^{+\infty}f_{U\left|X\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(y\left|u\right.\right)du,$$then the destination is able to determine whether $\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)$ is far away from $\Phi\left(v-u\right)$ or not by comparing $\int_{-\infty}^{+\infty}f_{U\left|X\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(y\left|u\right.\right)du$ with $F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)$. Obviously, the distance between $\lim_{n'\rightarrow\infty}f_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(v\left|u\right.\right)$ and $\Phi\left(v-u\right)$ indicates maliciousness of the relay. As a beneficial result, the attacks are detectable upon $F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)$. This intuition leads to the following dichotomy on all AWGN observation channels. \begin{define} \textbf{Non-manipulable AWGN Relay Channel} The observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(y\left|{v}\right.\right)\right)$ is non-manipulable, if there exists function $\Psi\left(v\left|u\right.\right)$ that satisfies the following three conditions \begin{enumerate} \item $\Psi\left(v\left|u\right.\right)$ is a conditional pdf. \item $\ensuremath{\Psi\left(v\left|u\right.\right)}\neq\Phi\left(v-u\right)$. \item {\small{$\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)\Psi\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv=\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(y\left|u\right.\right)du$}}. \end{enumerate} \end{define}Otherwise, the observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(y\left|{v}\right.\right)\right)$ is non-manipulable. The following theorem will show the non-manipulability of relay network is equivalent to the detectability of maliciousness. \begin{theorem}\textbf{(Maliciousness detectability )} \label{thm:main2} The observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(y\left|{v}\right.\right)\right)$ is non-manipulable is a necessary and sufficient condition for the existence of a sequence of decision statistics $\left\{ D^{n} \right\}$ simultaneously having the following two properties: \\ Fix any sufficiently small $\delta >0$, $\epsilon>0$, there has sufficiently large $n'$, \begin{enumerate} \item {\small{$\lim_{n\rightarrow\infty}\Pr\left(D^{n}>\varepsilon(n',\delta)~\Big|\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right|>\delta\right)\geq1-\epsilon$}} whenever {\small{$\Pr \Big(\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\Big|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\Big|> \delta \Big) > 0$}}, where $\varepsilon(n',\delta)$ is strictly positive and can be arbitrary small. \item {\small{$\lim_{n\rightarrow\infty}\Pr\Big( D^{n}> \mu' (n',\delta) ~\Big| \sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right|\leq \delta \Big) \leq \epsilon$}} whenever {\small{$\Pr \Big( \sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\Big|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\Big|<\delta \Big) > 0$, where $\mu' (n',\delta) \rightarrow 0$ as $n'\rightarrow \infty$, $\delta \rightarrow 0$}}. \end{enumerate} \end{theorem} The properties 1) and 2) of Theorem 1 together imply that we have $D^{n}\rightarrow0$ in probability if the relay network is safe. To elaborate a little further, for a relay network in which the source's observation channel is non-manipulable, it is theoretically feasible to check whether the relay have conducted Byzantine attacks. Conversely, if the observation channel is manipulable, the security of the relay network against Byzantine attacks may not be guaranteed by only checking the source's observations. \emph{Remark 1:} Theorem \ref{thm:main2} gives the detectability of continuous attacks over continuous channels. It extends the the detectability of discrete attacks given by \cite{GravesINFOCOM12} into continuous form. This extension is not trivial based on twofold work of this paper. Firstly, we prove the convergence of $F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)$ (\ref{c1}) is established for arbitrary sufficient large $n'$ rather than fixed $n'$, where the involved variables $\widetilde{X}$, $\widetilde{U}$, and $\widetilde{V}$ do not follow markov constraint. For completing such proof work, it is not available to straightforwardly use the methods of \cite{GravesINFOCOM12}, which processes the discrete variables following markov constraint and having fixed dimensions of their alphabets. Secondly, the checking problem for non-manipulability of continuous channel is to check number of solutions to an integral equation. The method of \cite{GravesINFOCOM12} for checking non-manipulability of discrete channel is to check number of solutions to an matrix equation. The checking method given by \cite{GravesINFOCOM12} cannot be used for integral equation. In this paper, we will show almost all the continuous relay networks are non-manipulable as follows. \begin{proposition}\label{pro1}\textbf{(Non-manipulability of Networks With Nonzero-Coefficients)} If and only if $h_1\neq0$, $h_2\neq0$ and $h_3\neq0$, the observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(y\left|{v}\right.\right)\right)$ is non-manipulable. \end{proposition}Obviously, the Proposition 1 indicates the non-manipulability is very common for the general AWGN relay networks. Jointly considering Theorem 1 and Proposition 1, we attain that in almost all the AWGN relay networks, arbitrary attacks are detectable by using physical-layer observation. Furthermore, according to Proposition \ref{pro1}, even the coefficient of direct channel, i.e., $h_3$, is very little yet nonzero, the observation channel is still non-manipulable. It indicates even the direct channel suffers deep fading, the signal observed from the direct channel still can be used for attack detection and achieving asymptotically errorless performance. According to Proposition 1, we have the following corollary. \begin{cor}\textbf{(Manipulability of AWGN Relay Networks Without Direct Channel)}\label{cor1} If the direct channel does not exist, i.e., $h_3=0$, the observation channel $\left(f_{U\left|X\right.}\left(u\left|{x}\right.\right),\; F_{Y\left|V\right.}\left(y\left|{v}\right.\right)\right)$ is manipulable. \end{cor}The proof of Corollary \ref{cor1} is completed by setting $\Psi\left(v\left|u\right.\right)=f_{U}\left(v\right)$, then we have {\small{$\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)\Psi\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv=\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(y\left|u\right.\right)du$}}. According to Definition 2, the networks without direct channel is manipulable. From Theorem 1, the manipulability indicates in such networks, some attacks are not detectable upon observation of the destination. Recall that the direct channel is specified by $X =h_3S+N_d$. If $h_3=0$, then $X =N_d$ which is always statistical independent on the observation from relay, $Y^n$. Hence, $X^n$ cannot work as SI to check $Y^n$ due to its loss of statistic dependence on $Y^n$. It also reflects the vulnerability of lacking SI. Proposition 1 and Corollary \ref{cor1} jointly illustrate the necessity of utilizing SI. For detectability of arbitrary attacks, SI is allowed to be little, but cannot be vacancy. \section{Numerical Examples} We give three numerical examples in this section to illustrate the detectability results of Theorem 1, Proposition 1, and Corollary 1. In all the examples, we assume that the source alphabet is binary. We employ decision statistic {\small{$$D^{n}=\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{{n_{y}-1}}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_{m}\left|\widetilde{\mathsf{x}}_{k}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_{k}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du\right|$$}} for Byzantine attack detection in the examples. We first consider the setup that $h_1=h_2=h_3=1$. We term the direct channel as strong in the sense that its coefficient is as large as relaying channel. According to Proposition 1, the considered channel is non-manipulable. Then, two different attacks are considered. In the first attack, referred to as Attack 1, the relay conducts a non-i.i.d. attack by mapping its $i$th input symbol $U_i$ to $V_i$ according to $V_i=U_i-1$ when $i$ is odd, and according to $V_i=2U_i-1$ when $i$ is even. In the second attack considered, referred to as Attack 2, relay makes $V$ follow the distribution identical to $U$. Meanwhile, $U$ and $V$ are independent with each other. Since the observation channel is non-manipulable, these two attacks are detectable. We conduct computer simulation to illustrate the detectability of both attacks using $D^n$. The empirical CDFs of $D^n$ obtained from the simulation are plotted in Figs. 4 and 5 for Attack 1 and Attack 2, respectively. From these two figures, it is observed that there are clear separations between the empirical CDFs of $D^n$ for the non-malicious case and the malicious case of Attack 1 and Attack 2 when $n=10^3$. This observation verifies sufficiency of non-manipulability for the detectability of attacks promised by Theorem 1. \begin{figure} \begin{centering} \includegraphics[scale=0.5]{Figure4} \par\end{centering} \caption{Empirical CDFs of $D^n$ for Attack 1 in non-manipulable observation channel characterized by $h_1=h_2=h_3=1$. } \end{figure} \begin{figure} \begin{centering} \includegraphics[scale=0.5]{Figure5} \par\end{centering} \caption{Empirical CDFs of $D^n$ for Attack 2 in non-manipulable observation channel characterized by $h_1=h_2=h_3=1$.} \end{figure} Secondly, we consider the setup that $h_1=h_2=1$, $h_3=0.01$. We term the direct channel as weak in the sense that its coefficient is much smaller than relaying channel. According to Proposition 1, this network with weak direct channel is still non-manipulable. Based on Theorem 1, Attack 2 is detectable. We consider Attack 2 in computer simulation. The empirical CDFs of $D^n$ are plotted in Fig. 6. Similar to Figs. 4 and 5, it is also observed clear separations between the empirical CDF of $D^n$ for the non-malicious case and the malicious case of Attack 2. Nevertheless, this separation appears when $n=10^5$. This observation verifies sufficiency of non-manipulability for the detectability of attacks promised by Theorem 1. It also indicates the detection with weak direct channel needs much more observations than it with strong direct channel. \begin{figure} \begin{centering} \includegraphics[scale=0.5]{Figure6} \par\end{centering} \caption{Empirical CDFs of $D^n$ for Attack 2 in non-manipulable observation channel characterized by $h_1=h_2=1, h_3=0.01$.} \end{figure} Finally, we consider the setup that $h_1=h_2=1$, $h_3=0$. Under this setup, the direct channel is vacancy. According to Proposition 1 and Corollary 1, this network is manipulable. Based on Theorem 1, we know that there some attacks are not attackable in this network. In order to verify this, we simulated Attack 2 in such network. The empirical CDFs of $D^n$ obtained from the simulation is plotted in Fig. 7. It is seen from Fig. 7 that the CDFs are indistinguishable, regardless of the value of $n$. As a result, from $D^n$, Attack 2 is not detectable. This observation verifies the necessity of non-manipulability for the detectability of attacks promised by Theorem 1. \begin{figure} \begin{centering} \includegraphics[scale=0.5]{Figure7} \par\end{centering} \caption{Empirical CDFs of $D^n$ for Attack 2 in manipulable observation channel characterized by $h_1=h_2=1, h_3=0$.} \end{figure} \section{conclusions} This paper considers attack detection problem in wireless relay system. We prove arbitrary attacks are detectable only using physical-layer observations, as long as the system satisfies a non-manipulable condition. Then, we further prove that if and only if the coefficients of all channels in the relay system are non-zero, the non-manipulability of the wireless system is guaranteed. It indicates that using physical-layer observations, rather than any other secret-key or AMD code, wireless relay systems are generally able to detect arbitrary attacks. \appendices{} \section{Proof of Proposition 1} \begin{lemma}\label{lemp1} If $h_{1}\neq0$ and $h_{3}\neq0$, there does not exist any i.i.d attack making the statistical distribution of $U$ conditioned on $X$ is equivalent to the statistical distribution of $V$ conditioned on $X$. \end{lemma} \begin{IEEEproof} Let us assume the manipulable wireless channel exists, which indicates there at least one i.i.d attack making the statistical distribution of $U$ conditioned on $X$ is equivalent to the statistical distribution of $V$ conditioned on $X$. Hence, we have $I\left(X;U\right)=I\left(X;V\right)$, where $I\left(\cdot;\cdot\right)$ denotes mutual information between the two input variables. On the other hand, $\left(X,U,V\right)$ forms a Markov chain as $X\rightarrow U\rightarrow V$. From Data-Processing Inequality, $I\left(X;U\right)=I\left(X;V\right)$ implies the Markov chain $X\rightarrow V\rightarrow U$ is also established. Then, let us use $\mathsf{u}$ and $\mathsf{v}$ to respectively denote arbitrary possible values of $U$ and $V$, we have \begin{equation} \label{markov_eq} \Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=a\right.\right)=\Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=b\right.\right) \end{equation}where $a$ and $b$ denote arbitrary value of $X$, $a\neq b$. Furthermore, $\Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=a\right.\right)$ can be extended as {\small{\begin{align}\label{extend_1} \Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=a\right.\right)&=\frac{\Pr\left(U=\mathsf{u},V=\mathsf{v},X=a\right)}{\Pr\left(V=\mathsf{v},X=a\right)}\\&\nonumber =\frac{\Pr\left(X=a\right)\Pr\left(U=\mathsf{u}\left|X=a\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\Pr\left(V=\mathsf{v},X=a\right)}\\&\nonumber =\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|a\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|a\right.\right)}\end{align}}}where the second equation follows the fact that $X\rightarrow U\rightarrow V$ also forms a Markov chain. Similarly, $\Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=b\right.\right)$ can be extended as {\small{\begin{align}\label{extend_2} \Pr\left(U=\mathsf{u}\left|V=\mathsf{v},X=b\right.\right)&=\frac{\Pr\left(U=\mathsf{u},V=\mathsf{v},X=b\right)}{\Pr\left(V=\mathsf{v},{X}=b\right)}\\&\nonumber =\frac{\Pr\left(X=b\right)\Pr\left(U=\mathsf{u}\left|X=b\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\Pr\left(V=\mathsf{v},X=b\right)}\\&\nonumber =\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|b\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|b\right.\right)},\end{align}}}where the second equation is again relying on the fact that $X\rightarrow U\rightarrow V$ forms a Markov chain. Substituting (\ref{extend_1}) and (\ref{extend_2}) into (\ref{markov_eq}), we have {\small{\begin{equation}\label{reshape_1} \frac{f_{U\left|X\right.}\left(\mathsf{u}\left|a\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|a\right.\right)}=\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|b\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|b\right.\right)}. \end{equation}}}Notice that (\ref{reshape_1}) should be always established for arbitrary value of $a$ and $b$. Thus, we have \begin{equation}\label{eq_infinity} \lim_{a\rightarrow\infty}\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|a\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|a\right.\right)}=\lim_{b\rightarrow-\infty}\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|b\right.\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|b\right.\right)}. \end{equation}which could be further reshaped as \begin{equation}\label{eq_infinity} \Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)\lim_{a\rightarrow\infty}\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|a\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|a\right.\right)}=\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)\lim_{b\rightarrow-\infty}\frac{f_{U\left|X\right.}\left(\mathsf{u}\left|b\right.\right)}{f_{U\left|X\right.}\left(\mathsf{v}\left|b\right.\right)}. \end{equation} Without loss of generality, we assume $h_{3}>0$. Then, according to the expression of $f_{U\left|X\right.}\left(u\left|x\right.\right)$, (\ref{eq_infinity}) becomes {\small{\begin{equation}\label{reshape_2} \frac{\exp\left(-\frac{\left(\mathsf{u}+h_{1}\right)^{2}}{2}\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\exp\left(-\frac{\left(\mathsf{v}+h_{1}\right)^{2}}{2}\right)}=\frac{\exp\left(-\frac{\left(\mathsf{u}-h_{1}\right)^{2}}{2}\right)\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\exp\left(-\frac{\left(\mathsf{v}-h_{1}\right)^{2}}{2}\right)},\end{equation}}}which indicates {\small{\begin{equation}\label{reshape_3} \frac{\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\exp\left(2h_1\mathsf{u}\right)}=\frac{\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)}{\exp\left(2h_1\mathsf{v}\right)}. \end{equation}}}Obviously, as $h_{1}\neq0$, if and only if $\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)=0$ for $\mathsf{u}\neq\mathsf{v}$, (\ref{reshape_3}) would be true. Then, for any attacks that $\Pr\left(V=\mathsf{v}\left|U=\mathsf{u}\right.\right)\neq 0$ for $\mathsf{u}\neq\mathsf{v}$, (\ref{reshape_3}) would not be true, which contradicts to the assumption that there at least one i.i.d attack making the statistical distribution of $U$ conditioned on $X_1$ is equivalent to the statistical distribution of $V$ conditioned on $X_1$. Hence, the lemma is proved. \end{IEEEproof} \begin{lemma}\label{lemp2} For random variables $Z_1$, $Z_2$, $Z_3$ $Z_4$, $Z_5$, where $Z_3=Z_1+Z_2$, $Z_5=Z_4+Z_2$, $Z_1$ and $Z_4$ are both stochastic independent with $Z_2$, if pdf $f_{Z_{3}\left|\widetilde{X}\right.}\left({z}_{3}\left|\widetilde{\msf{x}}\right.\right)=f_{Z_{5}\left|\widetilde{X}\right.}\left({z}_{5}\left|\widetilde{\msf{x}}\right.\right)$, then there must have $f_{Z_{1}\left|\widetilde{X}\right.}\left({z}_{1}\left|\widetilde{\msf{x}}\right.\right)=f_{Z_{4}\left|\widetilde{X}\right.}\left({z}_{4}\left|\widetilde{\msf{x}}\right.\right)$. \end{lemma} \begin{IEEEproof} According to the fact that $Z_3=Z_1+Z_2$, where $Z_1$ and $Z_2$ are stochastic independent with each other, then the characteristic function of $Z_3$ conditioned on $X_1=\widetilde{\msf{x}}$ is expressed by {\small{\begin{equation}\label{c1} \varphi_{Z_{3}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)=\varphi_{Z_{1}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right), \end{equation}}}where $\varphi_{Z_{3}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$, $\varphi_{Z_{1}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$ and $\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$ denote the characteristic functions of $Z_3$, $Z_2$ and $Z_1$ conditioned on $X_1=\widetilde{\msf{x}}$, respectively. Similarly, according to the fact that $Z_5=Z_4+Z_2$, where $Z_4$ and $Z_2$ are stochastic independent with each other, then the characteristic function of $Z_5$ conditioned on $X_1=\widetilde{\msf{x}}$ is expressed by {\small{\begin{equation}\label{c2} \varphi_{Z_{5}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)=\varphi_{Z_{4}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right), \end{equation}}}where $\varphi_{Z_{5}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$ and $\varphi_{Z_{4}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$ denote the characteristic functions of $Z_4$ and $Z_2$ conditioned on $X_1=\widetilde{\msf{x}}$, respectively. Since {\small{$f_{Z_{3}\left|\widetilde{X}\right.}\left(\mathsf{z}_{3}\left|\widetilde{\msf{x}}\right.\right)=f_{Z_{5}\left|\widetilde{X}\right.}\left(\mathsf{z}_{5}\left|\widetilde{\msf{x}}\right.\right)$}}, we have {\small{\begin{equation}\label{c3} \varphi_{Z_{3}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)=\varphi_{Z_{5}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right) \end{equation}}}Substituting (\ref{c1}) and (\ref{c2}) into (\ref{c1}), we get {\small{\begin{equation}\label{c4} \varphi_{Z_{4}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)=\varphi_{Z_{1}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right). \end{equation}}}Since {\small{$\varphi_{Z_{2}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)$}}is characteristic function which always attains strictly non-zero value across $t\in\left(-\infty,+\infty\right)$, then we have {\small{\begin{equation}\label{c5} \varphi_{Z_{4}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right)=\varphi_{Z_{1}\left|\widetilde{X}\right.}\left(t\left|\widetilde{\msf{x}}\right.\right). \end{equation}}}From the knowledge that pdf can be uniquely determined by characteristic function, (\ref{c5}) indicates {\small{\begin{equation}\label{c6} f_{Z_{1}\left|\widetilde{X}\right.}\left({z}_{1}\left|\widetilde{\msf{x}}\right.\right)=f_{Z_{4}\left|\widetilde{X}\right.}\left({z}_{4}\left|\widetilde{\msf{x}}\right.\right). \end{equation}}} \end{IEEEproof}Let us back to the proof of Proposition 1. Revisiting $Y =h_2V+N_s$, based on Lemma \ref{lemp1}, if and only if the relay is absolutely reliable, i.e., $U=V$, we can get {\small{$f_{U\left|X\right.}\left(u\left|{x}\right.\right)=f_{V\left|X\right.}\left(v\left|{x}\right.\right)$}}. Since $h_2$ is a nonzero constant, we can easily get that if and only if $U=V$, {\small{$f_{h_2U\left|X\right.}\left(h_2u\left|\mathsf{x}\right.\right)=f_{h_2V\left|X\right.}\left(h_2v\left|{x}\right.\right)$}} holds true. Jointly consider that Lemma \ref{lemp2} indicates if and only if {\small{$f_{h_2U\left|X\right.}\left(h_2u\left|{x}\right.\right)=f_{h_2V\left|X\right.}\left(h_2v\left|{x}\right.\right)$}}, there exists {\small{$f_{h_2U+N_s\left|X\right.}\left(y\left|{x}\right.\right)=f_{h_2V+N_s\left|X\right.}\left(y\left|{x}\right.\right)$}}. We finally get that if and only if $U=V$, {\small{$f_{h_2U+N_s\left|X\right.}\left(y\left|{x}\right.\right)=f_{h_2V+N_s\left|X\right.}\left(y\left|{x}\right.\right)$}} holds true. Hence, the proposition 1 is proved. \section{Necessity proof of Theorem 1} \begin{IEEEproof} Based on Definition 2, for manipulable observation channel, there exists \begin{equation}\label{necc_con} \int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)\Psi\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(y\left|v\right.\right)dudv=\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(y\left|u\right.\right)du \end{equation}where $\ensuremath{\Psi\left(v\left|u\right.\right)}\neq\Phi\left(v-u\right)$. Then, we consider the following two cases. \begin{enumerate} \item In case I, the relay reliably forwards symbols according to $U=V$, the destination observes $Y^n$ from the relay, and observes $X^n$ from the source. \item In case II, the relay conducts i.i.d. attack according to $f_{V\left|U\right.}\left(v\left|u\right.\right)=\Psi\left(v\left|u\right.\right)$. For easy description, we use $Y'^n$ and $X'^n$ to denote the destination's observation from the relay and from the source, respectively. \end{enumerate} Obviously, in case I, the relay is reliable. Under the condition that case I occurs, decision statistics $D^n$ are constructed upon on $\left\{ \ensuremath{Y^{n}},X^{n}\right\}$. In case II, the relay is malicious. Under the condition that case II occurs, decision statistics $D^n$ are constructed upon on $\left\{ \ensuremath{Y'^{n}},X'^{n}\right\}$. According to (\ref{necc_con}), it is not hard to check that $\left\{ \ensuremath{Y'^{n}},X'^{n}\right\}$ and $\left\{ \ensuremath{Y^{n}},X^{n}\right\} $ follow the same distribution. Then, any decision statistics $D^n$ constructed upon on $\left\{ \ensuremath{Y'^{n}},X'^{n}\right\}$ and $\left\{ \ensuremath{Y^{n}},X^{n}\right\} $ must follow the same distribution. Hence, if there exists $D^n$ satisfies the second property of Theorem 1, $\lim_{n\rightarrow\infty}\Pr\Big( D^{n}> \mu' (n',\delta) ~\Big| \text{case I} \Big) \leq \epsilon$, there must have $\lim_{n\rightarrow\infty}\Pr\Big( D^{n}> \mu' (n',\delta) ~\Big| \text{case II} \Big) \leq \epsilon$. It indicates the two properties of Theorem 1 cannot be satisfied simultaneously. \end{IEEEproof} \section{Sufficiency Proof of Theorem~\ref{thm:main2}} \subsection{Preparations} For easy description of our proof, we first define some functions and values as follows. \begin{equation} \triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(v\left|\widetilde{\msf{x}}\right.\right)=\begin{cases} \begin{array}{cc} \frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}, & N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)\neq0,\, v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)\\ 0, & otherwise \end{array}\end{cases} \end{equation} \begin{equation} F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)=\begin{cases} \begin{array}{cc} \frac{\sum_{i=1}^{n}1_{i}\left(Y_{i}<t\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}, & N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)\neq0,\\ 0, & otherwise \end{array}\end{cases} \end{equation} \begin{equation} F_{Y\left|V\right.}\left(t\left|v\right.\right)=\int_{-\infty}^{t}f_{Y\left|V\right.}\left(y\left|v\right.\right)dy \end{equation} For $k=1,2,\ldots,n_v$, $\overline{\mathsf{v}}_{k}$ denotes generic value belonging to $\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)$. In order to prove one convergence property given later, we also define {\small{\begin{align} &\nonumber\triangle F_{i,i',j,j'}=P_{\widetilde{X}_{i},\widetilde{X}_{i'}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}},\,\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} -P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)P_{\widetilde{X}_{i'}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\}\\\nonumber &-P_{\widetilde{X}_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)+P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right) \end{align}}}where $i\neq i'$, $j,j'=1,2,\ldots n'$, $i,i'=1,2,\ldots n$. Then, we have the following lemma. \begin{lemma}\label{lem1} If we choose $\alpha_{1}=-\beta_{1}$, and $\beta_{1}=\sqrt{n'}$, then upon this setup, there also exist a upper bound for $F_{i,i'j,j'}$ across $j,j'=2,\ldots n'-1$, $i,i'=1,2,3,\ldots n$, $i\neq i'$. This upper bound only depends on $n'$ rather than $n$. Hence, we denote the upper bound as $\triangle F_{max}\left(n'\right)$. $\triangle F_{max}\left(n'\right)$ has property that \begin{equation} n'^{k}\triangle F_{max}\left(n'\right)\rightarrow0 \end{equation}where $k$ is strictly less than $\frac{1}{2}$, i.e., $k<\frac{1}{2}$. \end{lemma} \begin{IEEEproof} To bound $\triangle F_{i,i'j,j'}$, we have \begin{equation} P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}P_{\widetilde{X}\left|{U}\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)f_{U}\left(u\right)du}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}f_{U}\left(u\right)du} \end{equation}which indicates \begin{equation}\label{bound1} \underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\leq P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)\leq\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right). \end{equation}On the other hand, since {\small{\begin{align*} &P_{\widetilde{X}_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\}=\\ &\frac{\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{v'\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}\int_{u'\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j'}\right)}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)f_{U_{i},U_{i'}\left|V_{i},V_{i'}\right.}\left(u,u'\left|v,\, v'\right.\right)f_{V_{i},V_{i'}}\left(v_{i},\, v_{i'}\right)dudu'dvdv'}{\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{v'\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k'}\right)}\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}\int_{u'\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j'}\right)}f_{U_{i},U_{i'}\left|V_{i},V_{i'}\right.}\left(u,u'\left|v,\, v'\right.\right)f_{V_{i},V_{i'}}\left(v_{i},\, v_{i'}\right)dudu'dvdv'} \end{align*}}}and {\small{\begin{align*} &P_{\widetilde{X}_{i},\widetilde{X}_{i'}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}},\,\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} =\\ &\frac{\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{v'\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}\int_{u'\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j'}\right)}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)f_{U_{i},U_{i'}\left|V_{i},V_{i'}\right.}\left(u,u'\left|v,\, v'\right.\right)f_{V_{i},V_{i'}}\left(v_{i},\, v_{i'}\right)dudu'dvdv'}{\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k}\right)}\int_{v'\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{k'}\right)}\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}\int_{u'\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j'}\right)}f_{U_{i},U_{i'}\left|V_{i},V_{i'}\right.}\left(u,u'\left|v,\, v'\right.\right)f_{V_{i},V_{i'}}\left(v_{i},\, v_{i'}\right)dudu'dvdv'}, \end{align*}}} we have \begin{equation}\label{bound21} \underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\leq P_{\widetilde{X}_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} \leq\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right) \end{equation}and {\small{\begin{align}\label{bound22} &P_{\widetilde{X}_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} \underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\leq P_{\widetilde{X}_{i},\widetilde{X}_{i'}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}},\,\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\}\\\nonumber & \leq P_{\widetilde{X}_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}\right.}\left\{ \widetilde{\mathsf{x}}\left|\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j'}\right.\right\} \underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right) \end{align}}} Jointly considering (\ref{bound1}), (\ref{bound21}) and (\ref{bound22}), $\triangle F_{i,i',j,j'}$ could be bound as {\small{\begin{equation} \nonumber\abs{\triangle F_{i,i',j,j'}}\leq\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}2P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)-\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}2P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\label{reshape}. \end{equation}}} Then, we have \begin{equation}\label{Fmax} \underset{j,j'=2,\ldots n'-1,i,i'=1,2,\ldots n,i\neq i'}{\max}\triangle F_{i,i'j,j'}<\underset{j=2,3,\ldots n'-1}{\max}2\left(\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)-\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\right)\triangleq\triangle F_{max}\left(n'\right) \end{equation}Then, we proceed to focus on the property of $F_{max}\left(n'\right)$. Revisiting the system model, for $j=2,3,\ldots,n'-1$, we have {\small{\begin{equation}\ \underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)-\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\leq 2P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right){P'}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right)\frac{2\sqrt{n'}}{n'-2} \end{equation}}}where $u'_{j}\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)$, ${P'}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)$ is derived function of ${P}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)$. The maximum of ${P'}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u\right.\right)$ in $\left(-\infty,+\infty\right)$ is bounded. \begin{align}\label{limitation1} &\nonumber\lim_{n'\rightarrow\infty}n'^{k}\left(\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\max}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)-\underset{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}{\min}P_{\widetilde{X}\left|U\right.}^{2}\left(\widetilde{\mathsf{x}}\left|u\right.\right)\right)\leq\lim_{n'\rightarrow\infty}n'^{k}2P_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right){P'}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right)\frac{2\sqrt{n'}}{n'-2}\\& =0 \end{align}where the last equality follows the fact that the maximum of ${P'}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right)$ and ${P}_{\widetilde{X}\left|U\right.}\left(\widetilde{\mathsf{x}}\left|u'_{j}\right.\right)$ in $\left(-\infty,+\infty\right)$ is bounded, and $k$ is strictly less than 1/2. Finally, based on the definition of $F_{max}\left(n'\right)$ in (\ref{Fmax}), the statement of this lemma is immediate. \end{IEEEproof} Similar to the definition of $\triangle F_{i,i',j,j'}$ and Lemma \ref{lem1}, we define {\small{\begin{align} \nonumber G_{i,i',k,k'}&=P_{Y_{i}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{X}_{i},\widetilde{X}_{i'}\right.}\left(Y_{i}<t\left|\widetilde{\mathsf{v}}_{k},\widetilde{\mathsf{v}}_{k'},\widetilde{\mathsf{x}},\widetilde{\mathsf{x}}\right.\right)\left(P_{Y_{i'}\left|Y_{i},\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{X}_{i},\widetilde{X}_{i'}\right.}\left(Y_{i'}<t\left|Y_{i}<t,\widetilde{\mathsf{v}}_{k},\widetilde{\mathsf{v}}_{k'},\widetilde{\mathsf{x}},\widetilde{\mathsf{x}}\right.\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k'}\right.\right)\right)\\ &-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\left(P_{Y_{i'}\left|\widetilde{V}_{i},\widetilde{V}_{i'},\widetilde{X}_{i},\widetilde{X}_{i'}\right.}\left(Y_{i'}<t\left|\widetilde{\mathsf{v}}_{k},\widetilde{\mathsf{v}}_{k'},\widetilde{\mathsf{x}},\widetilde{\mathsf{x}}\right.\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k'}\right.\right)\right) \end{align}}}where $i\neq i'$, $k,k'=2,3,\ldots n_v-1$, $i,i'=1,2,\ldots n$. Then, we have the following lemma. \begin{lemma}\label{lemA1} If we choose $\alpha_{2}=-\beta_{2}$, and $\beta_{2}=\sqrt{n_v}$, then upon this setup, there also exist a upper bound for $G_{i,i',k,k'}$ across $i\neq i'$, $k,k'=2,3,\ldots n_v-1$, $i,i'=1,2,\ldots n$. This upper bound only depends on $n_v$ rather than $n_v$. Hence, we denote the upper bound as $\triangle G_{max}\left(n_v\right)$. $\triangle G_{max}\left(n_v\right)$ has property that \begin{equation} n_{v}^{\tau}\triangle G_{max}\left(n_v\right)\rightarrow0 \end{equation}where $k$ is strictly less than $\frac{1}{2}$, i.e., $\tau<\frac{1}{2}$. \end{lemma} \begin{IEEEproof} Following the proof method employed by Lemma \ref{lem1}, the assertion is direct. More details are omitted due to space limitation. \end{IEEEproof} \begin{lemma}\label{lem2} For arbitrary $\widetilde{\mathsf{v}}_{k}$, sufficiently small $\mu$ and $\varepsilon\leq\frac{\mu}{2n'}$, {\small{\begin{align} &\nonumber \Pr\left\{ \left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|u\right.\right)du\right|>\mu\right\} \\\label{final_upper} &<\frac{4}{\mu^{2}}\left(\frac{n'^{2}}{n}+\frac{1}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\widetilde{\mathsf{x}}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin \mathcal{A}_{\varepsilon}\right\} \end{align}}} where{\small{\begin{equation} \mathcal{A}_{\varepsilon}=\left\{ \left({\widetilde{x}}^{n},\widetilde{u}^{n}\right):\:\left|P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}\left|\widetilde{\mathsf{x}}\right.\right)-\frac{N\left(\widetilde{\mathsf{u}}\left|\widetilde{U}^{n}\right.\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\mathsf{x}}\left|\widetilde{\mathsf{u}}\right.\right)}{N\left(\widetilde{\mathsf{x}}\left|\widetilde{X}^{n}\right.\right)}\right|<\varepsilon,\;\left|P_{\widetilde{X}}\left(\widetilde{\mathsf{x}}\right)-\frac{N\left(\widetilde{\mathsf{x}}\left|\widetilde{X}^{n}\right.\right)}{n}\right|<\varepsilon\right\}. \end{equation}}} \end{lemma} \begin{IEEEproof} Notice that {\small{\begin{align}\label{upper} &\Pr\left\{ \left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|u\right.\right)du\right|>\mu\right\} \\\nonumber &<\Pr\left\{ \left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|u\right.\right)du\right|>\mu\left| \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in \mathcal{A}_{\varepsilon}\right.\right\} +\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin \mathcal{A}_{\varepsilon}\right\} \end{align}}} Firstly notice that after $n'$, $\alpha_{1}$ and $\beta_{1}$ are chosen and fixed properly, \begin{equation} \Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin \mathcal{A}_{\varepsilon}\right\} \rightarrow0 \end{equation}as $n$ approaches to infinity. Then, focusing on the first item in the right side of (\ref{upper}), $\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in \mathcal{A}_{\varepsilon}$ indicates $N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)>0$ for all $j=1,2,\ldots, n'$. Hence, $\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)} $ is well-defined for all $j=1,2,\ldots, n'$. Under the condition {\small{$ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in \mathcal{A}_{\varepsilon}$}}, we have {\small{\begin{align}\label{upper1} &\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|u\right.\right)du\right|\\\nonumber &=\left|\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)} -\sum_{j=1}^{n'}\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}\int_{\mathcal{B}\left(\widetilde{\mathsf{u}}_{j}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)du\right|\\\nonumber &\text{=}\left|\frac{\sum_{j=1}^{n'}\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}-\sum_{j=1}^{n'}\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\right| \end{align}}}Substituting (\ref{upper1}) into the first item in the right side of (\ref{upper}), it becomes {\small{\begin{align}\label{upper2} &\Pr\left\{ \left|\frac{\sum_{j=1}^{n'}\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}-\sum_{j=1}^{n'}\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\right|>\mu\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right.\right\} \\\nonumber &<\Pr\left\{ \left|\sum_{j=1}^{n'}\underbrace{\left(\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{n\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)}-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{n\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)}\right)}_{H_{j}}\right|>\frac{\mu}{2}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right.\right\} \\\nonumber &+\sum_{j=1}^{n'}\Pr\left\{ \left|\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}\right|>\frac{\mu}{2n'}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right.\right\} \end{align}}}The second item in the right of (\ref{upper2}) can be further bound as {\small{\begin{align}\label{upper3} &\Pr\left\{ \left|\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)}{N\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{U}^{n}\right.\right)}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}\right|>\frac{\mu}{2n'}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in \mathcal{A}_{\varepsilon}\right.\right\} \\\nonumber &\leq\Pr\left\{ \left|P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)-\frac{N\left(\widetilde{\mathsf{u}}\left|\widetilde{U}^{n}\right.\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{N\left(\widetilde{\msf{x}}\left|\widetilde{X}^{n}\right.\right)}\right|>\frac{\mu}{2n'}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in \mathcal{A}_{\varepsilon}\right.\right\} =0 \end{align}}}where the last equality follows the definition of $\mathcal{A}_{\varepsilon}$ and set of $\varepsilon\leq\frac{\mu}{2n'}$. From (\ref{upper3}), the second item in the right of (\ref{upper2}) equals to 0. Then, we proceed to bound the first item in the right of (\ref{upper2}) as {\small{\begin{equation}\label{upper4} \Pr\left\{ \left|\sum_{j=1}^{n'}H_{j}\right|>\frac{\mu}{2}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right.\right\} <\frac{4}{\mu^{2}}E_{\mathcal{A}_{\varepsilon}}\left|\sum_{j=1}^{n'}H_{j}\right|^{2} =\frac{4}{\mu^{2}}\sum_{j=1}^{n'}\sum_{j'=1}^{n'}E_{\mathcal{A}_{\varepsilon}}\left(H_{j}H_{j'}\right) \end{equation}}}which follows the Chebyshev theorem. $E_{\mathcal{A}_{\varepsilon}}\left(\cdot\right)$ indicates the expectation of its input conditioned on $\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}$. {\small{\begin{align} &\nonumber E_{\mathcal{A}_{\varepsilon}}\left(H_{j}H_{j'}\right)=\\\nonumber &\frac{E_{\mathcal{A}_{\varepsilon}}\left(\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)\left(1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)\right)\right)\left(\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j'}\right)\left(1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\ &\nonumber \leq\frac{\sum_{i=1}^{n}E_{\mathcal{A}_{\varepsilon}}\left\{ 1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)\left(1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j'}\right)\left(1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)\right)\right\} }{n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\ &\nonumber +\frac{E\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k}\right)1_{i'}\left(\widetilde{U}_{i'}=\widetilde{\mathsf{u}}_{j'}\right)\left(1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)\right)\left(1_{i'}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)-P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)\right)}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\\nonumber &\leq\frac{1}{n}+\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}E\left\{ 1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k}\right)1_{i'}\left(\widetilde{U}_{i'}=\widetilde{\mathsf{u}}_{j'}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i'}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)\right\} }{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\\nonumber &-\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}E\left\{ 1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k}\right)1_{i'}\left(\widetilde{U}_{i'}=\widetilde{\mathsf{u}}_{j'}\right)1_{i'}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)\right\} P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\\nonumber &-\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}E\left\{ 1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k}\right)1_{i'}\left(\widetilde{U}_{i'}=\widetilde{\mathsf{u}}_{j'}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)\right\} P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\\nonumber &+\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}E\left\{ 1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{U}_{i}=\widetilde{\mathsf{u}}_{j}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k}\right)1_{i'}\left(\widetilde{U}_{i'}=\widetilde{\mathsf{u}}_{j'}\right)\right\} P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j}\right.\right)P_{\widetilde{X}\left|\widetilde{U}\right.}\left(\widetilde{\msf{x}}\left|\widetilde{\mathsf{u}}_{j'}\right.\right)}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\\\label{upper5} &=\frac{1}{n}+\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}P_{\widetilde{V}_{i}, \widetilde{V}_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}}\left\{ \widetilde{\mathsf{v}}_{k},\, \widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j}\right\} \triangle F_{i,i'j,j'}}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}} \end{align}}}Substituting (\ref{upper5}) into (\ref{upper4}), we have {\small{\begin{align} &\nonumber\Pr\left\{ \left|\sum_{j=1}^{n'}H_{j}\right|>\frac{\mu}{2}\left|\left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right.\right\} <\frac{4}{\mu^{2}}\sum_{j=1}^{n'}\sum_{j'=1}^{n'}\left\{ \frac{1}{n}+\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}P_{V_{i},V_{i'},\widetilde{U}_{i},\widetilde{U}_{i'}}\left\{ \widetilde{\mathsf{v}}_{k},\, \widetilde{\mathsf{v}}_{k},\,\widetilde{\mathsf{u}}_{j},\,\widetilde{\mathsf{u}}_{j}\right\} }{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right\} \\\nonumber &\leq\frac{4}{\mu^{2}}\left(\frac{n'^{2}}{n}+\frac{\sum_{i=1}^{n}\sum_{i=1,i'\neq i}^{n}\sum_{j=1}^{n'}\sum_{j'=1}^{n'}P_{\widetilde{U}}\left\{ \widetilde{\mathsf{u}}_{j}\right\} P_{\widetilde{U}}\left\{ \widetilde{\mathsf{u}}_{j'}\right\} }{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} n^{2}\left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)\\\label{upper6} &\leq \frac{4}{\mu^{2}}\left(\frac{n'^{2}}{n}+\frac{1}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right) \end{align}}}From (\ref{upper6}) (\ref{upper3}) (\ref{upper2}) and (\ref{upper}), we have \begin{align} &\nonumber \Pr\left\{ \left|\triangle F_{V^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\msf{x}}\right.\right)\triangle F^{(n')}_{V^{n}\left|\widetilde{U}^{n}\right.}\left(\widetilde{\mathsf{v}}_{k}\left|u\right.\right)du\right|>\mu\right\} \\\label{final_upper} &<\frac{4}{\mu^{2}}\left(\frac{n'^{2}}{n}+\frac{1}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin \mathcal{A}_{\varepsilon}\right\} \end{align}The proof is finished. \end{IEEEproof} Upon the aforementioned lemmas, the following assertion convergence property can be proved. \begin{lemma}\label{Alem2} For arbitrary $t$, sufficiently small $\mu$ and $\varepsilon\leq\frac{\mu}{4n'n_v}$, {\small{\begin{align} \Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu\right\} \end{align}}} \end{lemma} \begin{IEEEproof} Notice that {\small{\begin{align}\label{fupper1} &\Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu\right\}< \\\nonumber &\hspace{-20pt} \Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)-\sum_{k=1}^{n_{v}}\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\frac{\mu}{2}\right\} +\Pr\left\{ \sum_{k=1}^{n_{v}}\left|\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)-\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)\right|>\frac{\mu}{2}\right\}. \end{align}}} According to Lemma \ref{lem2}, the second item in the right side of (\ref{fupper1}) can be bound as {\small{\begin{align}\label{fupper2} \nonumber&\Pr\left\{ \sum_{k=1}^{n_{v}}\left|\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)-\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)\right|>\frac{\mu}{2}\right\}< \\ &\frac{16}{\mu^{2}}\left(\frac{n'^{2}n_{v}^{2}}{n}+\frac{n_{v}^{2}}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin T_{\left[\widetilde{X},\widetilde{U}\right]_{\varepsilon}}^{n}\right\}. \end{align}}}Then, we just need to focus on the first item in the right side of (\ref{fupper1}). Following the similar steps employed in the proof of (\ref{lem2}), we have {\small{\begin{align}\label{fupper3} &\nonumber \Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)-\sum_{k=1}^{n_{v}}\triangle F_{\widetilde{V}^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\msf{x}}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\frac{\mu}{2}\right\}<\\ &\hspace{-20pt}\Pr\left\{ \left|\sum_{k=1}^{n_{v}}{\left(\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right)}\right|>\frac{\mu}{2}\left|\widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right.\right\} +\Pr\left\{ \widetilde{X}^{n}\notin T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\}, \end{align}}}where {\small{$\Pr\left\{ \widetilde{X}^{n}\notin T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} \rightarrow0$}} as $n$ approaches to infinity. Then, we focus on bounding the first item in the right side of (\ref{fupper3}). Following the Chebyshev theorem, we attain {\small{\begin{align}\label{fupper4} &\nonumber \Pr\left\{ \left|\sum_{k=1}^{n_{v}}\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\frac{\mu}{2}\left|\widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right.\right\}< \\\nonumber &\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\Pr\left\{ \left|\sum_{k=1}^{n_{v}}\underbrace{\left(\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)}-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)}F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right)}_{H_{k}}\right|>\frac{\mu}{2}\right\} \\ &\leq\frac{4}{\mu^{2}}\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\sum_{k=1}^{n_{v}}\sum_{k'=1}^{n_{v}}E\left(H_{k}H_{k'}\right). \end{align}}} {\small{\begin{align}\label{fupper5} &\nonumber E\left(H_{k}H_{k'}\right)=\frac{E\left(\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)\left(1_{i}\left(Y_{i}<t\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right)\right)\left(\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)\left(1_{i}\left(Y_{i}<t\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k'}\right.\right)\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber <\frac{1}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\\&\nonumber \hspace{30pt}\frac{E\left(\sum_{i=1}^{n}\sum_{i\text{'}=1,i\neq i}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)\left(1_{i}\left(Y_{i}<t\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k'}\right)1_{i}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)\left(1_{i'}\left(Y_{i'}<t\right)-F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber <\frac{5}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{\sum_{i=2}^{n-1}\sum_{i\text{'}=2,i\neq i}^{n-1}E\left(1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k'}\right)1_{i}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)1_{i'}\left(Y_{i'}<t\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber -\frac{\sum_{i=2}^{n-1}\sum_{i\text{'}=2,i\neq i}^{n-1}E\left(1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k'}\right)1_{i}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k'}\right.\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber -\frac{\sum_{i=2}^{n-1}\sum_{i\text{'}=2,i\neq i}^{n-1}E\left(1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k'}\right)1_{i}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)1_{i'}\left(Y_{i'}<t\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber +\frac{\sum_{i=2}^{n-1}\sum_{i\text{'}=2,i\neq i}^{n-1}E\left(1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i'}\left(\widetilde{V}_{i'}=\widetilde{\mathsf{v}}_{k'}\right)1_{i}\left(\widetilde{X}_{i'}=\widetilde{\msf{x}}\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k'}\right.\right)\right)}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\&\nonumber <\frac{5}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{\sum_{i=2}^{n-1}\sum_{i\text{'}=2,i\neq i}^{n-1}P_{\widetilde{V}_{i},\widetilde{V}_{i'},X_{1,i},X_{1,i'}}\left(\widetilde{\mathsf{v}}_{k},\widetilde{\mathsf{v}}_{k'},\widetilde{\msf{x}},\widetilde{\msf{x}}\right)\triangle G_{max}}{n^{2}\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\\& <\frac{5}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{P_{\widetilde{V}_{i},\widetilde{V}_{i'},X_{1,i},X_{1,i'}}\left(\widetilde{\mathsf{v}}_{k},\widetilde{\mathsf{v}}_{k'},\widetilde{\msf{x}},\widetilde{\msf{x}}\right)\triangle G_{max}}{\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}} \end{align}}}Substituting (\ref{fupper5}) into (\ref{fupper4}), we get {\small{\begin{align}\label{fupper6} &\nonumber \Pr\left\{ \left|\sum_{k=1}^{n_{v}}\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)1_{i}\left(Y_{i}<t\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}-\frac{\sum_{i=1}^{n}1_{i}\left(\widetilde{V}_{i}=\widetilde{\mathsf{v}}_{k}\right)1_{i}\left(\widetilde{X}_{i}=\widetilde{\msf{x}}\right)}{N\left(\widetilde{\msf{x}}\left|X^{n}\right.\right)}F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\frac{\mu}{2}\left|\widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right.\right\} \\ &<\frac{4}{\mu^{2}}\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\left(\frac{5n_{v}^{2}}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{\triangle G_{max}}{\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\right) \end{align}}}From (\ref{fupper6}), (\ref{fupper1}), (\ref{fupper2}), and (\ref{fupper3}), we finally obtain {\small{\begin{align*} &\Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\msf{x}}\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu\right\}\\& <\frac{4}{\mu^{2}}\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\left(\frac{5n_{v}^{2}}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{\triangle G_{max}}{\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\right)+\Pr\left\{ \widetilde{X}^{n}\notin T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\}\\& +\frac{16}{\mu^{2}}\left(\frac{n'^{2}n_{v}^{2}}{n}+\frac{n_{v}^{2}}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin T_{\left[\widetilde{X},\widetilde{U}\right]_{\varepsilon}}^{n}\right\} \end{align*}}} The proof is finished. \end{IEEEproof} Upon the convergence property, the following lemma is immediate. \begin{lemma}\label{lem3} For sequence $t_{1}, t_{2}, \ldots, t_{n_y-1}$, upon setup that $\beta_{3}=-\alpha_{3}=\sqrt{n_{y}}$, $n_{y}^{2}=\sqrt{n_{v}}$, and $n_{v}^{2}=\sqrt{n'}$, we have \begin{enumerate} \item Fix $\mu$ to arbitrary small value, there has {\small{\begin{equation} \lim_{n\rightarrow\infty,n'\rightarrow\infty}\Pr\left\{ \frac{\beta_{3}-\alpha_{3}}{n_{y}-2}\frac{\beta_{4}-\alpha_{4}}{n_{x}-2}\sum_{i=1}^{n_{x}-1}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_{m}\left|\widetilde{\msf{x}}_i\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}_i\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t_m\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu\right\} =0. \end{equation}}} \item Fix $n'$ to arbitrary large value, and $\epsilon$ to arbitrary small value, there has {\small{\begin{equation} \Pr\left\{ \frac{\beta_{3}-\alpha_{3}}{n_{y}-2}\frac{\beta_{4}-\alpha_{4}}{n_{x}-2}\sum_{i=1}^{n_{x}-1}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_m\left|\widetilde{\msf{x}}_{i}\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}_i\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t_m\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu_{n'}\right\} \leq\epsilon \end{equation}}}where $n$ approaches to infinity, $\lim_{n'\rightarrow\infty}\mu_{n'}=0$. \end{enumerate} \end{lemma} \begin{IEEEproof} For arbitrary small $\mu$, we have {\small{\begin{align}\label{noname} &\Pr\left\{ \frac{\beta_{3}-\alpha_{3}}{n_{y}-2}\frac{\beta_{4}-\alpha_{4}}{n_{x}-2}\sum_{i=1}^{n_{x}-1}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_{m}\left|\widetilde{\msf{x}}_i\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}_i\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t_m\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\mu\right\} \\ &\nonumber\leq\sum_{i=1}^{n_{x}-1}\sum_{m=1}^{n_y-1}\Pr\left\{ \left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_{m}\left|\widetilde{\msf{x}}_{i}\right.\right)-\sum_{k=1}^{n_{v}}\sum_{j=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{j}\left|\widetilde{\msf{x}}_{i}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{k}\left|\widetilde{\mathsf{u}}_{j}\right.\right)F_{Y\left|V\right.}\left(t\left|\overline{\mathsf{v}}_{k}\right.\right)\right|>\frac{\mu(n_y-2)(n_x-2)}{(\beta_{3}-\alpha_{3})(\beta_{4}-\alpha_{4})(n_y-1)(n_x-1)}\right\} \\ &\nonumber< \frac{4(n_{y}-1)^{2}(n_{x}-1)^{2}}{\mu^{2}(n_{y}-2)^{2}(n_{x}-2)^{2}}\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\left(\frac{5n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{y}n_{x}}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{n_{y}n_{x}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}\triangle G_{max}}{\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\right)+n_{x}n_{y}\Pr\left\{ \widetilde{X}^{n}\notin T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} \\ &\hspace{-40pt}\nonumber +\frac{16(n_{y}-1)^{2}(n_{x}-1)^{2}}{\mu^{2}(n_{y}-2)^{2}(n_{x}-2)^{2}}\left(\frac{n'^{2}n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}}{n}+\frac{n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+n_{x}n_{y}\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin T_{\left[\widetilde{X},\widetilde{U}\right]_{\varepsilon}}^{n}\right\} \end{align}}}where the last inequality follows Lemma \ref{Alem2}. Upon the setup that $\beta_{3}=-\alpha_{3}=\sqrt{n_{y}}$, $n_{y}^{2}=\sqrt{n_{v}}$, and $n_{v}^{2}=\sqrt{n'}$, we have $$n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}<{n'}^{1/2},$$ Then, $n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}\triangle F_{max}\left(n'\right)\rightarrow0$ as $n'\rightarrow\infty$ according to Lemma \ref{lem1}, and $$n_{y}n_{x}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}<{n_v}^{1/2}$$ $n_{y}n_{x}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}\triangle G_{max}\rightarrow0$ as $n'\rightarrow\infty$ according to Lemma \ref{lemA1}. With these results, the upper bound of (\ref{noname}) approaches to 0, as $n'\rightarrow\infty$, $n\rightarrow\infty$. Hence, the first assertion is proved. Furthermore, again relying on (\ref{noname}), let us set {\small{\begin{align*} \hspace{-100pt}&\epsilon= \frac{4(n_{y}-1)^{2}(n_{x}-1)^{2}}{\mu_{n'}^{2}(n_{y}-2)^{2}(n_{x}-2)^{2}}\frac{1}{\Pr\left\{ \widetilde{X}^{n}\in T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} }\left(\frac{5n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{y}n_{x}}{n\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}+\frac{n_{y}n_{x}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}\triangle G_{max}}{\left(P_{\widetilde{X}}\left(\widetilde{\msf{x}}\right)-\varepsilon\right)^{2}}\right)+n_{x}n_{y}\Pr\left\{ \widetilde{X}^{n}\notin T_{\left[\widetilde{X}\right]_{\varepsilon}}^{n}\right\} \\ &+\frac{16(n_{y}-1)^{2}(n_{x}-1)^{2}}{\mu_{n'}^{2}(n_{y}-2)^{2}(n_{x}-2)^{2}}\left(\frac{n'^{2}n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}}{n}+\frac{n_{v}^{2}(\beta_{3}-\alpha_{3})^{2}(\beta_{4}-\alpha_{4})^{2}n_{x}n_{y}}{\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\in\mathcal{A}_{\varepsilon}\right\} \left(P_{\widetilde{X}}\left(\mathsf{x}\right)-\varepsilon\right)^{2}}\triangle F_{max}\left(n'\right)\right)+n_{x}n_{y}\Pr\left\{ \left(\widetilde{X}^{n},\,\widetilde{U}^{n}\right)\notin T_{\left[\widetilde{X},\widetilde{U}\right]_{\varepsilon}}^{n}\right\} \end{align*}}}As $\epsilon$ is fixed, and $n$ approaches to infinity, it is readily available to get $\lim_{n'\rightarrow\infty}\mu_{n'}=0$. The second statement can be proved. \end{IEEEproof} \subsection{Sufficiency Proof} Let us go back to the proof of theorem 1. With the aforementioned lemmas, we will show the decision statistic {\small{$D^{n}=\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{{n_{y}-1}}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t_{m}\left|\widetilde{\mathsf{x}}_{k}\right.\right)-\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_{k}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du\right|$}} simultaneously satisfies the properties stated by Theorem 1. Upon $n'$, we define function {\small{\begin{align} &\nonumber M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)=\frac{\beta_{4}-\alpha_{4}}{{n_{x}-2}}\frac{\beta_{3}-\alpha_{3}}{{n_{y}-2}}\\&\nonumber\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{{n_{y}-1}}\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|^{2} \end{align}}}where $W^{\left(n'\right)}$ is a matrix variable $\left[W^{\left(n'\right)}\right]_{i,j,k}=w_{i,j,k}$, $i=1,2,\ldots,n'$, $j=1,2,\ldots,n_v$, $k=1,2,\ldots,n_x$ and \begin{equation} F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)du}. \end{equation} According to the definition of $P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)$ and $F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)du}$, $M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)=0$ has one solution in the point that $W_{0}^{\left(n'\right)}$ defined as {\small{$$\left[W_{0}^{\left(n'\right)}\right]_{i,j,k}=\begin{cases} \begin{array}{cc} 1, & \mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)\subseteq\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)\\ 0, & otherwise \end{array}\end{cases} $$}}$i=1,\ldots n', j=1,\ldots n'-1, k=1,2,\ldots,n_x$ in the domain $\mathcal{D}^{(n')}=\big\{ W^{(n')}:\,0\leq w_{i,j,k}\leq1,\sum_{j=1}^{n_{v}}w_{i,j,k}=1,j=1,2,\ldots n_{v},\, i=1,\ldots n', k=1,2,\ldots,n_x\big\}$. We also define $\mathcal{D}_{s}^{(n')}$ as {\small{$\mathcal{D}_{s}^{(n')}=\big\{ W^{(n')}:\,\left|W^{(n')}-W_{0}^{(n')}\right|\geq\delta,\, W^{(n')}\in\mathcal{D}^{(n')}\big\}$}}, and the infimum of $M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)$ over ${D}_{s}^{(n')}$ is denoted as $\lambda^{(n')}\left(\delta\right)$. \begin{lemma}\label{lem5} If $\lambda^{(n')}\left(\delta\right)$ is strictly positive, then $M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)=0$ has single solution in the point $W_{0}^{\left(n'\right)}$. Moreover, $\lambda^{(n')}\left(\delta\right)\rightarrow0,\delta\rightarrow0$. \end{lemma} \begin{IEEEproof} Using the observation that $M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)$ is a convex function, the proof of this lemma follows our previous work. \end{IEEEproof} \begin{lemma}\label{lem6} If the wireless channel is non-manipulable, then for arbitrary small $\delta$, there exist sufficient large $n_0$, such that for any $n'>n_{0}$, $\lambda^{(n')}\left(\delta\right)\geq\mu_{n'}$. \end{lemma} \begin{IEEEproof} Notice that for arbitrary $W_{f}^{(n')}\in\mathcal{D}^{(n')}$, there exist a pdf function $f\left(t\left|u\right.\right)$ which satisfies {\small{\begin{equation} \left[W_{f}^{(n')}\right]_{i,j,k}=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f\left(v\left|u\right.\right)f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)dudv}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)du}. \end{equation}}}Then, according to the condition that $\frac{\triangle_{n'_{k}}}{\triangle_{n'_{k-1}}}=k$ and $\frac{\triangle_{n'_{k}}}{\triangle_{n'_{1}}}=s_{k}$, fixing $f\left(t\left|u\right.\right)$, $\left|W_{f}^{(n')}-W_{0}^{(n')}\right|\geq\delta$ implies $\left|W_{f}^{(n'_{k})}-W_{0}^{(n'_{k})}\right|\geq\delta$ for $n'_{k}>n'$. For the sake of proof, we define a function set {\small{\begin{equation} \mathcal{F}=\left\{ f\left(v\left|u\right.\right):\lim_{n'\rightarrow\infty}\sum_{k=1}^{n_{x}}\sum_{j=1}^{n_{v}}\sum_{i=1}^{{n'}}\left|\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f\left(v\left|u\right.\right)f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)dudv}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)du}-\left[W_{0}^{\left(n'\right)}\right]_{i.j,k}\right|\geq\delta\right\}. \end{equation}}}Then, we define $\mathcal{\widetilde{D}}_{s}^{(n')}$ as {\small{\begin{equation} \mathcal{\widetilde{D}}_{s}^{(n')}=\left\{ W^{(n')}:\left[W^{(n')}\right]_{i,j,k}=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f\left(v\left|u\right.\right)f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)dudv}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)du},\, f\left(v\left|u\right.\right)\in\mathcal{F}\right\} \end{equation}}}Obviously, $\mathcal{D}_{s}^{(n')}\subseteq\mathcal{\widetilde{D}}_{s}^{(n')}$, hence, we get $\lambda^{(n')}\left(\delta\right)\geq\widetilde{\lambda}^{(n')}\left(\delta\right)$ where $\widetilde{\lambda}^{(n')}\left(\delta\right)$ is infimum of $M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)$ across $\mathcal{\widetilde{D}}_{s}^{(n')}$. For arbitrary $f\left(v\left|u\right.\right)\in\mathcal{F}$, we define $\mathsf{\widehat{v}}_{m,j,k}^{(n')}$ which satisfies {\small{\begin{equation} F_{Y\left|V\right.}\left(t_{m}\left|\mathsf{\widehat{v}}_{m,j,k}^{(n')}\right.\right)=\frac{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f\left(v\left|u\right.\right)f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)dudv}{\int_{u\in\mathcal{B}\left(\widetilde{\mathsf{u}}_{i}\right)}\int_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}f\left(v\left|u\right.\right)f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)dudv}. \end{equation}}}Then, we have {\small{\begin{align} &\nonumber -\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|^{2}\\ &\nonumber +\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\mathsf{\widehat{v}}_{m,j,k}^{(n')}\right.\right)\right|^{2}=\\\nonumber &\left(2\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\mathsf{\widehat{v}}_{m,j,k}^{(n')}\right.\right)\right)\\&\nonumber \left(\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\mathsf{\widehat{v}}_{m,j,k}^{(n')}\right.\right)\right)\\&\nonumber <2\max_{j=1,2,\ldots,n_v, m=1,\ldots,n_{y}}\left|\max_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)-\min_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)\right| \end{align}}}Then, we get {\small{\begin{align}\label{temp} &\nonumber\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\mathsf{\widehat{v}}_{m,j,k}^{(n')}\right.\right)\right|^{2}\\\nonumber & -2\max_{j=1,2,\ldots,n_v, m=1,\ldots,n_{y}}\left|\max_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)-\min_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)\right| \\& <\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|^{2} \end{align}}}From (\ref{temp}), we have {\small{\begin{equation}\label{temp1} \widehat{M}^{\left(n'\right)}\left(W_f^{\left(n'\right)}\right)\leq M^{\left(n'\right)}\left(W_f^{\left(n'\right)}\right)+\gamma_{n'} \end{equation}}}where {\small{\begin{align} &\nonumber M^{\left(n'\right)}\left(W^{\left(n'\right)}\right)=\frac{\beta_{4}-\alpha_{4}}{{n_{x}-2}}\frac{\beta_{3}-\alpha_{3}}{{n_{y}-2}}\\&\nonumber\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{{n_{y}-1}}\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\right)w_{i,j,k}F_{Y\left|V\right.}\left(t_{m}\left|\widehat{\mathsf{v}}_{m,j,k}^{(n')}\right.\right)\right|^{2} \\ &\gamma_{n'}=\max_{j=1,\ldots,n_{v},m=1,\ldots,n_{y}}4\sqrt{n_{y}}\sqrt{n_{x}}\left|\max_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)-\min_{v\in\mathcal{B}\left(\widetilde{\mathsf{v}}_{m,j}\right)}F_{Y\left|V\right.}\left(t_{m}\left|v\right.\right)\right| \end{align}}}According to the stochastic property of channel model, we have $\lim_{n'\rightarrow\infty}\gamma_{n'}=0$. In order to prove $\widehat{M}^{\left(n'\right)}\left(W_f^{\left(n'\right)}\right)-\gamma_{n'}>\mu_{n'}$, for arbitrary $f\left(v\left|u\right.\right)\in\mathcal{F}$, we assume for arbitrary large $n'_0$, there exist $n'>n'_0$, such that $\widehat{\lambda}^{(n')}\left(\delta\right)-\gamma_{n'}\leq\mu_{n'}$. In other words, there exist a sequence denoted as $\widehat{n}_1< \widehat{n}_2<\ldots, \infty$ by which {\small{\begin{equation} \widehat{M}^{\left(\widehat{n}_{k}\right)}\left(W_{f}^{\left(\widehat{n}_{k}\right)}\right)-\gamma_{\widehat{n}_{k}}\leq\mu_{\widehat{n}_{k}}. \end{equation}}} Then, we have \begin{equation} \lim_{k\rightarrow\infty}\widehat{M}^{\left(\widehat{n}_{k}\right)}\left(W_{f}^{\left(\widehat{n}_{k}\right)}\right)\leq\lim_{k\rightarrow\infty}(\mu_{\widehat{n}_{k}}+\gamma_{\widehat{n}_{k}})=0 \end{equation}From the expressions of $W_{f}^{(n')}$ and $\widehat{M}^{\left(n'\right)}\left(W^{\left(n'\right)}\right)$, we get there is a division manner for $t\in\left(-\infty,+\infty\right)$ characterized by $\widehat{n}_1< \widehat{n}_2<\ldots, \infty$ such that {\small{\begin{align}\label{key1} \nonumber&\lim_{\widehat{n}_{k}\rightarrow\infty}\frac{\beta_{4}-\alpha_{4}}{{n_{x}-2}}\frac{\beta_{3}-\alpha_{3}}{{n_{y}-2}}\\&\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{{n_{y}-2}}\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}^{(\widehat{n}_{k})}\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t_{m}^{(\widehat{n}_{k})}\left|v\right.\right)dudv\right|^{2}=0\end{align}}} On the other hand, from the definition of $\mathcal{F}$ and the condition that the wireless channel is non-manipulable, we get \begin{equation} \int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du\neq\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\end{equation}Hence, if $\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}dxdt$ can be integrated, we must have \begin{equation} \int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}dxdt>0, \end{equation}which indicates there is no division manner for $t\in\left(-\infty,+\infty\right)$ making (\ref{key1}) be true. It contradicts with the meaning of (\ref{key1}). We proceed to examine another case that if {\small{$\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}dxdt$}} cannot be integrated, since {\small{$\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}>0$}}, we have {\small{\begin{equation} \lim_{\widetilde{\beta}\rightarrow\infty,\widetilde{\alpha}\rightarrow-\infty}\lim_{\beta\rightarrow\infty,\alpha\rightarrow-\infty}\int_{\widetilde{\alpha}}^{\widetilde{\beta}}\int_{\alpha}^{\beta}\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}dtdx=\infty \end{equation}}}Hence, there has $\alpha'$, $\beta'$, $\widetilde{\alpha}'$ and $\widetilde{\beta}'$ by which \begin{equation}\label{key2} \int_{\widetilde{\alpha}'}^{\widetilde{\beta}'}\int_{\alpha'}^{\beta'}\left|\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|{X}\right.}\left(u\left|x\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t\left|u\right.\right)dvdu\right|^{2}dtdx>0\end{equation} Meanwhile, (\ref{key1}) indicates \begin{align}\label{key3} \nonumber&\lim_{\widehat{n}_{k}\rightarrow\infty}\frac{\beta_{4}-\alpha_{4}}{{n_{x}-2}}\frac{\beta_{3}-\alpha_{3}}{{n_{y}-2}}\sum_{\widetilde{\mathsf{x}}_k\in\left[\widetilde{\alpha}',\widetilde{\beta}'\right]}\sum_{t_{m}\in\left[\alpha',\beta'\right]}\\&\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}^{(\widehat{n}_{k})}\left|u\right.\right)du-\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)f\left(v\left|u\right.\right)F_{Y\left|V\right.}\left(t_{m}^{(\widehat{n}_{k})}\left|v\right.\right)dudv\right|^{2}=0. \end{align}However, (\ref{key2}) indicates there is no division manner for $t\in\left(\alpha',\beta'\right)$ and $x_2\in\left(\widehat{\alpha}',\widehat{\beta}'\right)$ making (\ref{key3}) be true. Hence, the contradiction happens. Due to these contradictions, we attain the assumption that for arbitrary large $n'_0$, there exist $n'>n'_0$, such that $\widehat{M}^{\left(n'\right)}\left(W_{f}^{\left(n'\right)}\right)-\gamma_{n'}\leq\mu_{n'}$ is not right. Therefore, we have there exist $n'_0$, for any $n'>n'_0$, there has $\widehat{M}^{\left(n'\right)}\left(W_{f}^{\left(n'\right)}\right)-\gamma_{n'}>\mu_{n'}$. Applying the aforementioned derivation to each function belonging to $\mathcal{F}$, we get there exist $n_0$, for any $n'>n_0$, $\widehat{M}^{\left(n'\right)}\left(W_{f}^{\left(n'\right)}\right)-\gamma_{n'}>\mu_{n'}$ is available for all possible functions of $\mathcal{F}$. According to (\ref{temp1}), we have \begin{equation} M^{\left(n'\right)}\left(W_f^{\left(n'\right)}\right)<\mu_{n'} \end{equation}for each function belonging to $\mathcal{F}$. Since $\widetilde{\lambda}^{(n')}\left(\delta\right)$ is infimum of ${M}^{\left(n'\right)}\left(W^{\left(n'\right)}\right)$ across $\mathcal{\widetilde{D}}_{s}^{(n')}$, we thus have \begin{equation} \widetilde{\lambda}^{(n')}\left(\delta\right)>\mu_{n'} \end{equation}Revisiting $\lambda^{(n')}\left(\delta\right)\geq\widetilde{\lambda}^{(n')}\left(\delta\right)$, we get \begin{equation} {\lambda}^{(n')}\left(\delta\right)>\mu_{n'} \end{equation} Finally, the proof is completed. \end{IEEEproof} \begin{lemma}\label{p2} Fixing arbitrary small $\epsilon$ and $\delta$, if there exist $n'_0$ such that {\small{$$\Pr\{\underbrace{\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'_{0}}\left|\triangle F^{(n'_0)}_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n'_{0})}\right|}_{R\left(U^{n},V^{n},n'_{0}\right)}>\delta\}>0$$}}then, we have for $n'>n'_0$, {\small{$\Pr\left\{ D^{n}<\varepsilon\left(n', \delta\right)\left|{R\left(U^{n},V^{n},n'\right)}>\delta\right.\right\}$}} is well-defined and $$\Pr\left\{ D^{n}<\varepsilon\left(n', \delta\right)\left|{R\left(U^{n},V^{n},n'\right)}>\delta\right.\right\} \leq\epsilon$$ where $n\rightarrow\infty$, $n'$ is sufficient large so as to satisfy the properties given by lemma 4 and lemma 6. $\varepsilon\left(n', \delta\right)$ is strictly positive and can be arbitrary small value. \end{lemma} \begin{IEEEproof} According to lemma 7, there exist $\mu_{n'}$ such that {\small{\begin{align}\label{p2_1} \nonumber&\Pr\left\{ \frac{\beta_{4}-\alpha_{4}}{{n_{x}-2}}\frac{\beta_{3}-\alpha_{3}}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|>\mu_{n'}\right\} \\& \leq\epsilon\Pr\left\{ R\left(U^{n},V^{n},n'_{0}\right)>\delta\right\}\leq\epsilon\Pr\left\{ R\left(U^{n},V^{n},n'\right)>\delta\right\}, \end{align}}}where $\mu_{n'}\rightarrow0$ as $n'\rightarrow\infty, n\rightarrow\infty$. The last inequality follows the fact that $R\left(U^{n},V^{n},n'_{0}\right)>\delta$ implies $R\left(U^{n},V^{n},n'\right)>\delta$ according to the definition of $\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)$. Then, if {\small{$$\underbrace{\frac{\beta_{4}^{(n')}-\alpha_{4}^{(n')}}{{n_{x}-2}}\frac{\beta_{3}^{(n')}-\alpha_{3}^{(n')}}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|}_{G\left(V^{n},U^{n},\widetilde{X}^{n}\right)}<\mu_{n'},$$}}we must have {\small{\begin{align}\label{p2_2} \nonumber&\left(\beta_{3}^{(n')}-\alpha_{3}^{(n')}\right)\left(\beta_{4}^{(n')}-\alpha_{4}^{(n')}\right)D^{n}\\&\geq{\frac{\beta_{4}^{(\widehat{n}_{k})}-\alpha_{4}^{(\widehat{n}_{k})}}{{n_{x}-2}}\frac{\beta_{3}^{(\widehat{n}_{k})}-\alpha_{3}^{(\widehat{n}_{k})}}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|}-\mu_{n'}\\\nonumber &\geq{\frac{\beta_{4}^{(n')}-\alpha_{4}^{(n')}}{{n_{x}-2}}\frac{\beta_{3}^{(n')}-\alpha_{3}^{(n')}}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|\int_{-\infty}^{+\infty}f_{U\left|\widetilde{X}\right.}\left(u\left|\widetilde{\mathsf{x}}_k\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|u\right.\right)du-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|^2}-\mu_{n'} \end{align}}}On the other hand, if {\small{$\underbrace{\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n')}\right|}_{R\left(U^{n},V^{n},n'\right)}>\delta,$}} according to lemma \ref{lem5}, the right side of (\ref{p2_2}) becomes {\small{\begin{equation}\label{p2_3} \left(\beta_{3}^{(n')}-\alpha_{3}^{(n')}\right)\left(\beta_{4}^{(n')}-\alpha_{4}^{(n')}\right)D^{n}\geq\lambda^{(n')}\left(\delta\right)-\mu_{n'} \end{equation}}}which can be reshaped as {\small{\begin{equation}\label{p2_4} D^{n}\geq\frac{\lambda^{(n')}\left(\delta\right)-\mu_{n'}}{\left(\beta_{3}^{(n')}-\alpha_{3}^{(n')}\right)\left(\beta_{4}^{(n')}-\alpha_{4}^{(n')}\right)} \end{equation}}}Define $\varepsilon\left(n',\delta\right)=\frac{\lambda^{(n')}\left(\delta\right)-\mu_{n'}}{\left(\beta_{3}^{(n')}-\alpha_{3}^{(n')}\right)\left(\beta_{4}^{(n')}-\alpha_{4}^{(n')}\right)}$, according to lemma \ref{lem6}, $\varepsilon\left(n',\delta\right)>0$ as $n'$ is sufficient large. From the properties of $\mu_{n'}$ and $\lambda^{(n')}\left(\delta\right)$, $\varepsilon\left(n',\delta\right)$ can be arbitrarily small. Upon (\ref{p2_2}), (\ref{p2_3}) and (\ref{p2_4}), we have {\small{\begin{align*} &\Pr\left\{ D^{n}\geq\varepsilon\left(n',\delta\right),R\left(U^{n},V^{n},n'\right)\geq\delta\right\} \\ &\geq\Pr\left\{ D^{n}\geq\varepsilon\left(n',\delta\right),R\left(U^{n},V^{n},n'\right)\geq\delta,G\left(V^{n},U^{n},\widetilde{X}^{n}\right)\leq\mu'\right\}\\ &=\Pr\left\{ R\left(U^{n},V^{n},n'\right)\geq\delta,G\left(V^{n},U^{n},\widetilde{X}^{n}\right)\leq\mu_{n'}\right\}\\ &\geq\Pr\left\{ R\left(U^{n},V^{n},n'\right)\geq\delta\right\} -\Pr\left\{ G\left(V^{n},U^{n},\widetilde{X}^{n}\right)\geq\mu_{n'}\right\} \end{align*}}}where the equation follows the logic from (\ref{p2_2}), (\ref{p2_3}) to (\ref{p2_4}). Then, we have {\small{\begin{equation} \Pr\left\{ D^{n}\geq\varepsilon\left(n',\delta\right)\left|R\left(U^{n},V^{n},n'\right)\geq\delta\right.\right\} =\frac{\Pr\left\{ D^{n}\geq\varepsilon\left(n',\delta\right),R\left(U^{n},V^{n},n'\right)\geq\delta\right\} }{\Pr\left\{ R\left(U^{n},V^{n},n'\right)\geq\delta\right\} }>1-\frac{\Pr\left\{ G\left(V^{n},U^{n},\widetilde{X}^{n}\right)\geq\mu_{n'}\right\} }{\Pr\left\{ R\left(U^{n},V^{n},n'\right)\geq\delta\right\} }\geq1-\epsilon \end{equation}}}where the last inequality follows (\ref{p2_1}). The proof is finished. \end{IEEEproof} The first property of theorem 1 is direct result from lemma {\ref{p2}}. We proceed to prove the second property of theorem 1. For arbitrary small $\delta$, $\mu$ and $\mu'(n',\delta)=\mu+\frac{n_{x}-1}{n_{x}-2}\frac{n_{y}-1}{n_{y}-2}\delta$, we have {\small{\begin{align} &\nonumber \Pr\left\{ D^{n}\leq\mu'(n',\delta)\bigcap\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n')}\right|\leq\delta\right\} \geq\\ &\nonumber \Pr\big\{ D^{n}\leq\mu'(n',\delta)\bigcap\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|\leq\mu\\&\nonumber \bigcap\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n')}\right|\leq\delta\big\} \\ &\nonumber =\Pr\big\{ \frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|\leq\mu\\&\nonumber \bigcap\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n')}\right|\leq\delta\big\} \\ &\nonumber \geq\Pr\left\{\sum_{j=1}^{{n_{v}}}\sum_{i=1}^{n'}\left|\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{\left(n'\right)}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-W_{0}^{(n')}\right|\leq\delta\right\} -\\&\nonumber\Pr\left\{\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|>\mu\right\}\label{p1} \end{align}}}where the equality firstly follows the fact that \begin{align} &\nonumber D^{n}\leq\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|F_{Y^{n}\left|\widetilde{X}^{n}\right.}^{n}\left(t\left|\widetilde{\mathsf{x}}_k\right.\right)-\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\msf{x}}\right.\right)\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|\\ &\nonumber+\frac{1}{{n_{x}-2}}\frac{1}{{n_{y}-2}}\sum_{k=1}^{{n_{x}-1}}\sum_{m=1}^{n_{y}-1}\left|\sum_{j=1}^{n_{v}}\sum_{i=1}^{n'}P_{\widetilde{U}\left|\widetilde{X}\right.}\left(\widetilde{\mathsf{u}}_{i}\left|\widetilde{\mathsf{x}}_k\right.\right)\left(\triangle F_{\widetilde{V}^{n}\left|\widetilde{U}^{n}\right.}^{(n')}\left(\widetilde{\mathsf{v}}_{j}\left|\widetilde{\mathsf{u}}_{i}\right.\right)-\left[W_{0}^{(n')}\right]_{i,j}\right)F_{Y\left|V\right.}\left(t_{m}\left|\overline{\mathsf{v}}_{m,j,k}\right.\right)\right|\\ &<\mu+\frac{n_{x}-1}{n_{x}-2}\frac{n_{y}-1}{n_{y}-2}\delta=\mu'(n', \delta). \end{align}Hence, the equality in (\ref{p1}) is established. Upon (\ref{p1}) and lemma 3, the property 2 in Theorem 1 is direct. \bibliographystyle{IEEEtran}
{'timestamp': '2017-08-07T02:05:09', 'yymm': '1701', 'arxiv_id': '1701.01590', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01590'}
arxiv
\section{Algorithmic Analysis} In this section, we first describe the experimental settings and baseline algorithms, and then demonstrate the experimental validation results. \subsection{Experimental Settings} \subsubsection{Datasets} We adopt both the AVA \cite{Murray:CVPR:2012} and our dataset to train various image croppers to be compared in this study. The average aesthetic score associated with each image in AVA are used to select a set of high and low quality images to train a photo quality classifier (Section \ref{sec:aesthetic_method}). Additionally, we also exploit the aesthetic scores to form relative ranking constraints to train ranking-based image croppers (Section \ref{sec:ranking_methods}). For our dataset, we split the cropping and ranking annotations into training and test set with a roughly 4:1 ratio. Specifically, 348 out of the 1,743 images with highly ranked crops are adopted as ground truth for evaluating the performance of image croppers. The ranking annotations are also used to train ranking-based image croppers (Section \ref{sec:ranking_methods}). Finally, the image cropping annotations in \cite{Yan:CVPR:2013} is also used to evaluate the performance of image croppers. \subsubsection{Evaluation Protocol} \label{sec:protocol} For fair comparison, we take the strategy of evaluating all baseline algorithms on a number of sliding windows. For simplicity, we set the size of search window to each scale among $\left[0.5, 0.6, \dots, 0.9\right]$ of the original image and slide the search window over a 5$\times$5 uniform grid. The optimal crop windows determined by image croppers are compared to the ground truth to evaluate their performance. We adopt the same evaluation metrics as in \cite{Yan:CVPR:2013}, \ie, \emph{average overlapped ratio} and \emph{average boundary displacement error} to measure the \emph{cropping accuracy} of image croppers. The average overlapped ratio is computed by \begin{equation} \frac{1}{N}\sum_{i=1}^{N} area(W^g_i \cap W^c_i)/area(W^g_i \cup W^c_i), \end{equation} where $W^g_i$ and $W^c_i$ denote the ground-truth crop window and the crop window determined by the baseline algorithms for the $i$-th test image, respectively. $N$ is the number of test images. The boundary displacement error is given by \[ \sum_{j=\{l,r,b,u\}} ||B^g_j-B^c_j||/4, \] where $B^g_i$ and $B^c_i$ denote the four corresponding edges between $W_g$ and $W_c$. Note that the boundary displacements have to be normalized by the width or height of the original image. We optionally report the \emph{swap error} evaluated on the test set of AVA and our dataset. It is the ratio of swapped pairs averaged over all queries, which measures the \emph{ranking accuracy} of image croppers to correctly rank pairwise subviews. \subsubsection{Aesthetic Features} \label{sec:aesthetic_feature} For all the learning-based image croppers, we adopt the ``deep'' activation features \cite{Donahue:2013:arXiv} to accomplish aesthetics prediction as suggested in \cite{Karayev:BMVC:2014}. For feature extraction, we exploit the implementation of AlexNet \cite{Krizhevsky:NIPS:2012} provided by the Caffe library \cite{jia2014caffe}. Each training sample is resized to 227-by-227 pixels and forward-propagated into the network. The activations of the last fully-connected layer are retained as the aesthetic features ($\mathbf{DeCAF}_7$), which are of 4,096-dimension. We optionally train the ranking-based image croppers with generic image descriptors \cite{Marchesotti:ICCV:2011} to inspect the performance variations. Specifically, Fisher vectors of SIFT descriptors with spatial pyramid (\textbf{SIFT-FV}) and Fisher vectors of color descriptors with spatial pyramid (\textbf{Color-FV}) are considered. For \textbf{SIFT-FV} and \textbf{Color-FV}, the cardinality of visual words is 256, and the image descriptor is constructed by concatenating the features extracted from 8 sub-image layouts: ``1$\times$1'' (whole image), ``3$\times$1'' (upper, center, bottom), ``2$\times$2'' (quadrant). The feature points are densely evaluated every 4 pixels, resulting in 262,144-dimension feature vectors. \subsection{Baseline Algorithms} \subsubsection{Attention-Based Methods} The first category of methods to be compared are the extension of the \emph{attention-based} photo cropping methods \cite{Suh:UIST:2003,Stentiford:ICVS:2007}, which take advantage of the saliency map accompanying the original image to search for an optimal crop window with the highest average saliency. Instead of the outdated saliency detection methods used in the previous works, we adopt two state-of-the-art methods, \ie, \textbf{BMS} \cite{Zhang:ICCV:2013} and \textbf{eDN} \cite{Vig:CVPR:2014}, with leading performance on the CAT2000 dataset from MIT Saliency Benchmark \cite{mit-saliency-benchmark}. In addition to the aforementioned search strategy (\textbf{MaxAvg}), we further implement another search criterion, which maximizes the difference of average saliency between the crop window and the outer region of the image (\textbf{MaxDiff}). The saliency maps are generated by the implementation of the original authors with the default parameter settings. \subsubsection{Aesthetics-Based Method} \label{sec:aesthetic_method} The second category of comparison techniques represent the research line of \emph{aesthetics-based} methods, which exploit a quality classifier that measures whether the cropped region is visually attractive to users \cite{Nishiyama:MM:2009,Fang:MM:2014}. Instead of the low-level features used in the previous works, we adopt the more advanced $\mathbf{DeCAF}_7$ features \cite{Donahue:2013:arXiv} to achieve aesthetics recognition. A total of 52,000 images with the highest and lowest aesthetics scores are selected from the AVA dataset \cite{Murray:CVPR:2012} as the training (67\%) and testing (33\%) samples. We thus train a binary SVM classifier with RBF kernels, which predicts a photo as high or low quality. The parameters of the classifier are obtained through 5-fold cross validation on the training set and the testing accuracy achieved 80.27\%. To use the binary classifier as an image cropper, we take advantage of the method described in \cite{Lin:ML:2007} to compute the posterior class probability as the aesthetics score to pick the best crop among all candidate windows. \subsubsection{Ranking-Based Methods} \label{sec:ranking_methods} \begin{table} \begin{center} \begin{tabular}{|c||c||c|} \hline Method & Overlap & Disp. \\ \hline\hline RankSVM \cite{Joachims:KDD:2006} & \textbf{0.6019} & 0.1060 \\ \hline RankNet \cite{Burges:ICML:2005} & 0.6015 & \textbf{0.1058} \\ \hline RankBoost \cite{Freund:2003} & 0.5017 & 0.1383 \\ \hline LambdaMART \cite{Wu:2010} & 0.5451 & 0.1217 \\ \hline \end{tabular} \end{center} \caption{Benchmarking of various learning-to-rank algorithms. $\mathbf{DeCAF}_7$ feature is used to train the image rankers. The cropping accuracy is evaluated on the 348 test images of our dataset. The best results are highlighted in bold.} \label{tab:ranking_algirithms} \end{table} The third category of comparison techniques are a family of aesthetics-aware image rankers. To choose an appropriate training algorithm, we have test several pairwise learning-to-ranking algorithms to train the image rankers, including RankSVM \cite{Joachims:KDD:2006}, RankNet \cite{Burges:ICML:2005}, RankBoost \cite{Freund:2003} and LambdaMART \cite{Wu:2010}. We exploit the implementation of the above algorithms provided by SVM$^{rank}$\footnote{\url{https://www.cs.cornell.edu/people/tj/svm_light/svm_rank.html}} and RankLib\footnote{\url{https://people.cs.umass.edu/~vdang/ranklib.html}} libraries for our experiments. The image rankers are trained by using the training set of our dataset with many different configurations of the individual algorithms. The best-performing models are determined by 5-fold cross validation. As summarized in Table~\ref{tab:ranking_algirithms}, RankSVM and RankNet achieve very competitive performance in terms of cropping accuracy. However, since RankNet rankers take much longer time to train, we thus choose RankSVM as the training method for the rest of the experiments in this study. Specifically, all the SVM rankers are trained with a linear kernel and use L1-norm penalty for the slack variables. The loss is measured by the total number of swapped pairs summed over all queries. The parameter $C$, which controls the trade-off between training error and margin, is determined via 5-fold cross validation. \subsection{Evaluations and Analysis} \emph{1) Comparison of traditional methods}: As shown in Table~\ref{tab:cropping_performance}, the first five rows summarize the performances of the four variants of attention-based methods and the aesthetics-based method. One can see that the search strategy of \textbf{MaxDiff} consistently outperforms \textbf{MaxAvg} for either type of saliency maps. The possible reason is that \textbf{MaxDiff} tends to include more salient regions into the crop window in order to lower the total saliency score of the outer region. Unlike \textbf{MaxAvg} which usually only concentrates on a single salient region, \textbf{MaxDiff} is more likely to obtain a crop window that forms a good composition. The performance of attention-based methods are highly dependent on the underlying saliency detection scheme. Although \textbf{eDN} \cite{Vig:CVPR:2014} and \textbf{BMS} \cite{Zhang:ICCV:2013} possess comparable performance in \cite{mit-saliency-benchmark}, their performance greatly varied in image cropping. It suggests that a standard benchmark is essential to choose the best saliency detection method for automatic image cropping. A hybrid method that optimizes the compositional layout of salient objects might be less sensitive to the selection of saliency maps, such as \cite{Zhang:ICME:2005}. In general, attention-based methods performed poorly in determining the aesthetics preferences between crop pairs (45.34\% -- 63.66\% swap error). We believe that this phenomenon could be accounted for the lack of aesthetics considerations in this family of methods. Note that the swap errors are calculated by the attention scores received by the crop pairs. Comparing with attention-based methods, the aesthetics-based method (\textbf{SVM}+$\mathbf{DeCAF}_7$) achieved better performance in all evaluation metrics. However, although the SVM classifier showed good capability of predicting high- and low-quality images, it did not perform well in ranking pairwise views (\ie, 42\% swap error), resulting in moderate performance in image cropping accuracy. \emph{2) Comparison of various aesthetic features}: The 9-th to 11-th rows of Table~\ref{tab:cropping_performance} compare the performance of image rankers trained by different aesthetic features using our new dataset. $\mathbf{DeCAF}_7$ achieves the best accuracy in all metrics. This result is consistent with the findings reported by \cite{Karayev:BMVC:2014}, \ie, $\mathbf{DeCAF}_7$ generalizes well to other visual recognition tasks even though the DCNN was trained for object classification. Although $\mathbf{SIFT}$-$\mathbf{FV}$ achieves comparable cropping accuracy with $\mathbf{DeCAF}_7$, the later obviously provides a much more compact feature representation of visual aesthetics. \begin{table}[t] \begin{center} \begin{tabular}{|c||c||c||c|} \hline Method & Overlap & Disp. & Swap \\ \hline\hline \textbf{eDN} (\textbf{MaxAvg}) & 0.3573 & 0.1729 & 0.6366 \\ \hline \textbf{eDN} (\textbf{MaxDiff}) & 0.4857 & 0.1372 & 0.4534 \\ \hline \textbf{BMS} (\textbf{MaxAvg}) & 0.3427 & 0.1815 & 0.5775 \\ \hline \textbf{BMS} (\textbf{MaxDiff}) & 0.3905 & 0.1674 & 0.4962 \\ \hline\hline \textbf{SVM}+$\mathbf{DeCAF}_7$ & 0.5154 & 0.1325 & 0.4201 \\ \hline\hline \textbf{AVA 1-1}+$\mathbf{DeCAF}_7$ & 0.5223 & 0.1294 & \textbf{0.1317} \\ \hline \textbf{AVA 2-2}+$\mathbf{DeCAF}_7$ & 0.5069 & 0.1346 & 0.2379 \\ \hline \textbf{AVA 5-5}+$\mathbf{DeCAF}_7$ & 0.4931 & 0.1384 & 0.2775 \\ \hline\hline \textbf{Our}+$\mathbf{SIFT}$-$\mathbf{FV}$ & 0.5917 & 0.1084 & 0.3068 \\ \hline \textbf{Our}+$\mathbf{Color}$-$\mathbf{FV}$ & 0.5042 & 0.1405 & 0.3692 \\ \hline \textbf{Our}+$\mathbf{DeCAF}_7$ & \textbf{0.6019} & \textbf{0.1060} & 0.3225 \\ \hline \end{tabular} \end{center} \caption{Summarization of performance evaluation. The middle two columns measure the cropping accuracy on the 348 testing images of our dataset. The best results are highlighted in bold. } \label{tab:cropping_performance} \end{table} \emph{3) Comparison of different datasets}: In this experiment we examine the effectiveness of training image rankers on the AVA dataset \cite{Murray:CVPR:2012}. Same as the aesthetics-based method, 52,000 images with the highest and lowest aesthetics scores are first selected. A configuration of \textbf{AVA n-n} means that we repeatedly select $n$ images from the high- and low-ranked group, respectively, and generate all combinations of the selected images to form the ranking constraints. Note that the characteristics of pairwise ranking constraints formed by AVA and our dataset are very different since AVA differentiates the visual preferences \emph{between} distinct images while our dataset ranks visually similar subviews \emph{within} the same images. Row 6-8 in Table~\ref{tab:cropping_performance} give the performances of three rankers trained on AVA using $\mathbf{DeCAF}_7$ feature. \textbf{AVA 1-1} performs best both in cropping and ranking accuracy. However, surprisingly, increasing ranking constraints (\textbf{AVA 2-2} and \textbf{AVA 5-5}) caused the performance to considerably drop instead. It indicates that only a sparse set of pairwise ranking constraints defined by the aesthetic scores are useful for image ranking and naively pairing images would not improve the ranking accuracy. Besides, although \textbf{AVA n-n}+$\mathbf{DeCAF}_7$ rankers generally outperform the traditional methods in ranking accuracy, it does not reflect on their cropping capability. For example, the cropping accuracy of \textbf{AVA 1-1}+$\mathbf{DeCAF}_7$ outperforms the best-performing traditional method (\ie, \textbf{SVM}+$\mathbf{DeCAF}_7$) with only an insignificant margin even though it has a much greater ranking accuracy. One possible reason is that the training data of AVA do not reflect the visual preference among visually similar views, which is essential for image cropping. Such observation can be further validated by comparing to the rankers trained on our dataset. \textbf{Our}+$\mathbf{DeCAF}_7$ achieves significant improvement in cropping accuracy using the same feature. It is also interesting to note that \textbf{Our}+$\mathbf{DeCAF}_7$ does not perform well in its ranking accuracy. The reason for the low ranking accuracy could be explained as follows: Since $\mathbf{DeCAF}_7$ is trained for the purpose of object recognition, it is thus very likely that the $\mathbf{DeCAF}_7$ features extracted from similar views containing the same ``object'' to be also similar. The same phenomenon can also be observed in other aesthetic features, \ie, $\mathbf{SIFT}$-$\mathbf{FV}$ and $\mathbf{Color}$-$\mathbf{FV}$. It suggests that there is still great potential to improve ranking-based image croppers by jointly learning the feature representation and semantically meaningful embedding of image similarity with DCNN \cite{Wang:CVPR:2014} instead of directly using $\mathbf{DeCAF}_7$. \begin{table}[t] \begin{center} (a)\\ \begin{tabular}{|c||c||c|} \hline Method & Overlap & Disp. \\ \hline\hline \textbf{eDN} (\textbf{MaxDiff}) & 0.4636 & 0.1578 \\ \hline \textbf{SVM}+$\mathbf{DeCAF}_7$ & 0.5005 & 0.1444 \\ \hline \textbf{AVA 1-1}+$\mathbf{DeCAF}_7$ & 0.5142 & 0.1399 \\ \hline \textbf{Our}+$\mathbf{DeCAF}_7$ & \textbf{0.6643} & \textbf{0.092} \\ \hline \end{tabular}\\ (b)\\ \begin{tabular}{|c||c||c|} \hline Method & Overlap & Disp. \\ \hline\hline \textbf{eDN} (\textbf{MaxDiff}) & 0.4399 & 0.1651 \\ \hline \textbf{SVM}+$\mathbf{DeCAF}_7$ & 0.4918 & 0.1483 \\ \hline \textbf{AVA 1-1}+$\mathbf{DeCAF}_7$ & 0.5034 & 0.1443 \\ \hline \textbf{Our}+$\mathbf{DeCAF}_7$ & \textbf{0.6556} & \textbf{0.095} \\ \hline \end{tabular}\\ (c)\\ \begin{tabular}{|c||c||c|} \hline Method & Overlap & Disp. \\ \hline\hline \textbf{eDN} (\textbf{MaxDiff}) & 0.437 & 0.1659 \\ \hline \textbf{SVM}+$\mathbf{DeCAF}_7$ & 0.4882 & 0.1491 \\ \hline \textbf{AVA 1-1}+$\mathbf{DeCAF}_7$ & 0.4939 & 0.147 \\ \hline \textbf{Our}+$\mathbf{DeCAF}_7$ & \textbf{0.6439} & \textbf{0.099} \\ \hline \end{tabular} \end{center} \caption{Cross dataset validation. (a)-(c) summarize the cropping accuracy of the best performing image croppers of each category shown in Table~\ref{tab:cropping_performance}, which are evaluated on the three different sets of annotations in the database of \cite{Yan:CVPR:2013}. The best results are highlighted in bold. } \label{tab:cross_dataset} \end{table} \emph{4) Cross-dataset validation}: In this experiment, we select the best performing image croppers from each category shown in Table~\ref{tab:cropping_performance} and directly apply them on the image cropping databset of \cite{Yan:CVPR:2013}. This dataset is composed of 950 images, which were annotated by three different users. Since this dataset contains only cropping annotations, it is thus only used to evaluate the cropping accuracy. A similar sliding window approach as described in Section \ref{sec:protocol} is adopted for evaluation. As shown in Table~\ref{tab:cross_dataset}, \textbf{Our}+$\mathbf{DeCAF}_7$ consistently achieves the highest accuracy in all annotation sets, which further validates the effectiveness of ranking pairwise subviews in image cropping. Note that higher cropping accuracy is reported in \cite{Yan:CVPR:2013}. Since this is a comparative study, no optimization on the parameters of crop windows (\ie, $x$, $y$, $w$ and $h$) was performed for fair comparison. We believe that the performance of the ranking based image croppers can be further enhanced by incorporating appropriate crop selection procedures. To summarize, the findings of this study lead to the most important insight of this work: \textit{ranking pairwise views is crucial for image cropping}. To the best of our knowledge, all existing methods attempted to tackle this problem by visual saliency detection or learning an aesthetics-aware model from \emph{distinct} images. However, according to our experimental study, these approaches do not necessarily perform well in differentiating pairwise views with substantial overlaps, which is crucial for image cropping. Figure~ \ref{fig:baseline_comparison} demonstrates several examples of comparing the ground truth and the best crop windows determined by various methods. To maximize the performance of machine learned image rankers, two possible directions can be considered: 1) adopting more effective feature representations learned from pairwise ranking of image subviews; 2) developing effective crop selection method to determine potentially good candidate windows for image ranking. \begin{figure*} \centering \begin{tabular}{c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c} \includegraphics[width=3.5cm]{Figure/1992069_0751b406c5_o.jpg}& \includegraphics[width=3.5cm]{Figure/1992069_0751b406c5_o_1.jpg}& \includegraphics[width=3.5cm]{Figure/1992069_0751b406c5_o_2.jpg}& \includegraphics[width=3.5cm]{Figure/1992069_0751b406c5_o_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/539582366_3ed23b0711_b.jpg}& \includegraphics[width=3.5cm]{Figure/539582366_3ed23b0711_b_1.jpg}& \includegraphics[width=3.5cm]{Figure/539582366_3ed23b0711_b_2.jpg}& \includegraphics[width=3.5cm]{Figure/539582366_3ed23b0711_b_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/4192603791_ef6a86762b_b.jpg}& \includegraphics[width=3.5cm]{Figure/4192603791_ef6a86762b_b_1.jpg}& \includegraphics[width=3.5cm]{Figure/4192603791_ef6a86762b_b_2.jpg}& \includegraphics[width=3.5cm]{Figure/4192603791_ef6a86762b_b_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/4218887379_906f7b758b_o.jpg}& \includegraphics[width=3.5cm]{Figure/4218887379_906f7b758b_o_1.jpg}& \includegraphics[width=3.5cm]{Figure/4218887379_906f7b758b_o_2.jpg}& \includegraphics[width=3.5cm]{Figure/4218887379_906f7b758b_o_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/3830736783_225517cb16_o.jpg}& \includegraphics[width=3.5cm]{Figure/3830736783_225517cb16_o_1.jpg}& \includegraphics[width=3.5cm]{Figure/3830736783_225517cb16_o_2.jpg}& \includegraphics[width=3.6cm]{Figure/3830736783_225517cb16_o_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/4363660067_5ed3206b78_b.jpg}& \includegraphics[width=3.5cm]{Figure/4363660067_5ed3206b78_b_1.jpg}& \includegraphics[width=3.5cm]{Figure/4363660067_5ed3206b78_b_2.jpg}& \includegraphics[width=3.5cm]{Figure/4363660067_5ed3206b78_b_3.jpg}&\\ \includegraphics[width=3.5cm]{Figure/2367773845_8f17e45398_b.jpg}& \includegraphics[width=3.5cm]{Figure/2367773845_8f17e45398_b_1.jpg}& \includegraphics[width=3.5cm]{Figure/2367773845_8f17e45398_b_2.jpg}& \includegraphics[width=3.6cm]{Figure/2367773845_8f17e45398_b_3.jpg}&\\ (a) Ground Truth & (b) \textbf{eDN}(\textbf{MaxDiff}) & (c) \textbf{SVM}+$\mathbf{DeCAF}_7$ & (d) \textbf{Our}+$\mathbf{DeCAF}_7$ \\ \end{tabular} \caption{Example image cropping results. The optimal crop windows determined by various baselines are drawn as green rectangles.} \label{fig:baseline_comparison} \end{figure*} \section{Dataset Construction} In this section we describe how the candidate images are selected and the design principles of the annotation pipeline. \subsection{Design Principles} While designing the image annotation procedure, a pilot study was carried out among the authors. We randomly downloaded a small number of test images and had the authors to annotate the ideal crop windows individually. Several observations were obtained after the pilot study. \begin{enumerate} \item Photo cropping is sometimes very subjective. Particularly, it is extremely difficult to define an appropriate crop for photos of both professional and poor quality since there are no ``obvious'' answers. \item Most online images are post-processed which means that most unwanted regions had been already cut away before they were uploaded. Therefore, it is essential to search for ``raw'' images for annotation. \item Sometimes people do agree others' crops are good even though they are different from their own crops. To obtain quality crops, we decided to resort to a crowd-sourcing platform to review all the cropping annotations and adopt only the highly ranked ones as final results. \end{enumerate} In manual image cropping, human typically iterates the procedure of moving and adjusting the position, size and aspect ratio of the crop window, and examining the visual quality before and after the manipulation until an ideal crop window is obtained. It is essentially a problem of ranking a number of pairwise subviews that are visually similar. Inspired by the aforementioned process, we also build annotations indicating such preference relationships. We believe that this type of data will be beneficial for researchers to more faithfully evaluating the performance of image cropping techniques. \subsection{Image Collection} In the image collection stage, we aimed to collect as many non-iconic images as possible for better generalization capability \cite{Torralba:CVPR:2011}. Following the strategy suggested in \cite{Lin:ECCV:2014}, we chose Flickr as our data source, which tends to have fewer iconic images. In addition, we searched Flickr with many combinations of a pre-defined set of keywords, by which more non-iconic images with richer contextual information are more likely to be returned. The above process resulted in an initial set of candidate images consisting of 31,888 images, which were then passed through a data cleaning process. We employed workers on Amazon Mechanical Turk (AMT) to filter out inappropriate images, such as collage, computer-generated images or images with post-processed frames. Particularly, we also asked the AMT workers to pick the photos of excellent quality, because they are potentially not necessary for cropping and thus not suitable for annotation. After data cleaning, 18,925 images remained to enter the next stage of data annotation. \subsection{Image Annotation} We collected two types of annotation through crowd-sourcing in our dataset. \begin{itemize} \item \textbf{Cropping annotation:} We built a web-based interface for performing the image cropping tasks. The users were recruited from the photography club in our university by invitation. In our task design, we allowed users to skip the images which were judged to be unnecessary for cropping. We eventually retrieved 3,413 cropped images after the human labeling process was finished. For validation, we grouped pairs of cropped image and its corresponding source image as Human Intelligence Tasks (HITs) and assigned each of them to 7 distinct workers on AMT. It is worth noting that a qualification test consisting of 10 pictorial ranking questions was given to each worker. Only the workers who correctly answered at least 8 questions were allowed to take the HITs. For each HIT, the order that the source and cropped image appeared in the HIT was randomized and the workers were asked to pick the more preferable one in terms of their aesthetics. In total, 1,743 out of the 3,413 cropped images were ranked as preferable by at least 4 workers and they constitute the final cropping annotation of our dataset. \item \textbf{Ranking annotation:} Besides the cropping annotation, we want to enrich the dataset with pairwise ranking relationships between subviews in the same image. For each image with human labeling, 10 pairs of crop windows were randomly generated and then ranked by 5 workers with a similar process as the cropping annotations. To prevent the crop windows from containing too much unimportant contents, we utilized a saliency map \cite{Vig:CVPR:2014} to guide crop selection. The size of crop windows varied to imitate the effect of zoom in/zoom out and each pair of crop windows possessed sufficient overlapping. Figure~\ref{fig:ranking_pairs} illustrates some examples of the generated crop pairs for ranking. We eventually obtained a collection of totally 34,130 pairs of crop windows with aesthetics preference information. Note that the human cropped images and the corresponding source images can also be treated as ranking annotations. \end{itemize} To summarize, our dataset is composed of 3,413 cropped images and 34,130 crop pairs generated from the corresponding images. All the source/crop and crop/crop pairs were reviewed by a number of human workers to derive the pairwise aesthetics relationships as the ranking annotation. Finally, 1,743 out of the 3,413 human cropped images were selected as the final cropping annotation of our dataset. \section{Conclusions} In this paper, we presented a new dataset which aims to provide a benchmarking platform for photo cropping and view finding algorithms. With carefully designed data collection pipeline, we were able to collect high quality annotations. One significant difference between our dataset and other databases is the introduction of pairwise view ranking annotations. Inspired by the procedure of iteratively comparing in manual image cropping, we argue that learning-to-rank approaches possess great potential in this problem domain, which have been overlooked by most previous researchers. We conducted extensive study on evaluating the performances of traditional image cropping techniques and several machine learned image rankers. The experimental results showed that image rankers trained on pairwise view ranking annotations outperform the traditional methods. \section{Introduction} \label{sec:intro} \begin{figure}[h] \centering \begin{tabular}{c@{\hspace{0.1cm}}c@{\hspace{0.1cm}}c} \includegraphics[height=5.5cm]{Figure/CUHK.jpg}\\ \hline \\ \includegraphics[height=5.5cm]{Figure/our.jpg} \end{tabular} \caption{A new image cropping dataset is presented in this work. Example images of an existing database \cite{Yan:CVPR:2013} (upper) and ours (bottom). Note that \cite{Yan:CVPR:2013} contains more images of canonical views. We attempt to build a new dataset containing more images of non-canonical perspectives and richer contextual information.} \end{figure} Photo cropping is an important operation for improving visual quality of photos, which is mainly performed to remove unwanted scene contents or irrelevant details by cutting away the outer parts of the image. Nowadays, it is mostly performed on digital images but remains a tedious manual selection process and requires experience to obtain quality crops. Therefore, a lot of computational techniques have been proposed to automate this process \cite{Zhang:2013:TIP,Yan:CVPR:2013,Fang:MM:2014,Zhang:2014:TIP:1}. Automatic photo cropping is closely related to other applications like image thumbnail generation \cite{Suh:UIST:2003,Marchesotti:ICCV:2009}, view finding and recommendation \cite{Chang:ICCV:2009,Cheng:MM:2010,Su:TMM:2012}. In a nutshell, these approaches share one core capability in common -- finding an optimal subview in terms of its \emph{aesthetics} or \emph{composition} within a larger scene. In other words, their performance highly depends on the ability to correctly \emph{rank} a number of visually similar proposal windows. Traditionally, automatic photo cropping techniques follow two mainstreams, \ie \emph{attention}-based \cite{Stentiford:ICVS:2007} and \emph{aesthetics}-based methods \cite{Nishiyama:MM:2009}, which aim to search for a crop window covering the most visually significant objects or assess the visual quality of the candidate windows according to certain photographic guidelines, respectively. However, in spite of its nature of a ranking problem, to the best of our knowledge none of the existing researches have adopted the \emph{learning-to-ranking} approaches to accomplish this task, which is proven to be useful and widely used in many information retrieval systems. The main goal of this work is thus to study the effectiveness of applying ranking algorithms on image cropping and view finding problems. We believe that the ability of ranking pairwise views \emph{in the same context} is essential for evaluating photo cropping techniques. Therefore, we build a new dataset consisting of 1,743 images with human labeled crop windows and 31,430 pairs of subviews with visual preference annotations. To obtain quality annotations, we carefully designed an image collection and annotation pipeline which extensively exploited a crowd-sourcing platform to validate the annotated images. We conduct extensive evaluation on traditional approaches and a variety of machine learned rankers trained on the AVA dataset \cite{Murray:CVPR:2012} and our dataset with various aesthetic features \cite{Marchesotti:ICCV:2011,Donahue:2013:arXiv}. Experimental validations show that ranking based image croppers consistenly achieve higher cropping accuracy in both the image cropping dataset \cite{Yan:CVPR:2013} and our dataset. Additionally, it also suggests that ranking-based algorithms still have great potential to further improve their performance on automatic image cropping with more effective features. The dataset presented in this work is publicly available\footnote{\url{https://github.com/yiling-chen/flickr-cropping-dataset}}. \section{Previous Work} \subsection{Aesthetic Assessment and Modeling} The main goal of aesthetic visual analysis is to imitate human interpretation of the beauty of natural images. Traditionally, aesthetics visual analysis mainly focuses on the binary classification problem of predicting high- and low-quality images \cite{Datta:ECCV:2006,Dhar:CVPR:2011,Luo:ICCV:2011}. To this end, researchers design various features to capture the aesthetic properties of an image compliant with photographic rules or practices, such as the rule of thirds and visual balance. For example, the spatial distribution of edges is exploited as a feature to model the photographic rule of ``\emph{simplicity}'' \cite{Ke:CVPR:2006}. Some photo \emph{recomposition} techniques attempt to enhance image composition by rearranging the visual elements \cite{Bhattacharya:MM:2010}, applying crop-and-retarget operations \cite{Liu:EG:2010} or providing on-site aesthetic feedback \cite{Yao:2012:IJCV} to improve the aesthetics score of the manipulated image. Instead of using ``hand-crafted'' features highly related to the best photographic practices, Marchesotti \etal show that generic image descriptors previously used for image classification are also capable of capturing aesthetic properties \cite{Marchesotti:ICCV:2011}. In \cite{Isola:TPAMI:2014}, Isola \etal show that the \emph{memorability} of images is predictable by using global image descriptors. In recent years, deep convolutional neural network (DCNN) has been proven to gain tremendous success in various visual recognition tasks and several works also exploited it as the machinery to learn effective features for aesthetics prediction \cite{Kang:CVPR:2014,Lu:MM:2014,Lu:ICCV:2015}. In \cite{Karayev:BMVC:2014}, Karayev \etal compare the performance of different image features for style recognition and show that CNN features generally outperform other features even when trained on object class labels. \subsection{Photo Cropping and View Finding Methods} Generally, automatic photo cropping techniques can be categorized into two lines of researches: attention-based and aesthetics-based approaches. The basic principle of attention-based methods is to place the crop window over the most visually significant regions in an image according to certain attention scores, \eg saliency map \cite{Suh:UIST:2003,Stentiford:ICVS:2007}, or by resorting to eye tracker \cite{Santella:CHI:2006}, face detector \cite{Zhang:ICME:2005} to find the regions of interest. In \cite{Marchesotti:ICCV:2009}, a classifier trained on an annotated database for saliency prediction is used to facilitate image thumbnail extraction. Recently, Chen \etal \cite{Chen:CVPR:2016} conduct a complexity study of several different formulations of optimal window search under the attention-based framework. Although the attention-based approaches can usually determine a crop receiving the most human attention, the cropped images are not necessarily visually pleasing due to little consideration of image composition. The aesthetics-based methods accomplish the cropping task mainly by analyzing the attractiveness of the cropped image with the help of a quality classifier \cite{Nishiyama:MM:2009,Fang:MM:2014}, and are thus closely related to photo quality assessment \cite{Datta:ECCV:2006,Dhar:CVPR:2011,Luo:ICCV:2011}. Recently, Yan \etal \cite{Yan:CVPR:2013} proposed a cropping technique that employs features designed to capture the changes between the original and cropped images. In \cite{Chang:ICCV:2009}, finding good subviews in a panoramic scene is achieved by analyzing the structural features and layout of visual saliency learned from reference images of professional photographs. Several other related works achieve view finding by learning aesthetic features based on position relationships between regions \cite{Cheng:MM:2010} or image decomposition \cite{Su:TMM:2012}. \begin{figure*}[t] \centering \includegraphics[width=16cm]{Figure/crop_pairs.jpg} \caption{Examples of crop pair generation. On the left are the source images and four corresponding crop pairs are shown on the right. Each pair of crop windows were randomly generated with the guidance of a saliency map to prevent from too much unimportant contents. The aesthetics preference relationship between the crop pairs were determined by the ranking results from AMT workers.} \label{fig:ranking_pairs} \end{figure*} \subsection{Datasets for Computational Aesthetics} Datasets play an important role for computer vision researches since they provide a means to train and evaluate algorithms. There are already several publicly available databases containing aesthetic annotations, such as \cite{Datta:ECCV:2006,Ke:CVPR:2006,Luo:ICCV:2011,Murray:CVPR:2012}. Among them, AVA \cite{Murray:CVPR:2012} is a large-scale dataset which takes advantage of community-shared data (\eg \texttt{dpchallenge}) to provide a rich collection of aesthetic and semantic annotations. Despite all these efforts, there is still not a standard benchmark for evaluating automatic photo cropping algorithms. In \cite{Yan:CVPR:2013}, the authors built a dataset consisting of 950 images, which are divided into seven categories and individually cropped by three professional experts. We see two deficiencies of this dataset. First, the selected image are from a database originally for photo quality assessment. Some images of professional quality and compositions are also included and cropped. These crops may not faithfully reflect the unwanted regions of the images. Second, many images in the database are \emph{iconic} object or scene images which were taken from a canonical perspective, particularly in the \texttt{animal}, \texttt{architecture}, \texttt{static} categories, which may lack non-canonical views and contextual information. To provide a more general benchmark, we choose to build a new dataset from scratch with a carefully designed image collection and annotation pipeline. \section*{Acknowledgement} \noindent This work was supported in part by Ministry of Science and Technology, National Taiwan University and Intel Corporation under Grants MOST-105-2633-E-002-001 and NTU-ICRP-105R104045. T.-W.~Huang and H.-T.~Chen are partially supported by MOST 103-2221-E-007-045-MY3. {\small \bibliographystyle{ieee}
{'timestamp': '2017-01-09T02:01:18', 'yymm': '1701', 'arxiv_id': '1701.01480', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01480'}
arxiv
\section{Introduction} Phyllotaxis is the study of arrangements of plant organs. These originate at the growing tip (apex meristem) of a plant as protuberances of cells, called primordia. The geometric classification of phyllotactic patterns has often been reduced to that of cylindrical lattices, where the helices joining nearest primordia - called parastichies - form two families winding in opposite directions. Counting parastichies in each family gives rise to the pair of parastichy numbers that are used to classify phyllotactic patterns. The striking phenomenon central to phyllotaxis is the predominance of pairs of successive Fibonacci numbers as parastichy numbers. \begin{figure}[h] \centering \includegraphics[width=6in]{birchtilingNOLA.pdf} \caption{\footnotesize {Each picture represents the unrolled surface of a cylinder. {\sf (A)} The imprint of a Birch catkin rolled on clay. After a vertical compression counterbalancing anisotropic growth, we used a method of least squares with (nonlinear) constraints to fit lattices and rhombic tilings to this pattern. The results of this process are seen in the lattice in {\sf (B)}, the tiling in {\sf (C)}. Note that there are 5 blue segments and 8 green in the fronts represented at the bottom of the pattern: they form the front parastichy numbers, and coincide with the number of parastichies of both figures. One can think of the tiling as a deformation of the lattice, obtained by rotating the segments of the front of the lattice. The tiling offers an improvement of the fit of more than 14 percent over the lattice, and it also accounts for the undulations of the parastichies. Note that, even though the parastichies are well defined in the rhombic tiling, the divergence angle between successive primordia (numbered according to height, and thus, presumably according to age) is widely erratic (although periodic). See for instance the differences of horizontal spacing between Primordia pairs 42, 43 and 43, 44.}} \label{fig:tilingfit} \end{figure} However, Fibonacci patterns and transitions among these are not the only ones observed in nature. A very common transition can be seen on stems of sunflowers, for instance: after a few pairs of aligned leaves alternating at a $90^o$ angle leaves suddenly grow in spirals yielding Fibonacci numbers. In terms of parastichy numbers classification, the pattern with parastichy numbers $(2,2)$, (decussate), transitions to $(2,3)$. This transition is usually absent from the analysis of dynamical models of phyllotaxis, even when they can reproduce it. More generally, transitions to and from multijugate phyllotaxis, where parastichy numbers have a common divisor $k$, and where $k$ organs appear at the same level (whorl), is not often discussed (\cite{douadycouder}, Parts II \& III being a notable exception). Part of the difficulty lied in the absence, in the literature, of a continuum of patterns encompassing lattices of all jugacies, and of more local geometric tools to follow the transitions as they unfold one primordium at a time. We introduce the geometric concept of phyllotactic~and rhombic tilings, which do encompass lattices of all jugacies, as well as patterns hitherto considered as transient. These tilings can be seen as deformations of cylindrical lattices. In contrast with lattices, they can account for the marked undulations of parastichies often observed in nature (Fig. \ref{fig:tilingfit}). We also reintroduce van Iterson's century old concept of ``zickzacklinie" \cite{vaniterson}, that we call here primordia fronts (Fig. \ref{fig:tilingfit}). These zig-zaging fronts and their parastichy numbers offer a practical and theoretical tool to understand not only the steady state tilings but also transitions from one to another, in a way that may be less confusing than the divergence angles often used in experiments (see e.g. Section \ref{subsec:fibonacci}). The concept of primordia front might also offer an explanation as to the statistical predominance of Fibonacci numbers of ray petals in many asteracea (\cite{battjes}): the number of primordia in a front is the sum of its Fibonacci (likely) parastichy numbers, hence itself a (likely) Fibonacci number. We root the concepts of tilings and fronts within a simple discrete dynamical model that more or less explicitly exists since the 19th century (\cite{weisse}, \cite{vaniterson}, \cite{williams}, \cite{douady}). This system, that we call the Snow map after \cite{douadycouder} and denote by $S$~, represents primordia formation as the stacking of disks on a cylinder, according to the simple rules: the new disk appears at the lowest level above the older ones, without overlap. As we fix the circumference of the cylinder, the diameter $D$ of the of the primordia is the fundamental parameter of this model. Theorem \ref{thm:attractor}, brings together the geometry and dynamics of this paper, by showing that, for each parastichy number pair $M,N$ and for $D$ in an appropriate range, there exists a manifold of rhombic tilings, each of which is a periodic orbit of period $MN$ for $S$. This manifold is of dimension $M+N$, and contains the $M,N$-lattice of the fixed point bifurcation diagram for that $D$ (see Section \ref{subsec:fp.po}). We also show that this manifold is a local attractor for $S$, and that the attraction occurs in \emph{finite time}. We conjecture that the entire set of dynamically sustainable rhombic tilings forms a normally attracting set. This should imply the persistence of an invariant set with comparable topology in nearby models (\cite{fenichel}) and would confer the Snow model and rhombic tilings some universality in phyllotaxis. Although we do not study phyllotactic transitions in great detail here (see Sections \ref{subsec:fibonacci} and \ref{subsec:frontdyn}), we hope that this paper will serve as foundation for further research in that direction. Later work will explore the topological structure of the set of dynamically sustainable tilings, and of the dynamical transitions it allows, as well as generalizations of these tilings to other geometries. Experimental applications of some of the concepts discussed here, such as using fronts derived from plant data as initial conditions for growth modeling using a similar model, appeared in \cite{jpgr}. Recent experimental and modeling work points to the active transport of the hormone auxin \cite{auxinbern}, \cite{auxintraas},\cite{auxinmjolsness}, \cite{auxinprunsi} as the underlying mechanism of primordia formation, although some authors still advocate for a buckling explanation \cite{shipman}. Although the type of models based on auxin transport should eventually prove invaluable in testing the validity of proposed biological mechanisms, to date they can't easily and stably reproduce Fibonacci phyllotaxis, and neither could they form the proper context for a geometrical explanation of its prominence. Our approach is grounded in the tradition of dynamical/geometric models (\cite{weisse},\cite {vaniterson}, \cite{williams}, \cite{adler}, \cite{douadycouder}, \cite{douady}, \cite{leelevitov}, \cite{kunzthesis}, \cite{jns}), often based on the botanical observations of Hofmeister \cite{hofmeister} and Snow \& Snow \cite{snow}. The model we study is also compatible with the general assumptions of \cite{auxinbern} and \cite{shipman}. Our goal is to distill to their simplest and most rigorous form the geometric mechanisms that could be at play in Phyllotactic pattern formation. The concepts we develop are general enough that they may adapt to other situations, such as the assembly of the HIV-1 CA protein \cite{HIVnature}. To motivate this otherwise rather theoretical paper, we start in Section \ref{section:numexp} by reporting on some numerical experiments, showing how phenomena encountered by iterating $S$~on a computer naturally lead to rhombic tilings and primordia fronts. We then review the classical geometry of the cylindrical lattices and of their parastichies (Section \ref{sec:classicgeom}). In Section \ref{subsec:parentsEtc}, we establish the notion, for general configurations of primordia, of chains and fronts of primordia as sets of tangent primordia encircling the meristem. The parastichy numbers of chains and fronts are just the number of up and down segments as one travels around the chain. The definition of phyllotactic~and rhombic tiling as cyclic sums of up and down vectors follows in Section \ref{subsec:tilings}, followed by the analysis of their periodicity and properties of parastichies. In Section \ref{subsec:parastnum}, we show the equality of parastichy numbers of a tiling and of any of its fronts - thus validating the usage of the front parastichy numbers. We then give a rigorous definition of the Snow map $S$, followed by a study of its domain of differentiability (Section \ref{sec:snow}). Section \ref{sec:dyngeom} brings the dynamics of $S$~and the geometry of fronts and tilings together. In Section \ref{subsec:frontdyn}, we show that the top primordia front of a configuration determines its dynamical future, and that changes in parastichy numbers can be simply read from the number of sides of the polygonal tile between a new primordium and the top front. We show that the fixed points of the map $\overline S$~induced on the shape space of configurations are the same rhombic cylindrical lattices as in the Hofmeister map of \cite{jns} and conjecture that periodic orbits all form rhombic tilings (Section \ref{subsec:fp.po}). In Section \ref{subsec:attractor}, we prove Theorem \ref{thm:attractor} on the existence of attracting sets of rhombic tilings mentioned above. Returning to experimental results, Section \ref{subsec:rp2} shows numerically how tilings whose parastichy numbers sum up to 4 coexist in the shape space of chains of four primordia. We show that the latter set, for the chosen parameter, has the topology of the projective plane. \\ \section{Numerical Explorations} \label{section:numexp} Before formally studying the concepts of rhombic tilings, primordia front, and their relation to the dynamics of the Snow map $S$, we present some numerical observations that motivated our theoretical inquiry. \subsection{Asymptotic Behavior of $S$} \label{subsec:observe} In our numerical simulations, we consistently observed that, under iterations of $S$, \emph{all} configurations converge to of ``fat rhombic tilings": lattice-like sets of points of the cylinder that are vertices of tilings with rhombic tiles that are not too thin (See Section \ref{subsec:tilings}). The tilings have, like the classical lattices of phyllotaxis, parastichies: strings of tangent primordia winding up and down the cylinder in somewhat irregular helices. And as with lattices, these parastichies come in two families winding in opposite directions (Fig \ref{fig:Periodpen}). Interestingly, we observed two distinct types of convergence to rhombic tilings: a finite time convergence and an asymptotic (infinite time) convergence. In our experiments, asymptotic convergence always involves at least one pair of pentagonal and triangular tiles, repeating along a parastichy (Fig. \ref{fig:Periodpen}). One can see from the figure (see Proposition \ref{prop:frontperiod} for a proof) that when an orbit goes through segments of a given rhombic tiling of parastichy numbers $M, N$ its shape repeats periodically, with period $MN$. Hence, orbits that we have observed are either periodic (in the shape space), preperiodic or asymptotically periodic (with triangle and pentagon pairs). Moreover we observed large continua of tiling segments that are periodic orbits. In Theorem \ref{thm:attractor}, we prove the existence of such continua and of the preperiodicity of all orbits near steady state lattices. We will leave the analysis of the asymptotic convergence to a later work. \begin{figure}[h] \centering \includegraphics[height= 3.4in]{PeriodPent} \caption{\footnotesize{ {\sf (A)} Rhombic tiling of parastichy numbers (5,3) obtained by iterating the transformation $S$~on a front of parastichy numbers 5,3. The older the primordium, the greater its index. Three fronts, at primordia 1, 16, and 31, are shown with their up vectors in thick black, down vectors in thick white. A ``period vector" (shown in dark grey) joins primordia $k$ and $k+15$, and translates a front into another periodically, with $5\times 3$ primordia in between: this is an orbit of period 15 (see Theorem \ref{theorem:RTperiodic} and Proposition \ref{prop:frontperiod}). {\sf (B)} Asymptotically periodic orbit, with pairs of triangles and shrinking pentagons aligned in a parastichy.}} \label{fig:Periodpen} \end{figure} It is intuitively clear that, at a given time step. of the iteration, the top connected layer of primordia holds the key to the dynamics and the geometry of the orbits. We call such a layer a primordia front (Section \ref{subsec:parentsEtc}). The number of ``up" and ``down" vectors forming the zigzagging curve as one travels from left to right on a front corresponds to parastichy numbers in the case of lattices and tilings (Proposition \ref{prop:parastnum}). We call them front parastichy numbers (Section \ref{subsec:parentsEtc}). We contend that counting front parastichy numbers at each step of the iteration - which can be programmed in either simulations or data analysis - may be less misleading than the divergence angles commonly used in this type of experiment (See Figures \ref{fig:tilingfit} and \ref{fig:divVSparast} and the next section). \subsection{The Fibonacci Path} \label{subsec:fibonacci} \begin{figure}[h] \centering \includegraphics[width=6in]{divVSparast.pdf} \caption{\footnotesize { {\sf (A)} Divergence angle vs number of iterates of $S$. The initial condition is the $(2,1)$ steady state lattice for the parameter $\diam=.2083$ (diameter of primordia). $D$ is decreased by 1\% at each iterate, until iterate 170, after which it is kept constant. Note how close to the golden angle ($\approx 137.51^0$) the divergence angle is until iterate 140, and how wildly it oscillates after that. A periodicity of $104=8\times13$ can be observed after iterate 170. {\sf (B)} A section from {\sf (A)} blown up to show the oscillation of the divergence angle that mirrors, up to some small amplitude secondary oscillation, the zigzagging of the Fibonacci branch of the bifurcation diagram of Fig. \ref{fig:bifdiag}. {\sf (C)} The front parastichy numbers vs iterate numbers. Note the extreme regularity of this data, contrasting with the oscillations of the divergence angle. {\sf (D)} The $(13,8)$ dynamical tiling obtained after iterate 170, when $\diam$ is kept constant. The mild, nature-like undulations of its parastichies contrast with the irregularities of its divergence angles seen in (A). }} \label{fig:divVSparast} \end{figure} The litmus test for a model of phyllotaxis is its ability to reproduce aspects of the bifurcation diagram - or fixed point set - of Section \ref{subsec:fp.po}, and especially of its Fibonacci branch. This diagram is formed by the generators (see Section \ref{sec:classicgeom}) of the ``good" lattices of phyllotaxis, that are steady states of the given model (in this case presented, of both $S$~and the Hofmeister map of \cite{jns}). Each (dark) curve segment of the diagram corresponds to lattices with a given pair of parastichy numbers whose shapes are fixed under $S$. The $x$ coordinate of a generator corresponds to the so-called divergence angle between two consecutive points in the vertical ordering of the lattice. It also corresponds to the difference of $x$ coordinate of the new primordium and the next in an iteration process. The divergence angle, and its connection to parastichy numbers in lattices, has been widely used to explain and detect in models the Fibonacci phenomenon \cite{douadycouder}. The Fibonacci branch of the bifurcation diagram is the largest in the diagram, and starts at lattices of parastichy numbers (1,1), corresponding to the beginning of the growth of most monocotyledonous plants. In our work on the Hofmeister map \cite{jns}, we showed that the steady state lattices are attractors, accounting for the fact that once near the Fibonacci branch, a configuration remains near it as the parameter (in that case the internodal distance) was decreased. We were originally pessimistic about $S$~yielding Fibonacci transitions as the parameter varies. Indeed, we had observed numerically that a steady state lattice for $S$~is part of an attracting manifold of periodic orbits and the eigenvalues of the differential are either 0 or on the unit circle (A consequence of Theorem \ref{thm:attractor}). Hence the steady states for $S$~can at best be neutrally stable. However, our experiments (Fig. \ref{fig:divVSparast} ({\sf A \& B})) show that, as we lower the diameter of the primordia while iterating $S$, the Fibonacci phenomenon, as measured by front parastichy numbers, is in fact much more robust in our $S$~model than the divergence angle measurements indicates: while the divergence angle can vary wildly even in an orbit close to a lattice, the parastichy numbers stay constant. Orbits do not have to stay too close to lattices to follow the Fibonacci route: It is sufficient that they stay in a neighborhood the substantially larger and attracting set of rhombic tilings. This flexibility allows for much faster transitions than previously thought, in a time scale observed in plants, as we will show in future work. Last but not least, the strong attraction of $S$~orbits to the set of rhombic tilings should make this set persist topologically in nearby systems. \section{Classical Geometry of Phyllotaxis} \label{sec:classicgeom} \subsection{Underlying Geometry} In this paper, we concentrate on cylindrical phyllotaxis. We normalize the cylinder $\cyl$ to have circumference 1. Mathematically, $\cyl $ is the cartesian product $\circle\times {\mathbb R}$ of the unit circle $\circle= {\mathbb R}/{\mathbb Z}$ with the reals. Note that fixing the circumference of the cylinder does not mean that we preclude lateral plant growth in our modeling. We make this convenient normalization choice without loss of generality since, in the patterns we study, the important parameters (such as the ratio $D$ of the size of primordia relative to the diameter of the meristem) are independent of scale. Both botanists and mathematicians often unroll cylindrical patterns on the plane ${\mathbb R}^2$, which can also be seen as the complex plane ${\mathbb C}$. This is the covering space of the cylinder (see Section \ref{subsec:cover}). We will use the same notation for points and vectors in ${\mathbb R}^2$ and $\cyl$. By a \emph{configuration}, we mean a finite set of points in $\cyl$ ordered by height. These points represent centers of primordia along the stem. \subsection{Covering Space Notions and Notation} \label{subsec:cover} We often describe objects in the cylinder via their covers and lifts in the plane. The intuitive notion of cover of a set, in the case of the cylinder is simple: mark each point of the set with ink, and use the cylinder as a rolling press. As you roll the cylinder indefinitely on the plane, the points printed form the cover of the original set. Each piece of the cylindrical pattern is repeated at integer intervals along the $x$-direction. The cover of a helix, for example, is a collection of parallel lines. The lift of a helix at a point is the choice of one of these lines. Here is a more rigorous description of these classical concepts \cite{munkres} and notation that we will be using. The natural projection $\pi: {\mathbb R}^2 \mapsto\cyl$ which maps a point $(x,y)$ to $(x \text{ mod } 1, y)$ is a \emph{covering map} and the plane ${\mathbb R}^2$ is a \emph{covering space} of the cylinder $\cyl$. This means that $\pi$ is surjective, and that around any point $z$ of $\cyl$, there exists an open neighborhood $U$ such that $\pi^{-1}(U)$ (the inverse image of $U$) is a disjoint union $\cup U_k$ of open sets of the plane each homeomorphic to $U$. One says that $\pi$ is a \emph{local homeomorphism} and that $U$ is \emph{evenly covered}. In the case of the cylinder, $\pi$ is also a local isometry, for the metric induced by $\pi$ on the cylinder. A subset $X$ of ${\mathbb R}^2$ is a \emph{fundamental domain} if $\pi: X\mapsto \cyl$ is a bijection. Any region of ${\mathbb R}^2$ of the form $\{(x, y)\in {\mathbb R}^2 \mid a\leq x<a+1\}$ is a fundamental domain. The \emph{cover} of a subset $Y$ of $\cyl$ is the inverse image $\tilde Y = \pi^{-1}(Y)$ of $Y$. A set $\tilde Y$ of the plane is a cover of its projection $\pi(\tilde Y)$ if and only if $\tilde Y+ (1, 0) = \tilde Y.$ The ``tilde" notation as above is often used to denote covering spaces. In this paper, we also use the underline notation to denote the projection of a set in the plane to the cylinder: $\underline X = \pi(X)$. As with all covering maps, $\pi$ has the lifting property: if $\gamma$ is a path in $\cyl$ and $c\in {\mathbb R}^2$ is a point ``lying over" $\gamma (0)$ (i.e. $\pi(c) = \gamma(0)$), then there exists a unique path $\rho \in {\mathbb R}^2$ lying over $\gamma$ (i.e. $\pi \circ \rho = \gamma$) and with $\rho(0) = c$. The curve $\rho$ is called the \emph{lift of $\gamma$ at $c$}.The lift of a path is only a connected part of its cover: for instance the lift at $(3, 0)$ of the line of equation $\underline x = 0$ of the cylinder is the line $x=3$ in the plane, whereas its cover is the union of all the lines $x=k, k\in {\mathbb Z}.$ \subsection{Cylindrical Lattices, Helical Lattices, Multijugate Configurations } \label{subsec:lattices} A \emph{cylindrical lattice} $L$ is a set of points in $\cyl$ whose cover $\tilde L$ is a lattice of ${\mathbb R}^2$: $$ \tilde L = \left\{ m \vec v+n \vec w \in {\mathbb R}^2 \mid m,n\in {\mathbb Z}\right\},$$ where $\vec v,\vec w \in {\mathbb R}^2$ are independent generating vectors. Note that $\tilde L$ a discrete subgroup of ${\mathbb R}^2$ isomorphic to ${\mathbb Z}^2$. Since $\tilde L$ is a cover, it must be invariant under translation by $\2vec 10$. Changing bases if necessary, one can assume that $\vec w = \left(\frac 1k, 0\right)$ for some positive integer $k$, called the \emph{jugacy} of the lattice. If $k = 1$, we say that $L$ is \emph{monojugate} or that it is a \emph{helical lattice}. In this case $\vec w = (1,0) = (0,0) \mod 1$ and $L$ has the unique generator $\vec v$. If $k>1$, $L$ is called a \emph{multijugate configuration} or specifically a $k-$\emph{jugate} configuration (or $k$-jugate lattice). A cylindrical lattice $L$ is a discrete subgroup of $\cyl = \circle\times {\mathbb R}$ isomorphic to $ {\mathbb Z}\times{\mathbb Z}/{k{\mathbb Z}}$ (simply ${\mathbb Z}$ in the case of a helical lattice). In a $k$-jugate lattice, each point is part of a set of $k$ points, called a \emph{whorl}, evenly spread around a horizontal circumference of $\cyl$. Parastichies of a helical lattice $L$ are helixes joining each point of $L$ to its nearest neighbors. We now make this more precise. In general, there are two points of $\tilde L$ nearest to $0$ in the positive half plane. Say $z_M= M\vec v + (\Delta_M, 0)$ and $z_N= N\vec v + (\Delta_N, 0)$ nearest to 0, where $M,N, \Delta_M, \Delta_N\in {\mathbb Z}$. Also assume that $\widevec{0z_M}$ makes a larger angle with the horizontal than $\widevec{0z_N}$, so in particular $\widevec{0z_M}$ and $\widevec{0z_N}$ are not colinear. The line through 0 and $z_M$ lifts a helix in $\cyl$ that contains all the points $\pi(kz_M)=\pi(kM\vec v), k\in {\mathbb Z}$. The set of these points is called a \emph{parastichy}, and the helix connecting them a \emph{connected parastichy}. There are $M$ helixes, also called parastichies, parallel to this one. Each goes through a set of points $\left\{\pi(kz_M+jz_N)\right\}_{k\in \mathbb Z}$, for a fixed $j\in \{0, \ldots, M-1\}$. To prove this, one shows that when $j=M$, one obtains another lift of the original parastichy, using \begin{equation} \label{eqn:MNcoprime} N\Delta_M-M\Delta_N= 1 \end{equation} This is a consequence of $z_M, z_N$ being closest to 0 (\cite{jns}, Proposition 4.2) and it implies that $M$ and $N$ are co-prime ($\gcd(M,N) = 1$). Thus there are $M$ parastichies and they correspond to a cosets of the subgroup $M{\mathbb Z}$ of ${\mathbb Z}$. Likewise, there are $N$ parallel parastichies joining the second closest neighbors. \begin{figure}[h] \centering \includegraphics[width=6in]{LatticesAndWhorls} \caption{\footnotesize {\bf Cylindrical Lattices.} Each represented in a fundamental domain of their cover with $-\frac12<x\leq \frac 12$. All these lattices are rhombic: each primordium is equidistant to its 4 nearest neighbors. {\sf (A)} 3, 5 helical lattice, with only one generator $\vec v$. We only show the indices $k$ of the points $z_k$. Note how $z_3$ and $z_5$ are the closest to $z_0$. We have shaded the parastichies through $z_3$ and $z_5$. There are 5 parastichies parallel to that through $z_5$, and 3 parallel to that through $z_3$. {\sf (B)} 2-jugate (bijugate) 6,10 lattice, obtained by rescaling two copies of the one in (A) by $1/2$, and setting them side by side on the cylinder. This lattice has two generators, $\vec v$ which is half the vector $\vec v$ of $A$, and the vector $\vec w = (1/2,0)$. each primordium is in a whorl of 2, separated by $\vec w$. {\sf (C)} 4,4 lattice (4-jugate), with two generators $\vec v$ as shown and $\vec w = (1/4, 0)$. Each primordium is in a whorl of 4. } \label{fig:Lattice&Whorls} \end{figure} If $L$ is a $k$-jugate lattice, we can trace parastichies through nearest neighbors in a similar fashion. This time the parastichy numbers $M$ and $N$ must have the common divisor $k$. An intuitive way to see this is that, rescaling the cover $\tilde L$ of $L$ by $k$, one obtains the cover of a helical lattice, call it $L_h$. Build the parastichies through nearest neighbors for $L_h$ as before. Then rescale back by $1/k$ - the rescaled parastichies are parastichies of $L$. Since you need $k$ copies of the rescaled $L_h$ to go around the cylinder, you need $k$ rescaled copies of each parastichy of $L_h$, crossing the $x$-axis at intervals of $1/k$, to get all the parastichies of $L$. Thus, all cylindrical lattices can be classified by their parastichy numbers $(M,N) = k(i,j)$ where $k$ is the number of primordia in a whorl. Helical lattices are the special case where $k=1$. \emph{Whorled} configurations, where primordia in a new whorl are placed midway between those of the previous whorl, is another notable case, which corresponds to $k(1,1)$. \subsection{Limitations of Cylindrical Lattices in Phyllotaxis.} In Section \ref{subsec:fibonacci}, we presented a numerical simulation showing Fibonacci transitions along orbits of $S$~when the parameter $D$ is decreased. We argued briefly that the dynamical transitions observed mirrored the continuous geometric deformation of helical lattices along the main Fibonacci branch of the bifurcation diagram. The existence of the (connected) Fibonacci branch has been the basis of many explanations of the phenomenon since the $19^{th}$ century\footnote{This neat \emph{geometric} fact has often been a source of confusion between the global deformation of a pattern and its transitions via a \emph{dynamical} process with varying parameter.} (\cite{weisse}, \cite{vaniterson}). Unfortunately, this kind of argument, made rigorous for the Hofmeister model in \cite{jns}, cannot work for transitions involving a change of jugacy in the pattern. One of these transitions, from $2(1,1)$ (decussate) to $(2,3)$ (Fibonacci spiral) is the norm in the vast majority of dycotyledonous plants such as the sunflower, where after a few whorls of two leaves at $90^o$ angle, symmetry is broken and a spiral pattern emerges. This transition cannot be attributed to the proximity of iterated patterns to a continuous path \emph{within} the set of lattices between lattices of parastichy numbers $(2,2)$ and $(2,3)$. Indeed, no such continuous path exists, since it would have to involve the continuous deformation of the vector $w = (1/2, 0)$ into $(1,0)$ within the discrete set of rational vectors of the form $(1/k, 0)$, which is clearly absurd. Even in a Fibonacci transition, the global geometric deformation of lattices (orthostichies becoming parastichies when $D$ decreases) does not translate easily into a dynamical understanding of the transitional region. In short, we need more flexible and local geometrical tools to better describe dynamical transitions. \section{New Geometry for Phyllotaxis} \label{sec:newgeom} In this section, we introduce primordia fronts and phyllotactic~tilings. They address the limitations noted in the previous paragraph. Fronts are local in nature and are well defined in the setting of general configurations of points of the cylinder. We will show that fronts are key in understanding transitions. Phyllotactic~tilings and more specifically rhombic tilings allow many more deformations than cylindrical lattices while still featuring parastichies. We give an algebraic definition of these tilings as a set of points obtained by cyclically adding ``up" and ``down" vectors. In later sections, we derive the geometric and periodicity properties of these tilings and of the tiles they bound. \subsection{Parents, Ontogenetic Graphs, Fronts, Local Parastichy Numbers} \label{subsec:parentsEtc} This subsection gives definitions regarding very general configurations of points of the cylinder. They can naturally be adapted to other geometries (cone or disk) as well (see \cite{jpgr}). We consider general configurations of a number $K$ of disks of a given diameter $D$ in the cylinder. These configurations are given by their centers $(p_1, \ldots , p_K)$ and they form the set $\cyl^K$, Cartesian product of $K$ copies of the cylinder. Occasionally, we need to consider countably infinite configurations as well. The \emph{ontogenetic order} for a configuration in $\cyl^K$ is a choice of indices $\{1, \ldots, K\}$ for the points which corresponds to the following order of the points coordinates: $$ i > j \Leftrightarrow y(p_i) < y(p_j) \text{ or }\{ y(p_i) = y(p_j) \text{ and } x(p_i) > x(p_j)\}, $$ where we choose the fundamental domain $x \in \left(-\frac 12, \frac 12 \right] $. Often, such as with lattices, we consider finite configurations that are pieces of infinite ones. A configuration ${{\bf p}}\in \cyl^K$ comprising all the points of an infinite configuration $X$ between some $p_i$ and $p_{i+K}$ in the ontogenetic order of $X$ is called a \emph{segment} of $X$ of length $K$. A primordium $p_j$ is a \emph{left (resp. right) parent} of $p_i$ if it is tangent below and to the left (resp. right) of $p_i$. More precisely, we adopt the convention that, for $p_j$ to be left parent of $p_i$, the coordinates $x, y$ of the vector $\widevec{p_ip_j}$ must satisfy $-1<x<0, y\leq 0$ and $x^2+y^2 =D^2$, and $1>x\geq 0, y<0, x^2+y^2 =D^2$ for $p_j$ to be right parent of $p_i$. In the obvious fashion, $p_i$ is a right (resp. left) child of $p_j$ if $p_j$ is a left (resp. right) parent of $p_i$. The \emph{ontogenetic graph} of a primordia configuration is the directed graph embedded in $\cyl$ whose vertices are the centers of the primordia and where oriented edges are drawn between primordia and their parents (if they have any). Given an ontogenetically ordered configuration ${\bf p}$ of $\cyl^K$, we call \emph{parents data} the information about which primordia are parents of which primordia. One way to represent this data is by a $K\times K$ \emph{parents data matrix}, whose $(i,j)^{th}$ entry is $1$ if $p_j$ is left parent of $p_i$, $-1$ if $p_j$ is right parent of $p_i$ and 0 if $p_i$ is not a parent of $p_j$. Note that the absolute value of this matrix is just the adjacency matrix of the (directed) ontogenetic graph. A \emph{primordia chain} for a configuration is a subset $\{p_{i_1}, \ldots p_{i_q}\}$ of distinct points in the configuration such that: \begin{itemize} \item{} The chain is connected by tangencies: for all $k \in {1, \ldots, q}$, primordium $p_{i_{k+1}}$ is either a right parent or right child of $p_{i_k}$. A chain can thus be represented by a piecewise linear curve through the centers of its primordia, which can be lifted to ${\mathbb R}^2$. \item{} The chain is \emph{closed} and does not fold over itself: the point $p_{i_q}$ is either a left parent or left child of $p_{i_1}$ and any lift at a point $P$ with $\pi(P)=p_{i_1}$ of the chain is the graph of a piecewise linear function over the $x$ axis in ${\mathbb R}^2$ joining $P$ to its translate $P+ (1,0)$. \end{itemize} The vector $\widevec{p_{i_{k}}p_{i_{k+1}}}$ is an \emph{up vector} of the chain if $p_{i_{k+1}}$ is a right child of $p_{i_{k}}$. The vector $\widevec{p_{i_{k}}p_{i_{k+1}}}$ is a \emph{down vector} if $p_{i_{k+1}}$ is a right parent of $p_{i_{k}}$. We call the number of up ({\it resp.} down) vectors in a chain its \emph{right} ({\it resp.} \emph{left}) parastichy number. If $p_{i_{k+1}}$ is always parent of $p_{i_{k}}$ for $k=1, \ldots m-1$ and then always a child for $i = m , \ldots, q$, we call the chain a \emph{necklace}. \\ Given a configuration ordered ontogenetically, a \emph{front at $k$} is a chain with primordia of indices greater or equal to $k$, such that any primordium (not necessarily in the configuration) which is the child of a primordium in the chain, without overlapping any other primordium in the chain, is necessarily at a height greater or equal to that of $p_k$. The parastichy numbers of a front are called \emph{front parastichy numbers}. \remark{ Most of the notions defined above are applicable to plant data by relaxing the definition of left (resp. right) parent to that of ``closest primordia below to the left (resp. to the right)" with some tolerance level. In the case of configurations on the disk, ``below" translates to ``farther away from the meristem" (see \cite{jpgr}). Algorithms using these notions were also used to produce Fig. \ref{fig:tilingfit} and \cite{fig:divVSparast}.} \subsection {Phyllotactic Tilings} \label{subsec:tilings} A \emph{Phyllotactic~tiling} is a set of points of $\cyl$ that can be obtained by summing to a base point cyclically ordered sums of ``up'' and ``down'' vectors. More precisely, a tiling ${T}$ is determined by a base point $(a,b)\in {\mathbb R}^2$, \emph{down vectors} $\dd_1, \ldots, \dd_M \in {\mathbb R}^2$ where each $\dd_k$ has components $x\geq 0, y< 0$, and \emph{up vectors} $\uu_1, \ldots, \uu_N \in {\mathbb R}^2$, each with components $x>0, y\geq 0$. Moreover, we ask that \begin{equation} \label{eqn:U+D=1} \sum_{j=1}^M \dd_j + \sum_{i=1}^N\uu_i = (1,0) \end{equation} We then define $${T}= \{\zz_{m,n}\in \cyl \mid m,n \in {\mathbb Z}\},$$ where $\zz_{m,n} = \pi(z_{m,n})$ with: $$ z_{m,n}= (a,b) + sumdown(m)+sumup(n) $$ and where \begin{equation} \label{eqn:sumupdown} sumdown(m) =\left\{\begin{array}{ccl} \sum_{j=1}^m \dd_j &\text{if}& m>0\\ 0 &\text{if}&m = 0\\ \sum_{j=0}^{|m|-1} -\dd_{M-j} &\text{if}& m<0 \end{array}\right. \end{equation} and we use the periodicity convention $\dd_{j+M}=\dd_j, \forall j \in {\mathbb Z}$. The function $sumup(n)$ is a cyclical sum of up vectors defined similarly, with the convention that $\uu_{i+N}=\uu_i, \forall i \in {\mathbb Z}$. The numbers $M,N$ of down and up vectors are called the \emph{parastichy numbers of the tiling}, a terminology justified by Proposition \ref{prop:paras}. The phyllotactic~tiling ${T}$ is \emph{rhombic} if all the up and down vectors have same length $\diam$, and we call $\diam$ the \emph{length} of the tiling. A \emph{fat tiling} is a phyllotactic~tiling such that the angles between \emph{any} two down and up vectors are in the interval $[\pi/3, 2\pi/3]$. It is not hard to see that the ontogenetic graph of a rhombic tiling is the embedded graph in the cylinder whose vertices are the points of the tiling and the edges are the down and negative up vectors connecting them. For general phyllotactic~tiling, we call this graph the \emph{graph of the tiling}. We call the connected components of the complement of the graph its \emph{tiles}. \remark{The following are simple but important consequences of the previous definitions: \begin{itemize} \item Equation \eqref{eqn:U+D=1} implies that the set $\tilde{T}= \{z_{m,n}\in {\mathbb R}^2 \mid m,n \in {\mathbb Z}\}$ is indeed the cover of the tiling ${T}$: if $z \in \tilde{T}$, so does $z + (1,0).$ \item Equation \eqref{eqn:U+D=1} also implies that $\zz_{m+kM,n+kN} = \zz_{m,n}$ for all $n, m, k \in {\mathbb Z}$. It also implies that the down vectors stringed together, followed by the up vectors form a necklace, which clearly has parastichy numbers $N, M.$ \item If all the down vectors $\dd_j= \dd$ are equal are equal and if up vectors $\uu_i= \uu$ are equal, and if the tiling parastichy numbers $M, N$ are coprime the tiling is in fact a lattice of parastichy numbers $M,N$, generated by $\dd$ and $\uu$. If the tiling is fat, $\dd = -z_M$ and $\uu = z_N$ in the notation of Section \ref{subsec:lattices}. If $M, N$ are not coprime, the tiling is a multijugate configuration. \item The condition of ``fatness" implies that a rhombic tiling can be seen as a configuration of tangent disks with no overlap. \end{itemize} \label{remark:tiling} \begin{figure}[h] \centering \includegraphics[width=6in]{rhombictiling_3_5.pdf} \caption{\footnotesize { A fat rhombic tiling of parastichy numbers $M=3, N=5.$ On the left, the up and down vectors are shown, on a front, and on a necklace. Translating the tiling from one star to another does not change it: If a pair of down and up vectors meet at a point, they meet again at the other extremity of the necklace they both belong to, inducing periodicity in the tiling (Theorem \ref{theorem:RTperiodic}). On the right, the ${\mathbb Z}^2$-like numbering of primordia of the same tiling. The equation $\zz_{m+kM,n+kN} = \zz_{m,n}$ is shown at primordia $z_{1,5}$ and $z_{0,6}$. Note that parastichies are obtained by keeping all the points that have same down ({\it resp.} up) index. }} \label{fig:orm} \end{figure} Given a certain type of subsets of the cylinder, we say that two subsets have the \emph{same shape} if one is a translation of the other. We call the set of all distinct classes of shapes the \emph{shape space}. \proposition{When $(M+N)\diam>1$, the set $\rtmnd$ of opposed rhombic tilings of parastichy numbers $(M,N)$ with vectors of length $\diam$ is a manifold of dimension $M+N$, possibly with boundaries and corners. Every strictly fat lattice is contained in an open neighborhood of such a manifold. The set of fat rhombic tilings is a submanifold (with possibly more boundaries and corners) of $\rtmnd$. The set $\rtmndk$ of segments of length $k>M+N$ of tilings in $\rtmnd$ is homeomorphic to $\rtmnd$. When considering the shape spaces of these respective types of objects, subtract 2 to the dimension of each set above.} \proof We parameterize $\rtmnd$ by the two independent variables for the base point $(a,b)$, and $M+N-2$ angles with the horizontal of $M-1$ down and $N-1$ up vectors. The last down and up vectors are given by the two sides of an isosceles triangle of equal sides of length $\diam$ between the points $(1,0)$ and $\sum_{j=1}^{M-1} \dd_j + \sum_{i=1}^{N-1}\uu_i$. Boundaries are determined by the inequalities $-\frac{\pi}2\leq \theta_j<0$ on the angles of down vectors, $j\in \{1, \ldots, N-1 \}$ and $0\leq \upsilon_j <\frac\pi 2, \quad j\in \{1, \ldots, M-1\}$ for the angles of up vectors, as well as some more complicated inequalities (that we won't make explicit here) involving differentiable functions of these $M+N-2$ angles that guarantee that the last up and last down vectors can be defined and satisfy the above inequalities as well. The statement on lattices derives from the fact that, for a strictly fat lattice, the inequalities on angles stated above are all strict. The condition of fatness only adds further inequalities on the angles $\theta_j, \upsilon_i$. The set of segments of tilings of sufficient length is parameterized by the same angles, with the same inequalities as the set of itself, and thus these sets are homeomorphic. When considering the shape spaces, the base point is removed from the parameterization, lowering the dimension by 2. \qed \label{prop:dimension} \subsection{Periodicity of Phyllotactic~Tilings } We say that an infinite configuration of points $X$ in $\cyl$ or ${\mathbb R}^2$ has \emph{period vector} $\vec V$ if $X+\vec V = X.$ \theorem{\bf (Periodicity of Tilings) }{The cover $\tilde{T}$ of a phyllotactic~tiling ${T}$ with down and up vectors and $ \dd_1, \ldots, \dd_M$ and $ \uu_1, \ldots, \uu_N$ has the two independent period vectors $\vec D = \sum_{j=1}^M \dd_j$ and $\vec U = \sum_{i=1}^N \uu_i$. Since in $\cyl$ these two vectors sum to 0, ${T}$ has only one independent period vector, say $\vec U$.} \label{theorem:RTperiodic} \begin{proof} Pick a point $z_{m,n}\in \tilde{T}$. We will do the case $m,n >0$, the other cases derive from this one and the equality $z_{m+kM,n+kN} = z_{m,n}+(k,0)$. From $\uu_{j+N} = \uu_j$, we obtain: \begin{eqnarray*} z_{m,n} + \vec U &=& (a,b) +\sum_{i=1}^m \dd_i + \sum_{j=1}^n \uu_j + \sum_{j=1}^N \uu_j\\ &=& (a,b) +\sum_{i=1}^m \dd_i + \sum_{j=1}^{n+N} \uu_j = z_{m,n+N} \in \tilde{T} \end{eqnarray*} Likewise, we obtain $z_{m,n} + \vec D = z_{m+M,n} \in \tilde{T}.$ This proves that $\tilde{T} + \vec U \subset \tilde{T}$ and $\tilde{T} + \vec D \subset \tilde{T}$. Inclusions in the other direction are proven identically, by subtracting the vectors $\vec U, \vec D$ to points of $\tilde{T}$ and showing that one obtains points of $\tilde{T}$. The statement about the periodicity of ${T}$ already contains its proof. \end{proof} The periodicity above can be expressed by saying that phyllotactic~tilings are multilattices. A \emph{multilattice} $\Lambda$ of $\cyl$ or ${\mathbb R}^2$ is the union of a number $k$ of copies of the same lattice $L$, each translated by a different vector $v_i$: $$ \Lambda = \bigcup_{i=1}^k (\vec v_i+L). $$ } Note that the generating vector(s) of the lattice $L$ is (are) period vector(s) of the multilattice. To see that a phyllotactic~tiling is indeed a multilattice, let $L$ be the cylindrical lattice generated by $\vec U = \sum_{k = 1}^{N} \uu_k$ and let the $v_i's$ be vectors of the form $\sum_{i=1}^m \dd_i + \sum_{j=1}^{n},\uu_j, m\in \{1, \ldots,M\}, n\in \{1, \ldots,N\}$. This interpretation of tilings as multilattices explains the appearance of ``parallelogram" shaped tiles of ``size" $M, N$ that repeat periodically in a tiling. \subsection{Parastichies of Phyllotactic~Tilings} We call \emph{parastichies} at a point $\zz_{m,n}$ of a tiling in $\cyl$ the two subsets of the tiling obtained by successively adding or subtracting all the up vectors (starting with $\uu_{m+1}$ and following the cyclical order) or all the down vectors (starting at $\dd_{n+1}$ and following the cyclical order). We call these parastichies \emph{left and right parastichies} respectively, denoting their directions as they are traversed down from the point $\zz_{m,n}$. A \emph{connected parastichy} is the piecewise linear curve formed by joining the successive parastichy points with the up or down vectors that connect them. We denote by $LP_{m,n}$ and $RP_{m,n}$ the lifts of the left and right connected parastichies through $z_{m,n}.$ Hence $LP_{m,n}$ is the piecewise linear curve through the points $\{z_{m,j} \mid j\in {\mathbb Z}\}$ and $RP_{m,n}$ is the piecewise linear curve through the points $\{z_{i,n} \mid i\in {\mathbb Z}\}$, where two successive points are joined by an up (resp. down) vector. \\ In the case that the tiling is a fat lattice or multijugate configuration, the above definition coincides with the classical definition of parastichy: the regular helices joining nearest left (resp. nearest right) neighbors. \\ In the case that the tiling is a fat lattice or multijugate configuration, the above definition coincides with the classical definition of parastichy: the regular helices joining nearest left (resp. nearest right) neighbors. The following underlines the similarity between tilings and lattices and justifies the qualifier of rhombic given to some of the tilings we consider: \proposition{{\bf(Properties of lifted parastichies)} \label{prop:propliftparas} The lift of a connected left parastichy $LP_{m,j}$ intersects the lift of a connected right parastichy $RP_{i,n}$ at the unique point $z_{m,n}$. The curves $LP_{m,n}$ and $LP_{i,k}$ intersect if and only if $m=i$ (in which case they are equal); $RP_{m,n}$ and $RP_{i,k}$ intersect if and only if $n=k$ (in which case they are equal). The tiles of the cover of a phyllotactic~tiling are parallelograms, whose vertices are of the form $z_{m,n}, z_{m-1,n}, z_{m,n-1}, z_{m-1,n-1}$ for some integer pair $m, n$. In the case of a rhombic tiling, these tiles are rhombi.} \proof The curves $LP_{m,j}$ and $RP_{i,n}$ contain $z_{m,n}$. We show that they do not intersect in any other point. If they crossed at another point of the tiling cover, there would exist integers $k,l$ such that $z_{m,k}= z_{l,n}$. But this implies $\sum_{j=m+1}^l \dd_j = -\sum_{i=k+1}^n\uu_i$ (we've assumed $l>m>0, n>k>0$, other cases are similar) which is absurd in the plane since up and down vectors are in different quadrants. The case where the parastichies cross at segments between tiling points would yield an equally absurd equality between a linear combination of up vectors and a combination of down vectors - with real coefficients this time. \lemma{In the lift of a phyllotactic~tiling, each curve $LP_{m,n}$ is homeomorphic to a line and separates ${\mathbb R}^2$ into two unbounded regions homeomorphic to a half plane, containing the respective subsets $\{ z_{i,j}, i<m, j\in {\mathbb Z}\}$ and $\{ z_{i,j}, i>m, j\in {\mathbb Z}\}$ of the tiling. And similarly for $RP_{m,n}$.} \proof (of the lemma). $LP_{m,n}$ is a periodic perturbation of the line $L_l: t \mapsto z_{m,n}+ t U$ where $U=\sum_{i=1}^N \uu_i$, whereas $RP_{m,n}$ is a periodic perturbation of the line $L_r: t \mapsto z_{m,n}+ t[(1, 0)- U]$, and thus lifts of connected parastichies have the same asymptotic directions as the corresponding lines $L_l, L_r$. Since all up vectors are in the same quadrant, the orthogonal projection on $L_r$ of $LP_{m,n}$ is a homeomorphism which can be extended to an isotopy (bijective, continous deformation) of the plane, and similarly for the left parastichy. We sketch the isotopy, leaving the details to the reader: draw lines perpendicular to $L_r$ through the parastichy points $z_{m,j}, j\in {\mathbb Z}$. The lines separate the plane into parallel strips. Apply a shear within each strip so that the vector $\widevec {z_{m,j}z_{m,{j+1}}}$ becomes parallel to $L_r$, translating the other strips so that the transformation is continuous. The points $\{ z_{i,k} \mid i<m, k\in {\mathbb Z}\}$ are all on one side of $LP_{m,n}$ through $z_{m,n}$: the right connected parastichy of each point $z_{i,k}, i<m,$ crosses $LP_{m,n}$ at $z_{m,k}$, and thus at no other point. In particular, the point $z_{i,k}, i<m$ is on the same side of $LP_{m,n}$ as $z_{m-1,k}.$ Since the determinants of the angles between the vectors $\dd_{m}= \widevec{z_{m-1,k}z_{m,k}}$ and the vector $\uu_{k-1}= \widevec{z_{m,k}z_{m,k-1}}$ of $LP_{m,n}$ are of the same sign for all $k$, the points $z_{m-1,k}$ are all on the same side of $LP_{m,n}$. Thus $\{ z_{i,k}, i<m, k\in {\mathbb Z}\}$ are all on one side of $LP_{m,n}$. Similar statements hold for right parastichies. \qed \label{lemma:parasthalfplane} Back to the main proof, from the lemma, we obtain that $LP_{m,n}$ and $LP_{i,k}$ intersect if and only if $i=m$, in which case they coincide. Moreover, one left connected parastichy is a translate of another, as it is easy to check that (assuming $m>i$) $LP_{m,n} = LP_{i,k} + \sum_{j=i+1}^m\uu_i$. Similarly for right parastichies. Consider now the tiles adjacent to a point $z_{m,n}$. Since there are only four edges of the graph of the tiling adjacent to $z_{m,n}$, there are at most four tiles adjacent to that point. Without loss of generality, we only consider the tile sharing the edges $\widevec{z_{m-1,n} z_{m,n}}=\dd_m$ and $\widevec{z_{m,n-1} z_{m,n}}=\uu_n.$ We claim that this tile has exactly the vertices $z_{m,n}, z_{m-1,n},$ $z_{m,n-1},$ and $ z_{m-1,n-1}$. These points form the vertices of a parallelogram or a rhombus if the tiling is rhombic, with edges $\dd_m$ and $\uu_n$. To check that this indeed forms a tile, there remains to show that no other than these four tiling points is included in this parallelogram. The parallelogram is in a quadrant formed by the parastichies $LP_{mn}$ and $RP_{mn}$ and containing the point $z_{m-1,n-1}$. From Lemma \ref{lemma:parasthalfplane}, any other point of the tiling contained in the parallelogram must be of the form $z_{i,j}$ with $i\leq m, j\leq n$. But the parallelogram is also contained in the quadrant formed by the parastichies $LP_{m-1,n-1}$ and $RP_{m-1,n-1}$ and containing the point $z_{m,n}$, which forces $z_{i,j}$ to satisfy $i\geq m-1, j\geq n-1$. In other words, the only points of the tiling that the parallelogram may contain are its already defined vertices. \qed \proposition{{\bf (Properties of parastichies)} Connected left parastichies $\underline{LP}_{m,n}$ and $\underline{LP}_{i,k}$ cross only if and only if $i = m \mod M$, in which case they are equal. Thus there are $M$ left parastichies. Likewise $\underline{RP}_{m,n}$ and $\underline{RP}_{i,k}$ cross if and only if $k = n \mod N$ in which case they are equal, and there are $N$ right parastichies. Left and right parastichies $\underline{LP}_{m,n}$ and $\underline{RP}_{i,k}$ cross at the points $\zz_{m+qM, k+pN}, q, p \in {\mathbb Z}$. Interspaces of a phyllotactic~tiling are parallelograms.} \label{prop:paras} \proof Since their lifts do not intersect non trivially by Proposition \ref{prop:propliftparas}, left parastichies can only coincide or be disjoint. $\underline{LP}_{m,n}$ has lifts $LP_{m,n}+q(1,0) = LP_{m+qM,n+qN}, q \in {\mathbb Z}$ by Remark \ref{remark:tiling}. Likewise Parastichy $\underline{LP}_{i,k}$ has lifts $LP_{i+pM,k+pN}, p \in {\mathbb Z}$. The two parastichies coincide if and only if $m+qM = i+pM$ for some $p, q \in {\mathbb Z}$, {\it i.e. } if $i = m \mod M$. There are thus $M$ distinct parastichies. The proof is identical for right parastichies. Parastichies $\underline{LP}_{m,n}$ and $\underline{RP}_{i,k}$ intersect at projections by $\pi$ of intersection points of two of their lifts $LP_{m+qM,n+qN}, q \in {\mathbb Z}$ and $RP_{i+pM,k+pN}, p \in {\mathbb Z}$. By Proposition \ref{prop:propliftparas}, these intersection points are $z_{m+qM, k+pN}, q, p \in {\mathbb Z}.$ A tile of the cover of a phyllotactic~tiling is entirely in a fundamental domain and is thus isomorphic to its projection on the cylinder, which must thus be a parallelogram and a tile. All tiles arise this way. \qed\\ \subsection{Front vs. Tiling Parastichy Numbers} \label{subsec:parastnum} The following proposition connects the three notions of parastichy numbers encountered so far. The following proposition, about chain parastichy numbers, clearly applies to the special case of front parastichy numbers. \proposition{In a phyllotactic~tiling with $M$ down and $N$ up vectors, {\it i.e. } with parastichy numbers $M,N$, the parastichy numbers of any of its chains are also equal to $M,N$, which are equal to the numbers of left and right parastichies. All the up and down vectors of the tiling are represented in the chain. A chain must have $M+N$ primordia.} \label{prop:parastnum} \proof A left parastichy coming from above a chain $C$ must first intersect $C$ at the origin of one of its down vector, whereas a right parastichy first intersects $C$ at the origin of an up vector. This provides a one-to-one correspondence between left and right parastichies and down and up vectors in a chain respectively. Hence there are $M$ down and $N$ up vectors (for a total of $M+N$ primordia) in $C$. On the other hand, each point of the parastichy $LP_{(k-1, j)}$ is the origin of the down vector $\dd_k$, and likewise for $RP_{(i, l-1)}$ and $\uu_l$. This provides a 1-1 correspondence between parastichies and the vectors that originates at their points, and thus a 1-1 correspondence between the set of up and down vectors of the tiling and those of $C$. \qed \remark {\bf (Number of petals in daisies)} The predominance of flowers whose number of petals is a Fibonacci number was observed before people had noticed the relationship of these numbers to that sequence \cite{grew}. Modern studies also show that the number of petals in \emph{asteracea} ({\it e.g.}\ daisies) has a statistical peak at Fibonacci numbers (see references in \cite{battjes}). Proposition \ref{prop:parastnum} provides, among other things, a possible explanation as to why this might be. If we accept that parastichy numbers of the inflorescence of these plants are predominently successive Fibonacci numbers, this phenomenon would simply be a consequence of the fact that the ray petals occur, statistically, at a single primordia front. A front has $N+M$ primordia, a Fibonacci number if $N$ and $M$ are successive Fibonacci numbers. It would be interesting to check experimentally the hypothesis of petals forming predominantly at a single front. \theorem{In a fat rhombic tiling ${T}$, there is a unique primordia front at each point.} \proof We describe the algorithm that builds the front $p_{i_1}, \ldots, p_{i_{M+N}}$. Given a point $p_{i_1}=z_{m,n}$ of ${T}$, let $p_{i_2}= z_{m+1,n}$ be the right parent of $p_{i_1}$. By induction let $p_{i_{j+1}}$ be the right child of $p_{i_j}$ unless this child is strictly higher than $p_{i_1}$, in which case let $p_{i_{j+1}}$ be the right parent of $p_{i_j}$. We now show that this process has an end. Suppose by contradiction that the piecewise linear curve $c_r$ we built crosses the vertical line through $p_{i_1}+(1,0)$ strictly below that point. Construct with a similar algorithm a curve $c_l$ starting from $p_{i_1}+(1,0)$, but going left. The curves $c_r$ and $c_l$ necessarily cross at a tiling point in the strip between the vertical lines through $p_{i_1}$ and $p_{i_1}+(1,0)$. Let $Q$ be the rightmost such crossing point. The right parent of $Q$ is in $c_r$. The right child of $Q$ is in $c_l$ and is thus lower than $p_{i_1}$, which contradicts the algorithm for $c_r$. The set of points obtained is clearly a chain. It is a front because a child of any of its primordia is higher than $p_{i_1}$, by construction. \qed The periodicity proven in the following proposition is illustrated in Fig. \ref{fig:Periodpen}. \proposition{ There are $MN$ primordia in a phyllotactic~tiling ${T}$ of parastichy numbers $M, N$, between a point $z\in {T}$ and its translate $Z= z+\vec U$, including $Z$, (where $\vec U = \sum_{i=1}^N \uu_i$) in the ontogenetic order.} \proof Let ${\cal F}_z$ and ${\cal F}_Z$ be the fronts at $z$ and $Z$ respectively. Because of the periodicity, ${\cal F}_Z = {\cal F}_z + \vec U$. The segment of ${T}$ comprised between $z$ and $Z$ (including $Z$) includes all the points between ${\cal F}_z$ and ${\cal F}_Z$, as well as ${\cal F}_Z$. The segment comprises all the segments of $N$ primordia of the left parastichies strictly above ${\cal F}_z$. Since there are $M$ such parastichies, the number of points in the segment including $Z$ is $MN$. \qed \label{prop:frontperiod} \section{The Snow Dynamical System $S$} \label{sec:snow} \subsection{Definition of $S$} \label{subsec:snowdef} Remember that, in the introduction, we gave the following intuitive definition of the Snow model: given a configuration of disks of equal diameter $D$ on the cylinder, place a new one in the lowest position possible on top of the configuration, avoiding overlaps. To turn this intuitive definition into a mathematical one, we made the choice of considering configurations of constant, finite number of disks on the cylinder. We achieve this simply by removing the last primordium in our list at each iterate, making sure that there are enough primordia so that this removal does not have perverse, artificial effects. This allows us to use the framework of dynamical systems where the space of configurations is of constant dimension throughout the time evolution. We also require that the configurations be ordered by height, the highest being the first one - so that the lowest one is the one removed at each iterate. To decide on the location of the new disk (primordium), we slide a circle $y =h$ up the cylinder, starting at the top of the configuration, and at each height $h$, we check whether there is room to place a disk of radius $D$ without overlapping disks in the configuration. This checking is done via computing minimum distances to points of the configuration along that circle. When the test is positive, we add the new disk and erase the last disk in the list. We call the height $y=y_*$ at which there is first room to place a primordium at the edge of the meristem the \emph{threshold} value. In dry mathematical terms, this translates into (see Fig. \ref{fig:MinDis} for an illustration): \definition{({\bf Snow map}) Define the map $S$~on $K$-tuplets of points of the cylinder $\cyl$ by $$S (p_1, \ldots,p_K) = (P_1(p_1,\ldots,p_K), p_1, \ldots,p_{K-1}) $$ where each point $p_k$ is given by its angular and height coordinates $(x_k, y_k)$, and where the function $P_1$ determines the center of the new primordium in the following way. Let $$ Dis_{y,k}(x) = dist{((x,y),p_k)},$$ where $dist$ is the usual euclidean distance on $\cyl$, let $$MinDis_y(x) = \min_{k\in \{1, \ldots, K\}} Dis_{y,k}(x),$$ and let $$y_* = \min \{ y\geq \max_k y_k \ \mid \max_x MinDis_y(x) = D\}.$$ Finally, define $P_1(p_1,\ldots,p_k)$ to be the point $(x_*, y_*)\in \cyl$ at which this ``minimaximin" is attained. If it is attained at several possible values of $x$, choose the smallest of those $x$ in the interval $(-\frac12, \frac 12]$. \label{def:snow}} \begin{figure}[h] \centering \includegraphics[width=4 in]{MinDis.pdf} \caption{\footnotesize {The function $MinDis_y$ at the threshold value $y_*$, shown below the corresponding configuration. The maxima of $MinDis_y$ occur when the graphs (represented with lighter lines) of two convex functions $Dis_{y,k}$ cross. Thus at a maximum the corresponding test point $(x,y)$ is equidistant to its two nearest neighbors in the configuration. As the threshold value $y_*$ is reached where $\max_xMinDis_{y_*}(x) = D$, the point $(x_*, y_*)$ at which the maximum is attained is thus at distance $D$ from its two nearest neighbors $p_m$ and $p_n$: there is exactly enough space for a disk of radius $D$, and it must be tangent to the disks centered at $p_m$ and $p_n$. The convexity of the functions $Dis_{y,m}$ and $Dis_{y,n}$ also implies that $p_m$ and $p_n$ are on opposite sides of $P_1$. } } \label{fig:MinDis} \end{figure} \remark{Douady and Couder \cite{douadycouder} used a similar idea in the algorithm for their Snow computer models (see also \cite{kunzthesis}). Instead of the $MinDis_y$ function, they used potentials which are the sum of ``repulsive" interactions with existing primordia, with interactions decaying as the distance increases. The map $S$~can be seen as the limit of such models as their \emph{rate} of decay goes to infinity: in the limit, the test primordium only ``feels" the closest primordium, as is the case in $S$. In \cite{douadycouder}, this limit is called the ``hard disk" case.} \remark{As shown in Figure \ref{fig:MinDis}, and its caption, the geometry of the function $MinDis_y$ implies the following: \begin{enumerate} \item {\it Equidistance and tangency to nearest neighbors. } If the two nearest neighbors of $P_1$ are less than $2D$ apart, $P_1$ is tangent to them - and thus equidistant to them. If they are farther apart, $P_1$ is located at their midpoint. We use the term of ``parents" for the two closest neighbors, even in the latter situation, generalizing the notion of Section \ref{subsec:parentsEtc}. Correspondingly, $P_1$ is the child of its parents. \item {\it Opposedness of parents.} Generically (see Section \ref{subsec:differentiability}) , the new primordium has only two parents. In this case the centers of these two anterior primordia must lay on opposite sides of a vertical line through the center of the new one. Hence, generically $P_1$ has a left and a right parent. \end{enumerate} } \label{remark:Sgeom} These properties form the basis of our computer algorithm, in which we draw lists of candidates new primordium by placing disks tangentially to appropriate pairs of existing disks on sufficiently dense configurations. We then weed out the candidates that overlap with existing primordia or whose parents are not opposed and choose the lowest of the remaining candidates. In contrast to the above definition, our computer algorithm may add disks lower than the highest disk in the given configuration, when there is room for one - i.e. if the configuration has ``holes". For instance, the algorithm may fill in a necklace until it forms a front. Since all ``decent'' configurations eventually fill in and form a front at their top, we chose to elude, in this paper, the issue of which configurations eventually fill in and concentrate on configurations which already terminate by a front, or perturbations of such configurations. \remark{\bf (A potential alternate definition of front)} In the case of a rhombic tiling, it is not hard to check that the primordia that contribute to the function $MinDis_y$ for a given $y$ form a front. Thus, for rhombic tilings, a front at a new born primordium can be defined as the set of primordia closest to the meristem. One could use this to generalize the definition of front to general configurations, letting go of the requirement of tangency. \label{remark:frontclosest} We will be specially interested in the lattices and tilings that are ``preserved" by $S$. To make this notion more precise: \definition{{\bf (Dynamical Configurations)} An infinite configuration ${\bf p}$ is called \emph{dynamical} if given any of its segments $X$ of length $K$, $$S$(X)$ is the segment of ${\bf p}$ immediately above, {\it i.e. } obtained by shifting the ontogenetic indices of $X$ by 1.} \label{def:dynamicalconfig} \subsection{Domain of Differentiability of $S$} \label{subsec:differentiability} We call a configuration in $\cyl^K$ a \emph{critical configuration} if two distinct pairs of parent primordia lead to two candidate children primordia at the same (lowest) level for the map $S$. This may occur when the function $MinDis_{y*}(x)$ attains its maximum at two distinct values of $x$. But it can also occur as a \emph{triple tangency} where two pairs of primordia sharing a common primordium give rise to the same child. In that case, the graphs of three functions $Dis_{y_*,k}$ forming $MinDis_{y_*}$ cross at the maximum. \proposition{ The set of critical configurations is a closed set, finite union of manifolds (maybe with boundaries) of codimension at least 1 (and thus of measure 0) in $\cyl^K$.} \proof Given the location of one child candidate, one needs one (differentiable) equation to express the fact that another candidate belongs to the same horizontal line. This equation can be written in the form $f({{\bf p}}) = 0$, where ${{\bf p}}$ denotes a configuration in $\cyl^K$, and $f$ is the algebraic function giving the difference of height of children of two distinct pairs of primordia in ${{\bf p}}$. The gradient of $f$ is always non zero on the level set $f =0$. Indeed, let ${{\bf p}}$ be such that $f({{\bf p}})=0$ and let $p_L$ and $p_R$ be the parents of one of the two candidates. Choose an infinitesimal deformation $\Delta {\bf p}$ of ${{\bf p}}$ that rotates $p_R$ around $p_L$, leaving all other primordia fixed. The corresponding displacement of the candidate child is $\frac{\Delta {\bf p} }2$ since it rotates at half the radius. $f({\bf p} +\Delta {\bf p})$ is approximately the vertical component of $\frac{\Delta {\bf p}}2$, which is not 0, since $p_R$ and $p_L$ are not above one another. Hence $0$ is a regular value for $f$ and the equation $f({{\bf p}}) = 0$ defines locally a manifold of codimension 1 (see the Preimage Theorem, \cite{difftopo}). Each choice of two distinct ordered pairs of primordia gives rise to such a manifold. The number of such critical manifolds is thus bounded by the choices of two distinct ordered pairs of distinct indices in $\{1, \ldots, K\}$. The critical set is closed: for each of the choices of pairs of (ordered) pairs of parents, the zero level set of the corresponding function $f$ is closed: at the points of $\cyl^K$ that a given pair of parents ceases to correspond to maxima, another pair must yield a maxima. Hence the limit of a sequence of critical configurations is always critical. \qed We call a configuration ${\bf p}$ \emph{ $q$-non-critical} if $S^k({\bf p})$ is not critical for $k\in \{0, \ldots , q\}$ (we use $S^0=Id$ here). We denote by $NC_q$ the set of $q$-non-critical configuration. Note that $NC_{q+1}\subset NC_q$. \proposition {The map $S$~is continuous and differentiable on the open set $NC_0$ of non-critical configurations. More generally, the map $S^{q+1}$ is continuous and differentiable on the open set $NC_q$ of $q$-non-critical configurations.} \label{prop:differentiable} \proof $NC_0$ is the complement of a closed set and is thus open. Outside of the set of critical configurations, the function $x\mapsto MinDis_y(x)$ has a unique maximum for each $y$ near the threshold value $y_*$. This maximum corresponds to two parent primordia, whose child $P_1$ is strictly the lowest candidate primordium. In a neighborhood of a non-critical configuration the parents indices of the new primordium do not change. $P_1$ is a differentiable, algebraic function of the two parents ($P_1$ is the intersection of two circles centered at the parents). So the first component function $P_1$ of $S$~in Definition \ref{def:snow} is continuously differentiable (and thus continuous) on non-critical configurations. All other component functions of $S$~are trivially continuously differentiable. We show that the set $NC_q$ is open, and that $S^{q+1}$ is differentiable on it, by induction on $q$. We have proven the first step of the induction for $q=0$ above. Assume $NC_k$ is open and $S^{k+1}$ is continuous on $NC_k$ for $k<q$. Let ${\bf p} \in NC_q$. This implies that $S^q({\bf p})\in NC_0$ and that ${\bf p} \in NC_{q-1}$. Since $S^q$ is continuous on the open set $NC_{q-1}$ (by induction hypothesis) and $NC_0$ is open, we can find an open neighborhood $U({\bf p})\subset NC_{q-1}$ such that $S^q(U({\bf p}))\subset NC_0$. This implies that $U({\bf p})\subset NC_q$ which makes $NC_q$ open. $S^q$ is differentiable on $NC_q$ since this set is a subset of $NC_{q-1}$. Since $S^q(NC_q)\subset NC_0$, and $S$ is differentiable on $NC_0$, the composition $S^{q+1}$ is differentiable on $NC_q$, by chain rule. \qed\\ We call the \emph{orbit segment of length $q$} of a configuration ${\bf p}$ the configuration $X_q({\bf p})$ in $\cyl^q$ made of $q$ first points of $S^q({\bf p})$. \begin{corollary}{\bf (Continuity of Parents Data )} The function associating to a configuration ${\bf p}$ the parent data of $X_{q+1}({\bf p})$ is constant on each connected component of $NC_q$. \end{corollary} \label{corollary:parentscontinuity} \begin{proof} Connected components of $NC_q$ are by definition the open sets of configurations whose $k^{th}$ new primordium under $S$~have the same parent indices, for $k\in \{1, \ldots, q+1\}$. \end{proof} Discontinuities of $S$~do occur at configurations on the boundaries of the connected components of $NC_0$, where there are multiple maxima for $MinDis_y$ at the threshold level $y = y_*$. Indeed, two different configurations arbitrarily close to such a critical one may yield a new primordium in drastically different positions, although in the long run two such configurations might look arbitrarily similar. This switch of ontogenetic order is what makes the divergence angle a less than adequate classifying tool for the geometry of configurations (see Section \ref{subsec:fibonacci}). The map $S$~also fails to be differentiable at configurations with a triple tangency, for which $P_1$ has more than two equidistant nearest neighbors, even though it is continuous there. (This occurs for instance when the configuration is a segment of hexagonal lattice, corresponding to at a turning point of a branch of the bifurcation diagram of Figure \ref{fig:bifdiag}.) At those points, there is more than one choice for the differential matrix, violating differentiability. \section{Dynamics and Geometry} \label{sec:dyngeom} In this section, we show that fronts determine the future of a configuration and the its changes of parastichy numbers. We also give some strong evidence that the set of dynamical tilings forms an attractor for $S$. \subsection{Dynamical Properties of Primordia Fronts} \label{subsec:frontdyn} We say that a front $\cal F$ is a \emph{top front} for a configuration ${\bf p}$ if $\cal F \subset {\bf p}$ and the points of ${\bf p}$ are in or below $\cal F$. We based some of our fastest algorithms for $S$~on the following proposition: \proposition{If a configuration ${\bf p}$ has a top front, so does $S({{\bf p}})$ and the top front of $S({{\bf p}})$ is the union of the new primordium $P_1$ and of the points of the top front of ${\bf p}$ that are not between the parents of $P_1$. If two configurations in $\cyl^K$ have the same top front, they have the same orbit segments.} \proof If ${\bf p}$ has top front $\cal F$, the only functions $Dis_{y,k}$ whose graphs contribute parts to the graph of $x\mapsto MinDis_y(x)$ in the definition of $S$~are those corresponding to primordia in $\cal F$ (Remark \ref{remark:frontclosest}). Hence $\cal F$ determines the new primordium $P_1$ in the iteration. One can check that the union of $P_1$ and of all the primordia in $\cal F$ except for those between (if any) the left parent and right parent of $P_1$ (in the front ordering) constitute a top front for $S({{\bf p}})$. By induction all the subsequent primordia in the orbit are determined by $\cal F$. \qed\\ The following proposition is at once simple and we think fundamental to understand phyllotactic transitions - pointing to the central role of the local geometry of fronts. The proof is essentially by picture (See Fig. \ref{fig:transitions}). \proposition{Given a configuration ${\bf p}$ with a top front $\cal F$, the top front $\cal F'$ of $S({{\bf p}})$ has same parastichy numbers as $\cal F$ if and only if the left and right parents of the new primordium $P_1$ are separated by exactly one primordium in $\cal F$. In this case $P_1$ creates a rhombic tile with $\cal F$. If the parents of $P_1$ are adjacent in $\cal F$, one of the parastichy numbers of $\cal F$ increases by one, and $P_1$ forms a triangular tile with $\cal F$. Finally, if the parents are separated by two primordia in $\cal F$, one of the parastichy numbers decreases by one, and the new tile is pentagonal.} \label{prop:fronttransitions} \begin{figure}[h] \centering \includegraphics[width=6in]{transitions.pdf} \caption{\footnotesize{\bf The different front transitions. }{\sf (A)} A triangle transition. One down vector is replaced by another down (angle $-\pi/3$ with the original), and an up vector (angle $\pi/3$ with the down vector replaced). One of the front parastichy numbers, the up number, increases by one, while the down number stays the same. {\sf (B)} A rhombus transition. A pair of down and up vectors has switched order in the front, with no change in the sets of down and up vectors. {\sf (C)} A pentagon transition. One down vector and a pair of up vectors are replaced by one up and one down. Hence the front up parastichy number decreases by one. Note that there are no simple relationship between the angles of the new vectors and the old ones they replace. {\sf (D)} A (much rarer) hexagon transition. A pair of down and a pair of up vectors are replaced by one vector each. These four orbit segments are taken from the same orbit, with A, B, C corresponding to successive iterations, and D an anterior one. } \label{fig:transitions} \end{figure} \proof The transitions are understood by the number of down and up vectors between the left and right parents of the new primordium. These are always replaced by a pair of up and down vectors, in that order. The numbers of up and down vectors replaced determine the shape of the new tile of the ontogenetic graph, and the change of front parastichy numbers. See Fig. \ref{fig:transitions}. \qed In our numerical experiments, the rhombic transitions are by far the most common, followed by triangles and pentagons - equally common when $\diam$ is constant, as they usually come in pairs. Hexagons are much rarer. \conjecture{Configurations with top fronts cannot yield polygonal tiles with more than 6 sides.} \subsection{Fixed Points and Periodic Orbits in the Shape Space} \label{subsec:fp.po} We now consider the shapes of configurations that are preserved under some iteration of $S$. Configurations whose shape is preserved under \emph{any} iteration (fixed points) are found to be the same as for the Hofmeister map $\phi$ of \cite{jns}. In other words (see Definition \ref{def:dynamicalconfig}), the dynamical lattices of $S$~and $\phi$ coincide, for appropriate choices of parameters. On the other hand, we will see that many dynamical tilings for $S$~are not dynamical for $\phi$. We first introduce a parameterization of the shape space of configurations, and the map $\overline S$~that $S$~induces on it. The shape of a configuration is determined by its relative coordinates: $$\ovv p_k =p_{k+1}-p_{k}, \qquad k \in \{1, \ldots, K-1\}.$$ This set of coordinates can be seen as a parameterization of the quotient space of the set of cylindrical configurations modulo the translations on the cylinder. As a particular example, a helical lattice in this quotient space is simply given by the equations $\ovv p_k=p_*$ for all $k\in \{1, \ldots, K-1\}$ and for a fixed $p_*\in \cyl$. The map $S$~induces a map $\overline S$~on this quotient space, of the form $$\overline S(\ovv p_1 \ldots, \ovv p_{K-1}) )=(\ovv P_1, \ldots, \ovv P_K)= (\ovv P_1(\ovv p_2 \ldots, \ovv p_{K-1}),\ovv p_2 \ldots, \ovv p_{K-2})). $$ \emph{Since $K$ above is an arbitrary large integer, we set $K = K-1$ for a lighter notation in the rest of this section.} Similarly to $S$, in the Hofmeister map $\phi$ the placement of the new primordium is determined by the maxima of the function $MinDis$ (called $D$ in \cite{jns}), but instead of being at a threshold level $y = y_*$, it is evaluated at fixed, equal intervals of $y$. The interval length, called internodal distance and denoted by $y$ in \cite{jns}, is the parameter for that system. In \cite{jns}, inspired by \cite{leelevitov}, we used hyperbolic geometry to analyse in detail the fixed points set of the Hofmeister map for all values of $y$. It turned out to be a subset of the set of (segments of) fat rhombic lattices, see Figure \ref{fig:bifdiag}. This latter set, described by van Iterson \cite{vaniterson} must be truncated along crucial segments of its branches to obtain lattices that are dynamical for $\phi$. The same diagram was obtained by Douady \cite{douady} in a geometric context which is essentially that of this present paper, using Euclidean geometry only. The next proposition shows that the fixed points sets of the maps $\phi$ and $\overline S$~are identical when considering all values of the parameters $y$ and $D$. \proposition{Fixed points for the map $\overline S$~are segments of fat rhombic lattices in $\cyl^{K}$. These fixed points are the same as for the Hofmeister map $\phi$ of \cite{jns} and their set can be visualized in the truncated van Iterson diagram of Figure \ref{fig:bifdiag}. } \proof A fixed point for $\overline S$~is such that $(\ovv P_1, \ldots, \ovv P_K)=(\ovv p_1 \ldots, \ovv p_K)$. On the other hand, the definition of $S$~gives $\ovv P_k=\ovv p_{k-1}, \ k\in \{2,\ldots,K\}$. Hence, $\ovv p_k =\ovv p_{k-1}, \ k\in \{2,\ldots,K\}$. It easy to see that this yields, in the absolute coordinates $p_k= p_0+kp_*$ for some $p_0$ and $p_*$ independent of $k$, proving that fixed points of $\overline S$~are segments of helical lattices. By Remark \ref{remark:Sgeom}, these lattices must be rhombic and opposed. If ${\bf p}$ is fixed for $\overline S$, we just saw it is a segment of lattice, and by periodicity of the lattice, it has constant internodal distance $y$ between successive points in its ontogenetic order. Since the new primordium maximizes $MinDis$ at its level, it must correspond to the choice of new primordium for the map $\phi$, for that value of the parameter $y$. Thus ${\bf p}$ is fixed under $\phi$, for that value of parameter $y$. Conversely, if ${\bf p}$ is fixed under $\phi$, we showed in \cite{jns} that it is a segment of (fat) opposed rhombic lattice. Let $D$ be the mutual distance of points in this lattice. The new primordium of ${\bf p}$ under $\phi$ maximizes $MinDis$ at the threshold values corresponding to $D$ and is thus the new primordium for $S$, proving ${\bf p}$ is fixed for $\overline S$. \qed \remark In the bifurcation diagram, there is a monotone correspondence $y\mapsto D(y)$ between the parameter $D$ for the map $S$~and the internodal distance $y$ used as parameter for $\phi$ (see \cite{douadycouder}). When the $M,N$ branch is not truncated (the so called ``regular case", where $M<2N$ and $N<2M$, see \cite{jns}) the angle between the up vector and the down vector of the lattice spans the range of $[\frac{\pi}3, \frac{2\pi}3]$. Simple trigonometry on a necklace of the lattice shows that this corresponds to the parameter $D$ ranging in $\left[({M^2+N^2+MN})^{-\frac12}, ({M^2+N^2-MN})^{-\frac12}\right]$. \label{remark:Drange} \begin{figure}[h] \centering \includegraphics[width= 5.5in]{PicBifDiag.pdf} \caption{\footnotesize{Fixed point set for the Snow and Hofmeister maps $\overline S$~and $\phi$. Each point $(x,y)$ in this plane represents the generator of a cylindrical lattice. The lattices that correspond to fixed points for $\overline S$~and $\phi$ have their generator along the dark arcs of circle - each dark point representing a dynamical lattice. We have indicated a few parastichy number pairs corresponding to different branches. The grey arcs bound regions of constant parastichy numbers. In \cite{jns} , the coordinate $y$ of the generator is used as a parameter for the map $\phi$, and this graph is the fixed point bifurcation diagram. A monotonic change of coordinates $y \mapsto D(y)$ would give the topologically equivalent bifurcation diagram for $\overline S$.}} \label{fig:bifdiag} \end{figure} \proposition{Periodic points are segments of multilattices. If an orbit is a segment of a phyllotactic~tiling of parastichy number $M,N$, then the tiling is fat and rhombic and the orbit has period $MN$ for $\overline S$.} \proof Periodic orbits of period $q$ are such that $\overline S^q(\ovv p_1 \ldots, \ovv p_K)=(\ovv p_1 \ldots, \ovv p_K)$. The same argument as above implies that $\ovv p_{k+q}= \ovv p_k$. This makes the configuration a multilattice with generator $\sum_{j=1}^q \ovv p_j$ and translation vectors $v_k= \sum_{j=1}^k \ovv p_j, \ k\in \{1, \ldots, q\}$. The fact that a tiling-orbit is fat and rhombic is an immediate consequence of the interpretation of $S$~as a process of piling non overlapping disks of the same size in $\cyl$. Opposedness comes from the optimization involved in the definition (see comments at the end of Section \ref{subsec:snowdef}). The corresponding orbit of $\overline S$~is periodic of period $MN$ since, by Proposition \ref{prop:frontperiod}, each front's shape is repeated every $MN$ iterates. \qed \conjecture{Periodic points for $\overline S$~are segments of fat rhombic tilings.} The proof of this conjecture would rest on the fact (to be established) that no periodic orbit may contain other tiles than rhombi (apart from rhombi at the boundary of fatness which can be interpreted as two triangles). We now obtain, with relatively little work, infinitely many sets of periodic orbits for the map $\overline S$~that could not exist for the Hofmeister map, since two primordia could not be generated at the same height in that model. The cover of a $k$-jugate configuration $L_k$ is obtained from a lattice $L$ by gluing $k$ copies of the cover of $L$, rescaled by $1/k$ (see Fig. \ref{fig:Lattice&Whorls}). Since the cover $\tilde L_k$ is homothetic to the cover $\tilde L$, and homothecies preserve angles and equidistance, $L$ is respectively rhombic, opposed, or fat if and only if $L_k$ is. We now show that the the correspondence $L\mapsto L_k$ maps fixed points of $\overline S$~to periodic points of period $k$. \proposition{ A lattice $L$ is dynamical if and only if its corresponding $k$-jugate configuration $L_k$ is. A segment of a dynamical $L_k$ is a periodic point for $\overline S$, of period $k$.} \proof Choose a segment ${\bf p}_k$ of $L_k\in \cyl^{kK}$ which has $k$ primordia at the same top level. The segment ${\bf p}_k$, as a subset of $\cyl$, can be seen as $k$ rescaled copies of a segment ${\bf p}$ of $L$ in $\cyl^K$ (see Fig. \ref{fig:Lattice&Whorls}) set side by side on the cylinder. We can choose ${\bf p}$ and ${\bf p}_k$ to have the same base point $(0,0)$. Accordingly, the graph of the function $MinDis_{y/k}$ in the definition of $S$~for ${\bf p}_k$ is made of $k$ copies set side by side, rescaled by $1/k$, of the graph of $MinDis_{y}$ for ${\bf p}$. The value $y$ is a threshold for the function $MinDis_y$ for ${\bf p}$ (given the parameter $\diam$) at a point of $L$ if and only if $y/k$ is a threshold for ${\bf p}_k$ (with parameter $D/k$) at $k$ points (on the same level) of $L_k$. This implies that $L_k$ is dynamical if and only if $L$ is dynamical. Since a segment of $L_k$ has from 1 up to $k$ primordia at each level, an orbit of a segment of $L_k$ is of period $k$: a segment of $L_k$ in $\cyl^{kK}$ can translate into another one if and only if they both have the same number of primordia at the top level. \qed \subsection{Sufficient Conditions for Periodicity} This Section provides a useful and easily implemented test to establish in a finite number of iterates of $S$, whether an orbit is part of a tiling, and thus periodic. We call an \emph{ancestor} of a primordium $p$ in a phyllotactic~tiling ${T}$ a primordium $A$ which can be joined to $p$ by a connected sequence of up and negative down vectors of ${T}$. In a rhombic tiling, this is equivalent to the intuitive meaning of ancestor (parent of parent of~...). It is not hard to see that in this case, $p$ is on or above the necklace formed by the left and right parastichies between the ancestor $A$ and $A+\vec U$. The function $\lceil x\rceil$ used below denotes the smallest integer greater than $x$. \theorem{Let ${\bf p}$ be a configuration with top front. If the top fronts of $S^q({\bf p})$ for $q$ in $\{0, \ldots, \lceil\frac{3MN}2\rceil\}$ have all the same parastichy numbers $(M,N)$, then any orbit segment of ${\bf p}$ is the segment of the same dynamical tiling. In particular, the $\overline S$~-orbit of ${\bf p}$ is periodic, of period $MN$. } \label{thm:parastnum}\\ \proof Consider the rhombic tiling ${T}$ generated by the left and down vectors of the top front $F_0$ of ${\bf p}$. We will show that ${T}$ is in fact a dynamical tiling, and that points of ${T}$ above $F_0$ form the $S$-orbit for ${\bf p}$. Since the front parastichy numbers are constant, all transitions in the orbit are rhombic (see Proposition \ref{prop:fronttransitions}). Assume by induction that the top front $F_k$ (with $k< \frac {3MN}2-1$) of $S^k({\bf p})$ is in ${T}$ (by hypothesis $F_0$ \emph{is} in ${T}$). Let $P$ be the new primordium at iteration $k+1$, and $z_{m,n}$ be its left parent in $F_k$. Since the transition is rhombic, $z_{m+1, n+1}$ must be its right parent and $P = z_{m,n}+\uu_{n+1} = z_{m,n+1}\in {T}$. Thus any orbit segment of ${\bf p}$ is a subset of ${T}$. \label{theorem:conditionperiodicity} We will now show that any orbit segment $X$ of ${\bf p}$ is in fact a full segment of the tiling ${T}$ above $F_0$. Suppose first that the orbit segment of length $MN$ above $F_0$ is equal to a segment of ${T}$. By Proposition \ref{prop:frontperiod}, the front at iterate $NM$ is a translate of $F_0$ and thus the orbit shape is periodic of period $MN$ for $\overline S$~and must coincide with ${T}$ above $F_0$. We now show that this is the only case possible. Assume by contradiction that some point $z$ of the segment of ${T}$ of length $MN$ above $F_0$ is \emph{not} in the orbit segment $X$ of same length, and choose $z$ to be the lowest such point above $F_0$. The orbit is then strictly bounded above by the necklace formed by the left and right parastichies between the points $z$ and $z+\vec U$ of ${T}$. Indeed, since any point in the orbit segment $X$ is in ${T}$, if a point of $X$ were above the necklace, it would have $z$ as an ancestor, which is absurd since $z$ is not part of the orbit. But, as is not hard to check, the number of points of ${T}$ comprised between the front immediately below $z$ and the necklace is strictly less than $\lceil\frac{MN}2\rceil$, and thus the number of points between $F_0$ and the necklace is strictly less than $MN+\lceil\frac{MN}2\rceil = \lceil\frac{3MN}2\rceil$. This is a contradiction to the fact that at least $\lceil\frac{3MN}2\rceil $ points of the orbit are in ${T}$. \qed \subsection{Attracting Manifolds of Periodic Points} \label{subsec:attractor} The following theorem shows that, around each helical lattice segment of parastichy numbers $(M,N)$ of the bifurcation diagram, apart for its turning points, there exists a superattracting manifold of dimension $M+N$ of dynamical tilings (periodic of period $MN$ for $\overline S$) on which neighboring orbits land in finite time. In fact, such a manifold exists near any sufficiently non-critical segment of dynamical tiling. We remind the reader that $NC_q$ is the open set of $q$-non critical configurations, and that $\rtmndk$ is the manifold of segments of length $k$ of rhombic tilings of parastichy numbers $(M,N)$ and parameter $\diam$. \begin{theorem} Let $M$ and $N$ be coprime and let $K\geq M+N$. The set $\dmndk$ of segments of dynamical tilings of length $K$ in $NC_{MN}$ is an open submanifold of $\rtmndk$. Moreover, there exists an open neighborhood $\cal V$ of $\dmndk$ in $\cyl^K$ such that, for any configuration ${\bf p}\in \cal V$, and any $j>K$, $S^j({\bf p})$ is in $\dmndk$. The manifold $\dmndk$ is not empty when a non-critical $M,N$-lattice of the bifurcation diagram exists for the given parameter $D$. \label{thm:attractor} \end{theorem} \begin{proof} Take a segment $X_K({T})$ of a dynamical tiling ${T}$ and assume $X_K({T})$ is in $NC_{MN}$. Then it is in fact in $NC_q$ for all $q\geq 0$, by periodicity (Theorem \ref{theorem:RTperiodic}). Let $O$ be the (open) connected component of $NC_Q$ containing $X_K({T})$, for a chosen $Q\geq \lceil\frac{3MN}2\rceil$. By Proposition \ref{prop:dimension}, $X_K({T})$ is also contained in an open subset $U$ of the manifold $\rtmndk$: the boundary of the set of non fat tilings is made of critical tilings, thus, since $X_K({T})$ is in $NC_q$ it is also strictly non-fat. The set ${\cal O} = U\cap O$ is thus an open submanifold of tilings segments in $\rtmndk$, containing $X_K({T})$. Let $Y$ in ${\cal O}$ be a segment of a tiling ${T}'$. Since $Y$ is in the same component of $NC_Q$ as $X_K({T})$, parastichy numbers of the successive top fronts of $S^j(Y)$ are constant for $0\leq j\leq Q$. Since all the transitions are rhombic, these fronts are all fronts of ${T}'$. By Theorem \ref{theorem:conditionperiodicity}, ${T}'$ is dynamical. We have shown that $\dmndk$ is an open submanifold of $\rtmndk$. Given $X_K({T})\in \dmndk$, take a configuration ${\bf p}$ in $\cyl^K$ in the same (open) connected component of $NC_Q$ as $X_K({T})$ (${\bf p}$ need not be a tiling). Since all iterates of $X_K({T})$ have a top front of parastichy numbers $(M,N)$, $S^j({\bf p})$ must also have a top front of parastichy numbers $(M,N)$ for $k\leq j \leq Q.$ By Theorem \ref{theorem:conditionperiodicity}, $S^j({\bf p})$ is thus a segment of a dynamical tiling of parastichy numbers $(M,N)$. The union $\cal V$ of all the $NC_Q$-connected components of configurations in $\dmndk$ is open and attracted to $\dmndk$ in finite time. \end{proof} In the regular case ($M<2N$ and $N<2M$, see Remark \ref{remark:Drange}), each fixed point helical lattice in the range $D\in\left(({M^2+N^2+MN})^{-\frac12}, ({M^2+N^2-MN})^{-\frac12}\right)$ is non-critical, and by periodicity $q$-non-critical for all $q\geq 0$. Thus for each $D$ in this range, the manifold $\dmndk$ is non-empty, and provides a manifold of dimension $M+N$ of periodic orbits. In the irregular case, the range of allowable $D$ is smaller, but not empty. Since $k$-jugate lattices have $k$ primordia at the same level, they are automatically critical. Nonetheless, a perturbation argument should show: \conjecture{Around any dynamical $k$-jugate lattice of parastichy numbers $M, N$ whose corresponding helical lattice is non-critical, there is an open set of dynamical tilings in $\rtmndk$.} \conjecture{The set of dynamical tilings of given parameter $\diam$ forms an attracting invariant branched manifold - with branches of different dimensions - for the map $S$~which, in nearby systems, persists as an attracting invariant nearby (branched) manifold.} Confirming Theorem \ref{thm:attractor}, a computation shows that the characteristic polynomial for the differential of $S$~at a non-critical dynamical lattice of parastichy numbers $(M,N)$ has the neat form $Char(\lambda) = \lambda^B(1-\lambda^M)(1 - \lambda^N)$, where $B= K-M-N$ ($K$ is the dimension of the phase space). Thus the eigenvalues are either 0 or equal to $M^{th}$ or $N^{th}$ roots of unity. Clearly the dimensions of the generalized eigenspaces corresponding to the roots of unity sum up to $M+N$ which shows that the sum of these spaces must equal the tangent space to $\dmndk$ at $L$. The zero eigenvalue in the complementary subspace shows that $\dmndk$ is normally hyperbolic at $L$. Numerical evidence indicates the same to be true at dynamical tilings. Geometrically, the super attraction correspond to fronts forming in finite time on configurations that might not have them. Thus the set of dynamical tiling could entirely be made of pieces of normally hyperbolic invariant manifolds. There are theorems ({\it e.g.}\ \cite{fenichel}) that show that, given certain conditions on the map or flow, normally hyperbolic invariant manifolds survive perturbations of the system, as perturbed invariant manifolds. In the case of the map $S$, we have some hurdles stacked against us: 1) $S$~is not a diffeomorphism (it is not 1-1); 2) $S$~is not continuous everywhere; 3) the set of tilings has branches of various dimensions, some of which connect. \section{A Glimpse at the Set of Dynamical Tilings} \label{subsec:rp2} We conclude this paper with a numerical study of the topology of dynamical tilings. To see how dynamical tilings of different parastichy numbers coexist, we look at the shape space of all chains of four primordia of diameter $\diam=0.3$. Such a chain is given by four points, or vectors $\vec v_1, \vec v_2,\vec v_3$ and~$\vec v_4$. We fix one primordium at the origin, $\vec v_1=(0,0)$, which has no consequence on the shape of the chain. We choose two angles, $\alpha$ and~$\beta$, as parameters as Fig.~\ref{fig:parameterization} shows. A choice of these angles gives primordia located at $\vec v_1,\vec v_2$ and~$\vec v_3$ as follows \begin{eqnarray*} \vec v_1&=&(0,0),\\ \vec v_2 &=& (\diam\cos{\alpha},\diam \sin{\alpha}), \\ \vec v_3 &=& \vec v_2+ (\diam\cos{\beta},\diam\sin{\beta})=(\diam(\cos\alpha+\cos\beta),\diam(\sin\alpha+\sin\beta)). \end{eqnarray*} \begin{figure}[h] \centering \includegraphics[height=1.3 in]{Parameterization.pdf} \caption{\footnotesize {Parameterization of 4-chains. } } \label{fig:parameterization} \end{figure} To be able to define $\vec v_4$ and effectively have a chain with four primordia, we must have $$\diam\le \textrm {distance}(\vec v_3,(1,0))\le 2\diam,$$ which is equivalent to $$ 1\le \left(\cos\alpha+\cos\beta-\frac 1 \diam\right)^2+(\sin\alpha+\sin\beta)^2\le 4.$$ \begin{figure}[h] \centering \includegraphics[height=3.3 in]{rp2complete.pdf} \caption{\footnotesize {The shape space of chains of 4 primordia of diameter $\diam=0.3$. The regions $\oplus$ and $\ominus$ are identified at their boundary (``equator"), forming a sphere. The black curves drawn are the images of the equator under the cyclic permutations of primordia in the chain. These curves separate regions, which are identified when representing chains of same shape, according to the numbers shown. The union of the regions 1-7 forms a topological disk with antipodal identification at the boundary, yielding a space topologically equivalent to the projective plane~$\mathbb P^2$. The point $A$ corresponds to the front of a $(1,3)$ lattice, $B$ to that of the $(3,1)$ lattice, $C$ and $D$ correspond to the two possible fronts of the bi-jugate (2,2) configuration. All these lattices are dynamical. The yellow region corresponds to chains that are fronts of dynamical tilings of parastichy numbers (1,3), the red region corresponds to fronts of (3,1) tilings and the blue one corresponds to fronts of (2,2) tilings. Other chains are either not front and/or transit in one iterate of $S$~to the above colored regions, or to (2,3) and (3,2) tilings. } } \label{fig:partition} \end{figure} For our choice of parameter $\diam$, the first inequality is always satisfied. In the case of strict (second) inequality, for each choice of $\alpha$ and~$\beta$ the placement of primordia $\vec v_4$ is determined up to two possibilities. These are depicted in Fig.~\ref{fig:parameterization}, labeled as $\vec v_4^{\ +}$ and~$\vec v_4^{\ -}$. So, without the further identifications that we will make below, the parameterized shape space of 4-chains consists of two copies $\oplus, \ominus$ of the same disk-like region, depicted in~Fig.~\ref{fig:partition}. The boundary points of these regions (the \lq\lq equator") correspond to choices of $\alpha$ and~$\beta$ for which the distance between primordia $\vec v_3$ and $\vec v_1=(0,0)=(1,0) \textrm{ mod }1$ is~$2\diam$, and so $\vec v_4^{\ +}=\vec v_4^{\ -}$. Hence, the boundary points of the region $\ominus$ are identified one by one to those of the region $\oplus$, making the set a topological sphere (for now). We further identify the four configurations $(\vec v_1, \vec v_2,\vec v_3,\vec v_4)$, $(\vec v_2,\vec v_3,\vec v_4,\vec v_1)$, $(\vec v_3, \vec v_4,\vec v_1,\vec v_2)$ and $(\vec v_4, \vec v_1,\vec v_2,\vec v_3)$, as they have the same shape on the cylinder. This leads us to make some identifications in the above sphere. Fig.~\ref{fig:partition} shows these with a number coding: regions with same number are identified. One can see that the shape space for 4-chains is topologically equivalent to the projective plane~$\mathbb {RP}^2$. The colored regions correspond to shapes of \emph{fronts} of dynamical tilings of parastichy numbers (1,3), (2,2) and (3,1). This coloring was obtained numerically by sweeping the shape space, checking for front conditions, parastichy numbers and rhombic transitions for each chain in a grid of about 10000 points. Only 6 iterates of $S$~were necessary at each chain, thanks to Theorem \ref{theorem:conditionperiodicity}. Note that, after identification, the yellow and red regions each have only one connected component, on which the map has period $3 = 1\times 3= 3\times 1$. On the other hand, the (blue) shape space of fronts of (2,2) dynamical tilings is disconnected, and the map $\overline S$~toggles between one component and the other at each iterate, with period $4 = 2\times 2$. If one were looking at the shape space of \emph{dynamical tilings} (and not their \emph{fronts}), one would have to identify points in each orbit of $\overline S$, in each colored region. The space of (2,2) dynamical tilings is then apparently connected: the fronts $\sf C$ and $\sf D$ are identified as belonging to the same cylindrical lattice, for instance. \conjecture{ The shape space of dynamical tilings of parastichy number $M,N$, and parameter $\diam$ is contractible.} {\bf Acknowledgments.} Even though the bulk of the research for this paper occurred before our collaborations on this model with St\'ephane Douady, Jacques Dumais and Scott Hotton, it was solidified by many invaluable discussions with them. Dumais helped us see what might be useful to biologists and suggested our fitting of cylindrical plant patterns to tilings. Hotton made helpful suggestions on the programming used in Figure \ref{fig:tilingfit}. Douady encouraged us to pursue the study of rhombic tilings and their fronts, showed us enticing experiments about them, and pointed us to the work of van Iterson on zickzacklinie. Hotton, Dumais, and Luke Grecki read a draft of this paper and made many good suggestions. Jordan Crouser, Anna Naito, Duc Nguyen and Erich Kummerfeld helped gather plant data that was used in Figure \ref{fig:tilingfit}. We thank them all warmly. This research was supported by the NSF/NIH collaborative research grant \# 0540740 and a Mellon collaborative grant.
{'timestamp': '2017-01-06T02:05:36', 'yymm': '1701', 'arxiv_id': '1701.01361', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01361'}
arxiv
\section{Introduction} The minimum graph bisection problem is one of the classical NP-hard problems \cite{garey1976some}: for an undirected graph $G$ the aim is to partition the set of vertices $V=\{1,\ldots, n\}$ ($n$ even) into two equal sized sets, such that the number of cut edges, i.e. edges with endpoints in different bisection sides, is minimized. The bisection width of a graph $G$, denoted by $\operatorname{bw}(G)$, is then the minimum number of cut edges in a bisection of $G$. Due to practical significance in VLSI design, image processing, computer vision and many other applications (see \cite{lengauer2012combinatorial, bhatt1984framework, wu1993optimal, kwatra2003graphcut, lipton1980applications, schloegel2000graph}) and its theoretical importance, the problem has been the subject of a considerable amount of research from different perspectives: approximability \cite{saran1995finding,arora1995polynomial,feige2000approximating,Feige2002,khot2006ruling}, average-case complexity \cite{Bui1987}, and parameterized algorithms \cite{marx2006parameterized,van2013parameterized} including the seminal paper in this field by Cygan et~al. \cite{Cygan2014} showing that the minimum bisection is fixed parameter tractable. In this paper we consider polynomial-time algorithms that for an input graph either output the \emph{provable} minimum-size bisection or ``fail'' when the optimality cannot be certified. The methods should work well for all (or almost all, depending on the model) graphs of particular classes, i.e.~provide for them a certified optimum bisection, while for irregular, worst case instances the output can be ``fail'', what is justifiable. We investigate two well-studied graph models: the \emph{planted bisection model} and its extension the \emph{semirandom model} which are widely used to analyze and benchmark graph partitioning algorithms. We refer to \cite{Bui1987,dyer1989solution,Boppana1987,blum1995coloring,condon2001algorithms,Feige2001,carson2001hill,mcsherry2001spectral,bollobas2004max,Coja2005,makarychev2012approximation} to cite some of the relevant works. Moreover, we consider the \emph{regular graph model} introduced of Bui et al.~\cite{Bui1987} and a new extension of the semirandom model. For a (semi)random model we say that some property is satisfied with high probability (w.h.p.) if the probability that the property holds tends to $1$ as the number of vertices $n\to \infty$. In the planted bisection model, denoted as $\mathcal{G}_{n}(p,q)$ with parameters $1>p=p(n) \ge q(n) = q > 0$, the vertex set $V=\{1,\ldots, n\}$ is partitioned randomly into two equal sized sets $V_1$ and $V_2$, called the \emph{planted bisection}. Then for every pair of vertices do independently: if both vertices belong to the same part of the bisection (either both belong to $V_1$ or both belong to $V_2$) then include an edge between them with probability $p$; If the two vertices belong to different parts, then connect the vertices by an edge with probability $q$. In the semirandom model for graph bisection \cite{Feige2001}, initially a graph $G$ is chosen at random according to model $\mathcal{G}_{n}(p,q)$. Then a monotone adversary is allowed to modify $G$ by applying an arbitrary sequence of the following monotone transformations: (1) The adversary may remove from the graph any edge crossing a minimum bisection; (2) The adversary may add to the graph any edge not crossing the bisection. Finally, in the regular random model, denoted as $\mathcal{R}_{n}(r,b)$, with $r=r(n) < n$ and $b=b(n) \le (n/2)^2$, the probability distribution is uniform on the set of all graphs on $V$ that are $r$-regular and have bisection width $b$. The planted bisection model was first proposed in the sociology literature \cite{holland1983stochastic} under the name \emph{stochastic block model} to study community detection problems in random graphs. In this setting, the planted bisection $V_1,V_2$ (as described above) models latent communities in a network and the goal here is to recover the communities from the observed graph. In the general case, the model allows some errors by recovering, multiple communities, and also that $p(n) < q (n)$. The community detection problem on the stochastic block model has been subject of a considerable amount of research in physics, statistics and computer science (see e.g. \cite{abbe2017community,moore2017computer} for current surveys). In particular, an intensive study has been carried out on providing lower bounds on $|p-q|$ to ensure recoverability of the planted bisection. The main focus of our work is the bisection algorithm proposed by Boppana \cite{Boppana1987}. Though introduced almost three decades ago, the algorithm belongs still to one of the most important heuristics in this area. However, several basic questions concerning the algorithm's performance remain open. Using a spectral based approach, Boppana constructs an implementable algorithm which, assuming the density difference \begin{equation} \label{eq:dens:diff} p-q \ge c\sqrt{p\ln n}/\sqrt{n} \quad \text{for a certain constant $c>0$} \end{equation} bisects $\mathcal{G}_{n}(p,q)$ optimally w.h.p. (certifying the optimality of the solutions). Remarkably, for a long time this was the largest subclass of graphs $\mathcal{G}_{n}(p,q)$ for which a minimum bisection could be found. Since under the assumption \eqref{eq:dens:diff} the planted bisection is minimum w.h.p., Boppana's algorithm solves the recovery problem for the stochastic block model with two communities. Boppana's algorithm works well also on the regular graph model $\mathcal{R}_{n}(r,b)$, assuming that \begin{equation} \label{eq:rand:reg:assumption} r \ge 6 \quad\text{and} \quad b \le o(n^{1-1/\lfloor (r/2+1)/2 \rfloor} ). \end{equation} In this paper we investigate the problem if, under assumption \eqref{eq:dens:diff}, Boppana's algorithm works well for the semirandom model. This question was posed by Feige and Kilian in \cite{Feige2001} and remained open so far. In our work we answer the question affirmatively. We show also that Boppana's algorithm provides the same results as the algorithm proposed currently by Hajek, Wu, and Xu \cite{hajek2016achieving}. As a consequence we get that Boppana's algorithm achieves the optimal threshold for exact recovery in the stochastic block model with parameters $p=\alpha\log(n)/n$ and $q=\beta\log(n)/n$. On the other hand we show some limitations of the algorithm. One of the main results in this direction is that the density difference \eqref{eq:dens:diff} is tight: we prove that if $p-q \le o(\sqrt{p\cdot \ln n}/\sqrt{n})$ then the algorithm fails on $\mathcal{G}_{n}(p,q)$ w.h.p. \paragraph*{Our Results.} The motivation of our research was to systematically explore graph properties which guarantee that Boppana's algorithm outputs a certified optimum bisection. Due to \cite{Boppana1987} we know that random graphs from $\mathcal{G}_{n}(p,q)$ and $\mathcal{R}_{n}(r,b)$ satisfy such properties w.h.p.~under assumptions \eqref{eq:dens:diff} and \eqref{eq:rand:reg:assumption} on $p,q,r,$ and $b$ as discussed above. But, as we will see later, the algorithm works well also for instances which deviate significantly from such random graphs. Our first technical contribution is a modification of the algorithm to cope with graphs of more than one optimum bisection, like e.g. hypercubes. The algorithm proposed originally by Boppana does not manage to handle such cases. Our modification is useful to work on wider classes of graphs. In this paper we introduce a natural generalization of the semirandom model of Feige and Kilian \cite{Feige2001}. Instead of $\mathcal{G}_{n}(p,q)$, we start with an arbitrary initial graph model $\mathcal{G}_{n}$, and then apply a sequence of the transformations by a monotone adversary as in \cite{Feige2001}. We denote such a model by $\mathcal{A}(\mathcal{G}_{n})$. One of our main positive results is that if Boppana's algorithm outputs the minimum-size bisection for graphs in $\mathcal{G}_n$ w.h.p., then the algorithm finds a minimum bisection w.h.p. for the adversarial graph model $\mathcal{A}(\mathcal{G}_n)$, too. As a corollary, we get that under assumption \eqref{eq:dens:diff}, Boppana's algorithm works well in the semirandom model, denoted here as $\mathcal{A}(\mathcal{G}_{n}(p,q)$), and, assuming \eqref{eq:rand:reg:assumption}, in $\mathcal{A}(\mathcal{R}_n(r,b))$ \textendash\ the semirandom regular model. This solves the open problem posed by Feige and Kilian in \cite{Feige2001}. To the best of our knowledge, Boppana's algorithm is the only method known so far, that finds (w.h.p.) provably optimum bisections on all of the above random graph classes. Since the behavior of the algorithm on the (common) semirandom model $\mathcal{A}(\mathcal{G}_{n}(p,q))$ remained unknown so far, Feige and Kilian proposed in \cite{Feige2001} a new semidefinite programming (SDP) based approach which works for semirandom graphs, assuming \eqref{eq:dens:diff}. The relationship between the performance of the SDP based algorithm and Boppana's approach was left in \cite{Feige2001} as an open problem. Feige and Kilian conjecture that for every graph $G$, their objective function $h_p(G)$ to certify the bisection optimality and the lower bound computed in Boppana's algorithm give the same value. In our paper we answer this question affirmatively. To compare the algorithms, we provide a primal SDP formulation for Boppana's approach and prove that it is equivalent to the dual SDP of Feige and Kilian. Next we give a dual program to the primal formulation of Boppana's algorithm and prove that the optima of the primal and dual programs are equal to each other. Note that unlike linear programming, for semidefinite programs there may be a duality gap. Thus, we show that the bisection algorithm of Feige and Kilian provides exactly the same results as Boppana's algorithm. However, an important advantage of the spectral method by Boppana over the SDP based approach by Feige and Kilian is that the spectral method is practically implementable reducing the bisection problem for graphs with $n$ vertices to computing minima of a convex function of $n$ variables while the algorithm in \cite{Feige2001} needs to solve a semidefinite program over $n^2$ variables. From the result that the method by Feige and Kilian is equivalent to Boppana's we get, as a consequence, that Boppana's algorithm achieves the sharp threshold for exact cluster recovery in the stochastic block model which has been obtained recently by Abbe et~al.~\cite{abbe2016exact} and independently by Mossel et~al.~\cite{mossel2015consistency}. In~\cite{abbe2016exact,mossel2015consistency} it is proved that in the (binary) stochastic block model, with $p=\alpha\log(n)/n$ and $q=\beta\log(n)/n$ for fixed constants $\alpha \not= \beta$, if $(\sqrt{\alpha}-\sqrt{\beta})^2>2$, the planted clusters can be exactly recovered (up to a permutation of cluster indices) with probability converging to one; if $(\sqrt{\alpha}-\sqrt{\beta})^2<2$, no algorithm can exactly recover the clusters with probability converging to one. Note, that the choice of $p$ and $q$ is well justified: Mossel et~al. show that if $q<p = \log(n)/n$ then the exact recovery is impossible for these parameters. In \cite{hajek2016achieving} Hajek et~al. proved that the SDP of Feige and Kilian achieves the optimal threshold, i.e. if $(\sqrt{\alpha}-\sqrt{\beta})^2>2$ then the SDP reconstructs communities w.h.p. From our result we get, that Boppana's algorithm achieves the threshold, too. To analyze limitations of the spectral approach we provide structural properties of the space of feasible solutions searched by the algorithm. This allows us to prove that if an optimal bisection contains some forbidden subgraphs, then Boppana's algorithm fails. Using these tools, we were able to show that if the density difference $p-q$ is asymptotically smaller than $\sqrt{p\cdot \ln n}/\sqrt{n}$ then Boppana's algorithm fails to determine a certified optimum bisection on $\mathcal{G}_{n}(p,q)$ w.h.p. Note that our impossibility result is not a direct consequence of the lower bound for the exact cluster recovery discussed above. For example, for $q=\mathcal{O}(1)/n$ and $p=\sqrt{\log{n}} /n$ from Mossel et~al.~\cite{mossel2015consistency} we know that for these parameters the exact recovery is impossible but obviously this does not imply that determining of a certified optimum bisection is impossible either. \paragraph*{Related Works.} Spectral partitioning goes back to Fiedler \cite{Fiedler1975}, who first proposed to use eigenvectors to derive partitions. Spielman and Teng e.g. showed, that spectral partitioning works well on planar graphs \cite{Spielman1996,Spielman2006}, although there are also graphs on which purely spectral algorithms perform poorly, as shown by Guattery and Miller \cite{Guattery1998}. Also other algorithms have been proven to work on the planted bisection model. Condon and Karp \cite{condon2001algorithms} developed a linear time algorithm for the more general $l$-partitioning problem. Their algorithm finds the optimal partition with probability $1-\exp(-n^{\Theta(\varepsilon)})$ in the planted bisection model with parameters satisfying $p-q=\Omega(1/n^{1/2-\varepsilon})$. Carson and Impaglizzo \cite{carson2001hill} show that a hill-climbing algorithm is able to find the planted bisection w.h.p. for parameters $p-q=\Omega((\ln^3 n)/n^{1/4})$. Dyer and Frieze \cite{dyer1989solution} provide a min-cut via degrees heuristic that, assuming $n(p-q)=\Omega(n)$ finds and certifies the minimum bisection w.h.p. Note, that the density difference~\eqref{eq:dens:diff} assumed by Boppana still outperforms the above ones. Moreover a disadvantage of the methods against Boppana's algorithm, except for the last one, is that they do not certify the optimality of the solutions. In \cite{mcsherry2001spectral} McSherry describes a spectral based heuristic that applied to $\mathcal{G}(p,q)$ finds a minimum bisection w.h.p if $p$ and $q$ satisfy assumption \eqref{eq:dens:diff} but it does not certify the optimality. Importantly, the algorithms above, similarly as Boppana's method, solve the recovery problem for the stochastic block model with two communities. In \cite{Coja2005} Coja-Oghlan developed a new spectral-based algorithm which, on the planted partition model $\mathcal{G}_{n}(p,q)$, enables for a wider range of parameters than \eqref{eq:dens:diff}, certifying the optimality of its solutions. The algorithm~\cite{Coja2005} assumes that $ p-q \ge \Omega(\sqrt{p\ln (np)}/\sqrt{n})$. If the parameters $p$ and $q$ describe non-sparse graphs, this condition is essentially the same as Boppana's assumption. For sparse graphs, however, Coja-Oghlan's constraint allows a larger subclass. For example, the algorithm works in $\mathcal{G}_n(p,q)$ for $q=\mathcal{O}(1)/n$ and $p=\sqrt{\log{n}} /n$. Due to results presented in our paper we know that Boppana's algorithm fails w.h.p. for such graphs. Interestingly, the condition on the density difference by Coja-Oghlan allows graphs for which the minimum bisection width is strictly smaller than the width of the planted bisection w.h.p. However, a drawback of Coja-Oghlan's algorithm is that to work well in the planted bisection model with \emph{unknown} parameters $p$ and $q$, the algorithm has to learn the parameters since it is based on the knowledge of values $p$ and $q$. Also the performance of the algorithm on other families, like e.g. semirandom graphs and the regular random graphs $\mathcal{R}_n(r,b)$, is unknown. Recent research by Coja-Oghlan et\,al. \cite{Coja2015} contributes to a better understanding of the planted bisection model and average case behavior of a minimum bisection. \vspace*{1mm} The paper is organized as follows. The next section contains an overview over Boppana's algorithm. In Section~\ref{sec:non-unique:bisections} we propose a modification of the algorithm to deal with non-unique optimum bisections. In Section~\ref{sec:adversarial:model} we define the adversarial graph model and show, that Boppana's algorithm works well on this class. Next we develop a new analysis of the algorithm and use it to show some limitations of the method. Finally, in Section~\ref{sec:comparing:boppana:feige} we compare the algorithm to the SDP approach of Feige and Kilian. We conclude the paper with a discussion. The proofs of most of the propositions presented in Sections \ref{sec:Boppana:recall} through \ref{sec:comparing:boppana:feige} are moved to the appendix (Section~\ref{sec:appendix}). \section{Boppana's Graph Bisection Algorithm}\label{sec:Boppana:recall} In this section we fix definitions and notations used in our paper and we recall Boppana's algorithm and known facts on its performance. We need the details of the algorithm to describe its extension in the next section. For a given graph $G=(V,E)$, with $V=\{1,\ldots,n\}$, Boppana defines a function $f$ for all real vectors $x,d\in\mathbb{R}^n$ as \begin{equation}\textstyle f(G,d,x)=\sum_{\{i,j\}\in E}\frac{1-x_ix_j}{2}+\sum_{i\in V}d_i (x_i^2-1). \label{function_f} \end{equation} Call by $S\subset \mathbb{R}^n$ the subspace of all vectors $x\in\mathbb{R}^n$, with $\sum_i x_i=0$. Based on $f$, the function $g'$ is defined as follows \begin{equation} g'(G,d)=\min_{\|x\|^2=n, x\in S} f(G,d,x), \end{equation} where $\|x\|$ denotes $L_2$ norm of $x$. Vector $x$ is named a \emph{bisection vector} if $x\in \{+1,-1\}^n$ and $\sum_i x_i =0$. Such $x$ determines a bisection of $G$ of the cut width denoted as $\operatorname{cw}(x)=\sum_{\{i,j\}\in E}\frac{1-x_ix_j}{2}$. For a bisection vector $x$ the function $f$ takes the value \eqref{function_f} regardless of $d$. Minimization over all such $x$ would give the minimum bisection width. Since $g'$ uses a relaxated constraint we get $g'(G,d)\leq \operatorname{bw}(G)$ where, recall, $\operatorname{bw}(G)$ denotes the bisection width of $G$. To improve the bound, Boppana tries to find some $d$ which leads to a minimal decrease of the function value of $g'$ compared to the bisection width: \begin{equation}\label{def:function:h} h(G)=\max_{d\in \mathbb{R}^n} g'(G,d). \end{equation} It is easy to see that for every graph $G$ we have $h(G) \le \operatorname{bw}(G)$. In order to compute $g'$ efficiently, Boppana expresses the function in spectral terms. To describe this we need some definitions. Let $I$ denote the $n$-dimensional identity matrix and let $P=I-\frac{1}{n} J$ be the projection matrix which projects a vector $x\in\mathbb{R}^n$ to the projection $Px$ of vector $x$ into the subspace $S$. Here, $J$ denotes an $n\times n$ matrix of ones. For a matrix $B\in \mathbb{R}^{n\times n}$, the matrix $B_S=PBP$ projects a vector $x\in\mathbb{R}^n$ to $S$, then applies $B$ and projects the result again into $S$. Further, for $B\in\mathbb{R}^{n\times n}$ and $d\in \mathbb{R}^{n}$ we denote the sum of $B$'s elements as $\operatorname{sum}(B)=\sum_{ij} B_{ij}$ and by $\operatorname{diag}(d)$ we denote the $n\times n$ diagonal matrix $D$ with the entries of the vector $d$ on the main diagonal, i.\,e. $D_{ii}=d_i$. Now assume $B\in\mathbb{R}^{n\times n}$ is symmetric and let $B_S=PBP$. Denote by $\mathbb{R}^n_{\ne c\myvec{1}}$ the real space $\mathbb{R}^n$ without the subspace spanned by the identity vector $\myvec{1}$, i.\,e. $\mathbb{R}^n_{\ne c\myvec{1}}=\mathbb{R}^n\setminus \{c\myvec{1}: c\in\mathbb{R}\}$. We define $\lambda(B_S)=\max_{x\in\mathbb{R}^n_{\ne c\myvec{1}}} \frac{x^T B_S x}{\|x\|}.$ It is easy to see that if $\lambda(B_S)\geq 0$ then \begin{equation}\label{eq:Rayleigh:Quotient} \lambda(B_S)=\max_{x\in\mathbb{R}^n} \frac{x^T B_S x}{\|x\|} \end{equation} i.\,e. $\lambda(B_S)$ is the largest eigenvalue of the matrix $B_S$. Vectors $x$ that attain the maximum are exactly the eigenvectors corresponding to the largest eigenvalue $\lambda(B_S)$ of $B_S$. Let $G$ be an undirected graph with $n$ vertices and adjacency matrix $A$. Let further $d\in\mathbb{R}^n$ be some vector and let $B=A+\operatorname{diag}(d)$, then we define \[g(G,d)=\frac{\operatorname{sum}(B)-n \lambda(B_S)}{4}.\] In \cite{Boppana1987} it is shown that function $g'$ can be expressed as $g'(G,d)=g(G,-4d)$. Since in the definition of $h$ in~\eqref{def:function:h} we maximize over all $d$, we can conclude that \begin{equation}\label{eq:for:function:h} h(G)\ = \ \max_{d\in \mathbb{R}^n} g(G,d) \ = \ \max_{d\in \mathbb{R}^n} \frac{\operatorname{sum}(A+\operatorname{diag}(d))-n \lambda((A+\operatorname{diag}(d))_S)}{4}. \end{equation} Boppana's algorithm that finds and certifies an optimal bisection, works as follows: \begin{algorithm}[h] \SetKwInOut{Input}{Input} \caption{Boppana's Algorithm \label{alg:Boppana}} \Input{Graph $G$ with adjacency matrix $A$.} Compute $h(G)$: Numerically find a vector $d^\mathrm{opt}$ which maximizes $g(G,d)$. Let $D=\operatorname{diag}(d^\mathrm{opt})$. Use constraint $\sum_i d^\mathrm{opt}_i=2|E|$ to ensure $\lambda((A+D)_S)>0$\;\label{bb:alg:step:one} Construct a bisection: Let $x$ be an eigenvector corresponding to the eigenvalue $\lambda((A+D)_S)$. Construct a bisection vector $\hat x$ by splitting at the median $\bar x$ of $x$, i.e. let $\hat x_i = +1$ if $x_i\geq \bar x$ and $\hat x_i = -1$ if $x_i<\bar x$. If $\sum_i {\hat x}_i > 0$, move (arbitrarily) $\frac{1}{2}\sum_i {\hat x}_i$ vertices $i$ with $x_i=\bar x$ to part $-1$ letting $\hat x_i = -1$\;\label{bb:alg:step:two} Output $\hat x$; If $\operatorname{cw}(\hat x) = h(G)$ output ``optimum bisection'' else output ``fail''. \end{algorithm} One can prove that $g$ is concave and hence, the maximum in Step 1 can be found in polynomial time with arbitrary precision \cite{Groetschel1981}. To analyse the algorithm's performance, Boppana proves the following, for a sufficiently large constant $c>0$: \begin{theorem}[Boppana \cite{Boppana1987}] \label{thm:boppana:main} Let $G$ be a random graph from $\mathcal{G}_{n}(p, q)$, and let $p-q \ge c (\sqrt{p\ln n}/\sqrt{n})$. Then with probability $1 - \mathcal{O}(1/n)$, the bisection width of $G$ equals $h(G)$. \end{theorem} From this result one can conclude that the value $h(G)$ computed by the algorithm is, w.h.p., equal to the optimal bisection width of $G$. However, to guarantee that the algorithm works well one needs additionally to show that it also finds an optimal bisection: \begin{theorem}\label{thm:boppana:certify} For random graphs $G$ from $\mathcal{G}_{n}(p, q)$, with $p-q\ge c (\sqrt{p\ln n}/\sqrt{n})$, Boppana's algorithm certifies the optimality of $h(G)$ revealing w.h.p. the bisection vector $\hat x$ of $\operatorname{cw}(\hat x)=h(G)$. \end{theorem} To prove this theorem one first has to revise carefully the proof of Theorem~\ref{thm:boppana:main} in \cite{Boppana1987} and show that w.h.p. the multiplicity of the largest eigenvalue of the matrix $(A+D)_S$ in Step 1 is~1. This was observed already in \cite{Blumofe1993}. Next we need the following property: \begin{lemma} Let $G$ be a graph with $h(G)=\operatorname{bw}(G)$ and let $d^\mathrm{opt}\in\mathbb{R}^n$ s.\,t. $g(G,d^\mathrm{opt})=\operatorname{bw}(G)$ and $\sum_i d^\mathrm{opt}_i\geq 4\operatorname{bw}(G)-2|E|$. Denote further by $B^\mathrm{opt}=A+\operatorname{diag}(d^\mathrm{opt})$. Then every optimum bisection vector $y$ is an eigenvector of $B^\mathrm{opt}_S$ corresponding to the largest eigenvalue $\lambda(B^\mathrm{opt}_S)$. \label{lemma:y:largest:eigenvector} \end{lemma} (The proof of Lemma~\ref{lemma:y:largest:eigenvector}, as the proofs of most of the remaining propositions presented in this paper, are given in Section~\ref{sec:appendix}.) This completes the proof that the algorithm works well on random graphs from $\mathcal{G}_{n}(p, q)$. \section{Certifying Non-Unique Optimum Bisections} \label{sec:non-unique:bisections} From the previous section we know that if the bound $h(G)$ is tight and the bisection of minimum size is unique, or more precisely the multiplicity of the largest eigenvector of $B_S$ is~1, Boppana's algorithm is able to certify the optimality of the resulting bisection. We say that a graph $G$ has a unique optimum bisection if there exists a unique, up to the sign, bisection vector $x$ such that $\operatorname{cw}(x)=\operatorname{cw}(-x)=\operatorname{bw}(G)$. In this paper we investigate families of graphs, different than random graphs $\mathcal{G}_{n}( p, q)$, for which the Boppana's approach works well. To this aim we first need to show a modification which handles cases such that $h(G)=\operatorname{bw}(G)$ but for which no unique bisection of minimum size exists. As we will see later hypercubes satisfy these two conditions. We present our algorithm below. Note that if the multiplicity of the largest eigenvalue of $B^\mathrm{opt}_S$ is 1, then the algorithm outputs the same result as in the original algorithm by Boppana. \begin{algorithm}[h] \SetKwInOut{Input}{Input} \caption{Boppana's Algorithm Certifying Non-Unique Optimum Bisections \label{alg:modif:Boppana}} \Input{Graph $G$ with adjacency matrix $A$.} Perform Step 1 of Algorithm~\ref{alg:Boppana}; Let $x$ be an eigenvector corresponding to the eigenvalue $\lambda((A+D)_S)$ and let $k$ be the multiplicity of the largest eigenvalue of $(A+D)_S$\; If $k=1$ then construct a bisection vector $\hat x$ by splitting at the median $\bar x$ as in Step 2 of Algorithm~\ref{alg:Boppana}; Next output $\hat x$ and if $\operatorname{cw}(\hat x) = h(G)$ output ``optimum bisection'' else output ``fail''; If $k>1$ then perform the steps below\; Let $M\in\mathbb{R}^{n\times k}$ be the matrix with $k$ linear independent eigenvectors corresponding to this largest eigenvalue; Transform the matrix to the reduced column echelon form, i.\,e.\ there are $k$ rows which form an identity matrix, s.t. $M$ still spans the same subspace\; Brute force: for every combination of $k$ coefficients from $\{+1,-1\}$ take the linear combination of the $k$ vectors of $M$ with the coefficients and verify if the resulting vector $x$ is a bisection vector, i.e. $x\in \{+1,-1\}^n$ with $\sum_i x_i=0$. If yes and if $\operatorname{cw}(x)=h(G)$ then output $x$ and continue. This needs $2^k$ iterations\; \label{mod:boppana:brute:force} If in Step~\ref{mod:boppana:brute:force} no bisection vector $x$ is given then output ``fail''. \end{algorithm} \begin{theorem} If $h(G)=\operatorname{bw}(G)$ then the algorithm above reconstructs all optimal bisections. Every achieved bisection vector corresponds to an optimal bisection. \label{theorem:bop:modified:works} \end{theorem} The eigenvalues for the family of hypercubes are explicitly known \cite{harary1988}. Hence, we can verify that the bound $h(G)$ is tight and Boppana's algorithm with the modification above works, i.e. finds an optimal bisection. For a hypercube $H_n$ with $n$ vertices we have $h(H_n)=g(H_n,$ $(2-\log n)\myvec{1})=n/2=\operatorname{bw}(H_n)$. Since the hypercube with $n$ vertices has $\log n$ optimal bisections and the largest eigenspace of $B_S$ has multiplicity $\log n$, the brute force part in our modification of Boppana's algorithm results in a linear factor of $n$ for the overall runtime. Thus, the algorithm runs in polynomial time. In the next section we will extend this result to an adversarial model based on hypercubes and show, that Boppana's algorithm works on that model as well. \section{Bisections in Adversarial Models} \label{sec:adversarial:model} We introduce the \emph{adversarial model}, denoted by $\mathcal{A}(\mathcal{G}_n)$, as a generalization of the semirandom model in the following way. Let $\mathcal{G}_n$ be a graph model, i.e. a class of graphs with distributions over graphs of $n$ nodes ($n$ even). In the model $\mathcal{A}(\mathcal{G}_n)$, initially a graph $G$ is chosen at random according to $\mathcal{G}_n$. Let $(Y_1,Y_2)$ be a fixed, but arbitrary optimal bisection of $G$. Then, similarly as in \cite{Feige2001}, a monotone adversary is allowed to modify $G$ by applying an arbitrary sequence of the following monotone transformations: \begin{compactenum} \item The adversary may remove from the graph any edge $\{u, v\}$ crossing a minimal bisection ($u \in Y_1$ and $v \in Y_2$); \item The adversary may add to the graph any edge $\{u, v\}$ not crossing the bisection ($u,v \in Y_1$ or $u,v \in Y_2$). \end{compactenum} For example, $\mathcal{A}(\mathcal{G}_n(p,q))$ is the semirandom model as defined in \cite{Feige2001}. We will prove that Boppana's algorithm works well for graphs from adversarial model $\mathcal{A}(\mathcal{G}_n)$ if the algorithm works well for $\mathcal{G}_n$. First we show that, if the algorithm is able to find an optimal bisection size of a graph, we can add edges within the same part of an optimum bisection and that we can remove cut edges, and the algorithm will still work. This solves the open question of Feige and Kilian \cite{Feige2001}. Note that the result follows alternatively from Corollary~\ref{corr:feige:is:boppana} (presented in Section~\ref{sec:comparing:boppana:feige}) that the SDPs of \cite{Feige2001} are equivalent to Boppana’s optimization function and form the property proved in \cite{Feige2001} that the objective function of the dual SDP of Feige and Kilian preserves minimal bisection regardless of monotone transformations. The aim of this section is to give a direct proof of this property for Boppana's algorithm. \begin{theorem} Let $G=(V,E)$ be a graph with $h(G)=\operatorname{bw}(G)$. Consider some optimum bisection $Y_1,Y_2$ of $G$. \begin{compactenum} \item Let $u$ and $v$ be two vertices within the same part, i.e. $u,v\in Y_1$ or $u,v\in Y_2$, and let $G'=(V, E\cup \{\{u,v\}\})$. Then $h(G')=\operatorname{bw}(G')$. \item Let $u$ and $v$ be two vertices in different parts, i.e. $u\in Y_1$ and $v\in Y_2$, with $\{\{u,v\}\}\in E$ and let $G'=(V, E\setminus \{\{u,v\}\})$. Then $h(G')=\operatorname{bw}(G)-1=\operatorname{bw}(G')$. \end{compactenum} \label{theorem:add:edge:within:part} \label{theorem:remove:cut:edge} \end{theorem} \begin{proof}[Sketch of proof] In order to prove the first part of the theorem, i.e. when we add an edge~$\{u,v\}$, let $A$ and $A'$ denote the adjacency matrices of $G$ and $G'$, respectively. It holds $A'=A+A^\Delta$ with $A^\Delta_{uv}=A^\Delta_{vu}=1$ and zero everywhere else. The main idea is now, that we can derive a new optimal correction vector $d'$ for $G'$ based on the optimal correction vector $d^\mathrm{opt}$ for $G$. We set $d'=d^\mathrm{opt}+d^\Delta$ with \[ d^\Delta_i=\begin{cases} -1 & \text{ if } i=u \text{ or } i=v,\\ 0 & \text{ else.} \end{cases} \] The known changes in the adjacency matrix as well as the derived correction vector allow us to compute $g(G',d')$ and to show that $g(G',d')=\operatorname{bw}(G')$. The proof of the second part of the theorem works analogously. The complete proof can be found in the appendix. \end{proof} \begin{theorem} If Boppana's algorithm finds a minimum bisection for a graph model $\mathcal{G}_n$ w.h.p., then it finds a minimum bisection w.h.p. for the adversarial model $\mathcal{A}(\mathcal{G}_n)$, too. \label{theorem:boppana:adversary} \end{theorem} As a direct consequence, we obtain the following corollary regarding the semirandom graph model considered by Feige and Kilian: \begin{corollary}\label{corr:Bopp:works:for:semi:random} Under assumption \eqref{eq:dens:diff} on $p$ and $q$, Boppana's algorithm computes the minimum bisection in $\mathcal{A}(\mathcal{G}_n(p,q))$, i.e. in the semirandom model, w.h.p. \end{corollary} In \cite{Boppana1987}, Boppana also considers random regular graphs $\mathcal{R}_{n}(r,b)$, where a graph is chosen uniformly over the set of all $r$-regular graphs with bisection width~$b$. He shows that his algorithm works w.h.p. on this graph under the assumption that $b=o(n^{1-1/\lfloor (r+1)/2\rfloor})$. We can now define the semirandom regular graph model as adversarial model $\mathcal{A}(\mathcal{R}_{n}(r,b))$. Applying Theorem~\ref{theorem:boppana:adversary}, we obtain \begin{corollary} Under assumption \eqref{eq:dens:diff} on $p$ and $q$, Boppana's algorithm computes the minimum bisection in the semirandom regular model w.h.p. \end{corollary} Theorem~\ref{theorem:boppana:adversary} can also be applied on deterministic graph classes, e.g. the class of hypercubes. We then obtain: \begin{corollary} Boppana's algorithm (with our modification for non-unique bisections) finds an optimal bisection on adversarial modified hypercubes. \end{corollary} \section{The Limitations of the Algorithm} \label{sec:limitations} Boppana shows, that his algorithm works well on some classes of random graphs. However, we do not know which graph properties force the algorithm to fail. For example, for the considered planted bisection model, we require a small bisection width. On the other hand, as we have seen in Section \ref{sec:non-unique:bisections} Boppana's algorithm works for the hypercubes and their semirandom modifications \textendash\ graphs that have large minimum bisection sizes. In the following, we present newly discovered structural properties from inside the algorithm, which provide a framework for a better analysis of the algorithm itself. Let $y$ be a bisection vector of $G$. We define \begin{equation} \label{def:dy} d^{(y)}=-\operatorname{diag}(y)Ay. \end{equation} An equivalent but more intuitive characterization of $d^{(y)}$ is the following: $d^{(y)}_i$ is the difference between the number of adjacent vertices in other partition as vertex $i$ and the number of adjacent vertices in same partition as $i$. \begin{lemma} Let $G$ be a graph with $h(G)=\operatorname{bw}(G)$ and assume there is more than one optimum bisection in $G$. Then (up to constant translation vectors $c\myvec{1}$) there exists a unique vector $d^\mathrm{opt}$ with $g(G,d^\mathrm{opt})=\operatorname{bw}(G)$. Additionally, for every bisection vector $y$ of an arbitrary optimum bisection in $G$ there exists a unique $\alpha^{(y)}$ and the corresponding $d^{(y)}$, with $g(G,d^{(y)}+\alpha^{(y)} y)=\operatorname{bw}(G)$. \label{lemma:dopt:unique} \end{lemma} Thus, if there are two optimum bisections representing by $y$ and $y'$ with $d^{(y)}\ne d^{(y')}$, then the difference of the $d$-vectors in component $i$ is only dependent on $y_i$ and $y'_i$, since we have $d^{(y)}-d^{(y')}=\beta' y'-\beta y$ for some constants $\beta$ and $\beta'$. This structural property allows us to show the following limitation for the sparse planted partition model $\mathcal{G}_{n}(p,q)$. \begin{theorem}\label{thm:main:neg:res} The algorithm of Boppana fails w.h.p. in the subcritical phase from \cite{Coja2005}, defined as $n(p-q) = \sqrt{np\cdot \gamma\ln n}$, for real $\gamma>0$. \end{theorem} In the planted partition model $\mathcal{G}_{n}(p,q)$, if the graphs are dense, e.g. $p=1/n^c$ for a constant $c$ with $0<c<1$, the constraints for the density difference $p-q$ assumed in Boppana's \cite{Boppana1987} and Coja-Oghlan's \cite{Coja2005} algorithms are essentially the same. However for sparse graphs, e.g. such that $q=\mathcal{O}(1)/n$, the situation changes drastically. Now, e.g. $p=\sqrt{\log{n}} /n$ satisfy Coja-Oghlan's constraint $p-q \ge \Omega(\sqrt{p\ln (pn)}/\sqrt{n})$ but the condition on the difference $p-q$ assumed by Boppana is not true any more. Theorem~\ref{thm:main:neg:res} shows that Boppana's algorithm indeed fails under this setting. The proof of this theorem relies on the following observation, which can be derived from our newly discovered structural properties from above. \begin{lemma} Let $G$ be a graph with $h(G)=\operatorname{bw}(G)$ and let $(Y_1, Y_{-1})$ be an arbitrary optimal bisection. Then, for each pair of vertices $v_i\in Y_i$, $i\in\{1,-1\}$, not connected by an edge ($\{v_i,v_{-i}\}\not\in E$), we have: If $e(v_i,Y_i)=e(v_i,Y_{-i})$ for $i\in\{1,-1\}$ (the vertices have balanced degree), then $N(v_i)=N(v_{-i})$, i.e. both vertices have the same neighbors. \label{lemma:boppana:same:neighbors} \end{lemma} I.e. if we have two balanced vertices in different parts of an optimal bisection, not connected by an edge, then the two vertices must have the same neighborhood as a necessary criterion for Boppana's algorithm to work. In the subcritical phase in Theorem~\ref{thm:main:neg:res}, there exist most likely many of such pairs of vertices, but they are unlikely to have all even the same degree. We can also provide forbidden substructures, which make Boppana's algorithm fail. This is e.g. the case, when the graph contains a path segment located on an optimal bisection: \begin{corollary}\label{corollary:path} Let $G$ be a graph, as illustrated in Fig.~\ref{fig:path} (left), with $n\geq 10$ vertices containing a path segment $\{u',u\},\{u,w\},\{w,w'\}$, where $u$ and $w$ have no further edges. If there is an optimal bisection $y$, s.\,t. $y_u=y_{u'}=+1$ and $y_w=y_{w'}=-1$ (i.\,e. $\{u,w\}$ is a cut edge), then $h(G)<\operatorname{bw}(G)$. \end{corollary} To prove this corollary, we use the more general but more technical Lemma~\ref{lemma:necessary:many:edges} (in Appendix) with parameters $\tilde C_{+1}=\{u\}$ and $\tilde C_{-1}=\{w\}$. \begin{figure}[h!] \begin{center} \begin{tikzpicture}[scale=0.8, every node/.style={scale=0.8}] \node[draw] (a) at (0,2) {$\ldots u'$}; \node (b) at (2,2) {$u$}; \node (c) at (4,2) {$w$}; \node[draw] (d) at (6,2) {$w' \ldots$}; \draw (a) -- (b) -- (c) -- (d); \end{tikzpicture} \hspace{2cm} \begin{tikzpicture}[scale=0.6, every node/.style={scale=0.8}] \node[draw] (a1) at (0,0) {$\ldots u_1'$}; \node (b1) at (2,0) {$u_1$}; \node (c1) at (4,0) {$w_1$}; \node[draw] (d1) at (6,0) {$w_1' \ldots$}; \node[draw] (a2) at (0,-2) {$\ldots u_2'$}; \node (b2) at (2,-2) {$u_2$}; \node (c2) at (4,-2) {$w_2$}; \node[draw] (d2) at (6,-2) {$w_2' \ldots$}; \draw (a1) -- (b1) -- (c1) -- (d1); \draw (a2) -- (b2) -- (c2) -- (d2); \draw (b1) -- (b2); \draw (c1) -- (c2); \draw[dashed] (a1) -- (a2); \draw[dashed] (d1) -- (d2); \end{tikzpicture} \caption{Forbidden graph structures as in Corollary~\ref{corollary:path} (left) and in Corollary~\ref{corollary:grid} (right).} \label{fig:path} \label{fig:grid} \end{center} \end{figure} The result can also be applied for $2\times c$ lattices: \begin{corollary}\label{corollary:grid} Let $G$ be a graph with $n\geq 10c$ vertices containing a $2\times c$ lattice with vertices $u_i$ and $w_i$, as illustrated in Fig.~\ref{fig:grid} (right). (The construction is similar to the corollary above, but now we have a lattice instead of a single cut edge.) If there is an optimal bisection $y$, s.\,t. $y_{u_i}=y_{u_i'}=+1$ and $y_{w_i}=y_{w_i'}=-1$, then $h(G)<\operatorname{bw}(G)$. \end{corollary} Futhermore, the algorithm fails if there are isolated vertices in both parts of an optimal bisection: \begin{theorem} Let $G$ be a graph with $h(G)=\operatorname{bw}(G)$. Let $G'$ be the graph $G$ with two additional isolated vertices, then $h(G')\leq h(G)-\frac{4\operatorname{bw}(G)}{n^2}$. (Note: $G$ has $n$ vertices and $G'$ has $n+2$ vertices.) \label{theorem:no:two:isolated} \end{theorem} \section{SDP Characterizations of the Graph Bisection Problem} \label{sec:comparing:boppana:feige} Feige and Kilian express the minimum-size bisection problem for an instance graph $G$ as a semidefinite programming problem (SDP) with solution $h_p(G)$ and prove that the function $h_d(G)$, which is the solution to the dual SDP, reaches $\operatorname{bw}(G)$ w.h.p. Since $\operatorname{bw}(G)\geq h_p(G)\geq h_d(G)$, they conclude that $h_p(G)$ as well reaches $\operatorname{bw}(G)$ w.h.p. The proposed algorithm computes $h_p(G)$ and reconstructs the minimum bisection of $G$ from the optimum solution of the primal SDP. The authors conjecture in \cite[Sec.~4.1.]{Feige2001} the following: "Possibly, for every graph $G$, the function $h_p(G)$ and the lower bound $h(G)$ computed in Boppana's algorithm give the same value, making the lemma that $h_p(G)=\operatorname{bw}(G)$ w.h.p. a restatement of the main theorem of~\cite{Boppana1987}. In this section we answer this question affirmatively. The semidefinite programming approach for optimization problems was studied by Alizadeh~\cite{alizadeh1995interior}, who as first provided an equivalent SDP formulation of Boppana's algorithm. Before we give an SDP introduced by Feige an Kilian, we recall briefly some basic definitions and provide an SDP formulation for Boppana's approach. On the space $\mathbb{R}^{n\times m}$ of $n \times m$ matrices, we denote by $A\bullet B$ an inner product of $A$ and $B$ defined as $A\bullet B = \operatorname{tr}(AB)=\sum_{i=1}^n \sum_{j=1}^m A_{ij}B_{ij}$, where $\operatorname{tr}(C)$ is the trace of the (square) matrix $C$. Let A be an $n\times n$ symmetric real matrix, then $A$ is called symmetric positive semidefinite (SPSD) if $A$ is symmetric, i.e. $A^T=A$, and for all real vectors $v\in \mathbb{R}^n$ we have $v^T A v \ge 0$. This property is denoted by $A\succeq 0$. Note that the eigenvalues of a symmetric matrix are real. For given real vector $c\in \mathbb{R}^n$ and $m+1$ symmetric matrices $F_0,\ldots,F_m\in \mathbb{R}^{n\times n}$ an SDP over variables $x \in \mathbb{R}^n$ is defined as \begin{equation} \label{eq:def:sdp:primal} \min_x c^T x \quad \text{subject to}\quad F_0 +\sum_{i=1}^m x_i F_i\ \succeq \ 0. \end{equation} The dual program associated with the SDP (for details see e.g. \cite{vandenberghe1996}) is the program over the variable matrix $Y=Y^T \in \mathbb{R}^{n\times n}$: \begin{equation} \label{eq:def:sdp:dual} \max_Y\ - F_0 \bullet Y \quad \text{subject to}\quad \forall i: \ F_i \bullet Y =c_i \quad \text{and}\quad Y\ \succeq \ 0. \end{equation} It is known that the optimal value of the maximization dual SDP is never larger than the optimal value of the minimization primal counterpart. However, unlike linear programming, for semidefinite programs there may be a duality gap, i.e. the primal and/or dual might not attain their respective optima. To prove that for any graph $G$ Boppana's function $h(G)$ gives the same value as $h_p(G)$ we formulate the function $h$ as a (primal) SDP. We provide also its dual program and prove that the optimum solutions of primal and dual are equal in this case. Then we show that the dual formulation of the Boppana's optimization is equivalent to the primal SDP defined by Feige and Kilian~\cite{Feige2001}. Below, $G=(V,E)$ denotes a graph, $A$ the adjacency matrix of $G$ and for a given vector $d$, as usually, let $D=\operatorname{diag}(d)$, for short. We provide the SDP for the function $h$ (Eq.~\eqref{eq:for:function:h}) that differ slightly from that one given in~\cite{alizadeh1995interior}. \begin{proposition}\label{prop:Bopp:reformulation} For any graph $G=(V,E)$, the objective function \[ h(G)\ = \ \max_{d\in \mathbb{R}^n} \frac{\operatorname{sum}(A+D)-n \lambda((A+D)_S)}{4} \] maximized by Boppana's algorithm can be characterized as an SDP as follows: \begin{equation}\label{primal:sdp:boppana} \left\{ \begin{array}{rcl} \multicolumn{3}{l}{ p(G) = {\displaystyle \min_{z\in \mathbb{R},d\in \mathbb{R}^n}} (nz-\myvec{1}^T d ) \quad \text{subject to} }\\[3mm] zI-A+\frac{JA+AJ}{n}-\frac{\operatorname{sum}(A)J}{n^2}-D+\frac{\myvec{1} d^T+d \myvec{1}^T}{n}-\frac{\operatorname{sum}(D)J}{n^2} &\succeq & 0, \end{array} \right. \end{equation} with the relationship $h(G)=\frac{|E|}{2}-\frac{1}{4}p(G)$. The dual program to the program~\eqref{primal:sdp:boppana} can be expressed as follows: \begin{equation}\label{dual:sdp:boppana} \left\{ \begin{array}{rcl} \multicolumn{3}{l}{d(G)= {\displaystyle\max_{Y\in \mathbb{R}^{n\times n}}} \left(A\bullet Y-\frac{1}{n}\sum_j \deg(j) \sum_i y_{ij}-\frac{1}{n}\sum_i \deg(i) \sum_j y_{ij}+\frac{1}{n^2}\sum_{i,j}y_{ij}\right)}\\[3mm] \multicolumn{3}{l}{\text{subject to}}\\[2mm] \sum_i y_{ii}&=&n,\\[2mm] \forall i \quad y_{ii}-\frac{1}{n}\sum_j y_{ji}-\frac{1}{n} \sum_j y_{ij}+\frac{1}{n^2} \sum_{k,j} y_{kj}&=&1,\\[2mm] Y&\succeq& 0. \end{array} \right. \end{equation} \end{proposition} Using these formulations we prove that the primal and dual SDPs attain the same optima. \begin{theorem}\label{th:sdp:boppana:dual:primal:eq} For the semidefinite programs of Proposition~\ref{prop:Bopp:reformulation} the optimal value $p^*$ of the primal SDP~\eqref{primal:sdp:boppana} is equal to the optimal value $d^*$ of the dual SDP~\eqref{dual:sdp:boppana}. Moreover, there exists a feasible solution $(z,d)$ achieving the optimal value $p^*$. \end{theorem} \begin{proof} Consider the primal SDP~\eqref{primal:sdp:boppana} of Boppana in the form \[ \min_{z\in\mathbb{R}, d\in\mathbb{R}^n} z \quad\text{ s.t. }\quad zI-M(d) \ \succeq \ 0, \] with $M(d)=P(A+\operatorname{diag}(d))P-\frac{\myvec{1}^Td}{n}I$ and, recall, $P=I-\frac{J}{n}$. Note that this formulation is equivalent to~\eqref{primal:sdp:boppana}, as we have shown in the proof of Proposition~\ref{prop:Bopp:reformulation}. We show that this primal SDP problem is strictly feasible, i.e. that there exists an $z'$ and an $d'$ with $z'I-M(d')\succ 0.$ To this aim we choose an arbitrary $d'$ and then some $z'>\lambda(M(d'))$. From \cite[Thm. 3.1]{vandenberghe1996}, it follows that the optima of primal and dual obtain the same value. To prove the second part of the theorem, i.e. there exists a feasible solution achieving the optimal value $p^*$, consider the following. The function $h(G)$ maximizes $g(G,d)$ over vectors $d\in\mathbb{R}^n$, while $d$ can be restricted to vectors of mean zero. The function $g$ is convex and goes to $-\infty$ for vectors $d$ with some component going to $\infty$. Thus, $g$ reaches its maximum at some finite $d^\mathrm{opt}$. Now we choose $d=d^\mathrm{opt}$ and $z=\lambda(M(d^\mathrm{opt}))$. Clearly, this solution is feasible and obtains the optimal value $p^*$. \end{proof} For a graph $G=(V,E)$, Feige and Kilian express the minimum bisection problem as an SDP over an $n\times n$ matrix $Y$ as follows: \begin{equation}\label{primal:sdp:feige:kilian} h_p(G) = \min_{Y\in \mathbb{R}^{n\times n}} h_Y(G) \quad\text{ s.t. }\quad \ \forall i \ y_{ii}=1, \ \sum_{i,j} y_{ij} =0, \text{ and } Y\succeq 0, \end{equation} where $h_Y(G)=\sum_{\substack{\{i,j\} \in E \\ i<j}} \frac{1-y_{ij}}{2}.$ For proving that the SDP takes as optimum the bisection width w.h.p. on $\mathcal{G}_n(p,q)$, the authors consider the dual of their SDP: \begin{equation}\label{dual:sdp:feige:kilian} h_d(G)=\max_{x\in \mathbb{R}^{n} } \left(\frac{|E|}{2}+\frac{1}{4}\sum_i x_i\right) \quad\text{ s.t. }\quad M=-A-x_0 J-\operatorname{diag}(x) \succeq 0, \end{equation} where $A$ is the adjacency matrix of $G$. They show that the dual takes the value of the bisection width w.h.p. and bounds the optimum of the primal SDP. Although we know that their SDP and Boppana's algorithm both work well on $\mathcal{G}_n(p,q)$, it was open so far how they are related to each other. Below we answer this question showing that the formulations are equivalent. We start with the following: \begin{theorem} The primal SDP~\eqref{primal:sdp:feige:kilian} is equivalent to the dual SDP~\eqref{dual:sdp:boppana}, with the relationship $h_p(G)=\frac{|E|}{2} -\frac{1}{4}d(G)$. \label{theorem:feige:is:dual:boppana} \end{theorem} From Theorems \ref{th:sdp:boppana:dual:primal:eq} and \ref{theorem:feige:is:dual:boppana} we get \begin{corollary}\label{corr:feige:is:boppana} Let $G$ be an arbitrary graph. Then for the lower bound $h(G)$ of Boppana's algorithm and for the objective functions $h_p(G)$ of the primal SDP~\eqref{primal:sdp:feige:kilian}, resp. $h_d(G)$ of the dual SDP~\eqref{primal:sdp:feige:kilian} of Feige and Kilian \cite{Feige2001} it is true \[ h(G)= h_p(G)=h_d(G).\] \end{corollary} Thus, the both algorithms provide for any graph $G$ the same objective value. We want to point out another important fact: the bisection algorithm proposed in~\cite{Feige2001} use an SDP formulation, where the variables are a matrix with dimension $n\times n$. Thus, there are $n^2$ variables for a graph with $n$ vertices. In contrast, Boppana's algorithm uses $n$ variables in the convex optimization problem. If we consider the dual SDP, we again have only $n+1$ variables. However, due to Corollary~\ref{corr:feige:is:boppana}, we can't be better than Boppana's algorithm. Abbe et~al.~\cite{abbe2016exact} and independently Mossel et~al. \cite{mossel2015consistency} have shown, that there is a sharp threshold phenomenon when considering the $\mathcal{G}_n(p,q)$ model with $p=\alpha\log(n)/n$ and $q=\beta\log(n)/n$ for fixed constants $\alpha,\beta$, $\alpha>\beta$. Exact recovery of the planted bisection is possible if and only if $(\sqrt{\alpha}-\sqrt{\beta})^2>2$ (see e.g. \cite{mossel2015consistency} for a formal definition of exact cluster recovery problem). Hajek et~al.~\cite{hajek2016achieving} show, than an SDP equivalent to the one of Feige and Kilian achieves this bound. Since, due to Corollary~\ref{corr:feige:is:boppana}, we know that the SDP is equivalent to Boppana's algorithm, we conclude that also Boppana's algorithm achieves the optimal threshold for finding and certifying the optimal bisection in the considered model. We get: \begin{theorem} Let $\alpha$ and $\beta$, $\alpha>\beta$, be constants. Consider the graph model $\mathcal{G}_n(p,q)$ with $p=\alpha\log(n)/n$ and $q=\beta\log(n)/n$. Then, as $n\to\infty$, if $(\sqrt{\alpha}-\sqrt{\beta})^2>2$, Boppana's algorithm recovers the planted bisection w.h.p. If $(\sqrt{\alpha}-\sqrt{\beta})^2<2$, no algorithm is able to recover the planted bisection w.h.p. \end{theorem} \begin{proof} The second part of the theorem is exactly the statement from \cite{abbe2016exact}. The first part, i.e. that Boppana's algorithm is able to recover the bisection, follows from \cite[Thm. 2]{hajek2016achieving}. Hajek et al. show, that for $(\sqrt{\alpha}-\sqrt{\beta})^2>2$ the SDP of Feige and Kilian obtain the optimal solution. Due to Theorem \ref{theorem:feige:is:dual:boppana}, the same holds for Boppana's algorithm. \end{proof} \section{Discussion and Open Problems} Boppana's spectral method is a practically implementable heuristic. Computing eigenvalues and eigenvectors is well-studied and can be done very efficiently. Falkner, Rendl and Wolkowicz \cite{falkner1994computational} show in a numerical study that using spectral techniques for graph partitioning is very robust and upper and lower bounds for the bisection width can be obtained such that the relative gap is often just a few percentage points apart. In \cite{tu2000algorithms} and \cite{tu1998spectral}, Tu, Shieh and Cheng present numerical experiments including results for Boppana's algorithm. They verify that the algorithm indeed has good average case behavior over certain probability distributions on graphs. We conducted further experiments on the graph model $\mathcal{R}_n(r,b)$ which indicated, that Boppana's algorithm also works for $r=5$, but not for $r=3$ and $r=4$. An interesting question arising is, which properties of 3- and 4-regular graphs from the planted bisection model let the algorithm fail.
{'timestamp': '2017-05-01T02:03:58', 'yymm': '1701', 'arxiv_id': '1701.01337', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01337'}
arxiv
\section{Conclusions}\label{conc} In this paper, we have proposed a price-based HAS controller that is able to enhance the overall QoS and improve quality fairness among HAS clients sharing a common bottleneck link. Based on the experienced downloading times, a coordinator node evaluates the bottleneck price that reflects the congestion level of the network. The users then perform a quality-fair bitrate selection based on this price information. The ideal controller is adapted to work in realistic settings and tested in the network simulator NS3. The proposed algorithm is extremely scalable in terms of both computation and communication requirements. The simulation results show the ability of the proposed algorithm to work under different network conditions, and to improve the quality fairness of the users when compared to classical rate-fair controllers. The proposed controller is also able to work properly in scenarios where the bottleneck link is shared with TCP and other HAS cross-traffic. As future work, we plan to extend the proposed algorithm to multiple bottlenecks scenarios and to the case of dynamic utility functions, e.g., time varying video complexity. \bibliographystyle{IEEEtran} \section{Controller Implementation}\label{impl} From the theoretical study of the previous section, we now show how to adjust the iterative solution in~\eqref{eq:final} for it to be used in HAS system in practice. In particular we consider a discrete rather than continuous set of bitrates, as well as the actual playout buffer management. The overall HAS multi-user system, depicted in Fig.~\ref{fig:block_dia}, can be seen as a control loop composed of two main entities: the coordinator node, which receives the downloading time measurements from the users and updates the price $\lambda$ accordingly; and the users, which receive the price from the coordinator node and perform the chunk requests based on the video characteristic and the updated price. \begin{figure} \centering \includegraphics[scale=0.22]{block_dia.pdf} \caption{Simplified block diagram of the overall system.} \label{fig:block_dia} \end{figure} \vspace{2mm} \subsection{Coordinator Node} In Algorithm~\ref{alg1}, we present the operations that are executed by the coordinator node to update the price $\lambda$ at every iteration step. The key point is to have a coordinator node that stays as simple as possible without any need for a per user state information, such that the scalability of the system is preserved. Since users are not synchronized the coordinator node processes one user transmission per time. For each downloading time measurement $\tau_{i}$, received from client $i$, the coordinator updates the current maximum downloading time (line 2) and returns the last updated value of the price to user $i$. The second part of the algorithm is executed every $T_{ck}$ and corresponds to the price update. In order to compute the error signal, $\hat{e}$, the coordinator node needs a reference signal $\gamma T_{ck}$, which expresses the value of the maximum downloading time that the users must have at equilibrium, with $\gamma\in [0,1]$ being a multiplicative factor\footnote{Ideally the value of $\gamma$ should be set to $1$ to fully utilize the channel. In practical systems, however, we observed that $\gamma=0.9-0.95$ provides less noisy results at the cost of marginal channel under-utilization.}. The error between the maximum downloading time and the reference downloading time is evaluated (line 6) and filtered by a Low Pass Filter (LPF), implemented as an Exponential Weighted Moving Average (EWMA) with a coefficient equal to $\alpha_e$, (line 7). The filter is necessary since the maximum downloading time is a noisy measure in realistic settings, due to the random behavior of multiple coexisting TCP flows. Finally, the error is integrated according to Eq.~\eqref{eq:final_b} (line 8). Since the complete control loop is composed also by non-linear blocks, e.g., the utility functions, we limit the value of the integral error to zero in order to avoid integral windup effects \cite{windup}. The value of the final price $\lambda$ is then calculated by combining the integral error and the proportional error (line 9), where $K_P$ and $K_I$ represent the proportional and integral gain respectively. Compared to Eq.~\eqref{eq:final_b} we add in the practical implementation a proportional error to improve the stability of the system without affecting the equilibrium point. The values of $K_P$ and $K_I$ must be set in order to guarantee the stability of the system, i.e., ensuring that the loop return ratio of the control loop has a positive phase margin at the cross frequency. Note that $\lambda$, as in Eq.~\eqref{eq:final_b}, is restricted to be positive since negative prices have no meaning. \begin{algorithm}[t] \caption{{Coordinator Algorithm}} \label{alg1} \begin{algorithmic}[1] \If {New downloading time received from use } \State $\tau_{MAX}\gets \max(\tau_{MAX},\tau_{i})$ \State {Send most recent $\lambda$ to the user} \EndIf \State \Loop \Comment {executed every $T_{ck}$} \State {$\hat{e}:=\tau_{MAX}-\gamma T_{ck}$} \State {$e\gets \alpha_e e + (1-\alpha_e) \hat{e}$} \Comment {LPF} \State {$e_I\gets\max(0,e_I+{e})$} \State {$\lambda \gets \max(0, K_P {e} + K_I e_I)$} \Comment{Update price} \State {$\tau_{MAX}\gets 0$} \Comment{Reset $\tau_{MAX}$} \EndLoop \end{algorithmic} \end{algorithm} \begin{algorithm}[t] \caption{Client Controller Algorithm} \label{alg2} \begin{algorithmic}[1] \If {Buffer\_full or download active} \State \Return \EndIf \State \State $r_{coord} := \left[ {U'}(\lambda/\kappa) \right]^{-1}$ \State $\hat{r}_{TCP}:= \text{last chunk TCP throughput}$ \State $\hat{\alpha}_{TCP}:= \alpha_{TCP}(\text{now - last TCP throughput update})/T_{ck}$ \State $r_{TCP} \gets \hat{\alpha}_{TCP}r_{TCP}+(1-\hat{\alpha}_{TCP})\hat{r}_{TCP}$ \Comment{LPF \State $r:=r_{coord}$ \If {$(r_{TCP}<r_{coord})$ and $ (B<T_{ck}(0.6 M))$ } \State $r \gets r_{TCP}$ \EndIf \State $B := \text{BufferLevel}()$ \State $\delta:=\max\left(1.0,\min\left(0.25,\frac{B}{T_{ck}(0.7 M)}\right)\right)$ \State {$l \gets \arg \max_{b(l')<r \delta} b(l') $} \If {$l<l_{old}$} \State {$l \gets \max(l_{old}-1,l_{min})$} \EndIf \If {$l>l_{old}$} \State {$l \gets \min(l_{old}+1,l_{MAX})$} \EndIf \State $\hat{\tau}:= \min(\text{last downloading time},1.25 T_{ck})$ \State $\tau \gets \alpha_{\tau}\tau+(1-\alpha_{\tau})\hat{\tau}$ \Comment{LPF} \State $\hat{q} := \max(1.0,r_{coord,old}/b(l_{old}))$ \State $q \gets \alpha_{q}q+(1-\alpha_{q})\hat{q}$ \Comment{LPF} \State send the chunk request for bitrate $b(l)$ \State send the corrected downloading time to coordinator $q\tau$ \end{algorithmic} \end{algorithm} \vspace{2mm} \subsection{Client Controller}\label{client_sub} We now describe the main steps of the HAS client controller. The behavior of the controller is strongly based on Eq.~\eqref{eq:final_a}. However, we cannot simply use the aforementioned equation since buffer level variations as well as discrete sets of available bitrates need to be taken into account in practice. The full client algorithm, provided in Algorithm~\ref{alg2}, is executed every time a chunk can be downloaded, i.e., anytime a download is finished and the playback buffer is not full (see downloading conditions -- line 1,2). As a first step, the client controller calculates the value of the ideal bitrate $r_{coord}$ from the last received price value $\lambda$ according to Eq.~\eqref{eq:final_a}. The coefficient $\kappa$ is necessary to normalize the value of the price accordingly to the shape of the utility function and to assure the stability of the system. In a theoretical model, the controller would request a chunk of rate $r_{coord}$. However, we cannot fully neglect the experienced TCP throughput as well as the client buffer status in realistic implementations. For example, if the buffer level is very low and the rate suggested by the coordinator system is remarkably high compared to the measured TCP throughput, it might be a good idea to ignore $r_{coord}$ and select the chunk according to the measured bandwidth only. This situation can occur during the startup phase or after a sudden drop of the available bandwidth. Therefore, the controller estimates the TCP throughput as described in~\cite{panda} (lines 5-7) and selects which rate to use between the TCP throughput, $r_{TCP}$, and the ideal rate, $r_{coord}$. Basically, it selects the TCP throughput estimation only if $r_{TCP}<r_{coord}$ and if the video buffer level is below a certain threshold (we set this threshold to be equal to $60\%$ of the maximum buffer occupancy since it offers a good tradeoff between avoiding buffer underruns and trusting generally the coordinator price) (lines 9-10). Next, rather than selecting exactly $r$, the controller will search for a discounted value $r \delta$, with the discount factor $\delta$ defined in line 12, depends on the buffer level occupancy $B$. The discount factor is usually $1$ at regime, but it reduces during re-buffering phases in order to decrease the rate of the requested chunks and refill the buffer faster. The discount factor takes values between $0.25$ in low buffer conditions, and $1$ when the buffer occupancy is higher than 70\%. Finally, the controller selects the chunk with the encoded bitrate that is closest to $r \delta$. In order to select the bitrate level $l$ we first select the maximum bitrate lower than $r\delta$ (line 13) ($b(l)$ is the encoding bitrate for the representation $l$). Secondly, since large quality variations can be badly perceived by the user, we limit the variation of the representation index with respect to the previous selection $l_{old}$ (lines 14-17). We then consider the downloading time of the previous chunk $\tau_{old}$ and we filter this variable using a LPF implemented as an EWMA with a coefficient equal to $\alpha_{\tau}$ (line 18-19). The clipping and filtering of the downloading time is necessary to improve the coexistence with TCP in practice. When users compete against TCP flows, they can experience episodic downloading times that are remarkably larger then the average one, which may cause an unjustified price increase. The last step of this practical implementation takes into account the quantization of the selected chunk rates, which affects the granularity of the downloading time values. Due to the rate discretization we cannot always guarantee an average maximum downloading time that matches exactly $\gamma T_{ck}$. This can lead the controller to frequent oscillations in the price that then translate into annoying oscillations in the users bitrates selection. To overcome this problem, we introduce a new variable $q$, which keeps track of the ratio between the ideal rate and the actual requested bitrate (line 20-21). The value $\alpha_q$ corresponds to the coefficient of the EWMA, and $r_{coord,old}/b(l_{old})$ is the ratio between the previous ideal request, $r_{coord,old}$, and the previous chunk request, $b(l_{old})$. The key point is to perform an upscaling of the measured downloading time based on the experienced quantization step. In this way we are able to decrease the difference between the average downloading time of the most demanding user and the reference signal $\gamma T_{ck}$, reducing the variations of the price. Note that the main drawback of the downloading time correction technique is an under-utilization of the channel (at regime $r_{coord,old}\geq b(l_{old})$), which is however balanced with the reduction of the frequent oscillations of the video quality. An alternative way to solve the bitrate discretization problem is to select the chunks in such a way that the average bitrate is equal to the coordinator rate. This method might be useful if we consider dynamic video complexity, i.e. dynamic utility functions. This is however beyond the scope of this work. As last step the controller sends to the video server the request for a chunk of bitrate equal to $b(l)$ and sends to the coordinator the scaled downloading time measurement equal to $q\tau$. Finally, note that all the clipping operations implemented in the client algorithm are active exclusively during transitory phases, e.g., rebuffering events, therefore they do not affect the bitrate selection at regime. \subsection{Summary of the Proposed Controller} We conclude this section by listing some benefits of the proposed system. \begin{itemize} \item The coordinator node is extremely simple as it does not require any per user state information. The coordinator uses measurement collected from the users to compute a unique global signal that is then sent back to the users. Each user uses then this signal in the bitrate selection in order to increase the overall QoS. The bitrate selection is done in a fully distributed way to meet the HAS paradigm. \item The algorithm requires every user to send the downloading time of every chunk to the coordinator node and to receive the price. However, the size of both measurement and price messages is very small (few bytes). Moreover the communication overhead grows only linearly with both the number of users and the number of chunks. As a result, the proposed system has a limited overhead also for large multi-user systems. \item The coordinator node can be located anywhere in the network as long as it is able to communicate with the HAS users that share the bottleneck link. \item In case of broken communication link between the client controller and the coordinator node, the client can simply fall back to a classical rate/buffer-based HAS controller. Users that are not able to communicate with the coordinator node will be perceived as cross-traffic by the other HAS users, which can still perform the optimal selection strategy. \end{itemize} \section{System Model}\label{system} We describe in detail the framework studied in this paper. We consider a HAS system with $N$ users, or clients, sharing a bottleneck link with an unknown available capacity $C$. This scenario though not general is quite common, think for example about the case where the $N$ users share the same access link or the case where the server access link is the bottleneck. In the event that a heavy traffic load is detected on these links the group of users can ostensibly be gathered. Each client downloads video chunks of time duration $T_{ck}$ by sending HTTP requests to the server. The client then stores the received video data in the playout buffer, which has a maximum capacity of $M$ chunks. After a chunk is downloaded the next one is requested immediately if a free slot is available in the buffer, otherwise the client waits until a chunk is played and a slot becomes free to request the next one. When the buffer is full, requests therefore are made every $T_{ck}$ in stationary regime. Let $r_i$ be the bitrate of the last chunk downloaded by user $i$, and $\mathbf{r}=[r_1, r_2, \ldots, r_N]$ be the vector corresponding to the bitrates of all the recent clients requests. We denote by $\tau_i(\mathbf{r})$ the downloading time for client $i$, defined as the time necessary for user $i$ to download a chunk encoded at rate $r_i$. Note that $\tau_i(\mathbf{r})$ depend s on the entire vector $\mathbf{r}$, since the bottleneck is shared by all users. We denote the rate vector $\mathbf{r}$ as \emph{sustainable} if $\tau_i(\mathbf{r})\leq T_{ck}, \, \forall i$. A sustainable rate vector implies that users download their chunks in an amount of time that is sufficient to avoid buffer underflow. Note that the downloading time $\tau_i(\mathbf{r})$ is an extremely complex function in reality, and represents the network response to the client requests. It depends on the capacity $C$ of the bottleneck link, on the starting time of the downloads, as well as on the random fluctuations of the TCP rate due to packet losses. For the sake of simplicity, we first assume an ideal TCP behavior, which means that: $i)$ the bandwidth is always equally shared among the active connections, $ii)$ the channel is fully utilized when at least one connection is active. Note that these are the ideal characteristic of every rate-fair congestion control algorithms. We then use a realistic TCP connection to evaluate our controller in the conducted experiments. We define $U_i(r_i)$ to be a strictly increasing concave utility function that represents the quality experienced by user $i$ when the video is downloaded at bitrate $r_i$. Utility functions of different users have different shapes to model the different bandwidth requirements for different video sequences. We finally define the overall QoS of the system as the sum of the single utility functions experienced by each user, more formally, $\mathcal{U}(\mathbf{r})=\sum_{i=1}^N U_i(r_i)$. \section{Quality-Fair HAS Congestion Controller}\label{prob} In this section we derive the theoretical foundation of the proposed controller. We focus on the bitrate selection of the users at regime, which means that users need to experience a stationary average downloading time smaller than or equal to $T_{ck}$, in order to avoid buffer underruns, and they request one video chunk every $T_{ck}$. Rebuffering phases and proper buffer management policies are considered later in the practical implementation of the controller, which is described in the next section. We formulate a utility maximization problem for the multi-user system at regime. The goal is to find a rate vector $\mathbf{r}$ that is sustainable and that maximizes the aggregate utility. This can be achieved by solving the classical NUM problem: \begin{equation} \begin{aligned} & \underset{\mathbf{r}}{\text{maximize}} & & \sum_{i=1}^{N} U_{i}(r_{i})\\ & \text{subject to} & &\sum_{i=1}^{N} r_{i} \leq C. \label{NUM} \end{aligned} \end{equation} The problem consists in maximizing a concave objective function of utilities subject to a linear inequality constraint on the cumulative bitrate. The optimization problem in \eqref{NUM} can be solved using a dual algorithm, see~\cite{kelly,tutorial}. The Lagrangian of the problem in \eqref{NUM} corresponds to: \begin{equation} L(\mathbf{r},{\mu})= \sum_{i=1}^{N} U_i(r_{i}) + {\lambda} \left( \sum_{i=1}^{N} r_{i} - C \right), \label{lag} \end{equation} where $\lambda$ is the dual variable, or price, associated to the bottleneck capacity constraint. The optimal solution of the problem can be determined by solving iteratively the following system of discrete dynamic equations: \begin{subequations} \begin{align} \label{solveex_a} {r}^{k+1}_i &= \left[{U'}_i({\lambda^k})\right]^{-1}\ \ i=1...N\\ \label{solveex_b} {\lambda^{k+1}}&= \Bigg( \lambda^k + \beta \left( \sum_{i=1}^{N} r^{k+1}_{i} - C \right) \Bigg)_+ \end{align} \label{solveex} \end{subequations} where $\left[{U'}_i(\cdot)\right]^{-1}$ represents the inverse of the derivative of the utility function of user $i$, $()_+$ denotes the projection onto the positive orthant and $\beta$ is a simple parameter to set the speed of change of the dual variable. Note that users can compute the first step, Eq.~\eqref{solveex_a}, independently, if they know the value of the dual variable $\lambda$. For evaluating the second step, Eq. \eqref{solveex_b}, the value of the capacity $C$ needs to be known. However this quantity cannot be determined handily since its value depends on protocols overheads and potential cross traffic (which cannot be known in advance). We need therefore to modify the second step of the iterative algorithm in order to avoid the explicit the value of the capacity $C$. We thus propose to use the maximum downloading time $\tau_{MAX}=\max_{i=1...N}\tau_{i}$ in place of the rate sum. According to the ideal TCP behavior described in the previous section, when $\sum_{i=1}^{N} r_{i} \leq C$ the rate vector $\mathbf{r}$ is sustainable since the total amount of data can be downloaded in less than $T_{ck}$, similarly when $\sum_{i=1}^{N} r_{i} > C$ the rate vector is not sustainable\footnote{This follows directly from the assumption that when a single TCP connection is active the channel is fully utilized, and that users request at least one chunk every $T_{ck}$ to avoid buffer underruns.}. We can therefore map the sum rate constraint into a downloading time constraint, leading to the following equivalent conditions: \begin{equation} \sum_{i=1}^{N} r_{i} \leq C \iff \tau_{MAX}(\mathbf{r}) \leq T_{ck} \label{eq:equiv} \end{equation} By using the above equivalency we modify the dynamic system in \eqref{solveex} as follows: \begin{subequations} \begin{align} \label{eq:final_a} {r}^{k+1}_i &= \left[{U'}_i({\lambda^k})\right]^{-1}\ \ i=1...N\\ \label{eq:final_b} {\lambda^{k+1}}&= \left( \lambda^k + \beta ( \tau_{MAX}(\mathbf{r}^{k+1}) - T_{ck} ) \right)_+. \end{align} \label{eq:final} \end{subequations} The first step has not changed, but the second step of Eq. \eqref{eq:final_b} can now be easily computed since every user knows the downloading time of the requested chunks, and the maximum value can easily be extracted. The capacity value is not used explicitly anymore, however it is implicitly included in the downloading time measurement $\tau_{MAX}(\mathbf{r})$. Since the constraints in \eqref{eq:equiv} are equivalent, \eqref{solveex} and \eqref{eq:final} converge at equilibrium to the same rate vector $\mathbf{r}$. We give now a brief discussion of how the iterative steps of system \eqref{eq:final} can be computed in reality. The adaptation logic, i.e., the selection of the bitrate at the client side is represented by Eq.~\eqref{eq:final_a}, while the price update of the coordinator node is given by Eq.~\eqref{eq:final_b}. In more details, in the first step, Eq. \eqref{eq:final_a}, all the users independently compute the optimal bitrate and request the chunks to download at the next iteration accordingly. After the download every user sends to the coordinator node the measured downloading time. The coordinator then performs a maximum pooling operation on the received downloading times and updates the dual variable $\lambda$ using Eq. \eqref{eq:final_b}. The value of $\lambda$ is then sent to the users for the next bitrate selection. By performing these steps iteratively, the system converges to the optimal equilibrium point. The iterative solution in \eqref{eq:final} represents a modification of the solution of classical NUM problems for the case of HAS system. By using the downloading time of the chunks we can detect an overuse of the available bandwidth without requiring the knowledge of its actual value. Finally, note that the equivalency of the two conditions in Eq.~\ref{eq:equiv} is true only if the ideal characteristic of the congestion control is verified. If this assumption does not hold, the equivalency is only an approximation whose accuracy depends on the actual behavior of the congestion control. As a result in the real world we need to consider the usage of the downloading time condition instead of the original rate condition as an heuristic approximation suggested by ideal assumption on the congestion control used. Nevertheless the update rules in \eqref{eq:final} are extremely important as to derive a cooperative adaptation strategy for HAS users. \section{Introduction} HTTP adaptive streaming (HAS) has become the universal client-driven streaming solution for video distribution over the Internet, an example of this paradigm is given by the Dynamic Adaptive Streaming over HTTP~\cite{stockhammer} (DASH) standard. In HAS, as it is shown in Fig.~\ref{fig:system}, the video content is available at the main server in different coded versions, namely representations, each one with a given bitrate and resolution. The representations are subdivided into chunks of few seconds typically, which are then downloaded by clients using HTTP requests over TCP. Each HAS client selects the best representation to download (i.e., the best encoding rate and resolution) independently from the other clients. Therefore HAS systems are able to respond to the heterogeneous demands of several HAS clients in a fully distributed and adaptive way. The bitrate to download is usually selected by taking into account both the download rate of the previous chunks and the status of the playout buffer, with the aim of maximizing the downloaded bitrate while minimizing the possibility of rebuffering events. One of the most challenging aspects in HAS systems is the proper design of the adaptation logic (i.e., the selection of the bitrate to request) at the client side. An intense research has focused on designing HAS client controllers that guarantee a stable and fair utilization of the network resources among multiple clients sharing the same bottleneck. However, most of this research aims at reaching rate fairness among clients rather than quality fairness. Ideally, video distribution solutions should share the bandwidth in such a way that the different users experience a similar video quality. Unfortunately, since video sequences generally have different characteristics, equal rate allocation among clients (rate fairness) does not necessarily translate into quality fairness. From this point of view, the complete freedom left to HAS clients that selfishly maximizes their own download bitrate reveals its drawback. To overcome this main limitation, the MPEG group is developing an extension of the DASH standard called Server and Network Assisted DASH (SAND) \cite{sand}. SAND is based on asynchronous client-to-network and network-to-network transmissions aimed at improving the Quality of Service (QoS) without interfering with the delivery of the media stream. In this spirit, we focus on the bitrate selection problem in order to increase the overall QoS of the clients and therefore improve the quality fairness. Inspired by the well known Network Utility Maximization (NUM) framework in congestion controllers~\cite{kelly}, we design a price-based distributed controller, that maximizes the overall delivered QoS and improves the QoS fairness among users while respecting the guidelines of the SAND extension. More in details, we consider a multi-users HAS system where clients share a common bottleneck. We define an objective function to properly map the encoding rate of the downloaded representations to the QoS delivered to clients. Typically, different video characteristics lead to different objective functions. We then define the congestion level of the network as a function of the downloading times of the chunks, which value can easily be measured by the clients. We introduce a coordination node, which corresponds, for example, to a DASH-Assisting Network Element (DANE) in the SAND terminology. As shown in Fig.~\ref{fig:arch}, this node does not have to lie on the media delivery path, which facilitates the deployability of the proposed solution. The coordination node gathers the the downloading times of the chunks from the HAS clients and iteratively updates the price value accordingly, the updated price is then sent back to the clients. By following an appropriate price-based bitrate selection policy, users with simple video sequences, i.e., low bandwidth requirements, do not increase the bitrate of the requested chunks in congested periods in favor of users downloading more complex videos. This policy ultimately leads to a higher overall QoS of the HAS system and to a quality-fair resource allocation. We test the proposed solution in a network simulator (NS3) under different network conditions and we compare it with other rate-fair controllers proposed in the literature. The simulation results confirm that the achieved rate allocation leads to a better quality fairness among the users with respect to the baseline rate-fair HAS controllers. Moreover, we show the ability of our new algorithm to coexist with TCP cross-traffic and other HAS controllers. \begin{figure} \centering \includegraphics[scale=0.115]{overview.pdf} \caption{General HAS system architecture.} \label{fig:system} \end{figure} \begin{figure}[t] \centering \includegraphics[scale=0.14]{system.pdf} \caption{Proposed system architecture.} \label{fig:arch} \end{figure} In summary, the main contributions of the paper are the following: $i)$ we propose a distributed HAS controller that targets quality fairness among several HAS clients sharing a common bottleneck; $ii)$ we introduce a method for measuring the congestion level of a bottleneck link for HAS that relies exclusively on client measurements; $iii)$ we design our controller such that it can be integrated in the SAND architecture; $iv)$ we carry out performance simulations with a realistic network simulator that shows the benefits of the proposed solution. The paper is structured as follows. In Section \ref{related}, we report some related works on the QoS enhancement in HAS systems. In Section \ref{system}, we provide a description of the considered framework. In Section \ref{prob}, we derive the theoretical foundation of the proposed bitrate selection strategy using a simplified model. In Section \ref{impl}, we describe in detail the practical implementation of the controller. We present in Section \ref{results} the simulations results. Finally, conclusions are provided in Section \ref{conc}. \section{Related Works} \label{related} Since a complete description of the whole literature in adaptation algorithms for HAS would not possible due to space limitations, with the following we discuss the works that focus on quality-fairness in HAS. In~\cite{new_schroeder}, the authors optimize the bitrate selection in order to maximize the Quality of Experience (QoE) among a set of HAS users on a wireless link. In this case the base station carries out the optimization according to the different video characteristics. Though this system is able to effectively allocate the available bandwidth it has some drawbacks in terms of deployability, it requires to modify a network element that lies on the delivery path, and scalability, the base station has to collect all the information about the users' videos and solve the optimization problem. In our proposed system the coordinator is not responsible for solving the optimization problem and it does not need to hold any per user information, thus preserving system scalability. Several works \cite{SDN,cofano,holland} have proposed solutions for improving DASH QoS based on Software Defined Networking (SDN). The common feature of these solution is the presence of a central network controller that controls the video flows that are currently active in the network. While SDN is a promising technology to improve Internet performance, it is not currently deployed on a wide scale, therefore solutions based on this technology are not suited for many of the nowadays networks. In this work, we rather aim at improving the QoS in HAS with an algorithm that exclusively works at the application level and does not assume any particular technology about the inner network nodes. In \cite{QL2}, the authors propose a Q-learning multi-agent system for HAS users sharing a common bottleneck in order to maximize a global QoS metric. The problem is formulated as a reinforcement learning problem where the HAS user represents the learning agents. Although this method ultimately achieves the optimal bitrate selection, it requires a very long training phase to learn the optimal solution, making the deployability of this system in realistic environments problematic. In our case we use a model-based formulation therefore we do not require any learning phase and we quickly converge to the optimal bitrate selection. \section{System Evaluation}\label{results} We now provide simulation results to evaluate the performance of the proposed system. We implement the algorithm described in Section \ref{impl} in the NS3 network simulator and evaluate it in different representative scenarios. \subsection{Experimental Setup} In order to evaluate the proposed algorithm we use the well-known Structural Similarity (SSIM) metric~\cite{ssim} as a utility function. We consider four types of videos with different properties: a high motion sport video, two medium complexity videos, a cartoon and a documentary, and a low complexity lecture video. The original videos have been downscaled to smaller resolutions and every resolution has been encoded at different bitrates using h264 codec~\cite{h264}. We have then extracted the average SSIM of the encoded sequences at different bitrates. We have derived the following continuous model of the SSIM: \begin{equation} U_i(r)=a_i \cdot r^{b_i}+c_i, \label{ssim_fit} \end{equation} where the coefficients $a_i$, $b_i$ and $c_i$ for the encoded sequence $i$ are derived by curve fitting with the SSIM experimental points. The experimental SSIM data points and the fitting curves are depicted in Fig.~\ref{ssimcurves}. Note that a visually pleasant video usually has a SSIM score above $0.8$ and a gain in SSIM of $0.05$ might correspond to an increase of one point in Mean Opinion Score (MOS)~\cite{choivideo}. In our simulations we identify each user with a single video at a given resolution, therefore with a single constant utility curve that is then used to execute the adaptation logic described in Subsection~\ref{client_sub}. We assume that each user knows the utility function of the requested video. In reality, this is possible by including this information in the Media Presentation Description (MPD) file of the video, or alternatively, the service provider can make it available on the server as secondary information. Another possibility is that the users implement a no-reference distortion model to assess the quality of the displayed video sequence. \begin{figure} \centering \includegraphics[scale=0.2]{test.pdf} \includegraphics[scale=0.2]{test_leg.pdf} \caption{Quality-rate utility functions for the video sequences under consideration. Solid lines represent the continuous model of Eq. \eqref{ssim_fit} while symbols are experimental measurements.} \label{ssimcurves} \end{figure} We compare our algorithm with three HAS controllers proposed in the literature, namely a \emph{conventional} HAS controller as described and implemented in~\cite{panda}, the Probe and Adapt (PANDA) algorithm also proposed in~\cite{panda}, and the ELASTIC algorithm proposed in~\cite{elastic}. These three algorithms represent well the different behavior that rate-fair controllers can exhibit: PANDA is more conservative since it prefers to slightly underutilize the channel at the benefit of having a more constant bitrate selection. ELASTIC, on the other hand, strives to fully utilize the channel at the cost of more frequent quality variations. The conventional controller offers somehow an average behavior compared to the other two. To have a fair comparison among the different controllers, we fix the maximum buffer size of all the algorithms to $M$ chunks, and we modify accordingly the parameters that control the buffer size in the baseline algorithms. In particular, the parameters $B_{min}$ of PANDA and $q_T$ of ELASTIC are both set to $6T_{ck}$. The other parameters of the baseline algorithms are set accordingly to the cited works. Note that in our work we do not consider freezing events as metric of comparison, therefore reducing the size of the buffer does not penalize any of the algorithms. For the proposed quality-fair algorithm, the value of the parameters are listed in Table~\ref{tab:param}. We set the values of these parameters in order to have: $i)$ a good reactivity, thus good speed to convergence, $ii)$ and clean signals, thus reducing the noise introduced by the network measurements. Finally, the proposed controller as well as the baseline algorithms are tested over the network topology depicted in Fig.~\ref{topo}, where all users share the same bottleneck link. The links that connect the HAS users to the bottleneck link are local high-speed links. Lastly, the cross-traffic, if present, shares only the bottleneck link with the other HAS users. \begin{table}[h] \centering \caption{Parameters used in the implementation} \label{tab:param} \begin{tabular}{|c||c|} \hline Parameter & value \\ \hline \hline \multicolumn{2}{|c|}{All algorithms} \\ \hline $T_{ck}$ & $2$ s \\ \hline $M$ (Max buffer size) & $10$ \\ \hline Bitrates available & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}$[400\ 640\ 880\ 1200\ 1680\ 2240\ $\\ $2800\ 3600\ 4400\ 6000]$ kbps\end{tabular}} \\ \hline \hline \multicolumn{2}{|c|}{Proposed algorithm} \\ \hline $\gamma$ & $0.95$ \\ \hline $\alpha_e$ & $0.75$ \\ \hline $K_p$ & $1$ \\ \hline $K_i$ & $0.25$ \\ \hline $\kappa$ & $1e6$ \\ \hline $\alpha_{TCP}$, $\alpha_q$, $\alpha_{\tau}$ & $0.75$ \\ \hline \hline \end{tabular} \end{table} \begin{figure} \centering \includegraphics[scale=0.125]{topo.pdf} \caption{Topology used in the different simulated scenarios.} \label{topo} \end{figure} \subsection{Simulation Results} We now provide the simulation results carried out in the settings described above. We show first in detail how the proposed algorithm behaves. Then, we show the gain of our controller with respect to rate-fair controllers when the bottleneck is shared by many HAS users. In a last set of simulations we evaluate the performance of the proposed algorithm when competing with cross-traffic. In the first test case three HAS clients share a common bottleneck link that has a capacity of $5$ Mbps. The Users $2$ and $3$, download the cartoon video at resolution $1080$ and the lecture video at resolution $720$, respectively, from the beginning of the simulation and stay always active, while user $1$ downloads the sport video at resolution $540$, between the timestamps $250$s and $600$s. The results are depicted in Fig.~\ref{sim1}. In Fig.~\ref{sim1}a, we provide both the video bitrate selected by the users and the ideal bitrates ($r_{coord}$) as described in Subsection~\ref{client_sub}. This plot shows the ability of the algorithm to fairly allocate the available bandwidth when client have different utility functions. Since user $1$ is the one consuming the most complex video sequence, it is also the one that gets a larger portion of the channel link. From the SSIM curves, we know that for a bitrate of about $2.2$ Mbps, user 1 experiences a SSIM value of approximately $0.94$, while user 3 already achieves a SSIM value above $0.98$ at $0.4$ Mbps. Thus, the proposed controller is clearly able to improve the quality fairness among the users with respect to a rate-fair controller, which would allocate approximately $1.5$ Mbps per user, making user 1 suffer of poor video quality while only slightly increasing the quality of user 3. Fig.~\ref{sim1}b further shows the buffer level of the users. The playout buffers of all the three users have an occupancy level close to the maximum value, and no underruns are experienced during the simulation. The channel utilization, depicted in Fig.~\ref{sim1}c, is also satisfactory. In fact the total download rate, given by the sum of the bitrates requested by all users, settles to a value that is close to the channel capacity. Note that the reported channel capacity corresponds to the physical bandwidth, which does not take into account the TCP/IP protocols overhead, thus it is not possible to exactly match its value. \begin{figure} \centering \includegraphics[scale=0.1925]{rate_3.pdf} \includegraphics[scale=0.1925]{rate_3_sing.pdf} \caption{Performance of the proposed algorithm when three HAS users implementing our algorithm compete for the same bottleneck channel. The three plots respectively show the selected and ideal bitrates, the buffer occupancy and the channel utilization.} \label{sim1} \end{figure} We now consider $N$ users, and we randomly assign to each of them a video at a given resolution and thus a corresponding utility curve. We then set the bottleneck capacity $C$ to $NC_{usr}$, where $C_{usr}$ is the average per user capacity. We consider $10$ different realizations of the utility-user random selection, every metric shown in the final plots is the result of the average operation among the different realization. For each realization, we simulate the video streaming session where all users are simultaneously active for 460 seconds and we evaluate the average SSIM experienced at regime, i.e., after 60 seconds of video. Beyond the average SSIM, we also compute for each user the average SSIM variation per downloaded chunk as follows: \begin{equation} \Delta\text{SSIM}_{ck}=\frac{1}{L-1}\sum_{l=2}^L |\text{SSIM}(l)-\text{SSIM}(l-1)|, \end{equation} where $L$ is the total number of chunks downloaded by the user and $\text{SSIM}(l)$ is the SSIM value for chunk $l$. After we compute the average SSIM variation for every user, we average this value among the user population of the simulation. This metric quantifies the average variation of quality level among consecutive chunks and captures possible SSIM oscillations rather than the simple heterogeneity of the SSIM over the all video sequence. Since it has been shown that frequent quality switches result in QoE degradation~\cite{switchdash}, the lower the $\Delta\text{SSIM}_{ck}$ the better the QoE. The last metric that we compute is the capacity usage, which is the time average cumulative downloaded bitrate of the users divided by the total capacity. A capacity usage close to $1$ means an efficient use of the available resources. The three metrics above are evaluated in scenarios with different numbers of users, i.e., $N=[2\ 4\ 8\ 12\ 25\ 50\ 100]$, and different per user capacities, i.e., $C_{usr}=[0.75\ 1.25\ 2.0]$ Mbps. The corresponding results are depicted in Fig.~\ref{sim_var_usr}. Every element of the box-plot is composed of $i)$ a rectangle, which represents the first and third quartile divided by the median value $ii)$ the whiskers, which delimit the minimum and the maximum value of the time-average SSIM among the user population and $iii)$ the black dot which corresponds to the mean value over the population. We can notice that our algorithm is in general able to achieve better average quality compared with the rate-fair controllers. In particular the proposed algorithm is able to allocate more rate to the users that are watching high demanding videos. The minimum average SSIM of the proposed algorithm is remarkably higher than the one of the rate-fair controllers. By looking at the numerical values, it can be seen that our method can achieve a gain up to $0.05$ points of SSIM for large values of $N$, and a gain of around $0.01$ points of SSIM for small values of $N$. In general, the SSIM gain is larger for larger value of $C_{usr}$, since there is a larger margin of optimization in this case thanks to the larger amount of total bandwidth that can be re-allocated among the users. It is also worth noting that all the baseline algorithms show comparable performance among each other since they all target a rate-fair allocation. Beyond increasing the average SSIM, the proposed algorithm also reduced the average SSIM variations. As it is shown in the second column of Fig.~\ref{sim_var_usr}, this value is substantially smaller than the variations experienced by the rate-fair controllers. The PANDA algorithm, since it is the most conservative, is the one behaving best among the three controllers used for comparison, as expected. From the third column of Fig~\ref{sim_var_usr}, we can notice that the proposed algorithm is the one achieving the lowest bandwidth utilization. Nevertheless, the efficient usage of the bandwidth permits to the proposed algorithm to have better performances in the other metrics. The low bandwidth utilization is caused by the policy of selecting always a bitrate that is lower than the ideal bitrate. By applying a selection policy that targets a bitrate selection that is on average equal to the ideal rate the capacity usage can be increased, at the cost of more quality variations. Finally, note that we vary the number of users from a simple 2 users scenario to a scenario with 100 users, the proposed algorithm always achieves a better quality fairness with respect to rate-fair controllers, showing that our system scales well to large population of clients. \begin{figure*} \centering \includegraphics[scale=0.3]{first.pdf} \includegraphics[scale=0.3]{first_leg.pdf} \caption{ SSIM statistics, SSIM variations and channel utilization for the four implemented controllers for different numbers of users $N$. The per user capacity $C_{usr}$ has been set to $0.75$, $1.25$ and $2.0$ Mbps for the first, second and third row of plots respectively.} \label{sim_var_usr} \end{figure*} We further analyze the performance of our algorithm when the bottleneck capacity is shared with TCP cross-traffic for different amounts of TCP connections. We set the number of HAS users to $N=16$ and then add different numbers of TCP connections, i.e., $N_{TCP}=[2\ 4\ 8\ 16]$; in percentage the amount of TCP cross-traffic varies accordingly from $11\%$ to $50\%$ of the total connections. We also vary the amount of the total capacity: $C=(N+N_{TCP})C_{usr}$, and the per user capacity is set to $C_{usr}=[0.75\ 1.25\ 2.0] $ Mbps in different simulations. We then compute the same metrics of the previous tests and the results are shown in Fig.~\ref{sim_var_usr_TCP}. The average SSIM shows that the different algorithms are able to achieve approximatively the same performance. However, the proposed algorithm achieves higher values of minimum SSIM with respect to the rate-fair controllers. From the second column in Fig. \ref{sim_var_usr_TCP}, we see that the proposed method achieves the lowest SSIM variations in most of the cases, confirming the behavior of Fig.~\ref{sim_var_usr}. In terms of channel utilization, ELASTIC is the algorithm that achieves the highest utilization ratio. Our algorithm instead has the lowest channel utilization together with the PANDA algorithm. We further notice that the sum of the HAS users utilization plus TCP utilization (in dashed lines) is close to one, as expected. We finally point out that our algorithm achieves approximatively the same average quality as the other algorithms using less bandwidth. \begin{figure*} \centering \includegraphics[scale=0.3]{sec.pdf} \includegraphics[scale=0.3]{sec_leg.pdf} \caption{ SSIM statistics, SSIM variations and channel utilization for the four implemented controllers for a set $16$ HAS users sharing the bottleneck with a varying number of TCP flows . The per user capacity $C_{usr}$ has been set to $0.75$, $1.25$ and $2.0$ Mbps for the first, second and third row of plots respectively.} \label{sim_var_usr_TCP} \end{figure*} Finally, in the last set of simulations, we consider the scenario where only HAS users share the bottleneck channels, but with different controllers implemented at the client side. More in details, we have $4$ HAS users, two with the proposed algorithm, two with one of the other baseline controllers. The users $1$ and $2$, which implement the proposed algorithm, download a high complexity video and a low complexity one respectively. The baseline controllers (users $3$ and $4$) are content agnostic, thus their behavior does not depend on the utility curve of the videos. The bottleneck capacity is set to $8$Mbps, and all the users are simultaneously active during the simulation. The results are shown in Fig.~\ref{sim5}. The green and blue bars correspond to the average bitrate requested by the clients implementing the proposed algorithm, while the two red bars correspond to the average bitrate requested by clients implementing one of the other controllers. The least fair scenario is the one in which the proposed algorithm competes with PANDA. This is expected since, as we have observed in the previous results PANDA is a very conservative algorithm. On the other hand ELASTIC, which is the most aggressive controller, achieves a larger downloading rate when competing with the proposed controller. The goal of this final tests is to show that the rate-fair HAS controllers neither dominate,nor are dominated by the proposed algorithm and that they can effectively coexist. Consequently we expect that in a scenario with a large number of rate-fair HAS controllers the performance achieved by our controller are comparable to the TCP cross-traffic results of Fig.~\ref{sim_var_usr_TCP}. \begin{figure}[h] \centering \includegraphics[scale=0.18]{vs_other.pdf} \caption{Average equilibrium bitrate achieved by the proposed controller when competing with the other rate-fair HAS controllers.} \label{sim5} \end{figure}
{'timestamp': '2017-01-06T02:06:14', 'yymm': '1701', 'arxiv_id': '1701.01392', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01392'}
arxiv
\section{Introduction} \blfootnote{ This work is licenced under a Creative Commons Attribution 4.0 International License. License details: \url{http://creativecommons.org/licenses/by/4.0/} } \blfootnote{ This work is supported by the National Natural Science Foundation of China (grant No.61472017, M1552004). } \par Representing meanings of words by embedding them into a high dimensional vector space, so called word embedding, is a useful technique in natural language processing. An intuitive idea is to encode one word into a single vector, which contains the semantic information of the word in corpus \cite{bengio2003neural, collobert2008unified, mnih2007three, mikolov2010recurrent}. \par There is a consensus that natural languages always include lots of polysemous words. For example, when the word {\sl star} appears together with words like {\sl planet, satellite}, it may roughly denote a kind of celestial body; when {\sl star} appears with words like {\sl movie, song, drama}, it may stand for a famous person. For most cases, we human beings can easily point out which sense a word belongs to based on its context. Considering the polysemous words, some previous approaches have learned multiple embeddings for a word, discriminating different senses by their context, related syntax and topics \cite{reisinger2010multi, huang2012improving, chen2014unified, pina2014simple, neelakantan2015efficient, cheng2015syntax, liu2015topical}. The authors also provided methods to disambiguate among the multiple representations. \newcite{li2015multi} have demonstrated that multi-sense word embeddings could be helpful to improve the performance on many NLP and NLU tasks. \par However, this leads to another problem. It's much more difficult for computer than human beings to detect whether two appearances of a same word stand for the same sense. Moreover, the contexts may be totally different even if these appearances belong to the same meaning based on human judgement. Previous multi-sense word embedding approaches often tend to embed a word in such situation into more than one vector by mistake (actually, they have the same meaning and should be embedded into only one vector). Consider three different representations of word {\sl bear} learnt by the method introduced by \newcite{neelakantan2015efficient}, which are shown by their nearest neighbors in the vector space {\sl MSSG-50d}. \begin{itemize} \item emerald, \textbf{bears}, \textbf{three-toed}, \textbf{snake}, \textbf{periwinkle}, \textbf{ruffed}, \textbf{hoopoe}, distinctive, unmistakable \item \textbf{bird}, \textbf{wolf}, arrow, \textbf{pelican}, emerald, canyon, diamond, \textbf{buck}, \textbf{deer} \item pride, lady, hide, king, gift, crane, afflict, promise, reap, protect \end{itemize} The words clearly related to the domain {\sl animals} are bolded. We could infer that the first two representations have the same meaning that points to the animal bear, and the third representation has different meaning. We call such different learnt representations of a word with the same meaning (e.g. the first two representations of word {\sl bear} shown above) {\sl pseudo multi-sense}, where we judge whether senses are pseudo multi-sense by comparing their domains. \par Given the word embeddings, which have multiple vectors for each polysemous word, we introduce an algorithm based on domains and semantic relations to detect pseudo multi-sense, since word representations which stand for the same meaning would have the same hypernym and belong to the same domain. Then we try to eliminate the effect of pseudo multi-sense by training a global transition matrix which projects the original word vectors into a new vector space based on the detected pseudo multi-sense pairs, minimizing the distance between pseudo multi-sense pairs in the vector space while keeping the spatial relation of other pairs. We propose the algorithm in Section 3 and evaluate it in Section 4. \par Obviously, detecting and diminishing pseudo multi-sense would make word sense representations, which can be processed by computer, closer to human thinking. We also suggest this approach can improve the performance on real world NLU tasks by evaluating the algorithm on the analogy test dataset introduced by \newcite{mikolov2013efficient}, and also on WordSim-353 \cite{finkelstein2001placing} and SCWS \cite{huang2012improving} dataset which include human judgements on similarity between pairs of words. \section{Background and related work} \subsection{Distributional word representations} Since \newcite{bengio2003neural} applied neural network to language model, which treats word embeddings as parameters and thus it allows us to learn the language model and word embeddings at the same time, many researchers have proposed other neural network models \cite{mnih2007three, collobert2008unified, mikolov2013efficient} to improve in both efficiency and accuracy. What's more, hierarchical softmax by \newcite{morin2005hierarchical}, noise contrastive estimation by \newcite{mnih2013learning} and negative sampling by \newcite{mikolov2013linguistic} make it possible to learn accurate word embeddings in a short time. \subsection{Multi-sense word embeddings} \par Most vector-space models (VSMs) represent a word with only one vector, which clearly fails to capture homonymy and polysemy. And thus, \newcite{huang2012improving} proposed a method to generate the context embeddings in the following way. Firstly, they generate single-sense word embeddings and compute out the context embeddings. Then they cluster the context embeddings, and the result are used to re-label each occurrence of each word in the corpus. Thirdly, the model they proposed is applied to the labeled corpus to generate the multi-sense embeddings. \newcite{chen2014unified} took external knowledge base into consideration and built a model to learn a separate vector for each sense pre-defined by WordNet \cite{miller1995wordnet}. \newcite{neelakantan2015efficient} improved multi-sense word embedding model by dropping the assumption that each word should have the same number of senses, and proposed a non-parametric model to automatically discover a varying number of senses per word type. \newcite{cheng2015syntax} proposed a syntax-aware approach for multi-sense word embeddings. \subsection{WordNet and WordNet domain knowledge} \par WordNet \cite{miller1995wordnet} is a large lexical database of English. Nouns, verbs, adjectives and adverbs are grouped into sets of cognitive synonyms, namely synsets, each expressing a distinct concept. Synsets are represented by a word, a pos tag and a label, and interlinked by means of conceptual-semantic and lexical relations (hypernymy/hyponymy). \newcite{chen2014unified} used WordNet to improve word embeddings. \par \newcite{magnini2000integrating} and \newcite{bentivogli2004revising} presented a WordNet Domains Hierarchy, which is a language-independent resourse composed of 164 domain labels. What's more, \newcite{gonzalez2012graph} provided a graph based improvement and released a domain knowledge (Extended WordNet Domains) base aligned to WordNet 3.0, which we use in our experiments as domain knowledge. Extended WordNet Domains contains 170 domains and the probability of each synset in WordNet 3.0 in each domain. The domains it provided include {\sl acoustics, agriculture, volleyball, etc.} \subsection{Vector space projection} Even though bilingual data always plays an important role in the modern statistical machine translation system, it had failed to map the missing word and phrase entries between two languages until \newcite{mikolov2013exploiting} proposed a simple but effective method to extend dictionaries and translation tables. The main idea of this novel method is to learn a linear projection between the languages using a small bilingual dictionary but making little assumption about the languages, which has proved to be able to project the vector representation of any word from the source space to the target space accurately. Our vector space projection algorithm is very similar to this. \section{Pseudo multi-sense detection and elimination by vector space projection} \subsection{Domain based pseudo multi-sense detection} \subsubsection{Direct domain similarity} \par Given a word and its context, we human beings can easily determine the domains this word belongs to. WordNet makes it convenient for users to get the domains of all synsets of a word. To determine the domain of a sense given the multi-sense word embeddings, we can intuitively define the probability that the $k^{th}$ sense of word $w$ belongs to domain $d$ as \begin{equation} \label{pdomain} P_D(w, k, d) \propto {\sum_{w' \in NN(w, k)} D(p(w'), d)} \end{equation} where $NN(w,k)$ is the nearest neighbors of the $k^{th}$ sense of word $w$ in the given word embeddings, $p(w')$ is the protocol representation of word $w'$ (e.g. when $w'$ is {\sl star\_s1}, $p(w')$ would be {\sl star}), $D(p(w'), d)$ is the sum probability that domain $d$ appears in all synsets of $p(w')$ in WordNet provided by Extended WordNet Domain. Then we can compute the domain similarity between the $k^{th}$ and the $l^{th}$ sense of word $w$ by \begin{equation} Sim_D(w,k,l) = \frac 1n|TopN(P_D,w,k,n) \cap TopN(P_D,w,l,n)| \end{equation} where $TopN(P, w, k, n)$ is the set of $x$ that $P(w,k,x)$ ranks top $n$ in decreasing order (in our experiments, $n = 5$). \subsubsection{Semantic hierarchical similarity} \par However, in the knowledge base we applied, the domain knowledge is sometimes not enough for dectecting pseudo multi-sense, especially for some abstract words. For example, it's hard to specify which domain the word {\sl extract} belongs to. What's more, based on \newcite{gonzalez2012graph}, the Extended WordNet Domain cannot reach the precision of 100\%. So we tend to apply semantic hierarchy, particularly hypernymy relations, to help improve our pseudo multi-sense detecting as supplement, since hypernymy somehow contains some domain information. With WordNet, we can also get the semantic relations (e.g. hypernymy, hyponymy, synonymy) of synsets. With the consideration of the DAG structure of semantic relations, for hypernyms of a specific word, the nearer the hypernym, the more information it contains. So we penalize the {\sl far hypernyms}, like {\sl whole, entity, thing}, which cover a large amount of words as their hyponyms. Similar to the definition of $P_D(w,k,t)$, we can define the probability that the $k^{th}$ sense of word $w$ has the hypernym $h$, where $h$ is a synset in WordNet, as \begin{equation} \label{phyper} P_H(w, k, h) \propto \frac{1}{d(w,h)} {\sum_{w' \in NN(w, k)} H(p(w'), h)} \cdot \frac{1}{d(p(w'),h)} \end{equation} where $d(w,h) = \min_{sw \in Synsets(w)} dis(sw, h)$, $dis(x, y)$ is the distance between two synsets $x$ and $y$ in WordNet, $H(p(w'), h)$ is the frequency that the synset $h$ appears as a hypernym of a synset of $p(w')$ in WordNet. In particular, if $h$ is not a hypernym of $w$ in WordNet, $P_H(w, k, h) = 0$. \par We then compute the semantic hierarchical similarity between the $k^{th}$ and the $l^{th}$ sense of word $w$ by \begin{equation} \label{simh} Sim_H(w,k,l) = \frac 1n|TopN(P_H,w,k,n) \cap TopN(P_H,w,l,n)| \end{equation} \par With the definition of domain similarity and semantic hierarchical similarity, we can compute the similarity between the $k^{th}$ and the $l^{th}$ sense of word $w$ by \begin{equation} \label{simall} Sim(w,k,l) = Sim_D(w,k,l) + Sim_H(w,k,l) \end{equation} \par When $Sim(w,k,l) > \lambda$, where $\lambda$ is a hyper-parameter ($\lambda = 1$ in our experiments), we consider the $k^{th}$ and the $l^{th}$ sense of word $w$ have the same meaning. In other words, we are able to detect pseudo multi-sense pair $(w_k, w_l)$ based on $Sim(w, k, l)$, which is called pseudo multi-sense detection. \subsection{Pseudo multi-sense elimination} \par Having the existing word embeddings, assume that we have a detected pseudo multi-sense group $G = \{w_{k_1}, w_{k_2}, ... , w_{k_n}\}$, in which $w_{k_1}, w_{k_2}, ... , w_{k_n}$ are senses of word $w$, taking the same meaning. Thus, we can find a representative vector for the group. Let $v_s(w,k_i)$ be the corresponding vectors of $w_{k_i}$, and $v_r(G)$ be the representative vector for the group $G$. Such vector $v_r(G)$ can be randomly chosen from $\{v_s(w,k_1), v_s(w,k_2), ..., v_s(w,k_n)\}$, or simply the mean vector of them. Other methods to compute $v_r(G)$ are also worth trying if reasonable. \par Inspired by \newcite{mikolov2013exploiting}, we assume there is a transition matrix, by which for all pseudo multi-sense group $G$, $\forall w_{k_i} \in G$, $v_{w_{k_i}}$ can be projected to $v_r(G)$. The experiments shown in Section 4 supported our assumption. In other words, we suggest that there exists a global matrix $\Phi$, for any given pseudo multi-sense group $G = \{w_{k_1}, w_{k_2}, ... , w_{k_n}\}$ and its representative vector $v_r(G)$, we have \begin{equation} v_r(G) = \Phi * v_s(w, k_i), \forall w_{k_i} \in G, \forall G \end{equation} \par Stochastic gradient descent (SGD) is a stochastic approximation of the gradient descent optimization method for minimizing an objective function written as a sum of differentiable functions by iteration. In order to obtain a consistent $\Phi$ for the projection of all pseudo multi-sense group, we can learn an approximate $\Phi$ with SGD for optimization. Then we use the obtained $\Phi$ to project existing word embeddings, and thus we can get a new vector space in which pseudo multi-sense has been eliminated compared to the original space. \section{Experiments} \par We evaluate our pseudo multi-sense detecting and eliminating method both qualitatively and quantitatively. We apply our method to the released word embeddings by \newcite{huang2012improving} and \newcite{neelakantan2015efficient}, which were both trained on the same Wikipedia corpus, and display the performance of our method based on the nearest neighbor task, word similarity tasks and the analogy task. In the following parts, MSSG and NP-MSSG are word embeddings released by \newcite{neelakantan2015efficient}; 50d and 300d are the dimensions of the vector space. The vector space released by \newcite{huang2012improving} are 50-dimensional. \subsection{Nearest Neighbors} \begin{table}[htbp] \centering \begin{tabular}{|l|l|l|} \multicolumn{3}{l}{STAR}\\ \hline \multirow{ 10}{*}{Huang et al.} & princess, series, cast, serial, midway, sparkle, 1940s, leo, closet, co-star & 01 \\ & silver, boy, cat, version, adventures, stars, emerald, destroyer, terrace, planet& 02\\ & energy, disk, wheel, disadvantage, block, puff, radius, diamond, chord & 03 \\ & version, bronze, standard, colors, ring, emblem, silver, wear, shoulder, red & 01 \\ &workshop, shop, paper, merchandise, plain, corporation, stock, likeness&03\\ &guard, baseball, starter, tennis, basketball, brazil, class, world, morocco, ncaa &01\\ &appearance, entertainer, pat, alumnus, freelance, brother, session, receiver&01\\ &fictional, ongoing, manga, super, japanese, silver, interactive, asian, fiction&01\\ &die, express, ride, opera, spanish, musical, hour, disaster, sun, blue&01\\ &galaxy, spiral, variable, guide, magnitude, companion, satellite, crater&02\\ \hline \multirow{3}{*}{MSSG-50d} & blue, dragon, acbl, diamond, purple, legion, arrow, mercury, eagle, cross & 01\\ & fan, legend, show, moesha, heroes, guest-star, flicka, lassie, tv-movie& 01\\ & stars, sun, constellation, galaxy, eridani, pegasi, supergiant, ceti, starburst&02\\ \hline \multicolumn{3}{l}{01: person.n.01 ~~~~~~~~~~~~02: celestial\_body.n.01~~~~~~~~~~~~ 03: whole.n.02} \\[0.2cm] \multicolumn{3}{l}{ROCK}\\ \hline \multirow{ 10}{*}{Huang et al.} & blur, indulgence, pop, noise, bands, lacuna, reformed, wave, genre, taster & 01 \\ & energy, silver, cat, song, cd, planet, dawn, hero, video, terrace & 02 \\ & metal, classic, legendary, dubbed, american, hard, belgian, short-lived, debut, da & 01 \\ & soft, shifting, disappear, fill, crystalline, false, pitch, expanse, heat, pile & 03 \\ & vinyl, concert, limited, box, summer, double, dance, enhanced, gold, inch & 04 \\ & hop, well-known, folk, occasional, jazz, music, concert, array, hard, pop & 01\\ & morris, miami, wood, ghost, silver, pearl, chase, corner, oak, thousand & 03 \\ & hard, pop, cm, jazz, hip, hop, r\&b, gutter, wave, subculture & 01\\ & hard, hip, short-lived, classic, jazz, raw, metal, ep & 01\\ & jazz, rally, star, roll, live, entertainer, appearance, session, pop, cover & 01\\ \hline \multirow{3}{*}{MSSG-50d} & metal, rippling, dense, swirling, chirping, blues, punk, psychedelia, bands, pop & 01\\ & sand, rocks, butte, ash, sandy, little, cedar, rocky, sugarloaf, spring-fed& 03\\ & hip, alternative, indie, progressive, hop, reggae, roll, rock/metal, post-hardcore& 01\\ \hline \multicolumn{3}{l}{01: popular\_music.n.01 ~~~~~~~ 02: person.n.01~~~~~~~~~~~~~~~~03: material.n.01 ~~~~~~~~~~~~~~~~~ 04: whole.n.02} \\[0.2cm] \multicolumn{3}{l}{NET}\\ \hline \multirow{ 10}{*}{Huang et al.} & reduction, amount, increases, stamina, zero, worksheet, improvements, sum & 01 \\ &raw, atomic, destination, brave, orbit, generalize, clock, ca, exhale, fresh & 02\\ &monthly, minimum, retail, banking, dividend, investor, tax, consumer, flat, dollar &03\\ &cash, annual, bribe, yen, generate, yen, liabilities, stocks, lifetime& 03\\ &limousine, panic, alarm, cotton, racket, rush, 9th, buffalo, corps, recovered&04\\ &palm, stalk, blanket, challah, qibla, putting, recess, curtain, tighten, lean&04\\ &indent, text, poser, instruction, libraries, mosaic, campaigns, graphics, imperative&04\\ &freight, processing, volume, needs, passenger, junction, electrical, ferry, shipping&04\\ &contribution, bonus, compensation, bribe, yen, liabilities, stocks, yen, profit&03\\ &1909, quarterback, columbus, bills, bath, elite, 1903, tigers, affiliated, eagles&04\\ \hline \multirow{3}{*}{MSSG-50d} &droplet, pile, wellbore, squeeze, amount, volume, steady, turn, moves, balance&04\\ &boards, run, ball, spot, sideline, at-bat, clock, stretch, running, phils&04\\ &revenue, trillion, assets, profit, billion, pre-tax, liabilities, index, us\$, fdi&03\\ \hline \multicolumn{3}{l}{01: whole.n.02 ~~~~~~~~~~~~~~~~~~~~~ 02: seize.v.01 ~~~~~~~~~~~~~~~~~ 03: income.n.01 ~~~~~~~~~~~~~~~~~ 04: artifact.n.01} \end{tabular} \caption{\label{nntable} Nearest neighbors (by cosine similarity) of sample words and the result of pseudo multi-sense detecting. Column 1 shows the existing word embeddings we use to detect pseudo multi-sense. In Column 2, each row shows the nearest neighbors of one sense in the vector space (Column 1). In Column 3, we present a meaning label for each sense, following the standard of WordNet synset description. We argue that ``senses'' with the same label actually have the same meaning, namely pseudo multi-sense.} \end{table} \par As we hypothesized, previous multi-sense word embedding methods would produce a lot of pseudo multi-sense examples. For the convenience of view, we only focus on the semantic relation in the qualitative evaluation part. We extracted the most probable hypernym for each sense of some sample words by Eq\eqref{simh}, using the synset semantic relations provided by WordNet \cite{miller1995wordnet}. If different representations of one word have the same hypernym, we consider them as pseudo multi-sense. \par In Table~\ref{nntable}, we show the nearest neighbors for each sense of each sample word with multiple word embeddings and our result of pseudo multi-sense detecting. For most of the representations, according to their nearest neighbors, we got reasonable hypernyms. However, there are also some unexpected cases from the result based on the word vectors released by \newcite{huang2012improving}, while no such cases are found in the vectors released by \newcite{neelakantan2015efficient}. For example, we got [whole.n.02] as the hypernym of the three sample words (which seems too general since {\sl whole} can be the hypernym of nearly all entities), and [person.n.01] as a hypernym of {\sl ROCK} (which seems not very reasonable according to the nearest neighbors). By intuition, we suggest that is because of the quality of the word embeddings. Possibly, the level of confidence to extract domains and hypernyms for each sense could be a metric for evaluating the quality of word embeddings. From this point of view, the word embeddings released by \newcite{neelakantan2015efficient} are also with higher quality. \subsection{Word Similarity} \par Now we focus on applying a qualitative evaluation to our method. For each word in the embedded vector space, we first determine the pseudo multi-sense with Eq\eqref{simall}. Then we try to minimize the distance between vectors which belong to the same pseudo multi-sense group, since we argue that they actually represent for the same meaning in the vector space, by training such a matrix $\Phi$, which projects all vectors to a new vector space and eliminate the distance between pseudo multi-sense vectors. We train the matrix $\Phi$ by minimizing the following formula. \begin{equation} \label{phi} L = \sum_{(x,x_r)} ||\Phi x- x_r||^2 \end{equation} where $x$ is a vector which belongs to a pseudo multi-sense group and $x_r$ is the representative vector of the corresponding group. In our experiments, we tried both random sampling and computing mean vector for getting such representative vector. \subsubsection{Similarity Metrics} The similarity here is a metric between words to evaluate the performance of word embeddings, which will be used to compare with human judgements, differently from the similarities we introduced in Section 3, which are used to detect pseudo multi-sense. \par \newcite{neelakantan2015efficient} introduced three metrics to compute the similarity between words in multi-sense word embeddings, which are $avgSim, avgSimC$ and $localSim$, defined by the following equations. \begin{equation} avgSim(w,w') = \frac1K \frac1{K'} \sum_{i=1}^K \sum_{j=1}^{K'} s(v_s(w,i), v_s(w',j)) \end{equation} where $K$ and $K'$ are the numbers of senses for $w$ and $w'$, $v_s(w,i)$ is the vector of the $i^{th}$ sense of word $w$, and $s(v_s(w,i), v_s(w',j))$ is the similarity measure between vectors $v_s(w,i)$ and $v_s(w',j)$. In our experiments, we apply cosine similarity as $s$. \par $AvgSimC$ and $localSim$ can be computed when we have the context of the words. \begin{equation} avgSimC(w,w') = \frac1K \frac1{K'} \sum_{i=1}^K \sum_{j=1}^{K'} P(w,c,i)P(w',c',j) s(v_s(w,i), v_s(w',j)) \end{equation} where $P(w,c,i)$ is the probability for word $w$ to take the $i^{th}$ sense with context vector $c$. \\ \begin{equation} localSim(w,w') = s(v_s(w,k), v_s(w',k')) \end{equation} where $k = \mathop{\argmax}_i P(w,c,i)$, $k' = \mathop{\argmax}_{i'} P(w',c',i')$. \subsubsection{WordSim-353} \par WordSim-353 is a standard dataset for evaluating the quality of word vectors introduced by \newcite{finkelstein2001placing}, which includes 353 pairs of nouns (without context). Each pair is presented with 13 to 16 human judgements on similarity and relatedness on a scale from 0 to 10. For example, pair (stock, market) gets the score of 8.08, while pair (stock, egg) only gains the score of 1.81. \par In this dataset, since the context of words is not given, we can only compute the $avgSim$ for each pair of word to evaluate our method. The result is shown in Table~\ref{ws353}. \subsubsection{SCWS} \par Stanford Contextual Word Similarity (SCWS) dataset proposed by \newcite{huang2012improving} is also a standard dataset to evaluate the performance of word embeddings quantitatively. It contains 2,003 pairs of words and the context they occur in. \par Then as \newcite{neelakantan2015efficient} did in their work, we also report the Spearman rank correlation between a model's output similarities and the human judgements. We also tried both random sampling and mean vector to get the representative vector for each pseudo multi-sense group. The result of our experiments are shown in Table~\ref{localsimtable}. \begin{center} \begin{tabular}{|c|ccc|} \hline \multirow{1}{*}{\textbf{Model}} &\multicolumn{3}{c|}{\textbf{avgSim}} \\ & original & random & mean\\ \hline Huang et al. 50d & 64.2& \textbf{65.1} & 65.0\\ MSSG 50d & 63.2& 65.0 & \textbf{65.1} \\ MSSG 300d & \textbf{70.9} & 70.8 & 70.5\\ NP-MSSG 50d & 62.4 & 64.0 & \textbf{64.4} \\ NP-MSSG 300d & 68.6 & \textbf{69.1} & 68.8\\ \hline \end{tabular} \captionof{table}{\label{ws353} Experimental result on WordSim-353 dataset (Spearman $\rho \times 100$). We apply both random choosing and mean vector to compute the representative vector for each group of pseudo multi-sense. Our method gains a slight improvement on all models except MSSG-300d. } \end{center} \begin{center} \begin{tabular}{|c|ccc|ccc|ccc|} \hline \multirow{1}{*}{\textbf{Model}} &\multicolumn{3}{c}{\textbf{localSim}} & \multicolumn{3}{|c|}{\textbf{avgSim}} & \multicolumn{3}{c|}{\textbf{avgSimC}} \\ & original & random & mean & original & random & mean & original & random & mean\\ \hline Huang et al. & 26.1 & \textbf{37.6} & 36.9 & 62.8& 61.4 & 62.9 &65.7 & 65.9 & 66.1\\ MSSG 50d & 49.2 & 52.4 & \textbf{53.2} & 64.2 & 64.9 & 64.8& 66.9 & 67.0 & 67.2\\ MSSG 300d & 57.3 & 62.1 & \textbf{62.2} & 67.2& 67.3 & 67.2 & 69.3 & 69.1 & 69.4\\ NPMSSG50d & 50.3 & \textbf{55.5} & 54.9 & 64.0 & 64.1 &64.5 & 66.1 & 66.3& 66.4\\ NPMSSG300d & 59.8 & \textbf{62.3} & 62.2 & 67.3 & 67.3 & 67.4 &69.1& 68.9& 69.2\\ \hline \end{tabular} \captionof{table}{\label{localsimtable} Experimental result on SCWS dataset (Spearman $\rho \times 100$). It shows that the elimination of pseudo multi-sense can significantly improves the performance of word embeddings with the metric {\sl localSim}, while the performances of projected vectors on the metric {\sl avgSim} and {\sl avgSimC} are about the same as those of original vectors. In other words, the elimination of pseudo multi-sense improves the ability of representing a real sense of each sense vector locally.} \end{center} \subsection{Analogy} \par Analogy task is another method to evaluate the performance of word embeddings. In single-sense word embeddings, if the word $A$ is similar to word $B$ in the same sense as word $C$ is similar to $D$, there should be an algebraic relationship $v(A)-v(B)=v(C)-v(D)$, where $v(A)$ is the vector of word $A$ in the word embeddings \cite{mikolov2013efficient}. Based on such relationship, we conduct the following experiment, which shows that our method is able to improve the quality of multi-sense word embeddings. \par In order to compare the quality of different versions of word vectors, our experiment runs on the Semantic-Syntactic Word Relationship dataset, which contains five types of semantic questions and nine types of syntactic questions, as shown in Table~\ref{examples}, including 19544 such quadruples totally. \par For each quadruple in the test dataset, we mark it as $w_1, w_2, w_3, w_4$. The relationship between $w_1$ and $w_2$ is similar to that between $w_3$ and $w_4$. In single-sense word embeddings, we just need to check whether $v(w_4)$ is the most similar vector to $v(w_1)-v(w_2)+v(w_3)$ among all the vectors, and apply the same procedure for $w_1, w_2, w_3$. For multi-sense word embeddings, we check whether there is a combination of senses $\{k_1, k_2, k_3, k_4\}$ so that $v_s(w_4,k_4)$ is the most similar vector to $v_s(w_1, k_1)-v(w_2, k_2)+v(w_3, k_3)$, where $v_s(w,k)$ is the vector of word $w$'s $k^{th}$ sense. What's more, since the equivalence of the two pairs, we also check by such procedure for $v_s(w_1,k_1), v_s(w_2,k_2), v_s(w_3,k_3)$. For every quadruple, once one of the requirements above is satisfied, we treat it as correct. We report the accuracy for each multi-sense vector space in Table~\ref{analogy}. \begin{center} \begin{tabular}{|c||c|c|c|c|} \hline Type of relationship & \multicolumn{2}{c|}{Word Pair 1} & \multicolumn{2}{c|}{Word Pair 2} \\ \hline Common capital city & Athens & Greece & Oslo& Norway\\ All capital cities & Astana&Kazakhstan&Harare&Zimbabwe \\ Currency & Angola&kwanza&Iran&rial \\ City-in-state & Chicago&Illinois&Stockton&California \\ Man-Woman & brother&sister&grandson&granddaughter \\ \hline Adjective to adverb & apparent&apparently&rapid&rapidly \\ Opposite& possibly&impossibly&ethical&unethical \\ Comparative &great&greater&tough&tougher \\ Superlative & easy&easiest&lucky&luckiest \\ Present Participle & think&thinking&read&reading \\ Nationality adjective & Switzerland&Swiss&Cambodia&Cambodian \\ Past tense & walking&walked&swimming&swam \\ Plural nouns & mouse&mice&dollar&dollars \\ Plural verbs & work&works&speak&speaks \\ \hline \end{tabular} \captionof{table}{\label{examples} Sample quadruple instances in analogy testing dataset. The relations are divided into 5 semantic types and 9 syntactic types.} \end{center} \begin{center} \begin{tabular}{|c|ccc|ccc|} \hline \multirow{1}{*}{\textbf{Model}} &\multicolumn{3}{c}{\textbf{Semantic}} & \multicolumn{3}{|c|}{\textbf{Syntactic}} \\ & original & random & mean & original & random & mean \\ \hline Huang et al. & 52.8 & \textbf{53.5} & 53.4 & 53.5 & \textbf{56.1} & 55.9\\ MSSG 50d & 75.8 & \textbf{77.5} & 77.4 & 85.2 & 87.9 & \textbf{88.0}\\ MSSG 300d & 92.0 & 92.8 & \textbf{93.1} & 93.3& 94.1& \textbf{94.5}\\ NPMSSG 50d & 74.6 & 75.4 & \textbf{75.6} & 80.7 & 82.1 & \textbf{82.3}\\ NPMSSG 300d & 83.9 & 85.7 & \textbf{85.9} & 89.0 & \textbf{90.2} & 90.1\\ \hline \end{tabular} \captionof{table}{\label{analogy} Test result for analogy task. We also apply both random choosing and mean vector to get the representative vector for each pseudo multi-sense group. It shows that our improved vectors perform better on this task.} \end{center} Overall, our detection and elimination of pseudo multi-sense on word embeddings reach higher performance on the nearest neighbor, word similarity and analogy task. \section{Conclusion and future work} \par In this paper, we introduced the concept of {\sl pseudo multi-sense}, which is the word embedding models often embed one meaning to multiple senses, to describe the common problem in multi-sense word embeddings. Then we proposed a method based on both domains and semantic relations to detect such cases. What's more, we trained a global transition matrix based on the detected pseudo multi-sense from the given word embeddings, which is used to eliminate the distance between senses actually have the same meaning. The evaluation of our pseudo multi-sense eliminated vector showed that detecting and eliminating pseudo multi-sense significantly improved the ability for each vector in the word embeddings to represent for an exact meaning. We suggest that the following research directions could be considered \begin{itemize} \item For the detection of pseudo multi-sense, taking syntactic information and other information we have or we can extract from corpus into account is a reasonable idea to improve the performance. \item Involve the pseudo multi-sense detection and elimination into the neural network structure, so that the learnt word embeddings could have higher quality than those learnt by existing methods without consideration of pseudo multi-sense. \item Though we have gained an improvement on experiments, we don't have a deep understanding about the reason that why elimination of pseudo multi-sense works well and why pseudo multi-sense cases are ubiquitous in all kinds of word embeddings. In future work, we could focus on finding a reasonable explanation of the fact. \end{itemize} \newpage
{'timestamp': '2017-01-09T02:03:57', 'yymm': '1701', 'arxiv_id': '1701.01574', 'language': 'en', 'url': 'https://arxiv.org/abs/1701.01574'}
arxiv
\section{Introduction} Today, billions of smart wireless devices, including the Internet of Things~(IoT), surround us in our daily live. Increasingly, the wireless environment is used beyond mere communication to provide context-aware services: Wireless devices are integrated into the environment and applications such as asset tracking, indoor localization, contact tracing, and access control bring physical aspects into the digital world. Here, devices must be aware of their environment and distance to others. Not surprisingly and in line with the ongoing technological convergence, the smartphone is a central aspect of many context-aware applications. Using the smartphone as a generic platform eliminates the need of dedicated hardware devices while further enhancing convenience. For Phone as a Key~(PaaK)~\cite{ieeespectrum.2019, Ho.2016}, the smartphone acts as a personal token for access control systems of, e.\@\,g.\@\xspace, vehicles and buildings. As a prominent example, during the Covid-19 pandemic, smartphone-enabled contact tracing applications have emerged worldwide to track infection chains based on the proximity of individuals~\cite{baumgartner_mindthegap_2020}. Such applications naturally have to make use of the wireless communication systems implemented in smartphones. Being available in virtually every smartphone, Bluetooth has become the technology of choice for the required ad hoc short-range networks. Within this trend, vendors now increasingly also utilize Bluetooth for security-critical proximity verification applications, e.\@\,g.\@\xspace, access control. However, Bluetooth was originally designed for wireless communication rather than for secure proximity verification. Thus, one may suspect a vulnerability against \textit{relay attacks}. In the classical relay attack, an attacker makes distant victim parties being able to communicate by establishing an artificial communication channel. The distant parties thus may falsely assume to be in each other’s proximity. In the past, this has been exploited to circumvent earlier-generation automotive Passive Keyless Entry~(PKE) systems~\cite{Francillon.2010}. Thus, attackers are able to gain access to vehicles and media frequently reports car thefts due to relay attacks~\cite{Bilton.2015, Greenberg.2016}. In contrast, relay attacks on Bluetooth-based proximity verification have received only very little attention as of yet. While the attack has been identified as a threat for smart locks~\cite{Ho.2016}, realizations are still limited to unidirectional forwarding of contact tracing advertisement packets~\cite{baumgartner_mindthegap_2020}. Other than this, full-blown bidirectional range-extending relay attacks have not been reported. Since Bluetooth uses a very different wireless physical-layer architecture than traditional automotive PKE systems, previous attack strategies~\cite{Francillon.2010} cannot directly be applied. Consequently, the lacking attack realization currently hampers risk assessment of Bluetooth w.r.t. practical relay attacks and leaves the exploration of threat potential as an open research problem. To close this gap, in this work we identify technical peculiarities of relay attacks on Bluetooth and outline why previous attack strategies are not applicable. Based on our analysis, we utilize commodity Radio Frequency~(RF) components to design and implement an analog attacker setup to achieve bidirectional physical-layer relaying of time-division duplex~(TDD) wireless communication such as Bluetooth. Our cable-based proof-of-concept allows hands-on testing of products and enables real-world relay attacks in certain scenarios. We use our setup to test recent Bluetooth-based PKE systems of a car and a smart lock, both of which utilize smartphone-based key replacements. Our attack allowed us to unlock the door and start the engine (in case of the car) while the legitimate smartphone was at a distance of more than \SI{65}{\m}. Our results confirm that Bluetooth alone is vulnerable against simple range-extending relay attacks. As per its latest v5.3~specification~\cite{BluetoothSIG.January2019}, the only way to infer the distance between two Bluetooth devices is based on signal strength which is known to be notoriously inaccurate~\cite{giovanelliRSSITimeofflightBluetooth2018}. Therefore, vendors increasingly implement Multi-Carrier Phased-Based Ranging~(MCPR) aside of Bluetooth~\cite{AbidinSecureAccuratePractical_2021, Stitt.2020, Dialog.ranging, imec.undated, Zand.2019, denso.2020, alpsalpine.2021}, recently even within integrated circuits geared towards MCPR~\cite{Bechthum.2020, imec.rangingIC, synaptics.comboIC}. Since MCPR in the past has been marketed as High Accuracy Distance Measurement (HADM)~\cite{BluetoothSIG_HADM_MCPR.2021, everything_imec_HADM_MCPR.2018, denso.2020}, it is also interesting to note that the Bluetooth~SIG lists a specification under development bearing this very name~\cite{BluetoothSIG_HADM.2021}. In view of these developments, we additionally study the security of MCPR against our attacker setup. Our results show that MCPR is a viable detection method for simple range-extension attacks. However, with only little modification to our setup, we demonstrate a novel distance manipulation attack against MCPR. Thus, for the first time, we achieve both range-extension (bridging a physical distance of~\SI{90}{\m}) and distance manipulation \textit{at the same time}. Our results confirm previous findings of Ólafsdóttir~et~al.\@\xspace~\cite{Olafsdottir.2017}, who first described vulnerabilities of MCPR against signal manipulation attacks. Further, we give guidelines to enhance attack difficulty, e.\@\,g.\@\xspace, by leveraging frequency hopping or analyzing channel reciprocity. In summary, this paper makes the following contributions: \begin{compactitem} \item We design a practical physical-layer relay attack for standard \SI{2.4}{GHz} TDD communication systems such as Bluetooth. We use a novel attack strategy which adapts to the transmit-receive timing of the legitimate parties. We present a prototypical cable-based implementation built from commodity RF components. \item We analyze the Bluetooth-based access control implementations of a car and a smart lock and demonstrate successful relay attacks against both systems. To the best of our knowledge, this is the first work to fully implement a relay attack to demonstrate the insecurity of Bluetooth-based access control. \item We investigate MCPR as a countermeasure against our attack and demonstrate a novel phase manipulation attack to simultaneously perform range extension and distance manipulation. \end{compactitem} \Paragraph{Responsible Disclosure} We provided this paper to the Bluetooth SIG and the affected manufacturers. \section{Related Work and Background} In this section, we outline related works and provide background information on RF proximity verification, relay attacks, and Bluetooth communications. \subsection{Related Work} \label{sec:related} The literature describes various relay attacks against different RF proximity verification systems. Francillon~et~al.\@\xspace~\cite{Francillon.2010} have demonstrated signal amplification attacks to increase the range of immobilizing signals of classical automotive PKE systems. Their study revealed vulnerabilities on all tested models. Payment systems are subject to relay attacks as well and have been demonstrated for ISO~14443~\cite{Hancke.2005b} and NFC~\cite{Francis.2011, Roland.2012}. Relay attacks against Bluetooth communications have received little attention as of yet, although Levi~et~al.\@\xspace~\cite{Levi.2004} discussed the possibility of such attacks already in 2004. In a security analysis of Bluetooth-based smart locks, Ho~et~al.\@\xspace~\cite{Ho.2016} identified the attack as a threat, albeit not addressing technical realization. Baumgärtner~et~al.\@\xspace~\cite{baumgartner_mindthegap_2020} demonstrated Software-Defined Radio~(SDR)-based unidirectional forwarding of advertisement packets to study the security of contact tracing applications. Protocol-level impersonation attacks as described by Antonioli~et~al.\@\xspace~\cite{Antonioli.2020} and Jasek~\cite{SawomirJasek.} are conceptually different from a relay attack but likewise allow attackers to forward Bluetooth traffic between victim parties. To defeat relay attacks, numerous works study wireless distance measurements~\cite{Bensky.2016} and their security guarantees. Ranganathan and \v{C}apkun~\cite{Ranganathan.2017} survey techniques for secure ranging and conclude with Ultra Wideband Impulse Radio~(\mbox{UWB-IR}) as the most promising candidate. The fine time resolution of wideband waveforms promotes UWB systems to be used for Time-of-Flight~(ToF)-based ranging within distance-bounding protocols. While ToF itself cannot be reduced by an attacker, the measurement procedure can still be vulnerable: Clulow~et~al.\@\xspace~\cite{Clulow.2006} have introduced the Early-Detect, Late-Commit~(ED/LC) attack that has later been applied to UWB-based ranging~\cite{Flury.2010}. Singh~et~al.\@\xspace~\cite{Singh.2019a} and Leu~et~al.\@\xspace~\cite{Leu.2019} recently introduced novel physical-layer security primitives to diminish the attacker's success while preserving the ability of long-range communication. Another work of Singh~et~al.\@\xspace~\cite{Singh.2019b} aims to detect UWB distance-enlargement attacks. Apart from UWB, previous work also investigates the security of other RF proximity verification techniques. Ólafsdóttir~et~al.\@\xspace~\cite{Olafsdottir.2017} presented the first security analysis of MCPR and demonstrated a delay-based distance reduction attack. In order to counteract these attacks, Abidin~et~al.\@\xspace~\cite{AbidinSecureAccuratePractical_2021} recently combined MCPR with a coarse ToF measurement. Notably, they report a promising implementation on a standard Bluetooth transceiver. Ranganathan~et~al.\@\xspace~\cite{Ranganathan.2012} have shown ED/LC attacks on chirp-based ToF measurements. Other than distance measurement, proposals for relay attack detection are RF fingerprinting~\cite{Joo.2020}, channel reciprocity~\cite{Jain.2012b, Krentz.2014}, protocol timing~\cite{Reid.2007}, and sensor fusion~\cite{Truong.2014, shrestha2014drone}. In 1993, Brands and Chaum~\cite{Brands.1993} introduced distance bounding protocols to cryptographically verify an upper bound on the distance of a prover. Finally, the literature reports additional vulnerabilities in access control systems. Eisenbarth~et~al.\@\xspace~\cite{Eisenbarth.2008} demonstrated a side-channel based extraction of group keys from the KeeLoq system. Wouters~et~al.\@\xspace point out security weaknesses in the implementations of access control systems of luxury cars~\cite{Wouters.2019, Wouters.2021}. \Paragraph{Differentiation from previous work} As outlined previously, the general idea for relay and distance manipulation attacks is not original to this paper. The vulnerability of access control against range-extending relay attacks was first demonstrated by Francillon~et~al.\@\xspace~\cite{Francillon.2010} for earlier PKE systems. However, their unidirectional signal amplification strategy is insufficient for range extension of TDD wireless communication such as Bluetooth, requiring bidirectional amplification. In our work, we realize such a bidirectional amplification approach using power detection to toggle signal directions. Ólafsdóttir~et~al.\@\xspace~\cite{Olafsdottir.2017} presented the first security analysis of MCPR, revealing vulnerabilities against signal manipulation. The authors first proposed the general idea of manipulating the phase of individual MCPR tones, although not presenting a practical attack realization. The authors gave a brief technical proposal based on mixing with locally generated RF signals. We believe that this approach is of low practicality as an attacker needs to generate a coherent RF carrier before phase manipulation can be applied. Ólafsdóttir~et~al.\@\xspace also acknowledge this challenge in their paper as they sketch a countermeasure based on randomized phase shifts which later was adopted by Abidin~et~al.\@\xspace~\cite{AbidinSecureAccuratePractical_2021}. In our work, we build on the idea of manipulating individual MCPR tones~\cite{Olafsdottir.2017}, albeit using an entirely different signal manipulation mechanism. We leverage a simple phase shifter circuit and thereby eliminate the unrealistic attacker requirement of a coherent RF carrier. Moreover, we contribute the method to properly schedule phase shifts. Not only does this facilitate a real-world implementation (as our results show), it also bypasses the previously suggested countermeasure. To the best of our knowledge, this is the first work to unify range extension~\cite{Francillon.2010, Hancke.2005b, Francis.2011, Roland.2012} and distance manipulation~\cite{Olafsdottir.2017, Ranganathan.2012, Flury.2010} -- previously addressed separately -- within a real-world implementation. \subsection{Background} \label{sec:background} \Paragraph{Relay Attacks} In a classic relay attack, an adversary establishes a communication channel between distant parties that otherwise would not be able to communicate. Wireless radio systems are particularly prone to such attacks as radio wave propagation relies on a shared medium that the attacker can access, i.\@\,e.\@\xspace, to capture/eavesdrop legitimate signals. To forward legitimate signals, attackers employ \textit{amplify-and-forward} or \textit{decode-and-forward} relaying schemes~\cite{Goldsmith.2005}. The latter involves recovery of bits or symbols from analog waveforms which is attractive for long-range transfers. In contrast, amplify-and-forward omits demodulation and forwards the analog waveform with minimal processing efforts, e.\@\,g.\@\xspace, amplification only, resulting in low delays and moderate design complexity at the cost of link budget constraints. With the advent of distance measurement techniques, the scope of relay attacks became broader: The attacker is required to alternatively or additionally perform some sort of signal manipulation to overcome the implemented proximity verification. In turn, a location-based wireless service may falsely allow access to restricted applications, potentially causing economical damage to individuals and businesses. Examples for threatened services are wireless payment systems, contact tracing, electronic door locks, and PKE systems for cars. \Paragraph{RF Proximity Verification} Wireless communication systems can be used for localization and ranging~\cite{Bensky.2016, Boukerche.2007, Zand.2019}. Leveraging physical-layer observations such as ToF, Received Signal Strength~(RSS), or carrier phase, devices infer distances to others. Distance measurements from ToF are based on the signal propagation delay being a function of the speed of light and distance. Accurate measurement of the ToF requires nanosecond time resolution as provided, e.\@\,g.\@\xspace, by UWB-IR~\cite{Yassin.2016}. RSS-based ranging leverages the propagation path loss of radio waves as a function of the distance~\cite{giovanelliRSSITimeofflightBluetooth2018}. RSS indication is available for almost every wireless receiver but suffers from inaccuracies due to multipath propagation. Carrier phase-based ranging, i.\@\,e.\@\xspace, MCPR, uses unmodulated RF carrier signals to observe phase shifts that are proportional to the ToF~\cite{Bensky.2016}. The measurement procedure can conveniently be implemented with narrowband frequency hopping systems such as Bluetooth Low Energy~(BLE)~\cite{Zand.2019} and is capable of accuracies below \SI{30}{cm}~\cite{Bechthum.2020}. \Paragraph{Bluetooth} Bluetooth is designed for short-range wireless communication. The specification~\cite{BluetoothSIG.January2019} defines two wireless stacks, namely BLE and Bluetooth BR/EDR. In the following, we use the terms BLE and Bluetooth to refer to BLE devices. Still, our results also apply to BR/EDR in principle. BLE operates on a total of $40$~sub channels with~\SI{2}{\MHz} spacing within the~\SI{2.4}{\GHz}~ISM band and uses TDD to realize bidirectional communication. On the physical layer, transmissions use Gaussian Frequency Shift Keying (GFSK) with data rates of either \SI{1}{Mbps} or \SI{2}{Mbps}. Furthermore, BLE employs an adaptive frequency hopping scheme over $37$ channels with a hopping rate of up to approx.~\SI{133}{\Hz}. Device discovery in BLE is realized through periodic advertisement packets. In a subsequent \textit{pairing} phase, parties can establish an authenticated and encrypted channel, i.\@\,e.\@\xspace, cryptographic keys are exchanged. The secure channel is persistent as both nodes store long term keys, which is referred to as \textit{bonding} of two devices in BLE. Bluetooth does not specify a dedicated measurement procedure to find the distance between two devices. Instead, RSS values can to be used to coarsely estimate distances. When multiple devices are available, an alternative approach is triangulation based on Angle-of-Arrival~(AoA) or Angle-of-Departure~(AoD) which was added to the Bluetooth specification v5.1. Both features leverage the Constant Tone Extension~(CTE) which was already used to implement MCPR~\cite{Zand.2019}. \section{Relay Implementation} \label{sec:relaying_bluetooth} Next, we introduce the system and attacker model and outline challenges associated with relay attacks on Bluetooth. Finally, we outline our proof-of-concept analog physical-layer relay attack. \subsection{System and Adversary Model} We consider an external relay attacker operating on the wireless physical layer with the goal of circumventing Bluetooth-based RF proximity verification between a pair of distant communication parties~$\mathsf{A}$ and~$\mathsf{B}$. Considering an access control application, $\mathsf{B}$ is a mobile device, e.\@\,g.\@\xspace, a smartphone, whereas~$\mathsf{A}$ is mostly stationary, e.\@\,g.\@\xspace, a smart lock or a car. We assume that~$\mathsf{A}$ and~$\mathsf{B}$ are honest and have created a bond before, i.\@\,e.\@\xspace, the attacker is not able to break the applied cryptography, that is to read or make valid manipulations of secured payload data. The nodes employ standard-compliant BLE communication and $\mathsf{A}$ needs to infer proximity to $\mathsf{B}$ from the ability to communicate and reasonable RSS levels. The attacker is capable of transmitting and receiving RF signals to and from both parties. Also, the attacker can choose a strategic position close to~$\mathsf{A}$. \subsection{Previous Attack Strategies} \label{sec:analog_design_consideration} While relay attacks are well known, practical attack strategies for range extension of automotive PKE have only been reported for earlier generation systems~\cite{Francillon.2010}. This attack is, however, not directly applicable to BLE as we will explain next. Previous automotive PKE systems use a dedicated wireless protocol between the car and the key fob. The car transmits Low Frequency~(LF) signals at around \SI{100}{\kHz} to the key fob which responds on an Ultra-High Frequency~(UHF) channel at \SI{315} or \SI{433}{\MHz}. The LF signals only have short range and therefore \textit{immobilize} the system. In contrast, the UHF signals from the key have a wide range. The attack outlined by Francillon~et~al.\@\xspace~\cite{Francillon.2010} exploits this observation, extending the LF signal range to reach the distant key. Importantly, this simplifies the attack to a unidirectional amplification of the LF signals while the response from the key fob reaches the car directly. This is possible as each communication direction allocates a distinct frequency resource. Thus, an attacker can separately manipulate each direction. However, the situation is different with BLE-based communication. Here, the legitimate parties share the same frequency resource over time using TDD to establish bidirectional communication, having the same range in both directions. Thus, in order to extend the victim's effective communication range, a relay attacker faces the challenge of extending \textit{both} directions. Now, one may suggest to use a pair of BLE receivers and transmitters at both ends to accomplish this task by forwarding only the application payload data, i.\@\,e.\@\xspace, decode-and-forward relaying. Unfortunately, this cannot be done since resource allocation of the legitimate parties, e.\@\,g.\@\xspace, the transmit-receive timing and frequency hopping sequence\footnote{The BLE frequency hopping is randomized and synchronization is cumbersome due to the prediction of PRNG values~\cite{Cauquil.2019}.}, is unknown to the attacker who is completely external and cannot impersonate the legitimate parties. Further, decode-and-forward relaying neglects physical-layer information and is easily detected by, e.\@\,g.\@\xspace, MCPR or channel reciprocity (see Section~\ref{sec:attack_evaluation}). Alternatively, following the style of attack of~\cite{Francillon.2010} for both directions, the attacker could try to amplify and forward the entire Bluetooth spectrum at both legitimate parties towards the other. However, this approach requires careful design consideration since both communication directions use the same frequency range. That is, an attacker naively following this approach could end up building a large feedback loop that amplifies itself, eventually leading to instability and self-destruction. \subsection{Relay Implementation} \label{sec:relay_implementation} \begin{figure} \centering \includegraphics[width=\linewidth]{figures/relay_block_diag_without_manipulation.pdf}% \caption{This block diagram illustrates the hardware setup for the analog relay attack, comprising of the two distant primary and secondary stations.} \label{fig:relay_block_only_PD} \end{figure} The attacker's goal is to ($i$)~establish a bidirectional communication channel while ($ii$)~applying amplification in both directions for range-extension and to circumvent RSS-based proximity verification. However, as outlined before, the relay attacker cannot simply amplify the legitimate BLE signals in both directions independently. To resolve this issue, we propose a novel relaying strategy which adapts to the legitimate node's transmit-receive behavior. An implementation block diagram is shown in Figure~\ref{fig:relay_block_only_PD}. The attacker positions their antenna close to~$\mathsf{A}$ and uses an analog RF power detector to sense when~$\mathsf{A}$ transmits. Upon detection of a transmission of~$\mathsf{A}$, an RF switch is used to select the upper signal path, applying amplification and forwarding signals to~$\mathsf{B}$. In the other case that no transmission is detected, the lower signal path is selected, applying amplification in the other direction to forward signals from~$\mathsf{B}$ to~$\mathsf{A}$. This strategy allows the attacker to synchronize to the node's TDD, preventing simultaneous amplification in both directions to eliminate the aforementioned feedback loop. The output of the power detector is a voltage that is proportional to its RF input power. Using a comparator, we implement a threshold-based binary power detection to sense transmissions of~$\mathsf{A}$. The comparator output logic signal controls an RF switch to change signal directions. Allowing the attacker to bridge relatively large distances between the two relay end-points, we apply this technique at both the primary and secondary relay stations, cf.~Figure~\ref{fig:relay_block_only_PD}. At the primary side, close to~$\mathsf{A}$, the power detection takes place after the antenna but before the RF switch. Therefore, signals of~$\mathsf{A}$ will reach the power detector regardless of the switch position. At the secondary side, power detection is again used to detect forwarded transmissions of~$\mathsf{A}$. Due to the attacker's close position to~$\mathsf{A}$, the signals of~$\mathsf{A}$ reach the primary power detector rather strongly. In contrast, after over-the-air and cable losses, the signals of~$\mathsf{B}$ arrive weaker and therefore will not trigger the switching mechanism. Thus, the power-detection threshold should be selected below the expected high signal power from~$\mathsf{A}$ and above the low signal power from~$\mathsf{B}$. Combining standard and ready-to-use RF components, we implemented a prototypical cable-based attacker setup that is depicted in Figure~\ref{fig:analog_relay}. We give an outline of implementation details and example traces of power detector output signals in Appendix~\ref{sec:appendix}. Further, the exact parts are listed in Table~\ref{tab:relay_part_list} likewise in the appendix. While we have not optimized the design for low cost, we estimate the total cost for the parts to be about~\EUR{2200}. However, omitting the evaluation boards, the individual components and ICs can be purchased for under~\EUR{1200}. Note that our attacker implementation is based on a mixed-signal design with the relay channel being completely analog. As no sampling is involved, the attacker operates with minimum latency which is desired for attacks on proximity verification. On the other hand, targeted and intelligent signal manipulation becomes increasingly difficult for the attacker. However, such attacks are still possible as we show in Section~\ref{sec:relay_phase_manipulation}. Another aspect related to the relay's analog nature is immunity to interference. That is, \textit{all} signals picked up at the respective receiving station are simultaneously forwarded to the other (transmitting) station, including signals from the legitimate and other parties. Thus, multiple wireless devices in reach of the relay stations won't diminish the attacker's success. Still, interference from other devices may affect the legitimate receiver, as is always the case in multi-user wireless settings. However, on the primary relay side, strong interfering signals could falsely trigger the power detector. Therefore, the attacker should ensure that the victim signals are the strongest received signals. In our experiments, we did not encounter performance degradation due to interference, even though operating in busy wireless environments. For instance, close-by \mbox{Wi-Fi} routers did not trigger the relay's power detection (cf.~Fig.~\ref{fig:advertising_interference} in the appendix). \begin{figure} \centering \hspace*{\fill}% \subfloat[]{{% \includegraphics[width=0.48\columnwidth]{figures/primary_station_ann.jpg} }} \hfill \subfloat[]{{% \includegraphics[width=0.48\columnwidth]{figures/secondary_station_ann.jpg}}} \hspace*{\fill}% \caption{Our experimental relay setup consists of the (a) primary and (b) secondary relay stations. At the primary station, a phase shifter and a step attenuator used in Section~\ref{sec:attack_evaluation} can be seen.} \label{fig:analog_relay} \end{figure} \section{Attacks on Bluetooth-Based Access Control} \label{sec:attacks} In this section, we test our attacker setup in two case studies on Bluetooth-based access control systems that both implement smartphone-based PKE. In particular, we analyzed the behavior of a car and an electronic door lock for buildings. Both products allow the smartphone to be used as a personal entry token, not requiring any user interaction for unlocking doors or starting the engine. \subsection{Case Study 1: Car} \label{sec:car} For our first case study, we tested the Bluetooth-based PKE system of a car. The car accepts multiple smartphones to be used as an access token, allowing to unlock the doors and start the engine. The car uses Bluetooth to monitor the presence of an authorized smartphone. The user only needs to possess the phone and is not required to actively participate in the unlocking procedure. Initially, we tested the system in a non-adversarial setting. With the authorized smartphone, we approached the locked car towards the passenger side until it unlocked. Then, we moved away from the car until it locked again. The observed distances are given in Table~\ref{tab:car_lock_unlock} and it is evident that different conditions apply for locking and unlocking. Since BLE is used, proximity verification is likely accomplished through analysis of RSS\footnote{AoA and AoD methods can also be utilized to find distances, however, requiring multiple locator devices to perform triangulation.}. Thus, we suspect that the car applies different RSS thresholds for unlocking and locking. The RSS hypothesis is further backed by the distances in Table~\ref{tab:car_lock_unlock} varying significantly with the phone location: The distances are largest when the phone is carried in the hand (strong line-of-sight channel) and lowest when the phone is carried in a trouser pocket on the back of the body (weak non-line-of-sight channel due to human body shadowing). Further, we observed that unlocking the car does not imply the ability to start the engine. In line-of-sight conditions, we were able to start the engine with the smartphone at a distance of \SI{2}{\m} from the car, hinting a third RSS threshold. \begin{figure}[t] \centering \hspace*{\fill}% \subfloat[]{{% \includegraphics[width=0.49\columnwidth]{figures/car_close_comp.JPG}}} \hfill \subfloat[]{{% \includegraphics[width=0.49\columnwidth]{figures/car_far_edit.JPG} }} \hspace*{\fill}% \caption{Attack setup, relaying Bluetooth signals between the primary (a) and secondary (b) relay stations to establish communication between a car and a distant smartphone.} \label{fig:car} \end{figure} \begin{table} \footnotesize \caption{Observed non-adversarial car unlocking and locking distances.} \label{tab:car_lock_unlock} \centering \begin{tabular}{@{}rcc@{}} \toprule \textbf{Phone Location} & \textbf{Unlock} & \textbf{Lock}\\ \midrule Hand & \SI{5}{m} & \SI{13}{m}\\ Trouser pocket & \SI{3}{m} & \SI{11}{m}\\ Trouser pocket (back) & \SI{1}{m} & \SI{6}{m}\\ Jacket pocket & \SI{4}{m} & \SI{12}{m}\\ \bottomrule \end{tabular} \end{table} Next, we tested the effectiveness of our attacker setup outlined in Section~\ref{sec:relay_implementation}. We placed the primary relay station close (\SIrange{10}{30}{\cm}) to the B-pillar of the car. We placed the secondary relay station at a distance of approx.~\SI{65}{\m} to the car. Both relay stations were equipped with a directional antenna as can be seen from Figure~\ref{fig:car}, showing the experimental attack setup. Approaching the secondary relay station antenna with the authorized smartphone in the hand, the car unlocked at a distance of \SI{4}{\m} to the relay antenna. Being at a distance of \SI{2}{\m} to the relay antenna, it was possible to start the engine. Also, we observed the previously outlined behavior for unlocking which took place when the smartphone was at a distance of \SI{13}{\m} to the relay antenna. Our attack clearly succeeds to substantially extend the Bluetooth communication range between the car and the smartphone. We were able to unlock and start the car with the authorized smartphone being at a distance of \SI{69}{\m} and \SI{67}{\m}, respectively. Consequently, we circumvented the Bluetooth-based RF proximity verification, highlighting yet another attack vector to compromise keyless entry systems. During our experiments, we have not perceived any indication of additional countermeasures. Several approaches may be feasible, including GPS position comparison using the car's cellular network connection or plausibility checks of RSS values across the various Bluetooth antennas of the Model~3. However, as researchers have already stressed for a long time, using RSS for proximity verification is generally considered insecure. \subsection{Case Study 2: Smart lock} \begin{figure} \centering \includegraphics[width=0.48\linewidth]{figures/lock_paper.jpg} \caption{Smart lock key turning module.} \label{fig:smartlock} \end{figure} For our second case study, we tested a smart lock which is a Bluetooth-enabled keyless entry system that can be retrofitted to traditional key-based doors. A battery-powered and motorized key turning module, see Figure~\ref{fig:smartlock}, is attached to a door from the inside. The device is controlled using a smartphone app and also supports an optional PKE mode which automatically unlocks the door upon proximity of an authorized smartphone. Similarly to the previous experiments with the car, this time we placed the primary relay station close to the smart lock. % Then, with our setup we again bridged a distance of approx.~\SI{65}{\m} between an authorized smartphone and the smart lock. Now, with the smartphone as close as~\SI{2}{\m} to the secondary relay station, the smart lock unlocked the door. Again, our attacker setup successfully circumvents the Bluetooth-based RF proximity verification. Compared to the car entry systems considered previously, a smart lock has the distinct advantage of being deployed in a fixed location. This allows the smartphone to perform a number of plausibility checks before sending an unlock command to the lock. During our relay attack attempts, we noticed that the lock's smartphone app leverages multiple such checks. To analyze the behavior in detail, we took advantage of plain-text log files provided by the app, originally intended for diagnostic purposes. Notably, the log files in some cases even provide commentary insight to the application logic. From our analysis, we identified several measures and conditions when the lock is configured to automatically unlock: (1) Low Bluetooth transmission power is used and the application obtains RSS values. (2) The user must first exit and then re-enter a pre-defined geofence area before unlock. Distance to the lock is validated using GPS data and the known fixed device location. (3) The android app leverages Google Play services~\cite{google_play_services.2021} to monitor device activity such as walking. (4) Plausibility checks are applied, i.\@\,e.\@\xspace, when location changes occur too fast or despite no movement being detected. Clearly, the outlined plausibility checks increase the hurdles for a successful attack. However, as GPS positions are considered insecure and may be spoofed, we conclude that attacks are still possible. \section{Attacks On Phase-based Ranging} \label{sec:attack_evaluation} As demonstrated, attackers can circumvent Bluetooth-based proximity detection using analog relay attacks. To counter attack attempts, RF-based physical distance measurement techniques can be employed. RSS-based distance estimates as per the current Bluetooth specification~\cite{BluetoothSIG.January2019} are inaccurate and prone to manipulations, e.\@\,g.\@\xspace, by signal amplification like demonstrated in Section~\ref{sec:attacks}. Therefore, Bluetooth recently is increasingly being complemented by MCPR~\cite{AbidinSecureAccuratePractical_2021, Stitt.2020, Dialog.ranging, imec.undated, Zand.2019, denso.2020, alpsalpine.2021}, enabling distance measurements with high accuracy. In this section, we outline how our analog relay attack can be used to simultaneously increase the communication range while arbitrarily manipulating distances measured using MCPR. \subsection{Background on MCPR} MCPR is based on single carrier phase measurements, thus enabling accurate distance finding with narrowband radios. Notably, MCPR would be particularly attractive to implement with Bluetooth radios as the frequency hopping necessary for MCPR can be reused from or shared with the Bluetooth signaling, e.\@\,g.\@\xspace, by using the CTE. % \begin{figure} \centering \includegraphics[width=0.97\linewidth, trim={0.0cm 0.15cm 0cm 0cm},clip]{figures/ranging_attack_illustration.pdf} \caption{Illustration of the MCPR measurement procedure between nodes~$\mathsf{A}$ and~$\mathsf{B}$ and potential phase manipulation attack using by applying adversarial phase shifts~$\phi_{A_1}$ and~$\phi_{A_2}$.} \label{fig:ranging_attack_illustr} \end{figure} In order to find the distance, the radios exchange unmodulated carrier signals and observe their phase shifts~\cite{Bensky.2016}. In particular, node~$\mathsf{A}$ transmits a tone to node~$\mathsf{B}$, which reflects the received tone back to~$\mathsf{A}$ (see Figure~\ref{fig:ranging_attack_illustr}). Upon reception, $\mathsf{A}$ detects the phase of the response and can indirectly measure the ToF to calculate the distance to~$\mathsf{B}$. The idealized two-way tone exchange at frequency~$f_i$ leads to a phase delay of~$\phi_i = 4\pi f_i \tau$ which is a function of twice the ToF~$\tau$, (and the distance between the nodes). As the carrier phase wraps with~$2\pi$, measurements at two frequencies~$f_1$ and~$f_2$ resolve distance ambiguities~\cite{Olafsdottir.2017} and allow~$\mathsf{A}$ to calculate its distance~to~$\mathsf{B}$: \begin{equation} d = \frac{c_0}{4\pi} \frac{\phi_2 - \phi_1}{f_2 - f_1} = \frac{c_0}{4\pi} \frac{\Delta\phi}{f_\mathrm{step}} \label{eq:ranging_distance} \end{equation} In practice, the measurement is repeated for multiple frequencies in rapid succession to combat noise and multipath distortion, e.\@\,g.\@\xspace, by sweeping over $N$~frequencies to gather $N-1$~distance estimates for averaging. % \subsection{Distance Manipulation} \label{sec:mcpr_attack} Ólafsdóttir~et~al.\@\xspace~\cite{Olafsdottir.2017} have shown that MCPR has a number of vulnerabilities rooted in the feasibility to manipulate the signal phase. In turn, attackers may be able to manipulate MCPR distance measurements. One attack concept relies on individual phase manipulation of each carrier signal of a ranging procedure as illustrated in Figure~\ref{fig:ranging_attack_illustr}. Here, we follow this general idea. We observe from Equation~\ref{eq:ranging_distance} that the distance measured by the nodes depends on the phase \textit{change} over frequency. Thus, an attacker attempting to manipulate the distance needs to forge a malicious phase slope by manipulating the channel phase response. By applying appropriate phase shifts~$\phi_{A_i}$, the legitimate parties will estimate the distance to be~$d_\mathrm{set}$: \begin{equation} d_\mathrm{set} = \frac{c_0}{4 \pi} \frac{\Delta \phi + (\phi_{A_2} - \phi_{A_1})}{f_\mathrm{step}} = \frac{c_0}{4 \pi} \frac{\Delta \phi + \Delta \phi_{A}}{f_\mathrm{step}} \label{eq:ranging_distance_forged} \end{equation} Combining Equation~\ref{eq:ranging_distance} and Equation~\ref{eq:ranging_distance_forged}, we arrive at the following expression which yields the phase slope the attacker needs to apply to deliberately manipulate the distance measured by the legitimate parties to be~$d_\mathrm{set}$: \begin{equation} \Delta \phi_A = \frac{4\pi f_\mathrm{step}}{c_0} \left( d_\mathrm{set} - d \right) \label{eq:attacker_phase_changes} \end{equation} Thus, the attacker only needs to know the frequency step size $f_\mathrm{step}$ and the actual node distance $d$, which are either known or can be observed. The actual challenge for the attacker lies in carrying out the required signal manipulation, which we discuss next. \subsubsection{Attack Implementation} To realize the outlined attack, Ólafsdóttir~et~al.\@\xspace~\cite{Olafsdottir.2017} proposed mixing of the victim signals with locally generated coherent RF carrier signals to realize the required phase shifting. However, this requires the attacker to first synchronize to the victim signals. If possible at all (note the \SI{}{\us} timing of MCPR tones), this approach is highly complex and would be costly and cumbersome to implement. Instead, we introduce a new attack variant that allows straightforward implementation. We start with our attacker setup from Section~\ref{sec:relay_implementation} to which we add signal manipulation capabilities as shown in Figure~\ref{fig:relay_block_with_phase}. We insert a digital phase shifter~\cite{MACOM.} into one path of the relay, adding phase control to signals traveling from~$\mathsf{B}$ to~$\mathsf{A}$. Thereby, we completely eliminate the need for RF carrier synchronization. However, to achieve distance manipulation, the phase shifter needs to be adjusted dynamically for each carrier signal, according to Equation~\ref{eq:attacker_phase_changes} to forge a phase slope. Thus, the phase-shifter setting must be adapted to the legitimate ranging signals. To do so, we take advantage of the relay's power detector output signal that we use to obtain the legitimate transmit-receive timing: As soon as $\mathsf{A}$ transmits, the rising power detector output indicates to the attacker that $\mathsf{B}$ is possibly about to respond. Thus, we can properly schedule the setting of phase shifts which need to change by~$\Delta \phi_A$ (see Equation~\ref{eq:attacker_phase_changes}) each time the victim parties proceed with the next carrier frequency. Assuming a linearly increasing carrier frequency, i.\@\,e.\@\xspace, \mbox{$f_i = f_{i-1} + f_\mathrm{step}$}, the phase shifter setting at time $t$, as dictated by the power detector output, is given by: \begin{equation} \label{eq:phase_shifter_settings} \phi_t = \phi_{t-1} + \Delta \phi_A\ \textrm{mod}\ 2\pi \end{equation} Figure~\ref{fig:relay_ranging_attack_synchronization_update}~(top) shows the power detector output before and during a proprietary MCPR procedure between two BLE transceivers~\cite{Dialog.ranging}. We clearly observe the effect of the sweeped carrier measurement comprising of $N=40$~successive tone transmissions. The rising edges of the power detector output~(bottom) correspond to the times $t$ at which we apply the phase shift $\phi_t$. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{figures/relay_block_diag_with_manipulation.pdf}% \caption{This block diagram illustrates the hardware setup for the analog relay attack with amplitude and phase manipulation capabilities.} \label{fig:relay_block_with_phase} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.97\linewidth]{figures/ranging_detection_new_ann.pdf} \caption{Top: Raw power detector output signals, indicating when node~$\mathsf{A}$ transmits. Bottom: Detection times of the attacker to proceed to the next phase shift setting. From \SI{12}{\ms} on (dashed line), the MCPR tone exchange comprising of $40$~sweeped carriers is clearly visible.} \label{fig:relay_ranging_attack_synchronization_update} \end{figure} \subsubsection{Attack Evaluation} \label{sec:relay_phase_manipulation} We now detail the attack performance in a practical evaluation. We conduct experiments with a commercially available MCPR implementation for BLE radio transceivers~\cite{Dialog.ranging} and demonstrate successful distance manipulation attacks while enhancing the communication range. The transceivers interleave standard BLE communication with an MCPR procedure with $N=40$~carriers and a frequency step size~$f_\mathrm{step}=$~\SI{1}{\MHz}. \begin{figure} \centering \includegraphics[width=0.95\linewidth]{figures/distance_decreasing_attack_edit.pdf} \caption{Demonstration of real-time distance manipulation, including reduction and enlargement for three victim node positions.} \label{fig:distacne_decreasing} \end{figure} In a first experiment, we study the general attack principle and focus on the effectiveness of adversarial signal manipulations. To ensure stable channel conditions and prevent direct radiation, we connect the RF port of the interrogating node~$\mathsf{A}$ directly to the primary side of the relay. We place the reflecting node~$\mathsf{B}$ in line-of-sight to the secondary relay antenna at distances $d$~of~\SI{5}{\m},~\SI{10}{\m}, and~\SI{23}{\m}. For each setting, we take~$100$ distance measurements. We plot the results in Figure~\ref{fig:distacne_decreasing} with indication of the relay settings at the top. Without the relay, the distance measured by the legitimate nodes corresponds to the correct physical distance, as shown in the leftmost portion of Figure~\ref{fig:distacne_decreasing}. Next, we insert the attacker hardware but disabled any distance manipulation. The measured distances (labeled as 'Off' in the plot) are now offset by a constant distance bias of around~\SI{9}{\m}. This offset is due to the relay's hardware time delay of around~\SI{30}{\ns} (approx.~\SI{23}{\ns} when excluding coaxial feed cables of~\SI{2}{\m} length). By estimating the physical node distance~$d$ accordingly higher, the attacker can easily self-compensate this effect as we will see next. For each node distance, we then configure the relay to manipulate the measured distances $d_\mathrm{set}$~to~\SI{1}{\m},~\SI{5}{\m},~\SI{10}{\m},~\SI{25}{\m}, and~\SI{50}{\m} by adjusting the phase shifter setting based on Equations~\ref{eq:attacker_phase_changes} and~\ref{eq:phase_shifter_settings}. As evident from Figure~\ref{fig:distacne_decreasing}, the attacker succeeds to arbitrarily increase and decrease the measured distances accurately, regardless of the actual node distance. \begin{figure} \centering \includegraphics[width=\linewidth]{figures/90m_relay_signal_manipulation.pdf} \caption{Combined relay and distance decreasing attack to enhance the communication range while simultaneously decreasing MCPR distance estimations of a BLE transceiver. Top: Measured distance without distance manipulation. Bottom: Measured distance with distance manipulation. % } \label{fig:relay_ranging_attack_OTA} \end{figure} In the previous experiment, we investigated the attack principle and therefore granted the attacker ideal conditions, as node~$\mathsf{A}$ was directly connected to the relay through a coaxial cable. % We now test the attack under more realistic conditions for the attacker. The attacker now picks up the signals from node~$\mathsf{A}$ wirelessly. We place the nodes~$\mathsf{A}$ and~$\mathsf{B}$ outside of their communication range in non-line of sight. In between the nodes, we install our analog relay attacker setup with off-the-shelf directional antennas to span a distance of~\SI{86}{m}. For the experiment, we place node~$\mathsf{A}$ at a fixed distance of~\SI{1}{\m} to the primary relay antenna. We place node~$\mathsf{B}$ at distances $d$~of~\SI{1}{\m} to~\SI{6}{\m} to the secondary relay antenna. Hence, the total distance between the nodes adds up to~\SIrange{88}{93}{\m}. Like in the attack demonstrations from Section~\ref{sec:attacks}, the nodes are only able to communicate via BLE due to the communication channel provided by the relay attacker. Next, the legitimate nodes take~$100$ MCPR distance measurements without adversarial distance manipulation. Figure~\ref{fig:relay_ranging_attack_OTA}~(top) shows the results for the positions of node~$\mathsf{B}$~(indicated by labels at the top). As expected, the measured distance corresponds to the actual (relayed) distance between the nodes and rises as the distance to the relay antenna is increased. Thus, attacks like in Section~\ref{sec:attacks} would easily be detected. We now enable the distance manipulation with $d_\mathrm{set} =$~\SI{2}{\m}. The corresponding distance measurements in Figure~\ref{fig:relay_ranging_attack_OTA}~(bottom) clearly indicate the attacker's success. This experiment highlights that our attacker implementation enables BLE communication over substantial distances while \textit{simultaneously} manipulating the MCPR procedure in real-time. A key observation to make is that the sweeped carrier measurement for MCPR constitutes a particular security weakness: The channel transfer function is sampled on multiple frequencies consecutively which in turn allows individual manipulation of each carrier in a divide-and-conquer manner. This weakness becomes even more severe as, to the best of our knowledge, all currently available MCPR implementations utilize a non-randomly stepped RF carrier. In turn, simple attack strategies that do not require frequency knowledge, cf.~Equation~\ref{eq:phase_shifter_settings}, can be applied. Therefore, we suggest that future MCPR deployments should use secure randomized frequency hopping sequences. \subsection{Channel Reciprocity-based Detection} \label{sec:channel_reciprocity_detection} Besides carrier phase measurements, MCPR typically also provides the carrier amplitudes. While these are not necessary to infer the distance, it is still possible to evaluate them to perform a plausibility check based on \textit{channel reciprocity}. This fundamental property of radio wave propagation states that a radio channel between two antennas is symmetric~\cite{Balanis.2012}. Hence, signals sent on the same frequency from~$\mathsf{A}$ to~$\mathsf{B}$ and vice versa from~$\mathsf{B}$ to~$\mathsf{A}$ experience the same propagation effects such as loss, phase shift, and multipath propagation, e.\@\,g.\@\xspace, represented by a frequency-dependent complex-valued transfer function~$H(f)$. Based on the claim that a relay attacker violates channel reciprocity between legitimate nodes~$\mathsf{A}$ and~$\mathsf{B}$, previous works have suggested to examine the channel response to detect relay attacks~\cite{Jain.2012b, Krentz.2014, Zenger.2016}. The attack detection mechanism is constructed from an examination of channel symmetry using a dissimilarity metric~$d$ on pairs of bidirectional channel magnitude responses $|H_{\textrm{AB}}(f)|$ and $|H_{\textrm{BA}}(f)|$. These need to be exchanged by the nodes via their authenticated and encrypted communication channel. A detection threshold~$\epsilon$ accounts for allowed differences in the respective channel observations made by~$\mathsf{A}$ and~$\mathsf{B}$, e.\@\,g.\@\xspace, due to noise and device-dependent hardware imperfections: % \begin{equation} d(|H_{\textrm{AB}}(f)|,\ |H_{\textrm{BA}}(f)|) > \epsilon \label{eq:cr_detection} \end{equation} Based on this condition, channel asymmetries introduced by an attacker can be detected. For instance, due to spatial decorrelation~\cite{Goldsmith.2005}, this is the case when different wireless links are used, e.\@\,g.\@\xspace, in \textit{unidirectional} attacks~\cite{Olafsdottir.2017, Ranganathan.2012}. Here, the nodes~$\mathsf{A}$ and~$\mathsf{B}$ are within their mutual communication range while the adversary intercepts (and manipulates) one communication direction while the other remains unchanged. \begin{figure} \centering \includegraphics[width=\linewidth]{figures/edamp_with_illustr.pdf} \caption{Left: Illustration of unidirectional and bidirectional relay attacks. Right: Distribution of Euclidean distances to assess channel reciprocity under unidirectional and bidirectional distance decreasing relay attacks.} \label{fig:attack_comparison} \end{figure} We put this claim to test in unidirectional and bidirectional (see left side of~Figure~\ref{fig:attack_comparison}) distance decreasing attacks against MCPR between two BLE transceivers~\SI{15}{\m} apart from each other. First, we use the previously outlined attacker setup for a unidirectional relay attack. The attacker here only forwards signals from~$\mathsf{A}$ to~$\mathsf{B}$ while applying on-the-fly phase manipulation\footnote{We take the asymmetric channel into account to find the corresponding adversarial phase shifts.} to reduce the measured distance to~\SI{2}{\m}. Then, we repeat the attack but use bidirectional relaying where both communication directions are forwarded. Finally, we take a reference measurement without an attack with the nodes at an actual distance of~\SI{2}{\m}. We evaluate the channel reciprocity using the Euclidean distance between $|H_{\textrm{AB}}(f)|$ and $|H_{\textrm{BA}}(f)|$. Figure~\ref{fig:attack_comparison}~(right) depicts the distributions of Euclidean distances for the three scenarios. As expected, channel reciprocity is violated most by the unidirectional attack. In contrast, the bidirectional attack exhibits increased channel reciprocity which overlaps with the results of the legitimate reference measurement. % The residual channel dissimilarity of our bidirectional attack is caused by differences between the relay's forward and reverse transmission paths, e.\@\,g.\@\xspace, because of tolerances of the used parts. To completely circumvent attack detection, the relay hardware needs to be reciprocal, i.\@\,e.\@\xspace, symmetric. This can be achieved in an additional engineering step by tuning the relay's forward and reverse transmission behavior to prevent Condition~\ref{eq:cr_detection} to be fulfilled. However, again shining light on the security drawbacks of the MCPR measurement principle, an attacker can also manipulate the measurement of $|H_{\textrm{AB}}(f)|$ and $|H_{\textrm{BA}}(f)|$ to diminish the effect of the imperfect relay hardware. We propose a relay hardware equalization scheme where the attacker individually manipulates the amplitude of the $N$~tones exchanged by~$\mathsf{A}$ to~$\mathsf{B}$~(cf.~Figure~\ref{fig:ranging_attack_illustr}). The approach follows a similar rationale as the previously outlined phase manipulation attack: The attacker pursues a divide-and-conquer strategy by applying $N$ separate amplitude manipulations to each MCPR carrier. In this way, a frequency-dependent attenuation profile $\beta(f)$ can be applied, such that $|H_{\textrm{AB}}(f) \cdot \beta(f)| \approx |H_{\textrm{BA}}(f)|$ holds. The attacker knows the forward and reverse transmission behavior of the relay hardware\footnote{This can easily be measured using a Vector Network Analyzer~(VNA).} and can thus determine $\beta(f)$. We use a digital step attenuator that we insert into one path of the relay (see Figure~\ref{fig:relay_block_with_phase}) to apply $\beta(f)$. For the attack to work, the attacker must identify the current tone frequency. For this, we exploit the deterministic nature of the examined MCPR implementation: ($i$)~The MCPR measurement is always preceded by consistent transmit-receive patterns, allowing to identify the beginning of the tone exchange from analyzing the relay's power detector output signals. ($ii$)~The MCPR tone exchange is a linearly increasing frequency sweep with step size~$f_\mathrm{step}$, i.\@\,e.\@\xspace, $f_i = f_{i-1} + f_\mathrm{step}$. Thus, the attacker can easily infer the current tone frequency from counting the number of transmissions. \begin{figure} \centering \includegraphics[width=0.87\linewidth]{figures/edamp_vs_relay_hist_edit.pdf} \caption{Distributions of Euclidean distances of channel responses, showing the effect of adversarial gain equalization in relation to non-equalized and non-adversarial settings.} \label{fig:relay_equalize} \end{figure} We repeat the MCPR procedure with and without the outlined amplitude manipulation attack as well as in a legitimate scenario. For all three cases, we plot the histograms of Euclidean distances of channel measurements in Figure~\ref{fig:relay_equalize}. The distributions for the non-adversarial and the equalized relay settings are in complete agreement and are barely distinguishable. This demonstrates the effectiveness of the proposed equalization scheme to prevent attack detection from examining channel reciprocity. Overall, channel reciprocity can be helpful in thwarting naive attacks. However, we conclude that it only increases the attack difficulty, and thus, skilled attackers will be able to overcome this hurdle, as previously discussed and now demonstrated. \section{Discussion} \label{sec:discussion} In this section, we discuss the real-world applicability, attacker capabilities and hardware improvements, and reason about attack detection and mitigation. Finally, we give directions for future work. \subsection{Real-World Applicability} A real-world relay attack is likely to be carried out against access control systems offering PKE operation as those do not require any user interaction other than proximity. However, manufacturers usually allow to disable this feature at will. Some products implement geofencing, which is insufficient since GPS positions are considered to be insecure and may be spoofed. While the cable-based relay implementation certainly rules out some attack scenarios, this should pose a modest hurdle for willing and prudent attackers, e.\@\,g.\@\xspace, when attacks take place at night times. Owing to the operation principle, our relay requires input signals strong enough for the power detector-based reactive switching. Thus, the primary relay station needs to be in proximity to one victim node. This is a realistic assumption, as proximity prior to authorization is an integral part of access control. In one of our MCPR experiments, we studied the effectiveness of our signal manipulation attack and therefore attached one node to the relay hardware through a coaxial cable. While this configuration does not represent a realistic attack scenario, it simplified evaluation and allowed systematic evaluation of the intended attack. In all of our other experiments, the attacker picked up the victim signals wirelessly in ordinary wireless environments. \subsection{Attacker Capabilities and Improvements} We assess the complexity of the deployed attack setup to be moderate. As our setup is external to the legitimate communication and only uses off-the-shelf low-cost RF components, it can be realistically implemented by others. Although the setup is already capable of communication range extension and adaptive signal manipulation, further improvements can be made. Complementing the current mixed-signal processing with a digital receiver would allow to roughly track the nodes' protocol state. Currently, the attacker relies on a cabled connection between the two relay stations. Clearly, this could be replaced with a wireless link, although requiring additional engineering efforts. A challenge would be the isolation between the receiving and re-transmitting antennas of each relay station. This could be achieved through frequency conversion~\cite{Francillon.2010}, full-duplex radios~\cite{Bharadia.2014}, or directional antennas pointing away from each other at a distance~\cite{Lee2012IsolationEB}. An approach based on the latter will be part of a future publication. If bidirectional amplification is required at both relay stations, another aspect would be the wireless synchronization between the relay stations. For this, the primary power detector could trigger a radio transmitter (at another frequency) to which the secondary station listens to toggle the communication direction upon detection. \subsection{Attack Detection and Mitigation} A physical-layer relay attack ideally does not affect the application data but only alters physical quantities. Thus, a detection mechanism should likewise be deployed on the physical layer. This alone poses a hurdle to many devices already in the field as physical-layer data typically is not reported to the application or is not measured at all. Moreover, low-level signal processing is mostly implemented in a performance-optimized but less flexible manner, e.\@\,g.\@\xspace, in hardware, making it difficult to retrofit detection mechanisms. \Paragraph{MCPR} A candidate for a physical-layer countermeasure is MCPR which has recently gained popularity. As our results show, MCPR can be used to tackle range-extension-only attacks. However, likewise did we show that arbitrary distance manipulation is possible with simple off-the-shelf RF components. As an ad hoc security improvement to the currently available MCPR implementations, the deterministic frequency sweep should be replaced by secure random frequency hopping. Although this would render attacks more difficult, it would not be a sound security measure, since frequency can easily be measured. Specific to our phase shift scheduling mechanism, the legitimate nodes could introduce agreed-upon fake transmissions to make the attacker falsely proceed to the next phase shifter setting. To impede the attacker's power detection, the victim device could transmit with very low power. However, the attacker then could utilize an improved power detector or position closer to the victim. \Paragraph{ToF Measurement} Another possibility would be the addition of a direct ToF measurement by means of a challenge-response based distance bounding protocol. Fortunately, proprietary implementations have been reported for various BLE transceivers~\cite{ti.rtls, giovanelliRSSITimeofflightBluetooth2018, AbidinSecureAccuratePractical_2021}. However, due to the limited signal bandwidth of Bluetooth, it is unlikely to achieve measurement accuracy as high as with MCPR. % Further, the rather slow-transient Gaussian pulse shape employed for Bluetooth could facilitate early symbol detection attacks. Still, predicting cryptographically secured challenges early certainly poses higher hurdles to attackers than manipulating MCPR measurements where the measurement signals do not carry meaningful information. Thus, we believe this could be a good starting point to impose higher attack complexities. This likewise is acknowledged by recent work of Abidin~et~al.\@\xspace~\cite{AbidinSecureAccuratePractical_2021} who proposed a ranging system that combines MCPR with ToF to implement a distance bounding protocol specifically geared towards BLE applications. \Paragraph{Secondary observations} Specific to PaaK-based PKE applications, smartphones should not constantly emit unlock commands to mitigate the risk of relay attacks (as we experienced for the smart lock). That is, the smartphone should first apply plausibility checks, e.\@\,g.\@\xspace, based on sensor readings. Secondary tracking and surveillance systems of connected cars could report successful attacks. For instance, stolen cars may report location data and camera footage over a cellular connection. However, this could be bypassed, e.\@\,g.\@\xspace, using wireless jamming. \subsection{Future Work} In this work, we presented an analog physical-layer relay attack capable of RF range extension for Bluetooth communication and adaptive signal manipulation. Based on our results, we outline possible directions for future work. Security discussions on relay attacks are often based on vague assumptions on attacker capabilities, making it difficult to realistically assess the risk of attacks. Future work should define an attack taxonomy to properly categorize attacks and countermeasures. While the physical layer provides the basis for proximity verification, an actual implementation lives within a possibly complex protocol. Thus, in conjunction with physical-layer analysis, proximity verification should be examined for potential weaknesses on the protocol-level. Our current attack implementation serves as a proof-of-concept. Naturally, the hardware setup leaves room for improvements and we are currently in the process of investigating wireless relay links. % \section{Conclusion} \label{sec:conclusion} In this paper, we introduced a novel concept to accomplish real-world relay attacks on \SI{2.4}{\GHz} TDD communications such as Bluetooth. Using a setup built from off-the-shelf RF components, we carried out successful relay attacks on a car and a smart lock. Our results highlight the need for a secure proximity verification which is currently lacking for Bluetooth. Therefore and in view of our attacker setup, we investigated the security of MCPR which recently found deployment aside of Bluetooth. We demonstrated the first practical on-the-fly phase manipulation attack on MCPR while simultaneously enhancing the communication range. Based on our findings, we suggest to implement MCPR with a mandatory frequency hopping to impede attacks. Finally, we hope that our work will raise awareness for relay attacks against Bluetooth-based proximity applications to accelerate the deployment of countermeasures. \section{Relay Hardware Details} \label{sec:appendix} \begin{table} \footnotesize\caption{Relay hardware components. The lower part lists components required to conduct the outlined signal manipulation attacks.} \label{tab:relay_part_list} \centering \begin{tabular}{@{}rcl@{}} \toprule \textbf{Hardware Component} & \textbf{Quantity} & \textbf{Purpose}\\ \midrule Mini-Circuits ZX60-272LN-S+ & 2 & \tline[l]{Low-Noise Amplifier~(LNA),\\first amplifier stage}\\% 77€ Mini-Circuits ZX60-2534MA+ & 2 & Amplifier\\% 72€ Mini-Circuits ZX60-2522MA+ & 2 & Amplifier\\% 85€ Renesas F2932 & 2 & \tline[l]{SPDT RF switch,\\signal direction selection}\\% 208€, 3.30€ Renesas F2910 & 2 & \tline[l]{SP1T RF switch,\\isolation enhancement}\\% 214€, 1.69€ Mini-Circuits ZFSC-2-10G+ & 2 & \tline[l]{RF power splitter,\\tap signal for power detector}\\% 68€ Analog Devices LT5538 & 2 & \tline[l]{RF power detector,\\signal detection of $\mathsf{A}$}\\% 83€, 5.90€ Crystek CBPFS-2441 & 1 & \tline[l]{Bandpass filter,\\reject noise and outband interference}\\ % Siretta LLC200A 15m & 8 & \tline[l]{Coaxial cable,\\connect relay stations}\\ % Interline PANEL 17 & 2 & \tline[l]{Directional antenna,\\pick up victim signals}\\% 60€ \midrule ST STM32G474RE & 1 & \tline[l]{Microcontroller,\\comparator and relay control}\\ M/A-COM MAPS-010164 & 1 & \tline[l]{Phase shifter,\\MCPR distance manipulation}\\ Analog Devices HMC624A & 1 & \tline[l]{Step attenuator,\\reciprocity manipulation}\\ \bottomrule \end{tabular} \end{table} \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/comparator_speed_ann.pdf}% \caption{Output voltage of the power detector at the primary relay station, detection threshold voltage (\SI{0.9}{\V}, corresponding to an RF input power of approx.~\SI{-40}{dBm}~\cite{AnalogDevices.}), and RF switch control signal during the start of a Bluetooth transmission, indicating a reaction time of approx.~\SI{350}{\us} after threshold crossing.} \label{fig:detection_speed} \end{figure} \begin{figure}[h] \centering \includegraphics[width=\linewidth]{figures/advertising_and_interference_ann.pdf}% \caption{Power detector output voltage and RF switch control signal while receiving Bluetooth advertisement packets (consecutively on channels $37$, $38$, $39$) of the tested smart lock. Nearby Wi-Fi interference is received weaker and does not trigger detection.} \label{fig:advertising_interference} \end{figure} In the following, we provide additional details on our proof-of-concept attacker implementation. An architectural block diagram of the implemented setup is shown in Figure~\ref{fig:relay_block_only_PD}. For simplicity, we only show two amplifiers per direction in the block diagram. In fact, we used a cascade of three RF amplifiers, delivering a total gain of \SI{75}{\decibel} for each direction. A detailed list of all parts and their purpose to implement our attacker setup can be found in Table~\ref{tab:relay_part_list}. The upper part of the table lists the parts used for the relay configuration used in Section~\ref{sec:attacks}. For the experiments in Section~\ref{sec:attack_evaluation}, we additionally added the parts listed in the lower part of the table as shown in Figure~\ref{fig:relay_block_with_phase}. We selected the components listed in Table~\ref{tab:relay_part_list} primarily for their operating frequency to match the~\SI{2.4}{\GHz} frequency band. A fast response time is desired for the reactive switching of the relay to avoid cutting off initial parts of a transmission from~$\mathsf{A}$. Therefore, we specifically chose components having rather fast response times being much shorter than the~\SI{1}{\us} and~\SI{0.5}{\us} symbol duration of transmissions of BLE at~\SI{1}{Mbps} and~\SI{2}{Mbps}. The RF response time is governed by the power detector, the comparator which converts the power detector output into a logic signal, and the RF switches. The relay's response upon a beginning transmission of~$\mathsf{A}$ can be seen in Fig.~\ref{fig:detection_speed}. Reactive switching is accomplished within approx.~\SI{0.35}{\us} after signals from~$\mathsf{A}$ cross the power detection threshold at the primary relay station. Please note that this is approx.~0.795\% and 0.016\% of the shortest (\SI{44}{\us}) and longest (\SI{2128}{\us}) possible BLE packets, respectively~\cite{BluetoothSIG.January2019}. The relay directions are flipped back after A stops to transmit, without any limitation of the maximum transmission duration. The power detector is capable of detecting signals from~\SIrange{-75}{10}{dBm}. Considering interference from other radio traffic, in a typical office environment, we found input powers of~\SI{-45}{dBm} to be sufficient to distinguish between targeted and other signals. Fig.~\ref{fig:advertising_interference} shows an example trace captured from the relay's primary power detector while the relay receives BLE advertisement packets from the tested smart lock (at \SI{1}{\m} distance). It can be seen that the high received signal power triggers the detection. In contrast, interfering signals from a nearby \mbox{Wi-Fi} access point (\SI{0}{} to \SI{2}{\ms} in the plot) are not as strong as the target signals and do not trigger the detection. For adaptive signal manipulation, e.\@\,g.\@\xspace, MCPR distance manipulation, we used a microcontroller to process and react to the comparator output signals. The microcontroller accordingly controlled a phase shifter with \SI{6}{bit} phase resolution over~\SI{360}{\degree}~\cite{MACOM.}. Another important aspect of the implementation is the isolation between the relay's transmission paths. Isolation is critical since a portion of the amplifier output will reach the input of the other direction's amplifiers. When the overall amplification is too large in regard of the finite path isolation, this again creates a feedback loop, causing instability of the overall system. In our relay implementation, the isolation between the paths is dominated by the electronically controlled solid state RF switches. Here, we initially were facing the RF amplifiers to slightly oscillate. We tackled the issue by adding a pair of F2910 SP1T switches in front of the LNA inputs to increase the total isolation. For the sake of simplicity, we do not indicate these switches in Figure~\ref{fig:relay_block_only_PD} as these are always controlled in conjunction with the main SPDT switches.
{'timestamp': '2022-02-15T02:38:54', 'yymm': '2202', 'arxiv_id': '2202.06554', 'language': 'en', 'url': 'https://arxiv.org/abs/2202.06554'}
arxiv
\section{Introduction} Serverless computing platforms such as AWS Lambda~\cite{awslambda}, Google Cloud Functions~\cite{googlefunctions}, and Azure Functions~\cite{azurefunctions} offer highly elastic computing and fine-grained resource billing (as low as milliseconds~\cite{aws-1ms-billing}), while raising the level of abstraction for user interaction with the cloud \cite{Berkeley-CACM}. Although serverless platforms cost more per hour than resources on virtual machines \cite{RiseofServerless19}, the fine-grained cost model still makes serverless computing cost-effective for jobs with short execution times and sporadic invocation patterns~\cite{ExCamera,starling,Lambada}. Today's serverless offerings are, however, impractical for a wide variety of applications \cite{HellersteinCIDR19,gg,InfiniCache,starling,Lambada}. Current systems limit the execution time of tasks; some restrict the rate at which functions can be created \cite{azurefunctions} or the number of concurrent functions~\cite{Amazon-Lambda-reservation-system}; and none of the platforms support heterogeneous hardware~\cite{aws-FAQs}. However, the most critical limitation is the lack of direct communication among functions which has wide-ranging implications for application design and performance. Current attempts at generalizing commercial serverless platforms implement inter-function communication by exchanging data through remote storage systems such as Amazon S3, Anna, and Pocket~\cite{S3, anna, pocket}. Doing so adds considerable overhead and also increases cost~\cite{starling,Lambada}. For instance, parallelism can be used to hide the latency overhead of exchanging data through Amazon S3, with Perron et al. reporting an S3 latency of 14ms to read 256KB of data~\cite{starling}. The consequences are higher costs (each S3 GET and PUT request incurs cost) and a more complex system design which requires parallel reads to a storage system and additional network round trip times. In this paper, we explore how serverless computing platforms can be leveraged to run generic applications. Our goal is to provide a general-purpose solution that turns a serverless function into the equivalent of the Linux execution environment that most cloud applications expect. We identify networking as a key challenge, since generic cloud applications rely on direct communication between nodes while serverless platforms do not support it. We propose {Boxer}\xspace, a system that provides a familiar Linux execution environment on top of functions-as-a-service (FaaS) platforms. {Boxer}\xspace exposes a Linux socket API for networking inside functions and supports direct, transparent, TCP/IP communication. {Boxer}\xspace uses a NAT-punching technique to provide bi-directional TCP/IP communication to functions without the external proxies required by existing work ~\cite{ExCamera,gg,InfiniCache} or specializing to a single use case \cite{Boxer-CIDR21}. In addition to the design of {Boxer}\xspace, we make several contributions. First, we demonstrate that {Boxer}\xspace can run applications that require inter-function communication on AWS Lambda and achieve performance comparable to using similarly sized VMs (\S~\ref{sec:microbenchmarks}). Second, since {Boxer}\xspace provides the application with a standard network interface, we show in \S~\ref{eval:deathstar} that it supports running unmodified applications, such as the DeathStarBench microservice benchmark suite\cite{DeathStarBench}. Third, we show that {Boxer}\xspace allows cloud users to leverage the fine-grain elasticity of serverless platforms to quickly absorb load bursts in applications and optimize cost by migrating applications seamlessly between VM and serverless environments depending on the load pattern (\S~\ref{sec:dynamic}). Through these capabilities, {Boxer}\xspace opens up many new opportunities for serverless computing (\S~\ref{discuss:opportunities}). By providing conventional networking capabilities using standard interfaces, {Boxer}\xspace enables a general-purpose, on-demand, short-lived datacenter that can run unmodified, distributed applications and is not limited to trivially parallel jobs. We have implemented and evaluated {Boxer}\xspace on top of AWS Lambda and we plan on making it available as open source. \section{Background} Leveraging serverless platforms as short-lived, general purpose datacenters requires bridging the gap between the requirements of distributed applications and the functionality provided by today's serverless platforms. To provide the necessary background, we describe the execution environment of serverless platforms, focusing on AWS Lambda as the most advanced serverless platform in the market. \subsection{Serverless Execution Environments} \textbf{Packaging and invoking functions:} To run a serverless function, users register the function and specify its deployment package, invocation triggers, and memory resource allocation. For the deployment package, AWS Lambda allows users to supply source code or application binaries. AWS Lambda also supports container images of up to 10 GB in size~\cite{aws-lambda-containers}. In addition to the deployment package, users also configure events to trigger function invocations. Examples of event sources include storage and message queue service notifications, timers, and HTTP requests. Finally, users specify a memory requirement for the function. The cloud provider allocates CPU resources for the function proportionally to its memory allocation. As of October~2021, AWS Lambda supports functions with 128 MB to 10 GB of memory and up to 6 vCPUs (vitual CPUs). Every invocation of a function is executed in its own isolated environment, running a kernel derived from Linux 4.14 and a file system image based on the Amazon Linux~\cite{amazon-linux} distribution. Serverless functions execute as unprivileged userspace processes with restricted capabilities in a secure and isolated runtime environment. \textbf{Dynamically loading dependencies:} When a function process is invoked and begins executing, a dynamic linker in the AWS Lambda execution environment loads the shared libraries required by the executable. The dynamic linker uses a set of rules to locate the objects that have to be loaded to satisfy the dependency list. It is also possible to direct the dynamic linker to load additional shared libraries before any other shared libraries are loaded. Objects and functions exported by the additional libraries can be then used by the executable. If the exported names are the same as the exported names from other libraries loaded later, the executable will use the function or objects from the additional library that is loaded before others. This provides a mechanism to intercept function calls to dynamically linked system libraries such as libc. We use this mechanism to embed {Boxer}\xspace's interposition library in the system when deploying an application so that network and other operations are selectively routed through {Boxer}\xspace. \subsection{Serverless Networking} AWS Lambda functions are assigned private IP addresses from private subnets. They are able to send network traffic to external addresses as the traffic from a function to the public internet is routed through Network Address Translation (NAT) gateways. A NAT gateway forwards the traffic to the destination address but changes the source address to a publicly routable address available to the gateway. The assigned mapping between the internal source address and the externally routable source address is stored in the gateway state. As the network traffic arrives at the destination host, its source address is the address assigned by the NAT gateway. When the destination host sends traffic back to the source address it received the traffic from, the traffic arrives back at the gateway having the previously assigned mapping to an internal destination address. Based on the mapping, the gateway modifies the destination address of the traffic and routes it towards the original private source address assigned to the function. For the function, the traffic appears to come directly from the destination host. This results in AWS Lambda functions being able to transparently access external services and internet resources. Serverless functions cannot accept connections initiated by external sources or by other functions. AWS Lambda restricts the incoming network traffic for functions to traffic that directly corresponds to previously outgoing traffic. Even if an external host learned the private IP address assigned to a function, it could not route traffic to it. Network traffic destined for an internal address must be routed through an external gateway that will then appropriately route it through the private network. If the external gateway is a NAT, then just knowing the route is also not sufficient. A NAT gateway will drop any incoming traffic not matching its previously configured address translation map. Hence, in the case of TCP, a function process can initiate a connection to an external address and then receive traffic on that connection but it cannot accept new incoming TCP connections. \section{Related Work} \subsection{Communication Through Proxies} Prior work has circumvented the lack of networking by using proxy or coordinator servers to initiate connections and relay messages between serverless functions. Fouladi et al. proposed \textit{mu}, a framework for orchestrating parallel computation and communication across serverless workers, as part of their work on ExCamera~\cite{ExCamera}. The \textit{mu} framework uses a long-lived coordinator and rendezvous server for inter-function communication. Workers running short-lived lambda function invocations establish a connection with the mu coordinator, which can instruct workers to communicate between each other through a rendezvous server. The mu rendezvous server buffers and relays messages from source to destination lambdas. The authors point out that the rendezvous server’s connection to workers can become a bottleneck and recommend implementing direct communication between lambdas via a hole-punching NAT-traversal strategy, but leave this as future work. In a similar approach, Wang et al. propose using serverless functions to build InfiniCache, a distributed in-memory cache~\cite{InfiniCache} that uses a proxy to which functions connect and is used to relay messages to and between serverless functions. A number of other projects, e.g. \cite{gg}, use a similar approach to enable communication. Using an fixed infrastructure service that runs parallel to the serverless functions defeats some of purpose of using serverless. Initializing the supporting infrastructure and the proxy/coordinator add overheads, causing starting delays that serverless purportedly removes. Leaving the infrastructure running incurs costs and requires the maintenance, again defeating one of the main goals of serverless. We are not the first one to point out the limitations of existing approaches. There was an open-source Serverless Networking SDK that allowed functions to communicate over UDT~\cite{UDT}, a UDP-based protocol (the project is no longer active). It relied on a custom API instead of supporting conventional sockets~\cite{serverlessnet}. Solutions have also been proposed to address the networking overhead of starting thousands of functions at the same time \cite{Particle20} or the overhead of sustaining many RPC calls \cite{Nightcore21}. These solution propose alternative architectures to current commercial deployments and rely on conventional containers or VMs to avoid the limitations of serverless system. In contrast, we are interested in solving these same issues but using the infrastructure provided by cloud vendors. It has been claimed that, in such settings, adding networking makes no sense \cite{Berkeley-CACM} because it would remove the ability of the cloud vendor to optimize the deployment. As {Boxer}\xspace shows, it is possible to add networking to FaaS without affecting any of its underlying properties or restricting the possibility of optimizing the deployment. \subsection{Communication Through Storage} Applications that require to move larger amounts of data typically resort to an alternative design. Instead of using a coordinator or a proxy, they use ephemeral storage systems, such as Pocket~\cite{pocket}, Anna \cite{Anna18}, and Locus~\cite{Locus}, to improve the performance of inter-function communication through remote storage. In such systems, communication is implemented by writing and reading to a specialized storage layer built for serverless functions. In other cases, rather than using a specially built systems, Amazon's S3 is used directly. For instance, Lambada~\cite{Lambada} and Starling~\cite{starling} are query analytical systems that implement exchange operators as read/write patterns on Amazon S3 as a way to allow functions running parts of a query to exchange data. In both cases, a relatively complex design is needed to deal with the overhead of communication through storage. While communication through storage solves the problem, it has both a high cost both monetary and in performance. Writing and reading to storage services like S3 is not for free. Implementing communication through storage induces a large amount or read and writes, increasing the cost of using serverless. Performance-wise, using storage to exchange data not only suffers from the higher latency of storage but also adds communication rounds to the exchange. This overhead becomes significantly visible since now AWS Lambda is charged per millisecond and the observed delay is potentially in the order of tens of milliseconds \cite{starling,Boxer-CIDR21}. \subsection{General Purpose Serverless} It has been noted that serverless platforms can be used as a supercomputer on-demand to run highly parallel jobs as it is done in \texttt{gg}, a framework and collection of command line tools to help users run everyday applications -- such as software compilation and unit tests -- seamlessly on serverless platforms~\cite{gg}. Users express their applications as a composition of lightweight, functional containers using \texttt{gg}'s intermediate representation, while the framework takes care of instantiating containers as serverless functions, loading dependencies, and dealing with function failures and stragglers. This idea of a \textit{supercomputer-by-the-second} also appears in previous wok of the same authors\cite{ExCamera}. Recently, serverless has been presented as the next generation of cloud computing, reinforcing the idea of general purpose use instead of the narrow uses cases considered today \cite{Berkeley-CACM}. In this paper we pursue the same notion but focus on generalizing serverless to support unmodified, distributed applications. We aim to turn serverless into a true sub-second datacenter that can be used by off-the-shelf applications rather than just for trivially parallel jobs. \section{{Boxer}\xspace} As a first step towards exploring the notion of the sub-second datacenter, we have developed {Boxer}\xspace, a system that transparently enables networking between serverless functions. We choose to focus on datacenter applications that use the conventional socket networking API in Linux and the TCP networking protocol, as this represents a large class of datacenter applications. \subsection{System Overview} {Boxer}\xspace uses two key mechanisms to allow external hosts to initiate connections with serverless functions and functions to communicate with each other transparently. First, to allow incoming traffic to be routed to a serverless function, {Boxer}\xspace uses NAT punching techniques that resemble those proposed in the past for generic NAT services \cite{Eppinger,Ford}. However, our solution is tailored to the AWS Lambda environment and uses functionality specific to AWS Lambda. Through these techniques, {Boxer}\xspace provides the sending host with the appropriate gateway address and configures the gateway with the appropriate state for the traffic to traverse the NAT and arrive at the private IP address of the destination function. Second, to make the NAT traversal transparent to applications, {Boxer}\xspace intercepts some dynamically linked libc library function calls by leveraging the dynamic linker that is invoked in the Linux-based AWS Lambda execution environment. For example, when a serverless function calls \texttt{connect}, the {Boxer}\xspace \texttt{connect} implementation will execute instead of the original libc implementation -- this allows {Boxer}\xspace to implement NAT traversal without requiring application modifications. \begin{figure}[t] \centering \includegraphics[width=.8\linewidth]{plots/boxer-architecture.pdf} \caption{Networked serverless functions use a Seed process to connect functions during the startup. After the startup phase, the seed process is no longer needed.} \label{fig:arch} \end{figure} {Boxer}\xspace's networking environment consists of 1) {Boxer}\xspace processes running inside each serverless function and each node that needs to initiate connections to a function, and 2) a {Boxer}\xspace `seed' process (Figure \ref{fig:arch}), which runs on an externally routable host and is used for network initialization. Each {Boxer}\xspace process consists of a \textit{networking service} to establishes TCP connections, a \textit{coordination service} to send and receive network membership updates from other {Boxer}\xspace processes, and a \textit{transparent execution service} to selectively intercept library calls and run unmodified Linux TCP sockets-based applications. We describe each of these services in more detail below. {Boxer}\xspace is packaged as a Linux executable and a shared library object, as we describe in Section~\ref{sec:boxer-packaging}. Users include the {Boxer}\xspace package in each function deployment package when registering functions on the cloud platform. This allows a {Boxer}\xspace process to start executing in the serverless function environment when the function is invoked. Users are also responsible for spinning up a {Boxer}\xspace seed process on an externally routable host, such as an EC2 instance. \subsection{Networking Service} \label{sec:Boxer-net} The networking service in {Boxer}\xspace provides TCP connectivity and manages NAT configuration. We start by describing how nodes join the network and then describe how TCP connections are established. \begin{figure}[t] \centering \includegraphics[width=.6\linewidth]{plots/join.pdf} \caption{New {Boxer}\xspace node $B_{new}$ in function $F_{new}$ joins already connected nodes $B_0$, $B_1$ running in functions $F_{0}$,${F_1}$ and seed node $B_{seed}$ running in a virtual machine $VM$. Solid lines represent control connections, dashed lines messages sent, numerical labels the stage of the join protocol when message is sent or connection is established.} \label{fig:join} \end{figure} \textbf{Joining the network:} The {Boxer}\xspace seed process is responsible for network initialization (Figure \ref{fig:join}). The user sets a parameter to specify the address of the seed process. The seed can be any other {Boxer}\xspace process that is reachable by the process being started. Since functions cannot establish connections to other functions before {Boxer}\xspace is initialized, the seed process must be running outside of AWS Lambda. We currently run it in an AWS EC2 instance, but it could be run anywhere routable from {Boxer}\xspace processes that are attempting to join the network. The seed process performs three functions. First, it informs the connecting process of its observed external address. If the process is connecting from AWS Lambda, this is the external address assigned by the NAT gateway used. Second, the coordinator service of the seed process informs all other {Boxer}\xspace processes in the network of a new node, and it supplies the joining process with a list of all other nodes that already joined. Third, the seed process ensures that each external address only exists once. This deals with the fact that two concurrent function invocations may be handled by the same machine behind the same NAT gateway and would thus be indistinguishable. If that happens, all but the first node with a given address are rejected from joining the network, so the corresponding {Boxer}\xspace process exits immediately and all of the function resources are released. When a new node joins the network, its coordinator service learns the addresses of all other nodes in the network. Concurrently, coordination services of all other nodes in the network are updated with the address of the newly joined node. The {Boxer}\xspace networking service of every node listens to membership updates and treats these events as signals that it is time to establish direct control connections with the new node. Control connections are used to exchange commands between {Boxer}\xspace processes. The membership updates contain the expected external address of the {Boxer}\xspace network control service. At this point, all nodes have enough information to establish new control connections through the NAT. {Boxer}\xspace nodes establish the control TCP connections between the new node and the rest of the nodes in the network. This procedure is repeated for every joining node resulting in NxN connectivity through TCP connections, one for each pair of nodes in the network. \begin{figure}[t] \centering \includegraphics[width=0.85\linewidth]{plots/connect.pdf} \caption{Opening TCP connection by process $P_0$ to process $P_1$ running in a remote function.} \label{fig:connect} \end{figure} \textbf{Providing TCP connections:} After the {Boxer}\xspace networking service is initialized as described above, every node in the network is ready to provide TCP connectivity to its local {Boxer}\xspace process. The {Boxer}\xspace networking service provides NAT setup service for its local {Boxer}\xspace process and to {Boxer}\xspace processes running on remote nodes. In the current version, the {Boxer}\xspace networking service does not open TCP connections on behalf of processes; instead, it sets up the appropriate state in the NAT so that when the process attempts to open a TCP connection to another function, the network traffic will traverse through the NAT and the connection can be established. Figure~\ref{fig:connect} illustrates the TCP connection process. A {Boxer}\xspace process wishing to establish a TCP connection to a remote {Boxer}\xspace process cannot immediately open a connection to the remote address because the NAT would block it. Instead, (1) the process sends a request to the local {Boxer}\xspace networking service to request that the NAT state be configured for the specified connection. If the connection is to an address that is a part of the {Boxer}\xspace network, then (2) the request is forwarded to the appropriate remote {Boxer}\xspace network service using the control connections configured during the initialization (described above). The remote {Boxer}\xspace network service (3) performs the NAT configuration and then (4) sends an acknowledgment back to the requesting {Boxer}\xspace service that the NAT is ready. (5) The confirmation is forwarded back to the process that made the original request. At this point, the requesting process can (6) attempt opening a TCP connection to the previously specified remote address. Because the remote {Boxer}\xspace configured the NAT, opening the connection will traverse the NAT and reach the remote process. Assuming the remote process is listening for incoming connections at the specified address, the TCP connection is established. \subsection{Coordination Service} Every {Boxer}\xspace node runs a simple coordination service. The service exposes an interface for local processes to stream membership updates as new nodes join the network. Every membership service instance allows other nodes to become children and propagate the updates. Currently, the seed node is used as the root of the propagation tree. The coordination service is used during the initialization process (described above) by the networking service to establish the control connections. The execution service (described below) uses the coordination service to determine when to proceed with the application execution and to provide the application with the list of peer addresses. \subsection{Transparent Execution Service} \label{sec:Boxer-exec} The {Boxer}\xspace execution service provides functionality to schedule the execution of applications in a transparent manner. To use {Boxer}\xspace, the programmer specifies a command for {Boxer}\xspace to run when the {Boxer}\xspace process starts executing. The command can either be run immediately or after a specified number of members have joined the {Boxer}\xspace network. For example, \verb|perforator -s SEED_ADDR| \verb|-n 5 zk-start.sh| will run the \verb|zk-start.sh| command once the network has five members. This mode of execution is particularly useful to start datacenter applications that require a static network configuration. If a barrier for a target number of workers is specified, {Boxer}\xspace runs the specified command and sets its environment variables to indicate the local node address, a unique node ID assigned to the current node, and a file name of a file containing the list of addresses for all other nodes. If no barrier is specified and the command runs immediately, {Boxer}\xspace will still learn of network membership changes during execution via the coordination service. To run datacenter applications, users may write small shell scripts that generate the necessary configuration files based on the environment variables and then start the application. \begin{figure}[t] \centering \includegraphics[width=.65\linewidth]{plots/interpose.pdf} \caption{Transparent application execution via the interposition library(IL). Application process $P_0$ uses socket \texttt{connect} function to open a TCP connection to a remote function.} \label{fig:interpose} \end{figure} \subsection{Interposition Library} To enable applications to establish connections using {Boxer}\xspace without requiring changes to application code, when {Boxer}\xspace runs commands, it instructs the dynamic linker to load the {Boxer}\xspace interposition library before all other shared libraries are loaded and the application execution begins. The {Boxer}\xspace interposition library is designed selectively to intercept functions provided by other shared libraries that are loaded by the dynamic linker. We design {Boxer}\xspace to provide transparent networking support for applications that use the socket interface, which is generally provided by a version of the libc system library on Linux systems. Applications use the \verb|connect| function on stream sockets to open TCP connections. When the interposition library is loaded, applications use the \verb|connect| function exported by the interposition library, instead of the default version provided by libc. This provides the primary mechanism for intercepting the necessary function calls to provide transparent sockets semantics using {Boxer}\xspace networking to establish TCP connections. Figure ~\ref{fig:interpose} illustrates the process of transparently opening remote TCP connections by an application running in a function with {Boxer}\xspace. Every time an application process calls the \verb|connect| function, it is intercepted by the interposition library (1) If the call is not associated with a TCP socket, the interposition library immediately forwards the call to the default implementation of \verb|connect|. Otherwise, if the socket is not already bound to a local address, it is bound to a local address assigned by the kernel, and then the local and remote addresses associated with the socket are used to construct the appropriate connection request command. The command is then sent to the local {Boxer}\xspace networking service. (2) The networking service forwards the request to the appropriate remote node (3) and, when the result is received, (4) it reports it back to the library. (5) If a successful acknowledgment is returned from {Boxer}\xspace networking, that indicates that the NAT is configured, so the interposition library (6) establishes a TCP connection using the default version of the \verb|connect| function. When the system \verb|connect| function completes, (7) the result of the final call is returned to the calling application. (8) The application does not observe any functional difference from the default \verb|connect| call. If the connection was successful, the application continues to use the TCP connection in the same way as if {Boxer}\xspace was not involved in the process. No function calls for sending and receiving data over the socket are intercepted; instead, (9) default library functions are used directly. In addition to the \verb|connect| function, to provide transparency to the applications accepting TCP connections, the \verb|bind| socket function is also intercepted by the interposition library. The NAT configuration process performed by the networking service requires binding a temporary socket to the same local address as the socket that an application accepts connections on. To make this possible, the application's listening socket must have the \verb|SO_REUSEPORT| socket option set. To support unmodified applications, {Boxer}\xspace modifies this socket option for the application by intercepting \verb|bind| calls (the same effect could be achieved by intercepting other functions as well). It should be noted that this is an example where perfect transparency is not preserved. The application can detect that the option was changed on the socket, and if the application relies on this option not being set, then it could have an impact on the application. However, we do not aim to cover unusual corner cases, and typical datacenter applications are functionally not affected. \begin{table*}[h!] \centering \small \resizebox{\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline \multirow{2}{*}{TCP connection type} & \multicolumn{2}{c|}{Mean} & \multicolumn{2}{c|}{Median} & \multicolumn{2}{c|}{Std.} & \multicolumn{2}{c|}{Min} & \multicolumn{2}{c|}{Max} \\ \cline{2-11} & Forward & Reverse & Forward & Reverse & Forward & Reverse & Forward & Reverse & Forward & Reverse \\ \hline Function-to-Function & 622.57 & 622.63 & 626.88 & 628.59 & 24.32 & 25.81 & 564.25 & 561.16 & 680.63 & 678.36 \\ VM-to-Function & 428.28 & 426.03 & 429.03 & 428.09 & 1.69 & 4.01 & 420.31 & 415.62 & 429.16 & 429.18 \\ Function-to-VM & 410.31 & 427.05 & 422.64 & 428.74 & 26.58 & 3.61 & 335.70 & 414.39 & 429.06 & 430.33 \\ Function-to-VM-native & 427.77 & 426.67 & 429.04 & 428.62 & 3.16 & 4.93 & 412.74 & 399.35 & 429.07 & 429.07 \\ VM-to-VM & 428.89 & 428.96 & 428.96 & 428.95 & 0.55 & 0.29 & 424.78 & 427.50 & 429.01 & 430.39 \\ VM-to-VM-native & 429.02 & 429.06 & 429.03 & 429.07 & 0.15 & 0.02 & 428.43 & 429.02 & 429.65 & 429.09 \\ \hline \end{tabular}} \caption{TCP throughput in Mbit/s for different connection types measured using iperf3\cite{iperf3} Forward and Reverse modes refer to throughput achieved by the client side generating traffic or server side respectively.VMs are EC2 m4.large instances.} \label{fig:throughput} \end{table*} \begin{table*}[h!] \centering \small \resizebox{\textwidth}{!}{% \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline \multirow{2}{*}{TCP connection type} & \multicolumn{2}{c|}{Mean} & \multicolumn{2}{c|}{Median} & \multicolumn{2}{c|}{Std.} & \multicolumn{2}{c|}{Min} & \multicolumn{2}{c|}{Max} \\ \cline{2-11} & Forward & Reverse & Forward & Reverse & Forward & Reverse & Forward & Reverse & Forward & Reverse \\ \hline Function-to-Function & 621.48 & 621.44 & 628.42 & 627.95 & 23.87 & 24.28 & 560.61 & 560.99 & 674.14 & 677.28 \\ VM-to-Function & 622.98 & 624.10 & 610.70 & 623.97 & 26.59 & 32.31 & 595.92 & 566.07 & 680.64 & 681.22 \\ Function-to-VM & 623.18 & 621.78 & 637.01 & 640.82 & 26.99 & 32.22 & 564.00 & 570.34 & 658.91 & 664.03 \\ Function-to-VM-native & 624.13 & 622.39 & 639.62 & 622.06 & 27.75 & 31.24 & 566.61 & 571.08 & 657.34 & 668.00 \\ VM to VM & 4684.53 & 4706.22 & 4744.35 & 4735.99 & 144.29 & 103.36 & 4034.14 & 4263.13 & 4789.13 & 4787.11 \\ VM-to-VM-native & 4770.42 & 4695.97 & 4786.23 & 4740.02 & 39.46 & 159.41 & 4571.73 & 3903.98 & 4787.20 & 4789.87 \\ \hline \end{tabular}} \caption{TCP throughput in Mbit/s for different connection types measured using iperf3\cite{iperf3} between 32 pairs of hosts for each type. Connection types are the same as in Table~\ref{fig:throughput}. The measurements were conducted in AWS eu-west-3 region, VMs are EC2 m5.large instances. } \label{fig:throughput_big} \end{table*} \subsection{Packaging Applications with {Boxer}\xspace} \label{sec:boxer-packaging} In order to run existing applications in serverless functions, they have to be packaged together with {Boxer}\xspace using the deployment process of the cloud provider. A typical application package consists of four components: (1) the event handler the function service calls when the function is invoked, (2) the {Boxer}\xspace executable and interception library, (3) the application itself including templates of its configuration files, and (4) a dynamic configuration script. In AWS, we have used dependency layers for the {Boxer}\xspace and application code and deployed the handler and configuration scripts as the function code. {Boxer}\xspace introduces a small function deployment package size overhead resulting from the {Boxer}\xspace executable and interception library. These components account for 3.9 MB and 2.8 MB before compression, and 873 KB and 545 KB after compression ({Boxer}\xspace and interception library, respectively). In total, the package size increases by 1.4 MB, a reasonable overhead considering the current deployment package size limit of 50 MB. The event handler typically starts the networking service such that the newly invoked function joins the network. The address of the seed process, which is required for that process, can be passed as a function parameter in the invocation or read from some pre-defined place in the cloud. The execution service then starts the dynamic configuration scripts; depending on the selected start-up mode, this happens either immediately or after enough nodes have reached the barrier. The configuration script consults the coordination service for the current list of nodes in the network and their addresses and generates the runtime configuration of the application using the configuration template based on that list. When everything is set up, the script runs the application itself. \section{Benchmarking {Boxer}\xspace}\label{sec:microbenchmarks} To evaluate {Boxer}\xspace in practice, we start by characterizing its throughput and latency. \subsection{Throughput analysis}\label{eval:microbenchmarks} We summarize the networking characteristics we observe in AWS Lambda using {Boxer}\xspace. We show what a typical application running in AWS Lambda with {Boxer}\xspace can achieve in terms of TCP throughput and latency. Unless noted otherwise, all measurements were performed in AWS us-west-2 region with Lambda functions with 3008MB of memory and m4.large EC2 VM instances. {Boxer}\xspace enables TCP connectivity between AWS Lambda serverless functions and allows outside hosts, running outside of AWS Lambda to initiate TCP connections to serverless functions. As described in Section~\ref{sec:Boxer-net} this is achieved by traversing the NAT gateways between hosts. During development we have seen unfavorable network conditions when {Boxer}\xspace used different methods to establish connectivity. This is because the cloud applications we want to enable usually expect symmetric network properties between end-points. However, given that {Boxer}\xspace traverses an unknown network of middle-boxes that may impose arbitrary network filtering or throttling rules, we must verify the properties of the various scenarios the middle-boxes could differentiate, based on ordering of packets, timing or types of end-hosts. Thus, in the evaluation we distinguish six connection types; (1) Function-to-Function connections are established by {Boxer}\xspace between a pair of AWS Lambdas, (2) VM-to-Function are connections initiated by {Boxer}\xspace running in an EC2 VM to an AWS Lambda also running {Boxer}\xspace, (3) Function-to-VM are initiated by {Boxer}\xspace running in AWS Lambda to a EC2 VM also running {Boxer}\xspace, (4) Function-to-VM-native are connections initiated from AWS Lambda to EC2 VM without the use of {Boxer}\xspace (this scenario is allowed by default on AWS Lambda) as it is used a baseline, (5) VM-to-VM are connections established using {Boxer}\xspace between a pair of EC2 VMs and (6.) And as a baseline, VM-to-VM-native are vanilla connections established between a pair of EC2 VMs without {Boxer}\xspace. The evaluation also proves the versatility of {Boxer}\xspace and the many configurations in which it can be deployed. \begin{table*}[h!] \centering \small \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline \multirow{2}{*}{TCP connection type} & \multicolumn{5}{c|}{Round-trip latency of 1k byte message ($\mu s$)} & \multicolumn{5}{c|}{Connection establishment time for time-to-first byte ($\mu s$)} \\ \cline{2-11} & Mean & Median & Std. & Min & Max & Mean & Median & Std. & Min & Max \\ \hline Function-to-Function & 694.23 & 758.00 & 289.52 & 202.00 & 2769.00 & 2735.21 & 2625.00 & 10001.00 & 890.00 & 1033112.00\\ VM-to-Function & 547.84 & 457.00 & 194.29 & 244.00 & 2471.00 & 1981.38 & 2153.00 & 7909.74 & 821.00 & 1011171.00\\ Function-to-VM & 520.10 & 436.00 & 189.53 & 244.00 & 2372.00 & 2086.03 & 2239.00 & 6124.57 & 882.00 & 1015205.00\\ Function-to-VM-native & 622.53 & 686.00 & 175.57 & 241.00 & 2434.00 & 1378.56 & 1244.00 & 8027.04 & 382.00 & 1012935.00\\ VM-to-VM & 193.69 & 188.00 & 43.34 & 150.00 & 2165.00 & 1067.24 & 1034.00 & 166.09 & 894.00 & 7402.00\\ VM-to-VM-native & 197.62 & 194.00 & 28.18 & 153.00 & 1862.00 & 407.81 & 345.00 & 284.37 & 258.00 & 6416.00\\ \hline \end{tabular} \caption{Round-trip latency and connection establishment times for different TCP connection types.} \label{fig:latency} \label{fig:ttfb} \end{table*} We benchmark TCP throughput of different connection types between pairs of hosts (VMs or functions) by running unmodified iperf3\cite{iperf3} tool as a {Boxer}\xspace application (or natively for the native connection types). We instantiate 32 non-overlapping pairs of functions for a 60 seconds period for each scenario. In each pair, one function runs iperf3 in server mode, and one in client mode. The iperf3 client function connects to the listening server to begin the configured benchmark. When configured in the forward mode, the client side generates TCP traffic, when configured in the reverse mode, the server side generated the TCP traffic. We measure both to verify that the underlying network does not apply different network policies in different directions (we have seen this during development.) The achieved throughput reported on the receiving side at 1 second interval. Table~\ref{fig:throughput} presents throughput statistics for different connection scenarios. The sustained average throughput is 622Mbit/s in forward and reverse direction between a pair of AWS Lambda functions running {Boxer}\xspace (Function-to-Function). The variance level is low; the throughput is steady and sustained throughout the connection. In an additional experiment, we verified that the throughput can be sustained throughout the maximum lifetime of an AWS Lambda function (currently 15 minutes). The observed throughput between a pair of VMs is 429Mbit/s if {Boxer}\xspace is used or not, demonstrating that {Boxer}\xspace adds no data-plane overhead (after a connection is established). Throughput between functions and VMs is similar (410-428Mbit/s) and symmetric in all connection scenarios. In this case it is limited by the throughput of the VMs (m4.large) network. Table~\ref{fig:throughput_big} shows the same benchmarks but using a higher-bandwidth VM network (m5.large instances): the upper-bound on the throughput between AWS Lambda and VMs is the same as the throughput of the AWS Lambda internal network of 621Mbit/s (the experiment is performed in a different AWS region, and AWS Lambda function-to-function throughput is the same). The achieved TCP throughput between VMs and functions matches that observed by others ~\cite{Lambada} between functions and AWS services such as S3. To gain further insight about the bandwidth limits enforced, we conduct a load testing experiment by concurrently sending data from multiple functions to one. The server executing in one function listens for connections from clients executing in $N$ other functions. Each client establishes one TCP connection to the server and attempts to saturate the connection by sending data in a tight loop. At 1 second interval, the server records aggregate bytes received from all of the clients. We vary the number of clients from 1 to 256 functions and run each configuration over a 5 minute interval. Figure~\ref{fig:recvs_n} presents the averages of the aggregated received throughput at the server after removing the initial and final 30 seconds of the experiment measurements. The maximum observed throughput is 621.69Mbits/s with 1 sending function and minimum of 607.04Mbit/s at 128 sending functions. We attribute the degradation of less than 3\% to the overhead associated with handling multiple connections. This leads us to the conclusion that the ingress TCP bandwidth limits imposed on AWS Lambda functions do not depend on the number of sending function and that the available bandwidth is comparable to that of regular instances. The only resource parameter that can be adjusted for AWS Lambdas is the amount of memory, which then proportionally determines the vcpu share allocated to the function. To determine if the memory setting also influences network properties we varied memory allocated to functions and measured the achievable throughput. The throughput did not vary with memory settings of 512MB, 3008MB, and 10240MB. \subsection{Latency analysis} \begin{figure*}[t] \centering \begin{minipage}[t]{.3\textwidth} \centering \includegraphics[width=1.1\linewidth]{plots/recvs/recvs_bars.pdf} \caption{Comparison of aggregate receive throughput as number of sending functions varies. Maximum is 621.69Mbits/s at 1 sending function and minimum at 607.04Mbit/s at 128 sending functions, black lines represent standard deviation.} \label{fig:recvs_n} \end{minipage} \hspace{.5cm} \begin{minipage}[t]{.3\textwidth} \centering \includegraphics[width=1.1\linewidth]{plots/tcp_connect/tcp_connect.pdf} \caption{Empirical CDF of TCP connection establishment times. Time-to-first-byte (TTFB) for different connection types measured in microseconds between 32 distinct pairs of hosts establishing 1024 TCP connections each.} \label{fig:connect_ecdf} \end{minipage} \hspace{.5cm} \begin{minipage}[t]{.3\textwidth} \centering \includegraphics[width=1.1\linewidth]{plots/tcp_latency/tcp_latency.pdf} \caption{Empirical CDF of TCP round-trip latencies between 32 distinct nodes pairs (of VMs and AWS Lambda functions) echoing 1024 byte message, repeated for 6 connection scenarios.} \label{fig:latency_ecdf} \end{minipage} \end{figure*} We measure TCP latency of the six connection types described above. For each connection type, we instantiate 32 non-overlapping pairs of hosts (AWS Lambda functions or VMs). Each host executes a benchmarking program, and every pair opens a single TCP connection with Nagle's algorithm disabled by both hosts. The host assigned the client role implements a TCP echo client that initiates a connection to the assigned server host. After accepting the connection from the client, the server function initiates 128 rounds of ping-pong exchanges of a 1024-byte message and measures the total time, this measurement is repeated 1024 times. Table~\ref{fig:latency} list the summary statistics of observed round-trip latencies for different connection types and Figure~\ref{fig:latency_ecdf} shows the eCDF of the latencies measured. {Boxer}\xspace's TCP connections between pairs of functions have a mean round-trip latency of $694\mu s$. These connections also show significant variability in latencies, with a range between $202\mu s$ and $2769\mu s$, as can be seen in the eCDF plot. The main source of the observed variance is not due to the variance within each TCP connection but due to the variance between different TCP connections. This suggests that the network between different Lambda functions, from the latency perspective, is not uniform, and different instantiation patterns result in different latencies. This makes sense as the distance between the machines where functions are deployed plays a role in determining the latency. The latency measurements of the VM-to-VM-native connections, without the use of {Boxer}\xspace, and VM-to-VM connections that are established by {Boxer}\xspace show very close round-trip latencies of $198\mu s s$ and $194\mu s$, and follow a very similar distribution which can be seen in the eCDF plots of the two connection types. This further shows that there is no data plane overhead of {Boxer}\xspace provided connections once they are established. The observed latency of connections between Lambda functions and VMs have similar mean round-trip latencies ranging from $520\mu s$ to $622\mu s$, and all follow a similar distribution as can be seen in the eCDF plot. Perhaps surprising, the connections provided by {Boxer}\xspace have a slightly lower round-trip latency, which could be attributed to a different processing of the traffic by the network due to its different initial packet signature (we may investigate this further in the future.) We observe that the mean round-trip latency of {Boxer}\xspace's TCP connections between pairs of functions is 3.51$\times$ greater than latencies observed on AWS (m4.large) VM-to-VM native TCP connections. We consider this acceptable given the added functionality of {Boxer}\xspace. \subsection{Connection establishment} We measured the time required for application to have an established TCP connection for the six connection types described above. For each connection type we instantiate 32 host pairs (AWS VMs or Lambda functions depending on the scenario) and assign one host in each pair to be the client and the other to be the server. The time-to-first-byte(TTFB) measurement is recorded by the client. The client starts a timer, attempts to connect to its server and waits to read 1 byte of data from the server. Once it receives the 1 byte it stops the timer, records the duration and closes the connection. The server accepts connections and replies with 1 byte right after it accepts a new connection. This is repeated 1024 times by each pair, the measurements are in Table~\ref{fig:ttfb}. Unlike TCP throughput and latency, {Boxer}\xspace does have overhead compared to native TCP connection times. Mean time to establish a function to function connection is $2735\mu s$. The overhead can be seen in comparison of establishment time for VM-to-VM-native connections of $408\mu s$ vs VM-to-VM connections that are established by {Boxer}\xspace of $1067\mu s$. This is due to additional round trip necessary to contact the destination {Boxer}\xspace to request that the connection setup and wait for acknowledgement before proceeding locally, or in case of an error response to forward to the error to the application (for example in case when there is nothing listening at the destination address.) This additional signaling adds to the connection setup times, and can also be observed in the connection times between functions and VMs. However, given that there are no alternative native connections for function-to-function and VM-to-function connection types, we consider the latency acceptable. The eCDF of the TTFB times for the different scenarios in Figure~\ref{fig:connect_ecdf} shows that the comparable scenarios with and without {Boxer}\xspace connection setup follow similar distribution, but are shifted by additional delay of the round trip times. Function-to-function connections, and connection types that cross the AWS Lambda and EC2 networks have maximum TTFB times observed to be over 1 second, including a connection scenario that does not involve {Boxer}\xspace to establish TCP connections (Function-to-VM-native.) This suggests that there may be packet loss or network congestion in the network and it is not a direct consequence of the procedure {Boxer}\xspace uses to establish the connections. As it can be seed from the eCDF such extreme connection times are rare, in the case of Function-to-Function connection type, 99.9 quantile for TTFB is $20654\mu s$. Compared to communicating through storage, such latencies are acceptable, especially considering that in all of the above experiments performed, all connections were successfully established. \section{Short-lived data center} \label{eval:deathstar} To demonstrate the ability of {Boxer}\xspace to provide a short-lived datacenter, we run an unmodified, complex distributed application: the DeathStarBench benchmark \cite{DeathStarBench}. DeathStarBench is a suite of cloud microservice benchmarks deployed using container networks which mimic how real applications are deployed in production. We show that {Boxer}\xspace allows us to transparently deploy stateless microservices using AWS Lambda instead of AWS EC2 (VMs) or Fargarte (Containers). \begin{figure*}[t] \centering \begin{minipage}[t]{.33\textwidth} \includegraphics[keepaspectratio,width=\textwidth]{plots/deathstar/static-deployment-read.pdf} \centering a) Read Workload \end{minipage} \begin{minipage}[t]{.33\textwidth} \includegraphics[keepaspectratio,width=\textwidth]{plots/deathstar/static-deployment-write.pdf} \centering b) Write Workload \end{minipage} \begin{minipage}[t]{.33\textwidth} \includegraphics[keepaspectratio,width=\linewidth]{plots/deathstar/dynamic-deployment-write.pdf} \centering c) Burstable Write Workload \end{minipage} \caption{DeathStarBench experimental results for read and write workloads in a static deployment (left and center); burstable write workload in dynamic deployment (right).} \label{fig:eval_deathstar} \end{figure*} \subsection{Using {Boxer}\xspace with the DeathStarBench} We focus on DeathStarBench's \textit{socialNetwork} application, which offers a social network service to users and is organized using three microservice layers: i) front-end layer (implemented using an NGINX webserver); ii) logic layer (implemented using stateless Thrift services that communicate through RPCs); iii) caching and storage layer (implemented with MongoDB and Memcached instances). In \textit{socialNetwork}, user requests are received by the front-end layer (NGINX web server) and then routed to one of the services in the logic layer. Depending on the user request, the logic layer may perform one or multiple requests to the caching and storage layers. Since the logic layer is stateless (i.e., it contains no internal persistent state), it can be deployed on AWS Lambda. However, since functions cannot receive connections from external components, (e.g., the front-end NGINX laye in this case), {Boxer}\xspace is required to establish such connections. We did not have to make any modifications to the application code to deploy DeathStarBench on AWS Lambda with {Boxer}\xspace. The benchmark was only modified to i) use names instead of fixed local IPs (for example, replace \texttt{127.0.0.1} by \texttt{nginx-thrift}), and ii) wrap the invocation of all components of the front-end and logic layers with the {Boxer}\xspace binary (for example, replace \texttt{SocialGraphService} with \texttt{{Boxer}\xspace~-s <seed>} \texttt{-n <number of components>} \texttt{SocialGraphService}). Wrapping the invocation of the front-end and logic layer components with {Boxer}\xspace ensures that the creation of new connections goes through the {Boxer}\xspace network, allowing not only the front-end layer to establish connections to services running in the logic layer (VM to Lambda), but also components in the logic layer to establish connections between them (Lambda to Lambda). \subsection{Methodology} To evaluate the performance impact of moving the logic layer to Lambda using {Boxer}\xspace, we use three types of deployments. First, an \textit{EC2-only} deployment in which all components are deployed as VMs in EC2 is used as our baseline. Second, an EC2 VM-only deployment in which all components are still deployed as VMs in EC2 but the components of both the front-end and logic layers use {Boxer}\xspace. This deployment, \textit{EC2-only (w/ {Boxer}\xspace)}, is used to measure the performance overhead of using {Boxer}\xspace. Third, a mixed deployment where the front-end, and caching and storage layers are deployed as VMs, and the logic layer is deployed using Lambdas, \textit{EC2 + Lambda (w/ {Boxer}\xspace)}. To measure the throughput and latency of the end-to-end system we use two workloads included in the DeathStarBench suite. A read workload that issues requests to read a user timeline in the social network, and a write workload that creates follow relationships between users. Both workloads are generated using the \texttt{wrk} \cite{wrk} tool which builds and issues requests to the front-end layer. The performance of both workloads (read and write) is reported separately as each workload stresses the network and {Boxer}\xspace in a different way. The read workload mostly transfers data from the caching and storage layer (VMs), to the logic layer (VMs or Lambdas), and then to the front-end layer (VMs). The write workload operates in the opposite direction. All experiments in this section were conducted in AWS Ohio (us-east-2) region. All VMs use a base Amazon Linux 2 \cite{amazon-linux}. For front-end, and caching and storage layers, we use t3a.micro instances due to the memory requirements of the services included in these layers. For logic layer, when deployed in VMs, we use t3a.nano instances. Lambdas are deployed using the Python3.7 runtime (which is used to launch {Boxer}\xspace and the service binaries). Each Lambda is given 2048 MB of memory size (we experimentally determined that in us-east-2, the performance of a 2048 MB Lambda is similar to a t3a.nano VM instance). \subsection{Stateless Services in Lambdas} We analyze the throughput and latency impact of using {Boxer}\xspace to deploy the DeathStarBench social Network application and move the application logic layer to AWS Lambda. Figure \ref{fig:eval_deathstar} shows the results for both read and write workloads across the three different types of deployments. For each workload, we collect the average throughput and 90th percentile latency with an increasing load in the system. Results show that {Boxer}\xspace introduces only a low overhead. For the read workload, the EC2-only deployment becomes saturated at 3270 ops/s while the EC2-only (w/ {Boxer}\xspace) becomes saturated at 3070 ops/s. For the same data points, the 90p latency of a single request for the EC2-only and EC2-only (w/ {Boxer}\xspace) deployments are 3.18 ms and 5.07 ms, respectively. Note that these latencies are measured end-to-end and therefore include multiple internal microservice to microservice requests. The write workload demonstrates similar results. The EC2-only and EC2-only (w/ {Boxer}\xspace) deployments become saturated at 1411 ops/s and 1294 ops/s, with latencies of 7.07 ms and 7.56 ms, respectively. We use a similar analysis to measure the overhead of launching the logic layer services in AWS Lambda by comparing the EC2-only (w/ {Boxer}\xspace) and EC2 + Lambda (w/ {Boxer}\xspace) deployments. Figure~\ref{fig:eval_deathstar} shows that for the read workload, the EC2 + Lambda (w/ {Boxer}\xspace) deployment saturates at a 3556 ops/s with a 90p latency of 7 ms. For the write workload, the same deployment saturates at 1189 ops/s and with a 90p latency of 4.55 ms. We conclude that using {Boxer}\xspace incurs a small performance overhead arising from the interception and management of connections between the multiple services. Moving services to Lambda also incurs a small overhead due to the different way CPU and Network are allocated to VMs and lambdas. One could further increase the memory budget given to lambdas to also increase their computational power and thus close the performance gap between EC2-only (w/ {Boxer}\xspace) and EC2 + Lambda (w/ {Boxer}\xspace). \section{Dynamic Load Adaptation}\label{sec:dynamic} We now show that {Boxer}\xspace enables us to increase the scaling factor of stateless microservices running on VMs by leveraging the elasticity of serverless platforms to adapt to bursty loads. While in the previous experiments we deployed the logic layer of the DeathStarBench socialNetwork application entirely on Lambda or EC2, in this section we start by deploying all logic layer services on VMs. When the load increases, additional logic layer services are allocated to handle the increased load either on VMs or Lambdas. We compare two deployments: i) VM-based deployment that allocates extra VMs to handle increased load; ii) VM-based deployment that allocates lambdas to accommodate increased load. Our goal is to study the ability to adapt to a load burst. Figure \ref{fig:eval_deathstar} (right-hand side) presents a throughput trace of both deployments. Throughput is measured using wrk \cite{wrk} by looking at how many requests the front-end layer can handle per second. After 30 seconds (dashed vertical line), a new set of VMs or lambdas are deployed to handle the increased load. After requesting a new set of VMs to join the logic layer (\textit{t=30s}), the system throughput starts increasing after 40 seconds (\textit{t=70s}) and only stabilizes (completely absorbs the burst) after 75 seconds (\textit{t=105s}). There are several reasons to this. First, VM launch time is approximately 30 seconds (i.e., until the VM is connected to the network). After the VM launches, we also register its IP in our nameserver (we use DNS round-robin to distribute the load). At this point, when NGINX (front-end layer) needs to open a new connection to serve a new client, it will try to resolve the logic layer component name through the nameserver. Because load distribution is performed per-connection and connections are kept open to serve multiple requests, adapting to a burst request takes dozens of seconds. The time interval between nodes becoming available and being fully utilized by NGINX could be reduced by forcing NGINX to recycle connections more frequently. This would, however, add overhead for creating more connections. Using Lambdas to absorb load bursts can significantly reduce the time to add new logic layer services, and therefore, reduce the time to reach a steady throughput using all new nodes. Note that, although lambdas take less than one second to launch (compared to approximately 30 seconds for VMs), throughput starts increasing 8 seconds after the new lambdas are launched (\textit{t=38s}), and only stabilizes after 39 seconds (\textit{t=69s}). In summary, using Lambda to accommodate bursts reduces the time for new components start receiving requests by 5$\times$, and reduces the time to fully accommodate a burst by 1.9$\times$. \section{Discussion} We have shown that supporting direct networking among functions enables running off-the-shelf distributed applications, which were designed for traditional Linux execution environments, on serverless platforms. By decoupling the serverless resource management model from its event-driven programming model, {Boxer}\xspace enables cloud users to benefit from the resource elasticity of serverless platforms without having to change the programming model of their applications. The ability to run applications seamlessly between VM and serverless platforms allows users to leverage serverless platforms during bursty load periods and benefit from the lower cost per unit time of VM resources during steady load periods. \subsection{Opportunities}\label{discuss:opportunities} Enabling direct networking among functions opens up many opportunities to address other key limitations of serverless platforms. For example, to overcome limitations on function execution time, a function that is about to reach the maximum supported execution time on the platform could spawn a follower function and send its state to the follower directly to transparently continue execution. For instance, Infinicache~\cite{InfiniCache} refreshes functions that cache data by having a function call itself and send the cached data to its newly spawned clone. With {Boxer}\xspace, state can be sent through a direct communication channel, without relying on a proxy. Workflows can be programmed into functions so that a sequence of steps can execute automatically with functions spawning the next step and passing the necessary data without having to rely on an external orchestrator \cite{TxnOnServerless21,WorkflowOnServerless20}. In addition, scatter-gather interactions become possible and more efficient. This would considerably simplify running applications such as those considered in ExCamera~\cite{ExCamera} and gg~\cite{gg}, or removing a variety of work-arounds built to bypass the lack of function-to-function communication to implement stateful functions \cite{Cloudburst20,StatefulFunctions19}. It also enables implementing truly distributed data processing operators such as joins instead of using today's contrived solutions which need to communicate through storage~\cite{starling,Lambada}. Similar ideas apply to ML over serverless, which today is expensive due to the lack of communication \cite{ServerlessML21}. {Boxer}\xspace can also be used to implement a form of work stealing among functions of a serverless applications, since functions could communicate directly with one another to request additional work if they are idle. This mechanism adds another dimension of elasticity to serverless computing, which is particular useful when the amount of work to be done is not easily determined upfront or may exhibit skew. Another key limitation of serverless platforms is that they do not allow users to optimize the placement of functions to improve performance~\cite{Berkeley-CACM}. By supporting direct networking between functions, cloud providers can get a complete picture of the communication patterns of an application and use this information to optimize function placement~\cite{sonic}. Understanding the communication patterns of serverless applications is difficult for providers to do today as functions are forced to communicate through remote storage systems or proxies. While we have shown how users can circumvent the networking limitations in today's serverless platforms with {Boxer}\xspace, we hope that cloud providers will natively provide networking abstractions on serverless platforms. For example, providers could extend the serverless programming model to include communication collectives, which would allow them to optimize function placement policies for different communication patterns. \subsection{Current limitations}\label{discuss:limitations} {Boxer}\xspace raises a number of issues that we intend to address in the future: \textbf{{Boxer}\xspace control network topology:} Currently {Boxer}\xspace establishes a fully connected TCP control topology between all participating {Boxer}\xspace nodes. As the scale of deployment increase, this will likely be one of the bottlenecks. We are investigating solutions such as indirection through other {Boxer}\xspace nodes to route control messages, or using a datagram protocol to conserve the file descriptors. \textbf{Non-blocking I/O:} {Boxer}\xspace's transparent interposition layer does not support all non-blocking socket operations. Currently {Boxer}\xspace will block a calling thread for the duration of connect call, which can degrade performance of applications and can break the semantics of some. \textbf{Lambda execution environment:} Applications running in Lambda do not have access to the same exact environment that would be available in an EC2 VM. For example, the local file system might be read-only, there might be only one network device with a local IP, etc. {Boxer}\xspace can circumvent these limitation and emulate an environment similar to the one available in VMs by further interception of the libc functions used to query local interfaces, local files, etc. \textbf{Multiple lambdas behind a single NAT address:} {Boxer}\xspace~currently does not support multiple lambdas deployed behind the same NAT address. When this happens, a single external IP address is visible and {Boxer}\xspace~cannot distinguish between the two nodes. To support this scenario transparently to the user application, {Boxer}\xspace~needs to virtualize the network address space. \subsection{Truly general purpose short-lived datacenters}\label{discuss:general-purpose} Besides networking, other limitations that serverless platforms impose today include limited resources per function invocation (e.g., up to 10 GB of memory and 6 vCPUs in AWS Lambda), limited execution time for each function (e.g., 15 minutes in AWS Lambda), and the lack of support for heterogeneous hardware such as GPUs. Cloud providers have been steadily increasing resource limits and function execution time limits. We expect this trend to continue as serverless computing becomes increasingly popular for a broad range of applications. In particular, supporting higher resource limits per function gives developers the option to scale \textit{up} in addition to scale \textit{out} their application to achieve higher performance. Both of these scaling dimensions are important for general datacenter computing. Adding support for running serverless functions on heterogeneous hardware resources, such as accelerators, will also become increasingly important as applications such as machine learning jobs, which rely on GPUs and ASICs, can also benefit from the elasticity, fine-grain billing, and higher level of abstraction to the cloud that serverless computing offers. \section{Conclusion} We presented {Boxer}\xspace, a system that transparently provides direct communication between serverless functions. {Boxer}\xspace uses a NAT traversal mechanism to enable serverless functions to accept incoming traffic from external sources. By leveraging dynamic linking to intercept function calls, {Boxer}\xspace provides direct networking functionality for serverless functions through the standard socket networking API and requires no modifications to Linux TCP-based datacenter applications. With {Boxer}\xspace, latency sensitive applications such as microservices can be run unmodified on AWS Lambda. Our system presents a major step towards treating serverless platforms as short-lived, instant, general purpose datacenters and allows a broader range of applications to benefit from the elasticity, fine-grain billing, and high level of abstraction to the cloud that serverless platforms offer. \printbibliography \end{document} \endinput
{'timestamp': '2022-02-15T02:42:38', 'yymm': '2202', 'arxiv_id': '2202.06646', 'language': 'en', 'url': 'https://arxiv.org/abs/2202.06646'}
arxiv
\section{Introduction}\label{sec:intro} \begin{figure}[h] \centering \includegraphics[width=0.95\linewidth]{fig1.pdf} \caption{\textbf{Overview of DAPL.} We introduce the prompt tuning framework for domain adaptation. Top: conventional domain adaptation methods aim to remove domain-specific information via domain alignment or adversarial loss. This could lead to distorted feature representation when the manifold structures underlying the data distributions are complex~\cite{cai2019learning}. Bottom: Our method preserves domain information and tunes a prompt for each domain. Our model learns with a contrastive objective.} \label{fig:1} \vspace{-4mm} \end{figure} Deep Learning has achieved great success in recent years~\cite{he2016deep,huang2019convolutional} with the help of large-scale annotated datasets~\cite{deng2009imagenet}. Since annotating large-scale datasets is costly and time-consuming, researchers propose to train a model for an unlabeled domain by leveraging a related domain which is well-annotated. However, a model (\textit{e.g.}, a neural network) trained on an annotated domain may not generalize well to an unlabeled domain due to \textit{distribution shift}~\cite{DA_theory1, DA_theory2, DA_theory3}. The problem of Unsupervised Domain Adaptation (UDA) \cite{pan2009survey,ganin2015unsupervised,long2015learning} has been proposed to study the transferring of knowledge under such domain shift. Conventional UDA methods mainly resort to learning domain-invariant representations by aligning source and target domains. With similar features distribution led by domain alignment, the classifier trained on the source domain can be directly applied to the target data (\cref{fig:1}, top). One typical line of such methods is based on statistical discrepancy minimization \cite{tzeng2014deep,long2015learning, CMD_ICLR2017, long2017deep}, Maximum Mean Discrepancy (MMD)~\cite{long2015learning} and Central Moment Discrepancy (CMD) \cite{CMD_ICLR2017}. Another typical line learns domain-invariant features via adversarial training by applying domain discriminators \cite{GAN_NIPS14,long2017conditional,JADA_MM19,lu2020stochastic}. Such methods confuse domain discriminators to reduce the difference between source and target domains in the feature space. However, reducing the discrepancy by aligning domains could lead to a loss of semantic information~\cite{tang2020unsupervised,DWL_CVPR21}. Such loss comes from the entangled nature of semantic and domain information when the manifold structures of the data distributions are complex~\cite{cai2019learning}. To remedy this, some recent UDA methods \cite{li2018domain,BSP_ICML2019, SPL_AAAI20, tang2020unsupervised} advocate preserving the semantic information to maintain the class discriminability. However, these methods suffer from a subtle trade-off between \textit{domain alignment} and \textit{preserving semantic features}\cite{cai2019learning,stojanov2021domain,DWL_CVPR21} as two objectives could be adversarial. Learning disentangled semantic and domain representation could be an alternative since domain alignment could be discarded. \begin{figure*} \centering \includegraphics[width=0.95\linewidth]{fig2.pdf} \caption{\textbf{Example prompt structure.} Our proposed prompt consists of three parts: (a) Domain-specific prompt; (b) Domain-agnostic prompt; (c) Class label. The first two parts are continuous and learned from data. The words shown here are for illustrative purposes.} \label{fig:2} \vspace{-4mm} \end{figure*} To learn disentangled \textit{semantic} and \textit{domain} representation, we introduce the prompt learning method\cite{liu2021gpt,liu2021pre,hu2021knowledgeable} to UDA, by learning a representation in a continuous label space. \cref{fig:2} illustrates our prompt design. The prompt consists of three parts: domain-agnostic context, domain-specific context, and class label~(token). Each image corresponds to a ground truth class through the class label of prompt. For example, an image that shows ``an art work of a dog'' could correspond to the prompt ``{\textcolor{LimeGreen}{An image of a}} {\textcolor{cyan}{painting}} {\textcolor{Melon}{Dog}}''. The domain-agnostic context represents general task information and is shared among all images. The domain-specific context represents domain information and is shared in each domain. The class label distinguishes different categories. Such prompt learning method allows us to learn domain and category disentangled representation and avoids a loss of semantic information~\cite{tang2020unsupervised}. We apply a contrastive objective for training~(\cref{fig:1}, bottom). An image and a text form a pair of positive examples only when the domain and category of them are matched respectively, while any other cases are negative examples. By contrasting the representation of $X_S$ and $y$, the image and text representation of the ``sketch" and ``dogs" are aligned in the feature space, respectively. Further, the text representation of ``sketch" is pushed away from the ``photo" domain by contrasting $X_T$ and $y$. More details are discussed in \cref{sec:disentangle}. Hence, the representation of domain and category are aligned respectively. We adopt \textit{Contrastive Language Image Pre-training}~(CLIP)~\cite{radford2021learning} as our backbone to facilitate prompt learning and contrastive learning. Extensive experiments on two classic cross-domain benchmarks demonstrate that our method consistently yields promising performance, \textit{e.g.}, we achieve an \textit{sota} performance of $74.5\%/86.9\%$ on Office-Home\cite{Office-Home} and VisDA-2017\cite{VisDA-2017}. To summarize, the contributions of our work are three-fold: \begin{itemize} \item We propose Domain Adaptation via Prompt Learning~(\textbf{DAPL}) for unsupervised domain adaptation. To the best of our knowledge, we are the first to apply prompt learning in unsupervised domain adaptation. \item We propose to use domain-specific context in the prompt. Hence, we do not have to align domains at the cost of losing semantic information. Our method could learn continuous semantic representations for each category and domain. \item The proposed DAPL has achieved state-of-the-art performance on Office-Home and VisDA-2017 dataset, improving the accuracy by $2.5\%/2.5\%$ over the strong baseline CLIP. \end{itemize} \section{Related Work} \noindent\textbf{Unsupervised Domain Adaptation.} Unsupervised Domain Adaptation (UDA) adapts a model trained on a labeled source domain to an unlabeled target domain. Quite a few UDA methods learn domain-invariant features via minimizing the discrepancy between domains~\cite{long2015learning, long2017deep, sun2016deep}. For example, Tzeng \textit{et~al.} \cite{tzeng2014deep} introduce an adaptation layer and a domain confusion loss to learn semantically meaningful and domain-invariant representations. DAN \cite{long2015learning} aligns source and target domains by minimizing the maximum mean discrepancy (MMD) on task-specific layers. Sun \textit{et~al.} \cite{sun2016deep} propose CORAL that aligns the second-order statistics of the source and target domain with a linear projection. Inspired by generative adversarial networks (GANs) \cite{GAN_NIPS14}, another family of UDA methods apply adversarial learning to obtain domain-invariant representations \cite{ganin2015unsupervised, long2017conditional, JADA_MM19}. For example, DANN \cite{ganin2015unsupervised} and CDAN \cite{long2017conditional} introduce a domain discriminator to distinguish source samples from target ones, while the feature extractor tries to generate domain-invariant features in order to fool the domain discriminator. Differently, MCD \cite{saito2018maximum} plays the minimax game between a feature encoder and two classifiers, where two classifiers try to maximize their prediction discrepancy and the feature extractor aims to minimize that discrepancy. Despite the success achieved by domain alignment, class discrimination also loses due to the distorted structure of semantic features~\cite{cai2019learning,tang2020unsupervised}. How to maintain class discriminability has also been considered by recent UDA works \cite{tang2020unsupervised, TPN_CVPR2019,li2020domain, ETD_CVPR20, BNM_CVPR2020, DWL_CVPR21}. To name a few, Li \textit{et al.} \cite{ETD_CVPR20} build attention-aware transport distance to learn discriminant features, along with an entropy-based regularization. Cui \textit{et al.} \cite{BNM_CVPR2020} propose to enforce the prediction discriminability and diversity via batch nuclear-norm maximization (BNM). However, these methods have to make trade-offs between aligning domains and preserving class discriminability. Compared with these methods, our method applies prompt learning to learn domain-specific visual concepts (\textit{i.e.}, the transparent background for ``product" domain) for each domain. \noindent \textbf{Prompt Learning.} Prompt learning, which is first introduced by Petroni~\itshape{et~al.}\upshape~\cite{ DBLP:conf/emnlp/PetroniRRLBWM19}, has been widely studied in NLP during these years~\cite{DBLP:journals/corr/abs-2107-13586,DBLP:conf/emnlp/ShinRLWS20,DBLP:journals/corr/abs-2104-08691,DBLP:conf/acl/LiL20,DBLP:journals/tacl/JiangXAN20,DBLP:conf/emnlp/PetroniRRLBWM19}. Prompting means prepending instructions to the input and pre-training the language model so that the downstream tasks can be promoted. Petroni~\itshape{et~al.}\upshape~\cite{ DBLP:conf/emnlp/PetroniRRLBWM19} and P{\"{o}}rner~\itshape{et~al.}\upshape~\cite{ DBLP:journals/corr/abs-1911-03681} use manually defined prompts to improve the performance of language models. However, manually created prompts may be sub-optimal or even inappropriate, which might fail to provide accurate instruction. To obtain more accurate estimation of the knowledge contained in language models, several methods have been proposed to automatically explore optimal prompts~\cite{DBLP:journals/tacl/JiangXAN20, DBLP:conf/emnlp/ShinRLWS20,DBLP:conf/naacl/ZhongFC21}. More recently, prompts have been integrated into vision-language models to learn generic visual representations~\cite{radford2021learning,DBLP:conf/icml/JiaYXCPPLSLD21,DBLP:journals/corr/abs-2109-01134}. Among them, ALIGN~\cite{DBLP:conf/icml/JiaYXCPPLSLD21} and CLIP~\cite{radford2021learning} are most pioneering ones. CLIP~\cite{radford2021learning} learns state-of-the-art visual representations from natural language supervision by pre-training a vision language model on 400 million image-text pairs. Furthermore, Zhou~\itshape{et~al.}\upshape~\cite{ DBLP:journals/corr/abs-2109-01134} use continuous representations to model prompts so that the task-relevant prompts can be automatically learned, namely CoOp. However, CoOp only develops a domain-agnostic prompt for visual recognition tasks while our work proposes to learn both domain-agnostic and domain-specific prompts to deal with distribution shift in UDA. \section{Method} Given a set of labeled source images $\mathcal{D}_s = \{({\mathbf{x}}_i^s, y_i^s)\}_{i=1}^{N_s}$ and a set of unlabeled target images $\mathcal{D}_u = \{({\mathbf{x}}_i^u)\}_{i=1}^{N_u}$, we adopt a model trained from a source domain to a target domain. Here, $N_s$ and $N_u$ denote the scale of source domain dataset ${\mathcal{D}}_s$ and target domain dataset ${\mathcal{D}}_u$ respectively. These two domains share the same $K$ categories. \subsection{Preliminaries} \label{sec:p} \begin{figure*} \centering \includegraphics[width=0.90\linewidth]{fig3.pdf} \caption{\textbf{Domain Adaptation via Prompt Learning (DAPL):} (a) DAPL trains the learnable context variables: domain-agnostic context variables and domain-specific context variables, and [CLASS] token which are combined and encoded by a text encoder. (b) An image encoder encodes images from different domains. (c) Next, cosine similarity between text and image features is computed and the positive pairs (with matched domain and class) are encouraged to align. The classification probability are defined in \cref{eq:pro} and a cross-entropy loss is applied between the image feature and the ground truth class to train the networks. } \label{fig:3}\vspace{-3mm} \end{figure*} We adopt CLIP~\cite{radford2021learning} as our backbone. Our model is comprised of an image encoder $f(\cdot)$ and a text encoder $g(\cdot)$. The image encoder can be a ResNet~\cite{he2016deep} or Vision Transformer (ViT)~\cite{dosovitskiy2020image}, and the text encoder is a Transformer~\cite{vaswani2017attention}. The image and text input can be directly transformed from high dimensional space into a low dimensional feature space by the encoders. CLIP~\cite{radford2021learning} is trained with image-text pairs in a contrastive manner. Each input text describes a category in the format of ``a photo of a [CLASS]"~([\textrm{CLASS}] is the class token). A positive pair is an image ${\mathbf{x}}_i$ with its corresponding text ${\mathbf{t}}_i$ describing the category of ${\mathbf{x}}_i$. A negative pair is an image ${\mathbf{x}}_i$ with an irrelevant description ${\mathbf{t}}_j, j\neq i$ in the mini-batch. The training objective is to maximize the cosine similarity of positive pairs and minimize the cosine similarity of negative pairs. The contrastive learning objective aligns the image and text representation in the same feature space. With the aligned features, the model is capable of performing zero-shot inference. By forwarding $K$ category descriptions, an image ${\mathbf{x}}$ would belong to the category $\hat y_i$ with the largest similarity: \begin{align} & P(\hat y=i|{\mathbf{x}}) = \frac{\exp (\langle g({\mathbf{t}}_i), f({\mathbf{x}})\rangle /T)}{\sum_{k=1}^K \exp (\langle g({\mathbf{t}}_k), f({\mathbf{x}})\rangle /T)} \label{eq:1},\\ & \hat y_i = \arg\max_{k} P(\hat y_i = k), \end{align} where $T$ is a user-defined hyper-parameter (temperature) and $\langle \cdot, \cdot\rangle $ denotes the cosine similarity. The input text described above is a manually designed prompt comprised of a sequence of discrete tokens. The manually designed prompts are transformed into fixed vectors in the word embedding space. Since these vectors could be sub-optimal for the representation of categories, we could optimize the continuous embedding of the tokens. The continuous representation ${\mathbf{t}}_k$ allows for a more precise description of semantic features which are important to the context variable learning. Existing prompt learning methods adopt a domain-agnostic style that context is shared across all domains and all categories. It follows a unified style: \begin{equation} {\mathbf{t}}_k = [{\mathbf{v}}]_1[{\mathbf{v}}]_2 \ldots [{\mathbf{v}}]_{M_1} [\mathrm{CLASS}]_k, \label{eq:unified} \end{equation} where $[{\mathbf{v}}]_{m_1}, m_1 \in \{1, 2, \ldots, M_1\}$ is a vector with the same dimension as the word embedding, and $M_1$ is the number of context tokens applied in the prompt. \subsection{Domain Adaptation via Prompt Learning}\label{sec:dapl} Since the domain-agnostic context alone cannot deal with the distribution shift between domains, we propose to use Domain-Specific Context~(DSC) to capture unique features of each domain. To be specific, our proposed prompt contains two counterparts, a domain-agnostic context and a domain-specific context. We use $[{\mathbf{d}}]_{m_2}^d, m_2 \in \{1, 2, \ldots, M_2\}$ to denote domain-specific tokens, which have the same dimension as word embeddings. The domain-specific context is shared among all categories but specially designed for each domain $[{\mathbf{d}}]_i^s \neq [{\mathbf{d}}]_j^u, i,j \in \{1, 2, \ldots, M_2\}$. The number of domain-specific tokens is denoted by $M_2$. Domain indicator denotes the source and target domains $ d\in \{s, u\}$. The overall prompt is defined in the following format: \begin{equation} {\mathbf{t}}^d_k = [{\mathbf{v}}]_1[{\mathbf{v}}]_2 \ldots [{\mathbf{v}}]_{M_1} [{\mathbf{d}}]^d_1 [{\mathbf{d}}]^d_2 \ldots [{\mathbf{d}}]^d_{M_2} [\mathrm{CLASS}]_k. \label{eq:3} \end{equation} When $[\mathrm{CLASS}]$ token in the text feature space could not fully model the difference among each class, the domain-agnostic context could follow a class-specific style \cite{radford2021learning} denoted by class-specific context. Each class could be initialized with different tokens: \begin{equation} {\mathbf{t}}^d_k = [{\mathbf{v}}]_1^k[{\mathbf{v}}]_2^k \ldots [{\mathbf{v}}]_{M_1}^k [{\mathbf{d}}]^d_1 [{\mathbf{d}}]^d_2 \ldots [{\mathbf{d}}]^d_{M_2} [\mathrm{CLASS}]_k. \label{eq:cl} \end{equation} The trainable class-specific context could learn a more fine-grained representation than only $[\mathrm{CLASS}]$ token~\cite{DBLP:journals/corr/abs-2109-01134}. Our main results are based on class-specific context and domain-specific context as \cref{eq:cl}. We have $2K$ categories since we apply different prompts ${\mathbf{t}}_k^s, {\mathbf{t}}^u_k$ for the source and the target domain respectively. Given a set of training samples $\{{\mathbf{x}}_i^s, y_i^s\}_{i=1}^{N_s}$ of the source domain, we could obtain the probability that a training sample belongs to the $k$-th category: \begin{equation} P(\hat y_i^s=k|{\mathbf{x}}_i^s) = \frac{\exp (\langle g({\mathbf{t}}_k^s), f({\mathbf{x}}_i^s)\rangle /T)}{\sum_{d \in \{s,u\}}\sum_{j=1}^K \exp (\langle g({\mathbf{t}}_j^d), f({\mathbf{x}}_i^s)\rangle /T)}. \label{eq:pro} \end{equation} With the probability of the image ${\mathbf{x}}_i$ belonging to class $k$, we minimize the standard cross-entropy loss given ground truth label $y_i^s$. The loss is computed as follow: \begin{equation}\vspace{-1mm} {\mathcal{L}}_s = - \frac{1}{N_s} \sum_{i = 1}^{N_s} \log P(\hat y_i^s = y_i^s). \end{equation}\vspace{-1mm} \begin{figure} \centering \includegraphics[width=0.9\linewidth]{fig4.pdf} \vspace{-3mm} \caption{\textbf{Contrastive learning helps transfer learning.} (a) We assume that visual representation implicitly contains two parts: domain information ($\mathbf{z}_d$) and class information ($\mathbf{z}_c$). Similarly, the language feature contains two parts: domain information ($\mathbf{p}_d$) and class information ($\mathbf{p}_c$). By minimizing the distance between positive pairs (shown in green) and maximizing the distance between negative pairs (shown in red), we show that the domain information and class information can be disentangled. Such disentangled representations can be applied for transfer learning. See~\cref{sec:disentangle} for details. } \label{fig:contrastive_transfer} \vspace{-4mm} \end{figure} To further exploit the unlabeled data, We generate pseudo labels on the target domain. We choose from $K$ classes with maximum predicted probability as the pseudo label $y^u$ of the training data ${\mathbf{x}}^u$: \begin{align} y^{u} = \arg\max_{k} P(\hat y^u = k| {\mathbf{x}}^u), \ k = \{1, 2, \ldots, K\}. \end{align} \vspace{-1mm}We only generate pseudo labels for unlabeled data whose maximum prediction probability is larger than a fixed threshold $\tau$ for the quality of pseudo labels. We make use of the zero-shot inference ability of CLIP to generate pseudo labels as described in \cref{sec:p}. We train the prompt of target domain ${\mathbf{t}}_k^u$ with these unlabeled images and their pseudo labels with the contrastive objective \cref{eq:pro}: \vspace{-1mm} \begin{equation} {\mathcal{L}}_{u}\!\! = \!-\frac{1}{N_u}\!\! \sum_{i = 1}^{N_u}\!\mathbb{I}\{P(\hat y^u_i\! = y^{u}_i| {\mathbf{x}}^u_i) \!\!\ge\!\! \tau \!\}\! \log\! P(\hat y^u_i\!\! =\! y^{u}_i| {\mathbf{x}}^u_i),\!\!\! \vspace{-1mm} \end{equation} where $\mathbb{I}\{\cdot\}$ is an indicator function. Overall, our proposed \textbf{Domain Adaptation via Prompt Learning~(DAPL)} method could be trained in an end-to-end manner with a total contrastive loss: \vspace{-1mm} \begin{equation} {\mathcal{L}} = {\mathcal{L}}_s({\mathcal{D}}^s) + {\mathcal{L}}_{u}({\mathcal{D}}^u).\label{eq:totalloss} \vspace{-1mm} \end{equation} \vspace{-1mm}Existing domain adaptation methods train their classifier on the source domain to learn a conditional probability distribution $P(y|{\mathbf{x}}^s)$. By aligning the marginal distribution of $P(f({\mathbf{x}}^s))$ and $P(f({\mathbf{x}}^u))$ they could directly make use of the conditional probability for inference on the target domain. When the conditional probability distribution varies $P(y|{\mathbf{x}}^s) \neq P(y|{\mathbf{x}}^u)$, these methods could suffer the risk of performance drop~\cite{wang2020transfer}. Our method does not align marginal distributions but learns two conditional probability distributions $P(y|{\mathbf{x}}^s)$ and $P(y|{\mathbf{x}}^u)$ by learning two sets of prompts ${\mathbf{t}}_k^s, {\mathbf{t}}^u_k, k \in \{1, 2, \ldots, K\}$. Hence, our method could deal with both conditional distribution shift and marginal distribution shift. The overview of DAPL is shown in \cref{fig:3}. \vspace{-2mm} \subsection{Disentanglement by Contrastive Learning}\label{sec:disentangle} We adopt a contrastive loss ${\mathcal{L}}$ as the optimization objective. Here, we provide an intuitive explanation for why this objective achieves the desired goal: the visual encoder and text encoder each encodes the input into two disentangled latent representations, separating domain information from the intrinsic class information. Only when both the class and the domain information are aligned, the distance between the textual feature and the image feature is minimized. By minimizing the distance between such positive pairs (maximizing the similarity), the probability of the correct label is maximized (see \cref{eq:pro}). First, we assume that the visual representation $f({\mathbf{x}}_i^d)$ contains two parts: domain information of domain $d$ and the intrinsic class information of class $c$ (\cref{fig:contrastive_transfer} (a), ${\mathbf{z}}_d$ and ${\mathbf{z}}_c$). Similarly, the language embedding $g({\mathbf{t}}_k^d)$ contains the same two parts: domain information of domain $d$ and the class information of class $c$ (\cref{fig:contrastive_transfer} (a), ${\mathbf{p}}_d$ and ${\mathbf{p}}_c$). Next, we show that such domain information and class information can be disentangled by optimizing the contrastive objective. Figure~\ref{fig:contrastive_transfer} (b) provides an illustrative example. In this example, there are four image-text pairs with two classes (\textit{cat}, \textit{dog}) and two domains (\textit{photo}, \textit{sketch}). Take the image $I_1$, prompts $P_{1}$ and $P_{2}$ as an example. The image can form a positive pair with prompt $P_1$ and a negative pair with prompt $P_{2}$. By optimizing the contrastive objective, the distance between image feature $f(I_1)$ and the sentence embedding of $g(P_1)$ is minimized, whereas the distance between image feature $f(I_1)$ and the sentence embedding of $g(P_2)$ is maximized. We claim that this forces the class information of \textit{dog} disentangled from the domain representation of \textit{photo} or \textit{sketch}. Suppose on the contrary that the domain information and the class information are still \textit{entangled} in the representation, \textit{i.e.} the domain representation (${\mathbf{p}}_d^1$ and ${\mathbf{p}}_d^2$) contains the class information of \textit{dog}. In this case, $I_1$ and $P_2$ still matches and the distance between $f(I_1)$ and $g(P_2)$ could be further maximized by removing this class information. In other words, we reduce class information in domain representation by optimizing the contrastive loss. Similarly, taking $(I_1, P_3)$ as negative pair, we remove domain information from class representation - otherwise $f(I_1)$ still matches $g(P_3)$ because of the \textit{entangled} domain information of \textit{photo} in class representation. Combining these two negative pairs, the domain representation and the intrinsic class information can be forced to disentangle with each other by minimizing the contrastive objective. \input{table1} \section{Experimental Results} We conduct extensive experiments on UDA benchmarks to verify the validity of our proposed method. We next present the datasets used in our experiments, comparisons with baseline methods, ablation studies of our method and visualization of results. \subsection{Datasets and Experimental Settings}\label{sec:data} \noindent \textbf{Office-Home} \cite{Office-Home} is a large-scale benchmark for visual cross-domain recognition. It collects a total of 15,500 images from four distinct domains: Art (\textit{Ar}), Clip Art (\textit{Cl}), Product (\textit{Pr}), and Real World (\textit{Rw}). Besides, each domain contains the objects of 65 categories in the office and home environments. To evaluate our method, we conduct 12 UDA tasks, \textit{i.e.}., Ar $\rightarrow$ Cl, ..., Rw $\rightarrow$ Pr. \noindent \textbf{VisDA-2017} \cite{VisDA-2017} is a more challenging dataset for synthetic-to-real domain adaptation with 12 categories. It contains 152,397 synthetic images, generated by rendering the 3D models with different angles and light conditions, and 55,388 real-world images, collected from MSCOCO \cite{MSCOCO}. Following \cite{long2017conditional} and \cite{saito2018maximum}, we use the synthetic images as source domain and real-world images as target domain. \noindent \textbf{Implementation details.} For Office-Home, we use pre-trained CLIP model and adopt ResNet-50 \cite{He2016DeepRL} as its image encoder. We fix the parameters in the encoders and the prompt is trained with the mini-batch SGD optimizer for 200 epochs, where the batch size is set to be 32. The initial learning rate is set to 0.003 and decayed with a cosine annealing rule \cite{Loshchilov2017SGDRSG}. For VisDA-2017\cite{VisDA-2017}, the results are obtained by leveraging the pre-trained CLIP model with ResNet-101 \cite{He2016DeepRL} as the image encoder. The parameters of the image and text encoders are fixed and we train the prompt for 25 epochs using the mini-batch SGD optimizer with a batch of 32. The learning rate is set to 0.003 initially and decayed with a cosine annealing rule. As for the hyper-parameters, the length of context tokens $M_1$ and domain-specific tokens $M_2$ are both set to 16. Other choices of token numbers are discussed in \cref{sec:ablation}. Our context vectors are randomly initialized using a zero-mean Gaussian distribution with a standard deviation of 0.02. The pseudo labeling threshold $\tau$ is set to 0.6 for Office-Home and 0.5 for VisDA-2017\cite{VisDA-2017}. Further discussion about the value of $\tau$ is shown in \cref{sec:ablation}. \begin{table*}[h] \centering \setlength{\abovecaptionskip}{0.cm} \setlength{\belowcaptionskip}{0.cm} \caption{Accuracy (\%) on VisDA-2017\cite{VisDA-2017} for unsupervised domain adaptation (ResNet-101\cite{he2016deep}). The best accuracy is indicated in bold.} \setlength{\tabcolsep}{1.86mm} { \begin{tabular}{c|cccccccccccc|c} Method & plane & bicycle & bus & car & horse & knife & mcycl & person & plant & sktbrd & train & truck & Avg \\ \shline ResNet-101 \cite{he2016deep} & 55.1 & 53.3 & 61.9 & 59.1 & 80.6 & 17.9 & 79.7 & 31.2 & 81.0 & 26.5 & 73.5 & 8.5 & 52.4 \\ \hline DANN \cite{ganin2015unsupervised} & 81.9 & 77.7 & 82.8 & 44.3 & 81.2 & 29.5 & 65.1 & 28.6 & 51.9 & 54.6 & 82.8 & 7.8 & 57.4 \\ \hline JAN \cite{long2017deep} & 75.7 & 18.7 & 82.3 & \textbf{86.3} & 70.2 & 56.9 & 80.5 & 53.8 & 92.5 & 32.2 & 84.5 & 54.5 & 65.7 \\ \hline MCD \cite{saito2018maximum} & 87.0 & 60.9 & 83.7 & 64.0 & 88.9 & 79.6 & 84.7 & 76.9 & 88.6 & 40.3 & 83.0 & 25.8 & 71.9 \\ \hline CDAN+E \cite{long2017conditional} & 85.2 & 66.9 & 83.0 & 50.8 & 84.2 & 74.9 & 88.1 & 74.5 & 83.4 & 76.0 & 81.9 & 38.0 & 73.9 \\ \hline BSP+CDAN \cite{BSP_ICML2019} & 92.4 & 61.0 & 81.0 & 57.5 & 89.0 & 80.6 & 90.1 & 77.0 & 84.2 & 77.9 & 82.1 & 38.4 & 75.9 \\ \hline SWD \cite{SWD_CVPR19} & 90.8 & 82.5 & 81.7 & 70.5 & 91.7 & 69.5 & 86.3 & 77.5 & 87.4 & 63.6 & 85.6 & 29.2 & 76.4 \\ \hline DWL \cite{DWL_CVPR21} & 90.7 & 80.2 & 86.1 & 67.6 & 92.4 & 81.5 & 86.8 & 78.0 & 90.6 & 57.1 & 85.6 & 28.7 & 77.1 \\ \hline MODEL \cite{li2020model} & 94.8 & 73.4 & 68.8 & 74.8 & 93.1 & \textbf{95.4} & 88.6 & \textbf{84.7} & 89.1 & 84.7 & 83.5 & 48.1 & 81.6 \\ \hline CGDM \cite{CGDM_CVPR21} & 93.4 & 82.7 & 73.2 & 68.4 & 92.9 & 94.5 & 88.7 & 82.1 & 93.4 & 82.5 & 86.8 & 49.2 & 82.3 \\ \hline STAR \cite{lu2020stochastic} & 95.0 & \textbf{84.0} & 84.6 & 73.0 & 91.6 & 91.8 & 85.9 & 78.4 & \textbf{94.4} & 84.7 & 87.0 & 42.2 & 82.7 \\ \bottomrule CLIP \cite{radford2021learning} & \textbf{98.2} & 83.9 & \textbf{90.5} & 73.5 & 97.2 & 84.0 & \textbf{95.3} & 65.7 & 79.4 & \textbf{89.9} & 91.8 & \textbf{63.3} & 84.4 \\ \hline \textbf{DAPL} & 97.8 & 83.1 & 88.8 & 77.9 & \textbf{97.4} & 91.5 & 94.2 & 79.7 & 88.6 & 89.3 & \textbf{92.5} & 62.0 & \textbf{86.9} \end{tabular}} \label{tab:visda} \end{table*} \subsection{Comparison with State-of-the-Art DA Methods} \subsubsection{Quantitative Evaluation} \noindent \textbf{Results on Office-Home} are shown in \cref{tab:officehome}, where our method obviously outperforms all other baselines w.r.t the average accuracy of 12 tasks. Note that there exists a large performance gap between the feature alignment-based methods (e.g., DANN \cite{ganin2015unsupervised} and CDAN+E \cite{long2017conditional}) and SRDC \cite{tang2020unsupervised}. The possible reason may be that excessive feature alignment would hamper the discrimination of target data. While such potential risk will not happen in our method, since we do not force feature alignment across domains. Particularly, our method further surpasses the state-of-the-art method SRDC \cite{tang2020unsupervised}) by a large margin of 3.2\% in terms of the average accuracy. We owe the performance improvement to the more suitable visual concepts for the target domain that are generated from our learned prompts. And the superior performance of our method shows that simple prompt learning is effective for UDA problems. \noindent \textbf{Results on VisDA-2017\cite{VisDA-2017}} are presented in \cref{tab:visda}. It can be observed that our method achieves the highest average accuracy of $86.9\%$ over the 12 classes, outperforming the state-of-the-art method STAR \cite{lu2020stochastic} by a large margin of $4.2\%$. Note that CLIP in \cref{tab:visda} means zero-shot CLIP which adopts ``a photo of a [CLASS]" as the hand-crafted prompt. Even the hand-crafted prompt method already has an impressive performance, our DAPL still achieves a $2.5\%$ absolute improvement over it. The reason why the accuracy of truck is significantly boosted may be that the concept of ``truck'' is more discriminative in the language model. Furthermore, with the help of prompt learning, DAPL outperforms CLIP by $7.5\%, 14\%, 9.2\%$ on ``knife", ``person" and ``plant". In general, despite the simplicity of ours method, the encouraging results validate the efficacy of our prompt learning method. \subsubsection{Training Time Analysis} We train all the models with 1 NVIDIA RTX 2080 Ti GPU. Our method is much more efficient than other methods. For example, DAPL, MCD\cite{saito2018maximum} and DANN\cite{ganin2015unsupervised} take 5.3h, 13.4h, 38.3h to train on VisDA-2017, respectively. Because we only fine-tune the prompt with very few parameters, it is much easier and faster to optimize the model. \begin{table}[h] \centering \tablestyle{10pt}{1.2} \caption{\textbf{Ablation: the effectiveness of domain-specific context (DSC).} Domain-specific context is crucial for achieving good performance. The numbers show classification accuracy~($\%$) on VisDA-2017\cite{VisDA-2017} dataset. Higher values are better. The numbers in brackets show absolute improvement from baseline. } { \begin{tabular}{cc|c} Domain-agnostic & Domain-specific & Cls. Acc. \\ \shline Manual & \ding{55} & 84.4 \\ \hline Unified & \ding{55} & 85.5 {\color{OliveGreen}(+1.1)} \\ Class-specific & \ding{55} & 86.2 {\color{OliveGreen}(+1.8)} \\ \hline Unified & \ding{51} & \textbf{86.9} {\color{OliveGreen}(+2.5)} \\ Class-specific & \ding{51} & \textbf{86.9} {\color{OliveGreen}(+2.5)} \end{tabular}} \label{tab:dsc} \vspace{-1em} \end{table} \begin{figure} \centering \includegraphics[width=\linewidth]{fig5.pdf} \caption{\textbf{Prediction confidence from VisDA-2017 (\emph{top}) and Office-Home dataset (\emph{bottom})}. Confidence \emph{of the ground-truth class} predicted using different prompting methods. Blue: manually designed prompt. Green: domain-agnostic prompt. Pink: our proposed method. Predictions given by our method show the highest confidence.} \label{fig:vis}\vspace{0mm} \end{figure} \subsection{Ablation Study} \label{sec:ablation} To give a more detailed analysis of our method, we conduct several ablation studies on VisDA-2017\cite{VisDA-2017}. All of the variant models are trained with the same training hyper-parameters as described in \cref{sec:data}. \noindent \textbf{Ablation: domain-specific context.} To prove the effectiveness and necessity of domain-specific context, we compare the performances of these following prompt settings on VisDA-2017\cite{VisDA-2017} dataset: (1) the manually designed prompt ``a photo of [CLASS]" as the baseline; (2) the domain-agnostic prompt in the form of unified context~(as shown in \cref{eq:unified}); (3) the domain-agnostic prompt in the form of class-specific context; (4) the domain-agnostic prompt in the form of unified context with domain-specific context~(as shown in \cref{eq:3}); and (5) the domain-agnostic prompt in the form of class-specific context with domain-specific context~(as shown in \cref{eq:cl}). The results of the above experiments are listed in \cref{tab:dsc}. Even the manually design prompt is a strong baseline, our proposed DAPL (4) and (5) achieves $2.5\%$ absolute improvement than the hand-crafted baseline (1). By comparing (2) with (3), we can observe that learning prompt with class-specific context can have a better performance than with unified context when domain-specific context is not used. Because the differences between classes can be better modeled by the class-specific context. Combining domain-specific context with the unified context (\textit{i.e.}, (4)) can further bring $1.4\%$ performance improvement to (2). Besides, consistent performance improvement is also attained from (3) to (5). These improvements over the domain-agnostic context alone demonstrate the necessity of domain-specific context, which helps to capture the unique underlying domain information. Finally, by comparing (4) with (5), we know that tuning class-specific context with domain-specific context does not still yield improvement like (2) over (1). This is because distribution shift is the predominant factor in UDA, and modeling fine-grained discrepancy between classes may not further improve the performance. Thus, we choose the combination of unified context and domain-specific context in the paper. \noindent \textbf{Ablation: context token length.} We conduct experiments in \cref{tab:length of context tokens} to explore the influence of context token length. The lengths of domain-agnostic and domain-specific context tokens are denoted by $M_1$ and $M_2$, respectively. From the results, we can see that the performance is a little lower when $M_1 < M_2$. Overall, the token length has little effect on the performance of our method. This implies the continuous representation could be learned with a small number of tokens. \begin{table}[h] \centering \tablestyle{4pt}{1.2} \caption{\textbf{Ablation: context token length.} The accuracy~($\%$) of different length combinations on VisDA-2017\cite{VisDA-2017} dataset (with ResNet-101 as image encoder). The values shown are ($M_1$, $M_2$), \textit{i.e.}., context length of domain-agnostic prompt and domain-specific prompt. The best performance is denoted in bold.} { \begin{tabular}{c|ccccc} \makecell[c]{Content token length} & (4, 28) & (8, 24) & (28, 4) & (16, 16) & (24, 8) \\ \shline Cls. Acc. & 86.6 & 86.8 & \textbf{86.9} & \textbf{86.9} & \textbf{86.9} \end{tabular}} \label{tab:length of context tokens} \end{table} \noindent \textbf{Ablation: pseudo label threshold.} In \cref{tab:pseudo label threshold}, we present the sensitivity of our method to the hyper-parameter $\tau$ by ranging it from 0.4 to 0.7. It seems that our method is not sensitive to $\tau$ because of the trade-off between quality and quantity of pseudo labels. For example, when $\tau$ is set to 0.7, the model is trained with fewer but more confident pseudo labels and the quality of pseudo labels may make up the performance drop brought by the reduced quantity. \begin{table}[h] \centering \tablestyle{13pt}{1.2} \caption{\textbf{Ablation: pseudo label threshold.} The accuracy~($\%$) of different threshold $\tau$ on VisDA-2017\cite{VisDA-2017} dataset (with ResNet-101 image encoder). The best performance is denoted in bold.} { \begin{tabular}{c|cccc} Threshold $\tau$ & 0.4 & 0.5 & 0.6 & 0.7 \\ \shline Cls. Acc. & \textbf{86.9} & \textbf{86.9} & 86.7 & 86.6 \end{tabular}} \label{tab:pseudo label threshold}\vspace{-3mm} \end{table} \subsection{Visualization} In \cref{fig:vis}, we compare the prediction confidence of the ground truth category on the target domain when using three different prompts: (a) a hand-crafted prompt; (b) the prompt with only domain-agnostic context; and (c) the prompt with domain-agnostic context and domain-specific context. For the third example of the top row, the plant only takes up a small area of the image. Hence, the prompt ``a photo of a plant'' is inappropriate for the image, while ``a photo of a plant with a pot'' might be a better match. Therefore, the hand-crafted prompt performs poorly on this example. In contrast, the learnable prompt yields a more confident prediction than the manually designed prompt. For the last image of the bottom row, it is a good match for the prompt ``a photo of a backpack''. The learnable domain-agnostic context performs worse than the manually designed prompt. By learning domain information of ``product'', the domain-specific context enables the model with more confidence to predict the image as a backpack. Overall, these comparison results with different prompts validate that learnable domain-agnostic and domain-specific contexts improve the performance of our model when combined. \section{Conclusion} In this paper, we introduce a novel prompt learning method for unsupervised domain adaptation, which is free of aligning features between domains as conventional methods do~\cite{long2015learning}. Instead, we design domain-specific context for each domain to advocate learning distinct domain representations of the source and the target domain. By making use of the prompt learning, We build a bridge between multi-modality methods and domain adaptation methods. Extensive results have demonstrated the advantage of our method. Prompt learning methods can be extended to other visual tasks in unsupervised domain adaptation in the future, \textit{e.g.}, semantic segmentation. \section*{Acknowledgements} This work is supported in part by the National Science and Technology Major Project of the Ministry of Science and Technology of China under Grants 2018AAA0100701, the NSFC under Grant 62022048, the Guoqiang Institute of Tsinghua University.
{'timestamp': '2022-02-15T02:44:01', 'yymm': '2202', 'arxiv_id': '2202.06687', 'language': 'en', 'url': 'https://arxiv.org/abs/2202.06687'}
arxiv
\section{Introduction} Our world becomes more automated every day with the development of self-driving cars, robotics, and unmanned factories. Many of these automation processes rely on solutions to sequential decision-making problems. Reinforcement Learning (RL) has recently been shown to be an effective tool for solving such problems achieving notable successes, e.g., solving Atari games~\citep{mnih2013playing}, defeating the (arguably all-time) best human players in the game of GO~\citep{silver2016mastering}, accelerating robot skill acquisition~\citep{kober2013reinforcement}. Most of the successful RL algorithms rely on abstracting the sequential nature of the decision-making as Markov Decision Processes (MDPs), which typically assume both \emph{stationary} transition dynamics and reward functions. As classic RL departs a well-behaved laboratory setting, stationarity assumptions can quickly become prohibitive, sometimes leading to catastrophic consequences. As an illustration, imagine an autonomous agent driving a vehicle with changing weather conditions impacting visibility and tyre grip. The agent must identify and quickly adapt to these weather conditions changes in order to avoid losing control of the vehicle. Similarly, an unmanned aerial vehicle hovering around a fixed set of coordinates needs to deal with sudden atmospheric condition changes (e.g., wind, humidity etc). Another similar and realistic example is an actuator failure, which changes how the action affects the MDP. Following~\cite{menke1995sensor} we distinguish ``soft'' (a percentage drop in action efficiency) and ``hard'' (action is not affecting the MDP) failures. The failures can also be dynamic as a ``soft'' failure in one actuator can overload other actuators introducing a chain of failures. With every fixed specific weather condition or actuator failure such environments can be modeled as MDPs, however, with the changing weather or arising failures the environment becomes non-stationary. We can model this type of environments by making MDP state transitions dependant on the \emph{context} variable, which encapsulates the non-stationary and/or other dependencies. This kind of contextual Markov Decision Processes (C-MDPs) incorporate a number of different RL settings and RL frameworks~\citep{crl_review}: non-stationary RL, where the context changes over time and the agent needs to adapt to the context (e.g., the weather conditions are slowly changing over time); continual and/or meta RL, where the context is sampled from a distribution before the start of the episode (e.g, the weather changes abruptly between the instances the vehicle has been deployed). Although a significant progress in solving specific instances of C-MDPs has been made, the setting with a countable number of contexts with Markovian transitions between the contexts has not received sufficient attention in the literature --- a gap we are aiming to fill. The closest related works consider only special cases of our setting assuming: no context transitions~\citep{xu2020task}; Markovian context transitions with {\it a priori} known context transition times~\citep{xie2020deep}; finite state-action spaces~\citep{choi2000hidden}. To enable sample efficient context adaptation~\cite{xu2020task} and~\cite{xie2020deep} developed model-based reinforcement learning algorithms. Specifically,~\cite{xie2020deep} learned a latent space variational auto-encoder model with Markovian evolution in continuous context-space, while~\cite{xu2020task} adopted a Gaussian Process model for MDPs and a Dirichlet process (DP) prior to model \emph{static non-evolving} contexts. Note the use of DP, which is a conjugate prior for a categorical distribution, and fits perfectly with the static context case. We also propose a model-based RL algorithm, however, we model the context and state transitions using the Hierarchical Dirichlet Process (HDP)~\citep{teh2006hierarchical, fox2008nonparametric} prior and a neural network with outputs parametrizing a Guassian distribution (i.e., its mean and variance), respectively, and refer to the model as HDP-C-MDP. We chose the HDP prior since it only requires the knowledge of an upper bound on context cardinality, and it is better suited for Markov chain modeling than other priors such as DP~\citep{teh2006hierarchical}. Inspired by~\cite{blei2006variational} we derive a model learning algorithm using variational inference, which is amenable to RL applications using off-the-shelf algorithms. Our algorithm relies on two theoretical results guiding the representation learning: a) we propose a context distillation procedure (i.e., removing spurious contexts); b) we show that the optimal policy depends on the context belief (context posterior probability given past observations). We derive another theoretical result, which shows performance improvement bounds for the fully observable context case. Equipped with these results, we experimentally demonstrate that we can infer the true context cardinality from data. Further, the context distillation procedure can be used during training as a regularizer. Interestingly, it can also be used to merge similar contexts, where the measure of similarity is only implicitly defined through the learning loss. Thus context merging is completely unsupervised. We then show that our model learning algorithm appears to provide an optimization profile with fewer local maxima and minima than the maximum likelihood approach, which we attribute to the Bayesian nature of our algorithm. Finally, we illustrate RL applications on an autonomous car left turn and an autonomous drone take-off tasks. We also demonstrate that state-of-the-art algorithms of different frameworks (such as continual RL and Partially-Observable Markov Decision Processes (POMDPs)) fail to solve C-MDPs in our setting, and we elaborate on potential reasons why this is the case. \section{Problem Formulation and Related Work} \label{s:related_work} We define a contextual Markov Decision Process (C-MDP) as a tuple ${\mathcal M}_{\rm c} = \langle {\mathcal C}, \cS, {\mathcal A}, \cP_{{\mathcal C}}, \cP_{\cS}, \cR, \gamma_d \rangle$, where $\cS$ is the continuous state space; ${\mathcal A}$ is the action space; $\gamma_d \in [0, 1]$ is the discount factor; and ${\mathcal C}$ denotes the context set with cardinality $|{\mathcal C}|$. In our setting, the state transition and reward function depend on the context, i.e., $\cP_{\cS}: {\mathcal C} \times \cS \times {\mathcal A} \times \cS \rightarrow [0, 1]$, $\cR: {\mathcal C} \times \cS \times {\mathcal A} \rightarrow \R$. Finally, the context distribution probability $\cP_{{\mathcal C}}: {\mathcal T}_t \times {\mathcal C} \rightarrow [0, 1]$ is conditioned on ${\mathcal T}_t$ - the past states, actions and contexts $\{{\bm s}_0, {\bm a}_0, {\bm c}_0, \dots, {\bm a}_{t-1}, {\bm c}_{t-1}, {\bm s}_t\}$. Our definition is a generalization of the C-MDP definition by~\cite{hallak2015contextual}, where the contexts are stationary, i.e., $\cP_{{\mathcal C}}: {\mathcal C} \rightarrow [0, 1]$. We adapt our definition in order to encompass all the settings presented by~\cite{crl_review}, where such C-MDPs were used but not formally defined. Throughout the paper, we will restrict the class of C-MDPs by making the following assumptions: (a) {\bf Contexts are unknown and not directly observed} (b) {\bf Context cardinality is finite and we know its upper bound $K$}; (c) {\bf Contexts switches can occur during an episode and they are Markovian}. In particular, we consider the contexts ${\bm c}_k$ representing the parameters of the state transition function ${\bm \theta}_k$, and the context set ${\mathcal C}$ to be a subset of the parameter space $\Theta$. To deal with uncertainty, we consider a set $\widetilde {\mathcal C}$ such that: a) $|\widetilde {\mathcal C}| = K > |{\mathcal C}|$; b) all its elements ${\bm \theta}_k\in\widetilde{\mathcal C}$ are sampled from a distribution $H(\lambda)$, where $\lambda$ is a hyper-parameter. Let $z_t\in[0,\dots, K)$ be the index variable pointing toward a particular parameter vector ${\bm \theta}_{z_t}$, which leads to: \begin{equation} \begin{aligned} &z_0 \ | \ {\bm \rho}_0 \sim \mathbf{Cat}({\bm \rho}_0), \qquad z_{t} \ | \ z_{t-1}, \{{\bm \rho}_j\}_{j=1}^{|\widetilde{\mathcal C}|} \sim \mathbf{Cat}({\bm \rho}_{z_{t-1}}), \\ &{\bm s}_{t} \ | \ {\bm s}_{t-1}, {\bm a}_{t-1}, z_{t}, \{{\bm \theta}_k\}_{k=1}^{|\widetilde{\mathcal C}|} \sim p({\bm s}_{t}|{\bm s}_{t-1}, {\bm a}_{t-1}, {\bm \theta}_{z_{t}}),\quad {\bm \theta}_k \ | \ \lambda \sim H(\lambda), t \ge 1, \end{aligned} \label{eq:transition} \end{equation} where ${\bm \rho}_0$ is the initial context distribution, while ${\bm R} = [{\bm \rho}_1,..., {\bm \rho}_{|\widetilde{\mathcal C}|}]$ represents the context transition operator. As the reader may notice our model is tailored to the case, where the model parameters change abruptly due to external factors such as weather conditions, cascading actuator failures etc. The change is formalized by a Markov variable $z_t$, which changes the MDP parameters. Our approach can also be related to switching systems modeling (cf.~\cite{fox2008nonparametric, becker2019switching, dong2020collapsed}) and in this case the context is representing the system's mode. While we can draw parallels with these works, we improve the model by using nonlinear dynamics (in comparison to~\cite{becker2019switching, fox2008nonparametric}), by using the HDP prior (\cite{becker2019switching, dong2020collapsed} use maximum likelihood estimators), and finally, by proposing the distillation procedure and using deep learning (in comparison to~\cite{fox2008nonparametric}). Also note that typically a switching system aims to represent a complex nonlinear (Markov) model using a collection of simpler (e.g., linear) models, which is different from our case. Other restrictions on the space of C-MDPs lead to different problems and solutions~\citep{crl_review}. We briefly mention a few notable cases, while relegating a detailed discussion to Appendix~\ref{app:lit-review}. Assuming $\cP_{{\mathcal C}}$ is deterministic with $z_t = t$ puts us in the non-stationary RL setting (cf.~\cite{chandak2020optimizing}), where it is common to assume a slowly or smoothly changing non-stationarity as opposed to our case of possibly abrupt changes. Restricting the context to a stationary distribution sampled in specific time points (e.g., at the start of the episode) can be tackled from the continual RL (cf.~\cite{nagabandi2018deep}) and meta-RL perspectives (cf.~\cite{finn2017model}), but both are not designed to handle the Markovian context case. Finally, our C-MDP can be seen as a POMDP. Recall that a POMDP is defined by a tuple ${\mathcal M}_{po} = \{{\mathcal X}, {\mathcal A}, {\mathcal O}, \cP_{{\mathcal X}}, \cP_{{\mathcal O}}, \cR, \gamma_d, p({\bm x}_0)\}$, where ${\mathcal X}$, ${\mathcal A}$, ${\mathcal O}$ are the state, action, observation spaces, respectively; $\cP_{{\mathcal X}}: {\mathcal X} \times {\mathcal A} \times {\mathcal X} \rightarrow [0, 1]$ is the state transition probability; $\cP_{{\mathcal O}}: {\mathcal X} \times {\mathcal A} \times {\mathcal O} \rightarrow [0, 1]$ is the conditional observation probability; and $p({\bm x}_0)$ is the initial state distribution. In our case, ${\bm x} = ({\bm s}, z)$ and ${\bm o} = {\bm s}$. \section{Reinforcement Learning for Markov Processes with Markovian Context Evolution} There are three main components in our algorithm: the HDP-C-MDP derivation, the model learning algorithm using probabilistic inference and the control algorithms. We firstly briefly comment on each on these components to give an overview of the results and then explain our main contributions to each. The detailed description of all parts of our approach can be found in Appendix. In order to learn the model of the context transitions, we choose the Bayesian approach and we employ Hierarchical Dirichlet Processes (HDP) as priors for context transitions, inspired by time-series modeling and analysis tools reported by~\cite{fox2008nonparametric, fox2008hdp} (see also Appendix~\ref{app:hdp}). We improve the model by proposing a context spuriosity measure allowing for reconstruction of ground truth contexts. We then derive a model learning algorithm using probabilistic inference. Having a model, we can take off-the-shelf algorithms such as a Model Predictive Control (MPC) approach using Cross-Entropy Minimization (CEM) (cf.~\cite{chua2018deep} and Appendix~\ref{appendix:cem}), or a policy-gradient approach Soft-actor critic (SAC) (cf.~\cite{haarnoja2018soft} and Appendix~\ref{appendix:sac}), which are both well-suited for model-based reinforcement learning. While MPC can be directly applied to our model, for policy-based control we first derive the representation of the optimal policy. \textbf{Generative model: HDP-C-MDP.} Before presenting our probabilistic model, let us develop some necessary tools. \textit{A Dirichlet process (DP),} denoted as $\mathbf{DP}(\gamma, H)$, is characterized by a concentration parameter $\gamma$ and a base distribution $H(\lambda)$ defined over the parameter space $\Theta$. A sample $G$ from $\mathbf{DP}(\gamma, H)$ is a probability distribution satisfying $(G(A_1), ..., G(A_r)) \sim \textrm{Dir}(\gamma H(A_1),...,\gamma H(A_r))$ for every finite measurable partition $A_1,...,A_r$ of $\Theta$, where $\textrm{Dir}$ denotes the Dirichlet distribution. Sampling $G$ is often performed using the stick-breaking process~\citep{sethuraman1994constructive} and constructed by randomly mixing atoms independently and identically distributed samples ${\bm \theta}_k$ from~$H$: \begin{equation} \label{eq:high_dp} \nu_k \sim \mathbf{Beta}(1, \gamma), \quad \beta_k=\nu_k\prod_{i=1}^{k-1} (1 - \nu_i), \quad G = \sum_{k=1}^{\infty} \beta_k \delta_{{\bm \theta}_k}, \end{equation} where $\delta_{{\bm \theta}_k}$ is the Dirac distribution at ${\bm \theta}_k$. We note that the stick-breaking procedure assigns progressively smaller values to $\beta_k$ for large $k$, thus encouraging a smaller number of meaningful atoms. \textit{The Hierarchical Dirichlet Process (HDP)} is a group of DPs sharing a base distribution, which itself is a sample from a DP: $G \sim \mathbf{DP}(\gamma, H)$, $ G_j \sim \mathbf{DP}(\alpha, G)$ for all $j=0, 1, 2,\dots$~\citep{teh2006hierarchical}. The distribution $G$ guarantees that all $G_j$ inherit the same set of atoms, i.e., atoms of $G$, while keeping the benefits of DPs in the distributions $G_j$. It can be shown that $G_j = \sum_{k=0}^\infty \rho_{j k} \delta_{\bm\theta_k}$ for some $\rho_{j k}$ their sampling can be performed using another stick-breaking process~\citep{teh2006hierarchical}. We consider its modified version introduced by~\cite{fox2011bayesian}: \begin{equation} \mu_{j k} \ | \ \alpha, \kappa, \beta \sim \mathbf{Beta}\left( \alpha \beta_{k} + \kappa \tilde{\delta}_{j k}, \ \alpha + \kappa - \left(\sum_{i =1}^{k} \alpha \beta_i + \kappa \tilde{\delta}_{j i}\right) \right), \,\, \rho_{j k} = \mu_{j k}\prod_{i=1}^{k-1} (1 - \mu_{j i}), \label{eq:low_dp} \end{equation} where $k \ge 1$, $j \ge0$, $\tilde{\delta}_{j k}$ is the Kronecker delta, the parameter $\kappa \ge 0$, called the sticky factor, modifies the transition matrix priors encouraging self-transitions. The sticky factor serves as another measure of regularization reducing the average number of transitions. \begin{wrapfigure}{r}{0.5\textwidth} \centering \includegraphics[height=.21\textwidth]{figures/graphical_models/generative_model.pdf} \caption{HDP-C-MDP} \label{fig:gm} \end{wrapfigure} In our case, the atoms $\{{\bm \theta}_k\}$ forming the context set $\widetilde {\mathcal C}$ are sampled from $H(\lambda)$, while $\rho_{j k}$ are the parameters of the Hidden Markov Model: $\bm{\rho}_0$ is the initial context distribution and $\bm{\rho}_j$ are the rows in the transition matrix ${\bm R}$. Our probabilistic model is constructed in Equations~\ref{eq:transition},\ref{eq:high_dp},\ref{eq:low_dp} and illustrated in Figure~\ref{fig:gm} as a graphical model. We stress that the HDP in its stick-breaking construction assumes that $|\widetilde {\mathcal C}|$ is infinite and countable. In practice, however, we make an approximation and set $|\widetilde {\mathcal C}| = K$ with a large enough~$K$. \textit{Context Distillation.} HDP-C-MDP promotes a small number of meaningful contexts and some contexts will almost surely be spurious, i.e., we will transition to these contexts with a very small probability. While this probability is small we may still need to explicitly remove these spurious contexts. Here we propose a measure of context spuriosity and derive a distillation procedure removing these spurious contexts. As a spuriosity measure we will use the stationary distribution of the chain ${\bm p}^\infty$, which is computed by solving ${\bm p}^\infty = {\bm p}^\infty {\bm R}$. The distillation is then performed as follows: if in stationarity the probability mass of a context is smaller than a threshold $\varepsilon_{\rm distil}$ then transitioning to this context is unlikely and it can be removed. We develop the corresponding distilled Markov chain in the following result, which we prove in Appendix~\ref{proof_thm:distillation}, while the distillation algorithm can be found in Appendix~\ref{appendix:context_distill}. \begin{thm}\label{thm:distillation} Consider a Markov chain ${\bm p}^{t} = {\bm p}^{t-1} {\bm R}$ with a stationary distribution ${\bm p}^\infty$ and distilled ${\mathcal I}_1 = \{i | {\bm p}^\infty_i \ge \varepsilon_{\rm distil} \}$ and spurious ${\mathcal I}_2 = \{i | {\bm p}^\infty_i < \varepsilon_{\rm distil}\}$ state indexes, respectively. Then a) the matrix $\widehat {\bm R} = {\bm R}_{{\mathcal I}_1, {\mathcal I}_1} + {\bm R}_{{\mathcal I}_1, {\mathcal I}_2} ({\bm I} - {\bm R}_{{\mathcal I}_2, {\mathcal I}_2} )^{-1} {\bm R}_{{\mathcal I}_2, {\mathcal I}_1}$ is a valid probability transition matrix; b) the Markov chain $\widehat {\bm p}^{t}= \widehat {\bm p}^{t-1} \widehat {\bm R}$ is such that its stationary distribution $\widehat {\bm p}^{\infty}\propto{\bm p}^{\infty}_{{\mathcal I}_1}$. \end{thm} \textbf{Model Learning using Probabilistic Inference.} We aim to find a variational distribution $q(\bm\nu, \bm\mu, \bm\theta)$ to approximate the true posterior $p(\bm\nu, \bm\mu, \bm\theta | {\mathcal D})$, for a dataset ${\mathcal D} = \{({\bm s}^i,{\bm a}^i)\}_{i=1}^N$, where ${\bm s}^i=\{{\bm s}^i_t\}_{t=-1}^T$ and ${\bm a}^i=\{{\bm a}^i_t\}_{t=-1}^T$ are the state and action sequences in the $i$-th trajectory. We minimize $\KL{q(\bm\nu, \bm\mu, \bm\theta)}{p(\bm\nu, \bm\mu, \bm\theta | {\mathcal D})}$, or equivalently, maximize the evidence lower bound (ELBO): \begin{equation} \label{eq:elbo} \textrm{ELBO} = \mathbb{E}_{q(\bm\mu, \bm\theta)} \left[\sum_{i=1}^N \log p({\bm s}^i | {\bm a}^i, \bm\mu, \bm\theta)\right] - \KL{q(\bm\nu, \bm\mu, \bm\theta)}{p(\bm\nu, \bm\mu, \bm\theta)}. \end{equation} The variational distribution above involves infinite-dimensional random variables $\bm\nu, \bm\mu, \bm\theta$. To reach a tractable solution, we assume $|\widetilde {\mathcal C}| = K$ and exploit the standard mean-field assumption~\citep{blei2017variational} and the truncated variational distribution similarly to~\cite{blei2006variational, hughes2015reliable, bryant2012truly} as follows: \begin{align} &q(\bm\nu, \bm\mu, \bm\theta) = q(\bm\nu)q(\bm\mu)q(\bm\theta), \ q(\bm\theta|\hat{\bm\theta}) = \prod_{k=1}^{K} \delta(\bm\theta_k|\hat{\bm\theta}_k), \ q(\bm\nu|\hat{\bm\nu}) = \prod_{k=1}^{K-1} \delta(\nu_k|\hat{\nu}_{k}), \ q(\nu_K=1) = 1, \notag \\ &q(\bm\mu|\hat{\bm\mu}) = \prod_{j=0}^{K} \prod_{k=1}^{K-1} \mathbf{Beta}\left(\mu_{j k} \bigg| \hat{\mu}_{j k}, \hat{\mu}_{j} - \sum_{i=1}^k \hat{\mu}_{j i}\right), \quad q(\mu_{j K}=1) = 1, \label{eq:tvi} \end{align} where hatted symbols represent free parameters. For $\bm\theta$ and $\bm\nu$, we seek a MAP point estimate instead of a full posterior (see Appendix~\ref{appendix:vi_just} for a discussion on our design choices). Random variables not shown in the truncated variational distribution are conditionally independent of data, and thus can be discarded from the problem. We maximize ELBO using stochastic gradient ascent, while the gradient computations are performed using the following two techniques: (a) we compute the exact context posterior using a forward-backward message passing algorithm, (b) we use implicit reparametrized gradients to differentiate with respect to parameters of variational distributions~\citep{figurnov2018implicit}. We present the detailed derivations in Appendix~\ref{appendix:vi}. We also can perform context distillation during training as discussed in Appendix~\ref{appendix:context_distill}. While adding some computational complexity, this procedure acts as a regularization for model learning as we show in our experiments. \textbf{Representation of the optimal policy.} First, we notice that the model in Equation~\ref{eq:transition} is a POMDP, which we get by setting ${\bm x}_{t} := ( z_{t}, {\bm s}_{t})$ and ${\bm o}_{t} := {\bm s}_t$. In the POMDP case, we cannot claim that ${\bm o}_{t+1}$ depends \textit{only} on ${\bm o}_t$ and ${\bm a}_t$. Therefore the Bellman dynamic programming principle does not hold for these variables and solving the problem is more involved. In practice, one constructs \emph{the belief state} ${\bm b}_t = p({\bm x}_t | {\bm I}_t^C)$~\citep{astrom1965optimal}, where ${\bm I}_t^C = \{{\bm b}_0, {\bm o}_{\leq t}, {\bm a}_{<t}\}$ is called the information state and is used to compute the optimal policy. Since the belief state is a distribution, it is generally costly to estimate in continuous observation or state spaces. In our case, estimating the belief is tractable, since the belief of the state ${\bm s}_t$ is the state itself (as the state ${\bm s}_t$ is observable) and the belief of $z_t$, which we denote as ${\bm b}_t^z$, is a vector of a fixed length at every time step (as $z_t$ is discrete). We have the following result with the proof in Appendix~\ref{proof_thm:policy}. \begin{thm} \label{thm:policy} a) The belief of $z$ can be computed as $p(z_{t+1} | {\bm I}_t^C) ={\bm b}^{z}_{t+1}$, where $({\bm b}^{z}_{t+1})_i \propto {\bm N}_i = \sum_j p({\bm s}_{t+1}|{\bm s}_t, {\bm \theta}_i,{\bm a}_t) \rho_{j i} ({\bm b}^{z}_t)_j$, where $({\bm b}_{t}^z)_i$ are the entries of ${\bm b}^{z}_t$; b) the optimal policy can be computed as $\pi({\bm s}, {\bm b}^{z}) = \argmax_{{\bm a}} {\bm Q}({\bm s}, {\bm b}^{z}, {\bm a})$, where the value function satisfies the dynamic programming principle ${\bm Q}({\bm s}_t, {\bm b}_t^{z}, {\bm a}_t) = {\bm r}({\bm s}_t, {\bm b}_t^{z}, {\bm a}_t) + \gamma \int\sum_i {\bm N}_i \max_{{\bm a}_{t+1}} {\bm Q}({\bm s}_{t+1}, {\bm b}_{t+1}^{z}, {\bm a}_{t+1}) \ d {\bm s}_{t+1}$. \end{thm} \textbf{Computational framework.} Algorithm~\ref{algo:meta} summarizes our approach and is based on the standard model-based RL frameworks (e.g.,~\cite{Pineda2021MBRL}). Effectively, we alternate between model updates and policy updates. For the policy updates we relabel (recompute) the beliefs for the historical transition data. As MPC methods compute the sequence of actions based solely on the model such relabeling is not required. \begin{algorithm}[ht] \SetAlgoLined \textbf{Input:} $\varepsilon_{\rm distill}$ - distillation threshold, $N_{\rm warm}$ - number of trajectories for warm start, $N_{\rm traj}$ - number of newly collected trajectories per epoch, $N_{\rm epochs}$ - number of training epochs, {\sc agent} - policy gradient or MPC agent\\ Initialize {\sc agent} with {\sc random agent}, ${\mathcal D} = \emptyset$; \\ \For{$i = 1,\dots, N_{\rm epochs}$}{ Sample $N_{\rm traj}$ ($N_{\rm warm}$ if $i = 1$) trajectories from the environment with {\sc agent};\\ Set ${\mathcal D}_{\rm new} = \{({\bm s}^i,{\bm a}^i)\}_{i=1}^{N_{\rm traj}}$, where ${\bm s}^i=\{{\bm s}^i_t\}_{t=-1}^T$ and ${\bm a}^i=\{{\bm a}^i_t\}_{t=-1}^T$ are the state and action sequences in the $i$-th trajectory. Set ${\mathcal D} = {\mathcal D} \cup {\mathcal D}_{\rm new}$; \\ Update generative model parameters by gradient ascent on ELBO in Equation~\ref{eq:elbo}; \\ Perform context distillation with $\varepsilon_{\rm distill}$; \\ \If{{\sc agent} is {\sc policy}}{ Sample trajectories for policy update from ${\mathcal D}$;\\ Recompute the beliefs using the model for these trajectories;\\ Update policy parameters } } \Return {\sc agent} \caption{Learning to Control HDP-C-MDP}\label{algo:meta} \end{algorithm} \textbf{Performance gain for observable contexts.} It is not surprising that observing the ground truth of the contexts should improve the maximum expected return. In particular, even knowing the ground truth context model we can correctly estimate the context $z_{t+1}$ only \emph{a posteriori}, i.e., after observing the next state ${\bm s}_{t+1}$. Therefore at every context switch we can mislabel it with a high probability. This leads to a performance loss, which the following result quantifies using the value functions. We have the following result with the proof in Appendix~\ref{si_ss:performance_gain}. \begin{thm} \label{thm:performance} Assume we know the true transition model of the contexts and states and consider two settings: we observe the ground truth $z_t$ and we estimate it using ${\bm b}_{t}^z$. Assume we computed the optimal model-based policy $\pi(\cdot | {\bm s}_t, {\bm b}_{t}^z)$ with the return $\cR$ and the optimal ground-truth policy $\pi_{\rm gt}(\cdot | {\bm s}_t, z_{t+1})$ with the corresponding optimal value functions $V_{\rm gt}({\bm s}, z)$ and $Q_{\rm gt}({\bm s},z, {\bm a})$, then: \begin{equation*} \mathbb{E}_{z_1, {\bm s}_0} V_{\rm gt}({\bm s}_0, z_1) - \cR \ge \mathbb{E}_{\tau,{\bm a}^{\rm gt}_{t_m}\sim\pi_{\rm gt}, {\bm a}_{t_m}\sim\pi} \sum\limits_{m=1}^M \gamma^{t_m} (Q({\bm s}_{t_m}, z_{t_m+1}, {\bm a}^{\rm gt}_{t_m}) - Q({\bm s}_{t_m}, z_{t_m+1}, {\bm a}_{t_m})), \end{equation*} where $M$ is the number of misidentified context switches in a trajectory $\tau$. \end{thm} \section{Experiments} In this section, we demonstrate that the HDP offers an effective prior for model learning, while the distillation procedure refines the model and can regulate the context set complexity. We also explain why state-of-the-art methods from continual RL, meta-RL and POMDP literature can fail in our setting. We finally show that our algorithm can be adapted to high dimensional environments. We delegate several experiments to Appendix due to space limitations. We show that we can learn additional unseen contexts without relearning the whole model from scratch. We also illustrate how the context distillation during training can be used to merge contexts in an unsupervised manner thus reducing model complexity. We finally show that our model can generalize to non-Markovian and state dependent context transitions. \\ We choose \textbf{the switching process} to be a chain, however, we enforce a cool-off period, i.e, the chain cannot transition to a new state until the cool-off period has ended. This makes the context switching itself a non-stationary MDP. This is done to avoid switches at every time step, but also to show that our method is not limited to the stationary Markov context evolution.\\ {\bf Control Baselines:} (1) SAC algorithm with access to the ground truth context information (one-hot-encoded variable $z_t$) denoted as {\it FI-SAC}; (2) SAC algorithm with no context information denoted as {\it NI-SAC} (3) a continual RL algorithm for contextual MDPs~\citep{xu2020task}, where a Gaussian process is used to learn the dynamics while identifying and labeling the data with contexts, which is denoted as {\it GPMM}; (4) A POMDP approach, where the context set cardinality is known and the belief is estimated using an RNN, while PPO~\citep{schulman2017proximal, ppo-pytroch} is used to update the policy. We denote this approach as {\it RNN-PPO}. \\ {\bf Modeling Prior Baselines:} (1) a model with sticky Dirichlet priors $\bm\rho_j \sim \textrm{Dir}(\alpha_k=\alpha/K + \kappa \tilde\delta_{j k})$; (2) a model which removes all priors and conducts a maximum-likelihood (MLE) learning. All the other relevant experimental details (including hyper-parameters) are provided in Appendix~\ref{appendix:exp-details}. \begin{figure}[ht] \centering \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/prior_comparison/hdp_distill_0.pdf} \caption{HDP} \label{fig:hdp_rho} \end{subfigure} \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/prior_comparison/dirichlet_distill_0.pdf} \caption{Dirichlet} \label{fig:dir_rho} \end{subfigure} \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/prior_comparison/mle_distill_0.pdf} \caption{MLE} \label{fig:mle_rho} \end{subfigure} \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/prior_comparison/hdp_distill_01.pdf} \caption{HDP w distillation} \label{fig:hdp_rho_distilled} \end{subfigure} \caption{Cart-Pole Swing-Up. Transition matrices, initial $p(z_0)$ and stationary $p(z_\infty)$ distributions of the learned context models for Result A. $Z0$ -- $Z4$ stand for the learned contexts.} \label{fig:rho} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.3\textwidth} \centering\includegraphics[width=0.99\textwidth]{figures/si_time_seq_priors/hdp_seq_distill_0.pdf}\caption{HDP} \label{fig:hdp_z_seq} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering\includegraphics[width=0.99\textwidth]{figures/si_time_seq_priors/dirichlet_seq_distill_0.pdf}\caption{Dirichlet}\label{fig:dir_z_seq} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering\includegraphics[width=0.99\textwidth]{figures/si_time_seq_priors/mle_seq_distill_0.pdf}\caption{MLE}\label{fig:mle_z_seq} \end{subfigure} \caption{ Cart-Pole Swing-Up. Time courses the learned context models for Result A. $C0$ and $C1$ stand for the ground true contexts, while $Z0$ -- $Z4$ are the learned contexts.} \label{fig:z_seq} \end{figure} \textbf{Initial testing on Cart-Pole Swing-up Task~\citep{gym-cartpole-swingup}.} We attempt to swing up and balance a pole attached to a cart. This environment has four states and one action. We introduce the contexts by multiplying the action with a constant $\chi$ thus modulating the actuation effect. We will allow negative $\chi$ modeling catastrophic (or hard) failures, and positive $\chi$ modeling soft actuation failures. \\ {\bf Result A: HDP is an effective prior for learning an accurate and interpretable model.} In Figure~\ref{fig:rho}, we plot the expectation of ${\bm \rho}_0$ and ${\bm R}$ extracted from the variational distribution $q(\bm\mu)$ for HDP, Dirichlet and MLE priors for the Cart-Pole Swing-up Environment with the context set ${\mathcal C} = \{1, -1\}$ and $|\widetilde {\mathcal C}|= K = 5$. The MLE learning appears to be trapped in a local optimum as the results in Figure~\ref{fig:mle_rho} suggest. A similar phenomenon has been reported by~\cite{dong2020collapsed}, where an MLE method was used and a heuristic entropy regularization and temperature annealing method is adopted to alleviate the issue. All in all, while MLE learning can appear to be competitive with a different random seed, this approach does not give consistent results. The use of Dirichlet priors appears to provide a better model. Furthermore, with an appropriate distillation threshold the distilled transition matrices with HDP and Dirichlet priors are very similar to each other. However, the threshold for Dirichlet prior distillation needs to be much higher as calculations of the stationary distributions suggest. This implies that spurious transitions are still quite likely. In contrast, the HDP prior helps to successfully identify two main contexts ($Z0$ and $Z2$) and accurately predict the context evolution (see Figure~\ref{fig:z_seq}). Furthermore, the model is more interpretable and the meaningful contexts can often be identified with a naked eye.\\ {\bf Result B: Distillation acts as a regularizer.} We noticed that the context $Z2$ has a low probability mass in stationarity, but a high probability of self-transition (Figure~\ref{fig:hdp_rho}). This suggest that spurious transitions can happen, while highly unlikely. We speculate that the learning algorithm tries to fit the uncertainty in the model (e.g., due to unseen data) to one context. This can lead to over-fitting and unwanted side-effects. Results in Figure~\ref{fig:hdp_rho_distilled} suggest that distillation during training can act as a regularizer when we used a high enough threshold $\varepsilon_{\rm distil}=0.1$. We proceed by varying the context set cardinality $|\widetilde {\mathcal C}|$ (taking values $4$, $5$, $6$, $8$, $10$ and $20$) and the distillation threshold $\varepsilon_{\rm distil}$ (taking values $0$, $0.01$, and $0.1$). Note that we distill during training and we refer to the transition matrix for the distilled Markov chain as the distilled transition matrix. As the ground truth context cardinality is equal to two, the probability of the third most likely context would signify the learning error. In Table~\ref{table:distilled_third_context}, we present the stationary probability of the context with the third largest probability mass. In particular, for $|\widetilde {\mathcal C}| = 20$ the probability mass values for this context are larger than $0.01$. This indicates a small but not insignificant possibility of a transition to this context, if the distillation does not remove this context. We present some additional details on this experiment in Appendix~\ref{app:model_learning}. Overall, we can conclude that it is safe to overestimate the context cardinality. \\ \begin{table}[ht] \centering \caption{Comparing the probability mass of the third most probable state in the stationary distribution. We vary the cardinality of the estimated context set $\widetilde {\mathcal C}$ and the distillation threshold $\varepsilon_{\rm distil}$. Red indicates underestimation of distillation threshold.} \label{table:distilled_third_context} \begin{tabular}{l|cccccc} \toprule \diagbox{ $\varepsilon_{\rm distil}$ $\downarrow$}{$|\widetilde {\mathcal C}|$ $\rightarrow$} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{8} & \textbf{10} & \textbf{20} \\ \hline \hline \textbf{0 } & \color{red}{\bf 8.58e-03} & \color{red}{\bf 7.06e-03} & \color{red}{\bf 3.71e-03} & \color{red}{\bf 6.85e-03} & \color{red}{\bf 2.20e-03} & \color{red}{\bf 2.25e-02} \\ \textbf{0.01} & 1.06e-03 & 1.24e-03 & 1.37e-03 & 2.19e-03 & 2.56e-03 & \color{red}{\bf 1.60e-02} \\ \textbf{0.1 } & 1.21e-03 & 1.54e-03 & 1.70e-03 & 2.80e-03 & 3.54e-03 & 9.86e-03 \\ \bottomrule \end{tabular} \end{table} \textbf{Result C: MDP, POMDP and continual RL methods can be ineffective.} In Figure~\ref{fig:learning_curves}, we plot the learning curves for our algorithms and compare them to each other for $\chi=-1$. CEM, which is known to perform well in low-dimensional environments, learns faster than SAC. Note that there is no significant performance loss of C-SAC in comparison with the full information case exhibiting the power of our modeling approach. We evaluated FI-SAC, C-SAC, C-CEM on three seeds. \begin{figure}[ht] \centering \begin{subfigure}[b]{0.24\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/pomdp_cmpd/learning_curves_2.pdf} \caption{Learning curves}\label{fig:learning_curves} \end{subfigure} \begin{subfigure}[b]{0.2\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/pomdp_cmpd/context_estimation_hard_failure.pdf} \caption{GPMM $\chi=-1$} \label{fig:gpmm_seq_01} \end{subfigure} \begin{subfigure}[b]{0.2\textwidth} \centering \includegraphics[width=0.99\textwidth]{figures/pomdp_cmpd/context_estimation_soft_failure_05.pdf} \caption{GPMM $\chi=0.5$} \label{fig:gpmm_seq_05} \end{subfigure} \begin{subfigure}[b]{0.2\textwidth} \centering\includegraphics[width=0.99\textwidth]{figures/pomdp_cmpd/rnn_ppo_beliefs.pdf}\caption{RNN ``Beliefs''}\label{fig:rnn_beliefs} \end{subfigure} \caption{ Cart-Pole Swing-Up. Learning curves for $\chi=-1$ (a), time courses the learned context models using GPMM (b)-(c) and the learned model belief by RNN-PPO (d).} \label{fig:rnn_gpmm} \end{figure} \begin{table}[ht] \centering \begin{tabular}{l|cccc} \toprule \diagbox{algo $\downarrow$}{failure $\rightarrow$} & hard & soft $\alpha=0.1$ & soft $\alpha=0.3$ & soft $\alpha=0.5$ \\ \hline \hline FI-SAC & $84.50 \pm 1.79$ & $\mathbf{76.63 \pm 8.54}$ & $\mathbf{84.75 \pm 3.07}$ & $\mathbf{86.92 \pm 1.03}$ \\ C-SAC & $85.38 \pm 1.64$ & $\mathbf{76.80 \pm 8.91}$& $\mathbf{86.76 \pm 2.88}$& $\mathbf{88.35 \pm 1.30}$ \\ C-CEM & $\mathbf{87.63 \pm 0.14}$ & $60.15 \pm 25.91$ & $83.15 \pm 7.72$ & $\mathbf{89.08 \pm 1.90}$ \\ GPMM & $3.50 \pm 18.59$ & $3.55 \pm 7.83$ & $10.64 \pm 16.10$ & $49.61 \pm 19.13$ \\ RNN-PPO & $-0.17 \pm 18.06$ & $64.10 \pm 21.37$ & $74.58 \pm 20.66$ & $67.01 \pm 8.52$ \\ \bottomrule \end{tabular} \caption{Mean $\pm$ standard deviation of expected return for: our algorithms (C-SAC, C-CEM), a continual RL algorithm (GPMM), a POMDP algo (RNN-PPO), and SAC with a known context (FI-SAC). For soft failure experiments, we have increased the maximum applicable force by the factor of two. Best performances are highlighted in bold.} \label{tab:returns_soft_and_hard_failures} \end{table} We now compare the control algorithms for various values of $\chi$. We present the results of our experiments in Table~\ref{tab:returns_soft_and_hard_failures} and we also discuss the comparison protocols in Appendix~\ref{si_sec:comparing_to_baselines}. Here we focus on the reasons why both RNN-PPO and GPMM can fail in some experiments and seem to perform well in others. In GPMM, it is explicitly assumed that the context does not change during the episode, however, the algorithm can adapt to a new context. While {\it a posteriori} context estimation has a limited success for $\chi=0.5$ (see Figure~\ref{fig:rnn_gpmm}), the context adaptation is rather slow for our setting resulting in many context estimation errors, which reduces the performance. Furthermore, it appears that estimating hard failures is a challenge for GPMM. RNN-PPO appears to perform very well for $\chi > 0$ (see Table~\ref{tab:returns_soft_and_hard_failures}) and fail for $\chi = -1$, however, when we plot the output of the RNN, which is meant to predict the beliefs, we see that the average context prediction is quite similar across different experiments (see Figure~\ref{fig:rnn_gpmm}). It is worth noting that the mean of the true belief variable is $0.5$ for all $\chi$, as both contexts are equally probable at every time step. Therefore, the RNN approach does not actually learn a belief model, but an ``average'' adjustment signal for the policy, and hence it will often fail to solve a C-MDP. Interestingly, with $\chi = 0.5$ our modeling algorithm learns only {\bf one meaningful context} with high distillation threshold while still solving the task. This is because for both $\chi = 0.5$ and $\chi = 1$ the sign of optimal actions for swing up are the same and both have sufficient power to solve the task. We compare to further baselines in Appendix~\ref{si_sec:comparing_to_baselines}. {\bf Our model is effective for control in twelve dimensional environments (Drone and Intersection)}. In the drone environment~\citep{panerati2021learning}, the agent aims at balancing roll and pitch angles of the drone, while accelerating vertically, i.e., the task is to maximize the upward velocity. This environment has twelve states (positions, velocities, Euler angles, angular velocities in three dimensions) and four actions (motor speeds in rotation per minute). In the highway intersection environment~\citep{highway-env}, the agent aims at performing the unprotected left turn maneuver with an incoming vehicle turning in the same direction. The goal of the agent is to make the left turn and follow the social vehicle without colliding with it. The agent measures positions, velocities and headings in $x$, $y$ axes of the ego and social vehicles (twelve states in total), while controlling the steering angle and acceleration / deceleration. \begin{table}[ht] \centering \begin{tabular}{l|cccc} \toprule & FI-SAC & NI-SAC & C-SAC & C-CEM \\ \hline\hline Drone & $\mathbf{36.13 \pm 0.26}$ & $-0.80 \pm 3.08$ & $28.41 \pm 1.16$ & $32.30 \pm 2.78$ \\ Intersection & $\mathbf{572.09 \pm 20.25}$ & $499.62 \pm 19.98$ & $555.11 \pm 20.21$ & $529.75 \pm 78.12$ \\ \bottomrule \end{tabular} \caption{Mean $\pm$ standard deviation of expected return for various algorithms and tasks over three seeds. Our contextual approaches, which marked by the letter C, are competitive with FI-SAC (SAC with full context information) and outperform NI-SAC (SAC with no context information).} \label{tab:applications} \end{table} In both environments we introduce the contexts {\it by multiplying the maximum actuation effect by a constant $\chi$}, specifically, motor speeds in the drone environment and steering angle in the highway intersection environment. The results in Table~\ref{tab:applications} demonstrate that both MPC and policy learning approaches with the model are able to solve the task, while using no information (NI) about the contexts dramatically reduces the performance. Note that in the drone environment C-CEM algorithm exhibits slightly better performance than C-SAC, while in the intersection environment C-SAC controls the car much better. We can only hypothesize that the policy's feedback architecture (mapping states to actions) is better suited for complex tasks such as low-level vehicle control, where MPC approaches require a substantial tuning and computational effort to compete with a policy based approach. \section{Conclusion and Discussion} We studied a hybrid discrete-continuous variable process, where unobserved discrete variable represents the context and observed continuous variables represents the dynamics state. We proposed a variational inference algorithm for model learning using a sticky HDP prior. This prior allows for effective learning of an interpretable model and coupled with our context distillation procedure offers a powerful tool for learning C-MDPs. In particular, we showed that the combination of the HDP prior and the context distillation method allows learning the true context cardinality. We also showed that the model quality is not affected if the upper bound on context cardinality set is overestimated. Furthermore, we illustrated that the distillation threshold can be used as a regularization trade-off parameter and it can also be used to merge similar contexts in an unsupervised manner. Furthermore, we present additional experiments in Appendix suggesting that our model can potentially generalize to non-Markovian and state-dependent settings. While we presented several experiments in various environments, further experimental evaluation is required, e.g., using~\cite{benjamins2021carl}. We showed that continual and meta-RL approaches are likely to fail as their underlying assumptions on the environment do not fit our setting. The learned models do not appear to capture the complexity of Markovian context transitions. This, however, should not be surprising as these methods are tailored to a different problem: adapting existing policy / model to a new setting. If the context is very different and / or the contexts changing too fast then the continual and meta-RL algorithms would struggle by design. We derived our policy by exploiting the relation of our setting and POMDPs. We demonstrated the necessity of our model by observing that standard POMDP approaches (i.e., modeling the context dynamics using an RNN) fail to learn the model. We attribute this behavior to the lack of effective priors and model structure. While in some cases it can appear that the RNN policy is effective, disregarding the context altogether has a similar effect. Our model-based algorithm can be further enhanced by using synthetic one-step transitions similarly to~\cite{janner2019trust}, which would improve sample efficiency. We can also use an ensemble of models, which would allow to constantly improve the model using cross-validation over models in the ensemble. However, evaluation of the model quality is more involved since the context is unobservable. In future, we also plan to extend our model to account for a partially observable setting, i.e., where the state only indirectly measured similarly to POMDPs. This setting would allow for a rigorous treatment of controlling from pictures in the context-dependent setting. While we show that we can learn unseen contexts without re-learning the entire model, this procedure is not fully automated. Hence it can benefit from adaptation of continual learning methods in order to increase efficiency of the learning procedure. \bibliographystyle{iclr2022_conference}
{'timestamp': '2022-02-15T02:39:06', 'yymm': '2202', 'arxiv_id': '2202.06557', 'language': 'en', 'url': 'https://arxiv.org/abs/2202.06557'}
arxiv